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
  #1251   Link to this post, but load the entire thread.  
Old September 17th, 2017 (11:17 PM).
Enn's Avatar
Enn Enn is offline
 
Join Date: Jan 2017
Gender: Male
Posts: 185
Quote:
Originally Posted by BluRose View Post
legit take the routine for special 0x9F
replace the part where it accesses your party with the new ram address. this likely just involves replacing an address from the routine, literally nothing more. callasm the new special and ezpz
Say I located the routine, but how do u decompile the routine in hex to actual asm???
Reply With Quote
  #1252   Link to this post, but load the entire thread.  
Old September 18th, 2017 (4:56 AM).
BluRose BluRose is offline
blu rass
 
Join Date: Apr 2014
Location: michigan tech
Age: 22
Gender: Male
Nature: Timid
Posts: 812
Quote:
Originally Posted by Nisarg View Post
Say I located the routine, but how do u decompile the routine in hex to actual asm???
two easy ways
look in knizz's idb
disassemble in vba
__________________
heyo check out my github:

BluRosie
highlights:
battle engine for heartgold
various feature branches in heart gold (fairy type, odd egg, mud slopes)

i'm a big part of the development team of pokemon firegold! all the code that i develop for that hack is also on my github

also on discord: BluRose#0412
Reply With Quote
  #1253   Link to this post, but load the entire thread.  
Old September 30th, 2017 (9:49 PM).
Wesley FG's Avatar
Wesley FG Wesley FG is offline
Pokémon Kalos Advance !! Gba Hack
 
Join Date: Oct 2008
Location: Brazil
Gender: Male
Nature: Modest
Posts: 338
Someone can convert it for EM ?

Quote:
Originally Posted by Touched View Post
Change the order that badges appear on the trainer card (untested)
Simply makes the loop read from a lookup table before checking for the badge.
Spoiler:

Code:
.align 2
.thumb
    
@ 00 4B 18 47 XX + 1 XX XX 08 at 0x08AFC8 (0808AFC8 via r3)
hook_name:
    asr r7, r0, #0x10
    add r1, #0x11
    adr r0, order_table
    ldrb r0, [r0, r7]
    add r1, r1, r0
    ldrb r0, [r1]
    ldr r3, return
    bx r3
    
.align 2
return: .word 0x0808AFD0 + 1

@ Change the badge order using this table (reverse order)
order_table: .byte 7, 6, 5, 4, 3, 2, 1, 0
__________________
Kalos Demake Soon!!
Reply With Quote
  #1254   Link to this post, but load the entire thread.  
Old October 3rd, 2017 (2:32 PM).
BluRose BluRose is offline
blu rass
 
Join Date: Apr 2014
Location: michigan tech
Age: 22
Gender: Male
Nature: Timid
Posts: 812
Quote:
Originally Posted by Wesley FG View Post
Someone can convert it for EM ?
Code:
.align 2
.thumb
    
@ 00 4B 18 47 XX + 1 XX XX 08 at 0x0C4684 (080C4684 via r3)
hook_name:
    asr r7, r0, #0x10
    add r1, #0x11
    adr r0, order_table
    ldrb r0, [r0, r7]
    add r1, r1, r0
    ldrb r0, [r1]
    ldr r3, return
    bx r3
    
.align 2
return: .word 0x080C468C + 1

@ Change the badge order using this table (reverse order)
order_table: .byte 7, 6, 5, 4, 3, 2, 1, 0
here you go
__________________
heyo check out my github:

BluRosie
highlights:
battle engine for heartgold
various feature branches in heart gold (fairy type, odd egg, mud slopes)

i'm a big part of the development team of pokemon firegold! all the code that i develop for that hack is also on my github

also on discord: BluRose#0412
Reply With Quote
  #1255   Link to this post, but load the entire thread.  
Old October 6th, 2017 (12:26 PM). Edited October 6th, 2017 by Megax Rocker.
Megax Rocker's Avatar
Megax Rocker Megax Rocker is offline
 
Join Date: Jan 2016
Posts: 112
Is it possible to alter the breeding mechanism in FR? Having the egg be only be the mother's species and inherit moves from only the father is limited.

