77!bank_91_free_space_start2 = $91FC42
88!bank_91_free_space_end2 = $91FC66
99
10- !bank_82_free_space_start = $82FF20
11- !bank_82_free_space_end = $82FF30
10+ !bank_82_free_space_start = $82C42D
11+ !bank_82_free_space_end = $82C465
12+
13+ !bank_82_freespace2_start = $82FF20
14+ !bank_82_freespace2_end = $82FF30
1215
1316!bank_B6_free_space_start = $B6FC00
1417!bank_B6_free_space_end = $B6FE00
2225!speed_booster = $2000
2326!any_booster = !blue_booster|!spark_booster|!speed_booster
2427
25- org $8291D0
26- jsr hook_setup_speedbooster_menu_tile_wrapper
28+ org $82A22F
29+ lda #list_boots_ram_tilemaps
30+
31+ org $82A23D
32+ lda list_boots_equip_bitmasks, y
33+
34+ org $82A257
35+ ldx list_boots_equip_tilemaps, y
36+
37+ org $82A25D
38+ lda list_boots_equip_bitmasks, y
39+
40+ org $82B1C6
41+ cmp #$0303
42+
43+ org $82B517
44+ bit list_boots_equip_bitmasks, x
45+
46+ org $82B545
47+ bit list_boots_equip_bitmasks, x
48+
49+ org $82B51E
50+ cpx #$0008
2751
28- org $82B5AE
29- jsr hook_equip_enable
52+ org $82C194
53+ dw boots_item_selector_positions
3054
31- org $82C066
32- ; Speedbooster bitset
33- dw !any_booster
55+ org $82C1B2
56+ dw $00CC , $0044
57+ dw $00CC , $004C
58+ dw $00CC , $0064
59+ dw $00CC , $006C
60+ dw $00CC , $0074
61+ dw $00CC , $007C
62+
63+ org $82A278
64+ cpy #$0008
65+
66+ org $82C032
67+ dw list_boots_ram_tilemaps
68+
69+ org $82C03A
70+ dw list_boots_equip_bitmasks
71+
72+ org $82C076
73+ dw $3A2A , $3A6A , $3B2A , $3B6A , $3BAA , $3BEA
74+
75+ org $82C04A
76+ dw list_boots_equip_tilemaps
77+
78+ org $82C2A6
79+ list_boots_equip_tilemaps:
80+ dw $BFD2 , $BFE4 , tilemap_blue_booster, tilemap_spark_booster
81+ warnpc $82C2B7
3482
3583org !bank_82_free_space_start
3684
37- hook_setup_speedbooster_menu_tile_wrapper:
38- sta $0725 ; run hi-jacked instruction
39- jsl hook_setup_speedbooster_menu_tile
40- rts
85+ ;Tilemaps
86+ ;oBLUE BOOSTER
87+ tilemap_blue_booster:
88+ dw $12FF , $1270 , $1271 , $1272 , $1273 , $1274 , $1275 , $1276 , $1277
4189
42- hook_equip_enable:
43- ; X = equipment bitmask
44- ; Y = equipment bitset
45- ; A = loaded with previously equipped items
46- ora $0000 ,x ; Hijacked code (sets the bitmask)
47- and $0002 ,y ; AND with collected items
48- rts
90+ ;oSPARK BOOSTER
91+ tilemap_spark_booster:
92+ dw $12FF , $1278 , $1279 , $127A , $127B , $127C , $127D , $127E , $127F
4993
94+ ; Replacement boots table
95+ list_boots_equip_bitmasks:
96+ dw $0100 , $0200 , !blue_booster, !spark_booster
97+
98+ list_boots_ram_tilemaps:
99+ dw $3CAA , $3CEA , $3D2A , $3D6A
100+
101+ warnpc !bank_82_free_space_end
50102assert pc () <= !bank_82_free_space_end
51103
104+ org !bank_82_freespace2_start
105+
106+ boots_item_selector_positions:
107+ dw $00CC , $0094
108+ dw $00CC , $009C
109+ dw $00CC , $00A4
110+ dw $00CC , $00AC
111+
112+ warnpc !bank_82_freespace2_end
113+ assert pc () <= !bank_82_freespace2_end
114+
52115; Accelerate Samus' animation with any booster item:
53116org $908502
54117 bit #!any_booster
@@ -314,52 +377,6 @@ hook_update_speed_echoes:
314377 lda $0b3e ; run hi-jacked instruction
315378 rts
316379
317- hook_setup_speedbooster_menu_tile:
318- php
319-
320- rep #$30
321- lda $09A4
322- and #!any_booster
323- beq .no ; No boosters
324- bit #!speed_booster
325- bne .no ; Full speedbooster
326-
327- cmp #!blue_booster|!spark_booster
328- beq .no ; Blue+Spark = Speed
329-
330- ; Prepare VRAM for copy
331- ldx #$1240
332- stx $2116
333- sep #$10 ; X = 8-bit
334- ldx #$80 ; Auto-increment, 1 word
335- stx $2115
336-
337- cmp #!blue_booster
338- beq .blue
339-
340- ; Spark booster
341- jsl $8091A9
342- db $01 , $01 , $18
343- dl menu_tiles_spark_booster
344- dw menu_tiles_spark_booster_end-menu_tiles_spark_booster
345-
346- bra .dma
347-
348- .blue
349- jsl $8091A9
350- db $01 , $01 , $18
351- dl menu_tiles_blue_booster
352- dw menu_tiles_blue_booster_end-menu_tiles_blue_booster
353-
354- .dma
355- sep #$30
356- lda #$02
357- sta $420B ; DMA execute
358-
359- .no
360- plp
361- rtl
362-
363380hook_speed_clamp:
364381 lda !equipped_items
365382 and #!any_booster
@@ -373,8 +390,7 @@ hook_speed_clamp:
373390
374391assert pc () <= !bank_90_free_space_end
375392
376- org !bank_B6_free_space_start
377-
393+ org $B6CE00
378394menu_tiles_blue_booster:
379395 db $FF , $FF , $FF , $FF , $8D , $FF , $B5 , $FF , $8D , $FF , $B5 , $FF , $8C , $FF , $FF , $FF
380396 db $00 , $FF , $00 , $FF , $00 , $FF , $00 , $FF , $00 , $FF , $00 , $FF , $00 , $FF , $00 , $FF
@@ -413,4 +429,80 @@ menu_tiles_spark_booster:
413429 db $00 , $FF , $00 , $FF , $00 , $FF , $00 , $FF , $00 , $FF , $00 , $FF , $00 , $FF , $00 , $FF
414430.end
415431
416- assert pc () <= !bank_B6_free_space_end
432+ ; Power Suit Shoulder with line tile (1CF)
433+ org $B6B9E0
434+ db $0B , $00 , $09 , $00 , $08 , $00 , $05 , $00 , $85 , $80 , $41 , $40 , $22 , $20 , $12 , $10
435+ db $00 , $00 , $00 , $00 , $00 , $00 , $00 , $00 , $80 , $80 , $40 , $40 , $20 , $20 , $10 , $10
436+
437+ ; Power Suit inside line tile (17E) doesn't change
438+
439+ ; Power Suit outside line tile (17F)
440+ org $B6AFE0
441+ db $10 , $10 , $20 , $20 , $40 , $40 , $80 , $80 , $00 , $00 , $00 , $00 , $80 , $00 , $C0 , $00
442+ db $10 , $10 , $20 , $20 , $40 , $40 , $80 , $80 , $00 , $00 , $00 , $00 , $00 , $00 , $00 , $00
443+
444+ ; Varia Suit Shoulder with line tile (1D8)
445+ org $B6BB00
446+ db $14 , $00 , $25 , $00 , $29 , $00 , $2A , $00 , $8A , $80 , $4B , $40 , $20 , $20 , $10 , $10
447+ db $00 , $00 , $00 , $00 , $00 , $00 , $00 , $00 , $80 , $80 , $40 , $40 , $20 , $20 , $10 , $10
448+
449+ ;Varia Suit inside line tile (1E6)
450+ org $B6BCC0
451+ db $0F , $00 , $F0 , $00 , $06 , $00 , $00 , $00 , $FF , $FF , $00 , $00 , $00 , $00 , $FF , $00
452+ db $00 , $00 , $00 , $00 , $00 , $00 , $00 , $00 , $FF , $FF , $00 , $00 , $00 , $00 , $00 , $00
453+
454+ ;Varia Suit outside line tile (1E7)
455+ org $B6BCE0
456+ db $90 , $10 , $20 , $20 , $48 , $40 , $80 , $80 , $30 , $00 , $40 , $00 , $80 , $00 , $C0 , $00
457+ db $10 , $10 , $20 , $20 , $40 , $40 , $80 , $80 , $00 , $00 , $00 , $00 , $00 , $00 , $00 , $00
458+
459+ org $B6EA66
460+ dw $65CF
461+
462+ org $82D54F
463+ dw $65CF
464+
465+ org $82D65F
466+ dw $65CF
467+
468+ org $82D76F
469+ dw $65D8
470+
471+ org $82D87F
472+ dw $65D8
473+
474+ org $B6E9E8
475+ dw $3941 , $3942 , $3942 , $3943 , $2AF6 , $2AF7 , $2AF8 , $7943 , $3942 , $3942 , $7941
476+ org $B6EA28
477+ dw $3940 , $0CFF , $0D00 , $0D01 , $0D02 , $0D03 , $0D04 , $0D05 , $0CD4 , $0CD4 , $7940
478+ org $B6EA68
479+ dw $7954 , $0CFF , $0CD0 , $0CD1 , $0CD2 , $0CD3 , $0D03 , $0D04 , $0D05 , $0CD4 , $7940
480+ org $B6EAA8
481+ dw $B941 , $B942 , $B942 , $B942 , $B942 , $B942 , $B942 , $B942 , $B942 , $B942 , $F941
482+
483+ org $B6EAE8
484+ dw $3941 , $3942 , $3942 , $3943 , $29B0 , $29B1 , $29B2 , $7943 , $3942 , $3942 , $7941
485+ org $B6EB28
486+ dw $3940 , $08FF , $0920 , $0921 , $0922 , $0923 , $0917 , $0918 , $090F , $091F , $7940
487+ org $B6EB68
488+ dw $3940 , $08FF , $08D5 , $08D6 , $08D7 , $08D4 , $08D4 , $08D4 , $08D4 , $08D4 , $7940
489+ org $B6EBA8
490+ dw $7954 , $08FF , $0910 , $0911 , $0912 , $0913 , $0914 , $0915 , $0916 , $08D4 , $7940
491+ org $B6EBE8
492+ dw $3940 , $08FF , $08E0 , $08E1 , $08E2 , $08E3 , $08E4 , $08E5 , $08E6 , $08D4 , $7940
493+ org $B6EC28
494+ dw $B941 , $B942 , $B942 , $B942 , $B942 , $B942 , $B942 , $B942 , $B942 , $B942 , $F941
495+
496+ ;FIXME: Uses hud_expansion_opaque relocated tiles
497+ org $B6EC68
498+ dw $3941 , $3942 , $3942 , $3943 , $2EB9 , $2EBA , $2EBB , $7943 , $3942 , $3942 , $7941
499+ org $B6ECA8
500+ dw $3940 , $0CFF , $0D30 , $0D31 , $0D32 , $0D33 , $0D34 , $0D35 , $0D36 , $0CD4 , $7940
501+ org $B6ECE8
502+ dw $3940 , $0CFF , $0CF0 , $0CF1 , $0CF2 , $0CF3 , $0CF4 , $0CF5 , $0CD4 , $0CD4 , $7940
503+ org $B6ED28
504+ dw $3940 , $0CFF , $0D70 , $0D71 , $0D72 , $0D73 , $0D74 , $0D75 , $0D76 , $0D77 , $7940
505+ org $B6ED68
506+ dw $F954 , $0CFF , $0D78 , $0D79 , $0D7A , $0D7B , $0D7C , $0D7D , $0D7E , $0D7F , $7940
507+ org $B6EDA8
508+ dw $B941 , $B942 , $B942 , $B942 , $B942 , $B942 , $B942 , $B942 , $B942 , $B942 , $F941
0 commit comments