1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-03 06:29:36 +00:00
cc65/libsrc/c128/cputc.s

58 lines
1.0 KiB
ArmAsm
Raw Normal View History

;
; 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
.export newline, plot
.constructor initcputc
.destructor donecputc
.import popa, _gotoxy
.import PLOT
.include "c128.inc"
_cputcxy:
pha ; Save C
jsr popa ; Get Y
jsr _gotoxy ; Set cursor, drop x
pla ; Restore C
jmp PRINT
; Plot a character - also used as internal function
_cputc = PRINT ; let the kernal handle it
cputdirect = $c33b
newline:
lda #17
jmp PRINT
; 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
putchar = $CC2F
;--------------------------------------------------------------------------
; Module constructor/destructor
initcputc:
lda #$80
.byte $2C
donecputc:
lda #$00
sta SCROLL
rts