I have a request. I followed this tutorial to make two frame animations in fire red. the only issue is with trainers the animation starts right out of the ball and with wild pokemon it starts at the beggining of the encounter and doesnt show the animation because the pokemon is not in sight when it starts. Would it be possible to create two animation tables and insert an asm routine that sets the pointer at 0x2349BC to point to animation table 1 by default or table 2 if a var or flag is set? If no one has time to make a routine like this could someone at least tell me if it is possible?
I will say not to implement it because it takes a lot of storage in you rom.
If possible, I would like a battle routine that only allows you to use a maximum of 6 itmes throughout a battle(ignoring the pokeball bag). This would get rid of potion spamming! :)
Inherit Pokeball from Mother (Emerald)
So I'm learning asm and decided to see if I could implement passing down pokeballs like in 6th gen, and after a while I managed to make something that seems to work. Since this is basically my first go at writing asm feel free to point out better ways to do things and improve it.
There's is two parts to this, you have to give the egg its mother's pokeball and you have to keep the ball when it hatches. This is for Emerald only (Though I'm guessing it wouldn't be too hard to port to FR).
Give Egg Pokeball
How to insert:
Compile and put this into free space
and at 0x80713D4 write 00 48 00 47 XX XX XX 08
(where XX XX XX is the reverse hex pointer of where you put in the first piece of code +1)
and at 0x8071528 write 00 4A 10 47 XX XX XX 08
(where XX XX XX is the reverse hex pointer of where you put in the second piece of code +1)
How it works:
When hatching some data doesn't seem to be transferred to the pokemon, the type of ball being one. The first routine simply stores the ball type to 0x8000 while the second retrieves and gives it to the pokemon where before a normal pokeball was given.
The new version is here (no difference, but codes will be automatically inserted into the ROM): FIRERED:
EMERALD:
Read Readme.md to know how to compile.
Quick Preview:
The EV-IV display here looks fantastic! Unfortunately, I am unsure how to insert it into a ROM (Emerald).
The readme file says I need to have "Devkitarm" and "make" installed and that "armips v0.8/0.9" is required.
Mainly, I just have no clue what those programs are and how I would get them installed correctly in order to compile and insert this code into my ROM. I believe I MAY have Devkitarm installed (from using DizzyEgg's Emerald Battle Engine Upgrade), but I'm not sure about "make" nor "armips".
Any help on this would be absolutely appreciated, otherwise it seems I may have a lot of basic research on my hands before I'm able to include this in my ROM (which I'm also unsure of where to start).
Hi everyone. I was hoping someone could take a look at an asm routine and a script and tell me what i'm doing wrong. Here's the routine, originally made by FBI,
It is meant to rename the player from the overworld, but if the name is invalid (contains spaces), is sets 0x800D to 0x1. Everything works, except that last part. If I put a space in the name, it acts as if the name is valid and continues without changing the name.
Here is the script I wrote for it,
Spoiler:
#dynamic 0x800000
#org @main
lockall
callasm 0x825AB25
waitstate
compare 0x800D 0x1
if 0x1 call @invalid
msgbox @msg MSG_KEEPOPEN
closeonkeypress
releaseall
end
Hi everyone. I was hoping someone could take a look at an asm routine and a script and tell me what i'm doing wrong. Here's the routine, originally made by FBI,
It is meant to rename the player from the overworld, but if the name is invalid (contains spaces), is sets 0x800D to 0x1. Everything works, except that last part. If I put a space in the name, it acts as if the name is valid and continues without changing the name.
Here is the script I wrote for it,
Spoiler:
#dynamic 0x800000
#org @main
lockall
callasm 0x825AB25
waitstate
compare 0x800D 0x1
if 0x1 call @invalid
msgbox @msg MSG_KEEPOPEN
closeonkeypress
releaseall
end
#org @msginvalid
= The chosen name was invalid.\pPlease choose a valid name.
Is it something wrong with the routine or my script?
The validity check in the routine is very naive. It simply checks if the first character is a space, or no name was written. You'd have to do some sort of while loop or similar to validate spaces.
Code:
checkValidName:
ldr r0, =(0x300500C)
ldr r0, [r0]
ldrb r2, [r0]
cmp r2, #0xff
beq invalid
mov r1, #0x0
loop:
cmp r1, #0x13 @whatever max limit is for a name 0xff inclusive
beq done
add r0, r0, r1
ldrb r2, [r0]
cmp r2, #0x0
beq invalid
add r1, r1, #0x1
b loop
The validity check in the routine is very naive. It simply checks if the first character is a space, or no name was written. You'd have to do some sort of while loop or similar to validate spaces.
Code:
checkValidName:
ldr r0, =(0x300500C)
ldr r0, [r0]
ldrb r2, [r0]
cmp r2, #0xff
beq invalid
mov r1, #0x0
loop:
cmp r1, #0x13 @whatever max limit is for a name 0xff inclusive
beq done
add r0, r0, r1
ldrb r2, [r0]
cmp r2, #0x0
beq invalid
add r1, r1, #0x1
b loop
Something like that...
Sorry that's actually what I meant, I just worded it poorly. In the original routine, if I type just a space and no name, it acts as though it is valid and then keeps the name the character had before.
"The human sacrificed himself, to save the Pokemon. I pitted them against each other, but not until they set aside their differences did I see the true power they all share deep inside. I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are." -Mewtwo
Well, this took me longer than it should have lol. I initially just edited the wild Pokemon in RAM to have the moves I wanted, and used masterballs to capture it (i.e I didn't battle it).
Then I got a PP problem where the PP didn't match, so I wrote a routine to try and fix the PP problem. Then I talked to a friend on IRC, and he pointed out that I should make sure the Pokemon has the same moves in battle. Yeah, needless to say it didn't lol. So I ended up hacking the wild pokemon generator.
Where XX XX XX is the reverse hex pointer to where you inserted the previously compiled routine.
How to use:
Set var 0x8000 to 0x0 to disable.
Variables 0x8000 to 0x8003 are the 4 custom attacks you want inserted.
So to set the first attack of the wild Pokemon to firepunch, I would setvar 0x8000 0x7.
Here's a present :3
EDIT: Attacks must be between 0x0-0xFFFF
Just want to report that none of these is working.
Hey again everybody. I'm trying to get this code: https://github.com/jiangzhengwenjz/Double_wild_battle
Into my fire red game. Problem is the readme is having me install DevkitARM and Gnumake.. I I got a C in System Programing and can't for the life of me make this work. If anyone can help me I'd be grateful!
Hey again everybody. I'm trying to get this code: https://github.com/jiangzhengwenjz/Double_wild_battle
Into my fire red game. Problem is the readme is having me install DevkitARM and Gnumake.. I I got a C in System Programing and can't for the life of me make this work. If anyone can help me I'd be grateful!
You need those inorder to insert them. Remember use DevkitPro v45 not 47.
Thanks to DoesntKnowHowToPlay for the base routine which I slightly edited / optimised, and to Squeetz for making the routine into a form that can be applied as a patch.
So I've extracted both Gnumake and devkitARM v45. I have the double battle code extracted as well. I've read the readmes for all these files and they definitely don't assume i'm a beginner. Has anyone ever done this and wanna do a quick step-by-step? Thanks again.
Thanks to DoesntKnowHowToPlay for the base routine which I slightly edited / optimised, and to Squeetz for making the routine into a form that needs less proir hex editing to insert.
I like this idea, it looks great the pokedex .. when this list the routine you leave the explanation of how to insert it: D
I like this idea, it looks great the pokedex .. when this list the routine you leave the explanation of how to insert it: D
Type in the offset you wish to insert the routine at next to the .equ offset, 0x keyword in the .asm file. Save the .asm file, and then assemble it using a thumb assembler. Open the produced .bin file in a hex editor, along with your ROM. Go to each .org keyword in the routine, and copy the address beside it (for example, 10611E). Go to each of these addresses in both your ROM and .bin file, and copy the non-FF bytes from the .bin file to the same location as your ROM. Repeat this until you've made all of these changes. Then go to the offset you typed at the top of the routine, next to .equ offset, 0x, and, again, copy the bytes from the .bin file to your ROM. Save your changes, and test in game.
Type in the offset you wish to insert the routine at next to the .equ offset, 0x keyword in the .asm file. Save the .asm file, and then assemble it using a thumb assembler. Open the produced .bin file in a hex editor, along with your ROM. Go to each .org keyword in the routine, and copy the address beside it (for example, 10611E). Go to each of these addresses in both your ROM and .bin file, and copy the non-FF bytes from the .bin file to the same location as your ROM. Repeat this until you've made all of these changes. Then go to the offset you typed at the top of the routine, next to .equ offset, 0x, and, again, copy the bytes from the .bin file to your ROM. Save your changes, and test in game.
I hope that helps.
1.- Copy and paste the routine in a text editor.
2- On the line where it says ".equ offset, 0x" I put the address (in my case it is B00000)
3.- I keep the routine and name it as .asm (in my case, Dex.asm)
4.- I go to the thumb folder and I put my Dex.asm to Dex.bin
5.- Then I open with HxD a clean rom and the Dex.bin
.....
Until this step can I understand .. what should I do now? explain me with a little more detail and I hope I do not bother much ...
I have modified and enhanced azurile13's (credits and kudos to him) routine to make this supported on the Compiler's THUMB.bat. These are the things I modified:
Added routines creating the hooks that are to be copy-pasted on their respective locations. There are 11 hooks.
Added the master location of the routine in which the hooks will create locations for those routines. Insert your free space on .equ MyLoc. Format: 0x###### (Hexadecimal Number)
EDIT: I have tried to compile all these to my THUMB Assembler but I got no luck because the code is too many that the compiler can't manage to assemble lol. Is there anyway I can compile it? I tried CMD and what I always get is error... tried piece-by-piece assembly but still the compiler can't process it.
2- On the line where it says ".equ offset, 0x" I put the address (in my case it is B00000)
3.- I keep the routine and name it as .asm (in my case, Dex.asm)
4.- I go to the thumb folder and I put my Dex.asm to Dex.bin
5.- Then I open with HxD a clean rom and the Dex.bin
.....
Until this step can I understand .. what should I do now? explain me with a little more detail and I hope I do not bother much ...
Open your ROM (not a clean one, the one you actually want to insert it into) and Dex.bin in HxD.
Go to 0x10611E in both Dex.bin and your ROM, copy the bytes from Dex.bin, and paste them in your ROM.
Go to 0x106370 in both Dex.bin and your ROM, copy the bytes from Dex.bin, and paste them in your ROM.
Go to 0x106530 in both Dex.bin and your ROM, copy the bytes from Dex.bin, and paste them in your ROM.
Go to 0x452200 in both Dex.bin and your ROM, copy the bytes from Dex.bin, and paste them in your ROM.
Go to the address you put next to .equ offset, 0xB00000. in both Dex.bin and your ROM, copy the bytes from Dex.bin, and paste them in your ROM.
Save your ROM.
Open your ROM (not a clean one, the one you actually want to insert it into) and Dex.bin in HxD.
Go to 0x10611E in both Dex.bin and your ROM, copy the bytes from Dex.bin, and paste them in your ROM.
Go to 0x106370 in both Dex.bin and your ROM, copy the bytes from Dex.bin, and paste them in your ROM.
Go to 0x106530 in both Dex.bin and your ROM, copy the bytes from Dex.bin, and paste them in your ROM.
Go to 0x452200 in both Dex.bin and your ROM, copy the bytes from Dex.bin, and paste them in your ROM.
Go to the address you put next to .equ offset, 0xB00000. in both Dex.bin and your ROM, copy the bytes from Dex.bin, and paste them in your ROM.
Save your ROM.
Navegando en mi automóvil, hablando con la nena por el móvil 😎...
Join Date: Feb 2014
Location: Guatemala City
Age: 27
Gender:
Male
Nature: Brave
Posts: 521
I have a request. i'm not sure if that is possible or if it was already created, but. Is there a way to create a custom giveegg? I mean, I'd like to create an event that gives the player a Pokemon egg. and that egg will hatch with an specific shiny rate and custom moves. Like the Odd Egg you receive in GSC from the Day-care man that hatches knowing Dizzy Punch.
__________________
Graphic design is my passion...
Click on the picture to see the best hack ever created (?
I have a request that I'm pretty sure it's possible. I want a routine that modify the giveitem command (or something similar) in order to give the specified amount in a var of certain item. Example: The var 0x8000 is set to 3, then execute the giveitem command and it gives 3 items.
I have a request that I'm pretty sure it's possible. I want a routine that modify the giveitem command (or something similar) in order to give the specified amount in a var of certain item. Example: The var 0x8000 is set to 3, then execute the giveitem command and it gives 3 items.
I'm fairly certain the giveitem command lets you do this already, certainly just additem should. Just use the variable number in place of the value.
I'm not sure about the giveitem command... However the givemoney command does have this problem in which you cannot give a variable as the value. The game takes the value of the variable number not what the variable itself is pointing to. This is a problem for me also, and I was wondering if it is a problem ASM can solve.
I've been a bit on and off with rom hacking, but here's something I threw together recently:
Expanding Number of Buffers [FR]
Background info for those who are curious:
Spoiler:
The fdecoder function loads a ram or rom address from a table based on the byte following 0xFD in the string to display. There are 13 entries to this table (located at 0x08231e70) corresponding to buffers 00 through 0D. Buffer00 loads from 0x02022100, buffer01 loads the player name, buffers02-04 are the typical buffers used in scripts (eg. buffernumber), buffer06 is the rivlal's name, and buffers07 through buffer0D load a fixed string which hold useless names for ruby and sapphire (AQUA, MAGMA, etc).
This routine overwrites buffer07 through buffer0D, as they contain pointers to fixed strings corresponding to names in ruby and sapphire. This same feature could be achieved with a simple bufferstring, not that team aqua or magma show up in Fire Red anyways.
The following routine replaces the buffer table entries to store to/load from custom RAM, allowing the expanded usage of buffernumber, bufferstring, etc. You can also use ASM to buffer your own hex characters, but make sure the RAM ends with a 0xFF or else the game will load characters until it finds a 0xFF in the ram.
This hack requires the JPANs save block hack (I suppose you could use other free RAM outside of the save block area if you don't mind losing buffered values between saves)
It allows for up to 7 more buffer locations. Currently, there are 3 buffers of 4 bytes each and 4 buffers of 16 bytes each for numbers and strings, respectively. Feel free to change them, I tried to make the assembly routine easy to edit to accommodate various ram blocks. You can certainly buffer more than 4 characters into one of the 4-byte buffers, but it will overwrite anything else you have buffered afterwards. If you want to change the number of 4 vs. 16 byte buffers, just be sure to change the SetX+Y values appropriately.
Each script buffer command loads a table of buffer RAM pointers for buffers02-04, each from separate locations, obnoxiously enough. Just be sure to copy the data from the compiled routine into your ROM at each script section.
Spoiler:
Code:
.text
.align 2
.thumb
.thumb_func
.global ExpandedBuffers
.equ Offset, 0xYYYYYY @ where function will be inserted into ROM (no 0x08 in front!)
.equ Set1, 0x0203c000 @ first block of RAM, 3 sets of 4 bytes each (12 bytes)
.equ Set2, 0x0203C00c @ second block of RAM, 4 sets of 16 bytes each (64 bytes)
.equ ROM, 0x08000000
.org 0x6bcc0 @ bufferpokemon
.word RAMTable+ROM
.org 0x6bd08 @ bufferfirstpokemon
.word RAMTable+ROM
.org 0x6bd54 @ bufferpartypokemon
.word RAMTable+ROM
.org 0x6bd8c @ bufferitem
.word RAMTable+ROM
.org 0x6be88 @ bufferattack
.word RAMTable+ROM
.org 0x6bed0 @ buffernumber
.word RAMTable+ROM
.org 0x6bf0c @ bufferstd
.word RAMTable+ROM
.org 0x6bf38 @ bufferstring
.word RAMTable+ROM
.org 0x231e8c
.word Offset+1+ROM
.word Start08+1+ROM
.word Start09+1+ROM
.word Start0A+1+ROM
.word Start0B+1+ROM
.word Start0C+1+ROM
.word Start0D+1+ROM
.org Offset
Start07:
ldr r0, =(Set1) @4 byte buffer
b Return
Start08:
ldr r0, =(Set1 +4) @4byte buffer
b Return
Start09:
ldr r0, =(Set1 +8) @4byte buffer
b Return
Start0A:
ldr r0, =(Set2) @16 byte buffer
b Return
Start0B:
ldr r0, =(Set2 +16) @16byte buffer
b Return
Start0C:
ldr r0, =(Set2 +32) @16byte buffer
b Return
Start0D:
ldr r0, =(Set2 +48) @16 byte buffer
Return:
bx lr
RAMTable:
.word 0x02021cd0 @FD 02 = buffer0
.word 0x02021cf0
.word 0x02021d04
.word 0x00000000
.word 0x00000000
.word Set1 @FD 07 = buffer 0x5 in XSE
.word Set1+4
.word Set1+8
.word Set2
.word Set2+16
.word Set2+32
.word Set2+48
.align 2
I tested a few of them but not all, so please let me know if there are any bugs.