]> git.sur5r.net Git - cc65/blob - libsrc/geos-common/conio/gotoxy.s
48b413d5fb80abf4eaae23aa98e44feac7cc3e4a
[cc65] / libsrc / geos-common / conio / gotoxy.s
1 ;
2 ; Maciej 'YTM/Elysium' Witkowiak
3 ;
4 ; 27.10.2001
5 ; 06.03.2002
6
7 ; void gotox (unsigned char x);
8 ; void gotoy (unsigned char y);
9 ; void gotoxy (unsigned char x, unsigned char y);
10
11             .export _gotox, _gotoy, _gotoxy, fixcursor
12             .import popa
13             .importzp cursor_x, cursor_y, cursor_c, cursor_r
14
15             .include "jumptab.inc"
16
17 _gotox:
18         sta cursor_c
19         jmp fixcursor
20
21 _gotoy:
22         sta cursor_r
23         jmp fixcursor
24
25 _gotoxy:
26         sta cursor_r
27         jsr popa
28         sta cursor_c
29
30 ; convert 8x8 x/y coordinates to GEOS hires
31 fixcursor:
32         lda cursor_c
33         sta cursor_x
34         lda #0
35         sta cursor_x+1
36         ldx #cursor_x
37         ldy #3
38         jsr DShiftLeft
39         lda cursor_r
40         asl a
41         asl a
42         asl a
43         sta cursor_y
44         rts