The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking > Binary Hack Research & Development
Reload this Page Code ASM Resource Thread

Notices
For all updates, view the main page.

Binary Hack Research & Development Got a well-founded knack with your binary Pokémon hacks? Love reverse-engineering them? For the traditional Pokémon ROM hacker, 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!

Ad Content
Reply
 
Thread Tools
  #1326   Link to this post, but load the entire thread.  
Old April 11th, 2018 (8:02 AM).
Delta231's Avatar
Delta231 Delta231 is offline
A noob
 
Join Date: May 2016
Location: India
Gender: Male
Nature: Bold
Posts: 682
Quote:
Originally Posted by eaglesfan View Post
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.
__________________
HGSS OWs in FR Style
Fire Red NSE Bookmarks


A supporter of


Reply With Quote
  #1327   Link to this post, but load the entire thread.  
Old April 12th, 2018 (2:06 AM).
Delta231's Avatar
Delta231 Delta231 is offline
A noob
 
Join Date: May 2016
Location: India
Gender: Male
Nature: Bold
Posts: 682
Quote:
Originally Posted by eaglesfan View Post
why would an asm routine take alot of storage?
If you are having 500 pokemon then multiply by x4 or even x8. That would actually take a lot of space. Even Emerald hackers also remove Animations.
__________________
HGSS OWs in FR Style
Fire Red NSE Bookmarks


A supporter of


Reply With Quote
  #1328   Link to this post, but load the entire thread.  
Old April 13th, 2018 (7:13 AM). Edited April 13th, 2018 by xizqu.
xizqu's Avatar
xizqu xizqu is offline
 
Join Date: Feb 2018
Location: California
Gender: Male
Nature: Adamant
Posts: 82
Hello! Would it be possible to request a routine?

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! :)
Reply With Quote
  #1329   Link to this post, but load the entire thread.  
Old April 21st, 2018 (8:52 AM).
paccy's Avatar
paccy paccy is offline
Pokeholic
 
Join Date: May 2009
Location: 'Straya
Gender: Male
Nature: Quiet
Posts: 38
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
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

main:
    push {r5}
    ldr r0, =(0x3005D8C)    @Getting location of parents in daycare
    ldr r0, [r0]
    ldr r1, =0x3030
    add r0, r0, r1
    mov r5, r0
    ldr r3, pokemon_get_gender @Get gender of 1st parent
    bl linker
    cmp r0, #0xFE
    beq mother                @Branch if female
    mov r0, r5
    mov r5, #0x8C
    add r0, r0, r5
    mov r5, r0
    ldr r3, pokemon_get_gender @Get gender of 2nd parent
    bl linker
    cmp r0, #0xFE
    beq mother                @Branch if female

use_pokeball:
    mov r1, #4
    pop {r5}
    add r0, sp, #0x10
    strh r1, [r0]
    mov r4, sp
    
return:
    ldr r3, =(0x8070A50 +1)
    bl linker

mother:    
    mov r0, r5
    mov r1, #0x26
    ldr r3, pokemon_getattr @get mother's pokeball
    bl linker
    mov r1, r0
    cmp r1, #1            @It's a masterball
    beq use_pokeball        @Use pokeball instead of master
    pop {r5}
    add r0, sp, #0x10
    strh r1, [r0]            @Store mother's pokeball
    mov r4, sp
    b return
    
linker:
    bx r3    

.align 2

@Functions:
pokemon_get_gender:
    .word 0x8069FC4 +1
    
pokemon_getattr:
    .word 0x806A518 +1

@At 0x70A48 write 00 48 00 47 XX+1 XX XX 08

and at 0x8070A48 write 00 48 00 47 XX XX XX 08
(where XX XX XX is the reverse hex pointer of where you put in the code +1)

How it works:
When given an egg it will check if either of the parents are female. If yes it will pass on the egg, unless it's a masterball.

Keep Ball when Hatching
How to insert:
Compile and put both of these into free space
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

main:
	mov r0, r5				@Doing things that we overwrote
	mov r1, #0x25
	ldr r3, pokemon_getattr @Get game of origin
	bl linker
	mov r1, r10
	strb r0, [r1]
	mov r0, r5
	mov r1, #0x26
	ldr r3, pokemon_getattr @Get the egg's pokeball
	bl linker
	ldr r1, =(0x20375D8)	@var 0x8000
	strh r0, [r1] 			@Store pokeball in 0x8000
	ldr r3, =(0x80713DC +1)
	bl linker

linker:
	bx r3	

.align 2

@Functions:
pokemon_getattr:
	.word 0x806A518 +1
	
@At 0x713D4 write 00 48 00 47 XX+1 XX XX 08

Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

main:
	mov r2, sp
	add r2, #0xE
	ldr r0, =(0x20375D8) @Get ball from 0x8000
	ldrh r0, [r0]
	strh r0, [r2]
	mov r0, r5
	mov r1, #0x26
	ldr r3, pokemon_setattr @Set pokeball
	bl linker
	ldr r3, =(0x8071536 +1)
	bl linker

linker:
	bx r3	

.align 2

@Functions:
pokemon_setattr:
	.word 0x806ACAC +1
	
@At 0x71528 write 00 4A 10 47 XX+1 XX XX 08

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.
Reply With Quote
  #1330   Link to this post, but load the entire thread.  
Old April 21st, 2018 (11:45 AM).
deoadiuvante deoadiuvante is offline
 
Join Date: Apr 2018
Posts: 1
Quote:
Originally Posted by jiangzhengwenjzw View Post
Misc:

A EV-IV Display Screen


RENEWAL:
Spoiler:
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).
Reply With Quote
  #1331   Link to this post, but load the entire thread.  
Old April 23rd, 2018 (12:45 PM).
mattyman mattyman is offline
 
Join Date: Apr 2018
Gender: Male
Posts: 2
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,

Spoiler:

.text
.align 2
.thumb
.thumb_func