I'm thinking of the egg having a 50% chance to be either species instead, so that male only pokemon would still breed normally, and egg moves would be possible for them as well.

Would probably be much better than the regular one IMO.
Reply With Quote
  #1256   Link to this post, but load the entire thread.  
Old October 7th, 2017 (12:47 PM).
Wesley FG's Avatar
Wesley FG Wesley FG is offline
Pokémon Kalos Advance !! Gba Hack
 
Join Date: Oct 2008
Location: Brazil
Gender: Male
Nature: Modest
Posts: 338
Quote:
Originally Posted by BluRose View Post
Code:
.align 2
.thumb
    
@ 00 4B 18 47 XX + 1 XX XX 08 at 0x0C4684 (080C4684 via r3)
hook_name:
    asr r7, r0, #0x10
    add r1, #0x11
    adr r0, order_table
    ldrb r0, [r0, r7]
    add r1, r1, r0
    ldrb r0, [r1]
    ldr r3, return
    bx r3
    
.align 2
return: .word 0x080C468C + 1

@ Change the badge order using this table (reverse order)
order_table: .byte 7, 6, 5, 4, 3, 2, 1, 0
here you go

i test and not work
__________________
Kalos Demake Soon!!
Reply With Quote
  #1257   Link to this post, but load the entire thread.  
Old October 17th, 2017 (12:22 PM).
MKCocoon's Avatar
MKCocoon MKCocoon is offline
 
Join Date: Oct 2015
Location: Canada
Gender: Male
Posts: 19
I have a request:

So FireRed's egg move table only accounts for 8 egg moves. My hack, Pokemon Vega Minus, is obviously derived from the original English translation of Vega by Dr. Akimbo. The problem is, egg moves are busted in both my hack and his because in Vega, Pokemon have anywhere from 15 to 37 egg moves.

So I was able to fix it somewhat by replacing the 0x9 at 0x0456AC with 0x30 (just an arbitrarily large number), and then fixing the limiter at 0x045CC4, but since the amount of RAM allocated to egg moves only can account for ten moves without overflowing, I'm worried this could result in glitches.

In this thread, FBI explains how to fix the crappy way the game checks for egg moves using ASM, except since I know nothing about ASM, it doesn't make any sense to me. Apparently it's simple for people who do understand ASM though, so if anyone could help me out it'd be great. You can go download my patch for reference if needed. I'd also need to know how to implement the ASM into the game.

Thanks in advance.
Reply With Quote
  #1258   Link to this post, but load the entire thread.  
Old October 18th, 2017 (5:03 PM).
Lunos's Avatar
Lunos Lunos is offline
Random Uruguayan User
 
Join Date: Oct 2008
Location: Montevideo (Uruguay)
Gender: Male
Nature: Lonely
Posts: 3,000
Quote:
Originally Posted by Wesley FG View Post
i test and not work
I just tested it, and it does.

1) Copy the routine and paste it in a .txt file, change the order however you want and give the file an easy-to-remember name.

2) Pass it through HackMew's thumb.bat

3) Grab the compiled routine from its .bin file and paste it in an offset that ends in 0, 4, 8 or C and that also has free space in your ROM.

4) Go to the offset 0C4684 and Paste-Write (Ctrl+B) this:
Code:
00 4B 18 47 XX XX XX 08
XX XX XX = Pointer to the offset+1 where you've inserted the routine.
Example: I've put it in E3CF80, then I'd replace XX XX XX with 81 CF E3.

5) Test.
__________________
Reply With Quote
  #1259   Link to this post, but load the entire thread.  
Old October 19th, 2017 (4:05 AM).
Wesley FG's Avatar
Wesley FG Wesley FG is offline
Pokémon Kalos Advance !! Gba Hack
 
Join Date: Oct 2008
Location: Brazil
Gender: Male
Nature: Modest
Posts: 338
Quote:
Originally Posted by Lunos View Post
I just tested it, and it does.

1) Copy the routine and paste it in a .txt file, change the order however you want and give the file an easy-to-remember name.

2) Pass it through HackMew's thumb.bat

3) Grab the compiled routine from its .bin file and paste it in an offset that ends in 0, 4, 8 or C and that also has free space in your ROM.

