diff --git a/notes/ar-codes.txt b/notes/ar-codes.txt index 503819b6..9d0cddbd 100644 --- a/notes/ar-codes.txt +++ b/notes/ar-codes.txt @@ -488,3 +488,218 @@ Allow loading corrupted save files 60 frames per second This does not adjust any logic or animations; everything just runs faster 3OE1 => 045CDEF8 00000001 + +Show extended item info when targeting a dropped item +(Compiled from the ExtendedItemInfo patch, also written by me) +3OE1 => 044CB088 00000023 + 04262270 4BDA1E15 + 04262580 4BDA1AB8 + 0426224C 4BDA1DFD + 04262294 4BDA1DC9 + 042874C0 4BD7CB50 + 04287424 4BD7CBF8 + 04004008 41F00000 + 0400400C 43480000 + 04004010 3C808000 + 04004014 90644004 + 04004018 4E800020 + 0400401C 3C808000 + 04004020 80044004 + 04004024 7C001840 + 04004028 4082000C + 0400402C 38000000 + 04004030 90044004 + 04004034 4E800020 + 04004038 9421FFE0 + 0400403C 7C0802A6 + 04004040 90010024 + 04004044 48000028 + 04004048 9421FFE0 + 0400404C 7C0802A6 + 04004050 90010024 + 04004054 4825E0D5 + 04004058 48000014 + 0400405C 9421FFE0 + 04004060 7C0802A6 + 04004064 90010024 + 04004068 4825DBED + 0400406C 38600000 + 04004070 48000049 + 04004074 80010024 + 04004078 7C0803A6 + 0400407C 38210020 + 04004080 4E800020 + 04004084 9421FFE0 + 04004088 7C0802A6 + 0400408C 90010024 + 04004090 90810008 + 04004094 93E1000C + 04004098 4825DF19 + 0400409C 80610008 + 040040A0 48000019 + 040040A4 83E1000C + 040040A8 80010024 + 040040AC 38210020 + 040040B0 7C0803A6 + 040040B4 4E800020 + 040040B8 9421FFE0 + 040040BC 7C0802A6 + 040040C0 90010024 + 040040C4 90610008 + 040040C8 93E1000C + 040040CC 3FE08000 + 040040D0 28030000 + 040040D4 41820094 + 040040D8 A08300EC + 040040DC 28040103 + 040040E0 41820088 + 040040E4 28040300 + 040040E8 40800080 + 040040EC 480155DD + 040040F0 28030000 + 040040F4 40820074 + 040040F8 3C608000 + 040040FC 80634004 + 04004100 28030000 + 04004104 41820010 + 04004108 8063004C + 0400410C 546307FF + 04004110 40820058 + 04004114 807F4000 + 04004118 28030000 + 0400411C 4082002C + 04004120 386000BC + 04004124 48225419 + 04004128 907F4000 + 0400412C 28030000 + 04004130 41820050 + 04004134 63E34008 + 04004138 7C641B78 + 0400413C 807F4000 + 04004140 80ADAD80 + 04004144 482509B1 + 04004148 807F4000 + 0400414C 8003002C + 04004150 60000020 + 04004154 9003002C + 04004158 80810008 + 0400415C 808400D8 + 04004160 48250519 + 04004164 4800001C + 04004168 807F4000 + 0400416C 28030000 + 04004170 41820010 + 04004174 38000000 + 04004178 901F4000 + 0400417C 4823F76D + 04004180 83E1000C + 04004184 80010024 + 04004188 38210020 + 0400418C 7C0803A6 + 04004190 4E800020 +3OE2 => 044CF6F0 00000023 + 04263630 4BDA0A55 + 04263940 4BDA06F8 + 0426360C 4BDA0A3D + 04263654 4BDA0A09 + 0428893C 4BD7B6D4 + 042888A0 4BD7B77C + 04004008 41F00000 + 0400400C 43480000 + 04004010 3C808000 + 04004014 90644004 + 04004018 4E800020 + 0400401C 3C808000 + 04004020 80044004 + 04004024 7C001840 + 04004028 4082000C + 0400402C 38000000 + 04004030 90044004 + 04004034 4E800020 + 04004038 9421FFE0 + 0400403C 7C0802A6 + 04004040 90010024 + 04004044 48000028 + 04004048 9421FFE0 + 0400404C 7C0802A6 + 04004050 90010024 + 04004054 4825F495 + 04004058 48000014 + 0400405C 9421FFE0 + 04004060 7C0802A6 + 04004064 90010024 + 04004068 4825EFAD + 0400406C 38600000 + 04004070 48000049 + 04004074 80010024 + 04004078 7C0803A6 + 0400407C 38210020 + 04004080 4E800020 + 04004084 9421FFE0 + 04004088 7C0802A6 + 0400408C 90010024 + 04004090 90810008 + 04004094 93E1000C + 04004098 4825F2D9 + 0400409C 80610008 + 040040A0 48000019 + 040040A4 83E1000C + 040040A8 80010024 + 040040AC 38210020 + 040040B0 7C0803A6 + 040040B4 4E800020 + 040040B8 9421FFE0 + 040040BC 7C0802A6 + 040040C0 90010024 + 040040C4 90610008 + 040040C8 93E1000C + 040040CC 3FE08000 + 040040D0 28030000 + 040040D4 41820094 + 040040D8 A08300EC + 040040DC 28040103 + 040040E0 41820088 + 040040E4 28040300 + 040040E8 40800080 + 040040EC 480155A5 + 040040F0 28030000 + 040040F4 40820074 + 040040F8 3C608000 + 040040FC 80634004 + 04004100 28030000 + 04004104 41820010 + 04004108 8063004C + 0400410C 546307FF + 04004110 40820058 + 04004114 807F4000 + 04004118 28030000 + 0400411C 4082002C + 04004120 386000BC + 04004124 482264CD + 04004128 907F4000 + 0400412C 28030000 + 04004130 41820050 + 04004134 63E34008 + 04004138 7C641B78 + 0400413C 807F4000 + 04004140 80ADADA0 + 04004144 48251B89 + 04004148 807F4000 + 0400414C 8003002C + 04004150 60000020 + 04004154 9003002C + 04004158 80810008 + 0400415C 808400D8 + 04004160 482516F1 + 04004164 4800001C + 04004168 807F4000 + 0400416C 28030000 + 04004170 41820010 + 04004174 38000000 + 04004178 901F4000 + 0400417C 48240899 + 04004180 83E1000C + 04004184 80010024 + 04004188 38210020 + 0400418C 7C0803A6 + 04004190 4E800020 diff --git a/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OE0.patch.s b/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OE0.patch.s index f4c7ca73..8c49890f 100644 --- a/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OE0.patch.s +++ b/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OE0.patch.s @@ -31,10 +31,19 @@ start: .address 0x80262294 bl set_window_state_on_switch_to_enemy + .data 0x8028747C + .data 0x00000004 + .address 0x8028747C + b on_TWindowMainMenu1P_created + + .data 0x802873E0 + .data 0x00000004 + .address 0x802873E0 + b on_TWindowMainMenu1P_destroyed + .label is_split_screen, 0x800196C8 .label malloc7, 0x8022953C .label TWindow::close, 0x802438E8 - .label TWindowCtrlPlayer::get_for_player, 0x8024BC54 .label TWindowHelpItem::init, 0x80254AF4 .label TWindowHelpItem::set_displayed_item_by_id, 0x80254678 .label TWindowLockOn::update_for_enemy, 0x80261C54 @@ -47,9 +56,25 @@ start: code_start: .data 0x00000000 # Placeholder for active window pointer + .data 0x00000000 # Placeholder for TWindowMainMenu1P object .data 0x41F00000 # TWindowHelpItem x position .data 0x43480000 # TWindowHelpItem y position +on_TWindowMainMenu1P_created: + lis r4, 0x8000 + stw [r4 + 0x4004], r3 + blr + +on_TWindowMainMenu1P_destroyed: + lis r4, 0x8000 + lwz r0, [r4 + 0x4004] + cmpl r0, r3 + bne on_TWindowMainMenu1P_destroyed_different_object + li r0, 0 + stw [r4 + 0x4004], r0 +on_TWindowMainMenu1P_destroyed_different_object: + blr + set_window_state_on_lock_on_delete: stwu [r1 - 0x20], r1 mflr r0 @@ -118,15 +143,15 @@ set_window_state: # (TItem* item: r3) -> void cmplwi r3, 0 bne window_should_not_exist - # If the player's TWindowCtrlPlayer's TWindowMainMenu is visible, the - # TWindowHelpItem should not be visible - bl TWindowCtrlPlayer::get_for_player - lwz r3, [r3 + 0x28] + # If the TWindowMainMenu1P exists and is visible, the TWindowHelpItem should + # not be visible + lis r3, 0x8000 + lwz r3, [r3 + 0x4004] cmplwi r3, 0 beq window_should_exist # TWindowMainMenu does not exist lwz r3, [r3 + 0x4C] rlwinm. r3, r3, 0, 31, 31 - beq window_should_not_exist + bne window_should_not_exist # TWindowMainMenu exists and is visible window_should_exist: # Check if the window already exists @@ -142,7 +167,7 @@ window_should_exist: # Call the constructor if malloc7 succeeded cmplwi r3, 0 beq set_window_state_return - ori r3, r31, 0x4004 + ori r3, r31, 0x4008 mr r4, r3 lwz r3, [r31 + 0x4000] lwz r5, [r13 - 0x5280] # local_client_id diff --git a/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OE1.patch.s b/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OE1.patch.s index 3fd3d68a..0762d940 100644 --- a/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OE1.patch.s +++ b/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OE1.patch.s @@ -31,10 +31,19 @@ start: .address 0x80262294 bl set_window_state_on_switch_to_enemy + .data 0x802874C0 + .data 0x00000004 + .address 0x802874C0 + b on_TWindowMainMenu1P_created + + .data 0x80287424 + .data 0x00000004 + .address 0x80287424 + b on_TWindowMainMenu1P_destroyed + .label is_split_screen, 0x800196C8 .label malloc7, 0x8022953C .label TWindow::close, 0x802438E8 - .label TWindowCtrlPlayer::get_for_player, 0x8024BC54 .label TWindowHelpItem::init, 0x80254AF4 .label TWindowHelpItem::set_displayed_item_by_id, 0x80254678 .label TWindowLockOn::update_for_enemy, 0x80261C54 @@ -47,9 +56,25 @@ start: code_start: .data 0x00000000 # Placeholder for active window pointer + .data 0x00000000 # Placeholder for TWindowMainMenu1P object .data 0x41F00000 # TWindowHelpItem x position .data 0x43480000 # TWindowHelpItem y position +on_TWindowMainMenu1P_created: + lis r4, 0x8000 + stw [r4 + 0x4004], r3 + blr + +on_TWindowMainMenu1P_destroyed: + lis r4, 0x8000 + lwz r0, [r4 + 0x4004] + cmpl r0, r3 + bne on_TWindowMainMenu1P_destroyed_different_object + li r0, 0 + stw [r4 + 0x4004], r0 +on_TWindowMainMenu1P_destroyed_different_object: + blr + set_window_state_on_lock_on_delete: stwu [r1 - 0x20], r1 mflr r0 @@ -118,15 +143,15 @@ set_window_state: # (TItem* item: r3) -> void cmplwi r3, 0 bne window_should_not_exist - # If the player's TWindowCtrlPlayer's TWindowMainMenu is visible, the - # TWindowHelpItem should not be visible - bl TWindowCtrlPlayer::get_for_player - lwz r3, [r3 + 0x28] + # If the TWindowMainMenu1P exists and is visible, the TWindowHelpItem should + # not be visible + lis r3, 0x8000 + lwz r3, [r3 + 0x4004] cmplwi r3, 0 beq window_should_exist # TWindowMainMenu does not exist lwz r3, [r3 + 0x4C] rlwinm. r3, r3, 0, 31, 31 - beq window_should_not_exist + bne window_should_not_exist # TWindowMainMenu exists and is visible window_should_exist: # Check if the window already exists @@ -142,7 +167,7 @@ window_should_exist: # Call the constructor if malloc7 succeeded cmplwi r3, 0 beq set_window_state_return - ori r3, r31, 0x4004 + ori r3, r31, 0x4008 mr r4, r3 lwz r3, [r31 + 0x4000] lwz r5, [r13 - 0x5280] # local_client_id diff --git a/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OE2.patch.s b/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OE2.patch.s index 39558fc3..9676f1f2 100644 --- a/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OE2.patch.s +++ b/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OE2.patch.s @@ -31,10 +31,19 @@ start: .address 0x80263654 bl set_window_state_on_switch_to_enemy + .data 0x8028893C + .data 0x00000004 + .address 0x8028893C + b on_TWindowMainMenu1P_created + + .data 0x802888A0 + .data 0x00000004 + .address 0x802888A0 + b on_TWindowMainMenu1P_destroyed + .label is_split_screen, 0x80019690 .label malloc7, 0x8022A5F0 .label TWindow::close, 0x80244A14 - .label TWindowCtrlPlayer::get_for_player, 0x8024CDD0 .label TWindowHelpItem::init, 0x80255CCC .label TWindowHelpItem::set_displayed_item_by_id, 0x80255850 .label TWindowLockOn::update_for_enemy, 0x80263014 @@ -47,9 +56,25 @@ start: code_start: .data 0x00000000 # Placeholder for active window pointer + .data 0x00000000 # Placeholder for TWindowMainMenu1P object .data 0x41F00000 # TWindowHelpItem x position .data 0x43480000 # TWindowHelpItem y position +on_TWindowMainMenu1P_created: + lis r4, 0x8000 + stw [r4 + 0x4004], r3 + blr + +on_TWindowMainMenu1P_destroyed: + lis r4, 0x8000 + lwz r0, [r4 + 0x4004] + cmpl r0, r3 + bne on_TWindowMainMenu1P_destroyed_different_object + li r0, 0 + stw [r4 + 0x4004], r0 +on_TWindowMainMenu1P_destroyed_different_object: + blr + set_window_state_on_lock_on_delete: stwu [r1 - 0x20], r1 mflr r0 @@ -118,15 +143,15 @@ set_window_state: # (TItem* item: r3) -> void cmplwi r3, 0 bne window_should_not_exist - # If the player's TWindowCtrlPlayer's TWindowMainMenu is visible, the - # TWindowHelpItem should not be visible - bl TWindowCtrlPlayer::get_for_player - lwz r3, [r3 + 0x28] + # If the TWindowMainMenu1P exists and is visible, the TWindowHelpItem should + # not be visible + lis r3, 0x8000 + lwz r3, [r3 + 0x4004] cmplwi r3, 0 beq window_should_exist # TWindowMainMenu does not exist lwz r3, [r3 + 0x4C] rlwinm. r3, r3, 0, 31, 31 - beq window_should_not_exist + bne window_should_not_exist # TWindowMainMenu exists and is visible window_should_exist: # Check if the window already exists @@ -142,7 +167,7 @@ window_should_exist: # Call the constructor if malloc7 succeeded cmplwi r3, 0 beq set_window_state_return - ori r3, r31, 0x4004 + ori r3, r31, 0x4008 mr r4, r3 lwz r3, [r31 + 0x4000] lwz r5, [r13 - 0x5260] # local_client_id diff --git a/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OJ2.patch.s b/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OJ2.patch.s index 2e095791..50ef4d72 100644 --- a/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OJ2.patch.s +++ b/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OJ2.patch.s @@ -31,10 +31,19 @@ start: .address 0x802619BC bl set_window_state_on_switch_to_enemy + .data 0x80286BB0 + .data 0x00000004 + .address 0x80286BB0 + b on_TWindowMainMenu1P_created + + .data 0x80286B14 + .data 0x00000004 + .address 0x80286B14 + b on_TWindowMainMenu1P_destroyed + .label is_split_screen, 0x800196B0 .label malloc7, 0x80228C80 .label TWindow::close, 0x8024302C - .label TWindowCtrlPlayer::get_for_player, 0x8024B3CC .label TWindowHelpItem::init, 0x8025426C .label TWindowHelpItem::set_displayed_item_by_id, 0x80253DF0 .label TWindowLockOn::update_for_enemy, 0x8026137C @@ -47,9 +56,25 @@ start: code_start: .data 0x00000000 # Placeholder for active window pointer + .data 0x00000000 # Placeholder for TWindowMainMenu1P object .data 0x41F00000 # TWindowHelpItem x position .data 0x43480000 # TWindowHelpItem y position +on_TWindowMainMenu1P_created: + lis r4, 0x8000 + stw [r4 + 0x4004], r3 + blr + +on_TWindowMainMenu1P_destroyed: + lis r4, 0x8000 + lwz r0, [r4 + 0x4004] + cmpl r0, r3 + bne on_TWindowMainMenu1P_destroyed_different_object + li r0, 0 + stw [r4 + 0x4004], r0 +on_TWindowMainMenu1P_destroyed_different_object: + blr + set_window_state_on_lock_on_delete: stwu [r1 - 0x20], r1 mflr r0 @@ -118,15 +143,15 @@ set_window_state: # (TItem* item: r3) -> void cmplwi r3, 0 bne window_should_not_exist - # If the player's TWindowCtrlPlayer's TWindowMainMenu is visible, the - # TWindowHelpItem should not be visible - bl TWindowCtrlPlayer::get_for_player - lwz r3, [r3 + 0x28] + # If the TWindowMainMenu1P exists and is visible, the TWindowHelpItem should + # not be visible + lis r3, 0x8000 + lwz r3, [r3 + 0x4004] cmplwi r3, 0 beq window_should_exist # TWindowMainMenu does not exist lwz r3, [r3 + 0x4C] rlwinm. r3, r3, 0, 31, 31 - beq window_should_not_exist + bne window_should_not_exist # TWindowMainMenu exists and is visible window_should_exist: # Check if the window already exists @@ -142,7 +167,7 @@ window_should_exist: # Call the constructor if malloc7 succeeded cmplwi r3, 0 beq set_window_state_return - ori r3, r31, 0x4004 + ori r3, r31, 0x4008 mr r4, r3 lwz r3, [r31 + 0x4000] lwz r5, [r13 - 0x5298] # local_client_id diff --git a/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OJ3.patch.s b/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OJ3.patch.s index cc2b43bc..455afe0a 100644 --- a/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OJ3.patch.s +++ b/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OJ3.patch.s @@ -31,10 +31,19 @@ start: .address 0x80262594 bl set_window_state_on_switch_to_enemy + .data 0x80287924 + .data 0x00000004 + .address 0x80287924 + b on_TWindowMainMenu1P_created + + .data 0x80287888 + .data 0x00000004 + .address 0x80287888 + b on_TWindowMainMenu1P_destroyed + .label is_split_screen, 0x800196E0 .label malloc7, 0x8022961C .label TWindow::close, 0x802439EC - .label TWindowCtrlPlayer::get_for_player, 0x8024BE18 .label TWindowHelpItem::init, 0x80254D14 .label TWindowHelpItem::set_displayed_item_by_id, 0x80254898 .label TWindowLockOn::update_for_enemy, 0x80261F54 @@ -47,9 +56,25 @@ start: code_start: .data 0x00000000 # Placeholder for active window pointer + .data 0x00000000 # Placeholder for TWindowMainMenu1P object .data 0x41F00000 # TWindowHelpItem x position .data 0x43480000 # TWindowHelpItem y position +on_TWindowMainMenu1P_created: + lis r4, 0x8000 + stw [r4 + 0x4004], r3 + blr + +on_TWindowMainMenu1P_destroyed: + lis r4, 0x8000 + lwz r0, [r4 + 0x4004] + cmpl r0, r3 + bne on_TWindowMainMenu1P_destroyed_different_object + li r0, 0 + stw [r4 + 0x4004], r0 +on_TWindowMainMenu1P_destroyed_different_object: + blr + set_window_state_on_lock_on_delete: stwu [r1 - 0x20], r1 mflr r0 @@ -118,15 +143,15 @@ set_window_state: # (TItem* item: r3) -> void cmplwi r3, 0 bne window_should_not_exist - # If the player's TWindowCtrlPlayer's TWindowMainMenu is visible, the - # TWindowHelpItem should not be visible - bl TWindowCtrlPlayer::get_for_player - lwz r3, [r3 + 0x28] + # If the TWindowMainMenu1P exists and is visible, the TWindowHelpItem should + # not be visible + lis r3, 0x8000 + lwz r3, [r3 + 0x4004] cmplwi r3, 0 beq window_should_exist # TWindowMainMenu does not exist lwz r3, [r3 + 0x4C] rlwinm. r3, r3, 0, 31, 31 - beq window_should_not_exist + bne window_should_not_exist # TWindowMainMenu exists and is visible window_should_exist: # Check if the window already exists @@ -142,7 +167,7 @@ window_should_exist: # Call the constructor if malloc7 succeeded cmplwi r3, 0 beq set_window_state_return - ori r3, r31, 0x4004 + ori r3, r31, 0x4008 mr r4, r3 lwz r3, [r31 + 0x4000] lwz r5, [r13 - 0x5290] # local_client_id diff --git a/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OJ4.patch.s b/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OJ4.patch.s index be952fd7..12701478 100644 --- a/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OJ4.patch.s +++ b/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OJ4.patch.s @@ -31,10 +31,19 @@ start: .address 0x802635DC bl set_window_state_on_switch_to_enemy + .data 0x802889D4 + .data 0x00000004 + .address 0x802889D4 + b on_TWindowMainMenu1P_created + + .data 0x80288938 + .data 0x00000004 + .address 0x80288938 + b on_TWindowMainMenu1P_destroyed + .label is_split_screen, 0x800111BC .label malloc7, 0x8022A544 .label TWindow::close, 0x80244940 - .label TWindowCtrlPlayer::get_for_player, 0x8024CD58 .label TWindowHelpItem::init, 0x80255CC8 .label TWindowHelpItem::set_displayed_item_by_id, 0x8025584C .label TWindowLockOn::update_for_enemy, 0x80262F9C @@ -47,9 +56,25 @@ start: code_start: .data 0x00000000 # Placeholder for active window pointer + .data 0x00000000 # Placeholder for TWindowMainMenu1P object .data 0x41F00000 # TWindowHelpItem x position .data 0x43480000 # TWindowHelpItem y position +on_TWindowMainMenu1P_created: + lis r4, 0x8000 + stw [r4 + 0x4004], r3 + blr + +on_TWindowMainMenu1P_destroyed: + lis r4, 0x8000 + lwz r0, [r4 + 0x4004] + cmpl r0, r3 + bne on_TWindowMainMenu1P_destroyed_different_object + li r0, 0 + stw [r4 + 0x4004], r0 +on_TWindowMainMenu1P_destroyed_different_object: + blr + set_window_state_on_lock_on_delete: stwu [r1 - 0x20], r1 mflr r0 @@ -118,15 +143,15 @@ set_window_state: # (TItem* item: r3) -> void cmplwi r3, 0 bne window_should_not_exist - # If the player's TWindowCtrlPlayer's TWindowMainMenu is visible, the - # TWindowHelpItem should not be visible - bl TWindowCtrlPlayer::get_for_player - lwz r3, [r3 + 0x28] + # If the TWindowMainMenu1P exists and is visible, the TWindowHelpItem should + # not be visible + lis r3, 0x8000 + lwz r3, [r3 + 0x4004] cmplwi r3, 0 beq window_should_exist # TWindowMainMenu does not exist lwz r3, [r3 + 0x4C] rlwinm. r3, r3, 0, 31, 31 - beq window_should_not_exist + bne window_should_not_exist # TWindowMainMenu exists and is visible window_should_exist: # Check if the window already exists @@ -142,7 +167,7 @@ window_should_exist: # Call the constructor if malloc7 succeeded cmplwi r3, 0 beq set_window_state_return - ori r3, r31, 0x4004 + ori r3, r31, 0x4008 mr r4, r3 lwz r3, [r31 + 0x4000] lwz r5, [r13 - 0x5270] # local_client_id diff --git a/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OJ5.patch.s b/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OJ5.patch.s index d1194df6..6ae45343 100644 --- a/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OJ5.patch.s +++ b/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OJ5.patch.s @@ -31,10 +31,19 @@ start: .address 0x80263390 bl set_window_state_on_switch_to_enemy + .data 0x80288788 + .data 0x00000004 + .address 0x80288788 + b on_TWindowMainMenu1P_created + + .data 0x802886EC + .data 0x00000004 + .address 0x802886EC + b on_TWindowMainMenu1P_destroyed + .label is_split_screen, 0x80019690 .label malloc7, 0x8022A2BC .label TWindow::close, 0x802446E0 - .label TWindowCtrlPlayer::get_for_player, 0x8024CB0C .label TWindowHelpItem::init, 0x80255A08 .label TWindowHelpItem::set_displayed_item_by_id, 0x8025558C .label TWindowLockOn::update_for_enemy, 0x80262D50 @@ -47,9 +56,25 @@ start: code_start: .data 0x00000000 # Placeholder for active window pointer + .data 0x00000000 # Placeholder for TWindowMainMenu1P object .data 0x41F00000 # TWindowHelpItem x position .data 0x43480000 # TWindowHelpItem y position +on_TWindowMainMenu1P_created: + lis r4, 0x8000 + stw [r4 + 0x4004], r3 + blr + +on_TWindowMainMenu1P_destroyed: + lis r4, 0x8000 + lwz r0, [r4 + 0x4004] + cmpl r0, r3 + bne on_TWindowMainMenu1P_destroyed_different_object + li r0, 0 + stw [r4 + 0x4004], r0 +on_TWindowMainMenu1P_destroyed_different_object: + blr + set_window_state_on_lock_on_delete: stwu [r1 - 0x20], r1 mflr r0 @@ -118,15 +143,15 @@ set_window_state: # (TItem* item: r3) -> void cmplwi r3, 0 bne window_should_not_exist - # If the player's TWindowCtrlPlayer's TWindowMainMenu is visible, the - # TWindowHelpItem should not be visible - bl TWindowCtrlPlayer::get_for_player - lwz r3, [r3 + 0x28] + # If the TWindowMainMenu1P exists and is visible, the TWindowHelpItem should + # not be visible + lis r3, 0x8000 + lwz r3, [r3 + 0x4004] cmplwi r3, 0 beq window_should_exist # TWindowMainMenu does not exist lwz r3, [r3 + 0x4C] rlwinm. r3, r3, 0, 31, 31 - beq window_should_not_exist + bne window_should_not_exist # TWindowMainMenu exists and is visible window_should_exist: # Check if the window already exists @@ -142,7 +167,7 @@ window_should_exist: # Call the constructor if malloc7 succeeded cmplwi r3, 0 beq set_window_state_return - ori r3, r31, 0x4004 + ori r3, r31, 0x4008 mr r4, r3 lwz r3, [r31 + 0x4000] lwz r5, [r13 - 0x5270] # local_client_id diff --git a/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OP0.patch.s b/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OP0.patch.s index 98edb12e..6324f262 100644 --- a/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OP0.patch.s +++ b/system/client-functions/ExtendedItemInfo/ExtendedItemInfo.3OP0.patch.s @@ -31,10 +31,19 @@ start: .address 0x80262E9C bl set_window_state_on_switch_to_enemy + .data 0x80288140 + .data 0x00000004 + .address 0x80288140 + b on_TWindowMainMenu1P_created + + .data 0x802880A4 + .data 0x00000004 + .address 0x802880A4 + b on_TWindowMainMenu1P_destroyed + .label is_split_screen, 0x80019708 .label malloc7, 0x80229E88 .label TWindow::close, 0x8024425C - .label TWindowCtrlPlayer::get_for_player, 0x8024C618 .label TWindowHelpItem::init, 0x80255514 .label TWindowHelpItem::set_displayed_item_by_id, 0x80255098 .label TWindowLockOn::update_for_enemy, 0x8026285C @@ -47,9 +56,25 @@ start: code_start: .data 0x00000000 # Placeholder for active window pointer + .data 0x00000000 # Placeholder for TWindowMainMenu1P object .data 0x41F00000 # TWindowHelpItem x position .data 0x43480000 # TWindowHelpItem y position +on_TWindowMainMenu1P_created: + lis r4, 0x8000 + stw [r4 + 0x4004], r3 + blr + +on_TWindowMainMenu1P_destroyed: + lis r4, 0x8000 + lwz r0, [r4 + 0x4004] + cmpl r0, r3 + bne on_TWindowMainMenu1P_destroyed_different_object + li r0, 0 + stw [r4 + 0x4004], r0 +on_TWindowMainMenu1P_destroyed_different_object: + blr + set_window_state_on_lock_on_delete: stwu [r1 - 0x20], r1 mflr r0 @@ -118,15 +143,15 @@ set_window_state: # (TItem* item: r3) -> void cmplwi r3, 0 bne window_should_not_exist - # If the player's TWindowCtrlPlayer's TWindowMainMenu is visible, the - # TWindowHelpItem should not be visible - bl TWindowCtrlPlayer::get_for_player - lwz r3, [r3 + 0x28] + # If the TWindowMainMenu1P exists and is visible, the TWindowHelpItem should + # not be visible + lis r3, 0x8000 + lwz r3, [r3 + 0x4004] cmplwi r3, 0 beq window_should_exist # TWindowMainMenu does not exist lwz r3, [r3 + 0x4C] rlwinm. r3, r3, 0, 31, 31 - beq window_should_not_exist + bne window_should_not_exist # TWindowMainMenu exists and is visible window_should_exist: # Check if the window already exists @@ -142,7 +167,7 @@ window_should_exist: # Call the constructor if malloc7 succeeded cmplwi r3, 0 beq set_window_state_return - ori r3, r31, 0x4004 + ori r3, r31, 0x4008 mr r4, r3 lwz r3, [r31 + 0x4000] lwz r5, [r13 - 0x5220] # local_client_id