Binary Hack Research & DevelopmentGot a well-founded knack with your binary Pokémon hacks? Love reverse-engineering them? For the traditional Pokémon ROM hacker, this is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!
Can I request to have this thread to have examples of scripts (I mean the scripts which are XSE based)? Since a lot of people ask those here while checking ASMs. I think this should be started in the future posts of new ASMs (well, if you have effort enough to edit every single ASMs posted, then do so).
Erm.. Last time I checked, FBI posts how to use the ASM in a script, at the end of each post in the 'usage' part. If you mean a full on script starting from dynamic to end, well I guess thats FBI's chioce :/ But this isn't exactly a thread on scripting, which is why he includes basically everything you need to know in the usage section depending on the code. But again, it's FBI's decision lol.
Simply keep the numerator and only run a check if it's greater than the denominator. If the numerator's greater than the denominator, then make both values equal. :3
Yeah, this seems like the only solution that would help solve the problem. Unless someone comes up with something better, this is probably what I'm going to do. Thanks.
Quote:
Originally Posted by PokéMew
Well, my intent was to use the bike as, well, a key item called the dive suit. Its an item needed to access a certain place in the game (underwater as you may guess). The bicycle has a number of features that the running shoes do not to make things a hell of a ton simpler. For one, it is an actual item, rather than a flag. Also, the bike has its own soundtrack, where as the running shoes simply stick with the current sound track playing. That was one thing I felt this suit must need, a custom track (which I already inserted in sappy.) Now, if these things could be done to the running shoes using ASM (But I'd imagine that making the shoes an actual item and have its own sound track would be awfully complicated) thats another story, but for now I've just decided to use the bicycle as the thing to replace, I didn't find myself using the bike in the games anyways, mainly the shoes. It only has a tiny bit of a speed difference anyway.
That was my motive :)
So, possible?
I understand now. Hmm, this is a little specific though. The thread rules state that I'm not going to do routines which are specific to a hack. Anyways, since this is your first request, and this is relatively simple I'll do it. Look at the bottom of this post.
Quote:
Originally Posted by Percy
Can you be a more specific with the naming routines? Seems interesting :D
Can I request to have this thread to have examples of scripts (I mean the scripts which are XSE based)? Since a lot of people ask those here while checking ASMs. I think this should be started in the future posts of new ASMs (well, if you have effort enough to edit every single ASMs posted, then do so).
Hi, I think most of the ones that require scripts have script examples. There are a few simple ones which don't, but that's because all it is, is just a callasm command after setting a few variables. In future, I'll look into putting a little more effort into the usage portion.
Can I request something that I hope is relatively straight forward? A routine which adds 1 to a variable after winning a trainer battle? Could be used to record victories, count winning streaks, etc.
I'm not sure how you found that offset.. I've been looking for it for a long time. Despite, it still partially does not work. Registering the bike is glitched up. You can register it fine, you can click select and use it fine, however you cannot recall it. I think I have a slight understanding why this is, but I have absolutely no idea how I could fix this. Do you, just maybe, know how it could be done? :)
I'm not sure how you found that offset.. I've been looking for it for a long time. Despite, it still partially does not work. Registering the bike is glitched up. You can register it fine, you can click select and use it fine, however you cannot recall it. I think I have a slight understanding why this is, but I have absolutely no idea how I could fix this. Do you, just maybe, know how it could be done? :)
Well here is a complicated but theoretically working method.
Using Darthatron's script item hack, you can call FBI' overworld change with the code Playsong 0x## 0x1 the 0x1 will act like the bike music (ie only change after map change, not a trainer/wild battle).
Hmmm... so that means can we also fasten up the FR Bike to match RSE Mach Bike?
Not nessisarily, at least using this method. I've already tested it, if you keep going higher, it still does the exact same thing as the bike for 2-7. Everything above there still has the same speed, except you get the oak message (nows not the time to use that!) when trying to recall it after using it. Basically meaning you can't get off of it unless you warp somewhere.
I'm right! The naming routine is very interesting :D
edit: I can't understand the Re-usable TM's. (This one).
It says:
I can't understand that... :s
Am I just dumb or ...
For example, at 0x124F78, in the default game it has 75 F7 2E F9. You insert 00 over those four bytes, essentially replacing them. That goes for all of the offsets you listed - the four two digit bytes at each offset, replace them with 00 in a hex editor.
For example, at 0x124F78, in the default game it has 75 F7 2E F9. You insert 00 over those four bytes, essentially replacing them. That goes for all of the offsets you listed - the four two digit bytes at each offset, replace them with 00 in a hex editor.
I know that, lol.
I'm confused of this:
Quote:
To insert:
Do the byte changes below
0x124F78: 00 00 00 00
0x125C80: 00 00 00 00
Make it Ungivable:
insert that at 0x1326B8: 00 00 17 E0
Make it consumable after animation:
Insert: 00 00 00 00 at 0x124F78
The offsets highlighted is the same, by the way. Anyway, that's fixed now! Thanks FBI!
I saw a post in the script help thread by Méw who said he was trying to make it so that when you make a warp script, when you warp a key item is also activated. I looked through all of XSE's commands and there is no command that uses an item. I think this is the right place to post this, but how possible is it to make an item activated when making a warp script? I'm assuming the only thing the routine would involve is using an item, and the script does the rest..
Wow. I'm genuinely happy someone requested this. Believe it or not, this exact routine was my first ever routine. Darthatron held my hand through the process, and it's been years since I've done it. I'd be happy to redo it just for the nostalgia
However, I should warn you that fitting it all into one routine is not possible.
Okay then! Now I don't care how many routines it needs just to work! Just knowing that it can be done and how you've had an experience with this fires me up! Teach us how and I'll put it to good use! Thank you!
Intro:
Basically a routine to regenerate a Pokemon's HP every step. In this routine it's set to 3 per step. You may want to modify the exact amount to a percentage or something (see the commented line).
How to insert:
First compile and insert the following routine into free space.
Okay then! Now I don't care how many routines it needs just to work! Just knowing that it can be done and how you've had an experience with this fires me up! Teach us how and I'll put it to good use! Thank you!
Done!
Quote:
Originally Posted by Percy
I know that, lol.
I'm confused of this:
The offsets highlighted is the same, by the way. Anyway, that's fixed now! Thanks FBI!
That's because I wrote it down twice due to my brain malfunctioning. I'll have to edit that when I've mustered enough willpower.
Quote:
Originally Posted by Atmosphere
I saw a post in the script help thread by Méw who said he was trying to make it so that when you make a warp script, when you warp a key item is also activated. I looked through all of XSE's commands and there is no command that uses an item. I think this is the right place to post this, but how possible is it to make an item activated when making a warp script? I'm assuming the only thing the routine would involve is using an item, and the script does the rest..
That's interesting. Why can't he use a level script? In the end, in my ASM routine, I will end up having to execute the item's script/routine as a level script anyways. It's better to just use scripting here I'd think. It's a matter of finding each item's function, see davidjcobb's tutorial on adding items. There's a field in each item where it's routine is located. Most times you can just callasm to this routine. If you have trouble running a specific routine there, shoot me to routine offsets.
On a break from Rom hacking, to improve other skills.
Join Date: Nov 2013
Gender:
Male
Posts: 86
Quote:
Originally Posted by FBI agent
This is very dependent on what you're swapping. The solution is probably going to be a rewrite using the same skeleton. Also iirc, the badges are OAMs, not tile/bg graphics. You will need to generate/hide/show these extra OAMs on top of the BG overlay depending on the extra badge flags that have been implemented.
I was actually thinking of just swapping which graphics it loaded, but I actually think it'll be more than that. Sorry Dionen.
__________________
I'm no longer active here, I check back every now and then to see what happens, but that's it. I no longer hack either.
I was actually thinking of just swapping which graphics it loaded, but I actually think it'll be more than that. Sorry Dionen.
I think that's all it takes, honestly. Find where the pointers to the graphics are loaded and hijack that routine to potentially load different pointers.
I'd really like to see some ports of these routines (particulary this one, this one, this one, and this one) ported over to Ruby.
Dereferencing the necessary pointers should be easier in the absence of malloc(), so it shouldn't be too difficult. We should have better support for Ruby than this.
I think that's all it takes, honestly. Find where the pointers to the graphics are loaded and hijack that routine to potentially load different pointers.
He needs to load OAMs, the BGs are always easy to swap around. daniilS pls :x
Quote:
Originally Posted by Inyotef
I'd really like to see some ports of these routines (particulary this one, this one, this one, and this one) ported over to Ruby.
Dereferencing the necessary pointers should be easier in the absence of malloc(), so it shouldn't be too difficult. We should have better support for Ruby than this.
Well you don't need to dereferencing pointers, most of the RAM pointers are statically allocated to specific portions which are flagged. \What you'd need to do is find these static RAM blocks equivalents in your game of choice.
Anyways, why do you want support for R/S or LG? They're all pretty bad bases to use. The biggest problem is their lack of research. It's pointless to research something for R/S when it's already been discovered for Emerald, because Emerald will be better than Ruby as a base, but never vise versa. It's just not worth the time researching things for a ROM base which is inferior.
Fire Red has the most research done, and in my opinion, is the best base to use. Second comes Emerald, and finally the rest are trash.
But, yeah, if you wanted to port them, the pointers are all that needs changing (for the ones you've linked). Actually, the surf one may be a little different depending on the base. Fire Red launches that routine when "A" is pressed on any tile. Other bases may be a little different.
This, I think, deserves it's own thread. However, since I'd have about 90 threads by now if I followed that logic, I'm just going to make a post. I hope to cover how to add any arbitrary field move in addition to some research notes on the matter. This requires a little bit of patience and some table repointing/hex work in order to do. I should say that it's nothing hard, the hardest thing would be repointing a table, which is relatively easy. If you don't know how to do those hex manipulations, ask at the quick question thread, and hopefully myself or someone else will answer.
Research for Nerds:
Hi, if you're a noob just passing through trying to insert this without caring about the technical details, you can skip this section. Here I will be explaining as much as I know about the BRM for those who want to improve it or are generally curious about how it works in general.
The BRM menu is by far one of the more complicated data structures in the game. It's handled by several separate RAM and ROM data structures which I will attempt to explain. The first one is the BRM's RAM data structure. There are a few attributes which this structure contains, the main one, the one we care about in this case is the cursor's position. It's given in 0203B0A9 and changes depending on which Pokemon you're hovering over. In the case you're in a selection where there are more than one Pokemon to be selected, the byte next to it will hold the second selection. This byte is used (when the player presses the "A" button) to derive other menus and checks by using the simple formula: 0x2024284 + (0x64 * byte) to get the Pokemon.
There are a few others which are used to determine other things, which I don't be explaining in detail, mainly due to lack of my remembering (did this more than a month ago).
Once the Pokemon is selected using the "A" button, contrary to initial belief, the BRM is generated on the spot, then graphically generated right after. Initially when "A" is pressed, the game loops through the 0x0 terminated Move IDs table comparing each half-word represented move to each move the Pokemon selected has at the function 0x81229FC. If a move is found, then it will store it in a RAM data structure (same BRM structure) which works very similarly to the start menu. This routine handles Pokemon holding mail too.
With the given data structure fully formed the BRM is graphically created. There are some other things that go into it to pull up the "summary, cancel, item" fields and such (byte toggled in the BRM) but I'm not going to go too deeply about that. Anyways, the BRM RAM structure then handles the browsing of this smaller menu. Once "A" is pressed, the BRM table is used to determine which function to execute. It's format is [string pointer][routine pointer]. The HMs are at the end of this table. 0x81245A4 handles teh case where the selected item in an HM. It does things from badge checking to calling the actual routine, specific to the HM.
In general, you can edit the table for the BRM to change a function to execute a routine of your choosing. However, remember that you need to follow the correct procedures which including closing the BRM and exiting to Overworld ect. The graphics generation and such are left to you if you follow this method. Initially, this is the method I was using.
With some research, and studying, I was able to determine how the BRM item selection worked for HMs which excited to the overworld and called a routine. From there I was able to call a routine which ran a script.
Basically, there were other RAM locations allocated to hold routine pointers which were executed by the game at certain times. Cut for example, would first check the map, the tiles infront of the player (if they were grass), the coords infront of the player, ect. before executing. From there, there were two cases which executed differently. Believe it or not, cut does not always execute a script. The first method is that it sets the tiles infront of the player to plain grass (so it actually cuts wild grass, try it yourself by walking into a patch of grass and using CUT !), the second case it executed the script.
I think it's better to read the rest of the tutorial to see how those things work, rather than listening to my kinda long explanations.
Repointing some tables (noob friendly edition):
Before we begin, there are a few tables which need repointing. Please write down the offsets to where you paste the hex I give you. For your sake, once again, please write down where you place these tables to.
Table 1: Move IDs table:
Copy and place into free space:
Make sure the offset you copied this table to is half-word divisible (ends in 0, 2, 4, 6, 8, A, C, E)
Now navigate to 0x120F74, 0x121FB8, 0x122D18, 0x122D48 and change the reverse hex pointer to be the pointer where you copied the above hex table to.
Table 4: Field move description pointers table
Copy and place into free space:
Make sure the free space offset is word divisible (ends in 0, 4, 8, C)
Code:
83 75 41 08 33 75 41 08 48 75 41 08 6E 75 41 08 5D 75 41 08 96 75 41 08 AE 75 41 08 FB 75 41 08 CC 75 41 08 F1 75 41 08 F1 75 41 08 DE 75 41 08
Now navigate to 0x1221D0 and change the reverse hex pointer to be the pointer where you copied the above hex table to.
That's all for table repointing. I hope you wrote down the offsets for them in some recognizable format. I.e:
Table 1: Offset
Table 2: Offset
Table 3: Offset
Table 4: Offset
Because that's how I will refer to them AND we'll need them very soon.
Making your move's script -> The fuel
You are lucky. You are lucky I suffered many hours figuring this out so you can use scripts rather than routines and have an easy time setting up field moves. Anyways, the first step is to write out your script which you will be using. In this "tutorial/resource/research" thing I will be inserting Sunny Day in an attempt to give a relevant example of how to set things up.
Here's my PKSV script:
Spoiler:
Code:
#dyn 0x740000
#org @start
'-----------------------------------
'OK a little ASM-esque. Basically checking if we're indoors.
'If we aren't, jump @continue
'-----------------------------------
lockall
copybyte 0x20370B8 0x2036E13
compare 0x8000 0x3
if == jump @continue
compare 0x8000 0x1
if == jump @continue
compare 0x8000 0x6
if == jump @continue
compare 0x8000 0x2
if == jump @continue
msgbox @indoors
callstd MSG_NORMAL
release
end
#org @continue
'standard HM animation
doanimation 0x28
waitspecial
setweather 0x1
doweather
msgbox @text ' \v\h02 used Sunny Da...
callstd MSG_LOCK ' Built-in lock command
release
end
#org @text
= \v\h02 used Sunny Day!\nIt became Sunny outside.
#org @indoors
= Can't make it sunny inside[.]
If you're lost at the script, or don't know how to make a script, then you'd better go learn! This script is admittedly, a little more complicated than what I'd expect people to use. Its because I'm using some scripting and ASM knowledge to determine whether or not we're indoors. It's a special case only relevant to weather effects. The rest of the script is normal. Note that your script can be pretty much anything, but please beware of the recursion limits (i.e calling callasm and that ASM calling a script...ect..).
Once you've written the script, compile it to free space, and write down where you've compiled the script. Mine compiled to 0x740001 for example.
Setting up our Phase 2 routine -> The Rocket
Once you've compiled a suitable script, and tested the script individually to make sure it works, you're ready to set up your rocket. I call it Rocket because this routine will be the one calling the script.
It will also be the routine which is called by our launchpad routine. Anyways, more on that later.
In the above routine, you will need to modify the script pointer line. Change the YYYYYY into the offset your script was compiled into. Once you've done that, simply compile the routine into free space.
Once again, write down the offset in which you've compiled the routine into and make sure you've inserted this routine into a word aligned offset.
Setting up our Phase 1 routine -> The Launchpad
This routine is going to be our Phase 1 routine. This routine will do the initial checks we want and then call the rocket routine. Actually, this structure is a little weird, because you can just as easily fulfill it's functionalities within the second routine. I've yet to figure out the reason as to why this is, but it just is this way.
In the above routine, you will need to modify the Rocket routine line's "0x8YYYYYY" into a pointer to wherever you placed the Rocket 2 routine +1. Once you've done that compile this routine into free space. Make sure that this routine is compiled into a word aligned offset.
String setup
Our last task before modifying some tables is to set up the string descriptions which will be brought up when the move is hovered over. The first task is to create the string. My string will be,
"Makes it Sunny outside!". This in Hex is "C7D5DFD9E700DDE800CDE9E2E2ED00E3E9E8E7DDD8D9AB". Lastly, the game doesn't know how long or when the string ends. It's required that we specify this by using the string terminating character.
This in FireRed (and actually all ROMs in gen III) is 0xFF. So the string then becomes "C7D5DFD9E700DDE800CDE9E2E2ED00E3E9E8E7DDD8D9ABFF". If you're not sure how to convert an ASCII string to HEX without messing it up, then I'll tell you that there's a 1-1 correspondence between the two. Use this table to generate a string, or you can use this Python program I wrote (if you have Python).
Remember that the size of the string is also limited. I don't recall how many characters will fit before overflow, but keep it about 20 Characters long max.
The Hex is on the left, and on the right is the Ascii equivalent.
Python program:
Spoiler:
Code:
with open('C:/-YOUR PATH TO THE TABLE FILE-/Table.txt') as f:
lines = f.read().splitlines()
for i in range (0, len(lines)):
lines[i] = lines[i].split('=')
convert = raw_input("enter string: ")
result = ""
check_version = raw_input('H2A or A2H?')
if (check_version == "1"):
for char in convert:
for element in lines:
if element[1] == char:
result += (element[0])
print(result)
else:
convert = convert.split(" ")
for index in convert:
for element in lines:
if element[0] == index:
result += (element[1])
print(result)
For the prompts:
Prompt #1: Enter a hex or Ascii string
Prompt #2: 1 to convert to Hex; anything else to convert to Ascii.
Paste your Hex string into some free space in the ROM.
Next, we need to find our Move's name in hex. I recommend finding it in the Move name table at 0x247094. Here's a simple formula you can use to find it:
Offset = 0x247094 + (0xD * MoveID)
Where MoveID is the move index number. Pound is 0x1 for example. It should be noted that if you have expanded the move tables via MrDS's patch or on your own, that 0x247094 won't be the correct offset. Actually, I think his patch is bugged here because the BRM table uses points in the old table, which he couldn't possibly have repointed without knowing. Anyways, it doesn't prove a problem unless you plan to make one of the expanded move names to appear using the move name table. Write down the offset of your move name as well as the description pointer.
Editing the tables
Here are the important offsets you should have written:
Table 1-4 locations
Phase 1 routine: Launcher
Move Description pointer
Move Name pointer
Firstly, we're going to handle Table 1 first. This is a table of reversed half-word move IDs. The game reads these ID numbers using ldrh (load half-word) which internally reverses them. ldr is the same functionality, that why we need to reverse hex our routine pointers and various other things. Anyways, I'm getting off topic, so I'm going to explain what to do to this table.
The table itself is 0C 00 terminated, which is both weird and bad. Weird because 0xC is Guillotine, bad because someone may be interested in using Guillotine as a field move. So first of all, before we attempt anything, we'll be changing how the game reads this table, to terminate it upon reading 0x0 (which in the hex editor is 00 00 because it should be a half word), since 0x0 represents null move.
To do this, navigate to 0x122A8C and change the byte from 0C to 00.
Finally, edit your table to include the Move IDs of the field moves you want. My table for example looks like this right now:
I've added after E6 00 (which is ID 0xE6 sweet scent) F0 00 59 00 57 00 C9 00 F1 00 00 00
F0: Rain dance, 59: Earthquake, 57: Thunder, C9: Sandstorm, F1: Sunny day. Then at the end I put in the "00 00" to show the end of the move detection table. Make sure your table is of similar format, except with the move IDs you want.
After these edits go in game, and check if your game freezes upon pressing "a" on the selected Pokemon. If it does, then your table is messed up OR you've messed up something with these last few steps. The expected result is that you get weird characters (or no chars at all) in blue if your Pokemon has a move whose ID is in the table. We will be fixing these "glitched" names and such soon. Don't try using the move outside of battle yet, because you will crash your game.
We're going to briefly skip table 2, and go onto table 3.
This table is a little weird, because it's not terminated at all. It's browsed using an index number. Generally the moves are at the bottom, and each successive move in the move ID table is 1 entry past the last entry. So in short, for every move we add the the move ID table (table 1) we need to add an entry to this table (table 3).
Table 3 is formatted: [4 bytes (Pointer to name)] [4 bytes (Pointer to Routine)]
If you're doing to launch a routine instead of a script, the pointer to routine will be your routine's address +1. The chances are, you're going to use a script though. So farmat your entries like this:
[Move name pointer (4 bytes)][081245A5 - BRM HM launching sequence].
Navigate to the word aligned offset you placed table 3 in, and add the following 8 bytes:
Code:
XX XX XX 08 A5 45 12 08
Where XX XX XX is a pointer to your moves name (which you should've written down prior). In my case, the hex was, "D1 C7 24 08 A5 45 12 08".
After these edits, test it again. This time the blue gibberish should've turned into a move name. If it hasn't, you've messed up somewhere above.
Now we'll edit table 2, this will make selecting the move actually do something.
Table 2 consists of a routine pointer that is called by the routine 081245A4, as well as a mode. 95% of the time this mode is 0xD (the other mode is 0x10 used for Milkdrink and Softboiled). The routine pointer is simply going to be a pointer to Phase 1 routine: Launcher (which you should have written down). Like table 3, this is browsed by index and isn't terminated by a byte or sequence of bytes. So simply add to the end of the table, the following hex string:
Code:
XX XX XX 08 0D 00 00 00
Where XX XX XX is a reverse hex pointer to Phase 1 routine: Launcher.
After these edits, test your game again. This time, everything should be fully functional. Routine should be called, and the whole effect should happen. If it doesn't, you've done something wrong in the above steps.
Finally, we're on the last step, it's to change the move description which pops up when the move is highlighted. The Move Description pointer which you should have written down is what I'm referring to.
In Table 4, simply append the move description pointer. That's it, you've successfully added a new field move!
My condition for using this hack
Unlike most hacks, this is a little different. It's open source, and you're free to use it. However, I require you post the script you use for any of your moves. This is because I want people to keep anything regarding this hack public.
Just post the script you use in your own thread, and that'll be it (like the Sunny Day script I used).
Intro:
There are a few hacks already existing which detect a button the player has pressed, but in my opinion they are a little over-complicated and unnecessary. There's a few RAM offsets which are allocated for I/O placed in the SuperState datastruture and keyinput bytes. However, reading these bytes in a script would give you the byte value in that specific frame. That's right, scripts run one command per frame (mostly. wait special, and other commands "pause" the cycle because the script pointer isn't updated). Anyways, inorder to do this, you'd need to write a task (which is also executed every frame) which detects a certain keypress. However, there already exists a command which pauses until a button is pressed. This command is the "waitbutton" command in PKSV or the "waitkeypress" command on XSE. We're going to be hacking this command to buffer the non-null button pressed into a variable.
How to insert:
First compile and insert into free space, the following routine
This routine will run all of it's referenced routines at the end of the turn (right before the turn counter in incremented.
How to insert:
Look at the routine below. The last line .table has an incomplete pointer. It says 0x[pointer to routine table]. Find enough free space (takes 4 byte per routine) in your ROM and set the pointer for .table to that. You do not add +1 to the pointer, nor is it in reverse hex. Once you've fixed the pointer, compile the routine into free space.
Last entry in the table needs to be 00 00 00 00.
Now navigate to 0x13CB0 and insert the following byte changes:
Code:
00 48 00 47 XX XX XX 08
Usage:
The routine is toggled by flag 0x2F8. Activate the flag to toggle routines called by this routine. To add routines into the list of called routines, navigate to the pointer of freespace you made .table point to. Insert into that table pointers in reverse hex +1 to wherever you compiled the addon routines make sure they have the 0x8 prefix. The structure of the table should be: [routine pointer in reverse hex +1 (4 bytes)] for each pointer in the table. I.e if I put the addon at 0x740000, the pointer would read 01 00 74 08.
I have a little problem with this sleep clause. As the post requires, I need to put battle by turn routine, the table pointer, and the sleep clause routine in my rom. So I put these in the following addresses:
1. Battle by turn routine: 850000
2. BbT table: 850040 (I already put at the first entry the sleep clause routine)
3. Sleep clause routine: 800050
Spoiler:
Then I insert 00 48 00 47 41 00 85 08 to 0x13cb0
Spoiler:
So, I'm about to test it but I'm not able to because whenever I battle a trainer/wild encountered pokemon, it freezes or restarts after the first round. Also, there are some cases of resetting when I encounter wild pokemon.
I direly in need of these sleeping clause. Btw, I used MrDollSteak Rom base and JPAN's fire red Hacked Engine.
Intro:
Basically a routine to regenerate a Pokemon's HP every step. In this routine it's set to 3 per step. You may want to modify the exact amount to a percentage or something (see the commented line).
How to insert:
First compile and insert the following routine into free space.