Created
August 13, 2019 21:34
-
-
Save nurpax/d429be441c7a9f4a6ceffbddc35a0003 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!filescope c64 | |
!macro basic_start(addr) { | |
* = $801 | |
!byte $0c, $08, $00, $00, $9e | |
!for d in [10000, 1000, 100, 10, 1] { | |
!if (addr >= d) { | |
!byte $30 + (addr/d)%10 | |
} | |
} | |
!byte 0, 0, 0 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!include "c64.asm" | |
+c64::basic_start(entry) | |
!let yf = 249 | |
!let x0 = $d5 ; initial value == 39 | |
!let x1 = $62 ; 253 guessing this is zero | |
entry: { | |
; assume A=0 on entry | |
sta $d020 | |
sta $d021 | |
lda #80 | |
sta yf | |
; Assume 'xx' contains 39 here | |
xloop: | |
lda #$a0 | |
ldx x0 | |
sta $0400 + 24*40, x | |
ldx x1 | |
sta $0400 + 24*40, x | |
inc x1 | |
dec x0 | |
bmi xloop_done | |
; A=#$a0 from above | |
adc yf | |
sta yf | |
bcc no_scroll | |
jsr $e8ea ; scroll screen up | |
no_scroll: | |
jmp xloop | |
xloop_done: | |
inf: bne inf ; BNE on byte shorter than JMP, Z flag constant here | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment