Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development

Notices
For all updates, view the main page.

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!
Research & Development programs in this forum are subject to moderator approval before they are displayed.



Reply
 
Thread Tools
  #126    
Old March 1st, 2014 (08:04 PM). Edited April 4th, 2014 by Artemis64.
Artemis64
 
Join Date: Mar 2014
Gender: Male
For Ruby hackers, the command to clear background is 0E F3 61 1D 08 before you add the 08 byte at the end.
Most of Chaos Rush's commands work, except for any command with an "08" (pointer) inside.

Edit: I found the commands. They are:
14 XX 17 03 59 3A 0E 08 05 04 00 00 00 YY 0Z 00 00 FF FF (Scrolling BG Left-to-Right)
14 XX 17 03 59 3A 0E 08 05 04 00 00 00 YY FZ 00 00 FF FF (Scrolling BG Right-to-Left)

Now, I would like some help with finding the Psychic Background command for Ruby.


Reply With Quote
  #127    
Old March 19th, 2014 (12:17 AM).
Crazy_chu's Avatar
Crazy_chu
Newly Born Pichu
 
Join Date: Jan 2014
i confused X.X can you make a video about it?
please..
__________________
Please click this egg soo its could hatched



Reply With Quote
  #128    
Old April 6th, 2014 (07:59 PM). Edited April 6th, 2014 by HidoranBlaze.
HidoranBlaze's Avatar
HidoranBlaze
 
Join Date: Apr 2013
Age: 18
Gender: Male
If a person experienced in Emerald animations would help me with this, I would be very grateful.
I'm trying to make a new animation, with the Dark background and the slash animation, but the game freezes every time the animation finishes. I did add an extra 08 and everything, and I'm pretty sure I found the right commands, so I'm not really sure what's going wrong. I really want to squash this bug so I can move on to implementing custom backgrounds in Emerald.
Anyways, here's my code:
Code:
14 00 17 00 C7 27 02 2C 2D 59 08 82 03 01 00 F8 FF 00 00 19 88 00 3F 04 04 02 2C 2D 59 08 82 03 01 00 08 00 00 00 03 D1 52 0D 08 02 05 01 00 04 00 00 00 12 00 01 00 19 88 00 3F 05 FF 0E DD 7C 2D 08 08
EDIT: Nvm I realized what went wrong. It's funny how one byte changes everything.
Reply With Quote
  #129    
Old May 4th, 2014 (03:20 PM). Edited May 4th, 2014 by Giniselono.
Giniselono
 
Join Date: Dec 2013
Gender:
Quote originally posted by HidoranBlaze:
If a person experienced in Emerald animations would help me with this, I would be very grateful.
I'm trying to make a new animation, with the Dark background and the slash animation, but the game freezes every time the animation finishes. I did add an extra 08 and everything, and I'm pretty sure I found the right commands, so I'm not really sure what's going wrong. I really want to squash this bug so I can move on to implementing custom backgrounds in Emerald.
Anyways, here's my code:
Code:
14 00 17 00 C7 27 02 2C 2D 59 08 82 03 01 00 F8 FF 00 00 19 88 00 3F 04 04 02 2C 2D 59 08 82 03 01 00 08 00 00 00 03 D1 52 0D 08 02 05 01 00 04 00 00 00 12 00 01 00 19 88 00 3F 05 FF 0E DD 7C 2D 08 08
EDIT: Nvm I realized what went wrong. It's funny how one byte changes everything.
What was the one byte that went wrong? I want to use this code too, and I'm getting the same problem you were having.
Reply With Quote
  #130    
Old May 7th, 2014 (06:14 AM).
Yuna Hope's Avatar
Yuna Hope
Suport pokemon unleashed
 
Join Date: May 2014
Location: Silca bay
Age: 15
Gender: Female
Nature: Calm
Quote originally posted by Crazy_chu:
i confused X.X can you make a video about it?
please..
Same here <3 Need some video
__________________
Suport pokemon unleashed
Reply With Quote
  #131    
