Added some Equip stuff
Mainly this makes the game only print (None) if there's no equipment. Previously it would always print (None) for all four slots, and *then* print the equipment names over top.
This commit is contained in:
parent
54fe6ac47c
commit
193301c777
15
m2-hack.asm
15
m2-hack.asm
|
@ -34,6 +34,21 @@ org $80BE16A; strh r2,[r4,#0]
|
||||||
org $80BE1FA; strh r2,[r6,#0]
|
org $80BE1FA; strh r2,[r6,#0]
|
||||||
org $80BE222; strh r6,[r1,#0]
|
org $80BE222; strh r6,[r1,#0]
|
||||||
|
|
||||||
|
//---------------------------------------------------------
|
||||||
|
// C4B2C hacks (Equip window)
|
||||||
|
//---------------------------------------------------------
|
||||||
|
|
||||||
|
// Start equipment at the 6th tile instead of 5th
|
||||||
|
org $80C4C96; mov r2,#6 // Weapon
|
||||||
|
org $80C4D1C; mov r2,#6 // Body
|
||||||
|
org $80C4DA4; mov r2,#6 // Arms
|
||||||
|
org $80C4E2C; mov r2,#6 // Other
|
||||||
|
|
||||||
|
// Only render (None) if necessary
|
||||||
|
org $80C4C0C
|
||||||
|
bl m2_vwf_entries.c4b2c_skip_nones
|
||||||
|
b $80C4C58
|
||||||
|
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
// C980C hacks
|
// C980C hacks
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
|
|
|
@ -14,6 +14,7 @@ Hard-coded characters:
|
||||||
0x30051EC: tile offset (usually 0x100)
|
0x30051EC: tile offset (usually 0x100)
|
||||||
0x3005228: current text palette, << 0xC
|
0x3005228: current text palette, << 0xC
|
||||||
0x3005230: addresses of all 11 windows
|
0x3005230: addresses of all 11 windows
|
||||||
|
0x3005264: active window party member
|
||||||
0x3005270: address of tilemap start in WRAM, can use this to figure out X and Y
|
0x3005270: address of tilemap start in WRAM, can use this to figure out X and Y
|
||||||
|
|
||||||
LDRB Rx,[Ry,#n]: n has range 0-31 (0x0-0x1F)
|
LDRB Rx,[Ry,#n]: n has range 0-31 (0x0-0x1F)
|
||||||
|
@ -22,6 +23,8 @@ LDR Rx,[Ry,#n]: n has range 0-124 (0x0-0x7C) (0-1020 for SP- and PC-relative)
|
||||||
|
|
||||||
Custom WRAM: 2027FC0
|
Custom WRAM: 2027FC0
|
||||||
|
|
||||||
|
80C4C24: equip window renders four (None)s in a row
|
||||||
|
|
||||||
|
|
||||||
Subroutines
|
Subroutines
|
||||||
-----------
|
-----------
|
||||||
|
|
|
@ -59,3 +59,77 @@ strh r4,[r6,#2]
|
||||||
// Clobbered code
|
// Clobbered code
|
||||||
strh r5,[r1,#0]
|
strh r5,[r1,#0]
|
||||||
pop {pc}
|
pop {pc}
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
.c4b2c_skip_nones:
|
||||||
|
push {r7,lr}
|
||||||
|
add sp,#-4
|
||||||
|
mov r7,#0
|
||||||
|
|
||||||
|
// Get the (none) pointer
|
||||||
|
mov r0,r4
|
||||||
|
mov r1,r10
|
||||||
|
mov r2,#0x2A
|
||||||
|
bl $80BE260
|
||||||
|
mov r5,r0
|
||||||
|
|
||||||
|
// Check each equip slot
|
||||||
|
ldr r6,=#0x3001D40
|
||||||
|
ldr r3,=#0x3005264
|
||||||
|
ldrh r0,[r3,#0] // active party character
|
||||||
|
mov r1,#0x6C
|
||||||
|
mul r0,r1
|
||||||
|
add r6,r0,r6
|
||||||
|
add r6,#0x75
|
||||||
|
ldrb r0,[r6,#0]
|
||||||
|
bne +
|
||||||
|
|
||||||
|
// Weapon
|
||||||
|
mov r0,r8
|
||||||
|
mov r1,r5
|
||||||
|
mov r2,#0x6
|
||||||
|
mov r3,#0
|
||||||
|
str r7,[sp,#0]
|
||||||
|
bl $80C9634
|
||||||
|
|
||||||
|
+
|
||||||
|
ldrb r0,[r6,#1]
|
||||||
|
bne +
|
||||||
|
|
||||||
|
// Body
|
||||||
|
mov r0,r8
|
||||||
|
mov r1,r5
|
||||||
|
mov r2,#0x6
|
||||||
|
mov r3,#1
|
||||||
|
str r7,[sp,#0]
|
||||||
|
bl $80C9634
|
||||||
|
|
||||||
|
+
|
||||||
|
ldrb r0,[r6,#2]
|
||||||
|
bne +
|
||||||
|
|
||||||
|
// Arms
|
||||||
|
mov r0,r8
|
||||||
|
mov r1,r5
|
||||||
|
mov r2,#0x6
|
||||||
|
mov r3,#2
|
||||||
|
str r7,[sp,#0]
|
||||||
|
bl $80C9634
|
||||||
|
|
||||||
|
+
|
||||||
|
ldrb r0,[r6,#3]
|
||||||
|
bne +
|
||||||
|
|
||||||
|
// Other
|
||||||
|
mov r0,r8
|
||||||
|
mov r1,r5
|
||||||
|
mov r2,#0x6
|
||||||
|
mov r3,#3
|
||||||
|
str r7,[sp,#0]
|
||||||
|
bl $80C9634
|
||||||
|
|
||||||
|
+
|
||||||
|
mov r0,#0
|
||||||
|
mov r10,r0
|
||||||
|
add sp,#4
|
||||||
|
pop {r7,pc}
|
Loading…
Reference in New Issue