• 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.

Physical/Special Split w/ Images Tutorial (No ASM)

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
This is a quick and easy tutorial for inserting the physical special split to access images created by Darthatron and improved by Jambo51. All credit for the routines to access the images goes to them. The patch for the split is by DoesntKnowHowToPlay and you should credit him for that. All the info used in this tutorial can be found in this thread.

This tutorial provides a quick and simple way to insert the phys/special split that accesses the images into your rom without using ASM and minimilizing the use of a Hex Editor as much as possible. Its purpose is to make this routine available to as many people as possible.

This tutorial is for Fire Red, but I believe it will work on other roms.

You will need a Hex Editor and Free Space Finder. That's all.

Let's begin.

First, apply the patch created by DoesntKnowHowToPlay that can be downloaded here.

Now we will insert the data for the images for the Physical, Special, and Status attacks.

I will be using HxD as my Hex Editor, so if you are using something else, some commands might be a little different.

You will need 240 bytes of free space in Hexadecimal, or 576 bytes of data in decimal.

Open up Free Space Finder and search for 576 bytes of data. Copy the offset. For the sake of this tutorial, I will use 0x800000 as my offset for the image data.

Now open up your Hex Editor and navigate to your offset (Edit>goto and type in the offset #: ex: 800000).

Now select 240 bytes of data (Edit>Select block - Length: 240).

Now copy the data in the spoilers below and paste it into the block you selected in your Hex Editor:

Spoiler:


The data should be the same size as the block of data you selected.

Now the data for the images is inserted. Let's insert the routine needed to access them.

You will need 70 bytes of free space in hex, or 112 bytes in dec. As we did before, use FSF to locate 112 bytes of free space. For the sake of the tut, I will use offset 0x800300.

In your Hex Editor, navigate to the offset for your routine (Edit>goto). Now select 70 bytes of data (Edit>select block - Length: 70).

Copy the data in the spoilers below:

Spoiler:


Open up a word application such as Notepad. you will need to replace the X's with the offset to the attack images we inserted earlier first. The offset I used was 0x800000.

First, seperate the offset into pairs of numbers. So 800000 would become 80 00 00.

Now you will simply reverse the numbers, where the last pair will be first, and the first pair will be last.

So 80 00 00 will be come 00 00 80.

This is the number you will replace the X's in the routine data with. So if your offset for the images was 0x800000, the data for your routine would be:

Spoiler:


Copy this data, return to your Hex Editor, and paste it into the block of free space you had previously selected, and save.

Before we move on, navigate to offset 0x13A1A0 in your hex editor. Take the offset for your routine and reverse it as you did the offset for the images. The offset for my routine was 0x800300 which would become 80 03 00 and reversed would be 00 03 80. Add 1 to the first pair of numbers in the reversed offset. In the case of my example, I would add 1 to 00, making it 01 03 80. Lastly, stick 08 to the end of the line of data so that it will become 01 03 80 08.

Please type this number into the offset at 0x13A1A0.

Okay, now the most difficult parts of the tutorial are done. Now let's change the attack data so that the attacks are registered correctly.

Initially, all of the attacks will by Physical attacks. Go to your hex editor and select Edit > Select Block - Start Offset: 250C10 ; End Offset: 251CA7. (These offsets are for Fire Red. They may differ for Emerald or Ruby.)

You should have selected 1098 bytes of data.

Replace the data here with the data in the spoilers below:

Spoiler:


This should change all the attacks to their correct designation. I believe I changed all the attacks correctly, but if not, please let me know.And that should be everything you have to do. If I missed anything please let me know, but I think I got all the steps needed.

Again, thanks to Darthatron, Jambo51, and doesntknowhowtoplay for all their hard work. Enjoy!
 
Last edited:
218
Posts
10
Years
  • Seen Nov 12, 2021
Hi, firstly thank's, this is a good tutorial for persons who don't like ASM things, like me.
But I noticed you missed a (huge) credit for Doesntknowhowtoplay, the guy who made the physical/special split.
Jambo and and Danathron "only" made the routines to displays if the moves are special/physical/statut, which is a huge thing too of course.
 

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
Hi, firstly thank's, this is a good tutorial for persons who don't like ASM things, like me.
But I noticed you missed a (huge) credit for Doesntknowhowtoplay, the guy who made the physical/special split.
Jambo and and Danathron "only" made the routines to displays if the moves are special/physical/statut, which is a huge thing too of course.

I didn't see his name in the thread so I didn't know. I guess he is the one who figured out the byte changes? I'm not really in the hacking circles, so I don't know lol.
 

PokéMew1

Pokémon Fuchsia
484
Posts
10
Years
I'm not really in the hacking circles, so I don't know lol.

But created the best hack to exist :P

Good tutorial, it definitely helps since I only know half about writing ASM routines lol.

I'll definitely be trying this out tomorrow :)
 
218
Posts
10
Years
  • Seen Nov 12, 2021
Yes it's understandable since he posted only 1 or 2 posts in the thread. Check out the seventh page ^^ (I can't post link as of yet, sorry)
 
