diff options
author | B. Watson <yalhcru@gmail.com> | 2016-09-03 05:14:49 -0400 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2016-09-03 05:14:49 -0400 |
commit | 63a4565fbfd833f31f6f392225e51cb72bbc0297 (patch) | |
tree | 5b37b8116efb9f5a0953d9c4acf127041e1acd69 | |
parent | 410d305cff49647cb9749559c9a0bf3479c7d044 (diff) | |
download | jumpmanjr-63a4565fbfd833f31f6f392225e51cb72bbc0297.tar.gz |
name saved collision regs, decipher multiplayer a bit
-rw-r--r-- | jumpmanjr.dasm | 224 | ||||
-rw-r--r-- | jumpmanjr.info | 46 | ||||
-rw-r--r-- | main.info | 46 |
3 files changed, 220 insertions, 96 deletions
diff --git a/jumpmanjr.dasm b/jumpmanjr.dasm index 16d5dc2..7cbfefe 100644 --- a/jumpmanjr.dasm +++ b/jumpmanjr.dasm @@ -1,5 +1,5 @@ ; da65 V2.15 - Git 104f898 -; Created: 2016-09-02 13:28:05 +; Created: 2016-09-03 04:58:20 ; Input file: jumpmanjr.rom ; Page: 1 @@ -71,7 +71,22 @@ dlist_shadow_lo := $06AC ; stored in DLISTL if dlist_shad dlist_shadow_hi := $06AD ; stored in DLISTH if nonzero dli_vec_shadow_lo:= $06AE ; stored in VDSLST if dli_vec_shadow_hi nonzero dli_vec_shadow_hi:= $06AF ; stored in VDSLST if nonzero -collision_save := $06B0 ; save_collisions copies GTIA collision regs $D000-$d00f here +sav_m0pf := $06B0 ; Missile 0 to playfield collision. +sav_m1pf := $06B1 ; Missile 1 to playfield collision. +sav_m2pf := $06B2 ; Missile 2 to playfield collision. +sav_m3pf := $06B3 ; Missile 3 to playfield collision. +sav_p0pf := $06B4 ; Player 0 to playfield collision. +sav_p1pf := $06B5 ; Player 1 to playfield collision. +sav_p2pf := $06B6 ; Player 2 to playfield collision. +sav_p3pf := $06B7 ; Player 3 to playfield collision. +sav_m0pl := $06B8 ; Missile 0 to player collision. +sav_m1pl := $06B9 ; Missile 1 to player collision. +sav_m2pl := $06BA ; Missile 2 to player collision. +sav_m3pl := $06BB ; Missile 3 to player collision. +sav_p0pl := $06BC ; Player 0 to player collision. +sav_p1pl := $06BD ; Player 1 to player collision. +sav_p2pl := $06BE ; Player 2 to player collision. +sav_p3pl := $06BF ; Player 3 to player collision. option_key_vec := $06C0 ; vblank_imm_isr jumps thru here if option key pressed select_key_vec := $06C2 ; vblank_imm_isr jumps thru here if select key pressed start_key_vec := $06C4 ; vblank_imm_isr jumps thru here if start key pressed @@ -272,7 +287,9 @@ init_page_7_jv: jmp init_page_7 ; 8024 4C 5C 9A L\. ; ---------------------------------------------------------------------------- -L8027: jmp L9AAA ; 8027 4C AA 9A L.. +; used in multiplayer games, also called in single player (?) +next_player_jv: + jmp next_player ; 8027 4C AA 9A L.. ; ---------------------------------------------------------------------------- L802A: jmp LBA00 ; 802A 4C 00 BA L.. @@ -292,7 +309,9 @@ check_bomb_coll_jv: jmp check_bomb_coll ; 8033 4C A0 87 L.. ; ---------------------------------------------------------------------------- -L8036: jmp L8B23 ; 8036 4C 23 8B L#. +; various levels use this as their init, or use an init that calls this +special_init_jv: + jmp special_init ; 8036 4C 23 8B L#. ; ---------------------------------------------------------------------------- jmp L8B2D ; 8039 4C 2D 8B L-. @@ -1375,7 +1394,7 @@ set_prior: ; ---------------------------------------------------------------------------- ; check whether Jumpman just touched a bomb (RTS if not) check_bomb_coll: - lda collision_save+4 ; 87A0 AD B4 06 ... + lda sav_p0pf ; 87A0 AD B4 06 ... and #$04 ; 87A3 29 04 ). bne bomb_pickup ; 87A5 D0 01 .. rts ; 87A7 60 ` @@ -1517,7 +1536,7 @@ erase_bomb: dec work_level_num_bombs ; 8887 CE 8A 07 ... ; wait for bomb to really disappear wait_bomb: - lda collision_save+4 ; 888A AD B4 06 ... + lda sav_p0pf ; 888A AD B4 06 ... and #$04 ; 888D 29 04 ). bne wait_bomb ; 888F D0 F9 .. rts ; 8891 60 ` @@ -1637,7 +1656,7 @@ L896A: inc player_y_pos ; 896A EE 83 06 sta AUDF1 ; 8973 8D 00 D2 ... lda #$A3 ; 8976 A9 A3 .. sta AUDC1 ; 8978 8D 01 D2 ... - lda collision_save+4 ; 897B AD B4 06 ... + lda sav_p0pf ; 897B AD B4 06 ... and #$01 ; 897E 29 01 ). bne falling_bounce ; 8980 D0 01 .. rts ; 8982 60 ` @@ -1823,7 +1842,9 @@ zero_filler_8b00: .byte $00,$00,$00,$00,$00,$00,$00,$00 ; 8B18 00 00 00 00 00 00 00 00 ........ .byte $00,$00,$00 ; 8B20 00 00 00 ... ; ---------------------------------------------------------------------------- -L8B23: ldx #$20 ; 8B23 A2 20 . +; various levels use this as their init, or use an init that calls this +special_init: + ldx #$20 ; 8B23 A2 20 . lda #$00 ; 8B25 A9 00 .. L8B27: sta bullet_y_delta+1,x ; 8B27 9D 5F 07 ._. dex ; 8B2A CA . @@ -2434,13 +2455,17 @@ sfx_bullet: .byte $09,$00 ; 8F71 09 00 .. ; ---------------------------------------------------------------------------- ; did any missile hit a player, or did players 2 or 3 hit a player... -check_collisions_1: - lda collision_save+14 ; 8F73 AD BE 06 ... -L8F76: ora collision_save+15 ; 8F76 0D BF 06 ... -L8F79: ora collision_save+8 ; 8F79 0D B8 06 ... - ora collision_save+9 ; 8F7C 0D B9 06 ... - ora collision_save+10 ; 8F7F 0D BA 06 ... - ora collision_save+11 ; 8F82 0D BB 06 ... +check_pl_coll: + lda sav_p2pl ; 8F73 AD BE 06 ... +; skip player 2 to player collisions, called with A=0, used by level 11 +check_pl_coll_no_p2: + ora sav_p3pl ; 8F76 0D BF 06 ... +; skip player 2 and 3 to player collisions, called with A=0, used by levels 3 and 10 +check_pl_coll_no_pl: + ora sav_m0pl ; 8F79 0D B8 06 ... + ora sav_m1pl ; 8F7C 0D B9 06 ... + ora sav_m2pl ; 8F7F 0D BA 06 ... + ora sav_m3pl ; 8F82 0D BB 06 ... and #$01 ; 8F85 29 01 ). beq L8F91 ; 8F87 F0 08 .. lda $0623 ; 8F89 AD 23 06 .#. @@ -3158,7 +3183,7 @@ sfx_select_key: ; multiple code paths jump here. replay level, load next level, or go back to ask_num_players afterlife: jsr enable_joystick_jv ; 9600 20 1B 80 .. - jsr L8027 ; 9603 20 27 80 '. + jsr next_player_jv ; 9603 20 27 80 '. lda $06F8 ; 9606 AD F8 06 ... beq L960E ; 9609 F0 03 .. jmp ask_num_players ; 960B 4C 00 94 L.. @@ -3436,8 +3461,8 @@ check_collisions_2: sta $0688 ; 981C 8D 88 06 ... lda $06ED ; 981F AD ED 06 ... beq check_collisions_3 ; 9822 F0 0E .. - lda collision_save+4 ; 9824 AD B4 06 ... - ora collision_save+5 ; 9827 0D B5 06 ... + lda sav_p0pf ; 9824 AD B4 06 ... + ora sav_p1pf ; 9827 0D B5 06 ... and #$03 ; 982A 29 03 ). bne check_collisions_3 ; 982C D0 04 .. L982E: inc $0623 ; 982E EE 23 06 .#. @@ -3448,8 +3473,8 @@ L982E: inc $0623 ; 982E EE 23 06 check_collisions_3: lda #$00 ; 9832 A9 00 .. sta $06ED ; 9834 8D ED 06 ... - lda collision_save+4 ; 9837 AD B4 06 ... - ora collision_save+5 ; 983A 0D B5 06 ... + lda sav_p0pf ; 9837 AD B4 06 ... + ora sav_p1pf ; 983A 0D B5 06 ... and #$03 ; 983D 29 03 ). bne check_trigger_state ; 983F D0 0C .. inc $06ED ; 9841 EE ED 06 ... @@ -3478,8 +3503,8 @@ check_up_down: cud_jmp:jmp L9892 ; 9860 4C 92 98 L.. ; ---------------------------------------------------------------------------- -L9863: lda collision_save+4 ; 9863 AD B4 06 ... - ora collision_save+5 ; 9866 0D B5 06 ... +L9863: lda sav_p0pf ; 9863 AD B4 06 ... + ora sav_p1pf ; 9866 0D B5 06 ... and #$02 ; 9869 29 02 ). bne L9870 ; 986B D0 03 .. jmp L98D0 ; 986D 4C D0 98 L.. @@ -3503,8 +3528,8 @@ L9878: sta player_x_pos ; 9878 8D 7E 06 jmp play_sfx_climb ; 988F 4C 80 8A L.. ; ---------------------------------------------------------------------------- -L9892: lda collision_save+4 ; 9892 AD B4 06 ... - ora collision_save+5 ; 9895 0D B5 06 ... +L9892: lda sav_p0pf ; 9892 AD B4 06 ... + ora sav_p1pf ; 9895 0D B5 06 ... and #$01 ; 9898 29 01 ). bne L989F ; 989A D0 03 .. jmp L98D0 ; 989C 4C D0 98 L.. @@ -3534,8 +3559,8 @@ play_sfx_walk: sta sfx_slot_timer ; 98C8 8D 3F 06 .?. lda #$01 ; 98CB A9 01 .. jsr cue_sfx_lowprior_jv ; 98CD 20 03 80 .. -L98D0: lda collision_save+4 ; 98D0 AD B4 06 ... - ora collision_save+5 ; 98D3 0D B5 06 ... +L98D0: lda sav_p0pf ; 98D0 AD B4 06 ... + ora sav_p1pf ; 98D3 0D B5 06 ... and #$02 ; 98D6 29 02 ). beq L98F0 ; 98D8 F0 16 .. jsr L9971 ; 98DA 20 71 99 q. @@ -3548,7 +3573,7 @@ L98D0: lda collision_save+4 ; 98D0 AD B4 06 jmp L9925 ; 98ED 4C 25 99 L%. ; ---------------------------------------------------------------------------- -L98F0: lda collision_save+4 ; 98F0 AD B4 06 ... +L98F0: lda sav_p0pf ; 98F0 AD B4 06 ... and #$01 ; 98F3 29 01 ). beq L990F ; 98F5 F0 18 .. dec player_y_pos ; 98F7 CE 83 06 ... @@ -3565,8 +3590,8 @@ L98F0: lda collision_save+4 ; 98F0 AD B4 06 L990F: lda $0688 ; 990F AD 88 06 ... cmp #$01 ; 9912 C9 01 .. bne L9925 ; 9914 D0 0F .. - lda collision_save+4 ; 9916 AD B4 06 ... - ora collision_save+5 ; 9919 0D B5 06 ... + lda sav_p0pf ; 9916 AD B4 06 ... + ora sav_p1pf ; 9919 0D B5 06 ... and #$02 ; 991C 29 02 ). beq L9925 ; 991E F0 05 .. lda #$04 ; 9920 A9 04 .. @@ -3705,8 +3730,8 @@ L99DD: clc ; 99DD 18 ; ---------------------------------------------------------------------------- code_99f7: - lda collision_save+4 ; 99F7 AD B4 06 ... - ora collision_save+5 ; 99FA 0D B5 06 ... + lda sav_p0pf ; 99F7 AD B4 06 ... + ora sav_p1pf ; 99FA 0D B5 06 ... lsr a ; 99FD 4A J bcs end_jump ; 99FE B0 B2 .. lsr a ; 9A00 4A J @@ -3762,79 +3787,98 @@ data_9a71: .byte $00,$00,$00,$4C,$1D,$00,$00,$00 ; 9A71 00 00 00 4C 1D 00 00 00 ...L.... .byte $00,$06,$03 ; 9A79 00 06 03 ... ; ---------------------------------------------------------------------------- -L9A7C: ldx current_player ; 9A7C AE FE 06 ... +; multiply current player number by 11, return result in Y +mul_player_11: + ldx current_player ; 9A7C AE FE 06 ... lda #$00 ; 9A7F A9 00 .. clc ; 9A81 18 . -L9A82: dex ; 9A82 CA . - beq L9A8A ; 9A83 F0 05 .. +add_11: dex ; 9A82 CA . + beq return_y ; 9A83 F0 05 .. adc #$0B ; 9A85 69 0B i. - jmp L9A82 ; 9A87 4C 82 9A L.. + jmp add_11 ; 9A87 4C 82 9A L.. ; ---------------------------------------------------------------------------- -L9A8A: tay ; 9A8A A8 . +return_y: + tay ; 9A8A A8 . rts ; 9A8B 60 ` ; ---------------------------------------------------------------------------- -L9A8C: ldx #$00 ; 9A8C A2 00 .. -L9A8E: lda score,x ; 9A8E BD 00 07 ... +save_struct_player: + ldx #$00 ; 9A8C A2 00 .. +ssp_loop: + lda score,x ; 9A8E BD 00 07 ... sta $070B,y ; 9A91 99 0B 07 ... inx ; 9A94 E8 . iny ; 9A95 C8 . cpx #$0B ; 9A96 E0 0B .. - bne L9A8E ; 9A98 D0 F4 .. + bne ssp_loop ; 9A98 D0 F4 .. rts ; 9A9A 60 ` ; ---------------------------------------------------------------------------- -L9A9B: ldx #$00 ; 9A9B A2 00 .. -L9A9D: lda $070B,y ; 9A9D B9 0B 07 ... +load_struct_player: + ldx #$00 ; 9A9B A2 00 .. +lsp_loop: + lda $070B,y ; 9A9D B9 0B 07 ... sta score,x ; 9AA0 9D 00 07 ... inx ; 9AA3 E8 . iny ; 9AA4 C8 . cpx #$0B ; 9AA5 E0 0B .. - bne L9A9D ; 9AA7 D0 F4 .. + bne lsp_loop ; 9AA7 D0 F4 .. rts ; 9AA9 60 ` ; ---------------------------------------------------------------------------- -L9AAA: jsr L9A7C ; 9AAA 20 7C 9A |. - jsr L9A8C ; 9AAD 20 8C 9A .. +; used in multiplayer games, also called in single player (?) +next_player: + jsr mul_player_11 ; 9AAA 20 7C 9A |. + jsr save_struct_player ; 9AAD 20 8C 9A .. lda #$00 ; 9AB0 A9 00 .. sta $06F7 ; 9AB2 8D F7 06 ... sta $06F8 ; 9AB5 8D F8 06 ... -L9AB8: inc current_player ; 9AB8 EE FE 06 ... +; wraparound to 1 if > total players +next_player_num: + inc current_player ; 9AB8 EE FE 06 ... lda $06FF ; 9ABB AD FF 06 ... cmp current_player ; 9ABE CD FE 06 ... - bcs L9ACB ; 9AC1 B0 08 .. + bcs look_for_alive ; 9AC1 B0 08 .. lda #$01 ; 9AC3 A9 01 .. sta current_player ; 9AC5 8D FE 06 ... sta $06F7 ; 9AC8 8D F7 06 ... -L9ACB: ldx number_of_players ; 9ACB AE F4 06 ... +look_for_alive: + ldx number_of_players ; 9ACB AE F4 06 ... inx ; 9ACE E8 . - ldy L9AFB,x ; 9ACF BC FB 9A ... -L9AD2: lda $0715,y ; 9AD2 B9 15 07 ... + ldy mul_11_table_minus_one,x ; 9ACF BC FB 9A ... +is_player_dead: + lda $0715,y ; 9AD2 B9 15 07 ... cmp #$FF ; 9AD5 C9 FF .. - bne L9AE5 ; 9AD7 D0 0C .. + bne check_lives ; 9AD7 D0 0C .. tya ; 9AD9 98 . sec ; 9ADA 38 8 sbc #$0B ; 9ADB E9 0B .. tay ; 9ADD A8 . dex ; 9ADE CA . - bne L9AD2 ; 9ADF D0 F1 .. + bne is_player_dead ; 9ADF D0 F1 .. inc $06F8 ; 9AE1 EE F8 06 ... rts ; 9AE4 60 ` ; ---------------------------------------------------------------------------- -L9AE5: stx $06FF ; 9AE5 8E FF 06 ... - jsr L9A7C ; 9AE8 20 7C 9A |. - jsr L9A9B ; 9AEB 20 9B 9A .. +; if player hasn't been eliminated, but is out of lives, eliminate him +check_lives: + stx $06FF ; 9AE5 8E FF 06 ... + jsr mul_player_11 ; 9AE8 20 7C 9A |. + jsr load_struct_player ; 9AEB 20 9B 9A .. lda lives ; 9AEE AD 0A 07 ... cmp #$FF ; 9AF1 C9 FF .. - beq L9AB8 ; 9AF3 F0 C3 .. + beq next_player_num ; 9AF3 F0 C3 .. +; found the next player that isn't dead +player_alive: lda $0709 ; 9AF5 AD 09 07 ... sta initial_speed ; 9AF8 8D 25 06 .%. -L9AFB: rts ; 9AFB 60 ` +; 1-indexed +mul_11_table_minus_one: + rts ; 9AFB 60 ` ; ---------------------------------------------------------------------------- -data_9afc: +mul_11_table: .byte $00,$0B,$16,$21 ; 9AFC 00 0B 16 21 ...! ; ---------------------------------------------------------------------------- ; for some reason there are 2 copies of the display list, at $0800 and $0881 @@ -4191,7 +4235,7 @@ level01_sub2: .addr L0000 ; A006 00 00 .. ; a subroutine level01_sub3: - .addr check_collisions_1 ; A008 73 8F s. + .addr check_pl_coll ; A008 73 8F s. ; ---------------------------------------------------------------------------- ; number of bombs to pick up on this level level01_num_bombs: @@ -4355,7 +4399,7 @@ level02_sub_bomb: .addr electrocution_bomb_pickup ; A060 98 A4 .. ; called at start of level, $06E6 for some levels, or else a ROM subroutine level02_sub_start: - .addr L8036 ; A062 36 80 6. + .addr special_init_jv ; A062 36 80 6. ; always $9740 aka game_main_loop level02_sub6: .addr game_main_loop ; A064 40 97 @. @@ -4569,7 +4613,7 @@ level04_sub_bomb: .addr L06E6 ; A0E0 E6 06 .. ; called at start of level, $06E6 for some levels, or else a ROM subroutine level04_sub_start: - .addr L8036 ; A0E2 36 80 6. + .addr special_init_jv ; A0E2 36 80 6. ; always $9740 aka game_main_loop level04_sub6: .addr game_main_loop ; A0E4 40 97 @. @@ -4619,7 +4663,7 @@ level05_sub2: .addr L0000 ; A106 00 00 .. ; a subroutine level05_sub3: - .addr check_collisions_1 ; A108 73 8F s. + .addr check_pl_coll ; A108 73 8F s. ; ---------------------------------------------------------------------------- ; number of bombs to pick up on this level level05_num_bombs: @@ -4833,7 +4877,7 @@ level07_sub2: .addr L0000 ; A186 00 00 .. ; a subroutine level07_sub3: - .addr check_collisions_1 ; A188 73 8F s. + .addr check_pl_coll ; A188 73 8F s. ; ---------------------------------------------------------------------------- ; number of bombs to pick up on this level level07_num_bombs: @@ -4890,7 +4934,7 @@ level07_sub_bomb: .addr L06E6 ; A1A0 E6 06 .. ; called at start of level, $06E6 for some levels, or else a ROM subroutine level07_sub_start: - .addr L8036 ; A1A2 36 80 6. + .addr special_init_jv ; A1A2 36 80 6. ; always $9740 aka game_main_loop level07_sub6: .addr game_main_loop ; A1A4 40 97 @. @@ -4940,7 +4984,7 @@ level08_sub2: .addr L0000 ; A1C6 00 00 .. ; a subroutine level08_sub3: - .addr check_collisions_1 ; A1C8 73 8F s. + .addr check_pl_coll ; A1C8 73 8F s. ; ---------------------------------------------------------------------------- ; number of bombs to pick up on this level level08_num_bombs: @@ -5211,7 +5255,7 @@ level10_sub_bomb: .addr herethere_bomb_sub ; A260 FD B2 .. ; called at start of level, $06E6 for some levels, or else a ROM subroutine level10_sub_start: - .addr L8036 ; A262 36 80 6. + .addr special_init_jv ; A262 36 80 6. ; always $9740 aka game_main_loop level10_sub6: .addr game_main_loop ; A264 40 97 @. @@ -5318,7 +5362,7 @@ level11_sub_bomb: .addr hatch_bomb_sub ; A2A0 4C B4 L. ; called at start of level, $06E6 for some levels, or else a ROM subroutine level11_sub_start: - .addr L8036 ; A2A2 36 80 6. + .addr special_init_jv ; A2A2 36 80 6. ; always $9740 aka game_main_loop level11_sub6: .addr game_main_loop ; A2A4 40 97 @. @@ -5368,7 +5412,7 @@ level12_sub2: .addr hurr_sub2 ; A2C6 09 B7 .. ; a subroutine level12_sub3: - .addr check_collisions_1 ; A2C8 73 8F s. + .addr check_pl_coll ; A2C8 73 8F s. ; ---------------------------------------------------------------------------- ; number of bombs to pick up on this level level12_num_bombs: @@ -5425,7 +5469,7 @@ level12_sub_bomb: .addr L06E6 ; A2E0 E6 06 .. ; called at start of level, $06E6 for some levels, or else a ROM subroutine level12_sub_start: - .addr L8036 ; A2E2 36 80 6. + .addr special_init_jv ; A2E2 36 80 6. ; always $9740 aka game_main_loop level12_sub6: .addr game_main_loop ; A2E4 40 97 @. @@ -5586,11 +5630,11 @@ electrocution_done: ; ---------------------------------------------------------------------------- LA4E8: ldx #$01 ; A4E8 A2 01 .. - lda collision_save+14 ; A4EA AD BE 06 ... + lda sav_p2pl ; A4EA AD BE 06 ... and #$03 ; A4ED 29 03 ). bne LA505 ; A4EF D0 14 .. inx ; A4F1 E8 . - lda collision_save+15 ; A4F2 AD BF 06 ... + lda sav_p3pl ; A4F2 AD BF 06 ... and #$03 ; A4F5 29 03 ). bne LA505 ; A4F7 D0 0C .. lda initial_speed ; A4F9 AD 25 06 .%. @@ -5632,7 +5676,7 @@ sfx_electrocution: ; skip a couple of the collision regs, so we don't register a collision when Jumpman is being electrocuted level03_collisions: lda #$00 ; A53D A9 00 .. - jmp L8F79 ; A53F 4C 79 8F Ly. + jmp check_pl_coll_no_pl ; A53F 4C 79 8F Ly. ; ---------------------------------------------------------------------------- ; dunno, referenced by electrocution_bomb_pickup @@ -5694,7 +5738,7 @@ dw_platform_player: ; ---------------------------------------------------------------------------- ; gets called at start of level dumbwaiter_setup: - jsr L8036 ; A68C 20 36 80 6. + jsr special_init_jv ; A68C 20 36 80 6. lda #$06 ; A68F A9 06 .. sta bullet_y_delta+2 ; A691 8D 60 07 .`. ldy #$2A ; A694 A0 2A .* @@ -5781,26 +5825,26 @@ dumbwaiter_sub3: lda #$00 ; A735 A9 00 .. sta $06ED ; A737 8D ED 06 ... sta $0778 ; A73A 8D 78 07 .x. -LA73D: lda collision_save+8 ; A73D AD B8 06 ... - ora collision_save+9 ; A740 0D B9 06 ... - ora collision_save+10 ; A743 0D BA 06 ... - ora collision_save+11 ; A746 0D BB 06 ... +LA73D: lda sav_m0pl ; A73D AD B8 06 ... + ora sav_m1pl ; A740 0D B9 06 ... + ora sav_m2pl ; A743 0D BA 06 ... + ora sav_m3pl ; A746 0D BB 06 ... tax ; A749 AA . - ora collision_save+14 ; A74A 0D BE 06 ... - ora collision_save+15 ; A74D 0D BF 06 ... + ora sav_p2pl ; A74A 0D BE 06 ... + ora sav_p3pl ; A74D 0D BF 06 ... tay ; A750 A8 . and #$01 ; A751 29 01 ). beq LA760 ; A753 F0 0B .. - lda collision_save+4 ; A755 AD B4 06 ... + lda sav_p0pf ; A755 AD B4 06 ... ora #$01 ; A758 09 01 .. - sta collision_save+4 ; A75A 8D B4 06 ... + sta sav_p0pf ; A75A 8D B4 06 ... inc player_y_pos ; A75D EE 83 06 ... LA760: tya ; A760 98 . and #$02 ; A761 29 02 ). beq LA779 ; A763 F0 14 .. - lda collision_save+5 ; A765 AD B5 06 ... + lda sav_p1pf ; A765 AD B5 06 ... ora #$01 ; A768 09 01 .. - sta collision_save+5 ; A76A 8D B5 06 ... + sta sav_p1pf ; A76A 8D B5 06 ... txa ; A76D 8A . and #$02 ; A76E 29 02 ). beq LA778 ; A770 F0 06 .. @@ -5853,7 +5897,7 @@ hellstones_sub3: asl a ; A82D 0A . ora #$08 ; A82E 09 08 .. sta COLOR3 ; A830 8D C7 02 ... - jmp check_collisions_1 ; A833 4C 73 8F Ls. + jmp check_pl_coll ; A833 4C 73 8F Ls. ; ---------------------------------------------------------------------------- hellstones_sub0: @@ -5994,7 +6038,7 @@ l06_bombs_term: .byte $FF ; A9C5 FF . ; ---------------------------------------------------------------------------- walls_init: - jsr L8036 ; A9C6 20 36 80 6. + jsr special_init_jv ; A9C6 20 36 80 6. lda #$02 ; A9C9 A9 02 .. sta $0770 ; A9CB 8D 70 07 .p. sta $0772 ; A9CE 8D 72 07 .r. @@ -6078,7 +6122,7 @@ walls_sub2: ldx #$05 ; AA5A A2 05 .. LAA5C: dex ; AA5C CA . beq walls_sub0 ; AA5D F0 DB .. - lda collision_save+7,x ; AA5F BD B7 06 ... + lda sav_p3pf,x ; AA5F BD B7 06 ... and #$01 ; AA62 29 01 ). beq LAA5C ; AA64 F0 F6 .. lda player_x_pos ; AA66 AD 7E 06 .~. @@ -6320,7 +6364,7 @@ l08_unkn0: .byte $FF ; AE9A FF . ; ---------------------------------------------------------------------------- spellbound_init: - jsr L8036 ; AE9B 20 36 80 6. + jsr special_init_jv ; AE9B 20 36 80 6. lda #$C0 ; AE9E A9 C0 .. sta $0770 ; AEA0 8D 70 07 .p. rts ; AEA3 60 ` @@ -6493,7 +6537,7 @@ l09_bombs_term: .byte $FF ; B0C3 FF . ; ---------------------------------------------------------------------------- blackout_init: - jsr L8036 ; B0C4 20 36 80 6. + jsr special_init_jv ; B0C4 20 36 80 6. lda #$10 ; B0C7 A9 10 .. sta SAVMSC+1 ; B0C9 85 59 .Y jsr clear_screen_mem_jv ; B0CB 20 1E 80 .. @@ -6739,7 +6783,7 @@ herethere_sub3: LB2F2: lda $062A ; B2F2 AD 2A 06 .*. sta PCOLR2 ; B2F5 8D C2 02 ... lda #$00 ; B2F8 A9 00 .. - jmp L8F79 ; B2FA 4C 79 8F Ly. + jmp check_pl_coll_no_pl ; B2FA 4C 79 8F Ly. ; ---------------------------------------------------------------------------- herethere_bomb_sub: @@ -6920,7 +6964,7 @@ sfx_woop: ; ---------------------------------------------------------------------------- hatch_sub3: lda #$00 ; B57C A9 00 .. - jmp L8F76 ; B57E 4C 76 8F Lv. + jmp check_pl_coll_no_p2 ; B57E 4C 76 8F Lv. ; ---------------------------------------------------------------------------- hatch_sub1: @@ -7546,7 +7590,7 @@ code_bccd: lda $062A ; BCCD AD 2A 06 .*. sta COLOR2 ; BCD0 8D C6 02 ... lda #$02 ; BCD3 A9 02 .. - sta collision_save+4 ; BCD5 8D B4 06 ... + sta sav_p0pf ; BCD5 8D B4 06 ... rts ; BCD8 60 ` ; ---------------------------------------------------------------------------- diff --git a/jumpmanjr.info b/jumpmanjr.info index 9ab0765..4de38f2 100644 --- a/jumpmanjr.info +++ b/jumpmanjr.info @@ -109,13 +109,42 @@ label { name "anp_clear_loop"; addr $940D; comment "clear area where NUMBER OF P label { name "anp_copy_loop"; addr $9418; comment "copy NUMBER OF PLAYERS to screen RAM"; }; label { name "save_collisions"; addr $8503; comment "save contents of GTIA collision regs (X ranges 1 to $10, dli_vec_shadow_hi should read collision_save-1)"; }; -label { name "check_collisions_1"; addr $8F73; size 1; comment "did any missile hit a player, or did players 2 or 3 hit a player..."; }; +label { name "check_pl_coll"; addr $8F73; size 1; comment "did any missile hit a player, or did players 2 or 3 hit a player..."; }; +label { name "check_pl_coll_no_p2"; addr $8F76; size 1; comment "skip player 2 to player collisions, called with A=0, used by level 11"; }; +label { name "check_pl_coll_no_pl"; addr $8F79; size 1; comment "skip player 2 and 3 to player collisions, called with A=0, used by levels 3 and 10"; }; label { name "check_collisions_2"; addr $981A; size 1; comment "did player 0 or 1 hit the playfield..."; }; label { name "check_collisions_3"; addr $9832; size 1; comment "movement/jumping only allowed if player's touching the playfield"; }; + +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 "next_player"; addr $9AAA; comment "used in multiplayer games, also called in single player (?)"; }; +label { name "next_player_jv"; addr $8027; comment "used in multiplayer games, also called in single player (?)"; }; +label { name "mul_player_11"; addr $9A7C; comment "multiply current player number by 11, return result in Y"; }; +label { name "add_11"; addr $9A82; }; +label { name "return_y"; addr $9A8A; }; +label { name "save_struct_player"; addr $9A8C; }; + label { name "mid_jump"; addr $99A8; size 1; comment "check & see if we're done jumping"; }; label { name "continue_jump"; addr $99BD; size 1; comment "we're in mid-jump and didn't hit anything, keep going"; }; label { name "end_jump"; addr $99B2; size 1; comment "we hit a girder/rope/ladder in mid-jump, or else the jump finished without hitting anything(?). this does not (?) include the bottom of the level"; }; -label { name "collision_save"; addr $06B0; size 16; comment "save_collisions copies GTIA collision regs $D000-$d00f here"; }; +#label { name "collision_save"; addr $06B0; size 16; comment "save_collisions copies GTIA collision regs $D000-$d00f here"; }; +label { name "sav_m0pf"; addr $06b0; comment "Missile 0 to playfield collision."; }; +label { name "sav_m1pf"; addr $06b1; comment "Missile 1 to playfield collision."; }; +label { name "sav_m2pf"; addr $06b2; comment "Missile 2 to playfield collision."; }; +label { name "sav_m3pf"; addr $06b3; comment "Missile 3 to playfield collision."; }; +label { name "sav_p0pf"; addr $06b4; comment "Player 0 to playfield collision."; }; +label { name "sav_p1pf"; addr $06b5; comment "Player 1 to playfield collision."; }; +label { name "sav_p2pf"; addr $06b6; comment "Player 2 to playfield collision."; }; +label { name "sav_p3pf"; addr $06b7; comment "Player 3 to playfield collision."; }; +label { name "sav_m0pl"; addr $06b8; comment "Missile 0 to player collision."; }; +label { name "sav_m1pl"; addr $06b9; comment "Missile 1 to player collision."; }; +label { name "sav_m2pl"; addr $06ba; comment "Missile 2 to player collision."; }; +label { name "sav_m3pl"; addr $06bb; comment "Missile 3 to player collision."; }; +label { name "sav_p0pl"; addr $06bc; comment "Player 0 to player collision."; }; +label { name "sav_p1pl"; addr $06bd; comment "Player 1 to player collision."; }; +label { name "sav_p2pl"; addr $06be; comment "Player 2 to player collision."; }; +label { name "sav_p3pl"; addr $06bf; comment "Player 3 to player collision."; }; + label { name "init_next_level"; addr $9BE8; size 1; comment "..."; }; label { name "show_get_ready_prompt"; addr $9624; size 1; comment "only in multiplayer games"; }; label { name "check_bomb_coll"; addr $87A0; size 1; comment "check whether Jumpman just touched a bomb (RTS if not)"; }; @@ -260,7 +289,18 @@ label { name "ts_clear_sub0"; addr $9114; comment "set work_level_sub0 to $06e6 label { name "demo_mode"; addr $B96B; comment "display all the levels, happens if left idle at the title screen"; }; label { name "show_letter"; addr $9160; comment "$3000 is screen memory, at this point"; }; label { name "title_letters"; addr $928F; comment "JUMPMAN JUNIOR in screen codes with high bit set"; }; -range { name "data_9afc"; start $9AFC; end $9aff; type bytetable; }; + +label { name "is_player_dead"; addr $9AD2; }; +label { name "check_lives"; addr $9AE5; comment "if player hasn't been eliminated, but is out of lives, eliminate him"; }; +label { name "player_alive"; addr $9AF5; comment "found the next player that isn't dead"; }; +label { name "load_struct_player"; addr $9A9B; }; +label { name "lsp_loop"; addr $9A9D; }; +label { name "ssp_loop"; addr $9A8E; }; +label { name "look_for_alive"; addr $9ACB; }; +label { name "next_player_num"; addr $9AB8; comment "wraparound to 1 if > total players"; }; +label { name "mul_11_table_minus_one"; addr $9afb; comment "1-indexed"; }; +range { name "mul_11_table"; start $9AFC; end $9aff; type bytetable; }; + range { name "num_player_dli_service"; start $9578; end $959a; type code; comment "DLI service routine, changes COLPF2, address gets stored in $6ae/$6af by code at $944e"; }; range { name "dli_service_2"; start $bdc7; end $bdd1; type code; comment "DLI service routine, changes COLBK, address gets stored in $6ae/$6af by code at $bc3c"; }; label { name "numplayer_screen_data_minus_one"; addr $959a; comment "1-indexed loop copies from here+1"; }; @@ -107,13 +107,42 @@ label { name "anp_clear_loop"; addr $940D; comment "clear area where NUMBER OF P label { name "anp_copy_loop"; addr $9418; comment "copy NUMBER OF PLAYERS to screen RAM"; }; label { name "save_collisions"; addr $8503; comment "save contents of GTIA collision regs (X ranges 1 to $10, dli_vec_shadow_hi should read collision_save-1)"; }; -label { name "check_collisions_1"; addr $8F73; size 1; comment "did any missile hit a player, or did players 2 or 3 hit a player..."; }; +label { name "check_pl_coll"; addr $8F73; size 1; comment "did any missile hit a player, or did players 2 or 3 hit a player..."; }; +label { name "check_pl_coll_no_p2"; addr $8F76; size 1; comment "skip player 2 to player collisions, called with A=0, used by level 11"; }; +label { name "check_pl_coll_no_pl"; addr $8F79; size 1; comment "skip player 2 and 3 to player collisions, called with A=0, used by levels 3 and 10"; }; label { name "check_collisions_2"; addr $981A; size 1; comment "did player 0 or 1 hit the playfield..."; }; label { name "check_collisions_3"; addr $9832; size 1; comment "movement/jumping only allowed if player's touching the playfield"; }; + +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 "next_player"; addr $9AAA; comment "used in multiplayer games, also called in single player (?)"; }; +label { name "next_player_jv"; addr $8027; comment "used in multiplayer games, also called in single player (?)"; }; +label { name "mul_player_11"; addr $9A7C; comment "multiply current player number by 11, return result in Y"; }; +label { name "add_11"; addr $9A82; }; +label { name "return_y"; addr $9A8A; }; +label { name "save_struct_player"; addr $9A8C; }; + label { name "mid_jump"; addr $99A8; size 1; comment "check & see if we're done jumping"; }; label { name "continue_jump"; addr $99BD; size 1; comment "we're in mid-jump and didn't hit anything, keep going"; }; label { name "end_jump"; addr $99B2; size 1; comment "we hit a girder/rope/ladder in mid-jump, or else the jump finished without hitting anything(?). this does not (?) include the bottom of the level"; }; -label { name "collision_save"; addr $06B0; size 16; comment "save_collisions copies GTIA collision regs $D000-$d00f here"; }; +#label { name "collision_save"; addr $06B0; size 16; comment "save_collisions copies GTIA collision regs $D000-$d00f here"; }; +label { name "sav_m0pf"; addr $06b0; comment "Missile 0 to playfield collision."; }; +label { name "sav_m1pf"; addr $06b1; comment "Missile 1 to playfield collision."; }; +label { name "sav_m2pf"; addr $06b2; comment "Missile 2 to playfield collision."; }; +label { name "sav_m3pf"; addr $06b3; comment "Missile 3 to playfield collision."; }; +label { name "sav_p0pf"; addr $06b4; comment "Player 0 to playfield collision."; }; +label { name "sav_p1pf"; addr $06b5; comment "Player 1 to playfield collision."; }; +label { name "sav_p2pf"; addr $06b6; comment "Player 2 to playfield collision."; }; +label { name "sav_p3pf"; addr $06b7; comment "Player 3 to playfield collision."; }; +label { name "sav_m0pl"; addr $06b8; comment "Missile 0 to player collision."; }; +label { name "sav_m1pl"; addr $06b9; comment "Missile 1 to player collision."; }; +label { name "sav_m2pl"; addr $06ba; comment "Missile 2 to player collision."; }; +label { name "sav_m3pl"; addr $06bb; comment "Missile 3 to player collision."; }; +label { name "sav_p0pl"; addr $06bc; comment "Player 0 to player collision."; }; +label { name "sav_p1pl"; addr $06bd; comment "Player 1 to player collision."; }; +label { name "sav_p2pl"; addr $06be; comment "Player 2 to player collision."; }; +label { name "sav_p3pl"; addr $06bf; comment "Player 3 to player collision."; }; + label { name "init_next_level"; addr $9BE8; size 1; comment "..."; }; label { name "show_get_ready_prompt"; addr $9624; size 1; comment "only in multiplayer games"; }; label { name "check_bomb_coll"; addr $87A0; size 1; comment "check whether Jumpman just touched a bomb (RTS if not)"; }; @@ -258,7 +287,18 @@ label { name "ts_clear_sub0"; addr $9114; comment "set work_level_sub0 to $06e6 label { name "demo_mode"; addr $B96B; comment "display all the levels, happens if left idle at the title screen"; }; label { name "show_letter"; addr $9160; comment "$3000 is screen memory, at this point"; }; label { name "title_letters"; addr $928F; comment "JUMPMAN JUNIOR in screen codes with high bit set"; }; -range { name "data_9afc"; start $9AFC; end $9aff; type bytetable; }; + +label { name "is_player_dead"; addr $9AD2; }; +label { name "check_lives"; addr $9AE5; comment "if player hasn't been eliminated, but is out of lives, eliminate him"; }; +label { name "player_alive"; addr $9AF5; comment "found the next player that isn't dead"; }; +label { name "load_struct_player"; addr $9A9B; }; +label { name "lsp_loop"; addr $9A9D; }; +label { name "ssp_loop"; addr $9A8E; }; +label { name "look_for_alive"; addr $9ACB; }; +label { name "next_player_num"; addr $9AB8; comment "wraparound to 1 if > total players"; }; +label { name "mul_11_table_minus_one"; addr $9afb; comment "1-indexed"; }; +range { name "mul_11_table"; start $9AFC; end $9aff; type bytetable; }; + range { name "num_player_dli_service"; start $9578; end $959a; type code; comment "DLI service routine, changes COLPF2, address gets stored in $6ae/$6af by code at $944e"; }; range { name "dli_service_2"; start $bdc7; end $bdd1; type code; comment "DLI service routine, changes COLBK, address gets stored in $6ae/$6af by code at $bc3c"; }; label { name "numplayer_screen_data_minus_one"; addr $959a; comment "1-indexed loop copies from here+1"; }; |