Skip to content

Instantly share code, notes, and snippets.

@tomaes
Last active August 29, 2015 14:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomaes/2d62ccca110efb14897d to your computer and use it in GitHub Desktop.
Save tomaes/2d62ccca110efb14897d to your computer and use it in GitHub Desktop.
mini note file viewer. rev2 with multi-page support. (c64)
;
; a minimal noter example with generated audio, BASIC header and multi-page support
;
* = $801
; 0 SYS4096
byte $0B, $08, $00, $00, $9E, '4', '0', '9', '6', $00, $00, $00
* = $1000
init
lda #6
sta $d020 ; border color = screen color
start
lda txt ; get char
inc start+1 ; self-modifying code to alter the txt offset
bne cont
inc start+2
cont
cmp #$ff ; end of page?
beq wait_s ; -> wait
cmp #$fe ; end of text?
bne putchar ; no? -> get next char
lda <txt ; otherwise: wrap around
sta start+1 ; re-init offset
lda >txt
sta start+2
jmp start
putchar
jsr $ffd2 ; KERNAL chrout
jmp start
wait_s
lda #0 ; clear key buffer
sta $c6
wait
inx
lda $a2
sta $d418,x ; funky glitch audio :)
lda $c6
beq wait
jmp start
txt
byte 147, 14, 154 ; clear screen, upper/lower-case, light-blue
text "mICRO nOTE wITH aUDIO"
byte 13, 13, 13
text "lorem ipsum"
byte 13, 13
text "0123456789"
byte 13, 13, 150 ; 150 = light-red
text "tHE lAZY bROWN fOX!"
byte $ff ; end of page
byte 147
text "pAGE tWO!"
byte 13, 13, 13, 158 ; 158 = yellow
text "(end)"
byte $ff, $fe ; end of page and end of text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment