Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified patches/ips/vanilla_bugfixes.ips
Binary file not shown.
11 changes: 10 additions & 1 deletion patches/rom_map/Bank 82.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
B5E8 - B62B: ; vanilla_bugfixes.asm [boots ui fix, overwrites unused vanilla instruction.]
[unused vanilla code]
8B18 - 8B1F: [free] [unused vanilla code] - 8 bytes
A3D9 - A424: [free] [unused vanilla code] - 76 bytes
B5E8 - B62A: [free] [unused vanilla code] - 67 bytes
B650 - B671: [free] [unused vanilla code] - 34 bytes
BE5A - BF03: [free] [unused vanilla code] - 170 bytes
E675 - E6A1: [mosaic] Area Palettes.asm [uses 16 bytes / 29 bytes free]
F404 - F417: ; vanilla_bugfixes.asm

[bank free space]
F70F - F808: ; map_area.asm
F810 - F827: ; crash_handle_springball.asm
F830 - F9DE: ; disableable_etanks.asm
Expand Down
1 change: 0 additions & 1 deletion patches/rom_map/vanilla_hooks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ B51E - B520: ; split_speed.asm
B545 - B547: ; split_speed.asm
B56B - B56F: ; disableable_etanks.asm
B585 - B587: ; disable_major_glitches.asm
B5E8 - B62B: ; vanilla_bugfixes.asm
B672 - B676: ; map_area.asm
B924 - B92F: ; fast_pause_menu.asm
B9A0 - B9C7: ; fast_pause_menu.asm
Expand Down
72 changes: 24 additions & 48 deletions patches/src/vanilla_bugfixes.asm
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ lorom

incsrc "constants.asm"

!bank_82_free_space_start = $82B5E8 ; reserve icon ui fix. [;;; $B5E8: Unused. Convert [A] to three decimal digits ;;;]
!bank_82_free_space_end = $82B62B
!bank_82_free_space_start = $82f404 ; reserve icon ui fix. ;;; $F404: Unused. Pre-instruction ;;;
!bank_82_free_space_end = $82f418

!bank_86_free_space_start = $86F4B0 ; powamp projectile fix
!bank_86_free_space_end = $86F4D0
Expand Down Expand Up @@ -223,53 +223,29 @@ org $84B7EF ; PLM $B8AC (speed booster escape) LDA $09A4 [$7E:09A4]

; vanilla bugfix, ui shows the reserve tank select icon when only a boots item is available.
; this is due to a missing conditional branch instruction in the vanilla code.
; updated for split_speed compatibility.
; updated for split_speed compatibility, now fits in vanilla location with external table.
;
; -nn357

org $82ac15 ;;; $AB47: Equipment screen - set up reserve mode and determine initial selection ;;; ; $82:AC15 BRANCH_RETURN
bootsfinish:

org $82ac00 ;;; $AB47: Equipment screen - set up reserve mode and determine initial selection ;;; ; $82:AC00 LOOP_BOOTS
.loop
bit bootstable, x
bne .foundboots
inx
inx
cpx #$000a
bmi .loop
jmp bootsfinish
.foundboots
jmp found_boots
nop #3

assert pc() <= $82ac15

org !bank_82_free_space_start
found_boots:
cpx #$0006
beq .bluebooster
cpx #$0008
beq .sparkbooster
txa
lsr a
bra .store
.bluebooster
lda #$0002
bra .store
.sparkbooster
lda #$0003
.store
xba
ora #$0003
sta $0755
jmp bootsfinish
nop #25

org $82ac00
.loop
bit bootstable,x
bne .found
inx
inx
cpx #$000a
bmi .loop
bra .ret ; skip the padding byte if no items found.
nop ; padding that never runs.
.found
lda bootscat,x
sta $0755
.ret ; = $AC15, BRANCH_RETURN
assert pc() == $82ac15

org !bank_82_free_space_start
bootstable:
dw $0100 ; boots - hi-jump boots
dw $0200 ; boots - space jump
dw $2000 ; boots - speed booster
dw $0040 ; boots - blue booster
dw $0080 ; boots - spark booster

dw $0100, $0200, $2000, $0040, $0080
bootscat:
dw $0003, $0103, $0203, $0203, $0303
assert pc() <= !bank_82_free_space_end
Loading