2000-05-28 13:40:48 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 06.08.1998
|
|
|
|
;
|
|
|
|
; void cputcxy (unsigned char x, unsigned char y, char c);
|
|
|
|
; void cputc (char c);
|
|
|
|
;
|
|
|
|
|
|
|
|
.export _cputcxy, _cputc, cputdirect, putchar
|
2000-07-16 20:54:53 +00:00
|
|
|
.export newline, plot
|
2002-12-19 22:53:13 +00:00
|
|
|
.constructor initcputc
|
|
|
|
.destructor donecputc
|
2000-05-28 13:40:48 +00:00
|
|
|
.import popa, _gotoxy
|
2002-11-19 23:02:47 +00:00
|
|
|
.import PLOT
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
.include "c128.inc"
|
2002-11-19 23:02:47 +00:00
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
_cputcxy:
|
|
|
|
pha ; Save C
|
|
|
|
jsr popa ; Get Y
|
|
|
|
jsr _gotoxy ; Set cursor, drop x
|
|
|
|
pla ; Restore C
|
2002-12-19 21:22:22 +00:00
|
|
|
jmp PRINT
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
; Plot a character - also used as internal function
|
|
|
|
|
2002-12-19 21:22:22 +00:00
|
|
|
_cputc = PRINT ; let the kernal handle it
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2002-12-19 21:22:22 +00:00
|
|
|
cputdirect = $c33b
|
2000-12-02 14:59:14 +00:00
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
newline:
|
2002-12-19 21:22:22 +00:00
|
|
|
lda #17
|
|
|
|
jmp PRINT
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
; Set cursor position, calculate RAM pointers
|
|
|
|
|
|
|
|
plot: ldy CURS_X
|
|
|
|
ldx CURS_Y
|
|
|
|
clc
|
|
|
|
jmp PLOT ; Set the new cursor
|
|
|
|
|
|
|
|
; Write one character to the screen without doing anything else, return X
|
|
|
|
; position in Y
|
|
|
|
|
2002-12-19 21:22:22 +00:00
|
|
|
putchar = $CC2F
|
2002-12-19 22:53:13 +00:00
|
|
|
|
|
|
|
;--------------------------------------------------------------------------
|
|
|
|
; Module constructor/destructor
|
|
|
|
|
|
|
|
initcputc:
|
2002-12-19 23:16:51 +00:00
|
|
|
lda #$C0
|
2002-12-19 22:53:13 +00:00
|
|
|
.byte $2C
|
|
|
|
donecputc:
|
|
|
|
lda #$00
|
|
|
|
sta SCROLL
|
|
|
|
rts
|
|
|
|
|