Better loops
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
SCR_HEIGHT = 8
|
SCR_HEIGHT = 8
|
||||||
WORLD_LENGTH = 48
|
WORLD_LENGTH = 44
|
||||||
DIFF_LEVELS = 20
|
DIFF_LEVELS = 20
|
||||||
.IFNDEF ALONE
|
.IFNDEF ALONE
|
||||||
.def ALONE = 1 ; standalone version
|
.def ALONE = 1 ; standalone version
|
||||||
@@ -410,7 +410,7 @@ SwapLoop
|
|||||||
.endp
|
.endp
|
||||||
;-----------------------------------------------
|
;-----------------------------------------------
|
||||||
.proc ClearScreen
|
.proc ClearScreen
|
||||||
ldy #44 ; visible screen len
|
ldy #WORLD_LENGTH ; visible screen len
|
||||||
lda #0
|
lda #0
|
||||||
ClearLoop
|
ClearLoop
|
||||||
;sta screen+$0700,y
|
;sta screen+$0700,y
|
||||||
@@ -446,7 +446,7 @@ NothingToDraw
|
|||||||
jsr ClearScreen
|
jsr ClearScreen
|
||||||
ldx #0 ; start position (world)
|
ldx #0 ; start position (world)
|
||||||
stx temp_b
|
stx temp_b
|
||||||
lda #43 ; start position (screen)
|
lda #WORLD_LENGTH-1 ; start position (screen)
|
||||||
sta temp_b2
|
sta temp_b2
|
||||||
ToScreenLoop
|
ToScreenLoop
|
||||||
lda WorldTable,x
|
lda WorldTable,x
|
||||||
@@ -455,10 +455,9 @@ ToScreenLoop
|
|||||||
ldx temp_b2
|
ldx temp_b2
|
||||||
jsr ShowObjectL
|
jsr ShowObjectL
|
||||||
NothingToDraw
|
NothingToDraw
|
||||||
dec temp_b2
|
|
||||||
inc:ldx temp_b
|
inc:ldx temp_b
|
||||||
cpx #WORLD_LENGTH
|
dec temp_b2
|
||||||
bne ToScreenLoop
|
bpl ToScreenLoop
|
||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
;-----------------------------------------------
|
;-----------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user