Skip to content

Instantly share code, notes, and snippets.

@nurpax
Created August 13, 2019 21:34
Show Gist options
  • Save nurpax/d429be441c7a9f4a6ceffbddc35a0003 to your computer and use it in GitHub Desktop.
Save nurpax/d429be441c7a9f4a6ceffbddc35a0003 to your computer and use it in GitHub Desktop.
!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
}
!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