The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development
Sign Up Rules/FAQ Live Battle 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!
Research & Development programs in this forum are subject to moderator approval before they are displayed.


Advertise here

Reply
 
Thread Tools
  #1    
Old May 25th, 2012, 04:25 PM
Alex's Avatar
Alex
Community Supporter
 
Join Date: Nov 2009
Location: Antarctica
Age: 16
Gender: Male
Nature: Adamant
Send a message via Skype™ to Alex

Advertise here
This project is for collecting and compiling all of the raws used in standard scripts, movement sequences, and possibly text sequences (if applicable) for Ruby/Sapphire, FireRed/LeafGreen, and Emerald. All of the raws will be compiled into a standards-compliant XML sheet which could be used for implementation into ROM editing tools later on, and if not it can just be read as text in Notepad++ or whatever for reference. The scripting part of the XML contains the command's hex value, what it does, and a byte syntax formula; the movement-bytes section of the reference sheet contains the command's hex value and how it acts when executed; the text-sequence portion of the sheet hasn't been implemented yet (debatable).

I've found a lot of the values for R/S myself, but there is still a big amount of them I haven't discovered:
Identified script command bytes: 53 out of [assumedly] 255 (~21% complete)
Identified movement-sequence command bytes: 131 out of [assumedly] 255 (~51% complete)

