.meta name="Bug fixes" .meta description="Fixes many minor\ngameplay, sound,\nand graphical bugs" # Most original codes by Ralf @ GC-Forever and Aleron Ives, except where noted # https://www.gc-forever.com/forums/viewtopic.php?t=2050 # https://www.gc-forever.com/forums/viewtopic.php?t=2049 .versions 3OJ2 3OJ3 3OJ4 3OJ5 3OE0 3OE1 3OE2 3OP0 entry_ptr: reloc0: .offsetof start start: .include WriteCodeBlocksGC # Olga Flow Barta Bug Fix (makes barta work on ice weakness Olga Flow instead of damaging player) .label g1_hook_call, .label g1_hook_loc, 0x8000D980 .data g1_hook_loc .deltaof g1_hook_start, g1_hook_end .address g1_hook_loc g1_hook_start: lwz r3, [r28] cmpwi r3, 19 bnelr li r3, 0x0002 blr g1_hook_end: .data g1_hook_call .data 4 .address g1_hook_call bl g1_hook_loc # Morfos Frozen Player Bug Fix (stops Morfos Laser multi-hitting when player is frozen) .label g2_hook_call, .label g2_hook_loc, 0x8000D9A0 .data g2_hook_loc .deltaof g2_hook_start, g2_hook_end .address g2_hook_loc g2_hook_start: lfs f2, [r2 - ] lwz r3, [r30 + 0x0030] andi. r3, r3, 0x0020 beqlr lfs f2, [r2 - ] blr g2_hook_end: .data g2_hook_call .data 4 .address g2_hook_call bl g2_hook_loc # Tiny Grass Assassins Bug Fix .data .data 4 b +0x10 # Bulclaw HP Bug Fix .data .data 8 bl +0x024C sth [r3 + 0x032C], r30 # Control Tower: Delbiter Death SFX Bug Fix .label g3_patch_loc, .data g3_patch_loc .deltaof g3_code_start, g3_code_end .address g3_patch_loc g3_code_start: b +0x20 subi r3, r3, 0x57D0 lwz r0, [r13 - ] cmpwi r0, 35 bne g3_skip subi r3, r3, 0x04D8 g3_skip: b +0x8C g3_code_end: .data .data 0x00000004 b -0x9C # Weapon Attributes Patch (allows attributes to work on minibosses and Olga Flow) .label g4_hook_call1, .label g4_hook_call2, .label g4_hook_loc, 0x8000C8C0 .data g4_hook_loc .deltaof g4_hook_start, g4_hook_end .address g4_hook_loc g4_hook_start: andi. r0, r0, 0x000F g4_hook_entry2: andi. r0, r0, 0x004F cmpwi r0, 4 blr g4_hook_end: .data g4_hook_call1 .data 4 .address g4_hook_call1 bl g4_hook_start .data g4_hook_call2 .data 4 .address g4_hook_call2 bl g4_hook_entry2 # Ruins Laser Fence SFX Bug Fix .data .data 8 lis r3, 0x4005 b +0x9C .data .data 4 b +0x1C # SFX Cancellation Distance Bug Fix .data .data 4 .float 22500 .data .data 4 .float 200 # Foie SFX Pitch Bug Fix .data .data 4 li r4, 0xFFFFFF00 .data .data 4 li r4, 0xFFFFFE80 .data .data 4 li r4, 0xFFFFFDB0 # Gifoie SFX Pitch Bug Fix .data .data 4 li r4, 0xFFFFFF00 .data .data 4 li r4, 0xFFFFFE80 .data .data 4 li r4, 0xFFFFFDB0 # Rafoie SFX Pitch Bug Fix .data .data 4 li r4, 0xFFFFFF00 .data .data 4 li r4, 0xFFFFFE80 .data .data 4 li r4, 0xFFFFFDB0 .data .data 4 li r4, 0xFFFFFF00 .data .data 4 li r4, 0xFFFFFE80 .data .data 4 li r4, 0xFFFFFDB0 # Barta SFX Pitch Bug Fix .data .data 4 li r4, 0xFFFFFF00 .data .data 4 li r4, 0xFFFFFE80 .data .data 4 li r4, 0xFFFFFDB0 # Gibarta SFX Pitch Bug Fix .data .data 4 li r4, 0xFFFFFF00 .data .data 4 li r4, 0xFFFFFE80 .data .data 4 li r4, 0xFFFFFDB0 # Rabarta SFX Pitch Bug Fix .data .data 4 li r4, 0xFFFFFF00 .data .data 4 li r4, 0xFFFFFE80 .data .data 4 li r4, 0xFFFFFDB0 # Zonde SFX Pitch Bug Fix .data .data 4 li r4, 0xFFFFFF00 .data .data 4 li r4, 0xFFFFFE80 .data .data 4 li r4, 0xFFFFFDB0 # Gizonde SFX Pitch Bug Fix .data .data 4 li r4, 0xFFFFFF00 .data .data 4 li r4, 0xFFFFFE80 .data .data 4 li r4, 0xFFFFFDB0 # Razonde SFX Pitch Bug Fix .data .data 4 li r4, 0xFFFFFF00 .data .data 4 li r4, 0xFFFFFE80 .data .data 4 li r4, 0xFFFFFDB0 # Grants SFX Pitch Bug Fix .data .data 4 li r4, 0xFFFFFF00 .data .data 4 li r4, 0xFFFFFE80 .data .data 4 li r4, 0xFFFFFDB0 # Megid SFX Pitch Bug Fix .data .data 4 li r4, 0xFFFFFF00 .data .data 4 li r4, 0xFFFFFE80 .data .data 4 li r4, 0xFFFFFDB0 # Anti SFX Pitch Bug Fix .data .data 4 cmpwi r0, 1 # Shield DFP/EVP Bug Fix (allows shields to reach true max DFP/EVP values) .data .data 4 lbz r0, [r4 + 0x0016] .data .data 4 lbz r0, [r4 + 0x0017] # VR Spaceship Item Drop Bug Fix (allows items to drop from enemies above a certain Y position) .data .data 4 .float 220 # Invalid Items Bug Fix .data .data 0x0C mr r3, r0 subi r3, r3, 0x0001 b -0x18 .data .data 0x0C mr r3, r0 subi r3, r3, 0x0001 b -0x18 .data .data 0x0C mr r4, r0 subi r4, r4, 0x0001 b -0x18 # Item Removal Maxed Stats Bug Fix .label g5_hook1_call, .label g5_hook1_ret, .label g5_hook2_call, .label g5_hook3_call, .label g5_hook3_ret, .label g5_hook3_apply_bonuses, .label g5_hooks_loc, 0x8000B088 .data g5_hooks_loc .deltaof g5_hook1_start, g5_hooks_end .address g5_hooks_loc g5_hook1_start: mr r3, r29 li r4, 0x0000 bl [] mr r3, r29 b g5_hook1_ret g5_hook2_start: lbz r0, [r31] cmplwi r9, 1 bnelr lbz r0, [r31 + 1] addi r31, r31, 2 blr g5_hook3_start: li r9, 0x0000 bl g5_hook3_apply_bonuses mr r3, r26 mr r4, r27 mr r5, r28 mr r6, r29 mr r7, r30 mr r8, r31 li r9, 1 bl g5_hook3_apply_bonuses b g5_hook3_ret g5_hooks_end: .data g5_hook1_call .data 4 .address g5_hook1_call b g5_hook1_start .data g5_hook2_call .data 4 .address g5_hook2_call bl g5_hook2_start .data g5_hook3_call .data 4 .address g5_hook3_call b g5_hook3_start .label g5_hook4_loc, 0x8000C3F8 .label g5_hook4_call, .label g5_hook4_ret, .label TItemEquipBase_v16, .label TItemEquipBase_v17, .data g5_hook4_loc .deltaof g5_hook4_start, g5_hook4_end .address g5_hook4_loc g5_hook4_start: cmplwi r4, 0 beqlr stwu [r1 - 0x0010], r1 b g5_hook4_ret g5_hook4_entry: stwu [r1 - 0x20], r1 mflr r0 stw [r1 + 0x24], r0 stmw [r1 + 0x08], r26 mr r31, r3 bl g5_hook4_start li r30, 0 addi r29, r31, 0x0D04 lwz r27, [r31 + 0x032C] g5_hook4_again: lwz r28, [r29] mr. r3, r28 beq g5_hook4_skip li r4, 1 bl TItemEquipBase_v17 mr r3, r28 li r4, 1 bl TItemEquipBase_v16 g5_hook4_skip: addi r29, r29, 4 addi r30, r30, 1 cmpwi r30, 13 blt g5_hook4_again stw [r31 + 0x032C], r27 lmw r26, [r1 + 0x08] lwz r0, [r1 + 0x24] mtlr r0 addi r1, r1, 0x0020 blr g5_hook4_end: .data g5_hook4_call .data 4 .address g5_hook4_call b g5_hook4_entry # Unit Present Bug Fix .label g6_hook_loc, 0x8000C640 .label g6_hook_call, .data g6_hook_loc .deltaof g6_hook_start, g6_hook_end .address g6_hook_loc g6_hook_start: rlwinm. r0, r4, 0, 25, 25 beq g6_hook_skip li r4, 0x0000 g6_hook_skip: addi r0, r4, 0x0009 blr g6_hook_end: .data g6_hook_call .data 4 .address g6_hook_call bl g6_hook_start # Bank Item Stacking Bug Fix .label g7_hook1_loc, 0x8000C6D0 .label g7_hook1_call, .label g7_hook2_call, .data g7_hook1_loc .deltaof g7_hook1_start, g7_hooks_end .address g7_hook1_loc g7_hook1_start: li r0, 1 stw [r29 + 0x54], r0 lwz r3, [r29 + 0x24] blr g7_hook2_start: li r0, 1 stw [r31 + 0x0378], r0 lwz r3, [r31 + 0x24] blr g7_hooks_end: .data g7_hook1_call .data 4 .address g7_hook1_call bl g7_hook1_start .data g7_hook2_call .data 4 .address g7_hook2_call bl g7_hook2_start # Dropped Mag Color Bug Fix .data .data 4 li r0, 0x12 # Meseta Drop System Bug Fix .data .data 4 b +0x0C .data .data 4 mr r3, r0 # Present Color Bug Fix .only_versions 3OJ2 3OE0 3OE1 .data .data 4 nop .all_versions # Offline Quests Drop Table Bug Fix .data .data 4 beq +0x0C # Mag Revival Priority Bug Fix .label g8_hook_loc, 0x8000C8A0 .label g8_hook_call, .data g8_hook_loc .deltaof g8_hook_start, g8_hook_end .address g8_hook_loc g8_hook_start: mulli r0, r0, 10 rlwinm. r4, r31, 0, 30, 30 beqlr extsh r0, r29 blr g8_hook_end: .data g8_hook_call .data 4 .address g8_hook_call bl g8_hook_start # Mag Revival Challenge & Quest Mode Bug Fix .data .data 4 b +0x10 # Chat Bubble Window TAB Bug Fix .data .data 4 nop # Chat Log Window LF/Tab Bug Fix .data .data 4 nop # Dark/Hell Special GFX Bug Fix (makes Dark/Hell display graphic on success like in PSO BB) .label g9_hook_loc, 0x8000E1E0 .label g9_hook_call1, .label g9_hook_call2, .data g9_hook_loc .deltaof g9_hook_start, g9_hook_end .address g9_hook_loc g9_hook_start: mflr r30 li r5, 0x0000 li r6, 0x001E li r7, 0x0040 bl [] mtlr r30 blr g9_hook_end: .data g9_hook_call1 .data 4 .address g9_hook_call1 bl g9_hook_start .data g9_hook_call2 .data 4 .address g9_hook_call2 bl g9_hook_start .data .data 4 li r4, 0x01E8 .data .data 4 li r4, 0x01E8 # Gol Dragon Camera Bug Fix (makes the camera after Gol Dragon display "normally") .data .data 4 cmpwi r3, 1 # Box/Fence Fadeout Bug Fix (stops boxes and other environmental objects fading in and out as you approach) .data .data 4 nop .data .data 4 nop # TP Bar Color Bug Fix .data .data 4 subi r4, r4, 0x5506 .data .data 4 subi r3, r3, 0x5506 .data .data 4 subi r4, r3, 0x5506 .data .data 4 .data 0xFF0074EE # Devil's and Demon's Special Damage Display Bug Fix .data .data 4 b -0x0340 # Christmas Trees Bug Fix .label g10_hook_loc, 0x8000B5C8 .label g10_hook_call, .label g10_hook_ret, .data g10_hook_loc .deltaof g10_hook_start, g10_hook_end .address g10_hook_loc g10_hook_start: lwz r3, [r3 + 0x98] bl [] lwz r3, [r31 + 0x042C] lwz r4, [r31 + 0x0430] b g10_hook_ret g10_hook_end: .data g10_hook_call .data 4 .address g10_hook_call b g10_hook_start .data .data 4 nop # Rain Drops Color Bug Fix .data .data 8 .data 0x70808080 .data 0x60707070 # Reverser Target Lock Bug Fix .data .data 4 addi r4, r31, 0x02FC # Deband/Shifta/Resta Target Bug Fix .data .data 4 bgt +0x0630 .only_versions 3OJ2 3OE0 3OE1 .data .data 4 bgt +0x033C .data .data 4 bgt +0x0248 .all_versions # Tech Auto Targeting Bug Fix .data .data 4 nop .data .data 4 .data 0x0000001E .data .data 4 .data 0x00000028 .data .data 4 .data 0x00000032 .data .data 4 .data 0x0000003C .data .data 4 .data 0x0018003C .data .data 4 .data 0x00000028 # Enable Trap Animations .label g11_hook_loc, 0x8000BBD0 .label g11_hook_call, .data g11_hook_loc .deltaof g11_hook_start, g11_hook_end .address g11_hook_loc g11_hook_start: lwz r4, [r31 + 0x0370] subi r4, r4, 0x0400 stw [r31 + 0x0370], r4 lwz r3, [r31 + 0x14] cmplwi r3, 0 beqlr stw [r3 + 0x0060], r4 blr g11_hook_end: .data g11_hook_call .data 4 .address g11_hook_call bl g11_hook_start .data .data 4 ori r0, r4, 0x0420 # Belra arm bug fix (this part by fuzziqersoftware) .only_versions 3OJ2 3OE0 3OE1 .label g12_hook1_call, .label g12_hook2_call, .label g12_hook_loc, 0x8000B06C .data g12_hook_loc .deltaof g12_hook1_start, g12_hook_end .address g12_hook_loc g12_hook1_start: li r0, 1 stw [r13 - ], r0 # Anchor: 80039388 @ 3OE1 b [] g12_hook2_start: li r4, 0 stw [r13 - ], r4 lwz r4, [r28 + 0x04] blr g12_hook_end: .data g12_hook1_call .data 4 .address g12_hook1_call bl g12_hook1_start .data g12_hook2_call .data 4 .address g12_hook2_call bl g12_hook2_start .all_versions # Tsumikiri J-Sword special attack + rapid weapon switch bug fix (this part # by fuzziqersoftware) .label tjs_switch_fix_hook_call, .label tjs_switch_fix_hook_loc, 0x8000B050 .data tjs_switch_fix_hook_loc .deltaof tjs_switch_fix_hook_start, tjs_switch_fix_hook_end .address tjs_switch_fix_hook_loc tjs_switch_fix_hook_start: lwz r0, [r3 + 0x0188] cmpwi r0, 0 bnelr mflr r31 addi r31, r31, 0x100 mtlr r31 blr tjs_switch_fix_hook_end: .data tjs_switch_fix_hook_call .data 8 .address tjs_switch_fix_hook_call beq +0x108 bl tjs_switch_fix_hook_loc .data 0 .data 0