03-30-2018, 09:01 PM (This post was last modified: 04-04-2018, 05:56 PM by Eddio 0141.
Edit Reason: mistakes mistakes a proof that i'm a human
)
code hook thing for armips
for compressed ROM (8mb one)
Code:
.headersize 0x80245000
; replaces segment 02 loader with code loader
.orga 0x3ac0
lui a0, 0x8037; copy to ram (80370000 [8703 line of codes free or 34812 bytes])
addiu a0, a0, 0x0000
lui t0, 0x007c ; rom address copy from (0x7cc6c0 for this)
ori a1, t0, 0xc6c0
jal 0x80278504
ori a2, t0, 0xc700 ; rom addresss copy to
jal execmycodeonce
nop
.orga 0x15F4
jal execeveryframe
nop
.headersize 0x7FBA3940
.orga 0x7cc6c0
execmycodeonce:
ADDIU SP, SP, 0xFFE8
SW RA, 0x14(SP)
lui t0, 0x0011; seg02 loader (NEED THIS OR GAME WON'T WORK)
addiu a1, t0, 0x8a40
addiu a2, t0, 0x4750
jal 0x802787d8
addiu a0, r0, 0x0002
; your code here that runs once at start up
LW RA, 0x14(SP)
JR RA
ADDIU SP, SP, 0x18
execeveryframe:
ADDIU SP, SP, 0xFFE4
SW RA, 0x14(SP)
; your code that runs everyframe here
lui t6, 0x8033; do not delete this
lw t6, 0xd568(t6); do not delete this as well
LW RA, 0x14(SP)
JR RA
ADDIU SP, SP, 0x1c
for extended rom (uncompressed)
Code:
.headersize 0x80245000
; replaces segment 02 loader with code loader
.orga 0x3ac0
lui a0, 0x8037; copy to ram (80370000 [8703 line of codes free or 34812 bytes])
addiu a0, a0, 0x0000
lui t0, 0x007c ; rom address copy from (0x7cc6c0 for this)
ori a1, t0, 0xc6c0
jal 0x80278504
ori a2, t0, 0xc700 ; rom addresss copy to
jal execmycodeonce
nop
.orga 0x15F4
jal execeveryframe
nop
.headersize 0x7FBA3940
.orga 0x7cc6c0
execmycodeonce:
ADDIU SP, SP, 0xFFE8
SW RA, 0x14(SP)
lui a1, 0x0080; seg02 loader (NEED THIS OR GAME WON'T WORK)
lui a2, 0x0082
ori a2, a2, 0xbb64
jal 0x802787d8
addiu a0, r0, 0x0002
; your code here that runs once at start up
LW RA, 0x14(SP)
JR RA
ADDIU SP, SP, 0x18
execeveryframe:
ADDIU SP, SP, 0xFFE4
SW RA, 0x14(SP)
; your code that runs everyframe here
lui t6, 0x8033; do not delete this
lw t6, 0xd568(t6); do not delete this as well
LW RA, 0x14(SP)
JR RA
ADDIU SP, SP, 0x1c