I have the so-far-incomplete XML sheet for Ruby and Sapphire in the code below.
Code:
<?xml version="1.0" encoding="ISO-8859-1"?> <cat name="standardCommands" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.alextherose.ws/hexref.xsd"> <!-- Standard script command list ordered by command byte --> <!-- For vars, number of curly brackets used = number of bytes occupied --> <cmd hex="0x02" def="end script" syn=""/> <cmd hex="0x03" def="return to parent script" syn=""/> <cmd hex="0x04" def="calls another script for execution" syn="04 {{{{script-ptr}}}}"/> <cmd hex="0x05" def="Jumps to offset via pointer" syn="05 {{{{jump-ptr}}}}" /> <cmd hex="0x06" def="Checks two values stored by preceeding command, then jumps to ptr" syn="06 {type} {{{{jump-ptr}}}}"/> <cmd hex="0x09" use="callstd" syn="09 {byte}"/> <cmd hex="0x16" def="Sets variable with numerical value" syn="16 {{var}} {{val}}"/> <cmd hex="0x17" def="Adds two vars together" syn="17 {{var1}} {{var2}}"/> <cmd hex="0x18" def="Subtract one var from another var" syn="18 {{var1}} {{var2}}"/> <cmd hex="0x19" def="Copies value of one var to another var" syn="19 {{from}} {{to}}"/> <cmd hex="0x1A" def="Copies var if not zero" syn="1A {{from}} {{to}}"/> <cmd hex="0x1B" def="Compares values of two vars" syn="1B {{var1}} {{var2}}"/> <cmd hex="0x21" def="Compares two 16-bit integers" syn="21 {{num1}} {{num2}}"/> <cmd hex="0x25" def="Special command" syn="25 {{subcmd-id}}"/> <cmd hex="0x27" def="Waits for Special/Special2 command to finish" syn=""/> <cmd hex="0x28" def="Pauses script for fixed time; 0x20 ~ 1 sec" syn="28 {{time}}"/> <cmd hex="0x29" def="Sets flag to on pos" syn="29 {{flag-id}}"/> <cmd hex="0x2A" def="Clears flag to off pos" syn="2A {{flag-id}}"/> <cmd hex="0x2B" def="Checks on/off pos of flag" syn="2B {{flag-id}}"/> <cmd hex="0x30" def="Initiates Pokemon cry" syn="30 {{pkmn-id}} "/> <cmd hex="0x33" def="Play audio sequence from music banks" syn="33 {{trackid}} 00"/> <cmd hex="0x39" def="Warps player to a warp event or x/y coordinates" syn="39 {{bank}} {{map}} [1;{{warp}}|FF] {{x-pos*}} {{y-pos*}}"/> <!-- * = Only if [1] is 0xFF --> <cmd hex="0x43" def="Counts Pokemon in party and stores value in var 0x800D"/> <cmd hex="0x45" def="Removes one or more items of same id from bag" syn="45 {{item-id}} {{amt}}"/> <cmd hex="0x47" def="Checks existence of item in bag" syn="47 {{item-id}} {{amt}}"/> <cmd hex="0x4A" def="Checks existence of item in PC" syn="4A {{item-id}} {{amt}}"/> <cmd hex="0x4F" def="Apply movement to person evt" syn="4F {{evt-id}} {{{{movedata}}}}"/> <cmd hex="0x51" def="Pause script until current commands finish" syn="51 00 00"/> <cmd hex="0x53" def="Makes person evt disappear from map" syn="53 {{evt-id}}"/> <cmd hex="0x55" def="Makes person evt reappear on map" syn="55 {{evt-id}}"/> <cmd hex="0x57" def="Moves person evt to location instantly" syn="57 {{evt-id}} {{x-pos}} {{y-pos}}"/> <cmd hex="0x5A" def="Forces person evt to face towards player" syn=""/> <cmd hex="0x5C" def="Initiates trainer battle" syn="5C {type} {{t-id}} 00 00 {{{{intromsg-ptr}}}} {{{{defeatmsg-ptr*}}}} {{{{continuescr-ptr**}}}}"/> <!-- * = Only if {type} is 0x0 or 0x1 --><!-- ** = Only if {type} = 0x1 --> <cmd hex="0x66" def="Shows message invoked by 0x67" syn=""/> <cmd hex="0x67" def="Display text from offset" syn="67 {{{{textdata}}}}"/> <cmd hex="0x68" def="Closes message invoked by 0x66 or 0x67 commands" syn=""/> <cmd hex="0x69" def="Locks all person evts on map in place" syn=""/> <cmd hex="0x6A" def="Locks in place person evt being interacted with" syn="" /> <cmd hex="0x6B" def="Unlocks all person evts on map" syn=""/> <cmd hex="0x6C" def="Unlocks from place person evt being interacted with" syn=""/> <cmd hex="0x6D" def="Waits for player to press a button to continue" syn=""/> <cmd hex="0x79" def="Adds one Pokemon to party; must be followed by a valid 0x7D cmd" syn="79 {{pkmn-id}} {level} {{item-id}} 00 00 00 00 00 00 00 00 00"/> <cmd hex="0x7A" def="Gives player 1 egg" syn="7A {{pkmn-id}}"/> <cmd hex="0x7D" def="Stores Pokemon created by cmd 0x79 in party" syn="7D 00 {{pkmn-id}}"/> <cmd hex="0x86" def="Displays PokeMart data from offset" syn="86 {{{{martdata}}}}"/> <cmd hex="0x8F" def="Picks random number between 0x00 and specified number and stores in 0x800D" syn="8F {{num}}"/> <cmd hex="0x97" def="Fade screen to/from black/white" syn="97 {fadetype}"/> <cmd hex="0xA0" def="Checks player gender and stores value in 0x800D" syn=""/> <cmd hex="0xA2" def="Sets map tiles and/or movement permissions until reloaded" syn="A2 {{x-pos}} {{y-pos}} {{tileno}} {{passable}}"/> <cmd hex="0xA3" def="resets weather conditions to default value in map header" syn=""/> <cmd hex="0xA4" def="Sets weather type to be initiated by cmd 0xA5; see A-Map for weather vals" syn="A4 {weather-id}"/> <cmd hex="0xA5" def="Activates weather code set by cmd cmd 0xA4" syn=""/> <cmd hex="0xB6" def="Initiates wild Pokemon battle" syn="B6 {{poke-id}} {level} {{item-id}}"/> <cmd hex="0xC5" def="Waits for cry command to finish playing" syn=""/> </cat> <cat name="commandOptionBytes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.alextherose.ws/hexref.xsd"> <!-- Command byte value options (for specific commands) --> <op cmd="0x06"> <!-- Compare byte options for if-then-jump command --> <val var="type" hex="0x00" def="<"/> <val var="type" hex="0x01" def="=="/> <val var="type" hex="0x02" def=">"/> <val var="type" hex="0x03" def="<="/> <val var="type" hex="0x04" def=">="/> <val var="type" hex="0x05" def="!="/> </op> <op cmd="0x09"> <!-- Message types for 2nd byte of callstd --> <val var="byte" hex="0x00" def="MSG OBTAIN"/> <val var="byte" hex="0x01" def="MSG FIND"/> <val var="byte" hex="0x02" def="MSG STANDARD"/> <val var="byte" hex="0x03" def="MSG SIGN"/> <val var="byte" hex="0x04" def="MSG NOCLOSE"/> <val var="byte" hex="0x05" def="MSG YESNO"/> <val var="byte" hex="0x06" def="MSG NORMAL"/> </op> <op cmd="0x5C"> <!-- Options for trainerbattle command --> <val var="type" hex="0x00" def="Normal trainer battle"/> <val var="type" hex="0x01" def="Normal w/ scr continuation"/> <val var="type" hex="0x03" def="Normal w/o defeat scr"/> </op> <op cmd="0x97"> <!-- Types of screen fades for 2nd byte of fadescreen --> <val var="fadetype" hex="0x0" def="Black to normal"/> <val var="fadetype" hex="0x1" def="Normal to black"/> <val var="fadetype" hex="0x2" def="White to normal"/> <val var="fadetype" hex="0x3" def="Normal to white"/> </op> <op cmd="0xA2"> <val var="passable" hex="0x0" def="Passable"/> <val ver="passable" hex="0x1" def="Not passable"/> </op> </cat> <cat name="movementCodes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.alextherose.ws/hexref.xsd"> <!-- List of move bytes for Ruby/Sapphire --> <!-- Commented "?" indicates duplicate questionability --> <m hex="0x00" name="Face down"/> <m hex="0x01" name="Face up"/> <m hex="0x02" name="Face left"/> <m hex="0x03" name="Face right"/> <m hex="0x04" name="Step down (0.5x)"/> <m hex="0x05" name="Step up (0.5x)"/> <m hex="0x06" name="Step left (0.5x)"/> <m hex="0x07" name="Step right (0.5x)"/> <m hex="0x08" name="Step down (1x)"/> <m hex="0x09" name="Step up (1x)"/> <m hex="0x0A" name="Step left (1x)"/> <m hex="0x0B" name="Step right (1x)"/> <m hex="0x0C" name="Jump ledge 2 (down)"/> <m hex="0x0D" name="Jump ledge 2 (up)"/> <m hex="0x0E" name="Jump ledge 2 (left)"/> <m hex="0x0F" name="Jump ledge 2 (right)"/> <m hex="0x10" name="Pause #1"/> <m hex="0x11" name="Pause #2"/> <m hex="0x12" name="Pause #3"/> <m hex="0x13" name="Pause #4"/> <m hex="0x14" name="Pause #5"/> <m hex="0x15" name="Step down (2x)"/> <m hex="0x16" name="Step up (2x)"/> <m hex="0x17" name="Step left (2x)"/> <m hex="0x18" name="Step right (2x)"/> <m hex="0x19" name="Step on-the-spot (down) (0.5x)"/> <m hex="0x1A" name="Step on-the-spot (up) (0.5x)"/> <m hex="0x1B" name="Step on-the-spot (left) (0.5x)"/> <m hex="0x1C" name="Step on-the-spot (right) (0.5x)"/> <m hex="0x1D" name="Step on-the-spot (down) (1x)"/> <m hex="0x1E" name="Step on-the-spot (up) (1x)"/> <m hex="0x1F" name="Step on-the-spot (left) (1x)"/> <m hex="0x20" name="Step on-the-spot (right) (1x)"/> <m hex="0x21" name="Step on-the-spot (down) (2x)"/> <m hex="0x22" name="Step on-the-spot (up) (2x)"/> <m hex="0x23" name="Step on-the-spot (left) (2x)"/> <m hex="0x24" name="Step on-the-spot (right) (2x)"/> <m hex="0x25" name="Step on-the-spot (down) (4x)"/> <m hex="0x26" name="Step on-the-spot (up) (4x)"/> <m hex="0x27" name="Step on-the-spot (left) (4x)"/> <m hex="0x28" name="Step on-the-spot (right) (4x)"/> <m hex="0x29" name="Slide down (0.5x)"/> <m hex="0x2A" name="Slide up (0.5x)"/> <m hex="0x2B" name="Slide left (0.5x)"/> <m hex="0x2C" name="Slide right (0.5x)"/> <m hex="0x2D" name="Slide down (1x)"/> <m hex="0x2E" name="Slide up (1x)"/> <m hex="0x2F" name="Slide left (1x)"/> <m hex="0x30" name="Slide right (1x)"/> <m hex="0x31" name="Slide down (2x)"/> <m hex="0x32" name="Slide up (2x)"/> <m hex="0x33" name="Slide left (2x)"/> <m hex="0x34" name="Slide right (2x)"/> <m hex="0x35" name="Slide down (running)"/> <m hex="0x36" name="Slide up (running)"/> <m hex="0x37" name="Slide left (running)"/> <m hex="0x38" name="Slide right (running)"/> <m hex="0x3A" name="Jump facing left (down)"/> <m hex="0x3B" name="Jump facing down (up)"/> <m hex="0x3C" name="Jump facing up (left)"/> <m hex="0x3D" name="Jump facing left (right)"/> <m hex="0x3E" name="Face towards player"/> <m hex="0x3F" name="Face away from player"/> <m hex="0x40" name="Lock sprite-facing"/> <m hex="0x41" name="Release sprite-facing"/> <m hex="0x42" name="Jump ledge (down)"/> <m hex="0x43" name="Jump ledge (up)"/> <m hex="0x44" name="Jump ledge (left)"/> <m hex="0x45" name="Jump ledge (right)"/> <m hex="0x46" name="Jump on-the-spot (facing down)"/> <m hex="0x47" name="Jump on-the-spot (facing up"/> <m hex="0x48" name="Jump on-the-spot (facing left)"/> <m hex="0x49" name="Jump on-the-spot (facing right)"/> <m hex="0x4A" name="Jump on-the-spot (facing down/up)"/> <m hex="0x4B" name="Jump on-the-spot (facing up/down)"/> <m hex="0x4C" name="Jump on-the-spot (facing left/right)"/> <m hex="0x4D" name="Jump on-the-spot (facing right/left)"/> <m hex="0x4E" name="Face left"/> <!--?--> <m hex="0x54" name="Hide sprite"/> <m hex="0x55" name="Show sprite"/> <m hex="0x56" name="Exclamation mark bubble"/> <m hex="0x57" name="Question mark bubble"/> <m hex="0x58" name="Heart bubble"/> <m hex="0x62" name="Walk down"/> <!--?--> <m hex="0x63" name="Walk down"/> <!--?--> <m hex="0x64" name="Face down (delayed)"/> <m hex="0x65" name="Face up (delayed)"/> <m hex="0x66" name="Face left (delayed)"/> <m hex="0x67" name="Face right (delayed)"/> <m hex="0x70" name="Jump on-the-spot (facing down)"/> <!--?--> <m hex="0x71" name="Jump on-the-spot (facing up)"/> <!--?--> <m hex="0x72" name="Jump on-the-spot (facing left)"/> <!--?--> <m hex="0x73" name="Jump on-the-spot (facing right)"/> <!--?--> <m hex="0x74" name="Jump down (running)"/> <m hex="0x75" name="Jump up (running)"/> <m hex="0x76" name="Jump left (running)"/> <m hex="0x77" name="Jump right (running)"/> <m hex="0x78" name="Jump down 2 (running)"/> <m hex="0x79" name="Jump up 2 (running)"/> <m hex="0x7A" name="Jump left 2 (running)"/> <m hex="0x7B" name="Jump right 2 (running)"/> <m hex="0x7C" name="Walk on-the-spot (down)"/> <!--?--> <m hex="0x7D" name="Walk on-the-spot (up)"/> <!--?--> <m hex="0x7E" name="Walk on-the-spot (left)"/> <!--?--> <m hex="0x7F" name="Walk on-the-spot (right)"/> <!--?--> <m hex="0x80" name="Slide down (running)"/> <!--?--> <m hex="0x81" name="Slide up (running)"/> <!--?--> <m hex="0x82" name="Slide left (running)"/> <!--?--> <m hex="0x83" name="Slide right (running)"/> <!--?--> <m hex="0x84" name="Slide down"/> <!--?--> <m hex="0x85" name="Slide up"/> <!--?--> <m hex="0x86" name="Slide left"/> <!--?--> <m hex="0x87" name="Slide right"/> <!--?--> <m hex="0x88" name="Slide down on left foot"/> <m hex="0x89" name="Slide up on left foot"/> <m hex="0x8A" name="Slide left on left foot"/> <m hex="0x8B" name="Slide right on feft foot"/> <m hex="0x8C" name="Slide left diagonally (facing up)"/> <m hex="0x8D" name="Slide right diagonally (facing up)"/> <m hex="0x8E" name="Slide left diagonally (facing down)"/> <m hex="0x8F" name="Slide right diagonally (facing down)"/> <m hex="0x90" name="Slide left diagonally 2 (facing up)"/> <m hex="0x91" name="Slide right diagonally 2 (facing up)"/> <m hex="0x92" name="Slide left diagonally 2 (facing down)"/> <m hex="0x93" name="Slide right diagonally 2 (facing down)"/> <m hex="0x96" name="Walk left"/> <!--?--> <m hex="0x97" name="Walk right"/> <!--?--> <m hex="0x98" name="Levitate"/> <m hex="0x99" name="Stop levitating"/> <m hex="0x9C" name="Zoom up vertically"/> <m hex="0x9D" name="Disembark"/> <m hex="0xFE" name="End movement sequence"/> </cat>
(There is a copy of this code in an attachment below)

