forked from mist64/msbasic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlcd.s
More file actions
57 lines (48 loc) · 1.1 KB
/
lcd.s
File metadata and controls
57 lines (48 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
.segment "CODE"
.ifdef PLBS
.import putcmd_lcd
.importzp bios_public
LCDCMD:
jsr GETBYT
phx ; Save command in stack
ldy #0
jsr CHRGOT
@lcdcmd_args:
beq @lcdcmd
cmp #','
bne @lcdcmd
jsr CHRGET ; consume ','
jsr GETBYT ; read next argument
stx BUFFER, y ; put argument in BUFFER
iny
cpy #$10 ; 16 byte buffer limit
beq @lcdcmd
jsr CHRGET
jmp @lcdcmd_args
@lcdcmd:
; Setup bios_params pointer with address of BUFFER
lda #<BUFFER
sta bios_public + LCDCmdArgs::data_ptr + Ptr::lo
lda #>BUFFER
sta bios_public + LCDCmdArgs::data_ptr + Ptr::hi
pla ; Pull command off stack
jsr putcmd_lcd
rts
LCDPRINT:
jsr FRMEVL
bit VALTYP
bmi @lcd_print
jsr FOUT
jsr STRLIT
@lcd_print:
jsr FREFAC
tax
ldy #0
@lcd_print_char:
lda (INDEX), y
jsr putchar_lcd
iny
dex
bne @lcd_print_char
rts
.endif ; PLBS