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

Code: Port of the BW2 Repel system to GBA...

44
Posts
12
Years
  • Seen Feb 16, 2018
I have a problem too it's extremely weird, I got the script to show up but when I select the yes option it resets
 
62
Posts
9
Years
  • Age 33
  • Seen Jul 2, 2023
Does anyone have some sort of UPS file with this feature that i could patch on to my Emerald rom? I'm not really good with hex and i understand literally none of this. Could anyone help me out here?
 
51
Posts
9
Years
  • Age 38
  • Seen Dec 20, 2022
I warn you better to use this tutorial. I found a way better without hacking the bagroutine this badly to expand the repel. You just have to take a look on JPANs dokomentation and understand how it works. I just give one tip, write a script with setvar 0x4020 0xA and Repel will work 10 Steps. With this information you just need to insert your routine before the repel expires.
And this is defently better than mess up the hole bag-system.

.. Well why not share what you know? If you're going to claim that this way is wrong and there is a better way, why not share it here?


Does anyone have some sort of UPS file with this feature that i could patch on to my Emerald rom? I'm not really good with hex and i understand literally none of this. Could anyone help me out here?


This is for Fire Red like most things, it hasn't been ported to Emerald (yet).
 
51
Posts
9
Years
  • Age 38
  • Seen Dec 20, 2022
Haha fair enough. Personally I am wanting to start looking into porting some of these things to emerald, I'm glad that you posted before I started doing a lot of work on this for nothing. I'd like to read some of that documentation, maybe it will be useful for opening up emerald like fire red is..
 
62
Posts
9
Years
  • Age 33
  • Seen Jul 2, 2023
.. Well why not share what you know? If you're going to claim that this way is wrong and there is a better way, why not share it here?





This is for Fire Red like most things, it hasn't been ported to Emerald (yet).


Well nonentheless, i could still use this for my FireRed rom so is there a ups for that?
 

EthanAG

Guest
0
Posts
There are quite a lot of steps the the overall after part is amazing! It would be nice if they had implemented this a lot earlier on like other people were saying.
 
62
Posts
9
Years
  • Age 33
  • Seen Jul 2, 2023
Sorry, sorry. I shall respect Darthatron's wishes and learn. Could anyone be willing to help me out?
 
51
Posts
9
Years
  • Age 38
  • Seen Dec 20, 2022
Sorry, sorry. I shall respect Darthatron's wishes and learn. Could anyone be willing to help me out?

Get hold of HxD hex editor. Its a nice user friendly hex editor to start with and to get you familiar with things. In the first post where it says this:
Code:
080830CA: 0C 48 EB F7 4C FA 01 06 00 29 16 D0 41 1E 0C 06 0D 0A 07 48 EB F7 51 FA 00 2C 0E D1 03 4C 25 80 05 48 E6 F7 FA FC 01 20 08 E0 30 AD 03 02
08083119: 06
080A19A5: 06
080A19F6: 1C
080A19F8: 11
080A19FC: 0F
080A1A0E: 21 88 09 02 41 40
080A1A1E: 34 4B 28 21 71 43 5B 18 D9 79 30 1C 02 22 17 4B FF F7 49 FB C7 F7 85 FF 70 BD 20 40 00 00 FF FF 00 00 30 AD 03 02
080A1A5A: 00 00 00 00
080A1A68: 00 00 00 00
081BFB66: 00 00 00 B5 04 48 50 21 00 F0 01 F8 00 BD 00 4A 10 47 1D 74 07 08 99 19 0A 08 00 00 00 00 00 00
I'll take the first line as an example.
080830CA is an offset in the rom. At the top of HxD click search to open a drop down menu and choose goto (or just press Crtl+G), then in the box that opens enter that offset. You will immediately jump to that position in the rom. Lets read the first line again. It gives you the offset and then a bunch of hex numbers. You need to enter these numbers right where you were taken to with goto, exactly where the cursor is, enter those values, overwriting the existing ones. You can also copy and paste with Ctrl+B (don't use Ctrl+V as this will increase the rom size).

Next offset is 08083119. Use goto or Ctrl+G to get to that offset in the rom. Do the same thing, overwrite all the bytes. Do this for all of these entries.

Then you compile that script that was provided taking note of its offset as Darthatron says. Xse will give you the option to copy this offset, do it and paste it somewhere.

On the final step you have to replace a pointer at 08083100. Once again use goto in HxD to get to that address. Look at the first four bytes that you see. It will be ?? ?? ?? 08. I'm not sure what the exact values will be but that fourth byte should be '08'. That means it is a pointer. Take the pointer that you copied from Xse earlier and reverse it. For eg. if your pointer was 01 02 03, you must make it 03 02 01. Enter these values where I put '??' so that at 08083100 your values will be 03 02 01 08 (or whatever your offset is).
I hope this helps you :)
 
