]> git.sur5r.net Git - cc65/blob - libsrc/geos-cbm/conio/gotoxy.s
1a02611689651f04d7ddad60e3987e59cb2c51f1
[cc65] / libsrc / geos-cbm / conio / gotoxy.s
1
2 ;
3 ; Maciej 'YTM/Elysium' Witkowiak
4 ;
5 ; 27.10.2001
6 ; 06.03.2002
7
8 ; void gotox (unsigned char x);
9 ; void gotoy (unsigned char y);
10 ; void gotoxy (unsigned char x, unsigned char y);
11
12             .export _gotox, _gotoy, _gotoxy, fixcursor
13             .import popa
14             .importzp cursor_x, cursor_y, cursor_c, cursor_r
15
16             .include "../inc/jumptab.inc"
17
18 _gotox:     sta cursor_c
19             jmp fixcursor
20
21 _gotoy:     sta cursor_r
22             inc cursor_r
23             jmp fixcursor
24
25 _gotoxy:    sta cursor_r
26             inc 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             lda cursor_r
37             sta cursor_y
38             ldx #cursor_x
39             ldy #3
40             jsr DShiftLeft
41             asl cursor_y
42             asl cursor_y
43             asl cursor_y
44             rts