Old May 7th, 2014 (10:50 PM).
HidoranBlaze's Avatar
HidoranBlaze
 
Join Date: Apr 2013
Age: 18
Gender: Male
Quote originally posted by Giniselono:
What was the one byte that went wrong? I want to use this code too, and I'm getting the same problem you were having.
Ah my apologies, I didn't see this. It's been a while since I made this code, but I believe the FF byte near the end caused the problem; just take that out and you should be fine, I think.
Reply With Quote
  #132    
Old May 8th, 2014 (10:27 AM). Edited May 8th, 2014 by Giniselono.
Giniselono
 
Join Date: Dec 2013
Gender:
Quote originally posted by HidoranBlaze:
Ah my apologies, I didn't see this. It's been a while since I made this code, but I believe the FF byte near the end caused the problem; just take that out and you should be fine, I think.
Maybe you have the code stashed away somewhere? I changed the FF byte to 00 but that restarted my ROM when the attack was executed, so I instead took out the FF byte completely and my ROM broke.
Reply With Quote
  #133    
Old May 8th, 2014 (04:19 PM). Edited May 8th, 2014 by HidoranBlaze.
HidoranBlaze's Avatar
HidoranBlaze
 
Join Date: Apr 2013
Age: 18
Gender: Male
Quote originally posted by Giniselono:
Maybe you have the code stashed away somewhere? I changed the FF byte to 00 but that restarted my ROM when the attack was executed, so I instead took out the FF byte completely and my ROM broke.
Ok, I'm on my computer now, I'll look at it and tell you what the problem is.

EDIT: Ok, here's my revised code. This definitely works. If this doesn't work, then you're probably doing something wrong. (I tested this myself) :

Code:
14 00 16 00 C7 27 02 2C 2D 59 08 82 03 01 00 F8 FF 00 00 19 88 00 3F 04 04 02 2C 2D 59 08 82 03 01 00 08 00 00 00 03 D1 52 0D 08 02 05 01 00 04 00 00 00 12 00 01 00 19 88 00 3F 05 0E DD 7C 2D 08 08
Reply With Quote
  #134    
Old May 8th, 2014 (05:55 PM).
Giniselono
 
Join Date: Dec 2013
Gender:
Quote originally posted by HidoranBlaze:
Ok, I'm on my computer now, I'll look at it and tell you what the problem is.

EDIT: Ok, here's my revised code. This definitely works. If this doesn't work, then you're probably doing something wrong. (I tested this myself) :

Code:
14 00 16 00 C7 27 02 2C 2D 59 08 82 03 01 00 F8 FF 00 00 19 88 00 3F 04 04 02 2C 2D 59 08 82 03 01 00 08 00 00 00 03 D1 52 0D 08 02 05 01 00 04 00 00 00 12 00 01 00 19 88 00 3F 05 0E DD 7C 2D 08 08
Thanks, it worked!

25charmanderlimit
Reply With Quote
  #135    
Old May 12th, 2014 (08:01 PM). Edited May 19th, 2014 by Artemis64.
Artemis64
 
Join Date: Mar 2014
Gender: Male
Here's some animation codes for Ruby:
Ice Fang
Spoiler:


00 9B 27 00 9D 27 00 9F 27 00 97 27 0A 01 0C 0C 08 19 A1 00 3F 02 D0 B1 3D 08 02 06 00 00 E0 FF 00 00 00 00 33 03 0A 00 02 D0 B1 3D 08 02 06 00 00 20 00 04 00 00 00 CD FC 0A 00 04 0A 02 A8 B4 3D 08 02 04 00 00 00 00 01 00 02 00 03 7D 7E 0A 08 05 05 01 00 00 00 04 00 07 00 01 00 05 0B 01 0D 04 01 0E 36 5C 1D 08 04 05 03 39 2A 0E 08 0A 05 04 00 02 00 09 00 00 00 4C 7F 05 08 19 C5 00 C0

Thunder Fang
Spoiler:


