mirror of
https://github.com/cc65/cc65.git
synced 2024-09-07 09:54:35 +00:00
58 lines
1.0 KiB
ArmAsm
58 lines
1.0 KiB
ArmAsm
;
|
|
; 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 #$C0
|
|
.byte $2C
|
|
donecputc:
|
|
lda #$00
|
|
sta SCROLL
|
|
rts
|
|
|