• 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?".
  • Forum moderator applications are now open! Click here for details.
  • 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.

Pokéball hacking guide

476
Posts
6
Years
  • Age 23
  • Seen Feb 26, 2020
Altering the premier ball catch rate would be relatively simple. Its catch rate subroutine is the last entry in the table at 0802D54C. You would need to make a simple routine like so:

Spoiler:


In order to add your own custom ball you would have to go through the whole tutorial, with a catch rate function as above, except mov r4, #0x64.

Changing the catch rates of the others would require inserting an assembly routine wherever the catch rate calculation function checks for great ball, ultra ball, and safari ball.

By textures do you mean the throwing images? You can easily repoint them from the relevant tables from step four on the first page.

Hope this helps!

This is extremely helpful, however, I'm a total muggle with the scripting and stuff. All I have done thus far is edit stats/names/textures for Pokémon/moves. I'm not even sure if the offsets shown work across all gen 3 games (I'm performing my hack on Emerald, and didn't see any mention specifying what game was used in the tutorial)

About the scripts and such - how are they implemented and edited? I found a script editor a few weeks back but it didn't seem to have these Pokéball scripts anywhere.

With the textures, I mean the item textures and stuff for the actual Pokéballs themselves. Like, if I added an extra ball, and waned it to have its own texture, instead of what the ROM would defaul to (regardless of if it defaults to a regular ball,defaults to be invisible, or defualts to a placeholder texture like the (?) texture for empty Pokémon slots)

I know I'm a complete noob with this and more than likely am not qualified to do something so (seemingly) complex so early on, so thanks for your patience :)
 
Last edited:
239
Posts
8
Years
  • Age 31
  • Seen Nov 12, 2023
I would like someone to make a routine for Shiny Ball.

What it does? The caught Pokemon becomes shiny.

This would have to be a separate assembly or battle script routine that checks the ball ID where the pokemon is actually caught. I'm also not sure if messing with the personality ID would create a bad egg or not.

This is extremely helpful, however, I'm a total muggle with the scripting and stuff. All I have done thus far is edit stats/names/textures for Pokémon/moves. I'm not even sure if the offsets shown work across all gen 3 games (I'm performing my hack on Emerald, and didn't see any mention specifying what game was used in the tutorial)

About the scripts and such - how are they implemented and edited? I found a script editor a few weeks back but it didn't seem to have these Pokéball scripts anywhere.

With the textures, I mean the item textures and stuff for the actual Pokéballs themselves. Like, if I added an extra ball, and waned it to have its own texture, instead of what the ROM would defaul to (regardless of if it defaults to a regular ball,defaults to be invisible, or defualts to a placeholder texture like the (?) texture for empty Pokémon slots)

I know I'm a complete noob with this and more than likely am not qualified to do something so (seemingly) complex so early on, so thanks for your patience :)

Unfortunately this is for Fire Red. This engine has expanded the pokeballs, you would probably get better answers about relevant offsets there.

In general, though, if you expand the number of pokeballs, you would have to expand the image and palette tables as well and either insert your own graphics or simply copy existing images/palettes for your expanded pokeball entries, if that makes sense.
 
476
Posts
6
Years
  • Age 23
  • Seen Feb 26, 2020
This would have to be a separate assembly or battle script routine that checks the ball ID where the pokemon is actually caught. I'm also not sure if messing with the personality ID would create a bad egg or not.



Unfortunately this is for Fire Red. This engine has expanded the pokeballs, you would probably get better answers about relevant offsets there.

In general, though, if you expand the number of pokeballs, you would have to expand the image and palette tables as well and either insert your own graphics or simply copy existing images/palettes for your expanded pokeball entries, if that makes sense.

Again, it makes complete sense, but I haven't found a sprite editor that can let me see the item textures. Unless NSE is just glitchy/I am blind, I haven't seen item textures editable.
 
239
Posts
8
Years
  • Age 31
  • Seen Nov 12, 2023
Again, it makes complete sense, but I haven't found a sprite editor that can let me see the item textures. Unless NSE is just glitchy/I am blind, I haven't seen item textures editable.

NSE can do it. You can make a new plugin with pointers to the relevant throwing graphics tables and respective image sizes. The images they should be 16x48. The readme file should have instructions about how to make your own plugin file
 
12
Posts
6
Years
Here is the Pidgey ball assembly code.
Basically, the catch rate is increased when the wild pokemon is Pidgey.

Can anyone check this code if it works?

Code :
Spoiler:


I just wanna test this code so I can make Beast ball for Sun & Moon hack in the future.

And a little bit confused on Step 4 part 3. Do I have to repoint all the table right there?

After I added a new ball, the others become this
HTsq72J.png


And when I throw the new ball, the game freezes at this screen
wioA9Kh.png


How can I fix this?
 
Last edited:

Delta231

A noob
681
Posts
7
Years
Here is the Pidgey ball assembly code.
Basically, the catch rate is increased when the wild pokemon is Pidgey.

Can anyone check this code if it works?

Code :
Spoiler:


I just wanna test this code so I can make Beast ball for Sun & Moon hack in the future.

And a little bit confused on Step 4 part 3. Do I have to repoint all the table right there?

After I added a new ball, the others become this
HTsq72J.png


And when I throw the new ball, the game freezes at this screen
wioA9Kh.png


How can I fix this?
Beat ball routine is done in the previous page.
 

Skeli

Lord of the Rings
300
Posts
9
Years
One very important thing that was forgotten in the tutorial is the table at 0x40C1C4. Each half-word (2 bytes) in this table corresponds to the palette the Pokemon is faded when it comes out of that certain Poke Ball. For instance, the first entry, 0x7ADF is the pink colour a Pokemon fades from when it leaves a Poke Ball. To repoint this table, copy 0x18 bytes to another location, replace the pointers, and add new colours on to the end of your table in the same order as your Poke Balls.

Also, some updated routines:

Nest Ball
Code:
.thumb
.global NestBall

.org 0x2D5AA
Main:
	ldr r0, .BattleData
	ldr r1, .TargetBank
	ldrb r1, [r1]
	mov r2, #0x58
	mul r1, r2
	add r0, r1
	ldrb r0, [r0]
	cmp r0, #36
	bge Normal
	sub r0, #0x1
	mov r1, #2
	mul r0, r1
	mov r4, #80
	sub r4, r0
	b 0x2D62A

Normal:
	mov r4, #10
	b 0x2D62A

.align 2
.BattleData: .word 0x2023BE4 + 0x2A
.TargetBank: .word 0x2023D6C

Timer Ball
Code:
.thumb
.global TimerBall