00 9B 27 00 97 27 00 9F 27 00 35 27 0A 01 0C 0C 08 19 A1 00 3F 02 D0 B1 3D 08 02 06 00 00 E0 FF 00 00 00 00 33 03 0A 00 02 D0 B1 3D 08 02 06 00 00 20 00 04 00 00 00 CD FC 0A 00 04 0A 02 A8 B4 3D 08 02 04 00 00 00 00 01 00 02 00 03 7D 7E 0A 08 05 05 01 00 00 00 04 00 07 00 01 00 05 0B 01 0D 04 01 02 D0 97 3D 08 02 02 00 00 F0 FF 04 01 03 25 23 0E 08 02 03 01 01 01 01 01 01 04 01 02 D0 97 3D 08 82 02 00 00 D0 FF 04 01 02 D0 97 3D 08 02 02 00 00 F0 FF 04 01 02 D0 97 3D 08 02 02 00 00 10 00 04 01 19 DD 00 3F 03 25 23 0E 08 02 03 01 01 01 01 01 01 04 02 03 7D 7E 0A 08 02 05 01 00 00 00 03 00 0F 00 01 00 02 A8 B4 3D 08 03 04 00 00 00 00 01 00 02 00 04 01 02 C4 B3 3D 08 02 05 01 00 02 00 10 00 00 00 00 00 04 14 05 0B 01 0D 08

Drain Punch
Spoiler:


00 9F 27 00 A3 27 04 01 00 2F 27 00 97 27 0A 03 2A 01 0C 0C 08 04 01 02 A8 9F 3D 08 02 03 EC FF 0F 00 0C 00 05 02 A8 9F 3D 08 02 04 00 00 00 00 01 00 02 00 19 B4 00 3F 04 02 03 7D 7E 0A 08 05 05 01 00 00 00 05 00 05 00 01 00 05 02 C4 B3 3D 08 02 05 01 00 01 00 00 00 07 00 00 00 05 0E AE F5 1C 08 05 04 0F 0E F5 5E 1D 08 05 02 C4 B3 3D 08 02 05 01 00 01 00 07 00 00 00 00 00 05 0B 03 0D 08

Seed Bomb
Spoiler:


00 D6 27 00 BF 27 00 16 27 19 A7 00 C0 02 28 76 3D 08 82 06 0A 00 00 00 00 00 00 00 19 00 E0 FF 05 03 A1 7F 0A 08 02 05 01 00 04 00 00 00 10 00 01 00 02 28 78 3D 08 84 04 06 00 05 00 01 00 00 00 19 B1 00 3F 04 03 02 28 78 3D 08 84 04 F0 FF F1 FF 01 00 00 00 19 B1 00 3F 04 03 02 28 78 3D 08 84 04 10 00 FB FF 01 00 00 00 19 B1 00 3F 04 03 02 28 78 3D 08 84 04 F4 FF 12 00 01 00 00 00 19 B1 00 3F 04 03 02 28 78 3D 08 84 04 00 00 05 00 01 00 00 00 19 B1 00 3F 04 03 05 08

And I have some questions:
-What command allows you to play a sound multiple times?
-How would a pointer to offset 1 00 00 00 be written? Would it be 00 00 00 01 08, 00 00 00 18, or 00 00 00 09?
Reply With Quote
  #136    
Old May 13th, 2014 (07:07 PM).
destinedjagold's Avatar
destinedjagold
Oh Hai Thar~ 'ω'
Community Supporter
 
Join Date: May 2007
Location: Philippines
Gender: Male
Nature: Careful
I have successfully made a simple animation for Night Slash in a Ruby ROM.
Adding backgrounds seemed to be easier than I thought.
Many thanks to Chaos Rush for this tutorial, and to dreamengine and Artemis64 for your Ruby contributions~

But I'm having trouble understanding how to add some hues of blue and green and other colors to the screen, like Absorb and Water Pulse. =/
__________________

3DS FC: 0061-1111-6462
TSV: 1364(X), 0790(OR)


Reply With Quote
  #137    
Old May 13th, 2014 (08:00 PM).
HidoranBlaze's Avatar
HidoranBlaze
 
