Recently I decided to finally get my ass off and take on the huge task of learning r4300i disassembly. I have basically spent the last two weeks just trying to find documentation on the subject, and learn whatever I could from it. This, I hope anyways, has probably given me some decent knowledge in the very basics of MIPS disassembly.
A few days ago I started trying to write ASM hacks of my own (for the OoT MQ debug ROM). Obviously I wanted to start with something simple, namely that the current Rupee amount would increase by 1 each time that the D-pad up button was pressed. I used the source of
as a base when (trying) to write the hack, which resulted in what I thought was a pretty legit-looking code. Of course it didn't work at all in-game. The closest result I managed to get was that the game paused each time that D-pad up was pressed, which is kinda cool but not very close to the desired effect.
I have tried to fix the problem by myself for a time now, but I just don't seem to have the knowledge to locate the problem. I suspect that some instruction might be missing, or that I may have constructed the hack in a weird way. Another, "sillier" possibility is that I've just assembled the gs code incorrectly, since I had to do it manually due to neither the Renegade64 nor Galatea assemblers working correctly on my computer. I haven't been able to find any of these issues though, and I have checked the gameshark code multiple times for faults I couldn't find. I think that the solution simply just lies beyond me and my current capabilities.
I hope that maybe some of our experienced and knowledgeable MIPS-disassemblers will show up and save the day, but any help would be mostly appreciated really. Anyway, here's the source and gs code:
Source:
.ORG 0x80047E50
J 0x801A0000
NOP
.ORG 0x801A0000
LUI T0, 0x8016 ; Loads upper adress to rupee amount in T0
LH T4, 0xE694(T0) ; Loads halfword from T0 into T4
LUI T0, 0x8016 ; Loads upper adress to controller buttons
LHU T2, 0x6AF0(T0) ; Loads unsigned half-word into T2 from T0(controller buttons)
ADDIU T3, R0, 0x0800 ; Dpad-up stored into T3
BEQL T2, T3, 0x801A001C ; If T2(controller buttons) equals to T3(Dpad-up pressed), branch to 0x811A001C
ADDIU T4, T4, 0x0001 ; Adds immediate value 0x0001 to T4(current rupee amount)
.ORG 0x801A001C
LUI T0, 8016 ; Loads upper adress to rupee amount
SH T4, 0xE694(T0) ; Stores new rupee amount(T4) into current rupee amount(T0)
J 0x80047e58
LH V0, 0xE690(V0) ; "this is what was replaced at 0x80047E50" (source: savestate)
SLTI AT, V0, 0x0011 ; "if taken out it would cause a lot of trouble" (source: savestate)
NOTES:
0x8015E694 = Rupee amount
Question
Ideka
Source:
Link to comment
Share on other sites
9 answers to this question
Recommended Posts