]> git.sur5r.net Git - cc65/blob - libsrc/c64/soft80_kplot.s
Fix ftell() on Apple II to return the correct value.
[cc65] / libsrc / c64 / soft80_kplot.s
1
2 ;
3 ; Groepaz/Hitmen, 12.10.2015
4 ;
5 ; lowlevel kplot function for the soft80 implementation
6 ;
7
8         .export         soft80_kplot
9         .import         soft80_internal_cursorxlsb
10
11         .include        "c64.inc"
12         .include        "soft80.inc"
13
14 soft80_kplot:
15         bcs     @getpos
16
17         stx     CURS_Y
18         sty     CURS_X
19
20         sei
21         lda     $01
22         pha
23         lda     #$34                            ; enable RAM under I/O
24         sta     $01
25
26         ; calc pointer to bitmap
27         lda     soft80_bitmapylo,x
28         clc
29         adc     soft80_bitmapxlo,y
30         sta     SCREEN_PTR
31         lda     soft80_bitmapyhi,x
32         adc     soft80_bitmapxhi,y
33         sta     SCREEN_PTR+1
34
35         tya
36         and     #1
37         sta     soft80_internal_cursorxlsb
38
39         ; calc pointer to vram
40         tya
41         lsr     a
42
43         clc
44         adc     soft80_vramlo,x
45         sta     CRAM_PTR
46         lda     #0
47         adc     soft80_vramhi,x
48         sta     CRAM_PTR+1
49
50         pla
51         sta     $01
52         cli
53
54 @getpos:
55         ldx     CURS_Y
56         ldy     CURS_X
57         rts
58
59 ;-------------------------------------------------------------------------------
60 ; force the init constructor to be imported
61
62         .import soft80_init
63 conio_init      = soft80_init