Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2014-10-15 02:20:05

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 2,918/3,503

Attack name limiter?

I've been running into an odd problem today while working with Pokered. All new attacks I've added after $C3 load HM01, HM02, etc for their name instead of the name that is in the list. Everything else about the attack works properly though. Is there some limiter on the amount of attack names that can be read? I'm currently looking for it myself, but I thought I would go ahead and ask while I'm looking into it in case someone already knows.


EDIT: After looking into it, I am even more confused.

GetMoveName:: ; 3058 (0:3058)
push hl
ld a,MOVE_NAME
ld [W_LISTTYPE],a
ld a,[wd11e]
ld [wd0b5],a
ld a,BANK(MoveNames)
ld [wPredefBank],a
call GetName
ld de,wcd6d ; pointer to where move name is stored in RAM
pop hl
ret

This seems to be the function called to show a move's name, and I see nothing resembling a limiter. I also haven't been getting any errors on compile to indicate that the list of names is overflowing the bank or anything.

Last edited by Mateo (2014-10-15 02:39:48)

Offline

#2 2014-10-15 02:54:49

ShantyTown
Member
Registered: 2013-12-04
Post 154/344

Re: Attack name limiter?

Take a look at the GetName function.  It has a check for the id being greater than or equal to $C4.

GetName:: ; 376b (0:376b)
; arguments:
; [$D0B5] = which name
; [$D0B6] = which list (W_LISTTYPE)
; [$D0B7] = bank of list
;
; returns pointer to name in de
    ld a,[$d0b5]
    ld [$d11e],a
    cp a,$C4        ;it's TM/HM
    jp nc,GetMachineName

You want something like this:

GetName:: ; 376b (0:376b)
; arguments:
; [$D0B5] = which name
; [$D0B6] = which list (W_LISTTYPE)
; [$D0B7] = bank of list
;
; returns pointer to name in de
    ld a, [W_LISTTYPE]
    cp MOVE_NAME
    ld a,[$d0b5]
    ld [$d11e],a
    jr z, .nonMachine
    cp a,$C4        ;it's TM/HM
    jp nc,GetMachineName

Last edited by ShantyTown (2014-10-15 02:56:52)

Offline

#3 2014-10-15 03:09:08

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 2,919/3,503

Re: Attack name limiter?

Awesome, thanks man. That fixed it right up.

Offline

#4 2014-10-15 06:27:17

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

Re: Attack name limiter?

Use ITEM_NAME/nz so this doesn't happen with monster names either.

Offline

#5 2014-10-15 15:38:17

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 2,920/3,503

Re: Attack name limiter?

Good call. Thanks comet.

Offline

#6 2014-10-16 21:00:44

pagara123
Member
Registered: 2013-11-06
Post 80/118
Website

Re: Attack name limiter?

hmm i want you to use hex editor and repoint the name to change it without limit like i change to pokedex that i learn from piacarrot
the offsets of tm/hm technique in rom is 0x011A66-0x011AA2
try it

my hack:
FluxBB bbcode test

Offline

#7 2014-10-16 22:12:10

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 2,922/3,503

Re: Attack name limiter?

pagara123 wrote:

hmm i want you to use hex editor and repoint the name to change it without limit like i change to pokedex that i learn from piacarrot
the offsets of tm/hm technique in rom is 0x011A66-0x011AA2
try it

my hack:
http://pokemonhackersonline.com/attachm … 1413321120

I'm honestly not sure what you were trying to say here. I can't tell if you were telling me I should use a hex editor, or if you were asking how you could do it in a hex editor. If you were telling me to, thanks but I already have it sorted out. If you were asking how to do it, I'm honestly not sure where the routines are in an already compiled rom, and you would have to edit the ASM routine we were talking about in addition to repointing the table.

Offline

#8 2016-01-07 05:15:09

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,218/3,503

Re: Attack name limiter?

Bumping this old thread to point out that apparently the fix we came up with causes its own set of problems, where TMs will sometimes just crash the game when you click on them, before the Use/Toss menu even comes up. It seems that TM/HMs manage to load this routine without actually having a meaningful value loaded as the list type, which is why the TM/HM check is the very first thing it does. Been looking into potential workarounds with Crystal_, but I wanted to bring this up since it seems like an issue that could have an impact on other people as well.

Last edited by Mateo (2016-01-07 05:15:44)

Offline

Board footer

Powered by FluxBB