]> git.sur5r.net Git - cc65/blob - libsrc/c128/cputc.s
Add 80 column mode
[cc65] / libsrc / c128 / cputc.s
1 ;
2 ; Ullrich von Bassewitz, 06.08.1998
3 ;
4 ; void cputcxy (unsigned char x, unsigned char y, char c);
5 ; void cputc (char c);
6 ;
7
8         .export         _cputcxy, _cputc, cputdirect, putchar
9         .export         newline, plot
10         .import         popa, _gotoxy
11         .import         PLOT
12
13         .include        "c128.inc"
14
15
16 _cputcxy:
17         pha                     ; Save C
18         jsr     popa            ; Get Y
19         jsr     _gotoxy         ; Set cursor, drop x
20         pla                     ; Restore C
21         jmp     PRINT
22
23 ; Plot a character - also used as internal function
24
25 _cputc          = PRINT         ; let the kernal handle it
26
27 cputdirect      = $c33b
28
29 newline:
30         lda     #17
31         jmp     PRINT
32
33 ; Set cursor position, calculate RAM pointers
34
35 plot:   ldy     CURS_X
36         ldx     CURS_Y
37         clc
38         jmp     PLOT            ; Set the new cursor
39
40 ; Write one character to the screen without doing anything else, return X
41 ; position in Y
42
43 putchar = $CC2F