Development The 4th gen class split in 3rd gen Page 5

Started by JJames19119 October 15th, 2010 11:21 PM
  • 188145 views
  • 343 replies

Darthatron

巨大なトロール。

Age 29
Male
Melbourne, Australia
Seen February 2nd, 2015
Posted October 28th, 2014
1,152 posts
15.4 Years
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
あなた は しきしゃ です
わたし は ばか です

Agastya

Grinding failed. Item Grind level dropped by 3.

Seen January 30th, 2020
Posted January 16th, 2017
72 posts
11.3 Years
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.

colcolstyles

Yours truly

Male
The Bay Area
Seen May 18th, 2019
Posted August 13th, 2012
1,590 posts
13 Years
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.

Brother of Vrai
Seen January 22nd, 2015
Posted August 23rd, 2013
12 posts
11.4 Years
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!

colcolstyles

Yours truly

Male
The Bay Area
Seen May 18th, 2019
Posted August 13th, 2012
1,590 posts
13 Years
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:

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

Brother of Vrai

Darthatron

巨大なトロール。

Age 29
Male
Melbourne, Australia
Seen February 2nd, 2015
Posted October 28th, 2014
1,152 posts
15.4 Years
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:

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.
あなた は しきしゃ です
わたし は ばか です

colcolstyles

Yours truly

Male
The Bay Area
Seen May 18th, 2019
Posted August 13th, 2012
1,590 posts
13 Years
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.

Brother of Vrai
Male
Seen 1 Week Ago
Posted January 16th, 2021
1,321 posts
14.1 Years
These are the offsets you need to change to activate it on Pokemon Ruby:
3BA94: 80 7A
3BFBE: 00 29
3BFC0: 00 D0
3C124: 02 2E
3C126: 00 DB
3C12C: 01 28
3C12E: 00 D0
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:
http://www.pokecommunity.com/showthread.php?t=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.

Sole developer of STARLIGHT LEGACY intended to be released on Steam.

Discussion: https://www.pokecommunity.com/showthread.php?t=432051
Discord: https://discord.gg/fTS5Q78
Twitter: https://twitter.com/jmatz1995

Darthatron

巨大なトロール。

Age 29
Male
Melbourne, Australia
Seen February 2nd, 2015
Posted October 28th, 2014
1,152 posts
15.4 Years
Here's what I'm working on now. For FireRed. Will port to other games... Maybe.



Kind of just the (metaphorical) icing on the (metaphorical) cake that we've already made. Letting people see what is Physical/Special/Status.
あなた は しきしゃ です
わたし は ばか です

Jambo51

Glory To Arstotzka

Male
Seen January 28th, 2018
Posted December 6th, 2015
732 posts
12 Years
Here's what I'm working on now. For FireRed. Will port to other games... Maybe.



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. :)
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
Male
Seen 1 Week Ago
Posted January 16th, 2021
1,321 posts
14.1 Years
Here's what I'm working on now. For FireRed. Will port to other games... Maybe.



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:

^If I did this, then Pokemon Contests will become broken.

Sole developer of STARLIGHT LEGACY intended to be released on Steam.

Discussion: https://www.pokecommunity.com/showthread.php?t=432051
Discord: https://discord.gg/fTS5Q78
Twitter: https://twitter.com/jmatz1995

Darthatron

巨大なトロール。

Age 29
Male
Melbourne, Australia
Seen February 2nd, 2015
Posted October 28th, 2014
1,152 posts
15.4 Years
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:
@0813A130: 0x2F
@0813A17B: 0x47
@0813A1A0: [Pointer to Routine, plus 1 (one).]
Here's the source:
.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:
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. :)
あなた は しきしゃ です
わたし は ばか です

Jambo51

Glory To Arstotzka

Male
Seen January 28th, 2018
Posted December 6th, 2015
732 posts
12 Years
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 :(
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
Seen March 26th, 2013
Posted January 30th, 2012
48 posts
12.6 Years
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.

Jambo51

Glory To Arstotzka

Male
Seen January 28th, 2018
Posted December 6th, 2015
732 posts
12 Years
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.
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!

Jambo51

Glory To Arstotzka

Male
Seen January 28th, 2018
Posted December 6th, 2015
732 posts
12 Years
Did you want me to port my Emerald version to FireRed, or are you set?
You know what? Feel free to do it!

I'm beginning to get really frustrated by the coding, as it feels like I fix one thing and another breaks.
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!

Darthatron

巨大なトロール。

Age 29
Male
Melbourne, Australia
Seen February 2nd, 2015
Posted October 28th, 2014
1,152 posts
15.4 Years
HAPPY NEW YEAR!

Here's the Emerald hack ported to the other games. I find it amusing that with this hack we got it working for Emerald first, then Ruby, and then FireRed, when usually it's the complete opposite. xD

FireRed (US)
0803ED54: 80 7A
0803F226: 00 29
0803F228: 00 D0
0803F38C: 02 2F
0803F38E: 00 DB
0803F394: 01 28
0803F396: 00 D0
Ruby (US) 1
0803BA94: 80 7A
0803BFBE: 00 29
0803BFC0: 00 D0
0803C124: 02 2E
0803C126: 00 DB
0803C12C: 01 28
0803C12E: 00 D0
Emerald (US) 2
080695E8: 80 7A
08069A5A: 00 29
08069A5C: 00 D0
08069BC4: 02 2F
08069BC6: 00 DB
08069BCC: 01 28
08069BCE: 00 D0
1 Credit to Chaos Rush for the Ruby port; I don't even have a Ruby ROM. xD
2 Credit to colcolstyles for the Emerald hack; I based everything off of his post.

EDIT: Literally no testing was done for the FireRed port. So someone should test it and let me know if it breaks everything. But I really don't see that happening...
あなた は しきしゃ です
わたし は ばか です

Jambo51

Glory To Arstotzka

Male
Seen January 28th, 2018
Posted December 6th, 2015
732 posts
12 Years
FireRed (US)
0803ED54: 80 7A
0803F226: 00 29
0803F228: 00 D0
0803F38C: 02 2F
0803F38E: 00 DB
0803F394: 01 28
0803F396: 00 D0
EDIT: Literally no testing was done for the FireRed port. So someone should test it and let me know if it breaks everything. But I really don't see that happening...
I did a very quick test. And it has the opposite bug that my original code did. The physical attacks work fine, the special attacks do no damage at all.

EDIT: Never Mind. It was a leftover from the old code causing it. My bad. :)
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!