• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Development: Pokémon Fire Red Hacked Engine

Deokishisu

Mr. Magius
989
Posts
18
Years
It seems it wasn't saved in the manual. That is for the a new function, that allows you to create several sized pedometers. The flags it asks for allow you to activate one of those pedometers, by setting the flag it asked for. Those pedometers are located at 0x0203f4e0 to 0x0203f4eb, but to access them you need to use the getbyte commands.
0x203f4e0 -> always on 32bit pedometer
0x203f4e4 -> first flag asked activated 32 bit pedometer
0x203f4e8 -> second flag activated 16 bit pedometer
0x203f4ea -> third flag activated 8 bit pedometer
0x203f4eb -> fourth flag activated 8 bit pedometer
These pedometers are totaly optional to use, and don't even depend on the 0x800 flag.
So, the only relation they have with the safari hack is that they ride on the back of the safari decreasing.

So I could start a pedometer wherever I wanted for other step-limited minigames and such? Awesome! Thanks for clearing that up.

And regarding the menu thingy - Ugh I'm so bad at this! Thank you for explaining that. I know enough scripting to make any "standard Pokemon-esque" ingame event, but when it comes to some of these special and special2 commands, and the extras and such that I want to include that branch out farther than what Nintendo intended, there's just alot to work out! Which is part of the reason I was so excited when this got released. Anyway, like always, your amazingness cannot be expressed in mere words. Thanks!
 

>Dante<

Call me Steven
201
Posts
15
Years
Honestly? After all the amazing work he's done for the community with this engine, you say one thing about how "interesting" it is, without even looking at the manual and realizing the work he put into it I'll bet, and ask him to port it to Emerald? Wow.
Honestly? I'm interested only to the answer of JPAN.. not to yours.
isn't my intention to minimize the job of JPAN.

to ask is permissible..
to answer is courtesy..
 

Full Metal

C(++) Developer.
810
Posts
16
Years
JPAN, (i thought i saw you asking about the design of ur program).
IMO its kinda messy...like to scrambled, its ok if it doesn't all fit inside a nice space, just try and make it more...organized? I'm not being picky, i'm perfectly fine with the way it is, but i thought i read somewhere you asking for an opinion (ima too lazy to go back to first page xD FAIL) so yea...just my opinion though, I'm certainly glad you made a tool to apply it though ^^
 

Quil

Me
67
Posts
17
Years
  • Age 28
  • Seen Mar 1, 2010
JPAN, maybe you should add an option for variables more then 16 bit. 65535 isn't that much, and it ruins my bank script pretty hard xD And there are probably more cases when the 65k limit is verrrry annoying :C
I don't know if it is possible, but that would be an awesome addition :3
 

Darthatron

巨大なトロール。
1,152
Posts
18
Years
JPAN, maybe you should add an option for variables more then 16 bit. 65535 isn't that much, and it ruins my bank script pretty hard xD And there are probably more cases when the 65k limit is verrrry annoying :C
I don't know if it is possible, but that would be an awesome addition :3

Something like that would require a total overhaul of how variables work. I doubt he will do it for you, but if you need to use higher values your best bet would be to take a look at ASM - a bank script in ASM would be much better, at least.
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
Something like that would require a total overhaul of how variables work. I doubt he will do it for you, but if you need to use higher values your best bet would be to take a look at ASM - a bank script in ASM would be much better, at least.

Not to say there are not 65535 variables either...
Besides, there are thousands of them anyway. I don't see how that can be very annoying.
 

Logan

[img]http://pldh.net/media/pokecons_action/403.gif
10,417
Posts
15
Years
I'm going to go ahead and move this to Research & Development, I feel that this is innovative enough to fulfil the needs of that section more.
 

Quil

Me
67
Posts
17
Years
  • Age 28
  • Seen Mar 1, 2010
Not to say there are not 65535 variables either...
Besides, there are thousands of them anyway. I don't see how that can be very annoying.

I was talking about the limit of 65k in value. There are enough free variables to be used, that isn't the problem =P

And @ Darth, about ASM.. It costs pretty much time to learn ASM, and because of personal reasons, I don't have much time. I already figured out myself that ASM is a better solution..
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
I was talking about the limit of 65k in value. There are enough free variables to be used, that isn't the problem =P

And @ Darth, about ASM.. It costs pretty much time to learn ASM, and because of personal reasons, I don't have much time. I already figured out myself that ASM is a better solution..

