2000-05-28 13:40:48 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 06.08.1998
|
|
|
|
;
|
2017-06-28 18:43:31 +00:00
|
|
|
; void cputsxy (unsigned char x, unsigned char y, const char* s);
|
|
|
|
; void cputs (const char* s);
|
2000-05-28 13:40:48 +00:00
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export _cputsxy, _cputs
|
2016-06-05 12:58:38 +00:00
|
|
|
.import gotoxy, _cputc
|
2013-05-09 11:56:54 +00:00
|
|
|
.importzp ptr1, tmp1
|
2023-09-02 09:08:15 +00:00
|
|
|
.macpack cpu
|
2022-04-17 14:06:22 +00:00
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
_cputsxy:
|
2013-05-09 11:56:54 +00:00
|
|
|
sta ptr1 ; Save s for later
|
|
|
|
stx ptr1+1
|
2016-06-05 12:58:38 +00:00
|
|
|
jsr gotoxy ; Set cursor, pop x and y
|
2023-09-02 09:08:15 +00:00
|
|
|
.if (.cpu .bitand CPU_ISET_65SC02)
|
|
|
|
bra L0 ; Same as cputs...
|
|
|
|
.else
|
2013-05-09 11:56:54 +00:00
|
|
|
jmp L0 ; Same as cputs...
|
2023-09-02 09:08:15 +00:00
|
|
|
.endif
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
_cputs: sta ptr1 ; Save s
|
|
|
|
stx ptr1+1
|
2023-09-02 09:08:15 +00:00
|
|
|
|
|
|
|
.if (.cpu .bitand CPU_ISET_65SC02)
|
|
|
|
|
|
|
|
L0: lda (ptr1) ; (5)
|
|
|
|
beq L9 ; (7) Jump if done
|
|
|
|
jsr _cputc ; (13) Output char, advance cursor
|
|
|
|
inc ptr1 ; (18) Bump low byte
|
|
|
|
bne L0 ; (20) Next char
|
|
|
|
inc ptr1+1 ; (25) Bump high byte
|
|
|
|
bne L0
|
|
|
|
|
|
|
|
.else
|
|
|
|
|
|
|
|
L0: ldy #0 ; (2)
|
|
|
|
L1: lda (ptr1),y ; (7)
|
|
|
|
beq L9 ; (9) Jump if done
|
2013-05-09 11:56:54 +00:00
|
|
|
iny
|
2023-09-02 09:08:15 +00:00
|
|
|
sty tmp1 ; (14) Save offset
|
|
|
|
jsr _cputc ; (20) Output char, advance cursor
|
|
|
|
ldy tmp1 ; (23) Get offset
|
|
|
|
bne L1 ; (25) Next char
|
|
|
|
inc ptr1+1 ; (30) Bump high byte
|
2013-05-09 11:56:54 +00:00
|
|
|
bne L1
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2023-09-02 09:08:15 +00:00
|
|
|
.endif
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
; Done
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
L9: rts
|