Skip to content

Commit

Permalink
Moving subr ranger to hud space
Browse files Browse the repository at this point in the history
  • Loading branch information
intoinside committed Feb 27, 2022
1 parent 3f12d67 commit 3a096fc
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
24 changes: 23 additions & 1 deletion _hud.asm
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,26 @@ DrawDismissal: {
.label DismissalPtr = $beef
}

CurrentScore: .byte $00, $00, $00, $00
* = * "Hud ConvertDismissalToPoint"
ConvertDismissalToPoint: {
lda ReduceDismissalCounter.DismissalCompleted
bne Done

ldx #15
!:
jsr WaitRoutine
dex
bne !-

jsr ReduceDismissalCounter
jsr Sfx.PointConversion
AddPoints(0, 0, 4, 0)

Done:
rts
}

CurrentScore: .byte 0, 0, 0, 0

// "SCORE: 0000"
ScoreLabel: .byte $14, $04, $10, $13, $06, $34, $00
Expand All @@ -290,3 +309,6 @@ DismissalLabel: .byte $05, $0a, $14, $0e, $0a, $14, $14, $02, $0d, $34, $00
.label DismissalAliveChar = $a4

ScreenMemoryAddress: .word $be00

#import "_sounds.asm"
#import "_utils.asm"
2 changes: 1 addition & 1 deletion _level1.asm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Manager: {

CloseLevelAndGotoNext:
jsr SetSpriteToBackground
jsr Ranger.ConvertDismissalToPoint
jsr Hud.ConvertDismissalToPoint
IsReturnPressed()
bne LevelDone
jmp JoystickMovement
Expand Down
2 changes: 1 addition & 1 deletion _level2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Manager: {

CloseLevelAndGotoNext:
jsr SetSpriteToBackground
jsr Ranger.ConvertDismissalToPoint
jsr Hud.ConvertDismissalToPoint
IsReturnPressed()
bne LevelDone
jmp JoystickMovement
Expand Down
18 changes: 0 additions & 18 deletions _ranger.asm
Original file line number Diff line number Diff line change
Expand Up @@ -206,24 +206,6 @@ FiningInAction: {
rts
}

ConvertDismissalToPoint: {
lda Hud.ReduceDismissalCounter.DismissalCompleted
bne Done

ldx #15
!:
jsr WaitRoutine
dex
bne !-

jsr Hud.ReduceDismissalCounter
jsr Sfx.PointConversion
AddPoints(0, 0, 4, 0)

Done:
rts
}

* = * "Ranger UpdateRangerFrame"
UpdateRangerFrame: {
inc RangerFrame
Expand Down

0 comments on commit 3a096fc

Please sign in to comment.