Whether you want to have more variables, or increase their value range... both require quite some ASM.
It would be definitely easier to reserve some particular variables and use them in pairs, reaching a range limit of 4294967295.
 

mindfreak

Belgium Rom hacker
45
Posts
16
Years
  • Seen Nov 1, 2012
I'm really confused with the overworld stuf.
If I make a new pointer here V
B0FD3908 B0FF3908 B0FE3908 New pointer
What table is it?
(The manual said that only one was occupied but there are already 3 pointers. so is it 0x1 or 0x3)

And how can I display the new overworlds ingame?
(I tried by editing the event data in hexworkshop but failed.)
 

iTeruri

iAm
277
Posts
17
Years
Wait, so how does the item hack work?
I have a script compiled at 0x900000. I'm using Item Editor by Thethethethe. Where should I enter the offset? Because I can't find where the item table is located in the rom...
 

JPAN

pokemon rom researcher
104
Posts
15
Years
  • Seen Jul 2, 2016
I'm really confused with the overworld stuf.
If I make a new pointer here V
B0FD3908 B0FF3908 B0FE3908 New pointer
What table is it?
(The manual said that only one was occupied but there are already 3 pointers. so is it 0x1 or 0x3)
My bad. I accidentaly left some debug table addresses in the main table. Remove them and place your pointer on the second slot (b0ff3908), and delete the third. In that case, it will be 1.
If you wanted to keep the tables, then it would be 0x3, as you suggested.
And how can I display the new overworlds ingame?
(I tried by editing the event data in hexworkshop but failed.)
Look at the trainer flag hack area of the manual. I placed a picture there that explains the new data in the A-Map person event. Simply change the rightmost unknown byte, right below the picture number, to the table number. The change will not appear in A-Map, but in game it will be your sprite.

Wait, so how does the item hack work?
I have a script compiled at 0x900000. I'm using Item Editor by Thethethethe. Where should I enter the offset? Because I can't find where the item table is located in the rom...
The item table starts at 0x3db028, and ends at 0x3df09c. If you can, after editing the Item in the Item editor, Open a table file in your hex editor and search for your item name, and it should pop up. If you can't open a table file, multiply the item number by 0x2c and add it to the base address.
When you reach the item, goto Item_adddress+ 0xE and make sure the item number is the same there as you input it (item 0x102 should have 02 01 in there). Then go to Item_address + 0x1b and make sure the value is 4. In Item_address + 0x1c, place the routine pointer (21 15 16 08 in the patch version) and in Item_address + 0x28 place the script pointer (00 00 90 08 in your case). Save, and it's good to go.

Right now I am working on increasing the amount of money you can have to One billion minus 1. And I've read the "increase the variables capacity", and I Have already planned to create a group of special functions to let the user treat a group of variables as a single one, but all those operations are on the user's risk, and must keep under consideration the range he wishes to use. As such, I will provide said functions on the next release, and should include add and subtract functions, buffer number functions for 32 bit, and support for more digits dynamically.

And the increase money hack is (apparently) complete! You can now hold up to 999 999 999 money! That's nearly 1000 times more money! If you don't want to wait for the next release to test it, know this was acomplished just by replacing 7 bytes, and here's how to do it:
at 0809fdd4 replace |3f 42 0f 00| for |ff c9 9a 3b|; (999999 for 999999999)
at 0808a006, 0809fe52 and 0809fe62, replace that one byte from |06| for |09|. (6 digit display for 9 digit display)
Done, you should be able to have that much money now.

EDIT: As this was moved to the Research and Development forum, I feel that now I can directly ask for opinions on future updates without going Off-topic. So, I will tell you what's going on and you tell me what you would like me to do.
Because Special editing is limitative (special is a 5 byte command tops, and so it cannot receive direct input through the script. Not that's impossible, just very unpractical), I've been looking at the commands in the scripting engine, in order to find how stuff works and where the "free" commands are. And I was surprised to find that, from Ruby to Fire Red, some commands changed their use dramatically, or simply went and did some stuff we are not expecting. One example is the "copyVarIfNotZero" command, that In Fire Red copies a variable, even if it is zero. The correct name, for it's usage, would be something like "copyVarOrSetIfNotVar", as there what it does is copy a variable if both words given are real variables (in the 0x4000-0x8013 range), and set the first variable to the second value if not a real variable (values up to 0x3fff). Copyvar, in the other end, simply is error-prone in this case. trying to write in illegal memory if the value is not a variable. So, in this case, should I try and correct the Copyvar method to be bug-free and make it so Copyvarifnotzero does what we expected it to do, or let it be?
Same is true for some other commands, such as addvar and subvar, that should be identical, but subvar allows the use of two variables, while addvar does not. Should I try and fix that too?
I will introduce a concept now. A "fake" command would be a command where the arguments that should be used (according with the script compilers such as XSE) are not the real argument numbers. For instance command 0x96 (unnamed as of yet) in Ruby takes 2 bytes as arguments. In FR, it takes no arguments, as in there it's a simple nop command. The opposite could also be true: commands that use more bytes than we thought they would. Stuff like startContest, which have no use in FR, and occupies only one byte (correct in both versions) could be replaced with a command that receives data and consumes bytes, in order to make it easier to use certain commands (such as the VarMath special, that even I have trouble using). As that would cause some confusion in the script compilers code (there would have to be two separate set of Fire Red commands, one static and one dynamic that accompanied this hack), we could use a technique that Gamefreak used with its Trainerbattle command, where it can ignore certain bytes as to get specific information. As such, something like VarMaths multiply variables could be used like this:
Code:
#alias startContest mulVar
#org @start
mulvar
copyvar 0x8000 0x8001
end
Where the copyvar is nothing more than a holder for the two variables to multiply, and its opcode (0x19) is discarded, and would never happen. We would use it only to mantain the integral structure of the code, so decompiling this script wouldn't turn into something wierd that no-one could read.

So, with this concept in mind, should I in future hacks (and in corrections from older ones), allow "fake" commands to take place or keep with the current "setvar argument_var value" ... "special 0xNUM" format?
 
Last edited:

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
Just out of curiosity, what's the point of having SO much money? It would take ages just to reach that limit. I guess 999999 is a good amount IMHO. Especially in my hack where I let mom save some money for the player. Special editing may be limitative, but breaking commands compatibility is worser. Backward compatibility has already been broken (which is the main reason I don't like this hacked engine), basically. But that's not the point. Let's just not forget there's always callasm. Sure, it's not as comfy as specials, but I think I don't need to remind you that only FR/LG have many nopped specials. Yes, I do know it's called "Fire Red Hacked Engine". But porting it to other games it someday is always a possibility that should at least be considered.
 

Sierraffinity

Desperately trying to retire from ROM hacking
1,069
Posts
16
Years
Backward compatibility has already been broken (which is the main reason I don't like this hacked engine), basically.
HackMew, just out of curiosity, what do you mean by "backwards compatibility"?
And, to JPAN, I think that the new way would probably be more confusing than the current way, so just keep it as-is.

P.S. Using the hack tool, should I redo inserting all commands, or just insert the new ones? Or should I simply use the patch?
[BTW, you should start using HackMew's new tool, A-Ptch, as it has backwards patching compatibility.
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
HackMew, just out of curiosity, what do you mean by "backwards compatibility"?

I'll give you a little example: the sethealingplace command. In the hacked engine, it has changed and now requires three variables to be set in order to work properly.
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
Oh, so you meant "script backwards compatiblility, as scripts from the old/new couldn't go on to the new/old"? I see.

That was just an example. Backward compatibility is anything about structures, specials, scripting commands etc. etc. For example, when I implemented the D/P evolutions in a FR ROM, I did not change the original structure on purpose (as Eevee gained 2 evolutions, the old structure would not have been enough, theoretically) and used a workaround just for Eevee.
 
Last edited:

Deokishisu

Mr. Magius
989
Posts
18
Years
Hey JPAN, just thought I'd stop by again and give you some feedback and two suggestions for the next release.

I also think you should leave that the way it is. It's more complicated, and the current way works fine imo.

And for the suggestion, now that a RTC has been implemented into FR successfully, it may be time to step it up on the berry front. My suggestion is to add the R/S/E berry system into your engine, utilizing the RTC by interdepth and ZodiacTheGreat. The growing cycles for each berry can be found on each berry's individual Bulbapedia page, along with other miscellaneous information you may need regarding how it should turn out.

And here's a totally outlandish one that I personally wouldn't really need, and would probably take insane amounts of work that I really don't want to put you through, but might be something to keep in mind. Pokemon Contests from R/S/E? I just thought people might want that ported to FR. I don't really care either way, but it's something to consider.
 
Back
Top