534
Posts
11
Years
  • Age 26
  • Seen Jul 24, 2023
Hey metapod23, look like you miss a typo.

Code:
0x3FA4A: 58 46

Should have been 0x3F14A. :)
 

destinedjagold

You can contact me in PC's discord server...
8,593
Posts
16
Years
  • Age 33
  • Seen Dec 23, 2023
I have heard that implementing the Physical/Special split for Gen. 3 games break weather from boosting attacks, certain abilities that boost attacks (e.g. Blaze, Torrent, etc), and Weather Ball not functioning properly. I believe that is why an ASM fix was needed for this. I could be wrong though.
 
218
Posts
10
Years
  • Seen Nov 12, 2021
Yes it was true few years ago, but doesntknowhowtoplay's patch works perfectly, it implements the MECHANIC, but you have to change the eleventh bytes of each move to make them physical(0)/special(1)/statut(2). Without the patch it won't works.
The jambo51/Danathron routines are made to display if the move is physical/special or statut, wich is a way different.
I haven't seen a link to these patch, so, I guess it's a tutorial only to make the "displaying routine" works
 

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
I have heard that implementng tha Physical/Special split fo Gen. 3 gbees break weathar from boostng attacks, certan abilities that boost attacks (e.g. Blaze, Tarrent, etc), and Weathar Ball not functionng properly. I believe that is why an ASM fix was needed fo dis. I could be wrong though.

Tha glitch fix at 0x3F102 that is n dis tutarial should fix any issues wit that. At least that is mah understandng from Jbebo51's post.

If I'm missng any routnes that is needed ta fix any othar glitches hopefully someone will let me know :)
 
218
Posts
10
Years
  • Seen Nov 12, 2021
I'm quite sure it won't work.
There is several ability/attack routine to change to make PSS split works.
Check out the public of Doesntknowhowtoplay, go in his signature, click on the links "Physical/special split" and here you'll have a WORKING physical special split patch (just the mechanic split, not the icon or edited moves). It's the only way to make the split work.
 
Last edited:
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
I'm getting a glitch, after double checking my hex editing.

All physical attacks (ie, Tackle, Quick Attack, Vine Whip) do 2 damage. No more, no less. Special attacks and status attacks seem to be working well.

Has anyone else had this happen or is it just me? I'll triple check my hex now :).


// Well my solution was to use Doesn't patch with your hex edit fixes :)
 
Last edited:

DoesntKnowHowToPlay

Tiny Umbrella with Lots and Lots of Good
265
Posts
12
Years
  • Seen Feb 24, 2024
Nice broken split! The way you actually need to do this involves getting another register during the main damage calc function. This requires adding a line of code to take advantage of a no-op midway through damage calc, which shifts a large portion of the x3ECEC function by two bytes and results in far more byte edits than anyone wants to write out by hand. This is why the split I provided is in the form of a patch. Important things it handles that most combinations of minor byte edits don't:


Thick Fat: Game Freak's code just halves the SAtk of the attacker, not the move BP, since all Fire+Ice moves were normally Special anyway. It won't even do that most of the time here though, because...

Type-boosting hold items (Silk Scarf, Charcoal, etc.): These items are checked during the damage calc function starting at x3ECEC. The simple byte edit route replaces the move's type with its class; as such, these items do not work as they should. Silk Scarf boosts the power of all physical (0x0) moves, Black Belt boosts the power of all Special (0x1) moves, and the others do not function. The game raises Atk/SAtk based on typing rather than the BP though, so Black Belt doesn't actually do anything since Special-type (0x1) is lower than ???-type (0x9).

Blaze, Torrent, Overgrow, Swarm: These abilities check the type of the move being used. Because that register is replaced with class, the type checked is either 0x0 or 0x1; these abilities do not normally function as a result since they look for neither Normal or Fighting.

Mud Sport, Water Sport: See above

Hidden Power, Weather Ball: This one depends on how you do your byte edits somewhat. It runs into a similar problem though; class overwrites type, which is then overwritten by the move's custom type. As such, unless your mon has Hidden Power Fighting, you have a nonsense value in the register used by move class, which means it's anyone's guess how they work. (Usually they just do 1-2 damage.)

Hustle: The code for Hustle's accuracy boost is removed from the other parts of damage calc, so all moves of types that were physical before Gen IV have a chance to miss with this tutorial's byte edits. Physical Fire moves will still get a power boost, though; they just never miss.

Counter, Mirror Coat: As with Hustle, there's extra code for these removed from the damage calc proper that stores the final damage value in a location dependent on the move's class.
 
218
Posts
10
Years
  • Seen Nov 12, 2021
Ok I think these explanations are way better than mine x)
Though Doesn, I seen on the Nuzlock forum that you updated your FR PSS split patch, on 1.6, to fix the sandstorm problem, can you update the patch on your signature ? For those who don't know where is the newest
 

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
I'm quite sure it won't work.
There is several ability/attack routine to change to make PSS split works.
Check out the public of Doesntknowhowtoplay, go in his signature, click on the links "Physical/special split" and here you'll have a WORKING physical special split patch (just the mechanic split, not the icon or edited moves). It's the only way to make the split work.