The XML schema for all sheets of this project is already set up and saved to my domain for ease of access. Thus, the xsi:noNamespaceSchemaLocation attribute inside <cat> elements generally shouldn't be modified.

If you spot an error, don't hesitate to point it out. If you've found any raws that aren't in the document yet, please share them with the project.
Attached Files
File Type: xml hexref.xml‎ (13.0 KB, 9 views) (Save to Dropbox)
Reply With Quote
  #2    
Old May 28th, 2012, 07:41 AM
Gamer2020's Avatar
Gamer2020
This love is a sickness...
 
Join Date: Jun 2008
Location: Violet city!
Gender: Male
Nature: Bold
Send a message via AIM to Gamer2020 Send a message via Windows Live Messenger to Gamer2020 Send a message via Yahoo to Gamer2020 Send a message via Skype™ to Gamer2020
Open XSE and press F1... That's all you need to do really...
__________________
Pokemon Game Editor Download!
Reply With Quote
  #3    
Old May 28th, 2012, 08:27 PM
Alex's Avatar
Alex
Community Supporter
 
Join Date: Nov 2009
Location: Antarctica
Age: 16
Gender: Male
Nature: Adamant
Send a message via Skype™ to Alex
Some people prefer other script editors over XSE (surprisingly), and even those who have and/or use it might not want to have to drag it out to check what bytes do what, for instance with scripting in hex.

