Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2014-04-06 16:45:08

G0ld Z!
Member
From: New Bark Town
Registered: 2013-11-01
Post 50/82
Website

Help With Battle Music Routine

Yesterday I tried to edit the Routine of battle music posted by IIMarckus, but the routine is very stranger to me, the routine is this:

; 44569
ld a,[$D118] ; are we fighting a trainer?
and a
jr nz,+$1E ; if so, go to 4458D
ld a,$24 ; check region
ld hl,$694E
rst $8
ld a,e
and a
jr nz,+$F ; if in Kanto, go to 44588
ld de,$0029 ; set song
ld a,[$D157] ; check time of day
cp 2
jr nz,+$68 ; if not nighttime, we’re done (go to 445EB)
ld de,$004A ; set song
jr +$63 ; we’re done

; 44588
ld de,$0008 ; set song
jr +$5E ; we’re done

; 4458D
ld de,$002F ; set song
cp $10
jr z,+$57 ; if fighting Lance, we’re done
cp $3F
jr z,+$53 ; if fighting Red, we’re done
ld de,$0031 ; set song
cp $1F
jr z,+$4C ; if fighting male Rocket grunt, we’re done
cp $42
jr z,+$48 ; if fighting female Rocket grunt, we’re done
ld de,$0006 ; set song
ld a,$F
ld hl,$5075
rst $8
jr c,+$3D ; if fighting a Kanto Gym Leader, we’re done
ld de,$002E ; set song
ld a,$F
ld hl,$507A
rst $8
jr c,+$32 ; if fighting a Johto Gym Leader / Elite Four member, we’re done
ld de,$0030 ; set song
ld a,[$D118]
cp $09
jr z,+$28 ; if fighting rival type 1, we’re done
cp $2A
jr nz,+$C ; if not fighting rival type 2, go to 445D3
ld a,[$D11B] ; which rival are we fighting?
cp $04
jr c,+$1D ; if it’s not the fight inside Indigo Plateau, we’re done
ld de,$002F ; set song
jr +$18 ; we’re done

; 445D3
ld a,[$D042]
and a
jr nz,+$A ; if link battle(?), go to 445E3
ld a,$24
ld hl,$694E
rst $8
ld a,e
and a
jr nz,+$5 ; if in Kanto, go to 445E3
ld de,$002A
jr +$3 ; we’re done

; 445E3
ld de,$0007

; we’re done

My question is:

How to repoint the routine in $4458D, I don't know how edit in $44569 the call of $4458D , I need add a new battle songs to a 5 trainer groups,  I want if the 5 trainer groups plays the rocket theme, but I dont like overwrite any data.

PD: My rom Is Pokemon Silver.
PD: I try to use a hex editor and Gameboy aseembler plus, but in both the routine fails.

Offline

#2 2014-04-06 22:10:31

Chamber_
Member
Registered: 2013-12-31
Post 21/119

Re: Help With Battle Music Routine

Facil.

Cuando la rutina principal inicia y hace la comprobación de D118 con el and a, ahi hay un "brinco" de $1E espacios a $4458D, entonces, para que no tengas que mover nada, al inico de $4458D has un call con la rutina extendida.

; 44569
ld a,[$D118] ; are we fighting a trainer?
and a
jr nz,+$1E ; if so, go to 4458D
...

; 4458D
call @rutina ; extendida a cualquier lugar del rom
ret

Recuerda que el call es con el 2-byte pointer permutado.

Last edited by Chamber_ (2014-04-06 22:11:26)

Offline

#3 2014-04-06 22:23:55

Hat
Member
Registered: 2013-02-04
Post 116/118

Re: Help With Battle Music Routine

Oh Miksy, you're so fine
You're so fine you blow my mind
Hey Miksy

Offline

#4 2014-04-06 23:21:37

G0ld Z!
Member
From: New Bark Town
Registered: 2013-11-01
Post 51/82
Website

Re: Help With Battle Music Routine

@Chamber: Remember, english forum, english words please

@Hat: I use your link, and try and make this extended routine

#org 47F80
cp a,1F
ret z
cp a,42
ret z
cp a,33
ret z
cp a,37
ret

And works very good! thanks, my question are solved!
but I dont know what thr Gameboy assembler plus cant dissasemble the routine on $4458D, after modify the routine the programs freeze ever, but the game works ok?? is very odd...

Offline

#5 2014-04-07 03:37:36

Chamber_
Member
Registered: 2013-12-31
Post 22/119

Re: Help With Battle Music Routine

La verdad me da flojera hacerlo en ingles.

Lo que pasa es que el "Gameboy assembler plus" es muy profesional para este tipo de trabajos. Debido a la gran cantidad de datos que se tienen que desplegar y organizar el juego termina colgandose.

Solucion: para rutinas sencillas usa "GbAsmEdit". El autor reporta que tiene uno que otro bug, pero la verdad nunca me ha pasado nada.

Offline

#6 2014-04-07 18:41:11

Miksy91
Member
Registered: 2010-10-16
Post 2,087/2,305

Re: Help With Battle Music Routine

Hat wrote:

Oh Miksy, you're so fine
You're so fine you blow my mind
Hey Miksy

What a nice poem you wrote.

I could start using search function to look posts I have made before myself. I was about to reply in this thread earlier by explaining things step-by-step but because that would have taken quite long and I didn't have much time, I just left posting nothing at all.

Last edited by Miksy91 (2014-04-07 18:41:24)

Offline

#7 2014-04-08 10:59:15

Hat
Member
Registered: 2013-02-04
Post 117/118

Re: Help With Battle Music Routine

Miksy91 wrote:

What a nice poem you wrote.

Oh, that :1 I put your name in an old pop song ^^

I thought it was funny that Chamber_ was replying in Spanish. I've been reading Don Quixote recently.

Offline

#8 2014-04-08 14:33:22

Miksy91
Member
Registered: 2010-10-16
Post 2,088/2,305

Re: Help With Battle Music Routine

Hat wrote:
Miksy91 wrote:

What a nice poem you wrote.

Oh, that :1 I put your name in an old pop song ^^

Ah, okay :)
I thought that was just a "joke poem" you had made up. Not that I was offended at all by thinking you had made that up as a joke either.
Could have probably recognized the song if it was more popular though, but never even heard of that one really.

Last edited by Miksy91 (2014-04-08 14:33:39)

Offline

Board footer

Powered by FluxBB