.org 0x2D608
TimerBall:
	ldr r4, .BattleTimer
	ldrb r4, [r4, #0x13]
	mov r1, #0x3
	mul r4, r1
	add r4, #10
	cmp r4, #40
	ble 0x2D62A
	mov r4, #0x40
	b 0x2D62A

.align 2
.BattleTimer: .word 0x3004F90
 
Last edited:
22
Posts
15
Years
  • Age 37
  • Seen Sep 15, 2021
So I've been working on Fire Red rom hacking for about a month now. I was confident I could at least give this a try; however I've hit a road block at even the first step! Dang; apparently there's still quite a bit I don't know about this.

So let's get into it. I open up a clean Fire Red 1.0 rom with a hex editor and guess what? Offset 0x080400B6 doesn't exist. What? Seriously, what's going on? Why is everyone just glazing past this obvious roadblock without issue?
 

Delta231

A noob
681
Posts
7
Years
So I've been working on Fire Red rom hacking for about a month now. I was confident I could at least give this a try; however I've hit a road block at even the first step! Dang; apparently there's still quite a bit I don't know about this.

So let's get into it. I open up a clean Fire Red 1.0 rom with a hex editor and guess what? Offset 0x080400B6 doesn't exist. What? Seriously, what's going on? Why is everyone just glazing past this obvious roadblock without issue?

Search `400B6` in your hex editor.
 
22
Posts
15
Years
  • Age 37
  • Seen Sep 15, 2021
Search `400B6` in your hex editor.

Done. Was I supposed to do something with it?

Okay, but seriously, the offset 0x400B6 does exist and its value is '40'. Not sure why that's relevant in this context, but there you go. Also, if I use the find function it actually is able to find the bytes 40 0B 60 in the rom at offset 0xBF1D0. Also not sure how that's relevant. Just in case, the bytes 04 00 B6 were also found at 0x2543BE. Could you tell me how these relate to the non-existent offsets mentioned in the OP?
 

Delta231

A noob
681
Posts
7
Years
Done. Was I supposed to do something with it?

Okay, but seriously, the offset 0x400B6 does exist and its value is '40'. Not sure why that's relevant in this context, but there you go. Also, if I use the find function it actually is able to find the bytes 40 0B 60 in the rom at offset 0xBF1D0. Also not sure how that's relevant. Just in case, the bytes 04 00 B6 were also found at 0x2543BE. Could you tell me how these relate to the non-existent offsets mentioned in the OP?


You have to change those values which are told in the OP. Hope you know how to use a hex editor.

And answering this

0x080400B6

0x means hex

80 is your ROM

400B6 is your address

To sum it up, we are finding an address which is present in our ROM.
 
22
Posts
15
Years
  • Age 37
  • Seen Sep 15, 2021
You have to change those values which are told in the OP. Hope you know how to use a hex editor.
...
To sum it up, we are finding an address which is present in our ROM.

Good. Good. Actually I knew that a prefix of 0x denoted hex: base-16 mathematics. I've been using hex for years and, yes, apparently I also know how to use a hex-editor. Go figure. Anyway, I was actually asking what the importance of these seemingly random assertions were in regard to what the goal is. I was not, in fact, asking for a basic explanation of something that I've known for years.

Let's get back to the issue at had: the OP states an offset that simply does not exist in vanilla Fire Red. Why is this acceptable and how are people just glazing over this? In an attempt to address my initial inquiry: what are the real offsets?

My apologies for any perceived snark, however past dialog has proven to be needlessly obstreperous and entirely misinterpreted. The need for precision and concision are paramount, apparently.
 
788
Posts
17
Years
  • Age 29
  • Seen yesterday
Good. Good. Actually I knew that a prefix of 0x denoted hex: base-16 mathematics. I've been using hex for years and, yes, apparently I also know how to use a hex-editor. Go figure. Anyway, I was actually asking what the importance of these seemingly random assertions were in regard to what the goal is. I was not, in fact, asking for a basic explanation of something that I've known for years.

Let's get back to the issue at had: the OP states an offset that simply does not exist in vanilla Fire Red. Why is this acceptable and how are people just glazing over this? In an attempt to address my initial inquiry: what are the real offsets?

My apologies for any perceived snark, however past dialog has proven to be needlessly obstreperous and entirely misinterpreted. The need for precision and concision are paramount, apparently.

Because it's not an offset, it's an address. The GBA memory maps the ROM starting at 0x08000000 (up to 0x09FFFFFF). Hex editors can only see the ROM, so you have to use offsets from the beginning of the ROM; 0x0000000 to 0x1FFFFFF.

If you need the offset and you have the address, subtract 0x08000000. If you need an address and have the offset, add 0x08000000.
 
Last edited:
22
Posts
15
Years
  • Age 37
  • Seen Sep 15, 2021
Because it's not an offset, it's an address. The GBA memory maps the ROM starting at 0x08000000 (up to 0x09FFFFFF). Hex editors can only see the ROM, so you have to use offsets from the beginning of the ROM; 0x0000000 to 0x1FFFFFF.

If you need the offset and you have the address, subtract 0x08000000. If you have an address and have the offset, add 0x08000000.
Thank you so much; this was exactly what I was looking for. I did the initial hex editing no problem, and now I realize his "tutorial" is simply way over my head, mostly due to its instructions being sparse and vague . Okay, no new balls I guess. Thank you so much for explaining the difference between offsets and this strange format I've never seen before; you're a life-saver.
 
476
Posts
6
Years
  • Age 23
  • Seen Feb 26, 2020
Because it's not an offset, it's an address. The GBA memory maps the ROM starting at 0x08000000 (up to 0x09FFFFFF). Hex editors can only see the ROM, so you have to use offsets from the beginning of the ROM; 0x0000000 to 0x1FFFFFF.

If you need the offset and you have the address, subtract 0x08000000. If you have an address and have the offset, add 0x08000000.

Holy f--k it makes sense now thank you
 
239
Posts
8
Years
  • Age 31
  • Seen Nov 12, 2023
Can we get the sport and/or dream ball routines?

Dream Ball:
Spoiler:


Sport Ball:
Spoiler:


This code will prevent the use of either if you are not in the correct map/bank
Spoiler:
 
476
Posts
6
Years
  • Age 23
  • Seen Feb 26, 2020
I'm not sure if I already mentioned it here, but what if I just want to change the catch rates? ie make Premier 1.5, Great 2, Safari 2.5, Ultra 5, Luxury 2, etc? I don't want to do any ASM if I don't have to - I just want to make PokéBalls more effective, since the ability to catch everything (P L U S Fakemon, of which I'll have plenty) is really important to the hack I'm working on.
 