4) Go to the offset 0C4684 and Paste-Write (Ctrl+B) this:
Code:
00 4B 18 47 XX XX XX 08
XX XX XX = Pointer to the offset+1 where you've inserted the routine.
Example: I've put it in E3CF80, then I'd replace XX XX XX with 81 CF E3.

5) Test.

i know compile and insert asm routines, and i test it again and not work,
you can post the hex compiled bin generate for you:
for my it:

Quote:
07 14 11 31 03 A0 C0 5D 09 18 08 78 00 4B 18 47
8D 46 0C 08 07 06 03 02 05 04 01 00
and not work, you really check it ?
__________________
Kalos Demake Soon!!
Reply With Quote
  #1260   Link to this post, but load the entire thread.  
Old October 19th, 2017 (4:28 AM).
BluRose BluRose is offline
blu rass
 
Join Date: Apr 2014
Location: michigan tech
Age: 22
Gender: Male
Nature: Timid
Posts: 812
Quote:
Originally Posted by Wesley FG View Post
i know compile and insert asm routines, and i test it again and not work,
you can post the hex compiled bin generate for you:
for my it:

and not work, you really check it ?
to be honest i don't understand why this would even be necessary; just replace the graphics if it's really not working for you, although i regrettably inform you that i think lunos is right as i also tested it myself, so... yeah
__________________
heyo check out my github:

BluRosie
highlights:
battle engine for heartgold
various feature branches in heart gold (fairy type, odd egg, mud slopes)

i'm a big part of the development team of pokemon firegold! all the code that i develop for that hack is also on my github

also on discord: BluRose#0412
Reply With Quote
  #1261   Link to this post, but load the entire thread.  
Old October 19th, 2017 (6:24 AM). Edited October 19th, 2017 by Wesley FG.
Wesley FG's Avatar
Wesley FG Wesley FG is offline
Pokémon Kalos Advance !! Gba Hack
 
Join Date: Oct 2008
Location: Brazil
Gender: Male
Nature: Modest
Posts: 338
Quote:
Originally Posted by BluRose View Post
to be honest i don't understand why this would even be necessary; just replace the graphics if it's really not working for you, although i regrettably inform you that i think lunos is right as i also tested it myself, so... yeah
you change some badge of position, for test ?
i change the 5th with 3th (for use surf after 3 gym)
and 6th with 4th (for use fly after 4 gym)
and my changes no have any efecct, the badges apppear in the same order
__________________
Kalos Demake Soon!!
Reply With Quote
  #1262   Link to this post, but load the entire thread.  
Old October 19th, 2017 (6:47 AM).
BluRose BluRose is offline
blu rass
 
Join Date: Apr 2014
Location: michigan tech
Age: 22
Gender: Male
Nature: Timid
Posts: 812
Quote:
Originally Posted by Wesley FG View Post
you change some badge of position, for test ?
i change the 5th with 3th (for use surf after 3 gym)
and 6th with 4th (for use fly after 4 gym)
and my changes no have any efecct, the badges apppear in the same order
this has no effect on how the badges are awarded, in what order in the game's story, or which badge awards which move. this solely affects in which order the badges show up on the bottom of the front side of the trainer card
__________________
heyo check out my github:

BluRosie
highlights:
battle engine for heartgold
various feature branches in heart gold (fairy type, odd egg, mud slopes)

i'm a big part of the development team of pokemon firegold! all the code that i develop for that hack is also on my github

also on discord: BluRose#0412
Reply With Quote
  #1263   Link to this post, but load the entire thread.  
Old October 19th, 2017 (11:17 AM).
Wesley FG's Avatar
Wesley FG Wesley FG is offline
Pokémon Kalos Advance !! Gba Hack
 
Join Date: Oct 2008
Location: Brazil
Gender: Male
Nature: Modest
Posts: 338
Quote:
Originally Posted by BluRose View Post
this has no effect on how the badges are awarded, in what order in the game's story, or which badge awards which move. this solely affects in which order the badges show up on the bottom of the front side of the trainer card
yes i understand all, i change the order of 3 badge with 5 badge, and no have effect in game.
the badges are same original positions.
__________________
Kalos Demake Soon!!
Reply With Quote
  #1264   Link to this post, but load the entire thread.  
