Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2012-12-10 04:30:57

delpo
Member
Registered: 2012-11-26
Post 20/40

Finding the location of an asm routine

So from seeing some examples of different routines explained on some threads here, I'm getting a good understanding of how the routines work.  The problem is, I have no idea how you guys are finding what offset the routines begin at.  Is it a matter of setting breakpoints until you can isolate the location?

Offline

#2 2012-12-10 05:03:16

comet
Member
Registered: 2012-04-09
Post 46/679

Re: Finding the location of an asm routine

It really depends on what you're looking for. Is there something you had in mind?

Offline

#3 2012-12-10 05:29:41

573/701

Re: Finding the location of an asm routine

Finding an ASM routine takes some planning. It helps to have some base from which to find it, like a memory location. For example: to find the shiny check function in GSC, I set a read breakpoint on $D0F5 (the Attack/Defense DV for wild Pokémon) and then purposely encountered the Red Gyarados.

#4 2012-12-10 07:01:08

delpo
Member
Registered: 2012-11-26
Post 21/40

Re: Finding the location of an asm routine

comet wrote:

It really depends on what you're looking for. Is there something you had in mind?

IIMarckus wrote:

Finding an ASM routine takes some planning. It helps to have some base from which to find it, like a memory location. For example: to find the shiny check function in GSC, I set a read breakpoint on $D0F5 (the Attack/Defense DV for wild Pokémon) and then purposely encountered the Red Gyarados.

Okay, so three things in particular I am looking to change are: making tm's have unlimited use, making hm moves easily forgettable, and changing the experience formula so that trainers do not give 1.5x the normal experience for defeating pokemon.

I can only guess what would be a good base for these objectives.  For tm's, I would guess the usage would follow the same routine as any other item, for hm's relative permanence I have no idea, and for the experience bonus to find the formula routine I would think you could use the base experience for each pokemon as a base.

So after thinking of a base, you set a breakpoint at the location that part is in the rom?

Offline

#5 2012-12-10 07:16:47

Miksy91
Member
Registered: 2010-10-16
Post 1,306/2,311

Re: Finding the location of an asm routine

You don't necessarily have to use bgb's debugging function to search what you're looking for. If I was to make HMs forgettable myself, I'd first look for the text string displayed when you try to forget a HM move. Next, sarch for the pointer to that string which would eventually lead into finding the asm routine which "uses" that pointer.

About experience gain there, I'd probably start debugging from CF7E once a pokemon (used by a trainer) is defeated.

From a gameshark code site:

experience :  01??7ECF
points given   01??7FCF
 modifier

Last edited by Miksy91 (2012-12-10 07:19:20)

Offline

#6 2012-12-12 22:05:13

delpo
Member
Registered: 2012-11-26
Post 26/40

Re: Finding the location of an asm routine

IIMarckus wrote:

Finding an ASM routine takes some planning. It helps to have some base from which to find it, like a memory location. For example: to find the shiny check function in GSC, I set a read breakpoint on $D0F5 (the Attack/Defense DV for wild Pokémon) and then purposely encountered the Red Gyarados.

Okay so I tried doing this to see if I could end up at the right offset (x9052), but I was unsuccessful through bgb's debugger.  Can you elaborate on how that breakpoint lead you to x9052?

Offline

Board footer

Powered by FluxBB