Besides, I'm not one of those people that like to credit people for things (kinda makes me look unoriginal), so I don't plan on taking what HackMew has built up.
Reply With Quote
  #4    
Old May 29th, 2012, 07:20 AM
tinix's Avatar
tinix
PearlShipper & C Programmer
 
Join Date: Feb 2010
Location: Bratislava, Slovakia
Age: 17
Gender: Male
I have all raws (command list) exported from XSE somewhere, if you want them i can upload them
__________________
Pokémon games i own:
Pokémon Diamond
Pokémon Platinum
Pokémon Ranger: Shadows of Almia
Pokémon HeartGold Version

75% of Pokemon gamers use cheats and specially made codes to make their pokemon battle-worthy. If you are one of the 25% percent that level their Pokemon up legally, put this in your signature.
-Started by SkittyLover77



Last edited by tinix; May 29th, 2012 at 07:26 AM.
Reply With Quote
  #5    
Old May 29th, 2012, 07:28 AM
Spherical Ice's Avatar
Spherical Ice
Community Supporter
 
Join Date: Nov 2007
Location: UK
Send a message via Skype™ to Spherical Ice
Quote:
Originally Posted by AlexTheRose View Post
Some people prefer other script editors over XSE (surprisingly), and even those who have and/or use it might not want to have to drag it out to check what bytes do what, for instance with scripting in hex.

