1
0
mirror of https://github.com/fumiama/c64-snake.git synced 2026-06-05 00:32:39 +08:00

分数打印完成

This commit is contained in:
fumiama
2021-04-03 14:29:01 +08:00
parent 6585c635d0
commit caaead7be0
3 changed files with 9 additions and 16 deletions

View File

@@ -30,9 +30,9 @@ main:
.macro init
lda #147 ;清屏
jsr chrout
lda #$cd
lda #$ff
sta s
lda #$ab
lda #$ff
sta s + 1
jsr printscore
.macend

View File

@@ -14,7 +14,7 @@ print16:
lda #0
ldx #6
* sta _num_dec, x
* sta _num_dec-1, x
dex
bne -
@@ -129,31 +129,24 @@ _skip:
jsr mod_3
jsr mod_2
jsr mod_1 ; 此时结果中有些位可能大于10需要进行进位处理
jsr chrin
ldx #5
_loop:
ldy #0 ; y记录进位数
lda _num_dec, x
txa
lda _num_dec-1, x
cmp #10
bcc _skip ; 小于10不进位
jsr printbyte
pha
and #$f0
lsr
lsr
lsr
lsr
tay
adc _num_dec-2, x
sta _num_dec-2, x
pla
and #$0f
jsr printbyte
adc _num_dec, x
sta _num_dec, x
jsr chrin
tya
adc _num_dec - 1, x
sta _num_dec - 1, x
jsr chrin
sta _num_dec-1, x
_skip:
dex
bne _loop
@@ -171,4 +164,4 @@ _up:
tay
.macend
.require "printbyte.asm"
; .require "printbyte.asm"

BIN
snake.prg

Binary file not shown.