Skip to content

Commit

Permalink
fix ExtendedItemInfo patch and add AR code
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzziqersoftware committed Feb 23, 2025
1 parent 104e310 commit 11d5390
Show file tree
Hide file tree
Showing 9 changed files with 471 additions and 56 deletions.
215 changes: 215 additions & 0 deletions notes/ar-codes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading

0 comments on commit 11d5390

Please sign in to comment.