aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2016-08-30 17:42:07 -0400
committerB. Watson <yalhcru@gmail.com>2016-08-30 17:42:07 -0400
commitcb07e206cfdd8412710ef8e80f6a1faffcc65fec (patch)
tree11e97af1363da8730b2ff8444ba4f4a2126dc04d
parentb6836545db316380fe176ba72cb1b7d0cb28962a (diff)
downloadjumpmanjr-cb07e206cfdd8412710ef8e80f6a1faffcc65fec.tar.gz
bullet logic mostly figured out
-rw-r--r--Makefile3
-rw-r--r--jumpmanjr.dasm464
-rw-r--r--jumpmanjr.info82
-rw-r--r--leveldesc.info28
-rw-r--r--main.info54
-rw-r--r--mklevelinfo.pl2
6 files changed, 365 insertions, 268 deletions
diff --git a/Makefile b/Makefile
index 895c2fe..eb342ae 100644
--- a/Makefile
+++ b/Makefile
@@ -26,6 +26,9 @@ jmjtest.dasm: jumpmanjr.dasm
mv jmjtest.dasm jmjtest.dasm.bak 2>/dev/null || true
cp jumpmanjr.dasm jmjtest.dasm
+push: all html
+ git push
+
test: jmjtest.dasm
ca65 -t none -o jmjtest.o -g jmjtest.dasm
ld65 -t none -o jmjtest.bin -Ln tmp.lbl --start-addr 0x8000 jmjtest.o
diff --git a/jumpmanjr.dasm b/jumpmanjr.dasm
index f6dce3b..4273121 100644
--- a/jumpmanjr.dasm
+++ b/jumpmanjr.dasm
@@ -1,5 +1,5 @@
; da65 V2.15 - Git 104f898
-; Created: 2016-08-30 13:43:10
+; Created: 2016-08-30 17:25:09
; Input file: jumpmanjr.rom
; Page: 1
@@ -37,9 +37,12 @@ COLOR2 := $02C6
COLOR3 := $02C7
COLOR4 := $02C8
CHBAS := $02F4
+page6_vectors_minus_one:= $05FF ; 1-indexed
+page6_vectors := $0600 ; initialized with page6_initial_vectors
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
bonus_jiffy_timer:= $0626 ; gets incremented every frame when playing a level, bonus-=100 when this reaches 0
@@ -58,6 +61,10 @@ sfx_slot_duration:= $0646
sfx_slot_freq := $0647
sfx_slot_curpos := $064E ; address we've got to so far, playing this sfx
sfx_tempo_tmp := $0661 ; ??
+player_x_pos := $067E ; stored in HPOSP0
+player_y_pos := $0683 ; $C6 is the bottom of the level (where you end up when you die)
+bullet_x_pos := $069B ; 4 bytes, meaning we can never have >4 bullets on screen at once (makes sense, GTIA only has 4 missiles)
+bullet_y_pos := $069F ; another 4 bytes
dlist_shadow_lo := $06AC ; stored in DLISTL if dlist_shadow_hi nonzero
dlist_shadow_hi := $06AD ; stored in DLISTH if nonzero
dli_vec_shadow_lo:= $06AE ; stored in VDSLST if dli_vec_shadow_hi nonzero
@@ -81,13 +88,16 @@ speed_value := $06F9 ; decoded speed (1-8)
current_player := $06FE ; *think* this ranges 1-4, not 0-3
score := $0700
lives := $070A
+bullet_flags := $0756 ; 4 bytes, 0 = bullet slot not in use, non-0 = bullet active
+bullet_x_delta := $075A ; 4 bytes
+bullet_y_delta := $075E ; 4 bytes
work_level_desc := $0780 ; first 2 bytes are level number in screencodes
work_level_sub0 := $0782 ; a subroutine
work_level_sub1 := $0784 ; a subroutine
work_level_sub2 := $0786 ; a subroutine
work_level_sub3 := $0788 ; a subroutine
work_level_num_bombs:= $078A ; number of bombs to pick up on this level
-work_level_bullet_chance:= $078B ; 0 = no bullets
+work_level_bullet_max:= $078B ; 0 = no bullets, range 0-4.
work_level_y_start:= $078C ; jumpman starting Y position
work_level_x_start:= $078D ; jumpman starting X position
work_level_offs_14:= $078E ; points to $0600
@@ -115,7 +125,7 @@ cur_level_sub1 := $07C4 ; a subroutine
cur_level_sub2 := $07C6 ; a subroutine
cur_level_sub3 := $07C8 ; a subroutine
cur_level_num_bombs:= $07CA ; number of bombs to pick up on this level
-cur_level_bullet_chance:= $07CB ; 0 = no bullets
+cur_level_bullet_max:= $07CB ; 0 = no bullets, range 0-4.
cur_level_y_start:= $07CC ; jumpman starting Y position
cur_level_x_start:= $07CD ; jumpman starting X position
cur_level_offs_14:= $07CE ; points to $0600
@@ -673,12 +683,12 @@ position_missiles:
L8295: dex ; 8295 CA .
beq missiles_done ; 8296 F0 45 .E
lda $069A,x ; 8298 BD 9A 06 ...
- cmp $06A2,x ; 829B DD A2 06 ...
+ cmp bullet_y_pos+3,x ; 829B DD A2 06 ...
beq L82A6 ; 829E F0 06 ..
- sta $06A2,x ; 82A0 9D A2 06 ...
+ sta bullet_y_pos+3,x ; 82A0 9D A2 06 ...
sta HPOSP3,x ; 82A3 9D 03 D0 ...
L82A6: lda $06A6,x ; 82A6 BD A6 06 ...
- cmp $069E,x ; 82A9 DD 9E 06 ...
+ cmp bullet_x_pos+3,x ; 82A9 DD 9E 06 ...
beq L8295 ; 82AC F0 E7 ..
tay ; 82AE A8 .
lda $2B00,y ; 82AF B9 00 2B ..+
@@ -687,7 +697,7 @@ L82A6: lda $06A6,x ; 82A6 BD A6 06
lda $2B01,y ; 82B8 B9 01 2B ..+
and missiles_mask_table_minus_one,x ; 82BB 3D DF 82 =..
sta $2B01,y ; 82BE 99 01 2B ..+
- lda $069E,x ; 82C1 BD 9E 06 ...
+ lda bullet_x_pos+3,x ; 82C1 BD 9E 06 ...
sta $06A6,x ; 82C4 9D A6 06 ...
tay ; 82C7 A8 .
lda $2B00,y ; 82C8 B9 00 2B ..+
@@ -794,10 +804,9 @@ L8370: lda ($CD),y ; 8370 B1 CD
; ----------------------------------------------------------------------------
init_hardware:
ldx #$18 ; 837C A2 18 ..
-; movement_direction_table+31 should read data_table_85de-1, da65 isn't perfect yet
init_page6_loop:
- lda movement_direction_table+31,x ; 837E BD DD 85 ...
- sta $05FF,x ; 8381 9D FF 05 ...
+ lda page6_initial_vectors_minus_one+10,x; 837E BD DD 85 ...
+ sta page6_vectors_minus_one,x ; 8381 9D FF 05 ...
dex ; 8384 CA .
bne init_page6_loop ; 8385 D0 F7 ..
stx AUDCTL ; 8387 8E 08 D2 ...
@@ -854,7 +863,7 @@ set_savmsc:
set_vkeybd:
sta VKEYBD_hi ; 83ED 8D 09 02 ...
ldx #$07 ; 83F0 A2 07 ..
-L83F2: lda L8405,x ; 83F2 BD 05 84 ...
+L83F2: lda stub,x ; 83F2 BD 05 84 ...
sta $06D8,x ; 83F5 9D D8 06 ...
dex ; 83F8 CA .
bne L83F2 ; 83F9 D0 F7 ..
@@ -865,7 +874,8 @@ L83F2: lda L8405,x ; 83F2 BD 05 84
set_vvblki:
jsr SETVBV ; 8401 20 5C E4 \.
cld ; 8404 D8 .
-L8405: rts ; 8405 60 `
+; just an RTS
+stub: rts ; 8405 60 `
; ----------------------------------------------------------------------------
data_8406:
@@ -890,7 +900,7 @@ L841F: inc jiffy_timer_1 ; 841F EE 1A 06
and #$01 ; 842B 29 01 ).
sta $061C ; 842D 8D 1C 06 ...
lda #$00 ; 8430 A9 00 ..
- sta $0621 ; 8432 8D 21 06 .!.
+ sta falling_flag ; 8432 8D 21 06 .!.
sta $0622 ; 8435 8D 22 06 .".
sta $06FD ; 8438 8D FD 06 ...
inc $061D ; 843B EE 1D 06 ...
@@ -903,7 +913,7 @@ L841F: inc jiffy_timer_1 ; 841F EE 1A 06
bcc L846E ; 844E 90 1E ..
lda #$00 ; 8450 A9 00 ..
sta $061D ; 8452 8D 1D 06 ...
- inc $0621 ; 8455 EE 21 06 .!.
+ inc falling_flag ; 8455 EE 21 06 .!.
inc $061F ; 8458 EE 1F 06 ...
inc $0620 ; 845B EE 20 06 . .
lda $061F ; 845E AD 1F 06 ...
@@ -972,9 +982,9 @@ read_trigger:
L84D9: ldx #$08 ; 84D9 A2 08 ..
L84DB: lda work_level_desc+1,x ; 84DB BD 81 07 ...
beq L84EE ; 84DE F0 0E ..
- sta $0603,x ; 84E0 9D 03 06 ...
+ sta page6_vectors+3,x ; 84E0 9D 03 06 ...
lda work_level_desc,x ; 84E3 BD 80 07 ...
- sta $0602,x ; 84E6 9D 02 06 ...
+ sta page6_vectors+2,x ; 84E6 9D 02 06 ...
lda #$00 ; 84E9 A9 00 ..
sta work_level_desc+1,x ; 84EB 9D 81 07 ...
L84EE: dex ; 84EE CA .
@@ -1084,10 +1094,10 @@ L858D: ldx $0618 ; 858D AE 18 06
; ----------------------------------------------------------------------------
L859C: inc $0618 ; 859C EE 18 06 ...
inc $0618 ; 859F EE 18 06 ...
- lda $0601,x ; 85A2 BD 01 06 ...
+ lda page6_vectors+1,x ; 85A2 BD 01 06 ...
beq L858D ; 85A5 F0 E6 ..
sta $06E5 ; 85A7 8D E5 06 ...
- lda $0600,x ; 85AA BD 00 06 ...
+ lda page6_vectors,x ; 85AA BD 00 06 ...
sta $06E4 ; 85AD 8D E4 06 ...
jsr L06E3 ; 85B0 20 E3 06 ..
jmp L858D ; 85B3 4C 8D 85 L..
@@ -1101,14 +1111,28 @@ data_table_85b6:
movement_direction_table:
.word $0000,$0000,$0000,$0000 ; 85BE 00 00 00 00 00 00 00 00 ........
.word $0000,$0101,$FF01,$0001 ; 85C6 00 00 01 01 01 FF 01 00 ........
- .word $0000,$01FF,$FFFF,$00FF ; 85CE 00 00 FF 01 FF FF FF 00 ........
- .word $0000,$0100,$FF00,$0000 ; 85D6 00 00 00 01 00 FF 00 00 ........
-; ----------------------------------------------------------------------------
-; dunno what this is for yet, but it's copied into page 6 by init_hardware
-data_table_85de:
- .byte $C8,$88,$05,$84,$05,$84,$05,$84 ; 85DE C8 88 05 84 05 84 05 84 ........
- .byte $05,$84,$05,$84,$05,$84,$00,$98 ; 85E6 05 84 05 84 05 84 00 98 ........
- .byte $93,$82,$69,$8E,$00,$89,$57,$81 ; 85EE 93 82 69 8E 00 89 57 81 ..i...W.
+ .word $0000,$01FF ; 85CE 00 00 FF 01 ....
+ .byte $FF ; 85D2 FF .
+; 1-indexed
+page6_initial_vectors_minus_one:
+ .word $FFFF,$0000,$0000,$0001 ; 85D3 FF FF 00 00 00 00 01 00 ........
+ .word $00FF ; 85DB FF 00 ..
+ .byte $00 ; 85DD 00 .
+; copied into page 6 by init_hardware
+page6_initial_vectors:
+ .addr check_consol ; 85DE C8 88 ..
+ .addr stub ; 85E0 05 84 ..
+ .addr stub ; 85E2 05 84 ..
+ .addr stub ; 85E4 05 84 ..
+ .addr stub ; 85E6 05 84 ..
+ .addr stub ; 85E8 05 84 ..
+ .addr stub ; 85EA 05 84 ..
+ .addr check_falling_1 ; 85EC 00 98 ..
+ .addr position_missiles ; 85EE 93 82 ..
+ .addr bullet_logic ; 85F0 69 8E i.
+ .addr check_falling_2 ; 85F2 00 89 ..
+ .addr sfx_player_entry ; 85F4 57 81 W.
+; ----------------------------------------------------------------------------
; probably just filler
zero_filler_85f6:
.byte $00,$00,$00,$00,$00,$00,$00,$00 ; 85F6 00 00 00 00 00 00 00 00 ........
@@ -1322,7 +1346,7 @@ ej_loop:lda #$E6 ; 8777 A9 E6
bne ej_loop ; 8783 D0 F2 ..
stx joystick_disabled ; 8785 8E 32 06 .2.
stx sfx_lock ; 8788 8E 2F 06 ./.
- stx work_level_bullet_chance ; 878B 8E 8B 07 ...
+ stx work_level_bullet_max ; 878B 8E 8B 07 ...
jsr clear_pm_mem ; 878E 20 2A 87 *.
jsr silence_audio ; 8791 20 5B 87 [.
lda #$30 ; 8794 A9 30 .0
@@ -1344,13 +1368,13 @@ check_bomb_coll:
; ----------------------------------------------------------------------------
; Jumpman just picked up a bomb, award points, play sfx_bomb_pickup, make the bomb disappear, do some other stuff I don't understand yet
bomb_pickup:
- lda $067E ; 87A8 AD 7E 06 .~.
+ lda player_x_pos ; 87A8 AD 7E 06 .~.
clc ; 87AB 18 .
adc work_level_offs_14 ; 87AC 6D 8E 07 m..
and #$E0 ; 87AF 29 E0 ).
sta $B6 ; 87B1 85 B6 ..
clc ; 87B3 18 .
- lda $0683 ; 87B4 AD 83 06 ...
+ lda player_y_pos ; 87B4 AD 83 06 ...
adc work_level_offs_14+1 ; 87B7 6D 8F 07 m..
and #$E0 ; 87BA 29 E0 ).
lsr a ; 87BC 4A J
@@ -1517,7 +1541,9 @@ L88E7: lda $A2 ; 88E7 A5 A2
zero_filler_88f9:
.byte $00,$00,$00,$00,$00,$00,$00 ; 88F9 00 00 00 00 00 00 00 .......
; ----------------------------------------------------------------------------
- lda $0621 ; 8900 AD 21 06 .!.
+; called via vector in page 6
+check_falling_2:
+ lda falling_flag ; 8900 AD 21 06 .!.
beq L890F ; 8903 F0 0A ..
lda $0623 ; 8905 AD 23 06 .#.
cmp #$01 ; 8908 C9 01 ..
@@ -1542,13 +1568,14 @@ L8910: lda $06EE ; 8910 AD EE 06
and #$0F ; 892E 29 0F ).
sta $0688 ; 8930 8D 88 06 ...
inc $0688 ; 8933 EE 88 06 ...
+play_sfx_death:
lda #$60 ; 8936 A9 60 .`
sta sfx_slot_tempo ; 8938 8D 3E 06 .>.
lda #$8A ; 893B A9 8A ..
sta sfx_slot_timer ; 893D 8D 3F 06 .?.
lda #$07 ; 8940 A9 07 ..
jsr cue_sfx_lowprior_jv ; 8942 20 03 80 ..
-L8945: lda $0683 ; 8945 AD 83 06 ...
+L8945: lda player_y_pos ; 8945 AD 83 06 ...
cmp #$C6 ; 8948 C9 C6 ..
bcc L895D ; 894A 90 11 ..
lda #$00 ; 894C A9 00 ..
@@ -1564,9 +1591,9 @@ L895D: lda #$70 ; 895D A9 70
sta game_display_list ; 8962 8D 81 08 ...
lda $06EA ; 8965 AD EA 06 ...
bne L89A9 ; 8968 D0 3F .?
-L896A: inc $0683 ; 896A EE 83 06 ...
- inc $0683 ; 896D EE 83 06 ...
- lda $0683 ; 8970 AD 83 06 ...
+L896A: inc player_y_pos ; 896A EE 83 06 ...
+ inc player_y_pos ; 896D EE 83 06 ...
+ lda player_y_pos ; 8970 AD 83 06 ...
sta AUDF1 ; 8973 8D 00 D2 ...
lda #$A3 ; 8976 A9 A3 ..
sta AUDC1 ; 8978 8D 01 D2 ...
@@ -1602,26 +1629,26 @@ L89A9: ldx $06EA ; 89A9 AE EA 06
jmp L896A ; 89B5 4C 6A 89 Lj.
; ----------------------------------------------------------------------------
-L89B8: ldy data_table_8a39,x ; 89B8 BC 39 8A .9.
+L89B8: ldy falling_table_1,x ; 89B8 BC 39 8A .9.
lda $06E9 ; 89BB AD E9 06 ...
cmp #$01 ; 89BE C9 01 ..
beq L89D1 ; 89C0 F0 0F ..
ldy #$00 ; 89C2 A0 00 ..
cmp #$02 ; 89C4 C9 02 ..
beq L89D1 ; 89C6 F0 09 ..
- lda data_table_8a39,x ; 89C8 BD 39 8A .9.
+ lda falling_table_1,x ; 89C8 BD 39 8A .9.
eor #$FF ; 89CB 49 FF I.
clc ; 89CD 18 .
adc #$01 ; 89CE 69 01 i.
tay ; 89D0 A8 .
L89D1: clc ; 89D1 18 .
tya ; 89D2 98 .
- adc $067E ; 89D3 6D 7E 06 m~.
- sta $067E ; 89D6 8D 7E 06 .~.
- lda L8A42,x ; 89D9 BD 42 8A .B.
+ adc player_x_pos ; 89D3 6D 7E 06 m~.
+ sta player_x_pos ; 89D6 8D 7E 06 .~.
+ lda falling_table_2,x ; 89D9 BD 42 8A .B.
clc ; 89DC 18 .
- adc $0683 ; 89DD 6D 83 06 m..
- sta $0683 ; 89E0 8D 83 06 ...
+ adc player_y_pos ; 89DD 6D 83 06 m..
+ sta player_y_pos ; 89E0 8D 83 06 ...
sta AUDF1 ; 89E3 8D 00 D2 ...
inc $06EA ; 89E6 EE EA 06 ...
clc ; 89E9 18 .
@@ -1663,16 +1690,17 @@ L8A25: lda #$09 ; 8A25 A9 09
sta player_speed ; 8A27 8D 24 06 .$.
lda #$00 ; 8A2A A9 00 ..
sta $0623 ; 8A2C 8D 23 06 .#.
- sta $067E ; 8A2F 8D 7E 06 .~.
+ sta player_x_pos ; 8A2F 8D 7E 06 .~.
dec lives ; 8A32 CE 0A 07 ...
sta $06EE ; 8A35 8D EE 06 ...
rts ; 8A38 60 `
; ----------------------------------------------------------------------------
-data_table_8a39:
+falling_table_1:
.byte $02,$02,$02,$02,$02,$02,$00,$00 ; 8A39 02 02 02 02 02 02 00 00 ........
.byte $00 ; 8A41 00 .
-L8A42: .byte $FE,$FE,$00,$00,$02,$02,$02,$02 ; 8A42 FE FE 00 00 02 02 02 02 ........
+falling_table_2:
+ .byte $FE,$FE,$00,$00,$02,$02,$02,$02 ; 8A42 FE FE 00 00 02 02 02 02 ........
.byte $02 ; 8A4A 02 .
; used when jumpman is falling?
sfx_bounce_1:
@@ -1713,7 +1741,7 @@ cart_entry_point:
lda #$00 ; 8AC2 A9 00 ..
; clear pages 6 and 7
init_loop:
- sta $0600,x ; 8AC4 9D 00 06 ...
+ sta page6_vectors,x ; 8AC4 9D 00 06 ...
sta score,x ; 8AC7 9D 00 07 ...
inx ; 8ACA E8 .
bne init_loop ; 8ACB D0 F7 ..
@@ -1757,7 +1785,7 @@ zero_filler_8b00:
; ----------------------------------------------------------------------------
L8B23: ldx #$20 ; 8B23 A2 20 .
lda #$00 ; 8B25 A9 00 ..
-L8B27: sta $075F,x ; 8B27 9D 5F 07 ._.
+L8B27: sta bullet_y_delta+1,x ; 8B27 9D 5F 07 ._.
dex ; 8B2A CA .
bne L8B27 ; 8B2B D0 FA ..
L8B2D: lda work_level_unkn_table0 ; 8B2D AD 94 07 ...
@@ -2223,73 +2251,94 @@ L8E5D: lda jiffy_timer_1 ; 8E5D AD 1A 06
zero_filler_8e67:
.byte $00,$00 ; 8E67 00 00 ..
; ----------------------------------------------------------------------------
+; not sure what $0622, $0623 are for yet
+bullet_logic:
lda $0622 ; 8E69 AD 22 06 .".
- beq L8E75 ; 8E6C F0 07 ..
+ beq no_bullet ; 8E6C F0 07 ..
lda $0623 ; 8E6E AD 23 06 .#.
cmp #$02 ; 8E71 C9 02 ..
- bne L8E76 ; 8E73 D0 01 ..
-L8E75: rts ; 8E75 60 `
-
-; ----------------------------------------------------------------------------
-L8E76: ldx #$FF ; 8E76 A2 FF ..
-L8E78: inx ; 8E78 E8 .
- cpx work_level_bullet_chance ; 8E79 EC 8B 07 ...
- beq L8E75 ; 8E7C F0 F7 ..
- lda $0756,x ; 8E7E BD 56 07 .V.
- bne L8EB9 ; 8E81 D0 36 .6
- inc $0756,x ; 8E83 FE 56 07 .V.
-L8E86: lda RANDOM ; 8E86 AD 0A D2 ...
+ bne want_bullet ; 8E73 D0 01 ..
+no_bullet:
+ rts ; 8E75 60 `
+
+; ----------------------------------------------------------------------------
+; create a bullet unless there are already max_bullets of them
+want_bullet:
+ ldx #$FF ; 8E76 A2 FF ..
+next_bullet_slot:
+ inx ; 8E78 E8 .
+ cpx work_level_bullet_max ; 8E79 EC 8B 07 ...
+ beq no_bullet ; 8E7C F0 F7 ..
+ lda bullet_flags,x ; 8E7E BD 56 07 .V.
+ bne fire_when_ready ; 8E81 D0 36 .6
+ inc bullet_flags,x ; 8E83 FE 56 07 .V.
+; A = rand() % 3 + 1; // bullets only come from left, right, or top (never bottom)
+rand_1_to_3:
+ lda RANDOM ; 8E86 AD 0A D2 ...
and #$03 ; 8E89 29 03 ).
- beq L8E86 ; 8E8B F0 F9 ..
+ beq rand_1_to_3 ; 8E8B F0 F9 ..
tay ; 8E8D A8 .
lda RANDOM ; 8E8E AD 0A D2 ...
- sta $069B,x ; 8E91 9D 9B 06 ...
- sta $069F,x ; 8E94 9D 9F 06 ...
- lda L8F42,y ; 8E97 B9 42 8F .B.
+ sta bullet_x_pos,x ; 8E91 9D 9B 06 ...
+ sta bullet_y_pos,x ; 8E94 9D 9F 06 ...
+ lda bullet_table_minus_one,y ; 8E97 B9 42 8F .B.
beq L8E9F ; 8E9A F0 03 ..
- sta $069B,x ; 8E9C 9D 9B 06 ...
+ sta bullet_x_pos,x ; 8E9C 9D 9B 06 ...
L8E9F: lda L8F45,y ; 8E9F B9 45 8F .E.
- beq L8EA7 ; 8EA2 F0 03 ..
- sta $069F,x ; 8EA4 9D 9F 06 ...
-L8EA7: lda RANDOM ; 8EA7 AD 0A D2 ...
+ beq set_bullet_dir ; 8EA2 F0 03 ..
+ sta bullet_y_pos,x ; 8EA4 9D 9F 06 ...
+; initial direction (before it fires)
+set_bullet_dir:
+ lda RANDOM ; 8EA7 AD 0A D2 ...
and #$03 ; 8EAA 29 03 ).
tay ; 8EAC A8 .
lda L8F49,y ; 8EAD B9 49 8F .I.
- sta $075A,x ; 8EB0 9D 5A 07 .Z.
+ sta bullet_x_delta,x ; 8EB0 9D 5A 07 .Z.
lda L8F4D,y ; 8EB3 B9 4D 8F .M.
- sta $075E,x ; 8EB6 9D 5E 07 .^.
-L8EB9: cmp #$02 ; 8EB9 C9 02 ..
- beq L8F11 ; 8EBB F0 54 .T
- lda $069B,x ; 8EBD BD 9B 06 ...
+ sta bullet_y_delta,x ; 8EB6 9D 5E 07 .^.
+; fire at player if lined up with him, otherwise don't. either way we end up at move_bullet
+fire_when_ready:
+ cmp #$02 ; 8EB9 C9 02 ..
+ beq move_bullet ; 8EBB F0 54 .T
+ lda bullet_x_pos,x ; 8EBD BD 9B 06 ...
sec ; 8EC0 38 8
- sbc #$03 ; 8EC1 E9 03 ..
- cmp $067E ; 8EC3 CD 7E 06 .~.
- beq L8ED6 ; 8EC6 F0 0E ..
- lda $069F,x ; 8EC8 BD 9F 06 ...
+; aim at center of body mass!
+sbc3: sbc #$03 ; 8EC1 E9 03 ..
+ cmp player_x_pos ; 8EC3 CD 7E 06 .~.
+ beq aim_bullet_y ; 8EC6 F0 0E ..
+ lda bullet_y_pos,x ; 8EC8 BD 9F 06 ...
sec ; 8ECB 38 8
sbc #$04 ; 8ECC E9 04 ..
- cmp $0683 ; 8ECE CD 83 06 ...
- beq L8EE4 ; 8ED1 F0 11 ..
- jmp L8F11 ; 8ED3 4C 11 8F L..
+ cmp player_y_pos ; 8ECE CD 83 06 ...
+ beq aim_bullet_x ; 8ED1 F0 11 ..
+ jmp move_bullet ; 8ED3 4C 11 8F L..
; ----------------------------------------------------------------------------
-L8ED6: ldy #$00 ; 8ED6 A0 00 ..
- lda $069F,x ; 8ED8 BD 9F 06 ...
- cmp $0683 ; 8EDB CD 83 06 ...
- bcs L8EEF ; 8EDE B0 0F ..
+; take aim!
+aim_bullet_y:
+ ldy #$00 ; 8ED6 A0 00 ..
+ lda bullet_y_pos,x ; 8ED8 BD 9F 06 ...
+ cmp player_y_pos ; 8EDB CD 83 06 ...
+ bcs fire_bullet ; 8EDE B0 0F ..
iny ; 8EE0 C8 .
- jmp L8EEF ; 8EE1 4C EF 8E L..
+ jmp fire_bullet ; 8EE1 4C EF 8E L..
; ----------------------------------------------------------------------------
-L8EE4: ldy #$02 ; 8EE4 A0 02 ..
- lda $069B,x ; 8EE6 BD 9B 06 ...
- cmp $067E ; 8EE9 CD 7E 06 .~.
- bcs L8EEF ; 8EEC B0 01 ..
+; take aim!
+aim_bullet_x:
+ ldy #$02 ; 8EE4 A0 02 ..
+ lda bullet_x_pos,x ; 8EE6 BD 9B 06 ...
+ cmp player_x_pos ; 8EE9 CD 7E 06 .~.
+ bcs fire_bullet ; 8EEC B0 01 ..
iny ; 8EEE C8 .
-L8EEF: lda L8F51,y ; 8EEF B9 51 8F .Q.
- sta $075A,x ; 8EF2 9D 5A 07 .Z.
+; fire! Y reg indexes table of directions
+fire_bullet:
+ lda L8F51,y ; 8EEF B9 51 8F .Q.
+ sta bullet_x_delta,x ; 8EF2 9D 5A 07 .Z.
lda L8F55,y ; 8EF5 B9 55 8F .U.
- sta $075E,x ; 8EF8 9D 5E 07 .^.
+ sta bullet_y_delta,x ; 8EF8 9D 5E 07 .^.
+; let player hear report
+play_sfx_bullet:
lda #$59 ; 8EFB A9 59 .Y
sta sfx_slot_tempo ; 8EFD 8D 3E 06 .>.
lda #$8F ; 8F00 A9 8F ..
@@ -2300,44 +2349,49 @@ L8EEF: lda L8F51,y ; 8EEF B9 51 8F
jsr cue_sfx_lowprior_jv ; 8F09 20 03 80 ..
pla ; 8F0C 68 h
tax ; 8F0D AA .
- inc $0756,x ; 8F0E FE 56 07 .V.
-L8F11: lda $069B,x ; 8F11 BD 9B 06 ...
+ inc bullet_flags,x ; 8F0E FE 56 07 .V.
+move_bullet:
+ lda bullet_x_pos,x ; 8F11 BD 9B 06 ...
clc ; 8F14 18 .
- adc $075A,x ; 8F15 7D 5A 07 }Z.
+ adc bullet_x_delta,x ; 8F15 7D 5A 07 }Z.
cmp #$03 ; 8F18 C9 03 ..
bcc code_8f38 ; 8F1A 90 1C ..
cmp #$FD ; 8F1C C9 FD ..
bcs code_8f38 ; 8F1E B0 18 ..
- sta $069B,x ; 8F20 9D 9B 06 ...
- lda $069F,x ; 8F23 BD 9F 06 ...
+ sta bullet_x_pos,x ; 8F20 9D 9B 06 ...
+ lda bullet_y_pos,x ; 8F23 BD 9F 06 ...
clc ; 8F26 18 .
- adc $075E,x ; 8F27 7D 5E 07 }^.
+ adc bullet_y_delta,x ; 8F27 7D 5E 07 }^.
cmp #$03 ; 8F2A C9 03 ..
bcc code_8f38 ; 8F2C 90 0A ..
cmp #$CE ; 8F2E C9 CE ..
bcs code_8f38 ; 8F30 B0 06 ..
- sta $069F,x ; 8F32 9D 9F 06 ...
- jmp L8E78 ; 8F35 4C 78 8E Lx.
+ sta bullet_y_pos,x ; 8F32 9D 9F 06 ...
+ jmp next_bullet_slot ; 8F35 4C 78 8E Lx.
; ----------------------------------------------------------------------------
code_8f38:
lda #$00 ; 8F38 A9 00 ..
- sta $0756,x ; 8F3A 9D 56 07 .V.
- sta $069B,x ; 8F3D 9D 9B 06 ...
-L8F42 := * + 2
- jmp L8E78 ; 8F40 4C 78 8E Lx.
+ sta bullet_flags,x ; 8F3A 9D 56 07 .V.
+ sta bullet_x_pos,x ; 8F3D 9D 9B 06 ...
+bullet_table_minus_one:= * + 2 ; 1-indexed
+ jmp next_bullet_slot ; 8F40 4C 78 8E Lx.
; ----------------------------------------------------------------------------
-data_8f43:
+; used by bullet_logic
+bullet_table:
.byte $04,$FC ; 8F43 04 FC ..
L8F45: .byte $00,$00,$00,$04 ; 8F45 00 00 00 04 ....
L8F49: .byte $FF,$00,$01,$00 ; 8F49 FF 00 01 00 ....
L8F4D: .byte $00,$FF,$00,$01 ; 8F4D 00 FF 00 01 ....
L8F51: .byte $00,$00,$FD,$03 ; 8F51 00 00 FD 03 ....
-L8F55: .byte $FD,$03,$00,$00,$01,$8E,$00,$14 ; 8F55 FD 03 00 00 01 8E 00 14 ........
- .byte $02,$01,$8B,$00,$14,$03,$01,$88 ; 8F5D 02 01 8B 00 14 03 01 88 ........
- .byte $00,$14,$05,$01,$85,$00,$14,$07 ; 8F65 00 14 05 01 85 00 14 07 ........
- .byte $01,$82,$00,$14,$09,$00 ; 8F6D 01 82 00 14 09 00 ......
+L8F55: .byte $FD,$03,$00,$00 ; 8F55 FD 03 00 00 ....
+; bang!
+sfx_bullet:
+ .byte $01,$8E,$00,$14,$02,$01,$8B,$00 ; 8F59 01 8E 00 14 02 01 8B 00 ........
+ .byte $14,$03,$01,$88,$00,$14,$05,$01 ; 8F61 14 03 01 88 00 14 05 01 ........
+ .byte $85,$00,$14,$07,$01,$82,$00,$14 ; 8F69 85 00 14 07 01 82 00 14 ........
+ .byte $09,$00 ; 8F71 09 00 ..
; ----------------------------------------------------------------------------
; did any missile hit a player, or did players 2 or 3 hit a player...
check_collisions_1:
@@ -3267,9 +3321,9 @@ mj_clear_loop:
sta $BA ; 979A 85 BA ..
sta AUDF4 ; 979C 8D 06 D2 ...
lda work_level_y_start ; 979F AD 8C 07 ...
- sta $0683 ; 97A2 8D 83 06 ...
+ sta player_y_pos ; 97A2 8D 83 06 ...
lda work_level_x_start ; 97A5 AD 8D 07 ...
- sta $067E ; 97A8 8D 7E 06 .~.
+ sta player_x_pos ; 97A8 8D 7E 06 .~.
lda #$01 ; 97AB A9 01 ..
sta $0688 ; 97AD 8D 88 06 ...
lda #$A5 ; 97B0 A9 A5 ..
@@ -3315,14 +3369,16 @@ zero_filler_97f0:
.byte $00,$00,$00,$00,$00,$00,$00,$00 ; 97F0 00 00 00 00 00 00 00 00 ........
.byte $00,$00,$00,$00,$00,$00,$00,$00 ; 97F8 00 00 00 00 00 00 00 00 ........
; ----------------------------------------------------------------------------
- lda $0621 ; 9800 AD 21 06 .!.
+; called via vector in page 6
+check_falling_1:
+ lda falling_flag ; 9800 AD 21 06 .!.
bne L9806 ; 9803 D0 01 ..
L9805: rts ; 9805 60 `
; ----------------------------------------------------------------------------
L9806: lda $0623 ; 9806 AD 23 06 .#.
bne L9805 ; 9809 D0 FA ..
- lda $0683 ; 980B AD 83 06 ...
+ lda player_y_pos ; 980B AD 83 06 ...
cmp #$C6 ; 980E C9 C6 ..
bcs L982E ; 9810 B0 1C ..
lda jump_frame ; 9812 AD EB 06 ...
@@ -3353,8 +3409,8 @@ check_collisions_3:
and #$03 ; 983D 29 03 ).
bne check_trigger_state ; 983F D0 0C ..
inc $06ED ; 9841 EE ED 06 ...
- inc $0683 ; 9844 EE 83 06 ...
- inc $0683 ; 9847 EE 83 06 ...
+ inc player_y_pos ; 9844 EE 83 06 ...
+ inc player_y_pos ; 9847 EE 83 06 ...
jmp L989F ; 984A 4C 9F 98 L..
; ----------------------------------------------------------------------------
@@ -3390,12 +3446,12 @@ L9870: jsr check_up_down_2 ; 9870 20 3B 99
jmp L98D0 ; 9875 4C D0 98 L..
; ----------------------------------------------------------------------------
-L9878: sta $067E ; 9878 8D 7E 06 .~.
+L9878: sta player_x_pos ; 9878 8D 7E 06 .~.
lda player_delta_y ; 987B AD 31 06 .1.
asl a ; 987E 0A .
clc ; 987F 18 .
- adc $0683 ; 9880 6D 83 06 m..
- sta $0683 ; 9883 8D 83 06 ...
+ adc player_y_pos ; 9880 6D 83 06 m..
+ sta player_y_pos ; 9883 8D 83 06 ...
lda $0620 ; 9886 AD 20 06 . .
clc ; 9889 18 .
adc #$04 ; 988A 69 04 i.
@@ -3418,8 +3474,8 @@ L989F: lda player_delta_x ; 989F AD 30 06
beq L98AD ; 98A9 F0 02 ..
ldx #$0C ; 98AB A2 0C ..
L98AD: clc ; 98AD 18 .
- adc $067E ; 98AE 6D 7E 06 m~.
- sta $067E ; 98B1 8D 7E 06 .~.
+ adc player_x_pos ; 98AE 6D 7E 06 m~.
+ sta player_x_pos ; 98B1 8D 7E 06 .~.
txa ; 98B4 8A .
clc ; 98B5 18 .
adc $0620 ; 98B6 6D 20 06 m .
@@ -3438,8 +3494,8 @@ L98D0: lda collision_save+4 ; 98D0 AD B4 06
beq L98F0 ; 98D8 F0 16 ..
jsr L9971 ; 98DA 20 71 99 q.
bcc L990F ; 98DD 90 30 .0
- inc $0683 ; 98DF EE 83 06 ...
- inc $0683 ; 98E2 EE 83 06 ...
+ inc player_y_pos ; 98DF EE 83 06 ...
+ inc player_y_pos ; 98E2 EE 83 06 ...
lda $061F ; 98E5 AD 1F 06 ...
ora #$02 ; 98E8 09 02 ..
sta $0688 ; 98EA 8D 88 06 ...
@@ -3449,8 +3505,8 @@ L98D0: lda collision_save+4 ; 98D0 AD B4 06
L98F0: lda collision_save+4 ; 98F0 AD B4 06 ...
and #$01 ; 98F3 29 01 ).
beq L990F ; 98F5 F0 18 ..
- dec $0683 ; 98F7 CE 83 06 ...
- dec $0683 ; 98FA CE 83 06 ...
+ dec player_y_pos ; 98F7 CE 83 06 ...
+ dec player_y_pos ; 98FA CE 83 06 ...
lda $0688 ; 98FD AD 88 06 ...
cmp #$01 ; 9900 C9 01 ..
bne L990F ; 9902 D0 0B ..
@@ -3471,9 +3527,9 @@ L990F: lda $0688 ; 990F AD 88 06
sta $0688 ; 9922 8D 88 06 ...
L9925: lda $0688 ; 9925 AD 88 06 ...
sta $0689 ; 9928 8D 89 06 ...
- lda $067E ; 992B AD 7E 06 .~.
+ lda player_x_pos ; 992B AD 7E 06 .~.
sta $067F ; 992E 8D 7F 06 ...
- lda $0683 ; 9931 AD 83 06 ...
+ lda player_y_pos ; 9931 AD 83 06 ...
clc ; 9934 18 .
adc #$0A ; 9935 69 0A i.
sta $0684 ; 9937 8D 84 06 ...
@@ -3485,10 +3541,10 @@ check_up_down_2:
lda joystick_state ; 993B AD 33 06 .3.
cmp #$0D ; 993E C9 0D ..
bne L9949 ; 9940 D0 07 ..
- lda $0683 ; 9942 AD 83 06 ...
+ lda player_y_pos ; 9942 AD 83 06 ...
cmp #$C0 ; 9945 C9 C0 ..
bcs L9967 ; 9947 B0 1E ..
-L9949: lda $067E ; 9949 AD 7E 06 .~.
+L9949: lda player_x_pos ; 9949 AD 7E 06 .~.
sec ; 994C 38 8
sbc #$30 ; 994D E9 30 .0
sta zp_temp1 ; 994F 85 CB ..
@@ -3515,7 +3571,7 @@ L9969: lda work_level_offs_46+3,x ; 9969 BD B1 07
rts ; 9970 60 `
; ----------------------------------------------------------------------------
-L9971: lda $067E ; 9971 AD 7E 06 .~.
+L9971: lda player_x_pos ; 9971 AD 7E 06 .~.
sec ; 9974 38 8
sbc #$30 ; 9975 E9 30 .0
ldx #$06 ; 9977 A2 06 ..
@@ -3590,12 +3646,12 @@ continue_jump:
L99DB: ldy #$00 ; 99DB A0 00 ..
L99DD: clc ; 99DD 18 .
tya ; 99DE 98 .
- adc $067E ; 99DF 6D 7E 06 m~.
- sta $067E ; 99E2 8D 7E 06 .~.
+ adc player_x_pos ; 99DF 6D 7E 06 m~.
+ sta player_x_pos ; 99E2 8D 7E 06 .~.
lda jump_delta_y_table_minus_one,x ; 99E5 BD 31 9A .1.
clc ; 99E8 18 .
- adc $0683 ; 99E9 6D 83 06 m..
- sta $0683 ; 99EC 8D 83 06 ...
+ adc player_y_pos ; 99E9 6D 83 06 m..
+ sta player_y_pos ; 99EC 8D 83 06 ...
txa ; 99EF 8A .
cmp #$08 ; 99F0 C9 08 ..
bcs code_99f7 ; 99F2 B0 03 ..
@@ -3616,7 +3672,7 @@ code_99f7:
bcs end_jump ; 9A0D B0 A3 ..
jsr check_up_down_2 ; 9A0F 20 3B 99 ;.
bcc L9A19 ; 9A12 90 05 ..
- cmp $067E ; 9A14 CD 7E 06 .~.
+ cmp player_x_pos ; 9A14 CD 7E 06 .~.
beq end_jump ; 9A17 F0 99 ..
L9A19:
jump_delta_x_table_minus_one:= * + 2 ; 1-indexed...
@@ -4094,8 +4150,8 @@ level00_sub3:
; number of bombs to pick up on this level
level00_num_bombs:
.byte $0C ; A00A 0C .
-; 0 = no bullets
-level00_bullet_chance:
+; 0 = no bullets, range 0-4.
+level00_bullet_max:
.byte $01 ; A00B 01 .
; jumpman starting Y position
level00_y_start:
@@ -4187,8 +4243,8 @@ level01_sub3:
; number of bombs to pick up on this level
level01_num_bombs:
.byte $10 ; A04A 10 .
-; 0 = no bullets
-level01_bullet_chance:
+; 0 = no bullets, range 0-4.
+level01_bullet_max:
.byte $02 ; A04B 02 .
; jumpman starting Y position
level01_y_start:
@@ -4280,8 +4336,8 @@ level02_sub3:
; number of bombs to pick up on this level
level02_num_bombs:
.byte $0C ; A08A 0C .
-; 0 = no bullets
-level02_bullet_chance:
+; 0 = no bullets, range 0-4.
+level02_bullet_max:
.byte $00 ; A08B 00 .
; jumpman starting Y position
level02_y_start:
@@ -4373,8 +4429,8 @@ level03_sub3:
; number of bombs to pick up on this level
level03_num_bombs:
.byte $10 ; A0CA 10 .
-; 0 = no bullets
-level03_bullet_chance:
+; 0 = no bullets, range 0-4.
+level03_bullet_max:
.byte $00 ; A0CB 00 .
; jumpman starting Y position
level03_y_start:
@@ -4466,8 +4522,8 @@ level04_sub3:
; number of bombs to pick up on this level
level04_num_bombs:
.byte $0E ; A10A 0E .
-; 0 = no bullets
-level04_bullet_chance:
+; 0 = no bullets, range 0-4.
+level04_bullet_max:
.byte $02 ; A10B 02 .
; jumpman starting Y position
level04_y_start:
@@ -4559,8 +4615,8 @@ level05_sub3:
; number of bombs to pick up on this level
level05_num_bombs:
.byte $10 ; A14A 10 .
-; 0 = no bullets
-level05_bullet_chance:
+; 0 = no bullets, range 0-4.
+level05_bullet_max:
.byte $00 ; A14B 00 .
; jumpman starting Y position
level05_y_start:
@@ -4638,7 +4694,7 @@ level06_desc:
; ----------------------------------------------------------------------------
; a subroutine
level06_sub0:
- .addr LAD68 ; A182 68 AD h.
+ .addr zigzag_sub0 ; A182 68 AD h.
; a subroutine
level06_sub1:
.addr L0000 ; A184 00 00 ..
@@ -4652,8 +4708,8 @@ level06_sub3:
; number of bombs to pick up on this level
level06_num_bombs:
.byte $0E ; A18A 0E .
-; 0 = no bullets
-level06_bullet_chance:
+; 0 = no bullets, range 0-4.
+level06_bullet_max:
.byte $03 ; A18B 03 .
; jumpman starting Y position
level06_y_start:
@@ -4745,8 +4801,8 @@ level07_sub3:
; number of bombs to pick up on this level
level07_num_bombs:
.byte $0C ; A1CA 0C .
-; 0 = no bullets
-level07_bullet_chance:
+; 0 = no bullets, range 0-4.
+level07_bullet_max:
.byte $02 ; A1CB 02 .
; jumpman starting Y position
level07_y_start:
@@ -4838,8 +4894,8 @@ level08_sub3:
; number of bombs to pick up on this level
level08_num_bombs:
.byte $08 ; A20A 08 .
-; 0 = no bullets
-level08_bullet_chance:
+; 0 = no bullets, range 0-4.
+level08_bullet_max:
.byte $00 ; A20B 00 .
; jumpman starting Y position
level08_y_start:
@@ -4931,8 +4987,8 @@ level09_sub3:
; number of bombs to pick up on this level
level09_num_bombs:
.byte $0C ; A24A 0C .
-; 0 = no bullets
-level09_bullet_chance:
+; 0 = no bullets, range 0-4.
+level09_bullet_max:
.byte $02 ; A24B 02 .
; jumpman starting Y position
level09_y_start:
@@ -5024,8 +5080,8 @@ level10_sub3:
; number of bombs to pick up on this level
level10_num_bombs:
.byte $0F ; A28A 0F .
-; 0 = no bullets
-level10_bullet_chance:
+; 0 = no bullets, range 0-4.
+level10_bullet_max:
.byte $00 ; A28B 00 .
; jumpman starting Y position
level10_y_start:
@@ -5117,8 +5173,8 @@ level11_sub3:
; number of bombs to pick up on this level
level11_num_bombs:
.byte $0E ; A2CA 0E .
-; 0 = no bullets
-level11_bullet_chance:
+; 0 = no bullets, range 0-4.
+level11_bullet_max:
.byte $00 ; A2CB 00 .
; jumpman starting Y position
level11_y_start:
@@ -5284,7 +5340,7 @@ electrocution_bomb_pickup:
electrocution_done:
lda $0623 ; A4DD AD 23 06 .#.
bne LA4FF ; A4E0 D0 1D ..
- lda $0621 ; A4E2 AD 21 06 .!.
+ lda falling_flag ; A4E2 AD 21 06 .!.
bne LA4E8 ; A4E5 D0 01 ..
rts ; A4E7 60 `
@@ -5395,7 +5451,7 @@ dw_platform_player:
dumbwaiter_setup:
jsr L8036 ; A68C 20 36 80 6.
lda #$06 ; A68F A9 06 ..
- sta $0760 ; A691 8D 60 07 .`.
+ sta bullet_y_delta+2 ; A691 8D 60 07 .`.
ldy #$2A ; A694 A0 2A .*
LA696: ldx #$06 ; A696 A2 06 ..
LA698: lda LA781,x ; A698 BD 81 A7 ...
@@ -5407,7 +5463,7 @@ LA698: lda LA781,x ; A698 BD 81 A7
clc ; A6A3 18 .
adc #$1A ; A6A4 69 1A i.
tay ; A6A6 A8 .
- dec $0760 ; A6A7 CE 60 07 .`.
+ dec bullet_y_delta+2 ; A6A7 CE 60 07 .`.
bne LA696 ; A6AA D0 EA ..
lda #$FF ; A6AC A9 FF ..
sta SIZEM ; A6AE 8D 0C D0 ...
@@ -5493,7 +5549,7 @@ LA73D: lda collision_save+8 ; A73D AD B8 06
lda collision_save+4 ; A755 AD B4 06 ...
ora #$01 ; A758 09 01 ..
sta collision_save+4 ; A75A 8D B4 06 ...
- inc $0683 ; A75D EE 83 06 ...
+ inc player_y_pos ; A75D EE 83 06 ...
LA760: tya ; A760 98 .
and #$02 ; A761 29 02 ).
beq LA779 ; A763 F0 14 ..
@@ -5503,14 +5559,14 @@ LA760: tya ; A760 98
txa ; A76D 8A .
and #$02 ; A76E 29 02 ).
beq LA778 ; A770 F0 06 ..
- inc $0683 ; A772 EE 83 06 ...
+ inc player_y_pos ; A772 EE 83 06 ...
sta $0778 ; A775 8D 78 07 .x.
LA778: rts ; A778 60 `
; ----------------------------------------------------------------------------
-LA779: lda $0683 ; A779 AD 83 06 ...
+LA779: lda player_y_pos ; A779 AD 83 06 ...
and #$FE ; A77C 29 FE ).
- sta $0683 ; A77E 8D 83 06 ...
+ sta player_y_pos ; A77E 8D 83 06 ...
LA781: rts ; A781 60 `
; ----------------------------------------------------------------------------
@@ -5563,15 +5619,15 @@ LA842: rts ; A842 60
LA843: ldx #$05 ; A843 A2 05 ..
LA845: dex ; A845 CA .
beq LA842 ; A846 F0 FA ..
- lda $075F,x ; A848 BD 5F 07 ._.
+ lda bullet_y_delta+1,x ; A848 BD 5F 07 ._.
bne LA865 ; A84B D0 18 ..
lda RANDOM ; A84D AD 0A D2 ...
and #$1F ; A850 29 1F ).
bne LA845 ; A852 D0 F1 ..
- inc $075F,x ; A854 FE 5F 07 ._.
+ inc bullet_y_delta+1,x ; A854 FE 5F 07 ._.
lda #$00 ; A857 A9 00 ..
- sta $069E,x ; A859 9D 9E 06 ...
- lda $067E ; A85C AD 7E 06 .~.
+ sta bullet_x_pos+3,x ; A859 9D 9E 06 ...
+ lda player_x_pos ; A85C AD 7E 06 .~.
clc ; A85F 18 .
adc #$03 ; A860 69 03 i.
sta $069A,x ; A862 9D 9A 06 ...
@@ -5580,7 +5636,7 @@ LA865: lda $0763,x ; A865 BD 63 07
lda dli_vec_shadow_hi,x ; A86A BD AF 06 ...
and #$01 ; A86D 29 01 ).
beq LA89E ; A86F F0 2D .-
- lda $067E ; A871 AD 7E 06 .~.
+ lda player_x_pos ; A871 AD 7E 06 .~.
clc ; A874 18 .
adc #$03 ; A875 69 03 i.
ldy #$01 ; A877 A0 01 ..
@@ -5607,17 +5663,17 @@ play_hellstone_sfx:
LA89E: lda $0763,x ; A89E BD 63 07 .c.
bne LA8C1 ; A8A1 D0 1E ..
LA8A3: clc ; A8A3 18 .
- lda $069E,x ; A8A4 BD 9E 06 ...
+ lda bullet_x_pos+3,x ; A8A4 BD 9E 06 ...
adc #$02 ; A8A7 69 02 i.
cmp #$CE ; A8A9 C9 CE ..
bcs LA8B3 ; A8AB B0 06 ..
- sta $069E,x ; A8AD 9D 9E 06 ...
+ sta bullet_x_pos+3,x ; A8AD 9D 9E 06 ...
jmp LA845 ; A8B0 4C 45 A8 LE.
; ----------------------------------------------------------------------------
LA8B3: lda #$00 ; A8B3 A9 00 ..
sta $069A,x ; A8B5 9D 9A 06 ...
- sta $075F,x ; A8B8 9D 5F 07 ._.
+ sta bullet_y_delta+1,x ; A8B8 9D 5F 07 ._.
sta $0763,x ; A8BB 9D 63 07 .c.
jmp LA845 ; A8BE 4C 45 A8 LE.
@@ -5634,9 +5690,9 @@ LA8C1: lda $0767,x ; A8C1 BD 67 07
; ----------------------------------------------------------------------------
LA8D4: tay ; A8D4 A8 .
clc ; A8D5 18 .
- lda $069E,x ; A8D6 BD 9E 06 ...
+ lda bullet_x_pos+3,x ; A8D6 BD 9E 06 ...
adc LA905,y ; A8D9 79 05 A9 y..
- sta $069E,x ; A8DC 9D 9E 06 ...
+ sta bullet_x_pos+3,x ; A8DC 9D 9E 06 ...
lda data_table_a8fd,y ; A8DF B9 FD A8 ...
tay ; A8E2 A8 .
beq LA8EF ; A8E3 F0 0A ..
@@ -5769,10 +5825,10 @@ LAA5C: dex ; AA5C CA
lda collision_save+7,x ; AA5F BD B7 06 ...
and #$01 ; AA62 29 01 ).
beq LAA5C ; AA64 F0 F6 ..
- lda $067E ; AA66 AD 7E 06 .~.
+ lda player_x_pos ; AA66 AD 7E 06 .~.
clc ; AA69 18 .
adc $076F,x ; AA6A 7D 6F 07 }o.
- sta $067E ; AA6D 8D 7E 06 .~.
+ sta player_x_pos ; AA6D 8D 7E 06 .~.
jmp LAA5C ; AA70 4C 5C AA L\.
; ----------------------------------------------------------------------------
@@ -5904,16 +5960,18 @@ LAD02: .byte $00,$00,$16,$AD,$16,$AD,$20,$AD ; AD02 00 00 16 AD 16 AD 20 AD
.byte $9C,$FD,$00,$04,$04,$18,$0E,$FE ; AD5A 9C FD 00 04 04 18 0E FE ........
.byte $89,$9C,$8C,$31,$02,$FF ; AD62 89 9C 8C 31 02 FF ...1..
; ----------------------------------------------------------------------------
-LAD68: lda $0622 ; AD68 AD 22 06 .".
+; move bullets in ways that defy the laws of physics and common sense
+zigzag_sub0:
+ lda $0622 ; AD68 AD 22 06 .".
bne LAD6E ; AD6B D0 01 ..
LAD6D: rts ; AD6D 60 `
; ----------------------------------------------------------------------------
LAD6E: ldx #$FF ; AD6E A2 FF ..
LAD70: inx ; AD70 E8 .
- cpx work_level_bullet_chance ; AD71 EC 8B 07 ...
+ cpx work_level_bullet_max ; AD71 EC 8B 07 ...
beq LAD6D ; AD74 F0 F7 ..
- lda $0756,x ; AD76 BD 56 07 .V.
+ lda bullet_flags,x ; AD76 BD 56 07 .V.
cmp #$02 ; AD79 C9 02 ..
beq LAD8B ; AD7B F0 0E ..
sta $076C,x ; AD7D 9D 6C 07 .l.
@@ -5926,7 +5984,7 @@ LAD70: inx ; AD70 E8
LAD8B: cmp $076C,x ; AD8B DD 6C 07 .l.
beq LADA1 ; AD8E F0 11 ..
sta $076C,x ; AD90 9D 6C 07 .l.
- lda $075A,x ; AD93 BD 5A 07 .Z.
+ lda bullet_x_delta,x ; AD93 BD 5A 07 .Z.
beq LAD9E ; AD96 F0 06 ..
inc $0768,x ; AD98 FE 68 07 .h.
jmp LADA1 ; AD9B 4C A1 AD L..
@@ -5938,7 +5996,7 @@ LADA1: lda $0764,x ; ADA1 BD 64 07
and #$0F ; ADA6 29 0F ).
tay ; ADA8 A8 .
lda data_table_adc7,y ; ADA9 B9 C7 AD ...
- sta $075A,x ; ADAC 9D 5A 07 .Z.
+ sta bullet_x_delta,x ; ADAC 9D 5A 07 .Z.
inc $0764,x ; ADAF FE 64 07 .d.
jmp LAD70 ; ADB2 4C 70 AD Lp.
@@ -5948,7 +6006,7 @@ code_adb5:
and #$0F ; ADB8 29 0F ).
tay ; ADBA A8 .
lda data_table_adc7,y ; ADBB B9 C7 AD ...
- sta $075E,x ; ADBE 9D 5E 07 .^.
+ sta bullet_y_delta,x ; ADBE 9D 5E 07 .^.
code_adc1:
inc $0768,x ; ADC1 FE 68 07 .h.
jmp LAD70 ; ADC4 4C 70 AD Lp.
@@ -6218,25 +6276,25 @@ LB121: lda #$10 ; B121 A9 10
rts ; B13F 60 `
; ----------------------------------------------------------------------------
-LB140: lda $0621 ; B140 AD 21 06 .!.
+LB140: lda falling_flag ; B140 AD 21 06 .!.
bne LB146 ; B143 D0 01 ..
LB145: rts ; B145 60 `
; ----------------------------------------------------------------------------
-LB146: lda $067E ; B146 AD 7E 06 .~.
+LB146: lda player_x_pos ; B146 AD 7E 06 .~.
cmp #$34 ; B149 C9 34 .4
bcc LB145 ; B14B 90 F8 ..
cmp #$C9 ; B14D C9 C9 ..
bcs LB145 ; B14F B0 F4 ..
lda #$0B ; B151 A9 0B ..
sta $97 ; B153 85 97 ..
- lda $067E ; B155 AD 7E 06 .~.
+ lda player_x_pos ; B155 AD 7E 06 .~.
sec ; B158 38 8
sbc #$33 ; B159 E9 33 .3
lsr a ; B15B 4A J
lsr a ; B15C 4A J
sta $91 ; B15D 85 91 ..
- lda $0683 ; B15F AD 83 06 ...
+ lda player_y_pos ; B15F AD 83 06 ...
cmp #$C3 ; B162 C9 C3 ..
bcs LB145 ; B164 B0 DF ..
jsr LB1D2 ; B166 20 D2 B1 ..
@@ -6346,15 +6404,15 @@ LB27E: lda $06F5 ; B27E AD F5 06
rts ; B286 60 `
; ----------------------------------------------------------------------------
-LB287: inc $0760 ; B287 EE 60 07 .`.
- lda $0760 ; B28A AD 60 07 .`.
+LB287: inc bullet_y_delta+2 ; B287 EE 60 07 .`.
+ lda bullet_y_delta+2 ; B28A AD 60 07 .`.
and #$7F ; B28D 29 7F ).
beq LB292 ; B28F F0 01 ..
rts ; B291 60 `
; ----------------------------------------------------------------------------
-LB292: inc $0761 ; B292 EE 61 07 .a.
- lda $0761 ; B295 AD 61 07 .a.
+LB292: inc bullet_y_delta+3 ; B292 EE 61 07 .a.
+ lda bullet_y_delta+3 ; B295 AD 61 07 .a.
and #$07 ; B298 29 07 ).
tax ; B29A AA .
lda LB2D0,x ; B29B BD D0 B2 ...
@@ -6388,9 +6446,9 @@ LB2F2: lda $062A ; B2F2 AD 2A 06
; ----------------------------------------------------------------------------
LB2FD: lda $0680 ; B2FD AD 80 06 ...
- sta $067E ; B300 8D 7E 06 .~.
+ sta player_x_pos ; B300 8D 7E 06 .~.
lda $0685 ; B303 AD 85 06 ...
- sta $0683 ; B306 8D 83 06 ...
+ sta player_y_pos ; B306 8D 83 06 ...
lda #$19 ; B309 A9 19 ..
sta sfx_ptr ; B30B 8D 3C 06 .<.
lda #$B3 ; B30E A9 B3 ..
@@ -6517,7 +6575,7 @@ cue_woop_sound:
jsr cue_sfx_lowprior_jv ; B4DF 20 03 80 ..
LB4E2: ldy #$01 ; B4E2 A0 01 ..
lda $0681 ; B4E4 AD 81 06 ...
- cmp $067E ; B4E7 CD 7E 06 .~.
+ cmp player_x_pos ; B4E7 CD 7E 06 .~.
bcc LB4EE ; B4EA 90 02 ..
ldy #$FF ; B4EC A0 FF ..
LB4EE: sty $A0 ; B4EE 84 A0 ..
@@ -6526,7 +6584,7 @@ LB4EE: sty $A0 ; B4EE 84 A0
sta $0681 ; B4F3 8D 81 06 ...
ldy #$01 ; B4F6 A0 01 ..
lda $0686 ; B4F8 AD 86 06 ...
- cmp $0683 ; B4FB CD 83 06 ...
+ cmp player_y_pos ; B4FB CD 83 06 ...
bcc LB502 ; B4FE 90 02 ..
ldy #$FF ; B500 A0 FF ..
LB502: sty $A0 ; B502 84 A0 ..
@@ -6603,12 +6661,12 @@ LB658: .byte $00,$71,$B6,$08,$40,$02,$01,$08 ; B658 00 71 B6 08 40 02 01 08
.byte $05,$40,$EE,$3F,$1E,$1C,$0C,$02 ; B688 05 40 EE 3F 1E 1C 0C 02 .@.?....
.byte $05 ; B690 05 .
; ----------------------------------------------------------------------------
-LB691: lda $0621 ; B691 AD 21 06 .!.
+LB691: lda falling_flag ; B691 AD 21 06 .!.
bne LB697 ; B694 D0 01 ..
rts ; B696 60 `
; ----------------------------------------------------------------------------
-LB697: inc $067E ; B697 EE 7E 06 .~.
+LB697: inc player_x_pos ; B697 EE 7E 06 .~.
LB69A: rts ; B69A 60 `
; ----------------------------------------------------------------------------
@@ -6873,7 +6931,7 @@ wait_1_sec_2:
sta $06AB ; B97D 8D AB 06 ...
sta $067D ; B980 8D 7D 06 .}.
sta $0681 ; B983 8D 81 06 ...
- sta $067E ; B986 8D 7E 06 .~.
+ sta player_x_pos ; B986 8D 7E 06 .~.
sta $0680 ; B989 8D 80 06 ...
lda #$A0 ; B98C A9 A0 ..
sta FR1+1 ; B98E 85 E1 ..
@@ -7100,9 +7158,9 @@ well_done_screen:
sta $0688 ; BC2F 8D 88 06 ...
sta $066A ; BC32 8D 6A 06 .j.
lda #$7C ; BC35 A9 7C .|
- sta $067E ; BC37 8D 7E 06 .~.
+ sta player_x_pos ; BC37 8D 7E 06 .~.
lda #$20 ; BC3A A9 20 .
- sta $0683 ; BC3C 8D 83 06 ...
+ sta player_y_pos ; BC3C 8D 83 06 ...
; load dli_service_2 address into dli shadow
setup_dli_2:
lda #$C7 ; BC3F A9 C7 ..
@@ -7198,7 +7256,7 @@ well_done_map:
; ----------------------------------------------------------------------------
; referenced by code at $BC83
code_bd52:
- lda $0621 ; BD52 AD 21 06 .!.
+ lda falling_flag ; BD52 AD 21 06 .!.
bne LBD58 ; BD55 D0 01 ..
rts ; BD57 60 `
@@ -7229,9 +7287,9 @@ LBD81: lda #$E6 ; BD81 A9 E6
lda #$09 ; BD8B A9 09 ..
sta player_speed ; BD8D 8D 24 06 .$.
lda #$C6 ; BD90 A9 C6 ..
- sta $0683 ; BD92 8D 83 06 ...
+ sta player_y_pos ; BD92 8D 83 06 ...
lda #$00 ; BD95 A9 00 ..
- sta $0621 ; BD97 8D 21 06 .!.
+ sta falling_flag ; BD97 8D 21 06 .!.
lda #$01 ; BD9A A9 01 ..
sta $0688 ; BD9C 8D 88 06 ...
rts ; BD9F 60 `
diff --git a/jumpmanjr.info b/jumpmanjr.info
index 9c9fdef..c1b0d38 100644
--- a/jumpmanjr.info
+++ b/jumpmanjr.info
@@ -122,21 +122,23 @@ range { name "gr7_or_masks"; start $8143; end $8152; type bytetable; };
range { name "gr7_and_masks"; start $8153; end $8156; type bytetable; };
range { name "sfx_bomb_pickup"; start $8892; end $88A7; type bytetable; comment "played when a bomb is picked up"; };
range { name "data_8dfa"; start $8DFA; end $8DFF; type bytetable; };
-range { name "data_8f43"; start $8F43; end $8f72; type bytetable; };
-
-##range { name "mus0_addr1"; start $8FC3; end $8fc4; type addrtable; comment "mus struct table, 5 bytes per entry: 0/1 are an address, 2/3 are another, 5 is maybe the length? tempo?"; };
-##range { name "mus0_addr2"; start $8FC5; end $8fc6; type addrtable; };
-##range { name "mus0_len_or_tempo"; start $8FC7; end $8fc7; type bytetable; };
-##
-##range { name "mus1_addr1"; start $8FC8; end $8fc9; type addrtable; };
-##range { name "mus1_addr2"; start $8FCA; end $8fcb; type addrtable; };
-##range { name "mus1_len_or_tempo"; start $8FCC; end $8fcc; type bytetable; };
-##
-##range { name "mus2_addr1"; start $8FC8; end $8fc9; type addrtable; };
-##range { name "mus2_addr2"; start $8FCA; end $8fcb; type addrtable; };
-##range { name "mus2_len_or_tempo"; start $8FCC; end $8fcc; type bytetable; };
-
-#range { name "more_mus"; start $8FC8; end $8fff; type bytetable; comment "more 5-byte structs"; };
+range { name "bullet_table"; start $8F43; end $8f72; type bytetable; comment "used by bullet_logic"; };
+label { name "sfx_bullet"; addr $8f59; size 1; comment "bang!"; };
+label { name "play_sfx_bullet"; addr $8EFB; size 1; comment "let player hear report"; };
+label { name "set_bullet_dir"; addr $8EA7; size 1; comment "initial direction (before it fires)"; };
+label { name "fire_bullet"; addr $8EEF; size 1; comment "fire! Y reg indexes table of directions"; };
+label { name "player_y_pos"; addr $0683; size 1; comment "$C6 is the bottom of the level (where you end up when you die)"; };
+label { name "player_x_pos"; addr $067E; size 1; comment "stored in HPOSP0"; };
+label { name "bullet_x_pos"; addr $069B; size 4; comment "4 bytes, meaning we can never have >4 bullets on screen at once (makes sense, GTIA only has 4 missiles)"; };
+label { name "bullet_y_pos"; addr $069F; size 4; comment "another 4 bytes"; };
+label { name "bullet_flags"; addr $0756; size 4; comment "4 bytes, 0 = bullet slot not in use, non-0 = bullet active"; };
+label { name "bullet_x_delta"; addr $075A; size 4; comment "4 bytes"; };
+label { name "bullet_y_delta"; addr $075E; size 4; comment "4 bytes"; };
+label { name "fire_when_ready"; addr $8EB9; size 1; comment "fire at player if lined up with him, otherwise don't. either way we end up at move_bullet"; };
+label { name "sbc3"; addr $8EC1; size 1; comment "aim at center of body mass!"; };
+label { name "move_bullet"; addr $8F11; size 1; };
+label { name "aim_bullet_y"; addr $8ED6; size 1; comment "take aim!"; };
+label { name "aim_bullet_x"; addr $8EE4; size 1; comment "take aim!"; };
range { name "mus00_addr1"; start $8fc3; end $8fc4; type addrtable; comment "aka mus_struct_table, 5 bytes per entry"; };
range { name "mus00_addr2"; start $8fc5; end $8fc6; type addrtable; };
@@ -245,7 +247,9 @@ label { name "numplayer_screen_data_minus_one"; addr $959a; comment "1-indexed l
range { name "numplayer_screen_data"; start $959b; end $95ff; type bytetable; comment "'number of players?', gets copied to $3800, see option_key_handler"; };
range { name "sfx_add_life_bonus"; start $b896; end $b8a6; type bytetable; comment "played when adding bonus per life at end of level"; };
range { name "mul_25_table"; start $b8a7; end $b8be; type wordtable; comment "multiply by 25"; };
-range { name "data_table_8a39"; start $8a39; end $8a7f; type bytetable; };
+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 "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; };
@@ -299,8 +303,16 @@ range { name "data_table_aea4"; start $aea4; end $af0f; type bytetable; comment
range { name "sfx_letter_bonus"; start $AFCB; end $b0c3; type bytetable; comment "played once per correct letter at end of level07 (spellbound)"; };
label { name "cue_letter_sfx"; addr $AFB9; comment "play sfx_letter_bonus"; };
label { name "map_b000"; addr $b000; comment "referenced by routine at $B0C4"; };
+label { name "stub"; addr $8405; comment "just an RTS"; };
range { name "data_table_85b6"; start $85b6; end $85bd; type bytetable; comment "used in vblank_imm_isr, not sure for what yet"; };
-range { name "data_table_85de"; start $85de; end $85f5; type bytetable; comment "dunno what this is for yet, but it's copied into page 6 by init_hardware"; };
+label { name "page6_initial_vectors_minus_one"; addr $85d3; comment "1-indexed"; };
+label { name "page6_vectors_minus_one"; addr $05ff; comment "1-indexed"; };
+range { name "page6_initial_vectors"; start $85de; end $85f5; type addrtable; comment "copied into page 6 by init_hardware"; };
+label { name "page6_vectors"; addr $0600; size 24; comment "initialized with page6_initial_vectors"; };
+label { name "zigzag_sub0"; addr $AD68; comment "move bullets in ways that defy the laws of physics and common sense"; };
+label { name "no_bullet"; addr $8E75; };
+label { name "want_bullet"; addr $8E76; comment "create a bullet unless there are already max_bullets of them"; };
+label { name "next_bullet_slot"; addr $8E78; };
range { name "zero_filler_85f6"; start $85f6; end $85ff; type bytetable; comment "probably just filler"; };
range { name "movement_direction_table"; start $85be; end $85dd; type wordtable; comment "X/Y movement, indexed by joystick_state << 1, each entry is XXYY, $FF is -1"; };
range { name "get_ready_msg"; start $9714; end $9726; type bytetable; comment "PLAYER GET READY"; };
@@ -331,6 +343,12 @@ label { name "check_alive"; addr $8BE9; comment "player still has lives left?";
label { name "no_cross"; addr $8BEF; };
label { name "what_are_we_waiting_for"; addr $8C39; comment "I *think* we're waiting for the music to finish playing..."; };
+label { name "check_falling_1"; addr $9800; comment "called via vector in page 6"; };
+label { name "check_falling_2"; addr $8900; comment "called via vector in page 6"; };
+label { name "bullet_logic"; addr $8E69; comment "not sure what $0622, $0623 are for yet"; };
+label { name "rand_1_to_3"; addr $8E86; comment "A = rand() % 3 + 1; // bullets only come from left, right, or top (never bottom)"; };
+label { name "bullet_table_minus_one"; addr $8F42; comment "1-indexed"; };
+label { name "falling_flag"; addr $0621; comment "1 = falling, reset to 0 when jumpman hits the ground"; };
label { name "jiffy_timer_1"; addr $061A; comment "gets incremented every frame"; };
label { name "jiffy_timer_2"; addr $061B; comment "gets incremented every frame"; };
label { name "bonus_jiffy_timer"; addr $0626; comment "gets incremented every frame when playing a level, bonus-=100 when this reaches 0"; };
@@ -404,7 +422,7 @@ range { name "keycode_table"; start $9C19; end $9c20; type bytetable; };
#label { name "mul_25_table"; addr $B8A7; size 2; };
label { name "init_hardware"; addr $837c; };
-label { name "init_page6_loop"; addr $837e; comment "movement_direction_table+31 should read data_table_85de-1, da65 isn't perfect yet"; };
+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)"; };
@@ -566,7 +584,7 @@ label { name "work_level_sub1"; addr $0784; size 2; comment "a subroutine"; };
label { name "work_level_sub2"; addr $0786; size 2; comment "a subroutine"; };
label { name "work_level_sub3"; addr $0788; size 2; comment "a subroutine"; };
label { name "work_level_num_bombs"; addr $078a; size 1; comment "number of bombs to pick up on this level"; };
-label { name "work_level_bullet_chance"; addr $078b; size 1; comment "0 = no bullets"; };
+label { name "work_level_bullet_max"; addr $078b; size 1; comment "0 = no bullets, range 0-4."; };
label { name "work_level_y_start"; addr $078c; size 1; comment "jumpman starting Y position"; };
label { name "work_level_x_start"; addr $078d; size 1; comment "jumpman starting X position"; };
label { name "work_level_offs_14"; addr $078e; size 2; comment "points to $0600"; };
@@ -595,7 +613,7 @@ label { name "cur_level_sub1"; addr $07c4; size 2; comment "a subroutine"; };
label { name "cur_level_sub2"; addr $07c6; size 2; comment "a subroutine"; };
label { name "cur_level_sub3"; addr $07c8; size 2; comment "a subroutine"; };
label { name "cur_level_num_bombs"; addr $07ca; size 1; comment "number of bombs to pick up on this level"; };
-label { name "cur_level_bullet_chance"; addr $07cb; size 1; comment "0 = no bullets"; };
+label { name "cur_level_bullet_max"; addr $07cb; size 1; comment "0 = no bullets, range 0-4."; };
label { name "cur_level_y_start"; addr $07cc; size 1; comment "jumpman starting Y position"; };
label { name "cur_level_x_start"; addr $07cd; size 1; comment "jumpman starting X position"; };
label { name "cur_level_offs_14"; addr $07ce; size 2; comment "points to $0600"; };
@@ -624,7 +642,7 @@ range { name "level00_sub1"; start $a004; end $a005; type addrtable; comment "a
range { name "level00_sub2"; start $a006; end $a007; type addrtable; comment "a subroutine"; };
range { name "level00_sub3"; start $a008; end $a009; type addrtable; comment "a subroutine"; };
range { name "level00_num_bombs"; start $a00a; end $a00a; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level00_bullet_chance"; start $a00b; end $a00b; type bytetable; comment "0 = no bullets"; };
+range { name "level00_bullet_max"; start $a00b; end $a00b; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level00_y_start"; start $a00c; end $a00c; type bytetable; comment "jumpman starting Y position"; };
range { name "level00_x_start"; start $a00d; end $a00d; type bytetable; comment "jumpman starting X position"; };
range { name "level00_offs_14"; start $a00e; end $a00f; type bytetable; comment "points to $0600"; };
@@ -653,7 +671,7 @@ range { name "level01_sub1"; start $a044; end $a045; type addrtable; comment "a
range { name "level01_sub2"; start $a046; end $a047; type addrtable; comment "a subroutine"; };
range { name "level01_sub3"; start $a048; end $a049; type addrtable; comment "a subroutine"; };
range { name "level01_num_bombs"; start $a04a; end $a04a; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level01_bullet_chance"; start $a04b; end $a04b; type bytetable; comment "0 = no bullets"; };
+range { name "level01_bullet_max"; start $a04b; end $a04b; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level01_y_start"; start $a04c; end $a04c; type bytetable; comment "jumpman starting Y position"; };
range { name "level01_x_start"; start $a04d; end $a04d; type bytetable; comment "jumpman starting X position"; };
range { name "level01_offs_14"; start $a04e; end $a04f; type bytetable; comment "points to $0600"; };
@@ -682,7 +700,7 @@ range { name "level02_sub1"; start $a084; end $a085; type addrtable; comment "a
range { name "level02_sub2"; start $a086; end $a087; type addrtable; comment "a subroutine"; };
range { name "level02_sub3"; start $a088; end $a089; type addrtable; comment "a subroutine"; };
range { name "level02_num_bombs"; start $a08a; end $a08a; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level02_bullet_chance"; start $a08b; end $a08b; type bytetable; comment "0 = no bullets"; };
+range { name "level02_bullet_max"; start $a08b; end $a08b; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level02_y_start"; start $a08c; end $a08c; type bytetable; comment "jumpman starting Y position"; };
range { name "level02_x_start"; start $a08d; end $a08d; type bytetable; comment "jumpman starting X position"; };
range { name "level02_offs_14"; start $a08e; end $a08f; type bytetable; comment "points to $0600"; };
@@ -711,7 +729,7 @@ range { name "level03_sub1"; start $a0c4; end $a0c5; type addrtable; comment "a
range { name "level03_sub2"; start $a0c6; end $a0c7; type addrtable; comment "a subroutine"; };
range { name "level03_sub3"; start $a0c8; end $a0c9; type addrtable; comment "a subroutine"; };
range { name "level03_num_bombs"; start $a0ca; end $a0ca; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level03_bullet_chance"; start $a0cb; end $a0cb; type bytetable; comment "0 = no bullets"; };
+range { name "level03_bullet_max"; start $a0cb; end $a0cb; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level03_y_start"; start $a0cc; end $a0cc; type bytetable; comment "jumpman starting Y position"; };
range { name "level03_x_start"; start $a0cd; end $a0cd; type bytetable; comment "jumpman starting X position"; };
range { name "level03_offs_14"; start $a0ce; end $a0cf; type bytetable; comment "points to $0600"; };
@@ -740,7 +758,7 @@ range { name "level04_sub1"; start $a104; end $a105; type addrtable; comment "a
range { name "level04_sub2"; start $a106; end $a107; type addrtable; comment "a subroutine"; };
range { name "level04_sub3"; start $a108; end $a109; type addrtable; comment "a subroutine"; };
range { name "level04_num_bombs"; start $a10a; end $a10a; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level04_bullet_chance"; start $a10b; end $a10b; type bytetable; comment "0 = no bullets"; };
+range { name "level04_bullet_max"; start $a10b; end $a10b; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level04_y_start"; start $a10c; end $a10c; type bytetable; comment "jumpman starting Y position"; };
range { name "level04_x_start"; start $a10d; end $a10d; type bytetable; comment "jumpman starting X position"; };
range { name "level04_offs_14"; start $a10e; end $a10f; type bytetable; comment "points to $0600"; };
@@ -769,7 +787,7 @@ range { name "level05_sub1"; start $a144; end $a145; type addrtable; comment "a
range { name "level05_sub2"; start $a146; end $a147; type addrtable; comment "a subroutine"; };
range { name "level05_sub3"; start $a148; end $a149; type addrtable; comment "a subroutine"; };
range { name "level05_num_bombs"; start $a14a; end $a14a; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level05_bullet_chance"; start $a14b; end $a14b; type bytetable; comment "0 = no bullets"; };
+range { name "level05_bullet_max"; start $a14b; end $a14b; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level05_y_start"; start $a14c; end $a14c; type bytetable; comment "jumpman starting Y position"; };
range { name "level05_x_start"; start $a14d; end $a14d; type bytetable; comment "jumpman starting X position"; };
range { name "level05_offs_14"; start $a14e; end $a14f; type bytetable; comment "points to $0600"; };
@@ -798,7 +816,7 @@ range { name "level06_sub1"; start $a184; end $a185; type addrtable; comment "a
range { name "level06_sub2"; start $a186; end $a187; type addrtable; comment "a subroutine"; };
range { name "level06_sub3"; start $a188; end $a189; type addrtable; comment "a subroutine"; };
range { name "level06_num_bombs"; start $a18a; end $a18a; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level06_bullet_chance"; start $a18b; end $a18b; type bytetable; comment "0 = no bullets"; };
+range { name "level06_bullet_max"; start $a18b; end $a18b; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level06_y_start"; start $a18c; end $a18c; type bytetable; comment "jumpman starting Y position"; };
range { name "level06_x_start"; start $a18d; end $a18d; type bytetable; comment "jumpman starting X position"; };
range { name "level06_offs_14"; start $a18e; end $a18f; type bytetable; comment "points to $0600"; };
@@ -827,7 +845,7 @@ range { name "level07_sub1"; start $a1c4; end $a1c5; type addrtable; comment "a
range { name "level07_sub2"; start $a1c6; end $a1c7; type addrtable; comment "a subroutine"; };
range { name "level07_sub3"; start $a1c8; end $a1c9; type addrtable; comment "a subroutine"; };
range { name "level07_num_bombs"; start $a1ca; end $a1ca; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level07_bullet_chance"; start $a1cb; end $a1cb; type bytetable; comment "0 = no bullets"; };
+range { name "level07_bullet_max"; start $a1cb; end $a1cb; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level07_y_start"; start $a1cc; end $a1cc; type bytetable; comment "jumpman starting Y position"; };
range { name "level07_x_start"; start $a1cd; end $a1cd; type bytetable; comment "jumpman starting X position"; };
range { name "level07_offs_14"; start $a1ce; end $a1cf; type bytetable; comment "points to $0600"; };
@@ -856,7 +874,7 @@ range { name "level08_sub1"; start $a204; end $a205; type addrtable; comment "a
range { name "level08_sub2"; start $a206; end $a207; type addrtable; comment "a subroutine"; };
range { name "level08_sub3"; start $a208; end $a209; type addrtable; comment "a subroutine"; };
range { name "level08_num_bombs"; start $a20a; end $a20a; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level08_bullet_chance"; start $a20b; end $a20b; type bytetable; comment "0 = no bullets"; };
+range { name "level08_bullet_max"; start $a20b; end $a20b; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level08_y_start"; start $a20c; end $a20c; type bytetable; comment "jumpman starting Y position"; };
range { name "level08_x_start"; start $a20d; end $a20d; type bytetable; comment "jumpman starting X position"; };
range { name "level08_offs_14"; start $a20e; end $a20f; type bytetable; comment "points to $0600"; };
@@ -885,7 +903,7 @@ range { name "level09_sub1"; start $a244; end $a245; type addrtable; comment "a
range { name "level09_sub2"; start $a246; end $a247; type addrtable; comment "a subroutine"; };
range { name "level09_sub3"; start $a248; end $a249; type addrtable; comment "a subroutine"; };
range { name "level09_num_bombs"; start $a24a; end $a24a; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level09_bullet_chance"; start $a24b; end $a24b; type bytetable; comment "0 = no bullets"; };
+range { name "level09_bullet_max"; start $a24b; end $a24b; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level09_y_start"; start $a24c; end $a24c; type bytetable; comment "jumpman starting Y position"; };
range { name "level09_x_start"; start $a24d; end $a24d; type bytetable; comment "jumpman starting X position"; };
range { name "level09_offs_14"; start $a24e; end $a24f; type bytetable; comment "points to $0600"; };
@@ -914,7 +932,7 @@ range { name "level10_sub1"; start $a284; end $a285; type addrtable; comment "a
range { name "level10_sub2"; start $a286; end $a287; type addrtable; comment "a subroutine"; };
range { name "level10_sub3"; start $a288; end $a289; type addrtable; comment "a subroutine"; };
range { name "level10_num_bombs"; start $a28a; end $a28a; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level10_bullet_chance"; start $a28b; end $a28b; type bytetable; comment "0 = no bullets"; };
+range { name "level10_bullet_max"; start $a28b; end $a28b; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level10_y_start"; start $a28c; end $a28c; type bytetable; comment "jumpman starting Y position"; };
range { name "level10_x_start"; start $a28d; end $a28d; type bytetable; comment "jumpman starting X position"; };
range { name "level10_offs_14"; start $a28e; end $a28f; type bytetable; comment "points to $0600"; };
@@ -943,7 +961,7 @@ range { name "level11_sub1"; start $a2c4; end $a2c5; type addrtable; comment "a
range { name "level11_sub2"; start $a2c6; end $a2c7; type addrtable; comment "a subroutine"; };
range { name "level11_sub3"; start $a2c8; end $a2c9; type addrtable; comment "a subroutine"; };
range { name "level11_num_bombs"; start $a2ca; end $a2ca; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level11_bullet_chance"; start $a2cb; end $a2cb; type bytetable; comment "0 = no bullets"; };
+range { name "level11_bullet_max"; start $a2cb; end $a2cb; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level11_y_start"; start $a2cc; end $a2cc; type bytetable; comment "jumpman starting Y position"; };
range { name "level11_x_start"; start $a2cd; end $a2cd; type bytetable; comment "jumpman starting X position"; };
range { name "level11_offs_14"; start $a2ce; end $a2cf; type bytetable; comment "points to $0600"; };
diff --git a/leveldesc.info b/leveldesc.info
index 73d32ec..d98c9f0 100644
--- a/leveldesc.info
+++ b/leveldesc.info
@@ -4,7 +4,7 @@ label { name "work_level_sub1"; addr $0784; size 2; comment "a subroutine"; };
label { name "work_level_sub2"; addr $0786; size 2; comment "a subroutine"; };
label { name "work_level_sub3"; addr $0788; size 2; comment "a subroutine"; };
label { name "work_level_num_bombs"; addr $078a; size 1; comment "number of bombs to pick up on this level"; };
-label { name "work_level_bullet_chance"; addr $078b; size 1; comment "0 = no bullets"; };
+label { name "work_level_bullet_max"; addr $078b; size 1; comment "0 = no bullets, range 0-4."; };
label { name "work_level_y_start"; addr $078c; size 1; comment "jumpman starting Y position"; };
label { name "work_level_x_start"; addr $078d; size 1; comment "jumpman starting X position"; };
label { name "work_level_offs_14"; addr $078e; size 2; comment "points to $0600"; };
@@ -33,7 +33,7 @@ label { name "cur_level_sub1"; addr $07c4; size 2; comment "a subroutine"; };
label { name "cur_level_sub2"; addr $07c6; size 2; comment "a subroutine"; };
label { name "cur_level_sub3"; addr $07c8; size 2; comment "a subroutine"; };
label { name "cur_level_num_bombs"; addr $07ca; size 1; comment "number of bombs to pick up on this level"; };
-label { name "cur_level_bullet_chance"; addr $07cb; size 1; comment "0 = no bullets"; };
+label { name "cur_level_bullet_max"; addr $07cb; size 1; comment "0 = no bullets, range 0-4."; };
label { name "cur_level_y_start"; addr $07cc; size 1; comment "jumpman starting Y position"; };
label { name "cur_level_x_start"; addr $07cd; size 1; comment "jumpman starting X position"; };
label { name "cur_level_offs_14"; addr $07ce; size 2; comment "points to $0600"; };
@@ -62,7 +62,7 @@ range { name "level00_sub1"; start $a004; end $a005; type addrtable; comment "a
range { name "level00_sub2"; start $a006; end $a007; type addrtable; comment "a subroutine"; };
range { name "level00_sub3"; start $a008; end $a009; type addrtable; comment "a subroutine"; };
range { name "level00_num_bombs"; start $a00a; end $a00a; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level00_bullet_chance"; start $a00b; end $a00b; type bytetable; comment "0 = no bullets"; };
+range { name "level00_bullet_max"; start $a00b; end $a00b; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level00_y_start"; start $a00c; end $a00c; type bytetable; comment "jumpman starting Y position"; };
range { name "level00_x_start"; start $a00d; end $a00d; type bytetable; comment "jumpman starting X position"; };
range { name "level00_offs_14"; start $a00e; end $a00f; type bytetable; comment "points to $0600"; };
@@ -91,7 +91,7 @@ range { name "level01_sub1"; start $a044; end $a045; type addrtable; comment "a
range { name "level01_sub2"; start $a046; end $a047; type addrtable; comment "a subroutine"; };
range { name "level01_sub3"; start $a048; end $a049; type addrtable; comment "a subroutine"; };
range { name "level01_num_bombs"; start $a04a; end $a04a; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level01_bullet_chance"; start $a04b; end $a04b; type bytetable; comment "0 = no bullets"; };
+range { name "level01_bullet_max"; start $a04b; end $a04b; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level01_y_start"; start $a04c; end $a04c; type bytetable; comment "jumpman starting Y position"; };
range { name "level01_x_start"; start $a04d; end $a04d; type bytetable; comment "jumpman starting X position"; };
range { name "level01_offs_14"; start $a04e; end $a04f; type bytetable; comment "points to $0600"; };
@@ -120,7 +120,7 @@ range { name "level02_sub1"; start $a084; end $a085; type addrtable; comment "a
range { name "level02_sub2"; start $a086; end $a087; type addrtable; comment "a subroutine"; };
range { name "level02_sub3"; start $a088; end $a089; type addrtable; comment "a subroutine"; };
range { name "level02_num_bombs"; start $a08a; end $a08a; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level02_bullet_chance"; start $a08b; end $a08b; type bytetable; comment "0 = no bullets"; };
+range { name "level02_bullet_max"; start $a08b; end $a08b; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level02_y_start"; start $a08c; end $a08c; type bytetable; comment "jumpman starting Y position"; };
range { name "level02_x_start"; start $a08d; end $a08d; type bytetable; comment "jumpman starting X position"; };
range { name "level02_offs_14"; start $a08e; end $a08f; type bytetable; comment "points to $0600"; };
@@ -149,7 +149,7 @@ range { name "level03_sub1"; start $a0c4; end $a0c5; type addrtable; comment "a
range { name "level03_sub2"; start $a0c6; end $a0c7; type addrtable; comment "a subroutine"; };
range { name "level03_sub3"; start $a0c8; end $a0c9; type addrtable; comment "a subroutine"; };
range { name "level03_num_bombs"; start $a0ca; end $a0ca; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level03_bullet_chance"; start $a0cb; end $a0cb; type bytetable; comment "0 = no bullets"; };
+range { name "level03_bullet_max"; start $a0cb; end $a0cb; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level03_y_start"; start $a0cc; end $a0cc; type bytetable; comment "jumpman starting Y position"; };
range { name "level03_x_start"; start $a0cd; end $a0cd; type bytetable; comment "jumpman starting X position"; };
range { name "level03_offs_14"; start $a0ce; end $a0cf; type bytetable; comment "points to $0600"; };
@@ -178,7 +178,7 @@ range { name "level04_sub1"; start $a104; end $a105; type addrtable; comment "a
range { name "level04_sub2"; start $a106; end $a107; type addrtable; comment "a subroutine"; };
range { name "level04_sub3"; start $a108; end $a109; type addrtable; comment "a subroutine"; };
range { name "level04_num_bombs"; start $a10a; end $a10a; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level04_bullet_chance"; start $a10b; end $a10b; type bytetable; comment "0 = no bullets"; };
+range { name "level04_bullet_max"; start $a10b; end $a10b; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level04_y_start"; start $a10c; end $a10c; type bytetable; comment "jumpman starting Y position"; };
range { name "level04_x_start"; start $a10d; end $a10d; type bytetable; comment "jumpman starting X position"; };
range { name "level04_offs_14"; start $a10e; end $a10f; type bytetable; comment "points to $0600"; };
@@ -207,7 +207,7 @@ range { name "level05_sub1"; start $a144; end $a145; type addrtable; comment "a
range { name "level05_sub2"; start $a146; end $a147; type addrtable; comment "a subroutine"; };
range { name "level05_sub3"; start $a148; end $a149; type addrtable; comment "a subroutine"; };
range { name "level05_num_bombs"; start $a14a; end $a14a; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level05_bullet_chance"; start $a14b; end $a14b; type bytetable; comment "0 = no bullets"; };
+range { name "level05_bullet_max"; start $a14b; end $a14b; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level05_y_start"; start $a14c; end $a14c; type bytetable; comment "jumpman starting Y position"; };
range { name "level05_x_start"; start $a14d; end $a14d; type bytetable; comment "jumpman starting X position"; };
range { name "level05_offs_14"; start $a14e; end $a14f; type bytetable; comment "points to $0600"; };
@@ -236,7 +236,7 @@ range { name "level06_sub1"; start $a184; end $a185; type addrtable; comment "a
range { name "level06_sub2"; start $a186; end $a187; type addrtable; comment "a subroutine"; };
range { name "level06_sub3"; start $a188; end $a189; type addrtable; comment "a subroutine"; };
range { name "level06_num_bombs"; start $a18a; end $a18a; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level06_bullet_chance"; start $a18b; end $a18b; type bytetable; comment "0 = no bullets"; };
+range { name "level06_bullet_max"; start $a18b; end $a18b; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level06_y_start"; start $a18c; end $a18c; type bytetable; comment "jumpman starting Y position"; };
range { name "level06_x_start"; start $a18d; end $a18d; type bytetable; comment "jumpman starting X position"; };
range { name "level06_offs_14"; start $a18e; end $a18f; type bytetable; comment "points to $0600"; };
@@ -265,7 +265,7 @@ range { name "level07_sub1"; start $a1c4; end $a1c5; type addrtable; comment "a
range { name "level07_sub2"; start $a1c6; end $a1c7; type addrtable; comment "a subroutine"; };
range { name "level07_sub3"; start $a1c8; end $a1c9; type addrtable; comment "a subroutine"; };
range { name "level07_num_bombs"; start $a1ca; end $a1ca; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level07_bullet_chance"; start $a1cb; end $a1cb; type bytetable; comment "0 = no bullets"; };
+range { name "level07_bullet_max"; start $a1cb; end $a1cb; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level07_y_start"; start $a1cc; end $a1cc; type bytetable; comment "jumpman starting Y position"; };
range { name "level07_x_start"; start $a1cd; end $a1cd; type bytetable; comment "jumpman starting X position"; };
range { name "level07_offs_14"; start $a1ce; end $a1cf; type bytetable; comment "points to $0600"; };
@@ -294,7 +294,7 @@ range { name "level08_sub1"; start $a204; end $a205; type addrtable; comment "a
range { name "level08_sub2"; start $a206; end $a207; type addrtable; comment "a subroutine"; };
range { name "level08_sub3"; start $a208; end $a209; type addrtable; comment "a subroutine"; };
range { name "level08_num_bombs"; start $a20a; end $a20a; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level08_bullet_chance"; start $a20b; end $a20b; type bytetable; comment "0 = no bullets"; };
+range { name "level08_bullet_max"; start $a20b; end $a20b; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level08_y_start"; start $a20c; end $a20c; type bytetable; comment "jumpman starting Y position"; };
range { name "level08_x_start"; start $a20d; end $a20d; type bytetable; comment "jumpman starting X position"; };
range { name "level08_offs_14"; start $a20e; end $a20f; type bytetable; comment "points to $0600"; };
@@ -323,7 +323,7 @@ range { name "level09_sub1"; start $a244; end $a245; type addrtable; comment "a
range { name "level09_sub2"; start $a246; end $a247; type addrtable; comment "a subroutine"; };
range { name "level09_sub3"; start $a248; end $a249; type addrtable; comment "a subroutine"; };
range { name "level09_num_bombs"; start $a24a; end $a24a; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level09_bullet_chance"; start $a24b; end $a24b; type bytetable; comment "0 = no bullets"; };
+range { name "level09_bullet_max"; start $a24b; end $a24b; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level09_y_start"; start $a24c; end $a24c; type bytetable; comment "jumpman starting Y position"; };
range { name "level09_x_start"; start $a24d; end $a24d; type bytetable; comment "jumpman starting X position"; };
range { name "level09_offs_14"; start $a24e; end $a24f; type bytetable; comment "points to $0600"; };
@@ -352,7 +352,7 @@ range { name "level10_sub1"; start $a284; end $a285; type addrtable; comment "a
range { name "level10_sub2"; start $a286; end $a287; type addrtable; comment "a subroutine"; };
range { name "level10_sub3"; start $a288; end $a289; type addrtable; comment "a subroutine"; };
range { name "level10_num_bombs"; start $a28a; end $a28a; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level10_bullet_chance"; start $a28b; end $a28b; type bytetable; comment "0 = no bullets"; };
+range { name "level10_bullet_max"; start $a28b; end $a28b; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level10_y_start"; start $a28c; end $a28c; type bytetable; comment "jumpman starting Y position"; };
range { name "level10_x_start"; start $a28d; end $a28d; type bytetable; comment "jumpman starting X position"; };
range { name "level10_offs_14"; start $a28e; end $a28f; type bytetable; comment "points to $0600"; };
@@ -381,7 +381,7 @@ range { name "level11_sub1"; start $a2c4; end $a2c5; type addrtable; comment "a
range { name "level11_sub2"; start $a2c6; end $a2c7; type addrtable; comment "a subroutine"; };
range { name "level11_sub3"; start $a2c8; end $a2c9; type addrtable; comment "a subroutine"; };
range { name "level11_num_bombs"; start $a2ca; end $a2ca; type bytetable; comment "number of bombs to pick up on this level"; };
-range { name "level11_bullet_chance"; start $a2cb; end $a2cb; type bytetable; comment "0 = no bullets"; };
+range { name "level11_bullet_max"; start $a2cb; end $a2cb; type bytetable; comment "0 = no bullets, range 0-4."; };
range { name "level11_y_start"; start $a2cc; end $a2cc; type bytetable; comment "jumpman starting Y position"; };
range { name "level11_x_start"; start $a2cd; end $a2cd; type bytetable; comment "jumpman starting X position"; };
range { name "level11_offs_14"; start $a2ce; end $a2cf; type bytetable; comment "points to $0600"; };
diff --git a/main.info b/main.info
index 472f2c6..1fd0538 100644
--- a/main.info
+++ b/main.info
@@ -120,21 +120,23 @@ range { name "gr7_or_masks"; start $8143; end $8152; type bytetable; };
range { name "gr7_and_masks"; start $8153; end $8156; type bytetable; };
range { name "sfx_bomb_pickup"; start $8892; end $88A7; type bytetable; comment "played when a bomb is picked up"; };
range { name "data_8dfa"; start $8DFA; end $8DFF; type bytetable; };
-range { name "data_8f43"; start $8F43; end $8f72; type bytetable; };
-
-##range { name "mus0_addr1"; start $8FC3; end $8fc4; type addrtable; comment "mus struct table, 5 bytes per entry: 0/1 are an address, 2/3 are another, 5 is maybe the length? tempo?"; };
-##range { name "mus0_addr2"; start $8FC5; end $8fc6; type addrtable; };
-##range { name "mus0_len_or_tempo"; start $8FC7; end $8fc7; type bytetable; };
-##
-##range { name "mus1_addr1"; start $8FC8; end $8fc9; type addrtable; };
-##range { name "mus1_addr2"; start $8FCA; end $8fcb; type addrtable; };
-##range { name "mus1_len_or_tempo"; start $8FCC; end $8fcc; type bytetable; };
-##
-##range { name "mus2_addr1"; start $8FC8; end $8fc9; type addrtable; };
-##range { name "mus2_addr2"; start $8FCA; end $8fcb; type addrtable; };
-##range { name "mus2_len_or_tempo"; start $8FCC; end $8fcc; type bytetable; };
-
-#range { name "more_mus"; start $8FC8; end $8fff; type bytetable; comment "more 5-byte structs"; };
+range { name "bullet_table"; start $8F43; end $8f72; type bytetable; comment "used by bullet_logic"; };
+label { name "sfx_bullet"; addr $8f59; size 1; comment "bang!"; };
+label { name "play_sfx_bullet"; addr $8EFB; size 1; comment "let player hear report"; };
+label { name "set_bullet_dir"; addr $8EA7; size 1; comment "initial direction (before it fires)"; };
+label { name "fire_bullet"; addr $8EEF; size 1; comment "fire! Y reg indexes table of directions"; };
+label { name "player_y_pos"; addr $0683; size 1; comment "$C6 is the bottom of the level (where you end up when you die)"; };
+label { name "player_x_pos"; addr $067E; size 1; comment "stored in HPOSP0"; };
+label { name "bullet_x_pos"; addr $069B; size 4; comment "4 bytes, meaning we can never have >4 bullets on screen at once (makes sense, GTIA only has 4 missiles)"; };
+label { name "bullet_y_pos"; addr $069F; size 4; comment "another 4 bytes"; };
+label { name "bullet_flags"; addr $0756; size 4; comment "4 bytes, 0 = bullet slot not in use, non-0 = bullet active"; };
+label { name "bullet_x_delta"; addr $075A; size 4; comment "4 bytes"; };
+label { name "bullet_y_delta"; addr $075E; size 4; comment "4 bytes"; };
+label { name "fire_when_ready"; addr $8EB9; size 1; comment "fire at player if lined up with him, otherwise don't. either way we end up at move_bullet"; };
+label { name "sbc3"; addr $8EC1; size 1; comment "aim at center of body mass!"; };
+label { name "move_bullet"; addr $8F11; size 1; };
+label { name "aim_bullet_y"; addr $8ED6; size 1; comment "take aim!"; };
+label { name "aim_bullet_x"; addr $8EE4; size 1; comment "take aim!"; };
range { name "mus00_addr1"; start $8fc3; end $8fc4; type addrtable; comment "aka mus_struct_table, 5 bytes per entry"; };
range { name "mus00_addr2"; start $8fc5; end $8fc6; type addrtable; };
@@ -243,7 +245,9 @@ label { name "numplayer_screen_data_minus_one"; addr $959a; comment "1-indexed l
range { name "numplayer_screen_data"; start $959b; end $95ff; type bytetable; comment "'number of players?', gets copied to $3800, see option_key_handler"; };
range { name "sfx_add_life_bonus"; start $b896; end $b8a6; type bytetable; comment "played when adding bonus per life at end of level"; };
range { name "mul_25_table"; start $b8a7; end $b8be; type wordtable; comment "multiply by 25"; };
-range { name "data_table_8a39"; start $8a39; end $8a7f; type bytetable; };
+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 "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; };
@@ -297,8 +301,16 @@ range { name "data_table_aea4"; start $aea4; end $af0f; type bytetable; comment
range { name "sfx_letter_bonus"; start $AFCB; end $b0c3; type bytetable; comment "played once per correct letter at end of level07 (spellbound)"; };
label { name "cue_letter_sfx"; addr $AFB9; comment "play sfx_letter_bonus"; };
label { name "map_b000"; addr $b000; comment "referenced by routine at $B0C4"; };
+label { name "stub"; addr $8405; comment "just an RTS"; };
range { name "data_table_85b6"; start $85b6; end $85bd; type bytetable; comment "used in vblank_imm_isr, not sure for what yet"; };
-range { name "data_table_85de"; start $85de; end $85f5; type bytetable; comment "dunno what this is for yet, but it's copied into page 6 by init_hardware"; };
+label { name "page6_initial_vectors_minus_one"; addr $85d3; comment "1-indexed"; };
+label { name "page6_vectors_minus_one"; addr $05ff; comment "1-indexed"; };
+range { name "page6_initial_vectors"; start $85de; end $85f5; type addrtable; comment "copied into page 6 by init_hardware"; };
+label { name "page6_vectors"; addr $0600; size 24; comment "initialized with page6_initial_vectors"; };
+label { name "zigzag_sub0"; addr $AD68; comment "move bullets in ways that defy the laws of physics and common sense"; };
+label { name "no_bullet"; addr $8E75; };
+label { name "want_bullet"; addr $8E76; comment "create a bullet unless there are already max_bullets of them"; };
+label { name "next_bullet_slot"; addr $8E78; };
range { name "zero_filler_85f6"; start $85f6; end $85ff; type bytetable; comment "probably just filler"; };
range { name "movement_direction_table"; start $85be; end $85dd; type wordtable; comment "X/Y movement, indexed by joystick_state << 1, each entry is XXYY, $FF is -1"; };
range { name "get_ready_msg"; start $9714; end $9726; type bytetable; comment "PLAYER GET READY"; };
@@ -329,6 +341,12 @@ label { name "check_alive"; addr $8BE9; comment "player still has lives left?";
label { name "no_cross"; addr $8BEF; };
label { name "what_are_we_waiting_for"; addr $8C39; comment "I *think* we're waiting for the music to finish playing..."; };
+label { name "check_falling_1"; addr $9800; comment "called via vector in page 6"; };
+label { name "check_falling_2"; addr $8900; comment "called via vector in page 6"; };
+label { name "bullet_logic"; addr $8E69; comment "not sure what $0622, $0623 are for yet"; };
+label { name "rand_1_to_3"; addr $8E86; comment "A = rand() % 3 + 1; // bullets only come from left, right, or top (never bottom)"; };
+label { name "bullet_table_minus_one"; addr $8F42; comment "1-indexed"; };
+label { name "falling_flag"; addr $0621; comment "1 = falling, reset to 0 when jumpman hits the ground"; };
label { name "jiffy_timer_1"; addr $061A; comment "gets incremented every frame"; };
label { name "jiffy_timer_2"; addr $061B; comment "gets incremented every frame"; };
label { name "bonus_jiffy_timer"; addr $0626; comment "gets incremented every frame when playing a level, bonus-=100 when this reaches 0"; };
@@ -402,7 +420,7 @@ range { name "keycode_table"; start $9C19; end $9c20; type bytetable; };
#label { name "mul_25_table"; addr $B8A7; size 2; };
label { name "init_hardware"; addr $837c; };
-label { name "init_page6_loop"; addr $837e; comment "movement_direction_table+31 should read data_table_85de-1, da65 isn't perfect yet"; };
+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)"; };
diff --git a/mklevelinfo.pl b/mklevelinfo.pl
index 376651f..43c6588 100644
--- a/mklevelinfo.pl
+++ b/mklevelinfo.pl
@@ -7,7 +7,7 @@
6 => [ 2, 'sub2', "a subroutine" ],
8 => [ 2, 'sub3', "a subroutine" ],
10 => [ 1, 'num_bombs', "number of bombs to pick up on this level" ],
- 11 => [ 1, 'bullet_chance', '0 = no bullets' ],
+ 11 => [ 1, 'bullet_max', '0 = no bullets, range 0-4.' ],
12 => [ 1, 'y_start', 'jumpman starting Y position' ],
13 => [ 1, 'x_start', 'jumpman starting X position' ],
14 => [ 2, 'offs', 'points to $0600' ],