62
Posts
9
Years
  • Age 33
  • Seen Jul 2, 2023
Get hold of HxD hex editor. Its a nice user friendly hex editor to start with and to get you familiar with things. In the first post where it says this:
Code:
080830CA: 0C 48 EB F7 4C FA 01 06 00 29 16 D0 41 1E 0C 06 0D 0A 07 48 EB F7 51 FA 00 2C 0E D1 03 4C 25 80 05 48 E6 F7 FA FC 01 20 08 E0 30 AD 03 02
08083119: 06
080A19A5: 06
080A19F6: 1C
080A19F8: 11
080A19FC: 0F
080A1A0E: 21 88 09 02 41 40
080A1A1E: 34 4B 28 21 71 43 5B 18 D9 79 30 1C 02 22 17 4B FF F7 49 FB C7 F7 85 FF 70 BD 20 40 00 00 FF FF 00 00 30 AD 03 02
080A1A5A: 00 00 00 00
080A1A68: 00 00 00 00
081BFB66: 00 00 00 B5 04 48 50 21 00 F0 01 F8 00 BD 00 4A 10 47 1D 74 07 08 99 19 0A 08 00 00 00 00 00 00
I'll take the first line as an example.
080830CA is an offset in the rom. At the top of HxD click search to open a drop down menu and choose goto (or just press Crtl+G), then in the box that opens enter that offset. You will immediately jump to that position in the rom. Lets read the first line again. It gives you the offset and then a bunch of hex numbers. You need to enter these numbers right where you were taken to with goto, exactly where the cursor is, enter those values, overwriting the existing ones. You can also copy and paste with Ctrl+B (don't use Ctrl+V as this will increase the rom size).

Next offset is 08083119. Use goto or Ctrl+G to get to that offset in the rom. Do the same thing, overwrite all the bytes. Do this for all of these entries.

Then you compile that script that was provided taking note of its offset as Darthatron says. Xse will give you the option to copy this offset, do it and paste it somewhere.

On the final step you have to replace a pointer at 08083100. Once again use goto in HxD to get to that address. Look at the first four bytes that you see. It will be ?? ?? ?? 08. I'm not sure what the exact values will be but that fourth byte should be '08'. That means it is a pointer. Take the pointer that you copied from Xse earlier and reverse it. For eg. if your pointer was 01 02 03, you must make it 03 02 01. Enter these values where I put '??' so that at 08083100 your values will be 03 02 01 08 (or whatever your offset is).
I hope this helps you :)

I tried to goto the offset as you directed but it brings up an error message

Capture4.PNG
 
51
Posts
9
Years
  • Age 38
  • Seen Dec 20, 2022
My apologies, remove the first '08' from the front of your pointer and it should work. That 08 has to do with the location in the rom as a game, hxd is not a rom editor.
 
62
Posts
9
Years
  • Age 33
  • Seen Jul 2, 2023
My apologies, remove the first '08' from the front of your pointer and it should work. That 08 has to do with the location in the rom as a game, hxd is not a rom editor.

Thanks. I added all of the bytes however, i'm not sure about the compiled script part. What should i do there because i'm confused.
 
51
Posts
9
Years
  • Age 38
  • Seen Dec 20, 2022
Thanks. I added all of the bytes however, i'm not sure about the compiled script part. What should i do there because i'm confused.

Well you could compile it with XSE, I suggest you download it and look through some of the tutorials on this site. But I see that a compiled version of the script has already been provided. So you're going to need HxD again. Where he says

"Here's a compiled version of the script for anyone having problems:"

You need to copy and paste these hex numbers into free space in your rom. Anywhere there are enough 'FF' bytes. There is a tool on this forum somewhere for finding free space but in this case it is such a small amount of bytes that we don't need it.

So once you've copied this into a FF byte area of your choice, put the cursor at the beginning of your new values. Look in the bottom left corner of HxD, that will tell you your current address in the rom. Write that number down somewhere.

Now for the final step go to 083100. Here you will need to enter that number that you wrote down earlier. However, it needs to reverse.
Just as an example, say your number was E01414. First, split it into bytes so that it looks like E0 14 14. Now put those in reverse order 14 14 E0.
Those are the numbers that you enter at 083100, your own numbers of course. Make sure the very next byte is '08'.

