The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Emulation & ROM Hacking > Research & Development
Register New Account FAQ/Rules Chat Blogs Mark Forums Read

Notices

Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. 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!
New threads in this forum are to be approved by a moderator before they are displayed. The thread revival limit does not apply here.



Reply
Thread Tools
  #101  
Unread December 15th, 2011, 04:55 AM
Darthatron's Avatar
Darthatron
巨大なトロール。
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 21
Gender: Male
Nature: Modest
ArmoredGuns: Nah... I can't be bothered making a patch. Someone else can.

Quote:
Originally Posted by Agastya View Post
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.
__________________
あなた は しきしゃ です
わたし は ばか です
Reply With Quote
  #102  
Unread December 15th, 2011, 05:02 AM
Agastya's Avatar
Agastya
witty user title
 
Join Date: Feb 2010
Nature: Quiet
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.
Reply With Quote
  #103  
Unread December 15th, 2011, 11:32 AM
Darthatron's Avatar
Darthatron
巨大なトロール。
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 21
Gender: Male
Nature: Modest
I'll look at their code some time. But it doesn't really seem that important. So yeah. Thanks for telling me, though.
__________________
あなた は しきしゃ です
わたし は ばか です
Reply With Quote
  #104  
Unread December 15th, 2011, 09:55 PM
Krika
Unhatched Egg
 
Join Date: Oct 2011
Gender: Male
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).
Reply With Quote
  Click here to go to the next staff post in this thread.   #105  
Unread December 16th, 2011, 11:50 PM
colcolstyles's Avatar
colcolstyles
Yours truly
 
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
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.
Attached Files
File Type: zip physpec.zip‎ (3.6 KB, 134 views)
__________________

Brother of Vrai

Last edited by colcolstyles; December 18th, 2011 at 07:50 AM.
Reply With Quote
  #106  
Unread December 17th, 2011, 06:34 AM
ArmoredGuns
Beginning Trainer
 
Join Date: Jan 2010
Quote:
Originally Posted by colcolstyles View Post
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!
Reply With Quote
  Click here to go to the next staff post in this thread.   #107  
Unread December 17th, 2011, 07:15 AM
colcolstyles's Avatar
colcolstyles
Yours truly
 
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
Quote:
Originally Posted by ArmoredGuns View Post
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
__________________

Brother of Vrai
Reply With Quote
  #108  
Unread December 18th, 2011, 03:42 AM
Darthatron's Avatar
Darthatron
巨大なトロール。
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 21
Gender: Male
Nature: Modest
Quote:
Originally Posted by colcolstyles View Post
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.
__________________
あなた は しきしゃ です
わたし は ばか です
Reply With Quote
  This is the last staff post in this thread.   #109  
Unread December 18th, 2011, 07:51 AM
colcolstyles's Avatar
colcolstyles
Yours truly
 
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
Quote:
Originally Posted by Darthatron View Post
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
Reply With Quote
  #110  
Unread December 18th, 2011, 08:38 AM
Chaos Rush's Avatar
Chaos Rush
Pokémon DarkViolet restarting
 
Join Date: May 2007
Gender: Male
Nature: Adamant
These are the offsets you need to change to activate it on Pokemon Ruby:
Code:
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.
__________________

Pokémon DarkViolet

DS-style 64x64 Pokémon Sprite Resource
oh and you should probably check this out too

Guys, please stop VM/PMing me about ROM hacking questions. I'm not an "expert ROM hacker". I'm an artist.

Non-Pokémon hacks I support:
Sonic Classic Heroes
Sonic 3 Complete
Reply With Quote
  #111  
Unread December 21st, 2011, 11:12 AM
Darthatron's Avatar
Darthatron
巨大なトロール。
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 21
Gender: Male
Nature: Modest
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.
__________________
あなた は しきしゃ です
わたし は ばか です
Reply With Quote
  #112  
Unread December 21st, 2011, 03:49 PM
Jambo51's Avatar
Jambo51
Thinking about quitting...
 
Join Date: Jun 2009
Location: Livingston, Scotland
Gender: Male
Nature: Quiet
Quote:
Originally Posted by Darthatron View Post
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.
__________________


Guys, please don't send me question which belong in the Simple Questions or Scripting Help threads. I don't mind the occasional question about ASM or something, though. And definitely don't send me PMs or VMs asking for help with your hack or requesting custom ASM. I will not answer.
Reply With Quote
  #113  
Unread December 21st, 2011, 05:00 PM
Chaos Rush's Avatar
Chaos Rush
Pokémon DarkViolet restarting
 
Join Date: May 2007
Gender: Male
Nature: Adamant
Quote:
Originally Posted by Darthatron View Post
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.
__________________

Pokémon DarkViolet

DS-style 64x64 Pokémon Sprite Resource
oh and you should probably check this out too

Guys, please stop VM/PMing me about ROM hacking questions. I'm not an "expert ROM hacker". I'm an artist.

Non-Pokémon hacks I support:
Sonic Classic Heroes
Sonic 3 Complete

Last edited by Chaos Rush; December 21st, 2011 at 06:45 PM.
Reply With Quote
  #114  
