]> git.sur5r.net Git - cc65/blob - libsrc/geos-cbm/conio/cpputs.s
98781a4fb60ef4b07c70701089a7412edfc68dc0
[cc65] / libsrc / geos-cbm / conio / cpputs.s
1
2 ;
3 ; Maciej 'YTM/Elysium' Witkowiak
4 ;
5 ; 27.10.2001
6 ; 05.03.2002
7
8 ; void cpputsxy (unsigned char x, unsigned char y, char* s);
9 ; void cpputs (char* s);
10
11 ; same as cputsxy and cputs but faster and use proportional font spacing
12 ; does not update cursor position
13
14             .export _cpputsxy, _cpputs
15
16             .import _gotoxy
17             .import popa
18             .importzp cursor_x, cursor_y
19
20             .include "../inc/const.inc"
21             .include "../inc/geossym.inc"
22             .include "../inc/jumptab.inc"
23
24 _cpputsxy:
25         sta     r0L             ; Save s for later
26         stx     r0H
27         jsr     popa            ; Get Y
28         jsr     _gotoxy         ; Set cursor, pop x
29         jmp     L0              ; Same as cputs...
30
31 _cpputs:
32         sta     r0L             ; Save s
33         stx     r0H
34 L0:     ldy     #0
35         lda     (r0),y
36         bne     L1              ; Jump if there's something
37         rts
38
39 L1:     lda     cursor_x
40         sta     r11L
41         lda     cursor_x+1
42         sta     r11H
43         lda     cursor_y
44         sta     r1H
45         jmp     PutString