From 3539d9a91e5252054806193ca812eb230df5d440 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sat, 3 Sep 2016 20:50:05 -0400 Subject: check_extra_life --- jumpmanjr.dasm | 219 ++++++++++++++++++++++++++++++--------------------------- jumpmanjr.info | 43 +++++++---- main.info | 43 +++++++---- 3 files changed, 175 insertions(+), 130 deletions(-) diff --git a/jumpmanjr.dasm b/jumpmanjr.dasm index 3b1adfc..7f48485 100644 --- a/jumpmanjr.dasm +++ b/jumpmanjr.dasm @@ -1,5 +1,5 @@ ; da65 V2.15 - Git 104f898 -; Created: 2016-09-03 18:32:45 +; Created: 2016-09-03 20:29:55 ; Input file: jumpmanjr.rom ; Page: 1 @@ -11,6 +11,7 @@ L0000 := $0000 dm_ypos := $0054 ; see draw_map and level_maps.txt dm_xpos := $0055 ; see draw_map and level_maps.txt SAVMSC := $0058 ; OS's idea of the start of screen memory [redundant to set here?] +zp_temp2 := $00AE ; used for (zp,y) addressing, also 2 temps for scores_screen bomb_idx := $00B2 ; bomb that was just picked up (times 2, suitable for index into a table of words) blistptr := $00B4 ; bomb_pickup: points to current level's bomblist bombloc := $00B6 ; bomb_pickup: position of the bomb Jumpman just touched, on 8x8 coarse grid @@ -51,8 +52,8 @@ jiffy_timer_1 := $061A ; gets incremented every frame jiffy_timer_2 := $061B ; gets incremented every frame speed_jiffy_timer:= $061E ; counts 0..initial_speed falling_flag := $0621 ; 1 = falling, reset to 0 when jumpman hits the ground -player_speed := $0624 -initial_speed := $0625 +current_speed := $0624 ; can be modified, e.g. set to $08 when being electrocuted +initial_speed := $0625 ; current user's chosen speed, set at game start bonus_jiffy_timer:= $0626 ; gets incremented every frame when playing a level, bonus-=100 when this reaches 0 playing_level := $0627 ; 0 = not playing, non-0 = playing sfx_lock := $062F ; lets other code know cue_sfx is still running? not 100% sure @@ -106,12 +107,13 @@ L06E3 := $06E3 L06E6 := $06E6 jump_frame := $06EB ; 0 if not jumping, or frames since start of jump (range 1 to 21) randomizer_mode := $06F3 ; only after beating levels 1-12 in order -number_of_players:= $06F4 ; 0 for single-player game, otherwise range 1-3 (2 to 4 players) +users_still_alive:= $06F4 ; I *think* that's what this is for. level := $06F6 speed_value := $06F9 ; decoded speed (1-8) -current_player := $06FE ; *think* this ranges 1-4, not 0-3 -score_minus_one := $06FF +current_user := $06FE ; this ranges 1-4, not 0-3 +number_of_users := $06FF ; number of players selected at start of game. also this is score-1, if you see it being 1-indexed with X reg score := $0700 ; aka work_user, 11 bytes +next_extra_life := $0703 ; initialized to $4c,$1d (aka 7500), 7500 is added whenever an extra life is given lives := $070A struct_user_1 := $070B ; 11 bytes struct_user_2 := $0716 ; 11 bytes @@ -257,9 +259,9 @@ print_number_jv: jmp print_number ; 8009 4C 00 86 L.. ; ---------------------------------------------------------------------------- -; also adds extra life every 7500 points -update_score_display_jv: - jmp update_score_display ; 800C 4C BC 8C L.. +; should be called every time the score is updated, adds extra life every 7500 points +check_extra_life_jv: + jmp check_extra_life ; 800C 4C BC 8C L.. ; ---------------------------------------------------------------------------- ; print remaining bonus time @@ -880,7 +882,7 @@ init_set_prior: sta SKCTL ; 83A1 8D 0F D2 ... sta GRACTL ; 83A4 8D 1D D0 ... lda #$09 ; 83A7 A9 09 .. - sta player_speed ; 83A9 8D 24 06 .$. + sta current_speed ; 83A9 8D 24 06 .$. lda #$4C ; 83AC A9 4C .L sta L06E0 ; 83AE 8D E0 06 ... lda #$20 ; 83B1 A9 20 . @@ -962,11 +964,11 @@ L841F: inc jiffy_timer_1 ; 841F EE 1A 06 sta $06FD ; 8438 8D FD 06 ... inc $061D ; 843B EE 1D 06 ... inc speed_jiffy_timer ; 843E EE 1E 06 ... - lda player_speed ; 8441 AD 24 06 .$. + lda current_speed ; 8441 AD 24 06 .$. cmp #$09 ; 8444 C9 09 .. bcs L847E ; 8446 B0 36 .6 lda $061D ; 8448 AD 1D 06 ... - cmp player_speed ; 844B CD 24 06 .$. + cmp current_speed ; 844B CD 24 06 .$. bcc L846E ; 844E 90 1E .. lda #$00 ; 8450 A9 00 .. sta $061D ; 8452 8D 1D 06 ... @@ -1262,7 +1264,8 @@ print_score: lda #$3D ; 866C A9 3D .= sta num_out+1 ; 866E 85 D4 .. ldx #$03 ; 8670 A2 03 .. -ps_loop:lda score_minus_one,x ; 8672 BD FF 06 ... +; number_of_users should be score-1 here. +ps_loop:lda number_of_users,x ; 8672 BD FF 06 ... sta $CF,x ; 8675 95 CF .. dex ; 8677 CA . bne ps_loop ; 8678 D0 F8 .. @@ -1298,7 +1301,7 @@ L869B: lda L86D9,x ; 869B BD D9 86 bne L869B ; 86A5 D0 F4 .. ; 1 to 4 show_current_player: - lda current_player ; 86A7 AD FE 06 ... + lda current_user ; 86A7 AD FE 06 ... ora #$10 ; 86AA 09 10 .. sta $3DE9 ; 86AC 8D E9 3D ..= lda work_level_desc ; 86AF AD 80 07 ... @@ -1323,7 +1326,8 @@ L86D3: jsr print_score ; 86D3 20 68 86 L86D9: rts ; 86D9 60 ` ; ---------------------------------------------------------------------------- -data_table_86da: +; 40 bytes, or 2 GR.1 lines of screen codes +status_window_contents: .byte $20,$30,$20,$8C,$7D,$30,$30,$20 ; 86DA 20 30 20 8C 7D 30 30 20 0 .}00 .byte $D3,$C3,$CF,$D2,$C5,$20,$20,$20 ; 86E2 D3 C3 CF D2 C5 20 20 20 ..... .byte $20,$20,$20,$20,$20,$20,$20,$20 ; 86EA 20 20 20 20 20 20 20 20 @@ -1339,15 +1343,15 @@ pnum_subtractors: clear_screen_mem: ldx #$10 ; 8714 A2 10 .. lda SAVMSC+1 ; 8716 A5 59 .Y - sta $AF ; 8718 85 AF .. + sta zp_temp2+1 ; 8718 85 AF .. lda #$00 ; 871A A9 00 .. - sta $AE ; 871C 85 AE .. + sta zp_temp2 ; 871C 85 AE .. tay ; 871E A8 . csm_loop: - sta ($AE),y ; 871F 91 AE .. + sta (zp_temp2),y ; 871F 91 AE .. iny ; 8721 C8 . bne csm_loop ; 8722 D0 FB .. - inc $AF ; 8724 E6 AF .. + inc zp_temp2+1 ; 8724 E6 AF .. dex ; 8726 CA . bne csm_loop ; 8727 D0 F6 .. rts ; 8729 60 ` @@ -1356,7 +1360,7 @@ csm_loop: ; misc stuff, called from enable_joystick prepare_level: lda #$09 ; 872A A9 09 .. - sta player_speed ; 872C 8D 24 06 .$. + sta current_speed ; 872C 8D 24 06 .$. ldx #$05 ; 872F A2 05 .. lda #$00 ; 8731 A9 00 .. sta playing_level ; 8733 8D 27 06 .'. @@ -1561,7 +1565,7 @@ erase_bomb: lda #$06 ; 887D A9 06 .. sta dm_progctr+1 ; 887F 85 C1 .. jsr draw_map_jv ; 8881 20 00 80 .. - jsr update_score_display_jv ; 8884 20 0C 80 .. + jsr check_extra_life_jv ; 8884 20 0C 80 .. dec work_level_num_bombs ; 8887 CE 8A 07 ... ; wait for bomb to really disappear wait_bomb: @@ -1646,7 +1650,7 @@ L8910: lda $06EE ; 8910 AD EE 06 bne L8945 ; 8913 D0 30 .0 inc $06EE ; 8915 EE EE 06 ... lda #$02 ; 8918 A9 02 .. - sta player_speed ; 891A 8D 24 06 .$. + sta current_speed ; 891A 8D 24 06 .$. sta $067F ; 891D 8D 7F 06 ... lda #$00 ; 8920 A9 00 .. sta playing_level ; 8922 8D 27 06 .'. @@ -1759,7 +1763,7 @@ L89FB: lda $06EF ; 89FB AD EF 06 lda #$00 ; 8A06 A9 00 .. jsr cue_music_jv ; 8A08 20 18 80 .. lda #$04 ; 8A0B A9 04 .. - sta player_speed ; 8A0D 8D 24 06 .$. + sta current_speed ; 8A0D 8D 24 06 .$. lda #$16 ; 8A10 A9 16 .. sta $0688 ; 8A12 8D 88 06 ... rts ; 8A15 60 ` @@ -1775,7 +1779,7 @@ L8A16: lda $0663 ; 8A16 AD 63 06 ; ---------------------------------------------------------------------------- L8A25: lda #$09 ; 8A25 A9 09 .. - sta player_speed ; 8A27 8D 24 06 .$. + sta current_speed ; 8A27 8D 24 06 .$. lda #$00 ; 8A2A A9 00 .. sta $0623 ; 8A2C 8D 23 06 .#. sta player_x_pos ; 8A2F 8D 7E 06 .~. @@ -1889,9 +1893,9 @@ special_init_2: lda work_level_unkn_table0+1 ; 8B32 AD 95 07 ... sta $AD ; 8B35 85 AD .. ldy #$00 ; 8B37 A0 00 .. -L8B39: lda ($AC),y ; 8B39 B1 AC .. +si_loop:lda ($AC),y ; 8B39 B1 AC .. cmp #$FF ; 8B3B C9 FF .. - beq L8B7A ; 8B3D F0 3B .; + beq si_done ; 8B3D F0 3B .; tax ; 8B3F AA . iny ; 8B40 C8 . lda ($AC),y ; 8B41 B1 AC .. @@ -1922,17 +1926,17 @@ L8B39: lda ($AC),y ; 8B39 B1 AC iny ; 8B71 C8 . lda #$00 ; 8B72 A9 00 .. sta $0696,x ; 8B74 9D 96 06 ... - jmp L8B39 ; 8B77 4C 39 8B L9. + jmp si_loop ; 8B77 4C 39 8B L9. ; ---------------------------------------------------------------------------- -L8B7A: rts ; 8B7A 60 ` +si_done:rts ; 8B7A 60 ` ; ---------------------------------------------------------------------------- pcolor0_table: .byte $07,$00,$01,$02,$03 ; 8B7B 07 00 01 02 03 ..... ; ---------------------------------------------------------------------------- ; show scores, called at end of game, also called after beating level 12 (after WELL DONE). $40 in NMIEN = disable DLI, enable VBI -end_scores_screen: +scores_screen: lda #$40 ; 8B80 A9 40 .@ sta NMIEN ; 8B82 8D 0E D4 ... lda #$82 ; 8B85 A9 82 .. @@ -1940,27 +1944,29 @@ end_scores_screen: lda #$8C ; 8B8A A9 8C .. sta dlist_shadow_hi ; 8B8C 8D AD 06 ... ldx #$06 ; 8B8F A2 06 .. -L8B91: lda scores_msg,x ; 8B91 BD 7B 8C .{. +smsg_loop: + lda scores_msg,x ; 8B91 BD 7B 8C .{. sta $3006,x ; 8B94 9D 06 30 ..0 dex ; 8B97 CA . - bne L8B91 ; 8B98 D0 F7 .. - ldx current_player ; 8B9A AE FE 06 ... + bne smsg_loop ; 8B98 D0 F7 .. + ldx current_user ; 8B9A AE FE 06 ... ldy struct_user_lives_offsets_minus_one,x; 8B9D BC 88 8C ... ldx #$03 ; 8BA0 A2 03 .. lda lives ; 8BA2 AD 0A 07 ... sta $0713,y ; 8BA5 99 13 07 ... -L8BA8: lda score_minus_one,x ; 8BA8 BD FF 06 ... +; number_of_users should be score-1 here. +ss_loop:lda number_of_users,x ; 8BA8 BD FF 06 ... sta struct_user_1,y ; 8BAB 99 0B 07 ... dey ; 8BAE 88 . dex ; 8BAF CA . - bne L8BA8 ; 8BB0 D0 F6 .. + bne ss_loop ; 8BB0 D0 F6 .. lda #$00 ; 8BB2 A9 00 .. sta $AA ; 8BB4 85 AA .. sta $AB ; 8BB6 85 AB .. tay ; 8BB8 A8 . - lda number_of_players ; 8BB9 AD F4 06 ... - sta $AE ; 8BBC 85 AE .. - inc $AE ; 8BBE E6 AE .. + lda users_still_alive ; 8BB9 AD F4 06 ... + sta zp_temp2 ; 8BBC 85 AE .. + inc zp_temp2 ; 8BBE E6 AE .. ; shows PLAYER (backwards loop) show_reyalp_msg: ldx #$14 ; 8BC0 A2 14 .. @@ -1985,7 +1991,7 @@ continue_loop: lda #$00 ; 8BE0 A9 00 .. ; $AF is the character to show after the score (space for alive, cross for dead) store_space: - sta $AF ; 8BE2 85 AF .. + sta zp_temp2+1 ; 8BE2 85 AF .. lda $0713,y ; 8BE4 B9 13 07 ... cmp #$FF ; 8BE7 C9 FF .. ; user still has lives left? @@ -1994,7 +2000,7 @@ check_alive: ; no, show a cross instead of a space not_alive: lda #$5E ; 8BEB A9 5E .^ - sta $AF ; 8BED 85 AF .. + sta zp_temp2+1 ; 8BED 85 AF .. no_cross: lda L8C84,x ; 8BEF BD 84 8C ... sta num_out ; 8BF2 85 D3 .. @@ -2007,11 +2013,11 @@ L8BFA: lda struct_user_1,y ; 8BFA B9 0B 07 dex ; 8C00 CA . bne L8BFA ; 8C01 D0 F7 .. jsr print_number_jv ; 8C03 20 09 80 .. - lda $AF ; 8C06 A5 AF .. + lda zp_temp2+1 ; 8C06 A5 AF .. iny ; 8C08 C8 . sta (num_out),y ; 8C09 91 D3 .. ldy $AD ; 8C0B A4 AD .. - dec $AE ; 8C0D C6 AE .. + dec zp_temp2 ; 8C0D C6 AE .. bne show_reyalp_msg ; 8C0F D0 AF .. lda #$96 ; 8C11 A9 96 .. sta COLOR3 ; 8C13 8D C7 02 ... @@ -2080,7 +2086,7 @@ struct_user_lives_offsets: ; used by score screen score_screen_dli_sr: pha ; 8C8D 48 H - lda current_player ; 8C8E AD FE 06 ... + lda current_user ; 8C8E AD FE 06 ... sec ; 8C91 38 8 sbc #$01 ; 8C92 E9 01 .. sta WSYNC ; 8C94 8D 0A D4 ... @@ -2104,35 +2110,42 @@ L8CAA: inc $AB ; 8CAA E6 AB zero_filler_8cb4: .byte $00,$00,$00,$00,$00,$00,$00,$00 ; 8CB4 00 00 00 00 00 00 00 00 ........ ; ---------------------------------------------------------------------------- -; also adds extra life every 7500 points -update_score_display: +; should be called every time the score is updated, adds extra life every 7500 points. notice the score and threshold are both 3 bytes, and we compare from high byte to low. +check_extra_life: ldx #$03 ; 8CBC A2 03 .. -L8CBE: lda score_minus_one,x ; 8CBE BD FF 06 ... +; number_of_users should be score-1 here. score+2 should be next_extra_life-1 also. +chk_next_byte: + lda number_of_users,x ; 8CBE BD FF 06 ... cmp score+2,x ; 8CC1 DD 02 07 ... - bcc L8CFA ; 8CC4 90 34 .4 - beq L8CCB ; 8CC6 F0 03 .. - jmp show_l_equals ; 8CC8 4C CE 8C L.. + bcc chk_done ; 8CC4 90 34 .4 + beq score_byte_ge ; 8CC6 F0 03 .. + jmp add_extra_life ; 8CC8 4C CE 8C L.. ; ---------------------------------------------------------------------------- -L8CCB: dex ; 8CCB CA . - bne L8CBE ; 8CCC D0 F0 .. -; L= (for lives display) -show_l_equals: +; if it's greater or equal and X!=0, keep looping +score_byte_ge: + dex ; 8CCB CA . + bne chk_next_byte ; 8CCC D0 F0 .. +; first, calculate & store the next 7500-point target +add_extra_life: ldx #$00 ; 8CCE A2 00 .. clc ; 8CD0 18 . -L8CD1: lda l_equals,x ; 8CD1 BD FD 8C ... - adc $0703,x ; 8CD4 7D 03 07 }.. - sta $0703,x ; 8CD7 9D 03 07 ... +add_next_byte: + lda extra_life_points,x ; 8CD1 BD FD 8C ... + adc next_extra_life,x ; 8CD4 7D 03 07 }.. + sta next_extra_life,x ; 8CD7 9D 03 07 ... inx ; 8CDA E8 . +; we have to preserve the carry flag! +save_flags: php ; 8CDB 08 . cpx #$03 ; 8CDC E0 03 .. - beq add_extra_life ; 8CDE F0 04 .. + beq inc_lives ; 8CDE F0 04 .. plp ; 8CE0 28 ( - jmp L8CD1 ; 8CE1 4C D1 8C L.. + jmp add_next_byte ; 8CE1 4C D1 8C L.. ; ---------------------------------------------------------------------------- -; plays sfx_extra_life -add_extra_life: +; add 1 life, play sfx_extra_life +inc_lives: plp ; 8CE4 28 ( inc lives ; 8CE5 EE 0A 07 ... lda #$79 ; 8CE8 A9 79 .y @@ -2142,11 +2155,12 @@ add_extra_life: lda #$0C ; 8CF2 A9 0C .. jsr cue_sfx_jv ; 8CF4 20 06 80 .. jsr show_lives_icons ; 8CF7 20 BB 86 .. -L8CFA: jmp score_mod_1m ; 8CFA 4C C0 B7 L.. +chk_done: + jmp score_mod_1m ; 8CFA 4C C0 B7 L.. ; ---------------------------------------------------------------------------- -; L= (for lives display) -l_equals: +; 3 bytes, value 7500 decimal, give an extra life after this many points. not copied to RAM, meaning no level can change this. +extra_life_points: .byte $4C,$1D,$00 ; 8CFD 4C 1D 00 L.. ; ---------------------------------------------------------------------------- ; just lost your last life @@ -2193,7 +2207,7 @@ well_done_scores: lda #$00 ; 8D52 A9 00 .. sta AUDF1 ; 8D54 8D 00 D2 ... sta AUDC1 ; 8D57 8D 01 D2 ... - jsr end_scores_screen ; 8D5A 20 80 8B .. + jsr scores_screen ; 8D5A 20 80 8B .. jmp afterlife ; 8D5D 4C 00 96 L.. ; ---------------------------------------------------------------------------- @@ -2201,15 +2215,15 @@ L8D60: clc ; 8D60 18 adc #$70 ; 8D61 69 70 ip sta $AC ; 8D63 85 AC .. adc #$28 ; 8D65 69 28 i( - sta $AE ; 8D67 85 AE .. + sta zp_temp2 ; 8D67 85 AE .. lda #$3D ; 8D69 A9 3D .= sta $AD ; 8D6B 85 AD .. - sta $AF ; 8D6D 85 AF .. + sta zp_temp2+1 ; 8D6D 85 AF .. lda #$57 ; 8D6F A9 57 .W sta $AB ; 8D71 85 AB .. ldy #$00 ; 8D73 A0 00 .. L8D75: lda ($AC),y ; 8D75 B1 AC .. - sta ($AE),y ; 8D77 91 AE .. + sta (zp_temp2),y ; 8D77 91 AE .. sec ; 8D79 38 8 lda $AC ; 8D7A A5 AC .. sbc #$28 ; 8D7C E9 28 .( @@ -2217,15 +2231,15 @@ L8D75: lda ($AC),y ; 8D75 B1 AC bcs L8D84 ; 8D80 B0 02 .. dec $AD ; 8D82 C6 AD .. L8D84: sec ; 8D84 38 8 - lda $AE ; 8D85 A5 AE .. + lda zp_temp2 ; 8D85 A5 AE .. sbc #$28 ; 8D87 E9 28 .( - sta $AE ; 8D89 85 AE .. + sta zp_temp2 ; 8D89 85 AE .. bcs L8D8F ; 8D8B B0 02 .. - dec $AF ; 8D8D C6 AF .. + dec zp_temp2+1 ; 8D8D C6 AF .. L8D8F: dec $AB ; 8D8F C6 AB .. bne L8D75 ; 8D91 D0 E2 .. tya ; 8D93 98 . - sta ($AE),y ; 8D94 91 AE .. + sta (zp_temp2),y ; 8D94 91 AE .. rts ; 8D96 60 ` ; ---------------------------------------------------------------------------- @@ -2242,7 +2256,7 @@ L8DA0: lda level ; 8DA0 AD F6 06 L8DAA: jsr well_done_screen ; 8DAA 20 00 BC .. lda #$04 ; 8DAD A9 04 .. sta $0688 ; 8DAF 8D 88 06 ... - jsr end_scores_screen ; 8DB2 20 80 8B .. + jsr scores_screen ; 8DB2 20 80 8B .. jmp afterlife ; 8DB5 4C 00 96 L.. ; ---------------------------------------------------------------------------- @@ -2298,7 +2312,7 @@ sfx_bonus_tick: ; ---------------------------------------------------------------------------- level_finished: lda #$09 ; 8E00 A9 09 .. - sta player_speed ; 8E02 8D 24 06 .$. + sta current_speed ; 8E02 8D 24 06 .$. sta $067F ; 8E05 8D 7F 06 ... lda #$80 ; 8E08 A9 80 .. sta num_color ; 8E0A 85 D5 .. @@ -2320,7 +2334,7 @@ lt_64k: lda #$00 ; 8E27 A9 00 sta AUDC1 ; 8E2E 8D 01 D2 ... sta jiffy_timer_1 ; 8E31 8D 1A 06 ... sta playing_level ; 8E34 8D 27 06 .'. - jsr update_score_display_jv ; 8E37 20 0C 80 .. + jsr check_extra_life_jv ; 8E37 20 0C 80 .. ; 533ms ntsc, 640ms pal wait_32_jiffies: lda jiffy_timer_1 ; 8E3A AD 1A 06 ... @@ -3073,8 +3087,8 @@ wait_opt_key_sfx: get_player_speeds: lda $B8 ; 94DE A5 B8 .. sta $B9 ; 94E0 85 B9 .. - sta score_minus_one ; 94E2 8D FF 06 ... - sta number_of_players ; 94E5 8D F4 06 ... + sta number_of_users ; 94E2 8D FF 06 ... + sta users_still_alive ; 94E5 8D F4 06 ... lda #$00 ; 94E8 A9 00 .. sta $B8 ; 94EA 85 B8 .. ; disable start and option keys @@ -3096,7 +3110,7 @@ psprompt_loop: cpx #$14 ; 9503 E0 14 .. bne psprompt_loop ; 9505 D0 F4 .. lda $BA ; 9507 A5 BA .. - sta current_player ; 9509 8D FE 06 ... + sta current_user ; 9509 8D FE 06 ... ora #$90 ; 950C 09 90 .. inc $BA ; 950E E6 BA .. sta $3821,y ; 9510 99 21 38 .!8 @@ -3143,10 +3157,10 @@ display_speed: inc $B8 ; 954A E6 B8 .. dec $BA ; 954C C6 BA .. bne init_speed ; 954E D0 DA .. - inc score_minus_one ; 9550 EE FF 06 ... - lda score_minus_one ; 9553 AD FF 06 ... - sta current_player ; 9556 8D FE 06 ... - inc current_player ; 9559 EE FE 06 ... + inc number_of_users ; 9550 EE FF 06 ... + lda number_of_users ; 9553 AD FF 06 ... + sta current_user ; 9556 8D FE 06 ... + inc current_user ; 9559 EE FE 06 ... jmp afterlife ; 955C 4C 00 96 L.. ; ---------------------------------------------------------------------------- @@ -3237,7 +3251,7 @@ L9616: lda #$00 ; 9616 A9 00 ; ---------------------------------------------------------------------------- ; only in multiplayer games show_get_ready_prompt: - ldx current_player ; 9624 AE FE 06 ... + ldx current_user ; 9624 AE FE 06 ... lda color0_table_minus_one,x ; 9627 BD 27 97 .'. sta COLOR4 ; 962A 8D C8 02 ... sta COLOR0 ; 962D 8D C4 02 ... @@ -3246,7 +3260,7 @@ L9632: lda L9713,y ; 9632 B9 13 97 sta $0741,y ; 9635 99 41 07 .A. dey ; 9638 88 . bne L9632 ; 9639 D0 F7 .. - lda current_player ; 963B AD FE 06 ... + lda current_user ; 963B AD FE 06 ... ora #$10 ; 963E 09 10 .. sta $074A ; 9640 8D 4A 07 .J. lda #$00 ; 9643 A9 00 .. @@ -3350,7 +3364,7 @@ L96F2: lda COLOR0 ; 96F2 AD C4 02 rts ; 96FE 60 ` ; ---------------------------------------------------------------------------- -L96FF: ldx current_player ; 96FF AE FE 06 ... +L96FF: ldx current_user ; 96FF AE FE 06 ... lda color0_table_minus_one,x ; 9702 BD 27 97 .'. sta COLOR0 ; 9705 8D C4 02 ... rts ; 9708 60 ` @@ -3465,7 +3479,7 @@ mj_done:lda #$00 ; 97DB A9 00 sta AUDC4 ; 97E0 8D 07 D2 ... sta $0623 ; 97E3 8D 23 06 .#. lda initial_speed ; 97E6 AD 25 06 .%. - sta player_speed ; 97E9 8D 24 06 .$. + sta current_speed ; 97E9 8D 24 06 .$. inc playing_level ; 97EC EE 27 06 .'. rts ; 97EF 60 ` @@ -3828,7 +3842,7 @@ struct_users_init_contents: ; ---------------------------------------------------------------------------- ; multiply current player number by 11, return result in Y mul_player_11: - ldx current_player ; 9A7C AE FE 06 ... + ldx current_user ; 9A7C AE FE 06 ... lda #$00 ; 9A7F A9 00 .. clc ; 9A81 18 . add_11: dex ; 9A82 CA . @@ -3875,15 +3889,15 @@ next_player: sta $06F8 ; 9AB5 8D F8 06 ... ; wraparound to 1 if > total users next_user_num: - inc current_player ; 9AB8 EE FE 06 ... - lda score_minus_one ; 9ABB AD FF 06 ... - cmp current_player ; 9ABE CD FE 06 ... + inc current_user ; 9AB8 EE FE 06 ... + lda number_of_users ; 9ABB AD FF 06 ... + cmp current_user ; 9ABE CD FE 06 ... bcs look_for_alive ; 9AC1 B0 08 .. lda #$01 ; 9AC3 A9 01 .. - sta current_player ; 9AC5 8D FE 06 ... + sta current_user ; 9AC5 8D FE 06 ... sta $06F7 ; 9AC8 8D F7 06 ... look_for_alive: - ldx number_of_players ; 9ACB AE F4 06 ... + ldx users_still_alive ; 9ACB AE F4 06 ... inx ; 9ACE E8 . ldy mul_11_table_minus_one,x ; 9ACF BC FB 9A ... is_user_dead: @@ -3902,7 +3916,7 @@ is_user_dead: ; ---------------------------------------------------------------------------- ; if user hasn't been eliminated, but is out of lives, eliminate him check_lives: - stx score_minus_one ; 9AE5 8E FF 06 ... + stx number_of_users ; 9AE5 8E FF 06 ... jsr mul_player_11 ; 9AE8 20 7C 9A |. jsr load_struct_user ; 9AEB 20 9B 9A .. lda lives ; 9AEE AD 0A 07 ... @@ -4040,7 +4054,7 @@ random_9b: zero_filler_9bcc: .byte $00,$00,$00,$00 ; 9BCC 00 00 00 00 .... ; ---------------------------------------------------------------------------- -L9BD0: lda number_of_players ; 9BD0 AD F4 06 ... +L9BD0: lda users_still_alive ; 9BD0 AD F4 06 ... cmp #$00 ; 9BD3 C9 00 .. beq L9BDA ; 9BD5 F0 03 .. jmp show_get_ready_prompt ; 9BD7 4C 24 96 L$. @@ -5677,7 +5691,7 @@ LA4E8: ldx #$01 ; A4E8 A2 01 and #$03 ; A4F5 29 03 ). bne LA505 ; A4F7 D0 0C .. lda initial_speed ; A4F9 AD 25 06 .%. - sta player_speed ; A4FC 8D 24 06 .$. + sta current_speed ; A4FC 8D 24 06 .$. LA4FF: lda #$00 ; A4FF A9 00 .. sta $0770 ; A501 8D 70 07 .p. rts ; A504 60 ` @@ -5698,7 +5712,7 @@ LA50F: lda RANDOM ; A50F AD 0A D2 sta COLPM1,x ; A512 9D 13 D0 ... sta COLPM0 ; A515 8D 12 D0 ... lda #$08 ; A518 A9 08 .. - sta player_speed ; A51A 8D 24 06 .$. + sta current_speed ; A51A 8D 24 06 .$. lda #$2D ; A51D A9 2D .- sta sfx_slot_tempo ; A51F 8D 3E 06 .>. lda #$A5 ; A522 A9 A5 .. @@ -6478,7 +6492,7 @@ spellbound_letters: ; got all the bombs spellbound_got_all: lda #$09 ; AF5E A9 09 .. - sta player_speed ; AF60 8D 24 06 .$. + sta current_speed ; AF60 8D 24 06 .$. lda #$00 ; AF63 A9 00 .. sta playing_level ; AF65 8D 27 06 .'. ldx #$0C ; AF68 A2 0C .. @@ -6527,7 +6541,7 @@ bonus_250_pts: b250_hi_ok: txa ; AFB4 8A . pha ; AFB5 48 H - jsr update_score_display_jv ; AFB6 20 0C 80 .. + jsr check_extra_life_jv ; AFB6 20 0C 80 .. ; play sfx_letter_bonus cue_letter_sfx: lda #$CB ; AFB9 A9 CB .. @@ -7075,7 +7089,7 @@ LB69A: rts ; B69A 60 ; ---------------------------------------------------------------------------- hurr_sub1: - lda player_speed ; B69B AD 24 06 .$. + lda current_speed ; B69B AD 24 06 .$. cmp #$09 ; B69E C9 09 .. bcs LB6A9 ; B6A0 B0 07 .. lda $0623 ; B6A2 AD 23 06 .#. @@ -7260,7 +7274,7 @@ LB851: clc ; B851 18 lda work_level_time_bonus+1 ; B85A AD 92 07 ... adc $A5 ; B85D 65 A5 e. sta work_level_time_bonus+1 ; B85F 8D 92 07 ... - jsr update_score_display_jv ; B862 20 0C 80 .. + jsr check_extra_life_jv ; B862 20 0C 80 .. jsr print_bonus_jv ; B865 20 0F 80 .. ; play once per life play_life_bonus_sfx: @@ -7593,7 +7607,7 @@ LBC5E: lda jiffy_timer_1 ; BC5E AD 1A 06 lda #$BC ; BC6F A9 BC .. sta work_level_sub0+1 ; BC71 8D 83 07 ... lda #$05 ; BC74 A9 05 .. - sta player_speed ; BC76 8D 24 06 .$. + sta current_speed ; BC76 8D 24 06 .$. lda #$0D ; BC79 A9 0D .. sta joystick_disabled ; BC7B 8D 32 06 .2. lda #$00 ; BC7E A9 00 .. @@ -7622,10 +7636,11 @@ LBCA3: lda total_score_msg_minus_one,x ; BCA3 BD D1 BD lda #$F5 ; BCB0 A9 F5 .. sta num_out ; BCB2 85 D3 .. ldx #$03 ; BCB4 A2 03 .. -LBCB6: lda score_minus_one,x ; BCB6 BD FF 06 ... +; display current user's score, number_of_users should be score-1 here. +wd_xxx: lda number_of_users,x ; BCB6 BD FF 06 ... sta $CF,x ; BCB9 95 CF .. dex ; BCBB CA . - bne LBCB6 ; BCBC D0 F8 .. + bne wd_xxx ; BCBC D0 F8 .. jsr print_number_jv ; BCBE 20 09 80 .. LBCC1: lda $0663 ; BCC1 AD 63 06 .c. bne LBCC1 ; BCC4 D0 FB .. @@ -7693,7 +7708,7 @@ LBD81: lda #$E6 ; BD81 A9 E6 lda #$06 ; BD86 A9 06 .. sta work_level_sub1+1 ; BD88 8D 85 07 ... lda #$09 ; BD8B A9 09 .. - sta player_speed ; BD8D 8D 24 06 .$. + sta current_speed ; BD8D 8D 24 06 .$. lda #$C6 ; BD90 A9 C6 .. sta player_y_pos ; BD92 8D 83 06 ... lda #$00 ; BD95 A9 00 .. diff --git a/jumpmanjr.info b/jumpmanjr.info index 852e4b1..d50c63a 100644 --- a/jumpmanjr.info +++ b/jumpmanjr.info @@ -48,8 +48,9 @@ label { name "dli_chained_1"; addr $9B72; comment "changes DLI vector to point t label { name "dli_chained_2"; addr $9B87; comment "changes DLI vector to point to dli_chained_3"; }; label { name "dli_chained_3"; addr $9BB1; comment "changes DLI vector to point to dli_chained_1"; }; label { name "update_color_regs"; addr $840F; comment "update color regs from shadow regs (X ranges 1 to 9, GRAFM+1 is COLPM0, $2bf+1 is PCOLR0)"; }; -label { name "update_score_display"; addr $8CBC; comment "also adds extra life every 7500 points"; }; -label { name "update_score_display_jv"; addr $800C; comment "also adds extra life every 7500 points"; }; +label { name "save_flags"; addr $8CDB; comment "we have to preserve the carry flag!"; }; +label { name "check_extra_life"; addr $8CBC; comment "should be called every time the score is updated, adds extra life every 7500 points. notice the score and threshold are both 3 bytes, and we compare from high byte to low."; }; +label { name "check_extra_life_jv"; addr $800C; comment "should be called every time the score is updated, adds extra life every 7500 points"; }; label { name "score_mod_1m"; addr $B7C0; comment "roll over the score if it's >= 1 million"; }; label { name "score_below_1m"; addr $B7EE; }; label { name "spellbound_letters"; addr $AF58; comment "called at end of Spellbound, adds up letter bonus"; }; @@ -123,6 +124,8 @@ label { name "check_collisions_3"; addr $9832; size 1; comment "movement/jumping label { name "special_init"; addr $8B23; comment "various levels use this as their init, or use an init that calls this"; }; label { name "special_init_jv"; addr $8036; comment "various levels use this as their init, or use an init that calls this"; }; label { name "si_clear"; addr $8B27; comment "clear memory from $0760 to $077f"; }; +label { name "si_done"; addr $8B7A; }; +label { name "si_loop"; addr $8B39; }; label { name "special_init_2"; addr $8B2D; comment "special_init that doesn't clear memory. does anything use this entry point?"; }; label { name "special_init_2_jv"; addr $8039; comment "special_init that doesn't clear memory. unused vector?"; }; label { name "next_player"; addr $9AAA; comment "used in multiplayer games, also called in single player (?)"; }; @@ -322,7 +325,7 @@ range { name "mul_25_table"; start $b8a7; end $b8be; type wordtable; comment "mu range { name "falling_table_1"; start $8a39; end $8a7f; type bytetable; }; label { name "falling_table_2"; addr $8A42; }; label { name "play_sfx_death"; addr $8936; }; -range { name "data_table_86da"; start $86da; end $8713; type bytetable; }; +range { name "status_window_contents"; start $86da; end $8713; type bytetable; comment "40 bytes, or 2 GR.1 lines of screen codes"; }; label { name "pnum_subtractors"; addr $8702; size 18; comment "3 bytes per table entry"; }; range { name "level_name_hscrol_table"; start $BBF0; end $BBff; type bytetable; comment "used for centering level name on gameboard"; }; range { name "zero_filler_b8bf"; start $b8bf; end $b96a; type bytetable; }; @@ -343,6 +346,7 @@ range { name "code_bccd"; start $bccd; end $bcd8; type code; comment "dunno, but range { name "well_done_map"; start $bcd9; end $bd51; type bytetable; comment "level map used for the WELL DONE screen, when you beat level 12"; }; label { name "well_done_scores"; addr $8D52; comment "well_done_screen jumps here via work_level_sub1"; }; label { name "wd_wait_scores"; addr $BC92; comment "wait for score screen to finish (I think, anyway)"; }; +label { name "wd_xxx"; addr $BCB6; comment "display current user's score, number_of_users should be score-1 here."; }; range { name "well_done_shape"; start $bda0; end $bdc6; type bytetable; comment "used to draw the large WELL DONE banner"; }; label { name "total_score_msg_minus_one"; addr $bdd1; comment "1-indexed"; }; label { name "dumbwaiter_sub0"; addr $A6BD; comment "gets called every frame"; }; @@ -583,7 +587,9 @@ label { name "title_screen_data_minus_one"; addr $91ce; }; label { name "copy_title_screen"; addr $902A; }; label { name "wait_until_9c_is_0e"; addr $906E; comment "some ISR is writing to $9c..."; }; label { name "funky_init_loop"; addr $90C8; comment "lot going on here, not understood yet"; }; -label { name "end_scores_screen"; addr $8B80; comment "show scores, called at end of game, also called after beating level 12 (after WELL DONE). $40 in NMIEN = disable DLI, enable VBI"; }; +label { name "scores_screen"; addr $8B80; comment "show scores, called at end of game, also called after beating level 12 (after WELL DONE). $40 in NMIEN = disable DLI, enable VBI"; }; +label { name "ss_loop"; addr $8BA8; comment "number_of_users should be score-1 here."; }; +label { name "smsg_loop"; addr $8B91; }; label { name "read_joystick"; addr $84AC; comment "always joystick #1 (all players use the same joystick and pass it around)"; }; label { name "check_joystick_enabled"; addr $84A4; comment "read the joystick if not disabled"; }; label { name "fake_read_trigger"; addr $84CD; comment "??"; }; @@ -603,19 +609,23 @@ label { name "init_hardware"; addr $837c; }; label { name "init_page6_loop"; addr $837e; }; # these are so far only for player 1 -label { name "number_of_players"; addr $06f4; size 1; comment "0 for single-player game, otherwise range 1-3 (2 to 4 players)"; }; -label { name "score_minus_one"; addr $06ff; size 1; }; -label { name "score"; addr $0700; size 3; comment "aka work_user, 11 bytes"; }; +label { name "users_still_alive"; addr $06f4; size 1; comment "I *think* that's what this is for."; }; +label { name "number_of_users"; addr $06ff; size 1; comment "number of players selected at start of game. also this is score-1, if you see it being 1-indexed with X reg"; }; label { name "level"; addr $06f6; size 1; }; + +# this stuff is also going to be called work_user (an 11-byte struct) +label { name "score"; addr $0700; size 3; comment "aka work_user, 11 bytes"; }; +label { name "next_extra_life"; addr $0703; size 3; comment "initialized to $4c,$1d (aka 7500), 7500 is added whenever an extra life is given"; }; label { name "lives"; addr $070a; size 1; }; + label { name "struct_user_1"; addr $070b; comment "11 bytes"; }; label { name "struct_user_2"; addr $0716; comment "11 bytes"; }; label { name "struct_user_3"; addr $0721; comment "11 bytes"; }; label { name "struct_user_4"; addr $072c; comment "11 bytes"; }; -label { name "current_player"; addr $06fe; size 1; comment "*think* this ranges 1-4, not 0-3"; }; -label { name "player_speed"; addr $0624; size 1; }; -label { name "initial_speed"; addr $0625; size 1; }; +label { name "current_user"; addr $06fe; size 1; comment "this ranges 1-4, not 0-3"; }; +label { name "current_speed"; addr $0624; size 1; comment "can be modified, e.g. set to $08 when being electrocuted"; }; +label { name "initial_speed"; addr $0625; size 1; comment "current user's chosen speed, set at game start"; }; label { name "setup_dli_2"; addr $bc3f; size 1; comment "load dli_service_2 address into dli shadow"; }; label { name "silence_audio"; addr $875B; size 1; comment "set all AUDFx to 0"; }; label { name "sa_loop"; addr $875F; size 1; }; @@ -660,6 +670,7 @@ label { name "start_key_enabled"; addr $06C8; size 1; comment "non-zero = jump t label { name "select_key_enabled"; addr $06C7; size 1; comment "non-zero = jump through start_key_vec if start key pressed (checked by vblank_imm_isr)"; }; label { name "option_key_enabled"; addr $06C6; size 1; comment "non-zero = jump through start_key_vec if start key pressed (checked by vblank_imm_isr)"; }; label { name "zp_temp1"; addr $cb; size 2; comment "used for (zp,y) addressing, also for checking console keys in vblank_imm_isr"; }; +label { name "zp_temp2"; addr $ae; size 2; comment "used for (zp,y) addressing, also 2 temps for scores_screen"; }; label { name "hang_main_thread"; addr $9486; size 1; comment "initialization done, everything's done in interrupts from here on out"; }; label { name "option_key_handler"; addr $9489; size 1; comment "called via option_key_vec when someone presses option"; }; @@ -722,9 +733,13 @@ label { name "isu_next_su"; addr $9A5E; }; label { name "isu_next_byte"; addr $9A60; }; range { name "struct_users_init_contents"; start $9A71; end $9a7b; type bytetable; comment "work_user and struct_user_1 to _4 are initialized to this"; }; range { name "data_af10"; start $AF10; end $AF1B; type bytetable; comment "looks almost like code but it's bogus"; }; -range { name "l_equals"; start $8CFD; end $8CFF; type bytetable; comment "L= (for lives display)"; }; -label { name "add_extra_life"; addr $8CE4; comment "plays sfx_extra_life"; }; -label { name "show_l_equals"; addr $8CCE; comment "L= (for lives display)"; }; +range { name "extra_life_points"; start $8CFD; end $8CFF; type bytetable; comment "3 bytes, value 7500 decimal, give an extra life after this many points. not copied to RAM, meaning no level can change this."; }; +label { name "chk_next_byte"; addr $8CBE; comment "number_of_users should be score-1 here. score+2 should be next_extra_life-1 also."; }; +label { name "chk_done"; addr $8CFA; }; +label { name "add_extra_life"; addr $8CCE; comment "first, calculate & store the next 7500-point target"; }; +label { name "add_next_byte"; addr $8CD1; }; +label { name "score_byte_ge"; addr $8CCB; comment "if it's greater or equal and X!=0, keep looping"; }; +label { name "inc_lives"; addr $8CE4; comment "add 1 life, play sfx_extra_life"; }; label { name "show_lives_icons"; addr $86BB; comment "up to 6 jumpmen, and a + if lives > 6. char $C1 = jumpman icon, $CB = plus sign"; }; label { name "show_current_player"; addr $86A7; comment "1 to 4"; }; label { name "update_status_window"; addr $8694; comment "bottom 2 GR.1 lines on the game board"; }; @@ -743,7 +758,7 @@ label { name "print_bonus_jv"; addr $800F; comment "print remaining bonus time"; label { name "pnum_done"; addr $8667; }; label { name "next_digit"; addr $8607; comment "starts at 0, gets added to"; }; label { name "print_score"; addr $8668; }; -label { name "ps_loop"; addr $8672; }; +label { name "ps_loop"; addr $8672; comment "number_of_users should be score-1 here."; }; label { name "pb_loop"; addr $8688; }; label { name "draw_map"; addr $8049; comment "the entry point for parsing the level map and drawing graphics from it. see level_maps.txt. caller must set $C0/$C1 to the address of the map data. modders beware: bogus map data can & will cause infinite loops."; }; label { name "draw_map_jv"; addr $8000; comment "the entry point for parsing the level map and drawing graphics from it. see level_maps.txt."; }; diff --git a/main.info b/main.info index ff22455..c1f7a77 100644 --- a/main.info +++ b/main.info @@ -46,8 +46,9 @@ label { name "dli_chained_1"; addr $9B72; comment "changes DLI vector to point t label { name "dli_chained_2"; addr $9B87; comment "changes DLI vector to point to dli_chained_3"; }; label { name "dli_chained_3"; addr $9BB1; comment "changes DLI vector to point to dli_chained_1"; }; label { name "update_color_regs"; addr $840F; comment "update color regs from shadow regs (X ranges 1 to 9, GRAFM+1 is COLPM0, $2bf+1 is PCOLR0)"; }; -label { name "update_score_display"; addr $8CBC; comment "also adds extra life every 7500 points"; }; -label { name "update_score_display_jv"; addr $800C; comment "also adds extra life every 7500 points"; }; +label { name "save_flags"; addr $8CDB; comment "we have to preserve the carry flag!"; }; +label { name "check_extra_life"; addr $8CBC; comment "should be called every time the score is updated, adds extra life every 7500 points. notice the score and threshold are both 3 bytes, and we compare from high byte to low."; }; +label { name "check_extra_life_jv"; addr $800C; comment "should be called every time the score is updated, adds extra life every 7500 points"; }; label { name "score_mod_1m"; addr $B7C0; comment "roll over the score if it's >= 1 million"; }; label { name "score_below_1m"; addr $B7EE; }; label { name "spellbound_letters"; addr $AF58; comment "called at end of Spellbound, adds up letter bonus"; }; @@ -121,6 +122,8 @@ label { name "check_collisions_3"; addr $9832; size 1; comment "movement/jumping label { name "special_init"; addr $8B23; comment "various levels use this as their init, or use an init that calls this"; }; label { name "special_init_jv"; addr $8036; comment "various levels use this as their init, or use an init that calls this"; }; label { name "si_clear"; addr $8B27; comment "clear memory from $0760 to $077f"; }; +label { name "si_done"; addr $8B7A; }; +label { name "si_loop"; addr $8B39; }; label { name "special_init_2"; addr $8B2D; comment "special_init that doesn't clear memory. does anything use this entry point?"; }; label { name "special_init_2_jv"; addr $8039; comment "special_init that doesn't clear memory. unused vector?"; }; label { name "next_player"; addr $9AAA; comment "used in multiplayer games, also called in single player (?)"; }; @@ -320,7 +323,7 @@ range { name "mul_25_table"; start $b8a7; end $b8be; type wordtable; comment "mu range { name "falling_table_1"; start $8a39; end $8a7f; type bytetable; }; label { name "falling_table_2"; addr $8A42; }; label { name "play_sfx_death"; addr $8936; }; -range { name "data_table_86da"; start $86da; end $8713; type bytetable; }; +range { name "status_window_contents"; start $86da; end $8713; type bytetable; comment "40 bytes, or 2 GR.1 lines of screen codes"; }; label { name "pnum_subtractors"; addr $8702; size 18; comment "3 bytes per table entry"; }; range { name "level_name_hscrol_table"; start $BBF0; end $BBff; type bytetable; comment "used for centering level name on gameboard"; }; range { name "zero_filler_b8bf"; start $b8bf; end $b96a; type bytetable; }; @@ -341,6 +344,7 @@ range { name "code_bccd"; start $bccd; end $bcd8; type code; comment "dunno, but range { name "well_done_map"; start $bcd9; end $bd51; type bytetable; comment "level map used for the WELL DONE screen, when you beat level 12"; }; label { name "well_done_scores"; addr $8D52; comment "well_done_screen jumps here via work_level_sub1"; }; label { name "wd_wait_scores"; addr $BC92; comment "wait for score screen to finish (I think, anyway)"; }; +label { name "wd_xxx"; addr $BCB6; comment "display current user's score, number_of_users should be score-1 here."; }; range { name "well_done_shape"; start $bda0; end $bdc6; type bytetable; comment "used to draw the large WELL DONE banner"; }; label { name "total_score_msg_minus_one"; addr $bdd1; comment "1-indexed"; }; label { name "dumbwaiter_sub0"; addr $A6BD; comment "gets called every frame"; }; @@ -581,7 +585,9 @@ label { name "title_screen_data_minus_one"; addr $91ce; }; label { name "copy_title_screen"; addr $902A; }; label { name "wait_until_9c_is_0e"; addr $906E; comment "some ISR is writing to $9c..."; }; label { name "funky_init_loop"; addr $90C8; comment "lot going on here, not understood yet"; }; -label { name "end_scores_screen"; addr $8B80; comment "show scores, called at end of game, also called after beating level 12 (after WELL DONE). $40 in NMIEN = disable DLI, enable VBI"; }; +label { name "scores_screen"; addr $8B80; comment "show scores, called at end of game, also called after beating level 12 (after WELL DONE). $40 in NMIEN = disable DLI, enable VBI"; }; +label { name "ss_loop"; addr $8BA8; comment "number_of_users should be score-1 here."; }; +label { name "smsg_loop"; addr $8B91; }; label { name "read_joystick"; addr $84AC; comment "always joystick #1 (all players use the same joystick and pass it around)"; }; label { name "check_joystick_enabled"; addr $84A4; comment "read the joystick if not disabled"; }; label { name "fake_read_trigger"; addr $84CD; comment "??"; }; @@ -601,19 +607,23 @@ label { name "init_hardware"; addr $837c; }; label { name "init_page6_loop"; addr $837e; }; # these are so far only for player 1 -label { name "number_of_players"; addr $06f4; size 1; comment "0 for single-player game, otherwise range 1-3 (2 to 4 players)"; }; -label { name "score_minus_one"; addr $06ff; size 1; }; -label { name "score"; addr $0700; size 3; comment "aka work_user, 11 bytes"; }; +label { name "users_still_alive"; addr $06f4; size 1; comment "I *think* that's what this is for."; }; +label { name "number_of_users"; addr $06ff; size 1; comment "number of players selected at start of game. also this is score-1, if you see it being 1-indexed with X reg"; }; label { name "level"; addr $06f6; size 1; }; + +# this stuff is also going to be called work_user (an 11-byte struct) +label { name "score"; addr $0700; size 3; comment "aka work_user, 11 bytes"; }; +label { name "next_extra_life"; addr $0703; size 3; comment "initialized to $4c,$1d (aka 7500), 7500 is added whenever an extra life is given"; }; label { name "lives"; addr $070a; size 1; }; + label { name "struct_user_1"; addr $070b; comment "11 bytes"; }; label { name "struct_user_2"; addr $0716; comment "11 bytes"; }; label { name "struct_user_3"; addr $0721; comment "11 bytes"; }; label { name "struct_user_4"; addr $072c; comment "11 bytes"; }; -label { name "current_player"; addr $06fe; size 1; comment "*think* this ranges 1-4, not 0-3"; }; -label { name "player_speed"; addr $0624; size 1; }; -label { name "initial_speed"; addr $0625; size 1; }; +label { name "current_user"; addr $06fe; size 1; comment "this ranges 1-4, not 0-3"; }; +label { name "current_speed"; addr $0624; size 1; comment "can be modified, e.g. set to $08 when being electrocuted"; }; +label { name "initial_speed"; addr $0625; size 1; comment "current user's chosen speed, set at game start"; }; label { name "setup_dli_2"; addr $bc3f; size 1; comment "load dli_service_2 address into dli shadow"; }; label { name "silence_audio"; addr $875B; size 1; comment "set all AUDFx to 0"; }; label { name "sa_loop"; addr $875F; size 1; }; @@ -658,6 +668,7 @@ label { name "start_key_enabled"; addr $06C8; size 1; comment "non-zero = jump t label { name "select_key_enabled"; addr $06C7; size 1; comment "non-zero = jump through start_key_vec if start key pressed (checked by vblank_imm_isr)"; }; label { name "option_key_enabled"; addr $06C6; size 1; comment "non-zero = jump through start_key_vec if start key pressed (checked by vblank_imm_isr)"; }; label { name "zp_temp1"; addr $cb; size 2; comment "used for (zp,y) addressing, also for checking console keys in vblank_imm_isr"; }; +label { name "zp_temp2"; addr $ae; size 2; comment "used for (zp,y) addressing, also 2 temps for scores_screen"; }; label { name "hang_main_thread"; addr $9486; size 1; comment "initialization done, everything's done in interrupts from here on out"; }; label { name "option_key_handler"; addr $9489; size 1; comment "called via option_key_vec when someone presses option"; }; @@ -720,9 +731,13 @@ label { name "isu_next_su"; addr $9A5E; }; label { name "isu_next_byte"; addr $9A60; }; range { name "struct_users_init_contents"; start $9A71; end $9a7b; type bytetable; comment "work_user and struct_user_1 to _4 are initialized to this"; }; range { name "data_af10"; start $AF10; end $AF1B; type bytetable; comment "looks almost like code but it's bogus"; }; -range { name "l_equals"; start $8CFD; end $8CFF; type bytetable; comment "L= (for lives display)"; }; -label { name "add_extra_life"; addr $8CE4; comment "plays sfx_extra_life"; }; -label { name "show_l_equals"; addr $8CCE; comment "L= (for lives display)"; }; +range { name "extra_life_points"; start $8CFD; end $8CFF; type bytetable; comment "3 bytes, value 7500 decimal, give an extra life after this many points. not copied to RAM, meaning no level can change this."; }; +label { name "chk_next_byte"; addr $8CBE; comment "number_of_users should be score-1 here. score+2 should be next_extra_life-1 also."; }; +label { name "chk_done"; addr $8CFA; }; +label { name "add_extra_life"; addr $8CCE; comment "first, calculate & store the next 7500-point target"; }; +label { name "add_next_byte"; addr $8CD1; }; +label { name "score_byte_ge"; addr $8CCB; comment "if it's greater or equal and X!=0, keep looping"; }; +label { name "inc_lives"; addr $8CE4; comment "add 1 life, play sfx_extra_life"; }; label { name "show_lives_icons"; addr $86BB; comment "up to 6 jumpmen, and a + if lives > 6. char $C1 = jumpman icon, $CB = plus sign"; }; label { name "show_current_player"; addr $86A7; comment "1 to 4"; }; label { name "update_status_window"; addr $8694; comment "bottom 2 GR.1 lines on the game board"; }; @@ -741,7 +756,7 @@ label { name "print_bonus_jv"; addr $800F; comment "print remaining bonus time"; label { name "pnum_done"; addr $8667; }; label { name "next_digit"; addr $8607; comment "starts at 0, gets added to"; }; label { name "print_score"; addr $8668; }; -label { name "ps_loop"; addr $8672; }; +label { name "ps_loop"; addr $8672; comment "number_of_users should be score-1 here."; }; label { name "pb_loop"; addr $8688; }; label { name "draw_map"; addr $8049; comment "the entry point for parsing the level map and drawing graphics from it. see level_maps.txt. caller must set $C0/$C1 to the address of the map data. modders beware: bogus map data can & will cause infinite loops."; }; label { name "draw_map_jv"; addr $8000; comment "the entry point for parsing the level map and drawing graphics from it. see level_maps.txt."; }; -- cgit v1.2.3