Join Date: Apr 2013
Age: 18
Gender: Male
Quote originally posted by destinedjagold:
I have successfully made a simple animation for Night Slash in a Ruby ROM.
Adding backgrounds seemed to be easier than I thought.
Many thanks to Chaos Rush for this tutorial, and to dreamengine and Artemis64 for your Ruby contributions~

But I'm having trouble understanding how to add some hues of blue and green and other colors to the screen, like Absorb and Water Pulse. =/
destinedjagold: Same principle applies. Just add the code to activate the background at the front, put your animation in between, and put the clear code at the end. Except you don't really need to add an extra 08 here. Here's my modified night slash example for Emerald, with the Giga Drain background, but you can substitute in the codes for Ruby (I think Artemis64 has the codes somewhere) :
Code:
02 74 72 59 08 02 05 01 00 01 00 00 00 04 00 ED 33 05 00 C7 27 02 2C 2D 59 08 82 03 01 00 F8 FF 00 00 19 88 00 3F 04 04 02 2C 2D 59 08 82 03 01 00 08 00 00 00 03 D1 52 0D 08 02 05 01 00 04 00 00 00 12 00 01 00 19 88 00 3F 05 02 74 72 59 08 02 05 01 00 01 00 04 00 00 00 ED 33 05 0B 03 0D 08
Reply With Quote
  #138    
Old May 15th, 2014 (01:00 AM). Edited May 19th, 2014 by Artemis64.
Artemis64
 
Join Date: Mar 2014
Gender: Male
Here are the codes:
To enable such a background: 02 C4 B3 3D 08 02 05 01 00 SS 00 00 00 II 00 CC CC 05
To clear the background: 02 C4 B3 3D 08 02 05 01 00 SS 00 II 00 00 00 CC CC 05 0B 03 0D
SS refers to speed at which the battle becomes colored CC CC, and II controls at what intensity. For CC CC, all you have to do is open up Advance Map, go to the block editor then the palette editor, and pick the color you want. The 15-bit value there, however, has to be reversed to be usable in the thing.
I was thinking about adding new attack backgrounds, however. Using tajaros' tutorial, and substituting the offset 0x37F374, and adding his example Waterfall background, it failed when I placed the pointers at the end of the table. However, if I use it to overwrite BG 0x1 (the extra Dark-type BG) I can load it, and it works perfectly fine as far as I can see. Which makes me think there is some limiter that is preventing the game from loading more than 0x1A (26) backgrounds, in Ruby at least. Unfortunately, I have no idea how to go about finding limiter bytes. If someone can explain the process to me, I'd be more than willing to do it myself.
Edit: Wow, I even forgot what I originally wanted to post (my Flame Charge animation bytes, and my adapted Gen 4 flame sprites):
Flame Charge:
Spoiler:


00 2D 27 0A 02 0C 0C 08 1C A8 00 C0 14 0F 0E E9 39 1D 08 0E E9 39 1D 08 0E E1 02 1D 08 04 20 03 8D 1F 0E 08 02 06 0A 00 08 00 02 00 00 00 0E 00 FF 7F 05 0B 02 0D 02 F8 1F 3C 08 02 05 00 00 18 00 00 00 00 00 06 00 04 04 03 7D 7E 0A 08 02 05 01 00 05 00 00 00 08 00 01 00 03 91 97 07 08 03 05 01 00 1F 00 0C 00 01 00 01 00 19 91 00 3F 0E A2 11 1D 08 04 07 02 E0 1F 3C 08 02 03 00 00 00 00 09 00 05 0B 03 08 02 94 96 3D 08 03 03 00 00 00 00 32 00 04 04 0F

Flame Sprites.png
Edit 2: Here are some more animated background commands:
Animated Psychic : 0E E7 61 1D 08
High-power BG command: 0E E9 85 1C 08
Flying type BG : 0E FB 61 1D 08
As usual, all of them are for Ruby.
Reply With Quote
  #139    
Old May 23rd, 2014 (12:41 AM). Edited September 22nd, 2014 by RaileysXerilyasRX.
RaileysXerilyasRX's Avatar
RaileysXerilyasRX
Impressive. Most impressive.
 
