Started Goods window hacks
This commit is contained in:
parent
83f88e7f17
commit
e8aa855162
49
m2-hack.asm
49
m2-hack.asm
|
@ -98,6 +98,55 @@ b 0x80BADD8
|
|||
.org 0x80BBB12 :: bl baef8_reequip_erase
|
||||
.org 0x80BBC70 :: bl baef8_reequip_erase
|
||||
|
||||
//---------------------------------------------------------
|
||||
// BF858 hacks (goods window)
|
||||
//---------------------------------------------------------
|
||||
|
||||
// Skip the tile-by-tile nonsense and use existing string printing subs
|
||||
.org 0x80BFB08 :: mov r4,r0 :: nop
|
||||
.org 0x80BFB10 :: b 0x80BFB34
|
||||
|
||||
.org 0x80BFB34
|
||||
// Only render on button press
|
||||
ldr r0,=0x3002504 // for some reason 3002500 is already cleared when opening the window,
|
||||
// but 3002504 seems to be a copy of what it used to be?
|
||||
ldrb r0,[r0]
|
||||
cmp r0,0
|
||||
beq 0x80BFB84
|
||||
// Check for equip
|
||||
ldrh r0,[r7,0x3C]
|
||||
add r0,r8
|
||||
add r0,1
|
||||
lsl r0,r0,0x18
|
||||
lsr r0,r0,0x18
|
||||
bl 0x80BC670
|
||||
mov r3,0
|
||||
lsl r0,r0,0x18
|
||||
lsr r0,r0,0x18
|
||||
cmp r0,1
|
||||
bne @@noequip
|
||||
mov r3,1
|
||||
@@noequip:
|
||||
lsl r2,r5,15
|
||||
lsr r2,r2,31
|
||||
mov r0,11
|
||||
mul r2,r0
|
||||
add r2,1
|
||||
add r2,r2,r3 // r2 = X tile, 1 or 12 depending on the column (+1 if equipped)
|
||||
lsr r3,r5,17 // r3 = Y tile
|
||||
add sp,-4 // Need to push a 0 for the call to m2_printstr
|
||||
mov r0,0
|
||||
str r0,[sp]
|
||||
mov r0,r7 // Window pointer
|
||||
mov r1,r4 // String pointer
|
||||
bl 0x80C9634 // m2_printstr
|
||||
add sp,4
|
||||
b 0x80BFB84 // Skip the remaining nonsense
|
||||
.pool
|
||||
|
||||
// Skip the blank tile drawing after item names
|
||||
.org 0x80BFBDA :: b 0x80BFBFA
|
||||
|
||||
//---------------------------------------------------------
|
||||
// C5500 hacks (equip window switching)
|
||||
//---------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue