Andrea
Usuario mítico
Good morning!
These days i saw an update of an Italian hack, where there was a very interesting feature, that is the loading the image of items when they added to the bag.
Since it seemed like a nice thing to implement in our ROMs, today i'll explain how to do that!
#1 - Hook and asm routine
#2 - Final Result:
These days i saw an update of an Italian hack, where there was a very interesting feature, that is the loading the image of items when they added to the bag.
Since it seemed like a nice thing to implement in our ROMs, today i'll explain how to do that!
#1 - Hook and asm routine
Let's go to the offset 080F6F08 and overwrite with the byte 00480047XXXXXX08
Where in place of the x will be insert the asm routine offset in little endian format +1.
Next we compile the following routine in a free offset in the rom:
Where in place of the x will be insert the asm routine offset in little endian format +1.
Next we compile the following routine in a free offset in the rom:
.THUMB
.ALIGN 2
CMP R4, #1
BNE END
MOV R0, R5
MOV R1, #3
BL BOX
PUSH {R0-R7}
LDR R0, = 0x03000EC4
LDR R0, [R0]
LDR R1, = 0x081A6816
LDR R2, = 0x081A6820
CMP R0, R1
BEQ LOAD
CMP R0, R2
BNE END_
LOAD:
LDR R0, = 0x020370C0
LDRH R0, [R0]
LSL R0, R0, #3
LDR R5, = 0x083D4294
ADD R5, R0
LDR R0, [R5]
LDR R1, = 0x06008020
SWI 0x12
MOV R2, R1
LDR R0, [R5, #4]
LDR R1, = 0x02037798
SWI 0x12
MOV R0, #0x7F
LSL R0, R0, #8
ADD R0, #0xFF
STRH R0, [R1, #0x1E]
MOV R0, R2
MOV R6, #0x12
LSL R6, R6, #5
MOV R5, #0
LOOP_:
LDRB R1, [R0, R5]
LDRB R2, [R0, R5]
MOV R3, #0x0F
MOV R4, #0xF0
AND R1, R3
AND R2, R4
CMP R1, #0
BNE LAST
MOV R1, #0x0F
LAST:
LSR R3, R2, #4
CMP R3, #0
BNE CONTROL
MOV R2, #0xF0
CONTROL:
ORR R2, R1
ADD R5, #1
CMP R5, #2
BNE BYTE
LSL R2, R2, #8
ORR R7, R2
STRH R7, [R0]
ADD R0, #2
MOV R5, #0
B COUNTER
BYTE:
MOV R7, R2
COUNTER:
SUB R6, #1
BPL LOOP_
MOV R1, #0xD
LSL R1, R1, #12
ADD R1, R1, #1
MOV R2, #2
MOV R3, #2
LDR R0, = 0x02001C6E
LOOP:
STRH R1, [R0]
ADD R0, #2
ADD R1, #1
SUB R2, #1
BPL LOOP
MOV R2, #2
ADD R0, #0x3A
SUB R3, #1
BPL LOOP
END_:
POP {R0-R7}
END:
POP {R4, R5}
POP {R0}
BX R0
BOX:
PUSH {R0}
LDR R0, = 0x08003F20+1
MOV R10, R0
POP {R0}
BX R10
.ALIGN 2
CMP R4, #1
BNE END
MOV R0, R5
MOV R1, #3
BL BOX
PUSH {R0-R7}
LDR R0, = 0x03000EC4
LDR R0, [R0]
LDR R1, = 0x081A6816
LDR R2, = 0x081A6820
CMP R0, R1
BEQ LOAD
CMP R0, R2
BNE END_
LOAD:
LDR R0, = 0x020370C0
LDRH R0, [R0]
LSL R0, R0, #3
LDR R5, = 0x083D4294
ADD R5, R0
LDR R0, [R5]
LDR R1, = 0x06008020
SWI 0x12
MOV R2, R1
LDR R0, [R5, #4]
LDR R1, = 0x02037798
SWI 0x12
MOV R0, #0x7F
LSL R0, R0, #8
ADD R0, #0xFF
STRH R0, [R1, #0x1E]
MOV R0, R2
MOV R6, #0x12
LSL R6, R6, #5
MOV R5, #0
LOOP_:
LDRB R1, [R0, R5]
LDRB R2, [R0, R5]
MOV R3, #0x0F
MOV R4, #0xF0
AND R1, R3
AND R2, R4
CMP R1, #0
BNE LAST
MOV R1, #0x0F
LAST:
LSR R3, R2, #4
CMP R3, #0
BNE CONTROL
MOV R2, #0xF0
CONTROL:
ORR R2, R1
ADD R5, #1
CMP R5, #2
BNE BYTE
LSL R2, R2, #8
ORR R7, R2
STRH R7, [R0]
ADD R0, #2
MOV R5, #0
B COUNTER
BYTE:
MOV R7, R2
COUNTER:
SUB R6, #1
BPL LOOP_
MOV R1, #0xD
LSL R1, R1, #12
ADD R1, R1, #1
MOV R2, #2
MOV R3, #2
LDR R0, = 0x02001C6E
LOOP:
STRH R1, [R0]
ADD R0, #2
ADD R1, #1
SUB R2, #1
BPL LOOP
MOV R2, #2
ADD R0, #0x3A
SUB R3, #1
BPL LOOP
END_:
POP {R0-R7}
END:
POP {R4, R5}
POP {R0}
BX R0
BOX:
PUSH {R0}
LDR R0, = 0x08003F20+1
MOV R10, R0
POP {R0}
BX R10
#2 - Final Result: