• 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?".
  • 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: The 4th gen class split in 3rd gen

ArmoredGuns: Nah... I can't be bothered making a patch. Someone else can.

Darthatron's patch for Emerald works excellently, but there's a.. small, I guess, bug with Counter and Mirror Coat in it.

Counter won't reflect physical attacks if they're using a type that was formerly special, and Mirror Coat won't reflect special attacks if they're using a type that was formerly physical.

In the same vein if a special attack with a formerly physical type hits Counter, then it'll reflect it, and same with Mirror Coat/physicals with formerly special types.

Considering that Counter/Mirror Coat don't get used that often in the course of normal gameplay, it can be somewhat hard to notice, and probably only really a huge deal if you like using those moves often yourself.

I don't know if this happened with the JP versions of DPSS patches, because I saw Counter a grand total of zero times, so..
I dunno what they do. Explain, please? Also, does it crash, or just... do nothing? Glad it 'works', though. :P
 
It doesn't crash. Nothing bad happens, the moves simply fail.

For example, A Fire-typed Physical move, like, say, Blaze Kick, will cause Counter to fail, but Mirror Coat will deal the double damage back.

Similarly, a Ghost-typed Special move like Shadow Ball will cause Mirror Coat to fail, but it can be Countered back for doubled damage.

I haven't tripped over anything else yet, and this is honestly more of an annoyance than anything else. The moves aren't seen very often.
 
I'd hazard a guess that they're probably coded to run off of typing, not physical/special (since there isn't a distinction between them in the non-hacked game).
 
I think I found the bit of code responsible for the Counter/Mirror Coat glitch. At 0x47f02, the game loads the elemental type of the move with a "ldrb r6, [r0, #0x2]" instruction. Change the offset to wherever your custom physical/special/status byte is. Then, go to 0x48148 and change the "cmp r6, #0x8" instruction to "cmp r6, #0x0". Honestly, I don't understand the differences between the two branches but when I changed the conditional, it fixed the glitch.

edit: Ah, what the hell. I've attached my patch for whoever wants to test it.
 
Last edited:
I think I found the bit of code responsible for the Counter/Mirror Coat glitch. At 0x47f02, the game loads the elemental type of the move with a "ldrb r6, [r0, #0x2]" instruction. Change the offset to wherever your custom physical/special/status byte is. Then, go to 0x48148 and change the "cmp r6, #0x8" instruction to "cmp r6, #0x0". Honestly, I don't understand the differences between the two branches but when I changed the conditional, it fixed the glitch.

edit: Ah, what the hell. I've attached my patch for whoever wants to test it.

Thanks a lot for your patch!!

After applying your patch and comparing it with the original in Hex Workshop, I see both changes that you mention up there, but there are also many other changes (like "insert" at offset 009c1000 and "replace" at many 0031XXXX), may I bother asking you what are those changes (other than the light screen/reflect data that I read on your txt file)? Thanks!
 
Thanks a lot for your patch!!

After applying your patch and comparing it with the original in Hex Workshop, I see both changes that you mention up there, but there are also many other changes (like "insert" at offset 009c1000 and "replace" at many 0031XXXX), may I bother asking you what are those changes (other than the light screen/reflect data that I read on your txt file)? Thanks!

I uploaded a new archive with the asm files that I used. The 'physpec.asm' file details the exact changes but I also did a file compare with WindHex to see exactly what I changed. I'll sum up the differences here:

Code:
047f02	Changed a 'ldrb' instruction to load the custom byte
048148	Changed a 'cmp' instruction to test for 0x0 (physical)
0695e8	Changed a 'ldrb' instruction to load the custom byte
069602	Inserted a "ldr + bx" hijack, branches to 0x9c1000
069a5a	Changed a 'cmp' instruction to test for 0x0 (physical)
069a5e	Changed a 'b' instruction to branch to a different routine
31xxxx	All the changes to the attack data table
9c1000	The hijacked routine, branched to from 0x69604
 
I uploaded a new archive with the asm files that I used. The 'physpec.asm' file details the exact changes but I also did a file compare with WindHex to see exactly what I changed. I'll sum up the differences here:

Code:
047f02	Changed a 'ldrb' instruction to load the custom byte
048148	Changed a 'cmp' instruction to test for 0x0 (physical)
0695e8	Changed a 'ldrb' instruction to load the custom byte
069602	Inserted a "ldr + bx" hijack, branches to 0x9c1000
069a5a	Changed a 'cmp' instruction to test for 0x0 (physical)
069a5e	Changed a 'b' instruction to branch to a different routine
31xxxx	All the changes to the attack data table
9c1000	The hijacked routine, branched to from 0x69604

What did you need to hijack a routine for? I'm a bit confused.
 
What did you need to hijack a routine for? I'm a bit confused.

While writing up a reply to this question, I realized that the hijack was a very kludgey means of accomplishing something which could be done a lot more simply. So I removed the hijack part and replaced it with a simple byte edit at 0x69bcc which does the same thing. Once again, I've re-uploaded my patch. Since the .asm files are obsolete, I've included the changes in the README instead.
 
These are the offsets you need to change to activate it on Pokemon Ruby:
Code:
3BA94: 80 [B]7A[/B]
3BFBE: [B]00[/B] 29
3BFC0: 00 [B]D0[/B]
3C124: [B]02[/B] 2E
3C126: 00 [B]DB[/B]
3C12C: [B]01[/B] 28
3C12E: 00 [B]D0[/B]

And for those who care, here's a patch for Ruby that has the physical/special split implemented, and has all the attacks categorized into physical/special/status:
https://www.pokecommunity.com/threads/268940

Credit goes to Darthatron for posting how to do it on Emerald, since I found the Ruby offsets by searching for similar bytes to the offsets that Darthatron posted. And I'm assuming the recently found Mirror Coat/Counter glitch is present with this patch also.
 
Here's what I'm working on now. For FireRed. Will port to other games... Maybe.

[PokeCommunity.com] The 4th gen class split in 3rd gen
[PokeCommunity.com] The 4th gen class split in 3rd gen
[PokeCommunity.com] The 4th gen class split in 3rd gen


Kind of just the (metaphorical) icing on the (metaphorical) cake that we've already made. Letting people see what is Physical/Special/Status.
 
Here's what I'm working on now. For FireRed. Will port to other games... Maybe.

[PokeCommunity.com] The 4th gen class split in 3rd gen
[PokeCommunity.com] The 4th gen class split in 3rd gen
[PokeCommunity.com] The 4th gen class split in 3rd gen


Kind of just the (metaphorical) icing on the (metaphorical) cake that we've already made. Letting people see what is Physical/Special/Status.

Just out of curiosity - Why do you say working on?
This looks pretty d**n good to me. Obviously, I can't see any potential bugs which could arise from this, but it looks fine to me.

Anyway - when it's finished, will you release the code? As it's something which would come in very handy in my 649 Patch. I would (of course) credit you if you did release it. :)
 
Here's what I'm working on now. For FireRed. Will port to other games... Maybe.

[PokeCommunity.com] The 4th gen class split in 3rd gen
[PokeCommunity.com] The 4th gen class split in 3rd gen
[PokeCommunity.com] The 4th gen class split in 3rd gen


Kind of just the (metaphorical) icing on the (metaphorical) cake that we've already made. Letting people see what is Physical/Special/Status.
On my Ruby hack/project thing, I was thinking of modifying the fourth page on the summary to detail the physical/special indicators rather than Contest info (thus effectively breaking Pokemon Contests in the process), but since you said you might port to other versions I'm not sure if I want to follow through on that.

EDIT: This is what I meant:
[PokeCommunity.com] The 4th gen class split in 3rd gen

^If I did this, then Pokemon Contests will become broken.
 
Last edited:
Just out of curiosity - Why do you say working on?
This looks pretty d**n good to me. Obviously, I can't see any potential bugs which could arise from this, but it looks fine to me.

Anyway - when it's finished, will you release the code? As it's something which would come in very handy in my 649 Patch. I would (of course) credit you if you did release it. :)

I want to find a better place to put it. Right now, the image showing if it's physical/special/status appears a frame before the rest of the screen is loaded. :\ I mean, it's not that bad. I just don't love it.

