fix ExtendedItemInfo patch and add AR code

This commit is contained in:
Martin Michelsen
2025-02-22 17:18:30 -08:00
parent 104e31028b
commit 11d539042c
9 changed files with 471 additions and 56 deletions
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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