Skip to content

Commit

Permalink
Moves traveling sprite frame updates into sep. subroutines
Browse files Browse the repository at this point in the history
  • Loading branch information
samcan committed Jun 11, 2020
1 parent 83fae1c commit 614027f
Showing 1 changed file with 29 additions and 21 deletions.
50 changes: 29 additions & 21 deletions src/engine_logic_functions.asm
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,32 @@ LoadFrameZero:
LDA #$00
STA currwagfrm

JSR UpdateTravelingSpritesFrameZero

JMP GameEngineLogicDone

LoadFrameOne:
INC currwagfrm

JSR UpdateTravelingSpritesFrameOne

JMP GameEngineLogicDone
;;;;;;;;;;
UpdateCalendar:
; adds one day to the game's calendar
INC day
LDX month
LDA daysinmonth, X
CMP day
BCC @UpdateMonth
RTS
@UpdateMonth:
INC month
LDA #$01
STA day
RTS
;;;;;;;;;;
UpdateTravelingSpritesFrameZero:
; first part of wagon metatile
LDX #$04 ; start display using sprite 1 rather than
; sprite 0
Expand Down Expand Up @@ -225,13 +251,10 @@ LoadFrameZero:
INX
LDA #$D8
STA $0200, x
RTS

JMP GameEngineLogicDone

LoadFrameOne:
INC currwagfrm

; first part of wagon metatile
UpdateTravelingSpritesFrameOne:
; first part of wagon metatile
LDX #$04 ; start display using sprite 1 rather than
; sprite 0

Expand Down Expand Up @@ -301,19 +324,4 @@ LoadFrameOne:
INX
LDA #$D8
STA $0200, x

JMP GameEngineLogicDone
;;;;;;;;;;
UpdateCalendar:
; adds one day to the game's calendar
INC day
LDX month
LDA daysinmonth, X
CMP day
BCC @UpdateMonth
RTS
@UpdateMonth:
INC month
LDA #$01
STA day
RTS

0 comments on commit 614027f

Please sign in to comment.