Old October 19th, 2017 (1:45 PM). Edited October 19th, 2017 by Lunos.
Lunos's Avatar
Lunos Lunos is offline
Random Uruguayan User
 
Join Date: Oct 2008
Location: Montevideo (Uruguay)
Gender: Male
Nature: Lonely
Posts: 3,000
Quote:
Originally Posted by Wesley FG View Post
you can post the hex compiled bin generate for you
07 14 11 31 03 A0 C0 5D 09 18 08 78 00 4B 18 47 8D 46 0C 08 05 04 07 06 01 00 03 02
Order: 5, 4, 7, 6, 1, 0, 3, 2

Also, I'm seeing that you have an empty space after that 00, delete it.
__________________
Reply With Quote
  #1265   Link to this post, but load the entire thread.  
Old October 22nd, 2017 (7:31 AM).
linobigatti linobigatti is offline
 
Join Date: Dec 2016
Posts: 10
can i run a ASM routine forever in second plane? how?
Reply With Quote
  #1266   Link to this post, but load the entire thread.  
Old October 22nd, 2017 (2:05 PM).
ghoulslash's Avatar
ghoulslash ghoulslash is offline
 
Join Date: Mar 2016
Gender: Male
Posts: 238
Here's kind of a silly routine I made for fun.

Custom Vs. Seeker Pedometer [FR]

This will let you change the amount of steps needed to activate the vs. seeker. You can make it step-independent, increase or decrease as the game progresses, or have some random fluctuations, or anything you like.

It requires 2 bytes of free RAM. JPANs save block hack is needed to allow the pedometer to save. The first byte will hold the pedometer value, and the second will hold the 'charged up' limit. When the pedometer reaches this value, the vs. seeker is usable, and then reset upon use.

To change the required steps, just set your second RAM byte to whatever you like. This can easily be done in XSE. Just be sure to set the limit when the player receives the item.

Note: I'm not sure if this is an existing Vs. seeker feature or not, but using it even when there are no trainers are around resets the pedometer. Although from a logical standpoint this makes sense regardless.

Now, for the routines! There are two of them you will need. (insertion instructions in comments of each routine)

First: Change Vs. Seeker Routine to Check our new Pedometer
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func
.global Vs_Seeker_hack
/*
insert 00 48 00 47 (xx+1) xx xx 08 at 0x10c970
*/

