February 9th, 2013 5:50 AMFBI
Alrighty, I'm gonna try that VM again and see what happens. PC IRC Doesn't work for me, but I got in RHO's.
Wait, so is GetPokemonData some kind of function that accesses the information in r0 given a value for r1? If so I would do something like:
branch my routine
ldr r0, .Pokemon_data (just the pointer, not the actual data)
mov r1, #0x3A
ldr r3, .GetPokemonData
and it would return the Pokemon pointed by r0's Current HP and place it in r2 (in this case?).
I think I'm misinterpreting, unless there really is a function as awesome as that.
SetPokemonData obviously works in the same nature as GetPokemonData, I'm just waiting to get corrected here :P
I get everything else pretty much, though the goal of adding and subtracting 4 bytes sorta escapes me (is that just to clear?).
I've only been doing reading things the long way, so I've never actually used these built-in functions (assuming that's what they are).
February 8th, 2013 8:18 PMFBI
Do you have some other means of contact? I can't send longer VMs over PC because it times me out.
February 8th, 2013 6:56 PMDarthatron
Okay, well, 06D5E8 in the ROM is some ASM that is in my notes as activating every step. This calls the Repel checks and such as well. I suggest you branch from here.
Try just making it heal once every step for now.
0803FBE8 is GetPokemonData. R0 needs to contain a pointer to the Pokemon. R1 is either 0x39 for getting the Pokemon's Current HP; 0x3A for getting it's Max HP; 0x37 for it's Status Ailment.
0804037C is SetPokemonData. R0 contains the pointer to the Pokemon. R1 contains the same values as above. R2 contains a pointer to free RAM.
When I say free RAM, I mean it's best to use the Stack for that. So just subtract 4 from the Stack at the start of the function and add 4 to it after everything.
SUB SP, SP, 4
ADD SP, SP, 4
February 8th, 2013 6:19 PMFBI
Yeah, FireRed. Sorry for the late reply, I ran off to go get something to eat :P
February 8th, 2013 5:53 PMDarthatron
I figured it was comedic. You can call me whatever you want.
You're hacking FireRed, right?
February 8th, 2013 5:48 PMFBI
I'm not really looking to be formal, it's more comedic when I title people (not to say that it's comical to consider you a general) :P
February 8th, 2013 5:46 PMFBI
Sure, if you can show me how I record the number of steps taken? I assume I can find clues in the same code that repel/safari zone uses. Since you did the repel port recently maybe you can tell me where it starts :P
P.S I'm trying to not use Jpan's engine if I can.
February 8th, 2013 5:40 PMDarthatron
Also don't worry about being so formal with me.
February 8th, 2013 5:39 PMDarthatron
That sounds interesting! Is there any way I can help you? Offsets or something? Or would you prefer to just work on it alone for now?
February 8th, 2013 5:31 PMFBI
I want to try to give Pokemon passive HP regen outside of battle (1 hp gained every 10 steps), given the Pokemon is not affected by status affects.
So far I've just been able to check which Pokemon are affected by a status changing move. Adding HP and doing that outside of battle is a little hard for me right now though.
From what I've read though, changing HP requires manipulating some encrypted data.
That is my mini-feature I was working on, great hack overseer Darthatron.
February 8th, 2013 5:14 PMDarthatron
At ease, soldier.
Is there anything specific you're trying to do at the moment?
February 8th, 2013 4:29 PMFBI
As of now, I only know how to do ASM from scripts. I've actually been trying to branch from existing routines to my own little chunk of code, but I still haven't found out how.
I'm more-less trying to learn as I go. That is the status of my ASM knowledge, General Darthatron, sir.
February 8th, 2013 4:09 PMDarthatron
Hello! Have you done any reverse engineering, or do you only know how to put ASM into scripts?