; MODE[MANUAL] $82:BF06 dw 2519, 251A, 251B, 3D46, 3D47, 3D48, 3D49 ; RESERVE TANK $82:BF14 dw 3C80, 3C81, 3C82, 3C83, 3C84, 3C85, 3C86 ; [MANUAL] $82:BF22 dw 3D46, 3D47, 3D48, 3D49 ; [ AUTO ] $82:BF2A dw 3D56, 3D57, 3D58, 3D59 ; RAM offsets for specific tilemaps $82:C068 dw 3A88, 3AC8, 3C08, 3C48, 3C88, 3CC8, 3D08, 3A6A, 3AAA, 3B6A, 3BAA, 3BEA, 3C2A, 3CEA, 3D2A, 3D6A ; Pointers to tilemaps $82:C088 dw BF06, BF14, BF32, BF3C, BF46, BF50, BF5A, BF64, BF76, BF88, BF9A, BFAC, BFC0, BFD2, BFE4, BFF6, C01A, C01A, C008, C01A, C01A ;org $82C02C ;Pointers to start of RAM offsets for specific tilemaps: (this,list_index),item_index = RAM offset ;to understand the format: ;DW $C068 ;reserve tanks (left out) ;DW $C06C ;beams (see below) ;DW $C076 ;suits/misc (right after beams) ;DW $C082 ;boots ;these are the lists that must be replaced and expanded if you want to add an item from that category ;This handles reserve tanks $82:A12B C2 30 REP #$30 $82:A12D AD D4 09 LDA $09D4 [$7E:09D4] $82:A130 F0 38 BEQ $38 [$A16A] $82:A132 A0 00 00 LDY #$0000 $82:A135 A9 68 C0 LDA #$C068 $82:A138 85 03 STA $03 [$7E:0003] $82:A13A A9 82 00 LDA #$0082 $82:A13D 85 05 STA $05 [$7E:0005] $82:A13F B7 03 LDA [$03],y[$82:C068] $82:A141 85 00 STA $00 [$7E:0000] $82:A143 AE 88 C0 LDX $C088 [$82:C088] $82:A146 A9 0E 00 LDA #$000E $82:A149 85 16 STA $16 [$7E:0016] $82:A14B 20 7E A2 JSR $A27E [$82:A27E] $82:A14E A0 02 00 LDY #$0002 $82:A151 A9 68 C0 LDA #$C068 $82:A154 85 03 STA $03 [$7E:0003] $82:A156 A9 82 00 LDA #$0082 $82:A159 85 05 STA $05 [$7E:0005] $82:A15B B7 03 LDA [$03],y[$82:C06A] $82:A15D 85 00 STA $00 [$7E:0000] $82:A15F AE 8A C0 LDX $C08A [$82:C08A] $82:A162 A9 0E 00 LDA #$000E $82:A165 85 16 STA $16 [$7E:0016] $82:A167 20 7E A2 JSR $A27E [$82:A27E] ;this draws the reserve stuff $82:A16A A0 00 00 LDY #$0000 $82:A16D A9 6C C0 LDA #$C06C ; beam tilemap locations on screen $82:A170 85 03 STA $03 [$7E:0003] ;store to 03 so it can be used often $82:A172 A9 82 00 LDA #$0082 ;bank pointer? unidentified use $82:A175 85 05 STA $05 [$7E:0005] ;store to 05 so it can be used later $82:A177 B7 03 LDA [$03],y[$82:C06C] ;indexed load with y - load whichever tilemap is the y term of the sequence at C06C $82:A179 85 00 STA $00 [$7E:0000] ;store this tilemap to 00 $82:A17B AD 76 0A LDA $0A76 [$7E:0A76] ;-SPECIAL CASE-check if hyper beam is on (it has priority on th eq screen and its weird) $82:A17E D0 42 BNE $42 [$A1C2] ;if it is, gtfo ;---=THIS DRAWS BEAMS=--- $82:A180 B9 4C C0 LDA $C04C,y[$82:C04C] ;references this checklist ;Bit checklist: 5 beams, 6 suits/misc., 3 boots ;$82:C04C dw 1000, 0002, 0001, 0004, 0008, 0001, 0020, 0004, 1000, 0002, 0008, 0100, 0200, 2000 $82:A183 2C A8 09 BIT $09A8 [$7E:09A8] ;loads collected beams $82:A186 D0 0D BNE $0D [$A195] ;if equal to 0D, skip ahead to A195 $82:A188 A2 1A C0 LDX #$C01A ;load C01A to X $82:A18B A9 0A 00 LDA #$000A ;---IMPORTANT--- loads value of 000A into A then stores it. This value of 000A makes the beam tilemaps 5 tiles long (2 bytes per tile) $82:A18E 85 16 STA $16 [$7E:0016] ;store this into 16 so it can be used for the next routine $82:A190 20 7E A2 JSR $A27E [$82:A27E] ;go draw this $82:A193 80 20 BRA $20 [$A1B5] ;skip ahead to A1B5 ;---=THIS GREYS OUT BEAMS=--- $82:A195 BE 8C C0 LDX $C08C,y[$82:C08C] ;references this table, loads the y term of sequence into X ;; Pointers to tilemaps ;$82:C088 dw BF06, BF14, BF32, BF3C, BF46, BF50, BF5A, BF64, BF76, BF88, BF9A, BFAC, BFC0, BFD2, BFE4, BFF6, ;C01A, C01A, C008, C01A, C01A $82:A198 A9 0A 00 LDA #$000A ;loads 000A into A, 5 tiles $82:A19B 85 16 STA $16 [$7E:0016] ;stored into 16 for next draw routine $82:A19D 20 7E A2 JSR $A27E [$82:A27E] ;draw routine $82:A1A0 B9 4C C0 LDA $C04C,y[$82:C04C] ;same as above beam routine, checls that checklist $82:A1A3 2C A6 09 BIT $09A6 [$7E:09A6] ;loads EQUIPPED BEAMS not collected beams $82:A1A6 D0 0D BNE $0D [$A1B5] ;if 0D, then skip to A1B5 $82:A1A8 A9 00 0C LDA #$0C00 ;loads value 0C00 into A (PALETTE VALUE) $82:A1AB 85 12 STA $12 [$7E:0012] ;stores 0C00 into 12 $82:A1AD A9 0A 00 LDA #$000A ;5 tiles of whatever tilemap $82:A1B0 85 16 STA $16 [$7E:0016] ;stored into 16 for next routine $82:A1B2 20 9D A2 JSR $A29D [$82:A29D] ;palette update routine ;***continuation from beam drawing routine*** $82:A1B5 C8 INY ;increase y twice IMPORTANT $82:A1B6 C8 INY $82:A1B7 B7 03 LDA [$03],y[$82:C06E] ;this is now loads the NEXT beam location $82:A1B9 85 00 STA $00 [$7E:0000] ;stores into 00 $82:A1BB C0 0C 00 CPY #$000C ;Compare Y with memory $82:A1BE 30 C0 BMI $C0 [$A180] ;Branch if negative flag is set $82:A1C0 80 19 BRA $19 [$A1DB] ;Always go to A1DB $82:A1C2 A0 00 00 LDY #$0000 ;refresh Y $82:A1C5 BE A8 C0 LDX $C0A8,y ;loads the fifth to last value of the Pointers to tilemaps sequence which is C01A $82:A1C8 A9 0A 00 LDA #$000A ;loads 5 TILES ^ $82:A1CB 85 16 STA $16 [$7E:0016] ;store to 16 for next draw instruction | $82:A1CD 20 7E A2 JSR $A27E [$82:A27E] ;drawing instruction $82:A1D0 C8 INY ;increase Y twice aka prepare for next tilemap location | $82:A1D1 C8 INY $82:A1D2 B7 03 LDA [$03],y ;load the y term in the C06C tilemap locations list | $82:A1D4 85 00 STA $00 [$7E:0000] ;store that term in 00 $82:A1D6 C0 0C 00 CPY #$000C ;compare with 000C | $82:A1D9 30 EA BMI $EA [$A1C5] ;branch if negative to A1C5, which is this - - - - - - essentially a loop increasing Y until all of the terms are drawn ;---Suits n shit--- $82:A1DB A0 00 00 LDY #$0000 ;refresh Y $82:A1DE A9 76 C0 LDA #$C076 ;locations of suits on eq screen (part of 4 values in one location table, see top of document) $82:A1E1 85 03 STA $03 [$7E:0003];store to 03 to be used later $82:A1E3 A9 82 00 LDA #$0082 ;bank pointer? unknown purpose/use $82:A1E6 85 05 STA $05 [$7E:0005] ;store to 05 so it can be used later $82:A1E8 B7 03 LDA [$03],y[$82:C076] ;load the y term of the sequence at C076(suits) $82:A1EA 85 00 STA $00 [$7E:0000] ;store to 00 for next $82:A1EC B9 56 C0 LDA $C056,y[$82:C056] ;loads the y term of the bit check list, but starts at C056, the values from there are as follows: 0001, 0020, 0004, 1000, 0002, 0008, 0100, 0200, 2000 $82:A1EF 2C A4 09 BIT $09A4 [$7E:09A4] ;compares with COLLECTED items varia grav morph bombs sball Screw hjump sjump Speed $82:A1F2 D0 0D BNE $0D [$A201] ;if equal, branch to A201 (if the y term from the bit check list was a match, then go to A201 which loads the tilemap) $82:A1F4 A2 1A C0 LDX #$C01A ;load BLANK PLACEHOLDER tilemap $82:A1F7 A9 12 00 LDA #$0012 ;loads 8 TILES $82:A1FA 85 16 STA $16 [$7E:0016] ;store 8 tiles into 16 $82:A1FC 20 7E A2 JSR $A27E [$82:A27E] ;drawing routine $82:A1FF 80 20 BRA $20 [$A221] ;always go to A221 ;---=THIS GREYS OUT SUITS/BUILD/BOOTS=--- $82:A201 BE 96 C0 LDX $C096,y[$82:C09A] ;loads y term in tilemap pointers list starting from: BF88, BF9A, BFAC, BFC0, BFD2, BFE4, BFF6, C01A, C01A, C008, C01A, C01A $82:A204 A9 12 00 LDA #$0012 ; 8 TILES $82:A207 85 16 STA $16 [$7E:0016] ;store to 16 $82:A209 20 7E A2 JSR $A27E [$82:A27E] ;drawing routine $82:A20C B9 56 C0 LDA $C056,y[$82:C05A] ;loads the y term of the bit checklist above with given offset $82:A20F 2C A2 09 BIT $09A2 [$7E:09A2] ;compares with EQUIPPED items $82:A212 D0 0D BNE $0D [$A221] ;if equal to 0D, then go to A221 $82:A214 A9 00 0C LDA #$0C00 ;loads palette 0C00 $82:A217 85 12 STA $12 [$7E:0012] ;store into 12 $82:A219 A9 12 00 LDA #$0012 ;loads 8 TILES $82:A21C 85 16 STA $16 [$7E:0016] ;stores to 16 $82:A21E 20 9D A2 JSR $A29D [$82:A29D] ;draws new greyed out tiles