Join Date: Feb 2014
Location: Philippines
Gender: Male
Nature: Adamant
Send a message via Skype™ to RaileysXerilyasRX
Wow! Very interesting! This really helped me a lot and I get to create on my own.

Draco Meteor (noGIF):

I like it a lot.

Leaf Storm (noGIF):

Well, kinda bit simple for a powerful move. :3

If you want the Hex codes, just download the attachments below:
Attachment 72102
Attachment 72103
Just open it in an hex editor and you got it.
__________________











RaileysXerilyasRX

Reply With Quote
  #140    
Old May 28th, 2014 (04:00 AM).
Artemis64
 
Join Date: Mar 2014
Gender: Male
Here's some more data on the commands/pointers:
To recap, the 0E command not only loads a sprite, but also loads complex movements e.g. the rotating fire of Fire Spin, the Mud-Slap. The 02 command loads a sprite with some basic movements e.g. the moving upwards before falling downwards in a curve of Acid and Water Gun.
So I was intending to create a custom Emerald animation for Acid Spray by using Mud Slap and replacing the mud particles with A6 27, which is the Acid poison particle command. However, the 02 command didn't load the spherical Acid properly, but rather loaded half of it and combined it with the acid droplets. Therefore I was digging through the 02 command's 0x18 bytes to see how to get it fixed. What I found was the structure of the 02 command:
(1st 2 bytes, image data)(Next 2 bytes, palette data)(2 pointers to what should be extracted from the image and used and how to piece it together)(4 00 bytes, still haven't figured out what they do)(2 pointers containing movement data)
Reply With Quote
  #141    
Old August 31st, 2014 (02:09 AM).
Artemis64
 
Join Date: Mar 2014
Gender: Male
More interesting information:
I don't really get this one, but it seems that 0A XX YY 00 02 00 00 00 is the command to color a Pokémon (like the white in Mist and the purple in Sludge). The YY byte appears to define what is colored. 04 is opponent's Pokémon, 0F appears to be the whole area (Heat Wave?) Then, a byte follows that decides the limits of the color. 09 appears to be limited to basic red (Flame Wheel), while 0C/0E seems to accept any color. After that, a 00 byte appears, then the color in reverse hex.
Then, extracting data from Mist, the command is 0A 00 08 00 02 00 00 00 0E 00 FF 7F? However, using Flame Wheel's data, changing the bytes to 00 08 crashes the animation..???
Finally, looking at Heat Wave, the command used to color the whole background is 06 02 06 00 00 1F, while the command used to color the sand particles is 06 00 06 00 00 1F. Just a single byte's difference. The structure appears kinda similar, but it IS different, which is weird, since most animations using the same resource usually is the same command. Get the confusion?
The reason why I am posting this now is because it needs to be better researched and finalised before it can become a proper command. Help please?
Reply With Quote
  #142    
Old September 11th, 2014 (08:53 AM).
Lance32497's Avatar
Lance32497
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
I try to calculate the offset for SHADOW BALL, but I dont know what is the indication that this byte is the last byte for the move SHADOW BALL? How can I identify the end byte of a certain move???
__________________
My Threads

Reply With Quote
  #143    
Old September 11th, 2014 (10:22 AM).
vizor
 
Join Date: Dec 2011
Gender: Female
Today i was doing some reserach on the script engine of this language and figuered out, how some commands work. I have not worked through them all and yet I dont understand everything the commands do. The list i am posting is for firered german, so the offsets won't fit a english rom, but the way the commands work should be the same


Spoiler:
battle anim engine

cmd0 [u16 a]
loads a animated graphic given in a into objvram and its animation into animation_bank

cmd2 [u32 a] [u8 b] [u8 c] [...]
a seems to be an oam_structure, while b is a flag?
c also shows additional animation which is loaded into animation_bank
this function spawns an OAM from this structure which a certain animation


cmd3 [u32 a] [u8 b] [u8 c] [...]
loads a into ram as a callback
loads b into this callback as status
c shows the amount of additional animation, which is loeaded into animation_bank

cmd4 [u8 a]
seems to delay the next command by a frames

cmd5
delays the script by a number given at 0x02037EE2, must be some kind of "waitstate"

cmd6
nop

cmd7
nop

cmd8
ends the script, as long there is no delay remaining, otherwise it will wait and then end the script

cmd9 [u16 a]
plays a sound/song given in a, as long as 0x02031DD8 == 0 and 0x0203AdFA != 2

cmdA [u8 a]
something very complex, a lot of code, spawns a callback if there is an targeta
a has states from 0-3 (0,2 = players poke as target ;; 1,3 = opps. poke)

cmdB [u8 b]
very similar to cmdA but not so complex
also spawns a callback and clears bits in the OAM structure flags

cmdC [u16 a]
enables blending by setting BLDCNT to 0x3F40 and sets COLEV to a

cmdD
resets BLDCNT and COLEV to 0

cmdE [u32 a]
branches the code to a and places a return adress at 0x02037ED8

cmdF
branches the code to the return adress at 0x02037ED8

cmd10 [u8 a] [u16 b]
places b in the animation_bank, places it with the ID a

cmd11 [u32 a] [u32 b]
branches the code to a if the byte at 0x02037F16 has bit0 set, otherwise it branches the code to b

cmd12 [u8 a] [u32 b]
branches the code to b if the byte at 0x02037F16 == a

cmd13 [u8 a]
branches the code to a

cmd14 [u8 a]
spawns 0x80737B4|1 as callback and sets a as it param 0x8 in RAM
sets byte at 0x02037F17 to 0x1

cmd15
spawns 0x080737B5|1 as callback and sets it param 0x8 to 0xFFFF
sets byte at 0x02037F17 to 0x1

cmd16
halts the code until 0x02037F17 == 0x2

cmd17
halts the code until 0x02037F17 == 0x0

cmd18 [u8 a]
loads a background into the battle from the table at 0x3ADC64 (ID is a, entry length is 0xC)

cmd19 [u16 a] [s8 b]
does a lot of checks with the singed byte b and then seems to play sound a or something like that
maybe b is some modulation for the sound display


cmd1A [s8 a]
does the same thing with a as cmd19 does with b (maybe modulation)

cmd1B [u16 a] [s8 b] [u8 c] [u8 d] [u8 e]
spawns 0x0873C50|1 as callback
sets a transformed value of b (like in cmd19) as param 0x8 in RAM
sets " c " 0xA "
sets abs(d) or 0x0 (if b >= c)as param 0xE in RAM
sets e as param 0x10 in RAM



cmd1F [u16 a]
sets BLDCNT to a




cmd23 [u8 a]
does the same thing as cmdB but doesnt spawn a callback

cmd24 [u8 a]
very similar to cmdB


Reply With Quote
  #144    
Old November 28th, 2014 (11:10 PM).
kittopian's Avatar
kittopian
Source engine coder
 
Join Date: Mar 2010
Location: Lost in a poorly sorted filesystem
Nature: Docile
I have recently got back into ROM hacking, and I am now working on a tool to make editing move animations slightly easier by "decompiling" it into some kind of pseudo-scripting 'language'. So far, it seems to work "ok", for instance, fly seems to be parsed nicely:
Code:
load ac 27;
load 97 27;
2waybranch f71f2d08 0f202d08;
wait;

However, It seems to "break" very easily, as evident by this move (Vine whip):
Code:
load 2f 28;
sound 8f 0;
execute 28fe578 2 2;
delay 0;
nop;
load 4 6;
sound 9b 0;
execute e828598 82 2;
load 0 0;
load 4 6;
unknown2 d152d8 2 5;
load 2 0;
load 0 6;
load 1 0;
it mainly has trouble with 0x02, and 0x03. It may be due to me miscounting the number of arguments it uses. Can someone tell me the number of arguments these "commands" accept? Or a way of "splitting" these commands? Any help will be appreciated and thank you for your time.
__________________
<Insert content here>
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
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 05:08 PM.