[Refactor] jp [hl] -> jp hl; ld hl,[sp+N] -> ld hl,sp+N

This commit is contained in:
Abe Pralle 2020-05-30 21:03:34 -07:00
parent 71ede70bbe
commit f6644ee6fe
4 changed files with 9 additions and 9 deletions

View File

@ -39,7 +39,7 @@ routine rogo_build
local obj_files = String[] local obj_files = String[]
forEach (asm_file in File.listing("Source/***/*.asm")) forEach (asm_file in File.listing("Source/***/*.asm"))
local obj_file = "Build/$.obj" (File.filename(asm_file).leftmost(-4)) local obj_file = "Build/$.obj" (File.filename(asm_file).leftmost(-4))
execute "rgbasm -Wextra $ -o $" (asm_file,obj_file) execute "rgbasm -Wextra -Wobsolete $ -o $" (asm_file,obj_file)
obj_files.add( obj_file ) obj_files.add( obj_file )
endForEach endForEach

View File

@ -156,7 +156,7 @@ LongCall::
ld [$2100],a ld [$2100],a
push hl push hl
ld hl,[sp+6] ;point hl to empty spot in stack ld hl,sp+6 ;point hl to empty spot in stack
ld [hl],e ld [hl],e
inc hl inc hl
ld [hl],d ;save addr of method ld [hl],d ;save addr of method
@ -2191,7 +2191,7 @@ TimerDelay::
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
SetDialogSkip:: SetDialogSkip::
push hl push hl
ld hl,[sp+4] ;stack ptr pos once returned from this fn ld hl,sp+4 ;stack ptr pos once returned from this fn
ld a,e ld a,e
ld [levelCheckSkip+2],a ;set skip forward addr ld [levelCheckSkip+2],a ;set skip forward addr
ld a,d ld a,d
@ -2200,7 +2200,7 @@ SetDialogSkip::
SetDialogForward:: SetDialogForward::
push hl push hl
ld hl,[sp+4] ;stack ptr pos once returned from this fn ld hl,sp+4 ;stack ptr pos once returned from this fn
ld a,e ;set fast forward addr ld a,e ;set fast forward addr
ld [levelCheckSkip],a ld [levelCheckSkip],a
ld a,d ld a,d
@ -2209,7 +2209,7 @@ SetDialogForward::
SetSkipStackPos:: SetSkipStackPos::
push hl push hl
ld hl,[sp+4] ;stack ptr pos once returned from this fn ld hl,sp+4 ;stack ptr pos once returned from this fn
SetDialogCommon: SetDialogCommon:
ld a,l ld a,l
@ -2285,7 +2285,7 @@ SetLinkBailOutAddress::
ld [linkBailOut+1],a ld [linkBailOut+1],a
;save stack pointer (plus a*2 + 6 for things pushed on stack) ;save stack pointer (plus a*2 + 6 for things pushed on stack)
ld hl,[sp+6] ld hl,sp+6
pop af pop af
or a or a
jr z,.afterAdjustStackPointer jr z,.afterAdjustStackPointer
@ -3508,7 +3508,7 @@ GeneratePauseMessage:
;write map coordinates ;write map coordinates
add sp,-24 ;create temporary buffer on stack add sp,-24 ;create temporary buffer on stack
push hl push hl
ld hl,[sp+2] ld hl,sp+2
ld d,h ld d,h
ld e,l ld e,l
ld [hl],16 ;spaces to center ld [hl],16 ;spaces to center

View File

@ -11453,7 +11453,7 @@ WispCheck:
call GetCurLocation call GetCurLocation
push hl push hl
call .wispRemove call .wispRemove
ld hl,[sp+2] ;other object's location ld hl,sp+2 ;other object's location
ld a,[hl+] ld a,[hl+]
ld h,[hl] ld h,[hl]
ld l,a ld l,a

View File

@ -671,7 +671,7 @@ LoadMap::
ld a,OBJROM ld a,OBJROM
call SetActiveROM call SetActiveROM
ld hl,[sp+0] ld hl,sp
ld a,l ld a,l
ld [loadStackPosL],a ld [loadStackPosL],a
ld a,h ld a,h