That should be it.
 
62
Posts
9
Years
  • Age 33
  • Seen Jul 2, 2023
Well you could compile it with XSE, I suggest you download it and look through some of the tutorials on this site. But I see that a compiled version of the script has already been provided. So you're going to need HxD again. Where he says

"Here's a compiled version of the script for anyone having problems:"

You need to copy and paste these hex numbers into free space in your rom. Anywhere there are enough 'FF' bytes. There is a tool on this forum somewhere for finding free space but in this case it is such a small amount of bytes that we don't need it.

So once you've copied this into a FF byte area of your choice, put the cursor at the beginning of your new values. Look in the bottom left corner of HxD, that will tell you your current address in the rom. Write that number down somewhere.

Now for the final step go to 083100. Here you will need to enter that number that you wrote down earlier. However, it needs to reverse.
Just as an example, say your number was E01414. First, split it into bytes so that it looks like E0 14 14. Now put those in reverse order 14 14 E0.
Those are the numbers that you enter at 083100, your own numbers of course. Make sure the very next byte is '08'.

That should be it.


Thank you so much. I've now taken a step further into ROM Hacking.
 
51
Posts
9
Years
  • Age 38
  • Seen Dec 20, 2022
I'm glad I could help translate it lol. Now that you've done this, it'll come more naturally every time :)
 
7
Posts
9
Years
  • Age 28
  • Seen Jan 28, 2019
Well you could compile it with XSE, I suggest you download it and look through some of the tutorials on this site. But I see that a compiled version of the script has already been provided. So you're going to need HxD again. Where he says

"Here's a compiled version of the script for anyone having problems:"

You need to copy and paste these hex numbers into free space in your rom. Anywhere there are enough 'FF' bytes. There is a tool on this forum somewhere for finding free space but in this case it is such a small amount of bytes that we don't need it.

So once you've copied this into a FF byte area of your choice, put the cursor at the beginning of your new values. Look in the bottom left corner of HxD, that will tell you your current address in the rom. Write that number down somewhere.

Now for the final step go to 083100. Here you will need to enter that number that you wrote down earlier. However, it needs to reverse.
Just as an example, say your number was E01414. First, split it into bytes so that it looks like E0 14 14. Now put those in reverse order 14 14 E0.
Those are the numbers that you enter at 083100, your own numbers of course. Make sure the very next byte is '08'.

That should be it.

I've done this several times with different offsets and even with a clear rom, but it won't work! When repel runs out, it'll flash a text box with nothing written on it for less that a second. That's all that happens.

EDIT: I was using Ctrl+V instead of Ctrl+B on HxD.

Update: I changed all the bytes and added the compiled part and then repointed, but now repel will run off and nothing will happen. I also have no idea what I'm doing wrong, can somebody help? :(

I've tried using a clear rom, but it doesn't work. Clearly something I'm doing is wrong.

EDIT: Now I've done it! I feel like a million bucks for figuring this out! Hahaha. For some odd reason, the compiled code that the OP provided didn't work at all, but compiling the script with XSE did. I've also learned how to use XSE, which is pretty cool. If you're reading this, don't forget that you also have to change the pointer located at 083100 on a Hex Editor. Anyway, thanks for the sweet code! :P
 
Last edited:
5
Posts
13
Years
  • Seen Sep 19, 2014
Hi. Please don't close this thread/ban/warn me for reviving something this old. I'm a newbie to ROM-Hacking, and I'm pretty sure I followed all of the instructions properly, however, after taking 100 steps, it doesn't ask me if I want to use another nor that it expired. Please respond ASAP. Thanks in advance.

(P.S.) By "doesn't work" I mean another multichoice box shows up (actually 2 of them), instead of the expected Yes/No with the message thing.

EDIT: IMAGES -(IMGUR.COM)
/ahxTU0z (1st Image; note the small multichoice box on the lower right hand corner)
/tjrODMw (2nd Image; the second screen of the multichoice, opened right after selecting any of the two options from the first)
/cQZUDLt (3rd Image; reuse of repel after exiting multichoice boxes, eternal freeze)
 
Last edited:

anonyboy

Pokemon Aerial Emerald Creator&Pokemon Hybrid Co-C
286
Posts
10
Years
Hi, i've tried to insert this system but after my repel maxes out instead of asking me for another one it prompts the slot machine game. what should i do?
 
Back
Top