]> git.sur5r.net Git - cc65/blob - libsrc/tgi/tgi_textstyle.s
improved handling of cursor display and position
[cc65] / libsrc / tgi / tgi_textstyle.s
1 ;
2 ; Ullrich von Bassewitz, 22.06.2002
3 ;
4 ; void __fastcall__ tgi_textstyle (unsigned char magx, unsigned char magy,
5 ;                                  unsigned char dir);
6 ; /* Set the style for text output. */
7
8
9         .include        "tgi-kernel.inc"
10
11         .import         popax, incsp2
12         .export         _tgi_textstyle
13
14 _tgi_textstyle:
15         pha
16         jsr     popax                   ; Get magx/magy in one call
17         tay
18         pla
19
20 ; A = textdir, X = textmagx, Y = textmagy
21
22         cmp     #TGI_TEXT_HORIZONTAL
23         beq     DirOk
24         cmp     #TGI_TEXT_VERTICAL
25         beq     DirOk
26 Fail:   jmp     tgi_inv_arg             ; Invalid argument
27 DirOk:  cpy     #$00
28         beq     Fail                    ; Cannot have magnification of zero
29         cpx     #$00
30         beq     Fail                    ; Cannot have magnification of zero
31
32 ; Parameter check ok, store them
33
34         stx     _tgi_textmagx
35         sty     _tgi_textmagy
36         sta     _tgi_textdir
37
38 ; Call the driver, parameters are passed in registers
39
40         jmp     tgi_textstyle
41