Unread December 22nd, 2011, 06:07 AM
Darthatron's Avatar
Darthatron
巨大なトロール。
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 21
Gender: Male
Nature: Modest
Quote:
Originally Posted by Jambo51 View Post
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:
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.
__________________
あなた は しきしゃ です
わたし は ばか です
Reply With Quote
  #115  
Unread December 22nd, 2011, 09:53 PM
Jambo51's Avatar
Jambo51
Thinking about quitting...
 
Join Date: Jun 2009
Location: Livingston, Scotland
Gender: Male
Nature: Quiet
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
__________________


Guys, please don't send me question which belong in the Simple Questions or Scripting Help threads. I don't mind the occasional question about ASM or something, though. And definitely don't send me PMs or VMs asking for help with your hack or requesting custom ASM. I will not answer.

Last edited by Jambo51; December 22nd, 2011 at 11:39 PM.
Reply With Quote
  #116  
Unread December 23rd, 2011, 04:56 AM
Darthatron's Avatar
Darthatron
巨大なトロール。
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 21
Gender: Male
Nature: Modest
I'm sure with our combined brains, we can work it out. I don't have time until after Christmas, however.
__________________
あなた は しきしゃ です
わたし は ばか です
Reply With Quote
  #117  
Unread December 23rd, 2011, 09:45 AM
ArmoredGuns
Beginning Trainer
 
Join Date: Jan 2010
Seems awesome!!! I'm looking forward to an Emerald port
Reply With Quote
  #118  
Unread December 25th, 2011, 06:29 AM
JJames19119
Beginning Trainer
 
Join Date: Oct 2008
Gender:
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.
Reply With Quote
  #119  
Unread December 27th, 2011, 02:54 AM
Wiznatts's Avatar
Wiznatts
Unhatched Egg
 
Join Date: Dec 2010
Gender: Male
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.
Reply With Quote
  #120  
Unread December 27th, 2011, 09:04 AM
Jambo51's Avatar
Jambo51
Thinking about quitting...
 
Join Date: Jun 2009
Location: Livingston, Scotland
Gender: Male
Nature: Quiet
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.
__________________


Guys, please don't send me question which belong in the Simple Questions or Scripting Help threads. I don't mind the occasional question about ASM or something, though. And definitely don't send me PMs or VMs asking for help with your hack or requesting custom ASM. I will not answer.
Reply With Quote
  #121  
Unread December 27th, 2011, 11:27 AM
Darthatron's Avatar
Darthatron
巨大なトロール。
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 21
Gender: Male
Nature: Modest
Did you want me to port my Emerald version to FireRed, or are you set?
__________________
あなた は しきしゃ です
わたし は ばか です
Reply With Quote
  #122  
Unread December 29th, 2011, 01:16 AM
Krika
Unhatched Egg
 
Join Date: Oct 2011
Gender: Male
What exactly is the tool that I should use to find the table with the move data? I was directed to PKSV-UI, but that doesn't seem to be the right tool.
Reply With Quote
  #123  
Unread December 29th, 2011, 10:44 PM
Jambo51's Avatar
Jambo51
Thinking about quitting...
 
Join Date: Jun 2009
Location: Livingston, Scotland
Gender: Male
Nature: Quiet
Quote:
Originally Posted by Darthatron View Post
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.
__________________


Guys, please don't send me question which belong in the Simple Questions or Scripting Help threads. I don't mind the occasional question about ASM or something, though. And definitely don't send me PMs or VMs asking for help with your hack or requesting custom ASM. I will not answer.
Reply With Quote
  #124  
Unread January 1st, 2012, 04:36 AM
Darthatron's Avatar
Darthatron
巨大なトロール。
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 21
Gender: Male
Nature: Modest
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)
Code:
0803ED54: 80 7A
0803F226: 00 29
0803F228: 00 D0
0803F38C: 02 2F
0803F38E: 00 DB
0803F394: 01 28
0803F396: 00 D0
Ruby (US) 1
Code:
0803BA94: 80 7A
0803BFBE: 00 29
0803BFC0: 00 D0
0803C124: 02 2E
0803C126: 00 DB
0803C12C: 01 28
0803C12E: 00 D0
Emerald (US) 2
Code:
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...
__________________
あなた は しきしゃ です
わたし は ばか です

Last edited by Darthatron; January 1st, 2012 at 05:58 AM.
Reply With Quote
  #125  
Unread January 1st, 2012, 06:35 PM
Jambo51's Avatar
Jambo51
Thinking about quitting...
 
Join Date: Jun 2009
Location: Livingston, Scotland
Gender: Male
Nature: Quiet
Quote:
Originally Posted by Darthatron View Post
FireRed (US)
Code:
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.
__________________


Guys, please don't send me question which belong in the Simple Questions or Scripting Help threads. I don't mind the occasional question about ASM or something, though. And definitely don't send me PMs or VMs asking for help with your hack or requesting custom ASM. I will not answer.

Last edited by Jambo51; January 6th, 2012 at 02:03 PM.
Reply With Quote
Reply
Quick Reply

Sponsored Links


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are UTC. The time now is 12:52 AM.


Style by Perdition Haze, artwork by Sa-Dui.
Like our Facebook Page Follow us on TwitterMessage Board Statistics | © 2002 - 2013 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to Pokémon USA, Inc. and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company, Pokémon USA, Inc., The Pokémon Company International, or Wizards of the Coast. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2013 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User posts belong to the user.