main:
push {r0-r4, lr}
ldr r0, =(0x80568E0 +1)
str r0, [SP, #0x4]
ldr r1, =(0x300500C)
ldr r1, [r1]
mov r0, #0x0
mov r2, #0x0
mov r3, #0x0
ldr r4, =(0x20370D0)
strb r0, [r4]
ldr r4, =(0x809D954 +1)
bl linker

checkValidName:
ldr r0, =(0x300500C)
ldr r0, [r0]
ldrb r0, [r0]
cmp r0, #0xFF
beq invalid
cmp r0, #0x0
beq invalid

done:
pop {r0-r4, pc}

invalid:
ldr r0, =(0x20370D0)
mov r1, #0x1
strb r1, [r1]
pop {r0-r4, pc}

linker:
bx r4

.align 2


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 @invalid
msgbox @msginvalid MSG_KEEPOPEN
closeonkeypress
callasm 0x825AB25
waitstate
compare 0x800D 0x1
if 0x1 call @invalid
return

#org @msg
= Name set.

#org @msginvalid
= The chosen name was invalid.\pPlease choose a valid name.


Is it something wrong with the routine or my script?
Reply With Quote
  #1332   Link to this post, but load the entire thread.  
Old April 24th, 2018 (10:35 AM). Edited April 24th, 2018 by Blah.
Blah's Avatar
Blah Blah is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,924
Quote:
Originally Posted by mattyman View Post
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,

Spoiler:

.text
.align 2
.thumb
.thumb_func

main:
push {r0-r4, lr}
ldr r0, =(0x80568E0 +1)
str r0, [SP, #0x4]
ldr r1, =(0x300500C)
ldr r1, [r1]
mov r0, #0x0
mov r2, #0x0
mov r3, #0x0
ldr r4, =(0x20370D0)
strb r0, [r4]
ldr r4, =(0x809D954 +1)
bl linker

checkValidName:
ldr r0, =(0x300500C)
ldr r0, [r0]
ldrb r0, [r0]
cmp r0, #0xFF
beq invalid
cmp r0, #0x0
beq invalid

done:
pop {r0-r4, pc}

invalid:
ldr r0, =(0x20370D0)
mov r1, #0x1
strb r1, [r1]
pop {r0-r4, pc}

linker:
bx r4

.align 2


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 @invalid
msgbox @msginvalid MSG_KEEPOPEN
closeonkeypress
callasm 0x825AB25
waitstate
compare 0x800D 0x1
if 0x1 call @invalid
return

#org @msg
= Name set.

#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
Something like that...
__________________
...
Reply With Quote
  #1333   Link to this post, but load the entire thread.  
Old April 26th, 2018 (1:14 PM).
mattyman mattyman is offline
 
Join Date: Apr 2018
Gender: Male
Posts: 2
Quote:
Originally Posted by FBI View Post
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.
Reply With Quote
  #1334   Link to this post, but load the entire thread.  
Old May 8th, 2018 (10:29 PM).
AkameTheBulbasaur's Avatar
AkameTheBulbasaur AkameTheBulbasaur is offline
Akame Marukawa of Iyotono
 
Join Date: May 2013
Location: A place :D
Age: 25
Gender: Male
Nature: Docile
Posts: 408
Quote:
Originally Posted by paccy View Post
Inherit Pokeball from Mother (Emerald)
I have ported this to Fire Red!

Routine 1: Put 00 49 08 47 XX XX XX 08 at 0x46250
Spoiler:
/*Put 00 49 08 47 XX XX XX 08 at 0x46250*/
.text
.align 2
.thumb
.thumb_func

Main:
push {r5}
ldr r0, .SaveBlock
ldr r0, [r0]
ldr r1, =0x2F80
add r0, r0, r1
mov r5, r0
bl GetGender
cmp r0, #0xFE
beq Mother
mov r0, r5
mov r5, #0x8C
add r0, r0, r5
mov r5, r0
bl GetGender
cmp r0, #0xFE
beq Mother
b PokeBall

Mother:
mov r0, r5
mov r1, #0x26
bl Decrypt
mov r1, r0
cmp r1, #0x1
beq PokeBall
pop {r5}
add r0, sp, #0x10
strh r1, [r0]
mov r4, sp
b Return

PokeBall:
mov r1, #0x4
pop {r5}
add r0, sp, #0x10
strh r1, [r0]
mov r4, sp

Return:
add r4, r4, #0x13
ldr r0, .Return
bx r0

GetGender:
ldr r3, .GetGender
bx r3

Decrypt:
ldr r3, .Decrypt
bx r3

.align 2
.SaveBlock: .word 0x03005008
.GetGender: .word 0x0803F731
.Decrypt: .word 0x0803FBE9
.Return: .word 0x08046259


Routine 2: Put 00 48 00 47 XX XX XX 08 at 0x46D10
Spoiler:
/*Put 00 48 00 47 XX XX XX 08 at 0x46D10*/
.text
.align 2
.thumb
.thumb_func

Main:
mov r0, r5
mov r1, #0x25
mov r2, r10
bl Decrypt
mov r1, r10
strb r0, [r1]
mov r0, r5
mov r1, #0x26
bl Decrypt
ldr r1, .Var8000
strh r0, [r1]
ldr r3, .Return
bx r3

Decrypt:
ldr r3, .Decrypt
bx r3

.align 2
.Decrypt: .word 0x0803FBE9
.Var8000: .word 0x020370B8
.Return: .word 0x08046D19


Routine 3: 00 4A 10 47 XX XX XX 08 at 0x46DD0
Spoiler:
/*Put 00 4A 10 47 XX XX XX 08 at 0x46DD0*/
.text
.align 2
.thumb
.thumb_func

Main:
mov r2, sp
add r2, r2, #0xE
ldr r0, .Var8000
ldrh r0, [r0]
strh r0, [r2]
mov r0, r5
mov r1, #0x26
bl Encrypt
ldr r3, .Return
bx r3

Encrypt:
ldr r3, .Encrypt
bx r3

.align 2
.Var8000: .word 0x020370B8
.Encrypt: .word 0x0804037D
.Return: .word 0x08046DDF


I have also made a routine that will cause the PokeBall to be random. To use this:

1. Don't insert Routine 1.
2. Instead of Routine 2, insert the routine below.
3. Insert Routine 3 normally.

Routine: Put 00 48 00 47 XX XX XX 08 at 0x46D10
Spoiler:
/*Put 00 48 00 47 XX XX XX 08 at 0x46D10*/
.text
.align 2
.thumb
.thumb_func

Main:
mov r0, r5
mov r1, #0x25
mov r2, r10
bl Decrypt
mov r1, r10
strb r0, [r1]

GetBall:
push {r2-r3}
bl RNG
mov r2, #0xFF
mov r3, #0x16
mul r2, r3
sub r2, r2, #0x95
mov r3, #0x1
cmp r0, r2
ble StoreBall
mov r3, #0x2
mul r2, r3
cmp r0, r2
ble StoreBall
mov r3, #0x3
mul r2, r3
cmp r0, r2
ble StoreBall
mov r3, #0x4
mul r2, r3
cmp r0, r2
ble StoreBall
mov r3, #0x5
mul r2, r3
cmp r0, r2
ble StoreBall
mov r3, #0x6
mul r2, r3
cmp r0, r2
ble StoreBall
mov r3, #0x7
mul r2, r3
cmp r0, r2
ble StoreBall
mov r3, #0x8
mul r2, r3
cmp r0, r2
ble StoreBall
mov r3, #0x9
mul r2, r3
cmp r0, r2
ble StoreBall
mov r3, #0xA
mul r2, r3
cmp r0, r2
ble StoreBall
mov r3, #0xB
mul r2, r3
cmp r0, r2
ble StoreBall
mov r3, #0xC
mul r2, r3
add r2, r2, #0x3
cmp r0, r2
ble StoreBall
mov r3, #0x4
b StoreBall

StoreBall:
pop {r2}
mov r0, r3
pop {r3}
ldr r1, .Var8000
strh r0, [r1]
ldr r3, .Return
bx r3

RNG:
ldr r3, .RNG
bx r3

Decrypt:
ldr r3, .Decrypt
bx r3

.align 2
.Decrypt: .word 0x0803FBE9
.Var8000: .word 0x020370B8
.RNG: .word 0x08044EC9
.Return: .word 0x08046D19
__________________
"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
Reply With Quote
  #1335   Link to this post, but load the entire thread.  
Old May 17th, 2018 (5:14 AM).
Lancekoijerwillborough Lancekoijerwillborough is offline
 
Join Date: Jan 2017
Gender: Male
Posts: 41
Quote:
Originally Posted by FBI View Post

Wild Pokemon With custom attacks



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.

How to insert:

First compile this ASM routine.
ASM Routine:
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

main:
	ldr r5, .VAR
	mov r4, #0x0

loop:
	mov r1, r5 @check if attacks are set
	ldrb r1, [r1]
	cmp r1, #0x0
	beq defaultMoves
	mov r1, #0x2 @calculate location of next attack
	mul r1, r1, r4
	add r1, r1, r5
	ldrh r1, [r1]
	mov r0, r8
	ldr r3, =(0x803E8B0 +1)
	bl linkerTwo
	add r4, r4, #0x1
	cmp r4, #0x4
	bne loop
	

noCrash:
	lsl r0, r0, #0x10
	mov r1, r9
	lsr r5, r1, #0x10
	ldr r3, [sp]
	ldr r1, = (0x803EA60 +1)
	cmp r0, r9
	bne linkerOne
	ldr r1, = (0x803EA56 +1)
	bx r1

defaultMoves:
	mov r0, r8
	ldr r3, =(0x803E8B0 +1)
	bl linkerTwo
	b noCrash

linkerTwo:
	bx r3

linkerOne:
	bx r1
	

.align 2

.VAR:
	.word 0x020370B8


compiled version:
Code:
0F 4D 00 24 29 1C 09 78 00 29 13 D0 02 21 61 43 49 19 09 88 40 46 0B 4B 00 F0 10 F8 01 34 04 2C F0 D1 00 04 49 46 0D 0C 00 9B 07 49 48 45 06 D1 06 49 08 47 03 4B 00 F0 01 F8 F2 E7 18 47 08 47 B8 70 03 02 B1 E8 03 08 61 EA 03 08 57 EA 03 08
Now go to 0x3EA46 and insert:
Code:
01 48 00 47 00 00 XX XX XX 08
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.
Reply With Quote
  #1336   Link to this post, but load the entire thread.  
Old May 19th, 2018 (4:35 AM). Edited May 19th, 2018 by pikachux2.
pikachux2's Avatar
pikachux2 pikachux2 is offline
Never Evolve
 
Join Date: Mar 2010
Location: USA
Gender: Male
Nature: Jolly
Posts: 115
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!
Reply With Quote
  #1337   Link to this post, but load the entire thread.  
Old May 19th, 2018 (5:06 AM).
Delta231's Avatar
Delta231 Delta231 is offline
A noob
 
Join Date: May 2016
Location: India
Gender: Male
Nature: Bold
Posts: 682
Quote:
Originally Posted by pikachux2 View Post
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.
__________________
HGSS OWs in FR Style
Fire Red NSE Bookmarks


A supporter of


Reply With Quote
  #1338   Link to this post, but load the entire thread.  
Old May 20th, 2018 (8:09 AM). Edited January 17th, 2019 by Spherical Ice.
Spherical Ice's Avatar
Spherical Ice Spherical Ice is offline
 
Join Date: Nov 2007
Location: Leicester, UK
Age: 25
Posts: 5,251

Stats on the Pokédex screen replacing the weight comparison




Code:
.thumb

@ credits to DoesntKnowHowToPlay and Squeetz

.equ rom, 0x08000000
.equ offset, 0x

.org 0x10611E, 0xFF
	.byte 0x43, 0xE0
	
.org 0x106370, 0xFF
	.byte 0x0, 0x48, 0x0, 0x47
	.word main + rom + 1

.org 0x106530, 0xFF
	.byte 0xCE, 0xE0
	
.org 0x452200, 0xFF
	.byte 0xA

.org offset, 0xFF
main:
    mov r5, #4
    str r5, [sp]
    str r6, [sp, #4]
    mov r0, r10
    cmp r0, #0
    beq unknown_base_stats

hp:
    mov r0, #0
    bl print_stat
    mov r3, #4 @ y co-ord
    str r3, [sp]
    mov r3, #0 @ x co-ord
    ldr r5, write_method
    bl call_via_r5
    
atk:
    mov r0, #1
    bl print_stat
    mov r3, #4 @ y co-ord
    str r3, [sp]
    mov r3, #0x2C @ x co-ord
    ldr r5, write_method
    bl call_via_r5
     
def:
    mov r0, #2
    bl print_stat
    mov r3, #18 @ y co-ord
    str r3, [sp]
    mov r3, #0 @ x co-ord
    ldr r5, write_method
    bl call_via_r5
     
spa:
    mov r0, #4
    bl print_stat
    mov r3, #18 @ y co-ord
    str r3, [sp]
    mov r3, #0x2C @ x co-ord
    ldr r5, write_method
    bl call_via_r5
     
spd:
    mov r0, #5
    bl print_stat
    mov r3, #32 @ y co-ord
    str r3, [sp]
    mov r3, #0 @ x co-ord
    ldr r5, write_method
    bl call_via_r5
     
spe:
    mov r0, #3
    bl print_stat
    mov r3, #32 @ y co-ord
    str r3, [sp]
    mov r3, #0x2C @ x co-ord
    ldr r5, write_method
    bl call_via_r5
    
print_ability_one:
    ldr r0, [sp, #0x1C]
    mov r3, #0x1C
    mul r0, r3
    ldr r1, base_stats
	ldr r1, [r1]
    mov r3, #0x16
    add r1, r1, r3
    add r1, r0, r1
    ldr r3, abilities
	ldr r3, [r3]
    ldrb r2, [r1]
    mov r1, #0xD
    mul r1, r2
    add r2, r1, r3    
    ldr r1, [r7]
    add r1, #0x53
    ldrb r1, [r1]
    mov r0, r1
    mov r1, #0
    mov r3, #46
    str r3, [sp]
    mov r3, #0
    ldr r5, write_method
    bl call_via_r5
    
print_ability_two:
    ldr r0, [sp, #0x1C]
    mov r3, #0x1C
    mul r0, r3
    ldr r1, base_stats
	ldr r1, [r1]
    mov r3, #0x16
    add r1, r1, r3
    add r1, r0, r1
    ldrb r2, [r1, #1]
    ldrb r5, [r1, #0]
    ldr r3, abilities
	ldr r3, [r3]
    cmp r2, r5
    beq return
    cmp r2, #0
    beq return
    mov r1, #0xD
    mul r1, r2
    add r2, r1, r3
    
    ldr r1, [r7]
    add r1, #0x53
    ldrb r1, [r1]
    mov r0, r1
    mov r1, #0
    mov r3, #60
    str r3, [sp]
    mov r3, #0
    ldr r5, write_method
    bl call_via_r5
    b return
    
unknown_base_stats:
    mov r0, r1
    mov r1, #0
    ldr r2, str_unknown
    mov r3, #4 @ y co-ord
    str r3, [sp]
    mov r3, #0 @ x co-ord
    ldr r5, write_method
    bl call_via_r5
    
return:
    mov r5, #0
    ldr r0, return_loc
    bx r0
    
print_stat:
    push {lr}
    ldr r3, [sp, #0x20]
    mov r1, #0x1C
    mul r3, r1
    ldr r2, base_stats
	ldr r2, [r2]
    add r2, r3
    add r2, r0
    ldrb r1, [r2]
    mov r4, r0
    ldr r0, fcode_buffer2
    mov r3, #0
    cmp r1, #99
    bhi no_leading_zeroes
    cmp r1, #9
    bhi one_leading_zero

two_leading_zeroes:
    str r3, [r0]
    add r0, #1

one_leading_zero:
    str r3, [r0]
    add r0, #1

no_leading_zeroes:
    mov r3, #3
    ldr r5, int_to_str
    bl call_via_r5
    
    mov r2, r4
    ldr r0, displayed_string
    ldr r1, str_table
    lsl r2, r2, #2
    add r1, r2
    ldr r1, [r1]
    ldr r5, fdecoder
    bl call_via_r5
    ldr r1, [r7]
    add r1, #0x53
    ldrb r1, [r1]
    mov r0, r1
    mov r1, #0
    ldr r2, displayed_string
    pop {r5}
    
call_via_r5:
    bx r5

.align 2
    base_stats:             .word 0x1BC + rom
    abilities:              .word 0x1C0 + rom
    str_table:              .word table + rom
    str_unknown:            .word capture + rom
    fcode_buffer2:          .word 0x02021CD0
    displayed_string:       .word 0x02021D18
    int_to_str:             .word 0x08008E78|1
    fdecoder:               .word 0x08008FCC|1
    write_method:           .word 0x081047C8|1
    return_loc:             .word 0x08106380|1
table:
	.word stat_hp + rom
	.word stat_atk + rom
	.word stat_def + rom
	.word stat_spe + rom
	.word stat_spa + rom
	.word stat_spd + rom
	
stat_hp:
	.byte 0xC2, 0xCA, 0x0, 0x0, 0xFD, 0x2, 0xFF
	
stat_atk:
	.byte 0xBB, 0xE8, 0xDF, 0x0, 0xFD, 0x2, 0xFF 
	
stat_def:
	.byte 0xBE, 0xD9, 0xDA, 0x0, 0xFD, 0x2, 0xFF
	
stat_spe:
	.byte 0xCD, 0xE4, 0xD9, 0x0, 0xFD, 0x2, 0xFF
	
stat_spa:
	.byte 0xCD, 0xE4, 0xBB, 0x0, 0xFD, 0x2, 0xFF
	
stat_spd:
	.byte 0xCD, 0xE4, 0xBE, 0x0, 0xFD, 0x2, 0xFF
	
capture:
	.byte 0xBD, 0xD5, 0xE4, 0xE8, 0xE9, 0xE6, 0xD9, 0x0, 0xDA, 0xE3, 0xE6, 0xFE, 0xE1, 0xE3, 0xE6, 0xD9, 0x0, 0xDD, 0xE2, 0xDA, 0xE3, 0xE6, 0xE1, 0xD5, 0xE8, 0xDD, 0xE3, 0xE2, 0xAB, 0xFF
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.
__________________
Reply With Quote
  #1339   Link to this post, but load the entire thread.  
Old May 20th, 2018 (8:48 AM).
pikachux2's Avatar
pikachux2 pikachux2 is offline
Never Evolve
 
Join Date: Mar 2010
Location: USA
Gender: Male
Nature: Jolly
Posts: 115
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.
Reply With Quote
  #1340   Link to this post, but load the entire thread.  
Old May 21st, 2018 (3:53 AM).
Neon Skylar's Avatar
Neon Skylar Neon Skylar is offline
 
Join Date: May 2014
Location: Venezuela n_n
Gender: Male
Posts: 75
Quote:
Originally Posted by Spherical Ice View Post

Stats on the Pokédex screen replacing the weight comparison




Code:
.thumb

@ credits to DoesntKnowHowToPlay and Squeetz

.equ rom, 0x08000000
.equ offset, 0x

.org 0x10611E, 0xFF
	.byte 0x43, 0xE0
	
.org 0x106370, 0xFF
	.byte 0x0, 0x48, 0x0, 0x47
	.word main + rom + 1

.org 0x106530, 0xFF
	.byte 0xCE, 0xE0
	
.org 0x452200, 0xFF
	.byte 0xA

.org offset, 0xFF
main:
    mov r5, #4
    str r5, [sp]
    str r6, [sp, #4]
    mov r0, r10
    cmp r0, #0
    beq unknown_base_stats

hp:
    mov r0, #0
    bl print_stat
    mov r3, #4 @ y co-ord
    str r3, [sp]
    mov r3, #0 @ x co-ord
    ldr r5, write_method
    bl call_via_r5
    
atk:
    mov r0, #1
    bl print_stat
    mov r3, #4 @ y co-ord
    str r3, [sp]
    mov r3, #0x2C @ x co-ord
    ldr r5, write_method
    bl call_via_r5
     
def:
    mov r0, #2
    bl print_stat
    mov r3, #18 @ y co-ord
    str r3, [sp]
    mov r3, #0 @ x co-ord
    ldr r5, write_method
    bl call_via_r5
     
spa:
    mov r0, #4
    bl print_stat
    mov r3, #18 @ y co-ord
    str r3, [sp]
    mov r3, #0x2C @ x co-ord
    ldr r5, write_method
    bl call_via_r5
     
spd:
    mov r0, #5
    bl print_stat
    mov r3, #32 @ y co-ord
    str r3, [sp]
    mov r3, #0 @ x co-ord
    ldr r5, write_method
    bl call_via_r5
     
spe:
    mov r0, #3
    bl print_stat
    mov r3, #32 @ y co-ord
    str r3, [sp]
    mov r3, #0x2C @ x co-ord
    ldr r5, write_method
    bl call_via_r5
    
print_ability_one:
    ldr r0, [sp, #0x1C]
    mov r3, #0x1C
    mul r0, r3
    ldr r1, base_stats
	ldr r1, [r1]
    mov r3, #0x16
    add r1, r1, r3
    add r1, r0, r1
    ldr r3, abilities
	ldr r3, [r3]
    ldrb r2, [r1]
    mov r1, #0xD
    mul r1, r2
    add r2, r1, r3    
    ldr r1, [r7]
    add r1, #0x53
    ldrb r1, [r1]
    mov r0, r1
    mov r1, #0
    mov r3, #46
    str r3, [sp]
    mov r3, #0
    ldr r5, write_method
    bl call_via_r5
    
print_ability_two:
    ldr r0, [sp, #0x1C]
    mov r3, #0x1C
    mul r0, r3
    ldr r1, base_stats
	ldr r1, [r1]
    mov r3, #0x16
    add r1, r1, r3
    add r1, r0, r1
    ldrb r2, [r1, #1]
    ldrb r5, [r1, #0]
    ldr r3, abilities
	ldr r3, [r3]
    cmp r2, r5
    beq return
    cmp r2, #0
    beq return
    mov r1, #0xD
    mul r1, r2
    add r2, r1, r3
    
    ldr r1, [r7]
    add r1, #0x53
    ldrb r1, [r1]
    mov r0, r1
    mov r1, #0
    mov r3, #60
    str r3, [sp]
    mov r3, #0
    ldr r5, write_method
    bl call_via_r5
    b return
    
unknown_base_stats:
    mov r0, r1
    mov r1, #0
    ldr r2, str_unknown
    mov r3, #4 @ y co-ord
    str r3, [sp]
    mov r3, #0 @ x co-ord
    ldr r5, write_method
    bl call_via_r5
    
return:
    mov r5, #0
    ldr r0, return_loc
    bx r0
    
print_stat:
    push {lr}
    ldr r3, [sp, #0x20]
    mov r1, #0x1C
    mul r3, r1
    ldr r2, base_stats
	ldr r2, [r2]
    add r2, r3
    add r2, r0
    ldrb r1, [r2]
    mov r4, r0
    ldr r0, fcode_buffer2
    mov r3, #0
    cmp r1, #99
    bhi no_leading_zeroes
    cmp r1, #9
    bhi one_leading_zero

two_leading_zeroes:
    str r3, [r0]
    add r0, #1

one_leading_zero:
    str r3, [r0]
    add r0, #1

no_leading_zeroes:
    mov r3, #3
    ldr r5, int_to_str
    bl call_via_r5
    
    mov r2, r4
    ldr r0, displayed_string
    ldr r1, str_table
    lsl r2, r2, #2
    add r1, r2
    ldr r1, [r1]
    ldr r5, fdecoder
    bl call_via_r5
    ldr r1, [r7]
    add r1, #0x53
    ldrb r1, [r1]
    mov r0, r1
    mov r1, #0
    ldr r2, displayed_string
    pop {r5}
    
call_via_r5:
    bx r5

.align 2
    base_stats:             .word 0x1BC + rom
    abilities:              .word 0x1C0 + rom
    str_table:              .word table + rom
    str_unknown:            .word capture + rom
    fcode_buffer2:          .word 0x02021CD0
    displayed_string:       .word 0x02021D18
    int_to_str:             .word 0x08008E78|1
    fdecoder:               .word 0x08008FCC|1
    write_method:           .word 0x081047C8|1
    return_loc:             .word 0x08106380|1
table:
	.word stat_hp + rom
	.word stat_atk + rom
	.word stat_def + rom
	.word stat_spe + rom
	.word stat_spa + rom
	.word stat_spd + rom
	
stat_hp:
	.byte 0xC2, 0xCA, 0x0, 0x0, 0xFD, 0x2, 0xFF
	
stat_atk:
	.byte 0xBB, 0xE8, 0xDF, 0x0, 0xFD, 0x2, 0xFF 
	
stat_def:
	.byte 0xBE, 0xD9, 0xDA, 0x0, 0xFD, 0x2, 0xFF
	
stat_spe:
	.byte 0xCD, 0xE4, 0xD9, 0x0, 0xFD, 0x2, 0xFF
	
stat_spa:
	.byte 0xCD, 0xE4, 0xBB, 0x0, 0xFD, 0x2, 0xFF
	
stat_spd:
	.byte 0xCD, 0xE4, 0xBE, 0x0, 0xFD, 0x2, 0xFF
	
capture:
	.byte 0xBD, 0xD5, 0xE4, 0xE8, 0xE9, 0xE6, 0xD9, 0x0, 0xDA, 0xE3, 0xE6, 0xFE, 0xE1, 0xE3, 0xE6, 0xD9, 0x0, 0xDD, 0xE2, 0xDA, 0xE3, 0xE6, 0xE1, 0xD5, 0xE8, 0xDD, 0xE3, 0xE2, 0xAB, 0xFF
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
Reply With Quote
  #1341   Link to this post, but load the entire thread.  
Old May 21st, 2018 (5:00 AM). Edited May 21st, 2018 by Spherical Ice.
Spherical Ice's Avatar
Spherical Ice Spherical Ice is offline
 
Join Date: Nov 2007
Location: Leicester, UK
Age: 25
Posts: 5,251
Quote:
Originally Posted by Neon Skylar View Post
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.

I hope that helps.
__________________
Reply With Quote
  #1342   Link to this post, but load the entire thread.  
Old May 21st, 2018 (5:31 AM). Edited May 21st, 2018 by Neon Skylar.
Neon Skylar's Avatar
Neon Skylar Neon Skylar is offline
 
Join Date: May 2014
Location: Venezuela n_n
Gender: Male
Posts: 75
Quote:
Originally Posted by Spherical Ice View Post
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 ...
Reply With Quote
  #1343   Link to this post, but load the entire thread.  
Old May 21st, 2018 (6:15 AM). Edited May 21st, 2018 by Lance Koijer 2.0.
Lance Koijer 2.0 Lance Koijer 2.0 is offline
Lance Koijer
 
Join Date: Apr 2018
Location: Criscanto Town
Gender: Male
Nature: Adamant
Posts: 104
Quote:
Originally Posted by Xencleamas View Post
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)
  • Created and added a new index list of Pokémon up to Generation VI including the formes in style of KDS/Chacha Dinosaur from the filenames of MrDollSteak's sprites in his Sugimori and Gen VI threads. I think there is no master index list for Generation VII. If there is, please PM me and I will add those.
  • With the list created as stated above, you will just have to create your own Regional Pokédex by copy-pasting from your Excel and Notepad file to below "regional_dex_order" and .hword 0x0000 should be first in the list. Make sure the names are all CAPS-LOCKED. In case of Nidorans, Farfetch'd, Mr. Mime, Ho-Oh, Mime Jr., Porygon-Z, and Flabébé, their characters are changed so you'll have to look for them in the master list. NOTE: Cohagrigus have been filtered out and changed into asterisks (*). Remember to correct its name before generating the binary file otherwise the .asm file won't work.

Custom Regional Pokédex for FireRed:
Spoiler:
Code:
.thumb
.align

.equ number_of_mons_in_regional_dex, 202 @or however long you wanted your regional dex to be
.equ number_of_mons_in_national_dex, 386
.equ MyLoc, 0x888888 @insert your location here
.equ RomAreaOffset,	0x8000000

@Kanto

.equ UNKNOWN, 0x0
.equ BULBASAUR, 0x1
.equ IVYSAUR, 0x2
.equ VENUSAUR, 0x3
.equ CHARMANDER, 0x4
.equ CHARMELEON, 0x5
.equ CHARIZARD, 0x6
.equ SQUIRTLE, 0x7
.equ WARTORTLE, 0x8
.equ BLASTOISE, 0x9
.equ CATERPIE, 0xA
.equ METAPOD, 0xB
.equ BUTTERFREE, 0xC
.equ WEEDLE, 0xD
.equ KAKUNA, 0xE
.equ BEEDRILL, 0xF
.equ PIDGEY, 0x10
.equ PIDGEOTTO, 0x11
.equ PIDGEOT, 0x12
.equ RATTATA, 0x13
.equ RATICATE, 0x14
.equ SPEAROW, 0x15
.equ FEAROW, 0x16
.equ EKANS, 0x17
.equ ARBOK, 0x18
.equ PIKACHU, 0x19
.equ RAICHU, 0x1A
.equ SANDSHREW, 0x1B
.equ SANDSLASH, 0x1C
.equ NIDORAN_F, 0x1D
.equ NIDORINA, 0x1E
.equ NIDOQUEEN, 0x1F
.equ NIDORAN_M, 0x20
.equ NIDORINO, 0x21
.equ NIDOKING, 0x22
.equ CLEFAIRY, 0x23
.equ CLEFABLE, 0x24
.equ VULPIX, 0x25
.equ NINETALES, 0x26
.equ JIGGLYPUFF, 0x27
.equ WIGGLYTUFF, 0x28
.equ ZUBAT, 0x29
.equ GOLBAT, 0x2A
.equ ODDISH, 0x2B
.equ GLOOM, 0x2C
.equ VILEPLUME, 0x2D
.equ PARAS, 0x2E
.equ PARASECT, 0x2F
.equ VENONAT, 0x30
.equ VENOMOTH, 0x31
.equ DIGLETT, 0x32
.equ DUGTRIO, 0x33
.equ MEOWTH, 0x34
.equ PERSIAN, 0x35
.equ PSYDUCK, 0x36
.equ GOLDUCK, 0x37
.equ MANKEY, 0x38
.equ PRIMEAPE, 0x39
.equ GROWLITHE, 0x3A
.equ ARCANINE, 0x3B
.equ POLIWAG, 0x3C
.equ POLIWHIRL, 0x3D
.equ POLIWRATH, 0x3E
.equ ABRA, 0x3F
.equ KADABRA, 0x40
.equ ALAKAZAM, 0x41
.equ MACHOP, 0x42
.equ MACHOKE, 0x43
.equ MACHAMP, 0x44
.equ BELLSPROUT, 0x45
.equ WEEPINBELL, 0x46
.equ VICTREEBEL, 0x47
.equ TENTACOOL, 0x48
.equ TENTACRUEL, 0x49
.equ GEODUDE, 0x4A
.equ GRAVELER, 0x4B
.equ GOLEM, 0x4C
.equ PONYTA, 0x4D
.equ RAPIDASH, 0x4E
.equ SLOWPOKE, 0x4F
.equ SLOWBRO, 0x50
.equ MAGNEMITE, 0x51
.equ MAGNETON, 0x52
.equ FARFETCH_D, 0x53
.equ DODUO, 0x54
.equ DODRIO, 0x55
.equ SEEL, 0x56
.equ DEWGONG, 0x57
.equ GRIMER, 0x58
.equ MUK, 0x59
.equ SHELLDER, 0x5A
.equ CLOYSTER, 0x5B
.equ GASTLY, 0x5C
.equ HAUNTER, 0x5D
.equ GENGAR, 0x5E
.equ ONIX, 0x5F
.equ DROWZEE, 0x60
.equ HYPNO, 0x61
.equ KRABBY, 0x62
.equ KINGLER, 0x63
.equ VOLTORB, 0x64
.equ ELECTRODE, 0x65
.equ EXEGGCUTE, 0x66
.equ EXEGGUTOR, 0x67
.equ CUBONE, 0x68
.equ MAROWAK, 0x69
.equ HITMONLEE, 0x6A
.equ HITMONCHAN, 0x6B
.equ LICKITUNG, 0x6C
.equ KOFFING, 0x6D
.equ WEEZING, 0x6E
.equ RHYHORN, 0x6F
.equ RHYDON, 0x70
.equ CHANSEY, 0x71
.equ TANGELA, 0x72
.equ KANGASKHAN, 0x73
.equ HORSEA, 0x74
.equ SEADRA, 0x75
.equ GOLDEEN, 0x76
.equ SEAKING, 0x77
.equ STARYU, 0x78
.equ STARMIE, 0x79
.equ MR_MIME, 0x7A
.equ SCYTHER, 0x7B
.equ JYNX, 0x7C
.equ ELECTABUZZ, 0x7D
.equ MAGMAR, 0x7E
.equ PINSIR, 0x7F
.equ TAUROS, 0x80
.equ MAGIKARP, 0x81
.equ GYARADOS, 0x82
.equ LAPRAS, 0x83
.equ DITTO, 0x84
.equ EEVEE, 0x85
.equ VAPOREON, 0x86
.equ JOLTEON, 0x87
.equ FLAREON, 0x88
.equ PORYGON, 0x89
.equ OMANYTE, 0x8A
.equ OMASTAR, 0x8B
.equ KABUTO, 0x8C
.equ KABUTOPS, 0x8D
.equ AERODACTYL, 0x8E
.equ SNORLAX, 0x8F
.equ ARTICUNO, 0x90
.equ ZAPDOS, 0x91
.equ MOLTRES, 0x92
.equ DRATINI, 0x93
.equ DRAGONAIR, 0x94
.equ DRAGONITE, 0x95
.equ MEWTWO, 0x96
.equ MEW, 0x97
.equ CHIKORITA, 0x98
.equ BAYLEEF, 0x99
.equ MEGANIUM, 0x9A
.equ CYNDAQUIL, 0x9B
.equ QUILAVA, 0x9C
.equ TYPHLOSION, 0x9D
.equ TOTODILE, 0x9E
.equ CROCONAW, 0x9F
.equ FERALIGATR, 0xA0
.equ SENTRET, 0xA1
.equ FURRET, 0xA2
.equ HOOTHOOT, 0xA3
.equ NOCTOWL, 0xA4
.equ LEDYBA, 0xA5
.equ LEDIAN, 0xA6
.equ SPINARAK, 0xA7
.equ ARIADOS, 0xA8
.equ CROBAT, 0xA9
.equ CHINCHOU, 0xAA
.equ LANTURN, 0xAB
.equ PICHU, 0xAC
.equ CLEFFA, 0xAD
.equ IGGLYBUFF, 0xAE
.equ TOGEPI, 0xAF
.equ TOGETIC, 0xB0
.equ NATU, 0xB1
.equ XATU, 0xB2
.equ MAREEP, 0xB3
.equ FLAAFFY, 0xB4
.equ AMPHAROS, 0xB5
.equ BELLOSSOM, 0xB6
.equ MARILL, 0xB7
.equ AZUMARILL, 0xB8
.equ SUDOWOODO, 0xB9
.equ POLITOED, 0xBA
.equ HOPPIP, 0xBB
.equ SKIPLOOM, 0xBC
.equ JUMPLUFF, 0xBD
.equ AIPOM, 0xBE
.equ SUNKERN, 0xBF
.equ SUNFLORA, 0xC0
.equ YANMA, 0xC1
.equ WOOPER, 0xC2
.equ QUAGSIRE, 0xC3
.equ ESPEON, 0xC4
.equ UMBREON, 0xC5
.equ MURKROW, 0xC6
.equ SLOWKING, 0xC7
.equ MISDREAVUS, 0xC8
.equ UNOWN, 0xC9
.equ WOBBUFFET, 0xCA
.equ GIRAFARIG, 0xCB
.equ PINECO, 0xCC
.equ FORRETRESS, 0xCD
.equ DUNSPARCE, 0xCE
.equ GLIGAR, 0xCF
.equ STEELIX, 0xD0
.equ SNUBBULL, 0xD1
.equ GRANBULL, 0xD2
.equ QWILFISH, 0xD3
.equ SCIZOR, 0xD4
.equ SHUCKLE, 0xD5
.equ HERACROSS, 0xD6
.equ SNEASEL, 0xD7
.equ TEDDIURSA, 0xD8
.equ URSARING, 0xD9
.equ SLUGMA, 0xDA
.equ MAGCARGO, 0xDB
.equ SWINUB, 0xDC
.equ PILOSWINE, 0xDD
.equ CORSOLA, 0xDE
.equ REMORAID, 0xDF
.equ OCTILLERY, 0xE0
.equ DELIBIRD, 0xE1
.equ MANTINE, 0xE2
.equ SKARMORY, 0xE3
.equ HOUNDOUR, 0xE4
.equ HOUNDOOM, 0xE5
.equ KINGDRA, 0xE6
.equ PHANPY, 0xE7
.equ DONPHAN, 0xE8
.equ PORYGON2, 0xE9
.equ STANTLER, 0xEA
.equ SMEARGLE, 0xEB
.equ TYROGUE, 0xEC
.equ HITMONTOP, 0xED
.equ SMOOCHUM, 0xEE
.equ ELEKID, 0xEF
.equ MAGBY, 0xF0
.equ MILTANK, 0xF1
.equ BLISSEY, 0xF2
.equ RAIKOU, 0xF3
.equ ENTEI, 0xF4
.equ SUICUNE, 0xF5
.equ LARVITAR, 0xF6
.equ PUPITAR, 0xF7
.equ TYRANITAR, 0xF8
.equ LUGIA, 0xF9
.equ HO_OH, 0xFA
.equ CELEBI, 0xFB
.equ NOPE, 0xFC
.equ NOPE, 0xFD
.equ NOPE, 0xFE
.equ NOPE, 0xFF
.equ NOPE, 0x100
.equ NOPE, 0x101
.equ NOPE, 0x102
.equ NOPE, 0x103
.equ NOPE, 0x104
.equ NOPE, 0x105
.equ NOPE, 0x106
.equ NOPE, 0x107
.equ NOPE, 0x108
.equ NOPE, 0x109
.equ NOPE, 0x10A
.equ NOPE, 0x10B
.equ NOPE, 0x10C
.equ NOPE, 0x10D
.equ NOPE, 0x10E
.equ NOPE, 0x10F
.equ NOPE, 0x110
.equ NOPE, 0x111
.equ NOPE, 0x112
.equ NOPE, 0x113
.equ NOPE, 0x114
.equ TREECKO, 0x115
.equ GROVYLE, 0x116
.equ SCEPTILE, 0x117
.equ TORCHIC, 0x118
.equ COMBUSKEN, 0x119
.equ BLAZIKEN, 0x11A
.equ MUDKIP, 0x11B
.equ MARSHTOMP, 0x11C
.equ SWAMPERT, 0x11D
.equ POOCHYENA, 0x11E
.equ MIGHTYENA, 0x11F
.equ ZIGZAGOON, 0x120
.equ LINOONE, 0x121
.equ WURMPLE, 0x122
.equ SILCOON, 0x123
.equ BEAUTIFLY, 0x124
.equ CASCOON, 0x125
.equ DUSTOX, 0x126
.equ LOTAD, 0x127
.equ LOMBRE, 0x128
.equ LUDICOLO, 0x129
.equ SEEDOT, 0x12A
.equ NUZLEAF, 0x12B
.equ SHIFTRY, 0x12C
.equ NINCADA, 0x12D
.equ NINJASK, 0x12E
.equ SHEDINJA, 0x12F
.equ TAILLOW, 0x130
.equ SWELLOW, 0x131
.equ SHROOMISH, 0x132
.equ BRELOOM, 0x133
.equ SPINDA, 0x134
.equ WINGULL, 0x135
.equ PELIPPER, 0x136
.equ SURSKIT, 0x137
.equ MASQUERAIN, 0x138
.equ WAILMER, 0x139
.equ WAILORD, 0x13A
.equ SKITTY, 0x13B
.equ DELCATTY, 0x13C
.equ KECLEON, 0x13D
.equ BALTOY, 0x13E
.equ CLAYDOL, 0x13F
.equ NOSEPASS, 0x140
.equ TORKOAL, 0x141
.equ SABLEYE, 0x142
.equ BARBOACH, 0x143
.equ WHISCASH, 0x144
.equ LUVDISC, 0x145
.equ CORPHISH, 0x146
.equ CRAWDAUNT, 0x147
.equ FEEBAS, 0x148
.equ MILOTIC, 0x149
.equ CARVANHA, 0x14A
.equ SHARPEDO, 0x14B
.equ TRAPINCH, 0x14C
.equ VIBRAVA, 0x14D
.equ FLYGON, 0x14E
.equ MAKUHITA, 0x14F
.equ HARIYAMA, 0x150
.equ ELECTRIKE, 0x151
.equ MANECTRIC, 0x152
.equ NUMEL, 0x153
.equ CAMERUPT, 0x154
.equ SPHEAL, 0x155
.equ SEALEO, 0x156
.equ WALREIN, 0x157
.equ CACNEA, 0x158
.equ CACTURNE, 0x159
.equ SNORUNT, 0x15A
.equ GLALIE, 0x15B
.equ LUNATONE, 0x15C
.equ SOLROCK, 0x15D
.equ AZURILL, 0x15E
.equ SPOINK, 0x15F
.equ GRUMPIG, 0x160
.equ PLUSLE, 0x161
.equ MINUN, 0x162
.equ MAWILE, 0x163
.equ MEDITITE, 0x164
.equ MEDICHAM, 0x165
.equ SWABLU, 0x166
.equ ALTARIA, 0x167
.equ WYNAUT, 0x168
.equ DUSKULL, 0x169
.equ DUSCLOPS, 0x16A
.equ ROSELIA, 0x16B
.equ SLAKOTH, 0x16C
.equ VIGOROTH, 0x16D
.equ SLAKING, 0x16E
.equ GULPIN, 0x16F
.equ SWALOT, 0x170
.equ TROPIUS, 0x171
.equ WHISMUR, 0x172
.equ LOUDRED, 0x173
.equ EXPLOUD, 0x174
.equ CLAMPERL, 0x175
.equ HUNTAIL, 0x176
.equ GOREBYSS, 0x177
.equ ABSOL, 0x178
.equ SHUPPET, 0x179
.equ BANETTE, 0x17A
.equ SEVIPER, 0x17B
.equ ZANGOOSE, 0x17C
.equ RELICANTH, 0x17D
.equ ARON, 0x17E
.equ LAIRON, 0x17F
.equ AGGRON, 0x180
.equ CASTFORM, 0x181
.equ VOLBEAT, 0x182
.equ ILLUMISE, 0x183
.equ LILEEP, 0x184
.equ CRADILY, 0x185
.equ ANORITH, 0x186
.equ ARMALDO, 0x187
.equ RALTS, 0x188
.equ KIRLIA, 0x189
.equ GARDEVOIR, 0x18A
.equ BAGON, 0x18B
.equ SHELGON, 0x18C
.equ SALAMENCE, 0x18D
.equ BELDUM, 0x18E
.equ METANG, 0x18F
.equ METAGROSS, 0x190
.equ REGIROCK, 0x191
.equ REGICE, 0x192
.equ REGISTEEL, 0x193
.equ KYOGRE, 0x194
.equ GROUDON, 0x195
.equ RAYQUAZA, 0x196
.equ LATIAS, 0x197
.equ LATIOS, 0x198
.equ JIRACHI, 0x199
.equ DEOXYS, 0x19A
.equ CHIMECHO, 0x19B
.equ EGG, 0x19C
.equ UNOWN_B, 0x19D
.equ UNOWN_C, 0x19E
.equ UNOWN_D, 0x19F
.equ UNOWN_E, 0x1A0
.equ UNOWN_F, 0x1A1
.equ UNOWN_G, 0x1A2
.equ UNOWN_H, 0x1A3
.equ UNOWN_I, 0x1A4
.equ UNOWN_J, 0x1A5
.equ UNOWN_K, 0x1A6
.equ UNOWN_L, 0x1A7
.equ UNOWN_M, 0x1A8
.equ UNOWN_N, 0x1A9
.equ UNOWN_O, 0x1AA
.equ UNOWN_P, 0x1AB
.equ UNOWN_Q, 0x1AC
.equ UNOWN_R, 0x1AD
.equ UNOWN_S, 0x1AE
.equ UNOWN_T, 0x1AF
.equ UNOWN_U, 0x1B0
.equ UNOWN_V, 0x1B1
.equ UNOWN_W, 0x1B2
.equ UNOWN_X, 0x1B3
.equ UNOWN_Y, 0x1B4
.equ UNOWN_Z, 0x1B5
.equ UNOWN_EXCLAMATION, 0x1B6
.equ UNOWN_QUESTION, 0x1B7
.equ TURTWIG, 0x1B8
.equ GROTLE, 0x1B9
.equ TORTERRA, 0x1BA
.equ CHIMCHAR, 0x1BB
.equ MONFERNO, 0x1BC
.equ INFERNAPE, 0x1BD
.equ PIPLUP, 0x1BE
.equ PRINPLUP, 0x1BF
.equ EMPOLEON, 0x1C0
.equ STARLY, 0x1C1
.equ STARAVIA, 0x1C2
.equ STARAPTOR, 0x1C3
.equ BIDOOF, 0x1C4
.equ BIBAREL, 0x1C5
.equ KRICKETOT, 0x1C6
.equ KRICKETUNE, 0x1C7
.equ SHINX, 0x1C8
.equ LUXIO, 0x1C9
.equ LUXRAY, 0x1CA
.equ BUDEW, 0x1CB
.equ ROSERADE, 0x1CC
.equ CRANIDOS, 0x1CD
.equ RAMPARDOS, 0x1CE
.equ SHIELDON, 0x1CF
.equ BASTIODON, 0x1D0
.equ BURMY, 0x1D1
.equ WORMADAM, 0x1D2
.equ MOTHIM, 0x1D3
.equ COMBEE, 0x1D4
.equ VESPIQUEN, 0x1D5
.equ PACHIRISU, 0x1D6
.equ BUIZEL, 0x1D7
.equ FLOATZEL, 0x1D8
.equ CHERUBI, 0x1D9
.equ CHERRIM, 0x1DA
.equ SHELLOS, 0x1DB
.equ GASTRODON, 0x1DC
.equ AMBIPOM, 0x1DD
.equ DRIFLOON, 0x1DE
.equ DRIFBLIM, 0x1DF
.equ BUNEARY, 0x1E0
.equ LOPUNNY, 0x1E1
.equ MISMAGIUS, 0x1E2
.equ HONCHKROW, 0x1E3
.equ GLAMEOW, 0x1E4
.equ PURUGLY, 0x1E5
.equ CHINGLING, 0x1E6
.equ STUNKY, 0x1E7
.equ SKUNTANK, 0x1E8
.equ BRONZOR, 0x1E9
.equ BRONZONG, 0x1EA
.equ BONSLY, 0x1EB
.equ MIME_JR, 0x1EC
.equ HAPPINY, 0x1ED
.equ CHATOT, 0x1EE
.equ SPIRITOMB, 0x1EF
.equ GIBLE, 0x1F0
.equ GABITE, 0x1F1
.equ GARCHOMP, 0x1F2
.equ MUNCHLAX, 0x1F3
.equ RIOLU, 0x1F4
.equ LUCARIO, 0x1F5
.equ HIPPOPOTAS, 0x1F6
.equ HIPPOWDON, 0x1F7
.equ SKORUPI, 0x1F8
.equ DRAPION, 0x1F9
.equ CROAGUNK, 0x1FA
.equ TOXICROAK, 0x1FB
.equ CARNIVINE, 0x1FC
.equ FINNEON, 0x1FD
.equ LUMINEON, 0x1FE
.equ MANTYKE, 0x1FF
.equ SNOVER, 0x200
.equ ABOMASNOW, 0x201
.equ WEAVILE, 0x202
.equ MAGNEZONE, 0x203
.equ LICKILICKY, 0x204
.equ RHYPERIOR, 0x205
.equ TANGROWTH, 0x206
.equ ELECTIVIRE, 0x207
.equ MAGMORTAR, 0x208
.equ TOGEKISS, 0x209
.equ YANMEGA, 0x20A
.equ LEAFEON, 0x20B
.equ GLACEON, 0x20C
.equ GLISCOR, 0x20D
.equ MAMOSWINE, 0x20E
.equ PORYGON_Z, 0x20F
.equ GALLADE, 0x210
.equ PROBOPASS, 0x211
.equ DUSKNOIR, 0x212
.equ FROSLASS, 0x213
.equ ROTOM, 0x214
.equ UXIE, 0x215
.equ MESPRIT, 0x216
.equ AZELF, 0x217
.equ DIALGA, 0x218
.equ PALKIA, 0x219
.equ HEATRAN, 0x21A
.equ REGIGIGAS, 0x21B
.equ GIRATINA, 0x21C
.equ CRESSELIA, 0x21D
.equ PHIONE, 0x21E
.equ MANAPHY, 0x21F
.equ DARKRAI, 0x220
.equ SHAYMIN, 0x221
.equ ARCEUS, 0x222
.equ BURMY_SAND, 0x223
.equ BURMY_TRASH, 0x224
.equ WORMADAM_SAND, 0x225
.equ WORMADAM_THRASH, 0x226
.equ SHELLOS_EAST, 0x227
.equ GASTRODON_EAST, 0x228
.equ ROTOM_HEAT, 0x229
.equ ROTOM_WASH, 0x22A
.equ ROTOM_FROST, 0x22B
.equ ROTOM_FAN, 0x22C
.equ ROTOM_MOW, 0x22D
.equ GIRATINA_ORIGIN, 0x22E
.equ SHAYMIN_SKY, 0x22F
.equ ARCEUS_FIGHT, 0x230
.equ ARCEUS_FLYING, 0x231
.equ ARCEUS_POISON, 0x232
.equ ARCEUS_GROUND, 0x233
.equ ARCEUS_ROCK, 0x234
.equ ARCEUS_BUG, 0x235
.equ ARCEUS_GHOST, 0x236
.equ ARCEUS_STEEL, 0x237
.equ ARCEUS_UNKNOWN, 0x238
.equ ARCEUS_FIRE, 0x239
.equ ARCEUS_WATER, 0x23A
.equ ARCEUS_GRASS, 0x23B
.equ ARCEUS_ELECTRIC, 0x23C
.equ ARCEUS_PSYCHIC, 0x23D
.equ ARCEUS_ICE, 0x23E
.equ ARCEUS_DRAGON, 0x23F
.equ ARCEUS_DARK, 0x240
.equ ARCEUS_FAIRY, 0x241
.equ VICTINI, 0x242
.equ SNIVY, 0x243
.equ SERVINE, 0x244
.equ SERPERIOR, 0x245
.equ TEPIG, 0x246
.equ PIGNITE, 0x247
.equ EMBOAR, 0x248
.equ OSHAWOTT, 0x249
.equ DEWOTT, 0x24A
.equ SAMUROTT, 0x24B
.equ PATRAT, 0x24C
.equ WATCHOG, 0x24D
.equ LILLIPUP, 0x24E
.equ HERDIER, 0x24F
.equ STOUTLAND, 0x250
.equ PURRLOIN, 0x251
.equ LIEPARD, 0x252
.equ PANSAGE, 0x253
.equ SIMISAGE, 0x254
.equ PANSEAR, 0x255
.equ SIMISEAR, 0x256
.equ PANPOUR, 0x257
.equ SIMIPOUR, 0x258
.equ MUNNA, 0x259
.equ MUSHARNA, 0x25A
.equ PIDOVE, 0x25B
.equ TRANQUILL, 0x25C
.equ UNFEZANT, 0x25D
.equ BLITZLE, 0x25E
.equ ZEBSTRIKA, 0x25F
.equ ROGGENROLA, 0x260
.equ BOLDORE, 0x261
.equ GIGALITH, 0x262
.equ WOOBAT, 0x263
.equ SWOOBAT, 0x264
.equ DRILBUR, 0x265
.equ EXCADRILL, 0x266
.equ AUDINO, 0x267
.equ TIMBURR, 0x268
.equ GURDURR, 0x269
.equ CONKELDURR, 0x26A
.equ TYMPOLE, 0x26B
.equ PALPITOAD, 0x26C
.equ SEISMITOAD, 0x26D
.equ THROH, 0x26E
.equ SAWK, 0x26F
.equ SEWADDLE, 0x270
.equ SWADLOON, 0x271
.equ LEAVANNY, 0x272
.equ VENIPEDE, 0x273
.equ WHIRLIPEDE, 0x274
.equ SCOLIPEDE, 0x275
.equ COTTONEE, 0x276
.equ WHIMSICOTT, 0x277
.equ PETILIL, 0x278
.equ LILLIGANT, 0x279
.equ BASCULIN, 0x27A
.equ SANDILE, 0x27B
.equ KROKOROK, 0x27C
.equ KROOKODILE, 0x27D
.equ DARUMAKA, 0x27E
.equ DARMANITAN, 0x27F
.equ MARACTUS, 0x280
.equ DWEBBLE, 0x281
.equ CRUSTLE, 0x282
.equ SCRAGGY, 0x283
.equ SCRAFTY, 0x284
.equ SIGILYPH, 0x285
.equ YAMASK, 0x286
.equ COHAGRIGUS, 0x287
.equ TIRTOUGA, 0x288
.equ CARRACOSTA, 0x289
.equ ARCHEN, 0x28A
.equ ARCHEOPS, 0x28B
.equ TRUBBISH, 0x28C
.equ GARBODOR, 0x28D
.equ ZORUA, 0x28E
.equ ZOROARK, 0x28F
.equ MINCCINO, 0x290
.equ CINCCINO, 0x291
.equ GOTHITA, 0x292
.equ GOTHORITA, 0x293
.equ GOTHITELLE, 0x294
.equ SOLOSIS, 0x295
.equ DUOSION, 0x296
.equ REUNICLUS, 0x297
.equ DUCKLETT, 0x298
.equ SWANNA, 0x299
.equ VANILLITE, 0x29A
.equ VANILLISH, 0x29B
.equ VANILLUXE, 0x29C
.equ DEERLING, 0x29D
.equ SAWSBUCK, 0x29E
.equ EMOLGA, 0x29F
.equ KARRABLAST, 0x2A0
.equ ESCAVALIER, 0x2A1
.equ FOONGUS, 0x2A2
.equ AMOONGUSS, 0x2A3
.equ FRILLISH, 0x2A4
.equ JELLICENT, 0x2A5
.equ ALOMOMOLA, 0x2A6
.equ JOLTIK, 0x2A7
.equ GALVANTULA, 0x2A8
.equ FERROSEED, 0x2A9
.equ FERROTHORN, 0x2AA
.equ KLINK, 0x2AB
.equ KLANG, 0x2AC
.equ KLINKLANG, 0x2AD
.equ TYNAMO, 0x2AE
.equ EELEKTRIK, 0x2AF
.equ EELEKTROSS, 0x2B0
.equ ELGYEM, 0x2B1
.equ BEHEEYEM, 0x2B2
.equ LITWICK, 0x2B3
.equ LAMPENT, 0x2B4
.equ CHANDELURE, 0x2B5
.equ AXEW, 0x2B6
.equ FRAXURE, 0x2B7
.equ HAXORUS, 0x2B8
.equ CUBCHOO, 0x2B9
.equ BEARTIC, 0x2BA
.equ CRYOGONAL, 0x2BB
.equ SHELMET, 0x2BC
.equ ACCELGOR, 0x2BD
.equ STUNFISK, 0x2BE
.equ MIENFOO, 0x2BF
.equ MIENSHAO, 0x2C0
.equ DRUDDIGON, 0x2C1
.equ GOLETT, 0x2C2
.equ GOLURK, 0x2C3
.equ PAWNIARD, 0x2C4
.equ BISHARP, 0x2C5
.equ BOUFFALANT, 0x2C6
.equ RUFFLET, 0x2C7
.equ BRAVIARY, 0x2C8
.equ VULLABY, 0x2C9
.equ MANDIBUZZ, 0x2CA
.equ HEATMOR, 0x2CB
.equ DURANT, 0x2CC
.equ DEINO, 0x2CD
.equ ZWEILOUS, 0x2CE
.equ HYDREIGON, 0x2CF
.equ LARVESTA, 0x2D0
.equ VOLCARONA, 0x2D1
.equ COBALION, 0x2D2
.equ TERRAKION, 0x2D3
.equ VIRIZION, 0x2D4
.equ TORNADUS, 0x2D5
.equ THUNDURUS, 0x2D6
.equ RESHIRAM, 0x2D7
.equ ZEKROM, 0x2D8
.equ LANDORUS, 0x2D9
.equ KYUREM, 0x2DA
.equ KELDEO, 0x2DB
.equ MELOETTA, 0x2DC
.equ GENESECT, 0x2DD
.equ BASCULIN_BLUE, 0x2DE
.equ DARMANITAN_ZEN, 0x2DF
.equ DEERLING_SUMMER, 0x2E0
.equ DEERLING_AUTUMN, 0x2E1
.equ DEERLING_WINTER, 0x2E2
.equ SAWSBUCK_SUMMER, 0x2E3
.equ SAWSBUCK_AUTUMN, 0x2E4
.equ SAWSBUCK_WINTER, 0x2E5
.equ KYUREM_WHITE, 0x2E6
.equ KYUREM_BLACK, 0x2E7
.equ MELOETTA_PIROUETTE, 0x2E8
.equ GENESECT_SHOCK, 0x2E9
.equ GENESECT_BURN, 0x2EA
.equ GENESECT_CHILL, 0x2EB
.equ GENESECT_DOUSE, 0x2EC
.equ TORNADUS_THERIAN, 0x2ED
.equ THUNDURUS_THERIAN, 0x2EE
.equ LANDORUS_THERIAN, 0x2EF
.equ KELDEO_RESOLUTE, 0x2F0
.equ CHESPIN, 0x2F1
.equ QUILLADIN, 0x2F2
.equ CHESNAUGHT, 0x2F3
.equ FENNEKIN, 0x2F4
.equ BRAIXEN, 0x2F5
.equ DELPHOX, 0x2F6
.equ FROAKIE, 0x2F7
.equ FROGADIER, 0x2F8
.equ GRENINJA, 0x2F9
.equ BUNNELBY, 0x2FA
.equ DIGGERSBY, 0x2FB
.equ FLETCHLING, 0x2FC
.equ FLETCHINDER, 0x2FD
.equ TALONFLAME, 0x2FE
.equ SCATTERBUG, 0x2FF
.equ SPEWPA, 0x300
.equ VIVILLON, 0x301
.equ LITLEO, 0x302
.equ PYROAR, 0x303
.equ FLABEBE, 0x304
.equ FLOETTE, 0x305
.equ FLORGES, 0x306
.equ SKIDDO, 0x307
.equ GOGOAT, 0x308
.equ PANCHAM, 0x309
.equ PANGORO, 0x30A
.equ FURFROU, 0x30B
.equ ESPURR, 0x30C
.equ MEOWSTIC, 0x30D
.equ HONEDGE, 0x30E
.equ DOUBLADE, 0x30F
.equ AEGISLASH, 0x310
.equ SPRITZEE, 0x311
.equ AROMATISSE, 0x312
.equ SWIRLIX, 0x313
.equ SLURPUFF, 0x314
.equ INKAY, 0x315
.equ MALAMAR, 0x316
.equ BINACLE, 0x317
.equ BARBARACLE, 0x318
.equ SKRELP, 0x319
.equ DRAGALGE, 0x31A
.equ CLAUNCHER, 0x31B
.equ CLAWITZER, 0x31C
.equ HELIOPTILE, 0x31D
.equ HELIOLISK, 0x31E
.equ TYRUNT, 0x31F
.equ TYRANTRUM, 0x320
.equ AMAURA, 0x321
.equ AURORUS, 0x322
.equ SYLVEON, 0x323
.equ HAWLUCHA, 0x324
.equ DEDENNE, 0x325
.equ CARBINK, 0x326
.equ GOOMY, 0x327
.equ SLIGGOO, 0x328
.equ GOODRA, 0x329
.equ KLEFKI, 0x32A
.equ PHANTUMP, 0x32B
.equ TREVENANT, 0x32C
.equ PUMPKABOO, 0x32D
.equ GOURGEIST, 0x32E
.equ BERGMITE, 0x32F
.equ AVALUGG, 0x330
.equ NOIBAT, 0x331
.equ NOIVERN, 0x332
.equ XERNEAS, 0x333
.equ YVELTAL, 0x334
.equ ZYGARDE, 0x335
.equ DIANCIE, 0x336
.equ HOOPA, 0x337
.equ VOLCANION, 0x338
.equ PYROAR_FEMALE, 0x339
.equ FLABEBE_WHITE, 0x33A
.equ FLABEBE_YELLOW, 0x33B
.equ FLABEBE_ORANGE, 0x33C
.equ FLABEBE_BLUE, 0x33D
.equ FLOETTE_WHITE, 0x33E
.equ FLOETTE_YELLOW, 0x33F
.equ FLOETTE_ORANGE, 0x340
.equ FLOETTE_BLUE, 0x341
.equ FLORGES_WHITE, 0x342
.equ FLORGES_YELLOW, 0x343
.equ FLORGES_ORANGE, 0x344
.equ FLORGES_BLUE, 0x345
.equ MEOWSTIC_FEMALE, 0x346
.equ AEGISLASH_BLADE, 0x347
.equ PUMPKABOO_2, 0x348
.equ PUMPKABOO_3, 0x349
.equ PUMPKABOO_4, 0x34A
.equ GOURGEIST_2, 0x34B
.equ GOURGEIST_3, 0x34C
.equ GOURGEIST_4, 0x34D
.equ HOOPA_UNBOUND, 0x34E
.equ VENUSAUR_MEGA, 0x34F
.equ CHARIZARD_MEGAX, 0x350
.equ CHARIZARD_MEGAY, 0x351
.equ BLASTOISE_MEGA, 0x352
.equ BEEDRILL_MEGA, 0x353
.equ PIDGEOT_MEGA, 0x354
.equ ALAKAZAM_MEGA, 0x355
.equ SLOWBRO_MEGA, 0x356
.equ GENGAR_MEGA, 0x357
.equ KANGASKHAN_MEGA, 0x358
.equ PINSIR_MEGA, 0x359
.equ GYARADOS_MEGA, 0x35A
.equ AERODACTYL_MEGA, 0x35B
.equ MEWTWO_MEGAX, 0x35C
.equ MEWTWO_MEGAY, 0x35D
.equ AMPHAROS_MEGA, 0x35E
.equ STEELIX_MEGA, 0x35F
.equ SCIZOR_MEGA, 0x360
.equ HERACROSS_MEGA, 0x361
.equ HOUNDOOM_MEGA, 0x362
.equ TYRANITAR_MEGA, 0x363
.equ SCEPTILE_MEGA, 0x364
.equ BLAZIKEN_MEGA, 0x365
.equ SWAMPERT_MEGA, 0x366
.equ GARDEVOIR_MEGA, 0x367
.equ SABLEYE_MEGA, 0x368
.equ MAWILE_MEGA, 0x369
.equ AGGRON_MEGA, 0x36A
.equ MEDICHAM_MEGA, 0x36B
.equ MANECTRIC_MEGA, 0x36C
.equ SHARPEDO_MEGA, 0x36D
.equ CAMERUPT_MEGA, 0x36E
.equ ALTARIA_MEGA, 0x36F
.equ BANETTE_MEGA, 0x370
.equ ABSOL_MEGA, 0x371
.equ GLALIE_MEGA, 0x372
.equ SALAMENCE_MEGA, 0x373
.equ METAGROSS_MEGA, 0x374
.equ NOPE, 0x375 @Dunno why but maybe a new Latias out from the Soul Dew routine
.equ NOPE, 0x376 @Dunno why but maybe a new Latios out from the Soul Dew routine
.equ LATIAS_MEGA, 0x377
.equ LATIOS_MEGA, 0x378
.equ RAYQUAZA_MEGA, 0x379
.equ LOPUNNY_MEGA, 0x37A
.equ GARCHOMP_MEGA, 0x37B
.equ LUCARIO_MEGA, 0x37C
.equ ABOMASNOW_MEGA, 0x37D
.equ GALLADE_MEGA, 0x37E
.equ AUDINO_MEGA, 0x37F
.equ DIANCIE_MEGA, 0x380
.equ DEOXYS_NORMAL, 0x381 @Renewal of Deoxys' index
.equ DEOXYS_ATTACK, 0x382 @Renewal of Deoxys' index
.equ DEOXYS_DEFENSE, 0x383 @Renewal of Deoxys' index
.equ DEXOYS_SPEED, 0x384 @Renewal of Deoxys' index
.equ NOPE, 0x385 @Generation VII Pokemon starts here

.org 0x43F90, 0xFF
ldr r1, Hook3
bx r1
.align 2
Hook3: .word RomAreaOffset+dex_seeable_mon_hook+1

.org 0x88EDC, 0xFF
ldr r1, Hook6
bx r1
.align 2
Hook6: .word RomAreaOffset+dex_regional_count_hook+1

.org 0xCE91A, 0xFF
ldr r1, Hook4
bx r1
.align 2
Hook4: .word RomAreaOffset+dex_evolution_fix_hook+1

.org 0x10352C, 0xFF
ldr r1, Hook7
bx r1
.align 2
Hook7: .word RomAreaOffset+dex_display_hook+1

.org 0x10356C, 0xFF
ldr r0, Hook8
bx r0
.align 2
Hook8: .word RomAreaOffset+regional_dex_hook+1

.org 0x1035B4, 0xFF
ldr r1, Hook9
bx r1
.align 2
Hook9: .word RomAreaOffset+store_last_dex_seen_hook+1

.org 0x1035F4, 0xFF
ldr r0, HookA
bx r0
.align 2
HookA: .word RomAreaOffset+lazy_regional_dex_end_hook+1

.org 0x104A66, 0xFF
ldr r1, HookB
bx r1
.align 2
HookB: .word RomAreaOffset+display_regional_num_hook+1

.org 0x104BBC, 0xFF
ldr r2, Hook5
bx r2
.align 2
Hook5: .word RomAreaOffset+dex_display_counts_hook+1

.org 0x106810, 0xFF
ldr r1, Hook2
bx r1
.align 2
Hook2: .word RomAreaOffset+habitat_dex_regional_limit_hook+1

.org 0x106B84, 0xFF
ldr r1, Hook1
bx r1
.align 2
Hook1: .word RomAreaOffset+data_on_capture_hook+1

.org MyLoc, 0xFF
data_on_capture_hook:	@0x08106B84 via r1
	bl species_to_regional_dex_number
	cmp r0, #0x0
	bne capture_display_return
	ldr r0, add_task_no_capture_display
	bx r0

capture_display_return:
	ldr r0, add_task_capture_display
	bx r0


.align 2
.pool

.align 2


habitat_dex_regional_limit_hook:	@0x08106810 via r1
	push {r4, lr}
	mov r4, r0
	bl haz_national_dex_bool
	cmp r0, #0x1
	beq habitat_dex_regional_limit_return	@valid
	mov r0, r4
	bl species_to_regional_dex_number
	cmp r0, #0x0
	beq habitat_dex_regional_limit_return	@not in regional dex, return 0
	mov r0, #0x1

habitat_dex_regional_limit_return:
	pop {r4}
	pop {r1}
	bx r1


.align 2
.pool

.align 2


dex_seeable_mon_hook:	@0x08043F90 via r1
	push {r4, lr}
	mov r4, r0
	bl haz_national_dex_bool
	cmp r0, #0x0
	beq only_regional_numbered
@national
	mov r0, r4
	bl species_to_national_dex_number_1
	b dex_seeable_mon_check_valid_species

only_regional_numbered:
	mov r0, r4
	bl species_to_regional_dex_number

dex_seeable_mon_check_valid_species:
	cmp r0, #0x0
	bne dex_seeable_mon_return
	ldr r0, full_halfword

dex_seeable_mon_return:
	pop {r4}
	pop {r1}
	bx r1
.align
full_halfword:	.word 0xFFFF


.align 2
.pool

.align 2


dex_evolution_fix_hook:	@0x080CE91A via r1
	bl species_to_regional_dex_number
	cmp r0, #0x0	@not in regional dex, invalid
	beq dex_evolution_failure
	ldr r0, dex_evolution_success_return
	bx r0

dex_evolution_failure:
	mov r0, #0x11
	strh r0, [r5, #0x8]
	mov r2, #0x1
	ldr r1, dex_evolution_failure_return
	bx r1


.align 2
.pool

.align 2


dex_display_counts_hook:	@0x08104BBC via r2
	@r0: mode
	push {lr}
	cmp r1, #0x0
	beq call_regional_count
	bl national_pokedex_count
	b dex_display_counts_return

call_regional_count:
	bl dex_regional_count_hook

dex_display_counts_return:
	pop {pc}


.align 2
.pool

.align 2


dex_regional_count_hook:	@0x08088EDC via r1
	push {r4-r6, lr}
	mov r6, r0	@mode
	mov r4, #0x1	@loop
	mov r5, #0x0	@counter

dex_regional_count_loop:
	lsl r0, r4, #0x1	@loop times 2
	adr r1, regional_dex_order
	ldrh r0, [r1, r0]	@req species
	mov r1, r6	@mode
	mov r2, #0x1	@input is SPECIES
	bl dex_flag_check
	add r5, r5, r0
	add r4, #0x1
	ldr r0, regional_dex_limit
	cmp r4, r0
	blo dex_regional_count_loop
	mov r0, r5
	pop {r4-r6, pc}


.align 2
.pool

.align 2


dex_display_hook:	@0x0810352C via r1
	ldr r1, regional_dex_limit
	cmp r0, #0x0
	beq store_dex_limit_and_return
	ldr r1, national_dex_limit

store_dex_limit_and_return:
	str r1, [sp, #0x0]
	ldr r0, regional_dex_limit_return
	bx r0


.align 2
.pool

.align 2


regional_dex_hook:	@0x0810356C via r0
	mov r4, r8
	add r4, #0x1
	lsl r0, r4, #0x1	@index times 2
	adr r1, regional_dex_order
	ldrh r0, [r1, r0]
	bl species_to_national_dex_number_1
	mov r5, r0
	mov r1, #0x0
	ldr r2, regional_dex_hook_return
	bx r2


.align 2
.pool

.align 2


store_last_dex_seen_hook:	@0x081035B4 via r1
	str r0, [r2]
	mov r10, r4
	mov r4, r3
	ldr r0, def_store_string_dex_number
	bx r0


.align 2
.pool

.align 2


lazy_regional_dex_end_hook:	@0x081035F4 via r0
	mov r0, r8
	ldr r1, regional_dex_limit
	cmp r0, r1
	blo regional_dex_hook
	ldr r0, end_dex_display_return
	bx r0


.align 2
.pool

.align 2


display_regional_num_hook:	@0x08104A66 via r1
	mov r5, r0	@save species
	bl haz_national_dex_bool
	cmp r0, #0x0
	beq use_regional_dex_ordering
	ldr r1, dex_malloc_ptr
	ldr r1, [r1]
	add r1, #0x42
	ldrb r1, [r1]
	cmp r1, #0x0	@check if looking at regional dex
	beq use_regional_dex_ordering
	mov r0, r5
	bl species_to_national_dex_number_1
	b display_dex_number_return

use_regional_dex_ordering:
	mov r0, r5
	bl species_to_regional_dex_number	

display_dex_number_return:
	mov r5, r0
	ldr r0, dex_number_display_return
	bx r0





species_to_regional_dex_number:
	adr r3, regional_dex_order
	mov r2, r0	@req species
	mov r0, #0x0	@loop counter
find_regional_number_loop:
	lsl r1, r0, #0x1
	ldrh r1, [r3, r1]
	cmp r1, r2
	beq species_to_regional_dex_return
	add r0, #0x1
	ldr r1, regional_dex_limit
	cmp r0, r1
	bls find_regional_number_loop
	mov r0, #0x0	@not in dex: set number to 0
species_to_regional_dex_return:
	bx lr



species_to_national_dex_number_1:
	ldr r1, f_species_to_nat_dex
	bx r1
.align
f_species_to_nat_dex:	.word 0x08043298 + 1

haz_national_dex_bool:
	ldr r0, f_haz_national_check
	bx r0
.align
f_haz_national_check:	.word 0x0806E25C + 1

dex_flag_check:
	ldr r3, f_dex_flag_check
	bx r3
.align
f_dex_flag_check:	.word 0x08104AB0 + 1

national_pokedex_count:
	ldr r1, f_national_pokedex_count
	bx r1
.align
f_national_pokedex_count:	.word 0x08088E8C + 1



.align
add_task_no_capture_display:	.word 0x08106B90 + 1
add_task_capture_display:	.word 0x08106BA4 + 1
dex_evolution_success_return:	.word 0x080CE948 + 1
dex_evolution_failure_return:	.word 0x080CE924 + 1
regional_dex_limit:	.word number_of_mons_in_regional_dex
national_dex_limit:	.word number_of_mons_in_national_dex
regional_dex_limit_return:	.word 0x0810353a + 1
regional_dex_hook_return:	.word 0x08103578 + 1
def_store_string_dex_number:	.word 0x081035D6 + 1
end_dex_display_return:	.word 0x08103906 + 1
dex_malloc_ptr:			.word 0x0203ACF0
dex_number_display_return:	.word 0x08104A70 + 1

regional_dex_order:
.hword	0x0000
.hword	TREECKO
.hword	GROVYLE
.hword	SCEPTILE
.hword	TORCHIC
.hword	COMBUSKEN
.hword	BLAZIKEN
.hword	MUDKIP
.hword	MARSHTOMP
.hword	SWAMPERT
.hword	POOCHYENA
.hword	MIGHTYENA
.hword	ZIGZAGOON
.hword	LINOONE
.hword	WURMPLE
.hword	SILCOON
.hword	BEAUTIFLY
.hword	CASCOON
.hword	DUSTOX
.hword	LOTAD
.hword	LOMBRE
.hword	LUDICOLO
.hword	SEEDOT
.hword	NUZLEAF
.hword	SHIFTRY
.hword	TAILLOW
.hword	SWELLOW
.hword	WINGULL
.hword	PELIPPER
.hword	RALTS
.hword	KIRLIA
.hword	GARDEVOIR
.hword	SURSKIT
.hword	MASQUERAIN
.hword	SHROOMISH
.hword	BRELOOM
.hword	SLAKOTH
.hword	VIGOROTH
.hword	SLAKING
.hword	ABRA
.hword	KADABRA
.hword	ALAKAZAM
.hword	NINCADA
.hword	NINJASK
.hword	SHEDINJA
.hword	WHISMUR
.hword	LOUDRED
.hword	EXPLOUD
.hword	MAKUHITA
.hword	HARIYAMA
.hword	GOLDEEN
.hword	SEAKING
.hword	MAGIKARP
.hword	GYARADOS
.hword	AZURILL
.hword	MARILL
.hword	AZUMARILL
.hword	GEODUDE
.hword	GRAVELER
.hword	GOLEM
.hword	NOSEPASS
.hword	SKITTY
.hword	DELCATTY
.hword	ZUBAT
.hword	GOLBAT
.hword	CROBAT
.hword	TENTACOOL
.hword	TENTACRUEL
.hword	SABLEYE
.hword	MAWILE
.hword	ARON
.hword	LAIRON
.hword	AGGRON
.hword	MACHOP
.hword	MACHOKE
.hword	MACHAMP
.hword	MEDITITE
.hword	MEDICHAM
.hword	ELECTRIKE
.hword	MANECTRIC
.hword	PLUSLE
.hword	MINUN
.hword	MAGNEMITE
.hword	MAGNETON
.hword	VOLTORB
.hword	ELECTRODE
.hword	VOLBEAT
.hword	ILLUMISE
.hword	ODDISH
.hword	GLOOM
.hword	VILEPLUME
.hword	BELLOSSOM
.hword	DODUO
.hword	DODRIO
.hword	ROSELIA
.hword	GULPIN
.hword	SWALOT
.hword	CARVANHA
.hword	SHARPEDO
.hword	WAILMER
.hword	WAILORD
.hword	NUMEL
.hword	CAMERUPT
.hword	SLUGMA
.hword	MAGCARGO
.hword	TORKOAL
.hword	GRIMER
.hword	MUK
.hword	KOFFING
.hword	WEEZING
.hword	SPOINK
.hword	GRUMPIG
.hword	SANDSHREW
.hword	SANDSLASH
.hword	SPINDA
.hword	SKARMORY
.hword	TRAPINCH
.hword	VIBRAVA
.hword	FLYGON
.hword	CACNEA
.hword	CACTURNE
.hword	SWABLU
.hword	ALTARIA
.hword	ZANGOOSE
.hword	SEVIPER
.hword	LUNATONE
.hword	SOLROCK
.hword	BARBOACH
.hword	WHISCASH
.hword	CORPHISH
.hword	CRAWDAUNT
.hword	BALTOY
.hword	CLAYDOL
.hword	LILEEP
.hword	CRADILY
.hword	ANORITH
.hword	ARMALDO
.hword	IGGLYBUFF
.hword	JIGGLYPUFF
.hword	WIGGLYTUFF
.hword	FEEBAS
.hword	MILOTIC
.hword	CASTFORM
.hword	STARYU
.hword	STARMIE
.hword	KECLEON
.hword	SHUPPET
.hword	BANETTE
.hword	DUSKULL
.hword	DUSCLOPS
.hword	TROPIUS
.hword	CHIMECHO
.hword	ABSOL
.hword	VULPIX
.hword	NINETALES
.hword	PICHU
.hword	PIKACHU
.hword	RAICHU
.hword	PSYDUCK
.hword	GOLDUCK
.hword	WYNAUT
.hword	WOBBUFFET
.hword	NATU
.hword	XATU
.hword	GIRAFARIG
.hword	PHANPY
.hword	DONPHAN
.hword	PINSIR
.hword	HERACROSS
.hword	RHYHORN
.hword	RHYDON
.hword	SNORUNT
.hword	GLALIE
.hword	SPHEAL
.hword	SEALEO
.hword	WALREIN
.hword	CLAMPERL
.hword	HUNTAIL
.hword	GOREBYSS
.hword	RELICANTH
.hword	CORSOLA
.hword	CHINCHOU
.hword	LANTURN
.hword	LUVDISC
.hword	HORSEA
.hword	SEADRA
.hword	KINGDRA
.hword	BAGON
.hword	SHELGON
.hword	SALAMENCE
.hword	BELDUM
.hword	METANG
.hword	METAGROSS
.hword	REGIROCK
.hword	REGICE
.hword	REGISTEEL
.hword	LATIAS
.hword	LATIOS
.hword	KYOGRE
.hword	GROUDON
.hword	RAYQUAZA
.hword	JIRACHI
.hword	DEOXYS
hello... it was indeeed a nice recoding of yours...

I have questions though, does the byte on the equ. part is the actual index number of that Pokémon or that is what can be seen in National Dex. I have, however, made the arrangement that all mons first and the the forms will be the last slot.. by doing that, do I have to edit the index and replace it with the corresponding pokemon index?

Also, does it support forms now? Liké Flabebe but they will share the same index 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.
Reply With Quote
  #1344   Link to this post, but load the entire thread.  
Old May 21st, 2018 (10:40 AM). Edited May 21st, 2018 by Spherical Ice.
Spherical Ice's Avatar
Spherical Ice Spherical Ice is offline
 
Join Date: Nov 2007
Location: Leicester, UK
Age: 25
Posts: 5,251
Quote:
Originally Posted by Neon Skylar View Post
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 ...
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.
__________________
Reply With Quote
  #1345   Link to this post, but load the entire thread.  
Old May 21st, 2018 (12:37 PM).
Neon Skylar's Avatar
Neon Skylar Neon Skylar is offline
 
Join Date: May 2014
Location: Venezuela n_n
Gender: Male
Posts: 75
Quote:
Originally Posted by Spherical Ice View Post
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.
Muchaaaaas Gracias Hermano :D it worked perfectly
Reply With Quote
  #1346   Link to this post, but load the entire thread.  
Old May 21st, 2018 (1:40 PM). Edited May 21st, 2018 by Dr. Seuss.
Dr. Seuss's Avatar
Dr. Seuss Dr. Seuss is offline
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 (?
Reply With Quote
  #1347   Link to this post, but load the entire thread.  
Old May 22nd, 2018 (2:54 AM).
Diego98 Diego98 is offline
 
Join Date: Jan 2015
Gender: Male
Posts: 22
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.
Reply With Quote
  #1348   Link to this post, but load the entire thread.  
Old May 22nd, 2018 (4:49 AM).
Spherical Ice's Avatar
Spherical Ice Spherical Ice is offline
 
Join Date: Nov 2007
Location: Leicester, UK
Age: 25
Posts: 5,251
Quote:
Originally Posted by Diego98 View Post
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.

So for example:

Code:
setvar 0x8004 0xA
giveitem ITEM_POTION 0x8004 MSG_OBTAIN
would give you 10 Potions.
__________________
Reply With Quote
  #1349   Link to this post, but load the entire thread.  
Old May 28th, 2018 (12:45 PM).
pikachux2's Avatar
pikachux2 pikachux2 is offline
Never Evolve
 
Join Date: Mar 2010
Location: USA
Gender: Male
Nature: Jolly
Posts: 115
Quote:
Originally Posted by Spherical Ice View Post
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.

So for example:

Code:
setvar 0x8004 0xA
giveitem ITEM_POTION 0x8004 MSG_OBTAIN
would give you 10 Potions.
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.
Reply With Quote
  #1350   Link to this post, but load the entire thread.  
Old May 31st, 2018 (9:51 AM).
ghoulslash's Avatar
ghoulslash ghoulslash is offline
 
Join Date: Mar 2016
Gender: Male
Posts: 238
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.
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content
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

Forum Jump


All times are GMT -8. The time now is 8:46 AM.