Main:
	ldr r0, .Pedometer
	ldrb r1, [r0]			@pedometer value
	ldrb r0, [r0, #0x1]		@pedometer max
	cmp r1, r0
	beq Usable
	
Unusable:
	sub r1, r0, r1		@limit - num steps = num steps remaining
	ldr r0, =(0x0810c99c +1)
	bx r0
	
Usable:
	mov r0, #0x0
	ldr r1, .Pedometer
	strb r0, [r1]			@reset pedometer to zero
	ldrb r0, =(0x0810c97e +1)
	bx r0
	
.align 2
.Pedometer:	.word 0x02XXXXXX


Second: Increase pedometer each step (you will have to merge with the hp loss/gain each step routines)
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func
/*
insert 01 4A 10 47 00 00 (xx+1) xx xx 08 at 6D5F6
*/
Main:
        push {r0-r2}
	ldr r2, =(0x02XXXXXX)	@new pedometer loc
	ldrb r0, [r2]
	ldrb r1, [r2, #0x1]		@pedometer limit
	cmp r0, r1
	beq end
	add r0, #0x1	@increase
	strb r0, [r2]

end:
	pop {r0-r2}
	lsl r0, r0, #0x18
	lsr r0, r0, #0x18
	cmp r0, #0x1
	beq branch
	mov r0, r5
	ldr r1, =(0x806D600 +1)
	bx r1

branch:
	ldr r0, =(0x806D650 +1)
	bx r0
Reply With Quote
  #1267   Link to this post, but load the entire thread.  
Old October 29th, 2017 (9:19 PM).
thedarkgod thedarkgod is offline
 
Join Date: Sep 2013
Gender:
Posts: 21
Hello,

I know this is something which has been requested by others before, but I would like to request a way to store the current hp of pokemon being deposited in the pc storage system.

This would allow us to control any way in which a pokemon can be healed.

Spoiler:

I believe it should be possible to implement by intercepting the script of depositing a pokemon, then store the current hp value in an offset together with a unique id of the pokemon. Then also intercept the script called on withdrawal, and try the id of the pokemon against the id stored at the offset, and if it matches apply the value stored at depositing to current hp.

There would most certainly be bugs, such as not displaying the current hp when inspected, but it would be a way to implement a bare-bone system.


I don't know enough asm to evaluate how hard this would be to implement, but it would be a very good function to have, as it would allow a lot more flexibility with the kind of game-play changes you could implement.
Reply With Quote
  #1268   Link to this post, but load the entire thread.  
Old November 10th, 2017 (5:10 AM). Edited November 10th, 2017 by Lunos.
Lunos's Avatar
Lunos Lunos is offline
Random Uruguayan User
 
Join Date: Oct 2008
Location: Montevideo (Uruguay)
Gender: Male
Nature: Lonely
Posts: 3,000
Hi, I wanted to make a request. I don't know if it's simple or not but I hope it is.
I'd like an ASM Routine for Fire Red, that checks a Pokémon in your party and returns 0x1 in the var 0x8004, if it's an egg. Would that be possible?

I'm basically thinking in a script that forcefully hatches an egg.
Right now, if someone decided to make such a routine, I imagine that it could be used like this:
Code:
special 0x9F // Pick a Pokémon
waitstate
callasm 0x8XXXXXX|0x8XXXXXX+1 // This would check if the Slot that the Player picked in the special 0x9F is an egg or not, and if it is, it would set to 0x1 the Var 0x8004. 
compare 0x8004 0x1
if 0x1 goto @hatch

#org @hatch
special 0xC2 // Hatch the egg
__________________
Reply With Quote
  #1269   Link to this post, but load the entire thread.  
Old November 10th, 2017 (5:54 AM).
Squeetz's Avatar
Squeetz Squeetz is offline
ROM Hacker
 
Join Date: Jun 2013
Location: Norway
Age: 25
Gender: Male
Nature: Quiet
Posts: 236
Quote:
Originally Posted by Lunos View Post
(...) returns 0x1 in the var 0x8004, if it's an egg. Would that be possible?
There is actually already a special in Firered that checks if what you chose is an egg or not.
Usage:
Code:
(...)
special 0x9f
waitstate
compare 0x8004 0x6
if 0x4 goto @cancelled
special2 0x800d 0x147 - this is the special
compare 0x800d 0x19c - check if egg
if 0x1 goto @itsanegg
(...)
__________________
Reply With Quote
  #1270   Link to this post, but load the entire thread.  
Old November 10th, 2017 (10:00 PM).
Delta231's Avatar
Delta231 Delta231 is offline
A noob
 
Join Date: May 2016
Location: India
Gender: Male
Nature: Bold
Posts: 682
I would like to make request (FR)

An Asm routine which give separate pallets to maps ows (boy and girl)
__________________
HGSS OWs in FR Style
Fire Red NSE Bookmarks


A supporter of


Reply With Quote
  #1271   Link to this post, but load the entire thread.  
Old November 11th, 2017 (3:26 AM).
Megax Rocker's Avatar
Megax Rocker Megax Rocker is offline
 
Join Date: Jan 2016
Posts: 112
Quote:
Originally Posted by BluRose View Post
smh nathan closing tabs like what the hell

EXPANDING THE THING THAT MAKES NIDORAN'S/ILLUMISE'S MALE VARIANTS HATCH FROM EGGS
based on a table

first, the routine:
Spoiler:
Code:
.text
.align 2
.thumb

@ hook via r1 (00 49 08 47 XX+1 XX XX XX) at 46068 (BPRE) / 70858 (BPEE) / 415F6 (AXVE)

main:
	ldr r7, terminate
	mov r3, #0x0
loop:
	ldr r0, table
	lsl r2, r3, #0x1
	add r2, r0, r2
	ldrh r5, [r2, #0x0]
	cmp r5, r7
	beq return
	add r3, #0x1
	cmp r5, r4
	bne loop
	mov r0, #0x8C
	lsl r0, r0, #0x1
	add r0, r8
	ldrh r1, [r0]
	mov r0, #0x80
	lsl r0, r0, #0x8
	and r0, r1
	cmp r0, #0x0
	beq return
	ldrh r4, [r2, #0x2]
return:
	ldr r1, getparents
	bx r1

.align 2

getparents:
	.word 0x0804609B	@ 0x0804609B BPRE; 0x0807088D BPEE; 0x08041F88 AXVE
terminate:
	.word 0x0000FEFE @ end the table below with this
table:				@change as is necessary
	.word table1 + 0x[place where you plan on inserting this]
table1:
	.hword 0x001D		@ nidoran female
	.hword 0x0020		@ nidoran male
	.hword 0x0183		@ illumise
	.hword 0x0182		@ volbeat
				@ theoretical new entries
	.word 0x0000FEFE

usage:
- table at the end has a structure:
[hword] - species 1
[hword] - species 2
an egg that is supposed to be species 1 has a 50% chance of turning into species 2 (note at the bottom), and it NEEDS to end with FE FE 00 00 as it does in the example.
- i included addresses for emerald and ruby as well. replace as desired (the hook address and the getparents routine address)
- you need to know where you are going to insert the routine BEFORE compiling it; the table is placed right after the routine and is referenced as such.

proof of concept:
Spoiler:

first from female bulba x male venusaur, second from male bulba x ditto, third from illumise and volbeat, last from nidoran(f) x ditto


shoutouts to doesntknowhowtoplay for his research on the subject and to chaotix for initial testing and suggesting the idea of a table instead of some extremely inefficient shtuff that was originally going to happen.

notes:
- species 2 does not ever turn into species 1. so you're breeding your volbeat to get an illumise? you'll only ever get volbeat. just add an entry for volbeat to illumise.
- if you want species 1 to turn into multiple species: i have been testing for literally five hours with the game running consistently at about 300% and have yet to see a phanpy come from my illumise. moral of the story: this code, even with modifications telling it to continue looping after setting the id, doesn't support 1 pokémon to multiple.
i did however manage to get illumise and this after doing like a weird chain thing (illumise -> volbeat -> phanpy), but it negated volbeat, and no we'd not like that:

- not tested on bpee or axve but there is no reason it shouldn't work (axve is the same thing while bpee i think interchanges two different registers)
- OH ALSO you have 0x2A bytes of unused space at 46070 for you to use for whatever! knock yourself out with all of that free space
Can make a request?

Is it possible to make the species of the egg have a 50/50 chance of belonging to either of the parents?

For example, ditto and bulbasaur egg would result in a either a ditto or a bulbasaur to hatch, or an egg between a male bulbasaur and female charmander would result in either a bulbasaur egg or a charmander one.
Reply With Quote
  #1272   Link to this post, but load the entire thread.  
Old November 12th, 2017 (7:40 PM).
BluRose BluRose is offline
blu rass
 
Join Date: Apr 2014
Location: michigan tech
Age: 22
Gender: Male
Nature: Timid
Posts: 812
Quote:
Originally Posted by Megax Rocker View Post
Can make a request?

Is it possible to make the species of the egg have a 50/50 chance of belonging to either of the parents?

For example, ditto and bulbasaur egg would result in a either a ditto or a bulbasaur to hatch, or an egg between a male bulbasaur and female charmander would result in either a bulbasaur egg or a charmander one.
just add a second entry for the other way round to the table:
Code:
table1:
        .hword 0x001D @ nidoranf to
        .hword 0x0020 @ nidoranm
        .hword 0x0020 @ nidoranm to 
        .hword 0x001D @ nidoranf
        .hword 0x0183 @ illumise to
        .hword 0x0182 @ volbeat
        .hword 0x0182 @ volbeat to
        .hword 0x0183 @ illumise
__________________
heyo check out my github:

BluRosie
highlights:
battle engine for heartgold
various feature branches in heart gold (fairy type, odd egg, mud slopes)

i'm a big part of the development team of pokemon firegold! all the code that i develop for that hack is also on my github

also on discord: BluRose#0412
Reply With Quote
  #1273   Link to this post, but load the entire thread.  
Old November 19th, 2017 (2:47 AM). Edited November 19th, 2017 by Megax Rocker.
Megax Rocker's Avatar
Megax Rocker Megax Rocker is offline
 
Join Date: Jan 2016
Posts: 112
Quote:
Originally Posted by BluRose View Post
just add a second entry for the other way round to the table:
Code:
table1:
        .hword 0x001D @ nidoranf to
        .hword 0x0020 @ nidoranm
        .hword 0x0020 @ nidoranm to 
        .hword 0x001D @ nidoranf
        .hword 0x0183 @ illumise to
        .hword 0x0182 @ volbeat
        .hword 0x0182 @ volbeat to
        .hword 0x0183 @ illumise
That's pretty good and it actually helps but it's not what I was talking about, I probably wasn't clear.

What I meant is, is it possible to have the routine check the father's and the mother's species and the resulting eggs would be either of them?

The egg will always be the mother's species, e.g male Bulbasaur and a female Charmander will always produce Charmander eggs.

Your routine would make it possible for Bulbasaur eggs to be produced, but charmander would produce bulbasaur eggs even if it breeds with other species.

What I'm thinking of is a universal chance of having the produced egg be of either species of the parents, this would allow ditto and male only pokemon to hatch eggs of their own species with any pokemon species.

Sorry for not being clear.
Reply With Quote
  #1274   Link to this post, but load the entire thread.  
Old November 27th, 2017 (7:17 AM). Edited November 27th, 2017 by Lunos.
Lunos's Avatar
Lunos Lunos is offline
Random Uruguayan User
 
Join Date: Oct 2008
Location: Montevideo (Uruguay)
Gender: Male
Nature: Lonely
Posts: 3,000
My last request was solved by normal means. I think that this one won't or might not be as easy though.

I did check JPAN's thread with the Fire Red specials and I found nothing about a command that saves the amount of happiness/friendship that a Pokémon has for the user to use however he wants.
So, can someone make a simple routine for Pokémon Fire Red that checks the amount of Friendship/Happiness that a Pokémon in the var 0x8004 has, and saves the actual amount of points in a different value.. say, 0x8005?

Example:
Spoiler:
(...)
special 0x9F // Pick a Pokémon and saves its Slot in 0x8004
waitstate
bufferpokemon 0x0 0x8004 // Saves the Pokémon in 0x8004 inside the Buffer #1 for msgbox purposes
callasm 0x8XXXXXX/0x8XXXXXX+1 // Would check the happiness of the Pokémon in 0x8004 and save it as a number in 0x8005
buffernumber 0x1 0x8005 // Saves the amount of Happiness in 0x8005 for msgbox purposes
msgbox @1 0x6
(...)

#org @1
= Your [BUFFER1] has [BUFFER2] happiness points.
__________________
Reply With Quote
  #1275   Link to this post, but load the entire thread.  
Old November 27th, 2017 (1:58 PM). Edited November 27th, 2017 by ghoulslash.
ghoulslash's Avatar
ghoulslash ghoulslash is offline
 
Join Date: Mar 2016
Gender: Male
Posts: 238
Quote:
Originally Posted by Lunos View Post
can someone make a simple routine for Pokémon Fire Red that checks the amount of Friendship/Happiness that a Pokémon in the var 0x8004 has, and saves the actual amount of points in a different value.. say, 0x8005?
Here you go! (admittedly I have not tested it)

Code:
.text
.align 2
.thumb
.thumb_func
.global GetHappiness

Main:
	push {r0-r2, lr}
	ldr r0, .var8004
	ldrb r0, [r0]	@slot num
	mov r1, #0x64
	mul r0, r1
	ldr r1, .PartyData
	add r0, r1, r0
	mov r1, #0x20	@happiness
	bl GetAttribute
	ldr r1, .var8004
	strb r0, [r1, #0x2]	@store into var8005
	pop {r0-r2, pc}
	
GetAttribute:
	ldr r2, =(0x0803FBE8 +1)
	bx r2
	
.align 2
.PartyData:	.word 0x02024284
.var8004:	.word 0x020370C0
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:50 AM.