Change these bytes:
Code:
@0813A130: 0x2F
@0813A17B: 0x47
@0813A1A0: [Pointer to Routine, plus 1 (one).]

Here's the source:
Code:
.align 2
.thumb
Start:
	push {r0-r4}
	ldr r0, .CurMoveIndex
	ldrb r1, [r0]
	lsl r1, r1, #1
	ldr r0, .Move_List
	add r0, r0, r1
	ldrh r3, [r0]
	lsl r0, r3, #1
	add r0, r0, r3
	lsl r0, r0, #2
	ldr r1, .MoveBase
	add r0, r0, r1
	ldrb r4, [r0, #10]
	lsl r0, r4, #1
	add r4, r4, r0
	lsl r4, r4, #6
	
	ldr r0, .SplitImages
	add r0, r4
	ldr r1, .VRAM
	mov r2, #0x30
	swi #0xB
	
	ldr r0, .SplitImages
	add r0, r4
	add r0, #0x60
	ldr r1, .VRAM
	mov r2, #0x1E
	lsl r2, #0x04
	add r1, r1, r2
	mov r2, #0x30
	swi #0xB
	
Finish:
	pop {r0-r4}
	ldr r4, .Some_Offset
	ldr r0, [r4]
	ldr r1, .Return_Addr
	bx r1

.align 2
.MoveBase:		.word 0x08250C04
.CurMoveIndex:	.word 0x0203B16D
.Move_List:		.word 0x02003268

.VRAM:			.word 0x06001800
.SplitImages:	.word 0xYYYYYYYY

.Some_Offset:	.word 0x0203B148
.Return_Addr:	.word 0x0813A17C+1

Change the .SplitImages (0xYYYYYYYY) pointer to where ever you have the images.
The images are uncompressed. And should look like this:
[PokeCommunity.com] The 4th gen class split in 3rd gen

They need to be in this order. Use TileMolester or something to insert them.
They use the same palette as the Types, which is located at 0x08E95DBC in a clean FireRed ROM. :)
 
So, say I could find where the game writes the data to the screen normally, and hijacked that code, I could potentially make it appear at the same time as the rest of the information, instead of one frame before it?

The images also appear in cancel, which they shouldn't. However, the images themselves worked fine.

To prevent the image showing for cancel - simply include a cmp r3, #0x0 after loading the attack ID into the register, and if it's 0, branch to Finish. I changed it to do this, and it worked satisfactorily.

Incidentally - 1 frame, does it REALLY bother you that much? It has to be barely noticeable, surely?

EDIT: I take it back - It is kinda annoying :(
 
Last edited:
This might sound arrogant coming from the person who started this thread and then promptly left it to grow up into a big strong man on it's own (they grow up so fast *sniff*) but when can we expect a clean DPSS patch into Fire Red? I will take the first step into admitting that my patch was nothing more then presented research designed to help anyone interested reach the goal of a clean modification that others can use to improve their own hacks. The patch itself (that I made) is horrifically broken and unprofessional, unfit for any serious hack to use. I blame this on my complete lack of education in ASM and how the GBA works, and probably wasn't even necessary for someone as smart as Darthatron, whom I am highly thankful for in whipping up an Emerald patch. My gratitude extends to everyone else too who's been working on this project and I'm glad I at least put forth the voice and research to make this possible. (Even if it might've happened anyways regardless of my attendance)

If there's already a clean DPSS patch for FR like there is now for Emerald, then disregard me, I lick lollipops. If not though, I'd like to know if it's in the works at least. Judging from the small amount of bytes Darthatron's Emerald DPSS changes, it'll be a lot more efficient then my bulky, strung together patch.
 
I'm pretty sure Jambo has it implemented in his Pokedex hack, though I'd assume its pretty similar to what is out there for Ruby and Emerald. I'd ask him if he could put it out.
 
Nah, I'm still trying to work out issues with it. Some physical attacks do little or no damage at times. Oddly, this occurs more often with attacks which were physical before the split too. I'm still trying to track down the code for Mirror Coat/Counter, as that will no doubt be buggy, same as any other gen 3 Rom.
 
Back
Top