Thanks for the explanation. I think simply applying his patch is the best way to do it in that case, in addition to adding the codes for the images that are in the tut.

I'm getting a glitch, after double checking my hex editing.

All physical attacks (ie, Tackle, Quick Attack, Vine Whip) do 2 damage. No more, no less. Special attacks and status attacks seem to be working well.

Has anyone else had this happen or is it just me? I'll triple check my hex now :).


// Well my solution was to use Doesn't patch with your hex edit fixes :)

I will say that I didn't have this issue with using physical attacks in my hack. All of the physical attacks did what seemed to be the correct amount of damage. However, I believe you are correct that to make the split work correctly it is best to apply Doesn't's patch.

Just a quick question regarding the reversal of the offsets for pointers:

Are they supposed to be reversed, or are they intended to be in little endian format? If thats the case, a simple reversal is very wrong. Definitely specify, because not everyone will be using offsets full of zeros such as 0x800000. If I go to the first 576 byte offset in a clean FR rom, the first free space FSF finds is 71A23C, which in little endian is 3C 71 A1, which isn't a reversal.

I tried to make it as specific as I could in the post. The reversal for offset 71A23C would be 3CA271. It gets spit into bytes - 71 A2 3C, and then reversed while keeping the pairs together, so 3C is first, 71 is last, and A2 stays in the center. I'm sorry, but I don't know what little endian is, lol, I just know what you have to do to make a pointer work in Pokemon advanced series games.

The way you actually need to do this involves getting another register during the main damage calc function. This requires adding a line of code to take advantage of a no-op midway through damage calc, which shifts a large portion of the x3ECEC function by two bytes and results in far more byte edits than anyone wants to write out by hand. This is why the split I provided is in the form of a patch. Important things it handles that most combinations of minor byte edits don't .....

I will be honest that I don't know all the mechanics that are needed to make all the abilities work. Truthfully, I do believe you should have a thread of its own that links to the patch, and not have it muddled up in the other exploratory thread, or just in your signature. From the info you gave, it seems that it's probably best to use your patch, skip the glitch fix data I posted, and just use the data for inserting the icons. And while I respect the work that you did on the patch, and that you took the time to explain what this tutorial is missing to make the split work correctly ...

Nice broken split!

There's no need for sarcasm or a childish, pompous attitude.

EDIT: Also, I wonder if anyone could tell me if the byte changes at the end of the tutorial are needed at all, or if DoesntKnowHowToPlay's patch would make them unnecessary.
 
Last edited:
218
Posts
10
Years
  • Seen Nov 12, 2021
Ok I'm not very skilled but I think you should :
1) Apply Doesnt patch
2) Set 0, 1 or 2 for the 11th bytes of each move (0 physical, 1 special, 2 statut)
3) Finally you make the "graphical" things

So, if the byte in the end of your tut have a graphical purpose, keep those, otherwise, just don't

And it should be ok

Actually I've played many hacks and I always applied doesnt patch, even in yours ^^. Always worked. But I never done the graphical things
 
Last edited:

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
Ok I'm not very skilled but I think you should :
1) Apply Doesnt patch
2) Set 0, 1 or 2 for the 11th bytes of each move (0 physical, 1 special, 2 statut)
3) Finally you make the "graphical" things

And it should be ok

Yeah, I think that is best, so I edited the post for that. I don't think I need the byte changes at the end, but I'll leave it until I know for sure, just in case.
 

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
Well thats the thing though, machines read bytes in little endian, which is why I was confused by that part of your tutorial. I'll give you a quick run-down i guess:

We, as humans, read numbers in big endian, which is simply left-to-right (most significant digit first) as the numbers are normally displayed. Machines, however, read them in little endian. Little endian is when bytes are split up and rearranged from lowest value to highest value. For example, the word (4 bytes) F412CCBA would be represented as 12 BA CC F4, and that is how the machine reads it. The most significant digit comes last. Another example would be 800000, which is represented as 00 00 80. While yes, it is reversed, it is also in little endian.

Also, after reading the "Nuts and Bolts of ROM Hacking" thread in this section, I can pretty much confirm that pokemon roms are read by the machine like almost all other data in little endian. Definitely make sure you know the difference and clarify it in your tutorial. If newcomers learn to just reverse offsets and throw a 08 at the end, not only will they be confused, but they'll be either running into errors because of offsets not being LE when reversed, or they'll be using their free space very inefficiently by only using values where there is only one byte that isnt zero.

I read a bit about it, and my understanding is not that bytes get rearranged from say lowest value to highest value, but from least significant to most significant. In this case, that would mean that the most significant byte is the one at the beginning of an offset, and that would go in the biggest address, making it essentially a reverse of the the offset. That is my understanding of it from this page, and the examples it shows.

I am by no means an expert, and I could certainly be wrong and have misunderstood how pointers are written, but I have been hacking Fire Red for a while, and hex editing, and have never come up with a problem before doing it my way.
 
Back
Top