239
Posts
8
Years
  • Age 31
  • Seen Nov 12, 2023
I'm not sure if I already mentioned it here, but what if I just want to change the catch rates? ie make Premier 1.5, Great 2, Safari 2.5, Ultra 5, Luxury 2, etc? I don't want to do any ASM if I don't have to - I just want to make PokéBalls more effective, since the ability to catch everything (P L U S Fakemon, of which I'll have plenty) is really important to the hack I'm working on.

The table at 0x250892 has the catch rates for ultra, great, poke, and safari, respectively. Luxury and Premier share a catch rate routine, but you can edit the catch rate multiplier at 0x2D5CA
 
476
Posts
6
Years
  • Age 23
  • Seen Feb 26, 2020
The table at 0x250892 has the catch rates for ultra, great, poke, and safari, respectively. Luxury and Premier share a catch rate routine, but you can edit the catch rate multiplier at 0x2D5CA

So, the bytes at that address are 14 0F 0A 0F 00 00 60 AE - To me, this looks like it's structured as "multiplier, end byte, multiplier, end byte, etc."

With pre existing knowledge that hex 14 is a value of 20, does that mean the multiplier is coded as 10x that of what it is in practice? Based on Ultra Ball's data, that's what it looks like, but then Great Ball hs a byte of 0A which is a value of 10, which would be 1, not 1.5. Based on how the Ultra Ball is coded, shouldn't Great be 0F instead f 0A? What would happen if I changed it to 0F? Not to mention that Poké and Safari Balls don't seem to have an ending byte. I'm certain there's something I'm missing, but I can't quite figure out what, so can you please clarify this before I accidentally corrupt my ROM? lol :3
 
Last edited:
239
Posts
8
Years
  • Age 31
  • Seen Nov 12, 2023
So, the bytes at that address are 14 0F 0A 0F 00 00 60 AE - To me, this looks like it's structured as "multiplier, end byte, multiplier, end byte, etc."

With pre existing knowledge that hex 14 is a value of 20, does that mean the multiplier is coded as 10x that of what it is in practice? Based on Ultra Ball's data, that's what it looks like, but then Great Ball hs a byte of 0A which is a value of 10, which would be 1, not 1.5. Based on how the Ultra Ball is coded, shouldn't Great be 0F instead f 0A? What would happen if I changed it to 0F? Not to mention that Poké and Safari Balls don't seem to have an ending byte. I'm certain there's something I'm missing, but I can't quite figure out what, so can you please clarify this before I accidentally corrupt my ROM? lol :3

The table is a byte per ball. so 0x14 = 20 = 2.0x catch rate for ultra, 0xF is 1.5x for Great, etc. It is multiplied by 10 because the total catch rate value is later divided by 10 to allow for non-integer catch rate values. So if you want to make ultra ball 3x, change the 0x14 to 0x1E. There is no terminating byte, the table cannot load from a ball index greater than 4 due to the function it is referenced from.
 
Back
Top