Besides, I'm not one of those people that like to credit people for things (kinda makes me look unoriginal), so I don't plan on taking what HackMew has built up.
To be fair, XSE tells you what hex code the command is, how many bytes it needs, how many parameters are needed and everything. Sorry! D:
Reply With Quote
  #6    
Old May 29th, 2012, 10:00 AM
droomph's Avatar
droomph
mmm gurl that 90s
Community Supporter
 
Join Date: Sep 2011
Location: bar'jách
Age: 17
Gender: Male
Nature: Impish
@Spherical Um but commands like lighten and darken really need to be explained more (and commands like setpokepp are wrong in their explanation) and here's a great way to explain to everyone what commands like that do.

Besides I find the layout in XSE to be messy so here's a chance for him to start changing that trend.
__________________
did u no there r 21 letters in the alphabet
o i forgot 5
uraqt


Reply With Quote
  #7    
Old May 30th, 2012, 05:58 AM
tinix's Avatar
tinix
PearlShipper & C Programmer
 
Join Date: Feb 2010
Location: Bratislava, Slovakia
Age: 17
Gender: Male
Here are exported XSE commands in text and binary form. Use them if you want to.
Attached Files
File Type: zip Commands.zip‎ (13.6 KB, 13 views) (Save to Dropbox)
__________________
Pokémon games i own:
Pokémon Diamond
Pokémon Platinum
Pokémon Ranger: Shadows of Almia
Pokémon HeartGold Version

75% of Pokemon gamers use cheats and specially made codes to make their pokemon battle-worthy. If you are one of the 25% percent that level their Pokemon up legally, put this in your signature.
-Started by SkittyLover77


Reply With Quote
Reply
Quick Reply

Sponsored Links


Advertise here
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 03:50 AM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 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 generated content remains the property of its creator.