]> git.sur5r.net Git - cc65/blob - libsrc/atari/tgi/atr10p2.s
Removed (pretty inconsistently used) tab chars from source code base.
[cc65] / libsrc / atari / tgi / atr10p2.s
1 ;
2 ; Graphics driver for the 80x192x9 (CIO mode 10, ANTIC mode F, GTIA mode $80) on the Atari.
3 ;
4 ; Fatih Aygun (2009)
5 ;
6
7         .include        "atari.inc"
8         .include        "zeropage.inc"
9
10         .include        "tgi-kernel.inc"
11         .include        "tgi-error.inc"
12
13         .macpack        generic
14
15 ; ******************************************************************************
16
17         ; ----------------------------------------------------------------------
18         ;
19         ; Constants and tables
20         ;
21         ; ----------------------------------------------------------------------
22
23 ; Graphics mode
24         grmode = 10
25 ; X resolution
26         x_res = 80
27 ; Y resolution
28         y_res = 192
29 ; Number of colors
30         colors = 9
31 ; Pixels per byte
32         ppb = 2
33 ; Screen memory size in bytes
34         scrsize = x_res * y_res / ppb
35 ; Pixel aspect ratio
36         aspect = $0330                          ; based on 4/3 display
37 ; Free memory needed
38         mem_needed = 15339
39 ; Number of screen pages
40         pages = 2
41
42 .rodata
43         mask_table:                             ; Mask table to set pixels
44                 .byte   %11110000, %00001111
45         masks:                                  ; Color masks
46                 .byte   $00, $11, $22, $33, $44, $55, $66, $77, $88
47         bar_table:                              ; Mask table for BAR
48                 .byte   %11111111, %00001111, %00000000
49         default_palette:
50                 .byte   $00, $0E, $32, $96, $68, $C4, $74, $EE, $4A
51
52 .code
53
54 ; ******************************************************************************
55
56 .proc SETPALETTE
57
58         ; ----------------------------------------------------------------------
59         ;
60         ; SETPALETTE: Set the palette (in ptr1)
61         ;
62         ; ----------------------------------------------------------------------
63
64 .code
65         ; Copy the palette
66         ldy     #colors - 1
67 loop:   lda     (ptr1),y
68         sta     palette,y
69         sta     PCOLR0,y
70         dey
71         bpl     loop
72
73         ; Done, reset the error code
74         lda     #TGI_ERR_OK
75         sta     error
76         rts
77 .endproc
78
79 .include "atari_tgi_common.inc"