@@ -587,18 +587,17 @@ def handle_yoshi_box(rom):
587
587
588
588
def handle_bowser_damage (rom ):
589
589
590
- rom .write_bytes (0x1A509 , bytearray ([0x20 , 0x50 , 0xBC ])) # JSR $03BC50
590
+ rom .write_bytes (0x1A509 , bytearray ([0x5C , 0x50 , 0xBC , 0x03 ])) # JML $03BC50
591
591
592
592
BOWSER_BALLS_SUB_ADDR = 0x01BC50
593
- rom .write_bytes (BOWSER_BALLS_SUB_ADDR + 0x00 , bytearray ([0x08 ])) # PHP
594
- rom .write_bytes (BOWSER_BALLS_SUB_ADDR + 0x01 , bytearray ([0xAD , 0x48 , 0x0F ])) # LDA $F48
595
- rom .write_bytes (BOWSER_BALLS_SUB_ADDR + 0x04 , bytearray ([0xCF , 0xA1 , 0xBF , 0x03 ])) # CMP $03BFA1
596
- rom .write_bytes (BOWSER_BALLS_SUB_ADDR + 0x08 , bytearray ([0x90 , 0x06 ])) # BCC +0x06
597
- rom .write_bytes (BOWSER_BALLS_SUB_ADDR + 0x0A , bytearray ([0x28 ])) # PLP
598
- rom .write_bytes (BOWSER_BALLS_SUB_ADDR + 0x0B , bytearray ([0xEE , 0xB8 , 0x14 ])) # INC $14B8
599
- rom .write_bytes (BOWSER_BALLS_SUB_ADDR + 0x0E , bytearray ([0x80 , 0x01 ])) # BRA +0x01
600
- rom .write_bytes (BOWSER_BALLS_SUB_ADDR + 0x10 , bytearray ([0x28 ])) # PLP
601
- rom .write_bytes (BOWSER_BALLS_SUB_ADDR + 0x11 , bytearray ([0x60 ])) # RTS
593
+ rom .write_bytes (BOWSER_BALLS_SUB_ADDR + 0x0000 , bytearray ([0xAF , 0xA0 , 0xBF , 0x03 ])) # bowser_infinite_balls: lda.l goal_setting
594
+ rom .write_bytes (BOWSER_BALLS_SUB_ADDR + 0x0004 , bytearray ([0xD0 , 0x0C ])) # bne .nope
595
+ rom .write_bytes (BOWSER_BALLS_SUB_ADDR + 0x0006 , bytearray ([0xAD , 0x48 , 0x0F ])) # lda $0F48
596
+ rom .write_bytes (BOWSER_BALLS_SUB_ADDR + 0x0009 , bytearray ([0xCF , 0xA1 , 0xBF , 0x03 ])) # cmp.l required_bosses_setting
597
+ rom .write_bytes (BOWSER_BALLS_SUB_ADDR + 0x000D , bytearray ([0x90 , 0x03 ])) # bcc .nope
598
+ rom .write_bytes (BOWSER_BALLS_SUB_ADDR + 0x000F , bytearray ([0xEE , 0xB8 , 0x14 ])) # inc $14B8
599
+ rom .write_bytes (BOWSER_BALLS_SUB_ADDR + 0x0012 , bytearray ([0xAD , 0xB8 , 0x14 ])) # .nope lda $14B8
600
+ rom .write_bytes (BOWSER_BALLS_SUB_ADDR + 0x0015 , bytearray ([0x5C , 0x0F , 0xA5 , 0x03 ])) # jml $03A50F
602
601
603
602
return
604
603
@@ -2729,6 +2728,22 @@ def handle_uncompressed_player_gfx(rom):
2729
2728
])
2730
2729
rom .write_bytes (0x87F80 , vram_targets )
2731
2730
2731
+
2732
+ def handle_chocolate_island_2 (rom ):
2733
+ FIX_CHOCOISLAND2_ADDR = 0x87200
2734
+ rom .write_bytes (0x2DB3E , bytearray ([0x5C , 0x00 , 0xF2 , 0x10 ])) # jml fix_choco_island_2
2735
+ rom .write_bytes (FIX_CHOCOISLAND2_ADDR + 0x0000 , bytearray ([0xAD , 0x33 , 0x1F ])) # fix_choco_island_2 lda $1F2F+$04
2736
+ rom .write_bytes (FIX_CHOCOISLAND2_ADDR + 0x0003 , bytearray ([0x29 , 0x08 ])) # and #$08
2737
+ rom .write_bytes (FIX_CHOCOISLAND2_ADDR + 0x0005 , bytearray ([0xD0 , 0x0D ])) # bne .dc_room
2738
+ rom .write_bytes (FIX_CHOCOISLAND2_ADDR + 0x0007 , bytearray ([0xAD , 0x22 , 0x14 ])) # lda $1422
2739
+ rom .write_bytes (FIX_CHOCOISLAND2_ADDR + 0x000A , bytearray ([0xC9 , 0x04 ])) # cmp #$04
2740
+ rom .write_bytes (FIX_CHOCOISLAND2_ADDR + 0x000C , bytearray ([0xF0 , 0x06 ])) # beq .dc_room
2741
+ rom .write_bytes (FIX_CHOCOISLAND2_ADDR + 0x000E , bytearray ([0xA2 , 0x02 ])) # .rex_room ldx #$02
2742
+ rom .write_bytes (FIX_CHOCOISLAND2_ADDR + 0x0010 , bytearray ([0x5C , 0x49 , 0xDB , 0x05 ])) # jml $05DB49
2743
+ rom .write_bytes (FIX_CHOCOISLAND2_ADDR + 0x0014 , bytearray ([0xA2 , 0x00 ])) # .dc_room ldx #$00
2744
+ rom .write_bytes (FIX_CHOCOISLAND2_ADDR + 0x0016 , bytearray ([0x5C , 0x49 , 0xDB , 0x05 ])) # jml $05DB49
2745
+
2746
+
2732
2747
def decompress_gfx (compressed_graphics ):
2733
2748
# This code decompresses graphics in LC_LZ2 format in order to be able to swap player and yoshi's graphics with ease.
2734
2749
decompressed_gfx = bytearray ([])
@@ -3050,6 +3065,8 @@ def patch_rom(world: World, rom, player, active_level_dict):
3050
3065
rom .write_bytes (0x09C13 , bytearray ([0x7E , 0x7E , 0x7F , 0x7F ]))
3051
3066
rom .write_byte (0x3F425 , 0x32 )
3052
3067
3068
+ handle_chocolate_island_2 (rom )
3069
+
3053
3070
handle_ability_code (rom )
3054
3071
3055
3072
handle_yoshi_box (rom )
0 commit comments