You are not logged in.
Pages: 1
.moveAhead2
ld hl,wFlags_0xcd60
res 2,[hl]
ld a,[wWalkBikeSurfState]
dec a ; riding a bike?
jr nz,.normalPlayerSpriteAdvancement
ld a,[wd736]
bit 6,a ; jumping a ledge?
jr nz,.normalPlayerSpriteAdvancement
call BikeSpeedup ; if riding a bike and not jumping a ledge
call BikeSpeedup ; added
call BikeSpeedup ; added
jr .notRunning
.normalPlayerSpriteAdvancement
; Make you surf at bike speed
ld a,[wWalkBikeSurfState]
cp a, $02
jr z, .surfFaster
; Add running shoes
ld a, [hJoyHeld] ; Check what buttons are being pressed
and B_BUTTON ; Are you holding B?
jr z, .notRunning ; If you aren't holding B, skip ahead to step normally.
.surfFaster
call BikeSpeedup ; Make you go faster if you were holding B
.notRunning ; Normal code resumes here
call AdvancePlayerSprite
ld a,[wWalkCounter]
and a
jp nz,CheckMapConnections ; it seems like this check will never succeed (the other place where CheckMapConnections is run works)
; walking animation finished
call StepCountCheck
CheckEvent EVENT_IN_SAFARI_ZONE ; in the safari zone?
jr z, .notSafariZone
callba SafariZoneCheckSteps
ld a, [wSafariZoneGameOver]
and a
jp nz, WarpFound2
Upon make, I get this in cygwin:
rgbasm -h -o main.o main.asm
rgblink -n pokeyellow.sym -o pokeyellow.gbc audio.o main.o text.o wram.o
C:\cygwin64\usr\local\bin\rgblink.exe: ROM0 section too large
Makefile:47: recipe for target 'pokeyellow.gbc' failed
make: *** [pokeyellow.gbc] Error 1
This is apparently the same issue Fotomac experienced here. So what would I need to move out of home.asm?
Offline
One simple way to save some space in bank 0 is to put Mart data in with the rest of the scripts on their map instead of putting them all together in bank 0 like they are by default. You'll notice that instead of a single file with all mart inventories inside it, Red++ has a folder where each mart has its own .asm file for its inventory. Still simple to find and edit them if you need to change a mart, and frees up precious space in bank 0.
I am not very active on this forum. I only pop in from time to time.
Offline
Is it as simple as just deleting "INCLUDE "data/mart_inventories.asm" from home.asm and splitting them into their own files?
Offline
Yeah, then just INCLUDE the new files alongside the other scripts for those maps.
I am not very active on this forum. I only pop in from time to time.
Offline
Now it assembles, but the injected code doesn't seem to work - pressing B doesn't speed up, but it's also at the very start of the game. Do I need to already have the bike for the game to be able to call BikeSpeedup at all?
Offline
You don't need to have the bike for this to work. You are holding B down while walking, not just pressing it once and expecting that to toggle it on and off or something, right? Normal running shoes make you go faster while holding B, but the way you worded it made me think you might be confused.
If that still doesn't work, might be some other difference between red and yellow, I haven't looked at how yellow's version of that routine originally looked. Also, faster surfing might be causing an issue too, since Red++ doesn't have a separate state for Surfing Pikachu, so that might be different.
Last edited by Luna (2016-11-29 16:13:58)
I am not very active on this forum. I only pop in from time to time.
Offline
Yeah, I'm holding down B. But I think you're right, because here's the original section for R/B vs Yellow (only relevant parts quoted):
.moveAhead2
ld hl,wFlags_0xcd60
res 2,[hl]
ld a,[wWalkBikeSurfState]
dec a ; riding a bike?
jr nz,.normalPlayerSpriteAdvancement
ld a,[wd736]
bit 6,a ; jumping a ledge?
jr nz,.normalPlayerSpriteAdvancement
call DoBikeSpeedup
.normalPlayerSpriteAdvancement
call AdvancePlayerSprite
ld a,[wWalkCounter]
and a
jp nz,CheckMapConnections ; it seems like this check will never succeed (the other place where CheckMapConnections is run works)
; walking animation finished
DoBikeSpeedup::
ld a,[wNPCMovementScriptPointerTableNum]
and a
ret nz
ld a,[wCurMap]
cp ROUTE_17 ; Cycling Road
jr nz,.goFaster
ld a,[hJoyHeld]
and D_UP | D_LEFT | D_RIGHT
ret nz
.goFaster
jp AdvancePlayerSprite
.moveAhead2
ld hl, wFlags_0xcd60
res 2, [hl]
xor a
ld [wd435], a
call DoBikeSpeedup
call AdvancePlayerSprite
ld a, [wWalkCounter]
and a
jp nz, CheckMapConnections ; it seems like this check will never succeed (the other place where CheckMapConnections is run works)
; walking animation finished
DoBikeSpeedup::
ld a, [wWalkBikeSurfState]
dec a ; riding a bike?
ret nz
ld a, [wd736]
bit 6, a
ret nz
ld a, [wNPCMovementScriptPointerTableNum]
and a
ret nz
ld a, [wCurMap]
cp ROUTE_17 ; Cycling Road
jr nz, .goFaster
ld a, [hJoyHeld]
and D_UP | D_LEFT | D_RIGHT
ret nz
.goFaster
call AdvancePlayerSprite
ret
So should I be sticking "ld a,[wWalkBikeSurfState]
dec a ; riding a bike?
jr nz,.normalPlayerSpriteAdvancement
ld a,[wd736]
bit 6,a ; jumping a ledge?
jr nz,.normalPlayerSpriteAdvancement" into DoBikeSpeedup?
EDIT: Deleted the extra lines instead from DoBikeSpeedup and it works fine for now! Thanks!
Last edited by SommenRider (2016-11-29 17:39:58)
Offline
Glad it seems like it is working.
I am not very active on this forum. I only pop in from time to time.
Offline
Would removing the 'xor a' from the original .moveAhead2 affect anything later on, though?
Offline
It would affect something right then, by not setting "a" to 0 before storing it somewhere in the next line.
I am not very active on this forum. I only pop in from time to time.
Offline
So which is better of these two:
.moveAhead2
ld hl, wFlags_0xcd60
res 2, [hl]
ld a,[wWalkBikeSurfState]
dec a ; riding a bike?
jr nz,.normalPlayerSpriteAdvancement
ld a,[wd736]
bit 6,a ; jumping a ledge?
jr nz,.normalPlayerSpriteAdvancement
xor a
ld [wd435], a
call BikeSpeedup ; if riding a bike and not jumping a ledge
call BikeSpeedup ; added
call BikeSpeedup ; added
jr .notRunning
.normalPlayerSpriteAdvancement
; Make you surf at bike speed
ld a,[wWalkBikeSurfState]
cp a, $02
jr z, .surfFaster
; Add running shoes
ld a, [hJoyHeld] ; Check what buttons are being pressed
and B_BUTTON ; Are you holding B?
jr z, .notRunning ; If you aren't holding B, skip ahead to step normally.
.surfFaster
call BikeSpeedup ; Make you go faster if you were holding B
.notRunning ; Normal code resumes here
call AdvancePlayerSprite
ld a, [wWalkCounter]
and a
jp nz, CheckMapConnections ; it seems like this check will never succeed (the other place where CheckMapConnections is run works)
; walking animation finished
BikeSpeedup::
ld a, [wNPCMovementScriptPointerTableNum]
and a
ret nz
ld a, [wCurMap]
cp ROUTE_17 ; Cycling Road
jr nz, .goFaster
ld a, [hJoyHeld]
and D_UP | D_LEFT | D_RIGHT
ret nz
.goFaster
call AdvancePlayerSprite
ret
or
.moveAhead2
ld hl, wFlags_0xcd60
res 2, [hl]
xor a
ld [wd435], a
call BikeSpeedup
call BikeSpeedup
call BikeSpeedup
.normalPlayerSpriteAdvancement
; Make you surf at bike speed
ld a,[wWalkBikeSurfState]
cp a, $02
jr z, .surfFaster
; Add running shoes
ld a, [hJoyHeld] ; Check what buttons are being pressed
and B_BUTTON ; Are you holding B?
jr z, .notRunning ; If you aren't holding B, skip ahead to step normally.
.surfFaster
call BikeSpeedup ; Make you go faster if you were holding B
.notRunning ; Normal code resumes here
call AdvancePlayerSprite
ld a, [wWalkCounter]
and a
jp nz, CheckMapConnections ; it seems like this check will never succeed (the other place where CheckMapConnections is run works)
; walking animation finished
BikeSpeedup::
ld a,[wWalkBikeSurfState]
dec a ; riding a bike?
jr nz,.normalPlayerSpriteAdvancement
ld a,[wd736]
bit 6,a ; jumping a ledge?
jr nz,.normalPlayerSpriteAdvancement
ld a, [wNPCMovementScriptPointerTableNum]
and a
ret nz
ld a, [wCurMap]
cp ROUTE_17 ; Cycling Road
jr nz, .goFaster
ld a, [hJoyHeld]
and D_UP | D_LEFT | D_RIGHT
ret nz
.goFaster
call AdvancePlayerSprite
ret
Offline
Pages: 1