2 ; Ullrich von Bassewitz, 2000-08-06, 2002-12-21
3 ; Using lots of code from MagerValp, MagerValp@cling.gu.se
5 ; void cputcxy (unsigned char x, unsigned char y, char c);
9 .export _cputcxy, _cputc, cputdirect, putchar
13 .include "cbm_kernal.inc"
18 ;--------------------------------------------------------------------------
24 jsr gotoxy ; Set cursor, drop x and y
27 ; Plot a character - also used as internal function
29 _cputc: cmp #$0A ; CR?
34 jmp NEWLINE ; Update cursor position
36 ; Printable char of some sort
39 bcc cputdirect ; Other control char
45 bne cputdirect ; Branch always
48 ; Output one character to the screen. We will disable scrolling while doing so
51 tax ; Save output char
53 pha ; Save scroll flag
55 sta SCROLL ; Disable scrolling
56 txa ; Restore output char
59 sta SCROLL ; Restore old scroll flag
62 ; Handle character if high bit set
67 lda #$5E ; Load screen code for PI
70 bne cputdirect ; Branch always
77 ; Set cursor position, calculate RAM pointers
82 jmp PLOT ; Set the new cursor
84 ; Write one character to the screen without doing anything else, return X