• 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.

Research: Exploring Ruby and Emerald

Agastya

Grinding failed. Item Grind level dropped by 3.
73
Posts
14
Years
  • Age 33
  • Seen Mar 19, 2023
I think I figured out opposing Contest trainers in Emerald. They're spread across a master list stored at 0x5880A4 and follow a relatively sane table format for all entries. This is the format itself, using the first entry in the table as an example:

1E 01 | Pokemon Species

CA C9 C9 BD C2 D3 FF 00 00 00 00 | Pokemon nickname

C4 C3 C7 C7 D3 FF 00 00| Trainer name

07 00 00 | Trainer Sprite (Based on OW sprite #, if you really wanted you could put Rayquaza or Steven in the hall)

FF | No idea, static across all entries
0F | No idea, but occasionally is 8F 4F 2F or 1F in some entries. Once an entry becomes 8F, it decreases to previous until 0F
00 | Still no idea. It occasionally goes to 80 and then counts down to 40 20 10 8 4 2 1, and after a loop or two of this the previous bite begins to count down.
0C | More unknown stuff.

44 | Contests eligible. This is a bitfield:

1: This Pokemon appears in Super-rank contests
2: This Pokemon appears in Hyper-rank contests
* If you do not assign either 1 or 2, the Pokemon will appear in Normal-rank contests.
* If you assign both 1 and 2, the Pokemon will appear in Master-rank contests.

4: This Pokemon appears in Coolness contests
8: This Pokemon appears in Beauty contests
10: This Pokemon appears in Cuteness contests
20: This Pokemon appears in Smartness contests
40: This Pokemon appears in Toughness contests

You can mix and match 4~40 as you see fit.

00 | ???

2E 00 2C 00 24 00 50 01 | Moveset

0A | Cool rating
04 | Beauty rating
0A | Cute rating
03 | Smart rating
04 | Tough rating
32 | "Sheen" rating (how full it is)

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | Padding?
FF FF 00 00 | More padding?

The unknown bytes are mostly irrelevant considering everything else interesting is covered in the known ones.
Carry on, friends.
 

Tlachtli

Crit happens.
267
Posts
12
Years
Ok, I'm back with more cleaned-up versions of my Fairy move animations. These are all for Emerald BPEE. Animated gifs may come later, when I'm not feeling lazy :P

Dazzling Gleam:
Spoiler:


Disarming Voice:
Spoiler:


Draining Kiss:
Spoiler:


Fairy Wind:
Spoiler:


Moonblast:
Spoiler:


Play Rough:
Spoiler:
 
180
Posts
10
Years
  • Age 34
  • Seen Jan 10, 2017
So I've been trying to implement the Fairy-type into Emerald using the tutorials at Pokecommunity. I've seen that some other Emerald hackers have implemented the fairy type in emerald, but nobody has shared the details on how they did it.

I found that there was a patch as well, however, that patch replaced the ??? type which ruins Struggle (making struggle a normal-type move is not a good solution as it gets type disadvantage against Steel and Rock etc.)

Sorry if I don't give credit to the stuff I list here below, but a lot of different people seem to have found a lot of different things (such as Emerald offsets), none of these things are found by me. I just try to put all the stuff together and make sense out of it.

So ideally, I wanted to create a new Fairy type without replacing the contest types or the ??? type. Simply put, a new type. The only thing that I am struggling with is the Icon, everything else works perfectly fine. Thus, this post will focus on the icon. Name and effectiveness table tutorials can be found in the tutorial section of this forum.

The types are numbered in hex from 00 - 11 (Starts with Normal and ends with Dark). 12 - 16 are the contest types. Currently, I have placed my Fairy type at 14 which replaces Cute. However, I would like to place it at some other position where it does not replace anything.

Method 1
Deleted, I mixed the normal type icons up with the TM icons.

Method 2
This second method involved replacing one of the contest types, so I decided to replace Cute since it had similar background colour to Fairy.

So, I went to NSE and offset D971B0, which holds this picture:
Spoiler:


I changed Cute to Fairy, indexed the picture, and put it in empty space using HxD. However, no matter what I did, I couldn't get the right colour. I went through every single Palette in UNLZ and tried to use the VBA Palette view combine with APE to search for the right Palette, but I couldn't find it. Thus, the picture I added would always be in black and white.

So, my issue is that I have created the Fairy type but I am forced to call it "Cute" which is kind of lame. If anyone has done this entire process before, I would like to ask a couple of questions.

1. Did anyone find the Emerald offset for a location table similar to the one in Fire Red, which enables you to add more status icons? If there is such table, I guess you could just expand it and add a Fairy icon on spot 17 (after Tough).

2. If my only choice is to replace Cute, does anyone know how to get the right colours for the Icons after adding it into free space? I guess you'll have to repoint a Palette, but at what offset is that Palette?

Any help with this is appreciated, I've spent way too many hours trying to figure this out.

EDIT: Ok, just found this:
Not exactly R&D, but a useful image I found:
In Emerald BPEE, the uncompressed type images used for TMs/HMs (different from the ones used on the Poke info page) are found at 0xDC4378 and use the palette at 0xDC4338.

Potentially useful if you're adding new types to a hack and want to make TMs with moves of those types. The Power/Type/PP images are on there too, if you want to change how those look.

So I guess, in my Method 1, I was mixing up with TM/HM icons with the Type icons. My questions for method 2 are still valid though.
 
Last edited:
89
Posts
10
Years
The palette for R/S/E is different. For Ruby, it is at E726EB, but because the type palette seems to be spread out over many different palettes, I don't think we can edit the palette. The type image uses 256++ colors, so we can't get the right palette.
 
252
Posts
11
Years
  • Age 27
  • Seen Jul 6, 2019
The palette for R/S/E is different. For Ruby, it is at E726EB, but because the type palette seems to be spread out over many different palettes, I don't think we can edit the palette. The type image uses 256++ colors, so we can't get the right palette.
Are you sure you have the right offset? Because I opened a Ruby rom on NSE 2.x, and I'm getting this:
ScreenShot05-16-14at1206AM_zps040a229e.png

And I thought the image was 16 colors, not 256 colors. Why would the palette be 256 colors?
 
180
Posts
10
Years
  • Age 34
  • Seen Jan 10, 2017
If we can't edit the palette, how do people manage to insert the Fairy type and all other type images with their correct colours? I've seen a bunch of hacks with that function but I'm not sure how to get the colours right.
 

Agastya

Grinding failed. Item Grind level dropped by 3.
73
Posts
14
Years
  • Age 33
  • Seen Mar 19, 2023
The palette for R/S/E is different. For Ruby, it is at E726EB, but because the type palette seems to be spread out over many different palettes, I don't think we can edit the palette. The type image uses 256++ colors, so we can't get the right palette.
There are three different palettes that can be edited separately iirc, editing one palette won't change the colors for another palette.

that patch replaced the ??? type which ruins Struggle (making struggle a normal-type move is not a good solution as it gets type disadvantage against Steel and Rock etc.)
Struggle ignores the type chart entirely. It's not ??? type, the game doesn't think it's ??? type.
 
Last edited:
180
Posts
10
Years
  • Age 34
  • Seen Jan 10, 2017
For Pokemon Emerald:

If you add a move such as Flare Blitz or Scald with an effect that defrosts a Pokemon when used, it will say "XXX was defrosted by Fire Move/Water Move" instead of "XXX was defrosted by Flare Blitz/Scald".

To fix this, change offset 14EF4A to 00 00 00 00 00 00.
 

Le pug

Creator of Pokémon: Discovery / Fat Kid
870
Posts
10
Years
Going to be trying to port Jambo's FR asm for the Class Based Trainer Battle Music to Emerald.

Here is the thread: http://www.pokecommunity.com/showthread.php?t=293704

Here is his asm:
Spoiler:

I'm not good with asm at all lol and this will probably take me ages so if anyone wants to help .. would be great.
 
1,323
Posts
16
Years
  • Seen Dec 9, 2023
I've worked out how to have the Gen IV Roost effect in Emerald. This is how it is achieved:
1. First, in the battle script for Recover, it checks if the move ID is Roost (by having Recover's script, the AI can use Roost properly). If the move ID is Roost, then it branches to a near identical script that also calls a custom routine
2. The custom routine checks if the attacking Pokémon has Flying type in either of its slots and then changes it to the ??? type (0x9). If it's a pure Flying type, then it will become a pure ??? type.
3. Another custom routine is run at the end of every turn that checks for any ???-type Pokémon, and changes it back to Flying.

Here's how to implement it:
1. First, you need Jambo51's callasm routine for Battle Script Pro. It is found right here. Despite Jambo writing the routine for FireRed, it works for Emerald too. However, you need to change the "scriptlocation" offset to 0x02024214. Also this is very important, but unlike FireRed, your new command is not going to be 0xF8! Your new command will be 0xF9. It appears that Emerald has an extra battle command, most likely due to the Battle Frontier.

2. Now to get BSP to recognize our new command, open up the folder where BSP is located, and then there should be another folder called "Data". Then you should see a file called, "commands.bsh". Open it up with Notepad, and put this in:
#command callasm 0xF9 0x1 "Offset of routine" 0x4
This might be confusing, but DO NOT change anything in the quotation marks! That's just there to show minor info in BSP's command list. I repeat, DO NOT CHANGE A SINGLE THING IN THAT QUOTE!!! Also note that if you were using FireRed, your command would be 0xF8, not 0xF9.

3. Now, put in this routine somewhere:
Code:
.text
.align 2
.thumb
.thumb_func

/*What this routine does is check if the attacking PKMN
is Flying-type. It then changes its Flying-type to
the ???-type.*/

GetPkmnType1:
push {r0-r5}
ldr r1, .BattleData
ldr r0, .CurPokeIndex
ldrb r0, [r0]
mov r2, #0x58
mul r2, r0
add r1, #0x21
add r1, r2
ldrb r0, [r1]
ldrb r2, [r1, #0x1]
mov r3, #0x2
cmp r0, r3
beq ChangeType1
cmp r2, r3
beq ChangeType2
b End

ChangeType1:
mov r4, #0x9
strb r4, [r1]
cmp r2, r3
beq ChangeType2
b End

ChangeType2:
mov r4, #0x9
strb r4, [r1, #0x1]
b End

End:
pop {r0-r5}
bx lr

.align 2
.BattleData:        .word 0x02024084
.CurPokeIndex:        .word 0x0202420B

4. Now open up BSP, and open up Recover's battle script. Replace it with this:
#dynamic 0x9C5CE0
#freespacebyte 0xFF

#org @start
jumpifhalfword 0x0 0x20241EA 0x163 @RoostHandle
attackcanceler
attackstring
ppreduce
setdamageasrestorehalfmaxhp @full 0x1
attackanimation
waitanimation
orword 0x2024280 0x100
graphicalhpupdate 0x1
datahpupdate 0x1
printstring 0x4B
waitmessage 0x40
goto @finish

#org @full
pause 0x20
printstring 0x4C
waitmessage 0x40
goto @finish

#org @finish
setbyte 0x2024488 0x0
cmd49 0x0 0x0
end

#org @RoostHandle
attackcanceler
attackstring
ppreduce
setdamageasrestorehalfmaxhp @fullroost 0x1
attackanimation
waitanimation
orword 0x2024280 0x100
graphicalhpupdate 0x1
datahpupdate 0x1
printstring 0x4B
waitmessage 0x40
jumpiftype2 0x1 0x2 @changetype
goto @finishroost

#org @fullroost
pause 0x20
printstring 0x4C
waitmessage 0x40
goto @finishroost

#org @changetype
callasm 0x(offset of your routine +1)
goto @finishroost

#org @finishroost
setbyte 0x2024488 0x0
cmd49 0x0 0x0
end
A couple things to note: At the top, we have "jumpifhalfword 0x0 0x20241EA 0x163 @RoostHandle".
Replace 0x163 with your move ID for Roost.

Towards the bottom, at "#org @changetype", you see "callasm 0x(offset of your routine +1)". Obviously, put in the offset of the routine we added earlier, but add 0x1 to the offset.

So far, we have made it so that every time a Flying-type Pokémon uses Roost, it will turn into a ???-type. (If it was part-Flying, it would become part-???, and if it was pure-Flying, it would become pure-???).

5. Now we're going to insert another routine. This second routine will be called at the end of every turn and simply checks to see if there are any ???-type Pokémon, and then changes them back to Flying types.
Code:
.text
.align 2
.thumb
.thumb_func

HandlePoke1:
push {r0-r5}
mov r3, #0x9
ldr r1, .Poke1Type
ldrb r0, [r1]
ldrb r2, [r1, #0x1]
cmp r0, r3
beq Poke1ChangeType1
cmp r2, r3
beq Poke1ChangeType2
b HandlePoke2

Poke1ChangeType1:
mov r4, #0x2
strb r4, [r1]
cmp r2, r3
beq Poke1ChangeType2
b HandlePoke2

Poke1ChangeType2:
mov r4, #0x2
strb r4, [r1, #0x1]
b HandlePoke2

HandlePoke2:
ldr r1, .Poke2Type
ldrb r0, [r1]
ldrb r2, [r1, #0x1]
cmp r0, r3
beq Poke2ChangeType1
cmp r2, r3
beq Poke2ChangeType2
b HandlePoke3

Poke2ChangeType1:
mov r4, #0x2
strb r4, [r1]
cmp r2, r3
beq Poke2ChangeType2
b HandlePoke3

Poke2ChangeType2:
mov r4, #0x2
strb r4, [r1, #0x1]
b HandlePoke3

HandlePoke3:
ldr r1, .Poke3Type
ldrb r0, [r1]
ldrb r2, [r1, #0x1]
cmp r0, r3
beq Poke3ChangeType1
cmp r2, r3
beq Poke3ChangeType2
b HandlePoke4

Poke3ChangeType1:
mov r4, #0x2
strb r4, [r1]
cmp r2, r3
beq Poke3ChangeType2
b HandlePoke4

Poke3ChangeType2:
mov r4, #0x2
strb r4, [r1, #0x1]
b HandlePoke4

HandlePoke4:
ldr r1, .Poke4Type
ldrb r0, [r1]
ldrb r2, [r1, #0x1]
cmp r0, r3
beq Poke4ChangeType1
cmp r2, r3
beq Poke4ChangeType2
b End

Poke4ChangeType1:
mov r4, #0x2
strb r4, [r1]
cmp r2, r3
beq Poke4ChangeType2
b End

Poke4ChangeType2:
mov r4, #0x2
strb r4, [r1, #0x1]
b End

End:
pop {r0-r5}
ldr r0, .ReturnAddress
bx r0


.align 2
.Poke1Type: .word 0x020240A5
.Poke2Type: .word 0x020240FD
.Poke3Type: .word 0x02024155
.Poke4Type: .word 0x020241AD
.ReturnAddress:	.word 0x080405B1

6. At 0x402A0, change the bytes there to point to where you inserted the second routine (the one right above). DO NOT ADD +1 TO THE OFFSET. I REPEAT, DO NOT ADD +1. This is because the code that is executed before this appears to already account for that.

And now we have a fully working Roost with Generation IV's effect, and the AI can use it properly too, since we're using Recover's battle script slot, but the battle script is designed so that Recover will still function separately from Roost.

A couple things to note, this routine replicates the Generation IV effect of Roost where if the user was pure-Flying, it would become ??? type upon using Roost. In Generation V+, a pure-Flying type using Roost would become Normal-type.. If anyone wants to mod my routine to have the Generation V effect, feel free to do so.

Credits:
Chaos Rush
DoesntKnowHowToPlay - for the idea of the method to achieve this
Shiny Quagsire - for suggesting to me that Emerald might have more battle commands than FireRed due to the Battle Frontier
Tchlatli - I looked at his custom Protean code to figure out how to correctly calculate the type offset of the attacking Pokémon
JPAN - his documentation on FireRed battle-related RAM offsets helped me find the Emerald offsets

To verify that it's working properly, here are some useful RAM offsets:
02024084 - Battle Data (check out this post to see how its structured.)

020240A5 - Your(1) Type 1
020240A6 - Your(1) Type 2

020240FD - Opponent(1) Type 1
020240FE - Opponent(1) Type 2

02024155 - Your(2) Type 1
02024156 - Your(2) Type 2

020241AD - Opponent(2) Type 1
020241AE - Opponent(2) Type 2
 
Last edited:

LCCoolJ95

Limited Capacity
638
Posts
14
Years
I did some research into TM extension in Emerald. It seems that the TMs are located at 616040. When I looked at the data, they were two bytes long each. It was a move IDs, in hex, FLIPPED. I used a Pokémon Ruby Gameshark Codes listing to prove it (Here's the link: http://www.ign.com/faqs/2004/pokemon-battle-e-gameshark-sp-codes-list-541208). For example, the move ID for Focus Punch, or or Fighting Punch as the rough Japanese to English translation, in hex would be 108. However, within the TM Data,
it is actually 08 01. It just flipped the first number, 01, with the two other numbers, 08.

The TMs in hex are:
Spoiler:


But what about the HMs? They follow right after:
Spoiler:


I asked someone about this, and they stated that, no matter what, if the move IDs (in hex) are added BEFORE the HM data, this would be the beginning of the expansion of TMs in the game. HMs, however, will always be the last 8 move IDs (in hex).

Here, I just did an example of doing this process, using an expanded moves table:
Spoiler:


If you compare it to the original, there are an extra 50 TMs added. Now, I just need to know how to make the legitimate TM item work. If someone were to look into that, that would be awesome.
 
Last edited:
91
Posts
14
Years
  • Seen Feb 22, 2023
But aren't the compatabilities stored in boolean arrays which are 8 bytes long? Therefore you are limited to a maximum of 64 TMs/HMs. Just a quick thought, maybe I just forgot something.

~SBird
 
180
Posts
10
Years
  • Age 34
  • Seen Jan 10, 2017
I've worked out how to have the Gen IV Roost effect in Emerald.

I did all the steps in the process. Recover works as normal but my game freezes when a Flying types uses Roost to heal up.

My Steps:
callasm routine:
1. Moved the table from 31BD10 (starts with FD5F0408) - 31C0F3 (ends with F96E0508) to the location EF7000. Replaced all 10BD3108 to 0070EF08.

2. Copy/Pasted the first routine Jambo posted in his thread, changed the scriptlocation to 02024214 and put it at EF7400

3. Added a pointer at the end of my new table after F96E0508 which is 0074EF08 (tried 0174EF08 here, too. Neither worked. Not sure which to use).

4. Went to notepad, added your command in those exact word in commands.bsh (It's the only text in this entire notepad, everything else is empty)

5. Copy/Pasted the routine you posted first, put in note pad, thumb, and then placed at offset EF7450.

6. Opened battle script pro. My Roost is at spot 398 so I changed the first row to 0x18E @RoostHandle.
Also changed callasm 0x(offest here) to 0xEF7451 (since offset of routine was EF7451)

7. Notepad, thumb, put in your last routine at EF74A0. Changed 0x402A0 to A074EF08.

8. Gave roost attack animation and edited it properly in PGE.

It seems to be a problem with the callasm as Roost heals the pokemon, the text that it is heals comes up, and then it just stops.
 
Last edited:
1,323
Posts
16
Years
  • Seen Dec 9, 2023
I did all the steps in the process. Recover works as normal but my game freezes when a Flying types uses Roost to heal up.

My Steps:
callasm routine:
1. Moved the table from 31BD10 (starts with FD5F0408) - 31C0F3 (ends with F96E0508) to the location EF7000. Replaced all 10BD3108 to 0070EF08.

2. Copy/Pasted the first routine Jambo posted in his thread, changed the scriptlocation to 02024241 and put it at EF7400

3. Added a pointer at the end of my new table after F96E0508 which is 0074EF08 (tried 0174EF08 here, too. Neither worked. Not sure which to use).

4. Went to notepad, added your command in those exact word in commands.bsh (It's the only text in this entire notepad, everything else is empty)

5. Copy/Pasted the routine you posted first, put in note pad, thumb, and then placed at offset EF7450.

6. Opened battle script pro. My Roost is at spot 398 so I changed the first row to 0x18E @RoostHandle.
Also changed callasm 0x(offest here) to 0xEF7451 (since offset of routine was EF7451)

7. Notepad, thumb, put in your last routine at EF74A0. Changed 0x402A0 to A074EF08.

8. Gave roost attack animation and edited it properly in PGE.

It seems to be a problem with the callasm as Roost heals the pokemon, the text that it is heals comes up, and then it just stops.
At step 2, you said you changed scriptlocation to 02024241. Maybe you made a typo there, but it should be 02024214.

For step 3, the pointer you add at the end of the table is the offset of the callasm routine+1. (Notice how the rest of the offsets in that table are NOT 4-byte aligned)

I'm not at home right now so I can't check if I missed anything, but I do have it working properly on my ROM with any of the four Pokémon in battle using it. I'll check it more thoroughly when I get home if it's still not working for you.

Also make 100% sure you're not getting the two routines mixed up - they're near identical; the first one is called by the battle script to change any instance of Flying type into ??? type, and the second one is called at the end of every turn to change any instance of ??? type into Flying type.
 
Last edited:
180
Posts
10
Years
  • Age 34
  • Seen Jan 10, 2017
I got it to work!

This part:

#org @changetype
callasm 0xEF7451
goto @finishroost

compiled into

51 74 EF 00

When I looked at it in a HEX editor, so I just changed the 00 to 08 manually in HxD.

I guess I had to put it like:
#org @changetype
callasm 0x8EF7451
goto @finishroost

Pretty simple and stupid mistake that cost me a lot of time. Anyway, thank you very much for taking your time looking into it, I appreciate it a lot.
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
I got it to work!

This part:

#org @changetype
callasm 0xEF7451
goto @finishroost

compiled into

51 74 EF 00

When I looked at it in a HEX editor, so I just changed the 00 to 08 manually in HxD.

I guess I had to put it like:
#org @changetype
callasm 0x8EF7451
goto @finishroost

Pretty simple and stupid mistake that cost me a lot of time. Anyway, thank you very much for taking your time looking into it, I appreciate it a lot.

Yes, that would definitely be an issue there, because you can technically use callasm to access RAM locations as well, so having that 08 in there is a must to identify exactly where in the GBA's memory map the routine is. That said, congrats on getting it to work!
 
1,323
Posts
16
Years
  • Seen Dec 9, 2023
Turns out there was a problem with the 2nd routine in my Roost method, as it would only change Pokémon Slot 1's type, since I forgot to take into account that the variable that controls what Pokémon is currently attacking (which is used by the routine to determine the correct type offset of the attacking Pokémon) is reset to 0. So replace the 2nd routine with this instead:
Code:
.text
.align 2
.thumb
.thumb_func

HandlePoke1:
push {r0-r5}
mov r3, #0x9
ldr r1, .Poke1Type
ldrb r0, [r1]
ldrb r2, [r1, #0x1]
cmp r0, r3
beq Poke1ChangeType1
cmp r2, r3
beq Poke1ChangeType2
b HandlePoke2

Poke1ChangeType1:
mov r4, #0x2
strb r4, [r1]
cmp r2, r3
beq Poke1ChangeType2
b HandlePoke2

Poke1ChangeType2:
mov r4, #0x2
strb r4, [r1, #0x1]
b HandlePoke2

HandlePoke2:
ldr r1, .Poke2Type
ldrb r0, [r1]
ldrb r2, [r1, #0x1]
cmp r0, r3
beq Poke2ChangeType1
cmp r2, r3
beq Poke2ChangeType2
b HandlePoke3

Poke2ChangeType1:
mov r4, #0x2
strb r4, [r1]
cmp r2, r3
beq Poke2ChangeType2
b HandlePoke3

Poke2ChangeType2:
mov r4, #0x2
strb r4, [r1, #0x1]
b HandlePoke3

HandlePoke3:
ldr r1, .Poke3Type
ldrb r0, [r1]
ldrb r2, [r1, #0x1]
cmp r0, r3
beq Poke3ChangeType1
cmp r2, r3
beq Poke3ChangeType2
b HandlePoke4

Poke3ChangeType1:
mov r4, #0x2
strb r4, [r1]
cmp r2, r3
beq Poke3ChangeType2
b HandlePoke4

Poke3ChangeType2:
mov r4, #0x2
strb r4, [r1, #0x1]
b HandlePoke4

HandlePoke4:
ldr r1, .Poke4Type
ldrb r0, [r1]
ldrb r2, [r1, #0x1]
cmp r0, r3
beq Poke4ChangeType1
cmp r2, r3
beq Poke4ChangeType2
b End

Poke4ChangeType1:
mov r4, #0x2
strb r4, [r1]
cmp r2, r3
beq Poke4ChangeType2
b End

Poke4ChangeType2:
mov r4, #0x2
strb r4, [r1, #0x1]
b End

End:
pop {r0-r5}
ldr r0, .ReturnAddress
bx r0


.align 2
.Poke1Type: .word 0x020240A5
.Poke2Type: .word 0x020240FD
.Poke3Type: .word 0x02024155
.Poke4Type: .word 0x020241AD
.ReturnAddress:	.word 0x080405B1
I've edited the original post to reflect this as well, and I have also tested this extensively and made sure it works when any of the four Pokémon slots in battle (remember, in a double battle there are four Pokémon at once) use Roost. This routine will be called at the end of every turn and will actually check all four Pokémon in battle to see if they have attained the ??? type and then changes them back to Flying-type.

Again, sorry about that. I have edited the original post to have the fixed routine.

To verify that everything is working properly, here are some RAM offsets:
020240A5 - Your(1) Type 1
020240A6 - Your(1) Type 2

020240FD - Opponent(1) Type 1
020240FE - Opponent(1) Type 2

02024155 - Your(2) Type 1
02024156 - Your(2) Type 2

020241AD - Opponent(2) Type 1
020241AE - Opponent(2) Type 2
 
89
Posts
10
Years
@HidoranBlaze, here are some more Emerald animation commands:
Animated Psychic background: 0E D1 7C 2D 08
Animated Flying background : 0E E5 7C 2D 08
High power background :0E E9 A1 2C 08
Colored background: 02 74 72 59 08 02 05 01 00 SS 00 00 00 II 00 CC CC 05
Clear color background: 02 74 72 59 08 02 05 01 00 SS 00 00 00 II 00 CC CC 05 0B 03 0D
SS refers to speed at which the background becomes color CC CC, and II refers to the intensity at which the color overlays the battle field.
Also, Chaos Rush, exactly what problem did Ruby Pokédex Expansion run into? And what was the game breaking glitch that your Ruby Physical/Special Split patch had? I tried it out, and as far as I am aware there appears to be no problems.
 
1,323
Posts
16
Years
  • Seen Dec 9, 2023
Also, Chaos Rush, exactly what problem did Ruby Pokédex Expansion run into?
As SBird and Jambo51 would tell you, expanding the Pokédex is pretty much impossible on Ruby due to how it was coded and compiled. I don't know much about how bad Ruby's coding was, but SBird confirmed that Emerald's Pokédex uses a malloc system (unlike Ruby), similar to FireRed's (but not exactly the same), but both are completely different from Ruby/Sapphire in which the pointers are hard-coded and are impossible to find.

And what was the game breaking glitch that your Ruby Physical/Special Split patch had? I tried it out, and as far as I am aware there appears to be no problems.
That was Darthatron's first method of the split (that I simply found the Ruby offsets for). Here's what Jambo51 said about it (I can confirm that these glitches occur in the Ruby port, too):
I've spotted what could potentially be a huge bug in the FR version of the hack. I'm not 100% certain exactly what it actually breaks, but it breaks something.
I can confirm that it completely breaks the functionality of Blaze, Torrent, Overgrow and probably (although I have yet to see the check itself) Swarm. It also breaks some sort of check which would normally halve the amount of damage dealt for certain types of attack under certain circumstances.

To see evidence for yourself, go to 0x3F102. You will see there are a bunch of type based checks, which read the category byte kept in R9. Under normal circumstances, the game will check the type, and if it matches, will branch link to 0x19F18, passing 0xE in R0, 0x0 in R1, 0x0 in R2 and a changeable byte (seems to depend on the type) in R3. What this checks and returns, I do not know.

However, due to the split changes implemented, none of these checks ever pass, and as such, whatever this piece of functionality is, as well as the abilities named above, simply do not work.

I hate to be that guy, but I don't see any point in hacking Ruby anymore. As Shiny Quagsire mentioned earlier, Ruby/Sapphire were compiled using Nintendo's first AGB compilers (and the source code itself wasn't as optimized as FR/LG and Emerald), and as a result Ruby's coding is just a mess. Why not hack Emerald? Emerald has everything Ruby has plus more. I know people say that a lot, but it's true and you can't really argue with that.

For Emerald, DoesntKnowHowToPlay has made a perfect Physical/Special split patch found here: http://s7.zetaboards.com/Nuzlocke_Forum/topic/8679031/1 (if the link doesn't work or something just try this: http://www.mediafire.com/download/ipcjia5b778zj8o/PhysSpecSplitEM1.4.ips) It works flawlessly and does not have any of the problems associated with Darthatron's method.

To add to that, Tlachtli has made a flawless Physical/Special icon method for Emerald. I have tried it out myself and it works beautifully: http://www.pokecommunity.com/showpost.php?p=8217520&postcount=237

Don't like Emerald's animations? Then disable them: http://www.pokecommunity.com/showthread.php?p=8209204#post8209204

And lastly, don't like the color green? That's no longer a problem: http://www.pokecommunity.com/showpost.php?p=8210772&postcount=295

At this point, I honestly don't see why anyone would hack Ruby over Emerald. Reading Shiny Quagsire's post alone about why Ruby/Sapphire's coding is screwed was enough to convince me to be done with Ruby hacking. And not to mention, thanks to him we can disable animations now and have Pokémon sprites behave exactly as they do in R/S and FR/LG, Doesnt has made a perfect physical/special split patch for Emerald, Tlachtli has made a perfect physical/special icon implementation, and SBird freaking expanded the Pokédex on Emerald (which I then ported to the English ROM), at this point there's just no point at all in hacking Ruby.
 
Last edited:
Back
Top