1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-26 08:32:00 +00:00

add Atari TGI drivers from Fatih Aygun

git-svn-id: svn://svn.cc65.org/cc65/trunk@4456 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cpg 2009-11-10 21:53:55 +00:00
parent fe5adb5c4e
commit b18d6ad8db
21 changed files with 2761 additions and 18 deletions

View File

@ -44,6 +44,12 @@
TGI_ERR_INV_FUNC ; Function not supported
TGI_ERR_INV_FONT ; Font file is invalid
; Atari specific error codes
TGI_ERR_NO_IOCB ; No free IOCB to open the screen device
TGI_ERR_NO_MEM ; Not enough memory
TGI_ERR_UNKNOWN ; Unknown error
TGI_ERR_COUNT ; Special: Number of error messages
.endenum

View File

@ -42,6 +42,22 @@
TGI_MODE_640_480_2 ; 640x480, 2 colors (b/w)
TGI_MODE_280_192_8 ; 280x192, 8 colors
TGI_MODE_40_48_16 ; 40x48, 16 colors
TGI_MODE_320_192_2
TGI_MODE_160_192_4
TGI_MODE_160_192_2
TGI_MODE_160_96_4
TGI_MODE_160_96_2
TGI_MODE_80_48_4
TGI_MODE_80_48_2
TGI_MODE_40_24_4
TGI_MODE_80_192_16b
TGI_MODE_80_192_9
TGI_MODE_80_192_16h
TGI_MODE_320_192_2_2p
TGI_MODE_80_192_16b_2p
TGI_MODE_160_192_4_2p
TGI_MODE_80_192_9_2p
.endenum

View File

@ -15,18 +15,18 @@ LD = ../../src/ld65/ld65
# List of all targets
ALLTARGETS = apple2 \
apple2enh \
atari \
atmos \
atari \
atmos \
c16 \
c128 \
c64 \
cbm510 \
cbm610 \
geos \
c128 \
c64 \
cbm510 \
cbm610 \
geos \
lynx \
nes \
pet \
plus4 \
pet \
plus4 \
supervision \
vic20
@ -43,7 +43,7 @@ all:
apple2lib:
for i in apple2 common runtime conio dbg em joystick mouse serial tgi zlib; do \
$(MAKE) SYS=apple2 -C $$i || exit 1; \
$(MAKE) SYS=apple2 -C $$i || exit 1; \
$(AR) a apple2.lib $$i/*.o;\
done
cp apple2/apple2-auxmem.emd a2.auxmem.emd
@ -83,18 +83,34 @@ apple2enhlib:
atarilib:
for i in atari common runtime conio dbg em joystick tgi zlib; do \
$(MAKE) SYS=atari -C $$i || exit 1; \
$(MAKE) SYS=atari -C $$i || exit 1; \
$(AR) a atari.lib $$i/*.o;\
done
cp atari/atari-stdjoy.joy ataristd.joy
cp atari/atari-multijoy.joy atarimj8.joy
cp atari/atari-10.tgi atari10.tgi
cp atari/atari-10p2.tgi atr10p2.tgi
cp atari/atari-11.tgi atari11.tgi
cp atari/atari-14.tgi atari14.tgi
cp atari/atari-15.tgi atari15.tgi
cp atari/atari-15p2.tgi atr15p2.tgi
cp atari/atari-3.tgi atari3.tgi
cp atari/atari-4.tgi atari4.tgi
cp atari/atari-5.tgi atari5.tgi
cp atari/atari-6.tgi atari6.tgi
cp atari/atari-7.tgi atari7.tgi
cp atari/atari-8.tgi atari8.tgi
cp atari/atari-8p2.tgi atr8p2.tgi
cp atari/atari-9.tgi atari9.tgi
cp atari/atari-9p2.tgi atr9p2.tgi
#-----------------------------------------------------------------------------
# Oric Atmos
atmoslib:
for i in atmos common conio runtime em joystick tgi zlib; do \
$(MAKE) SYS=atmos -C $$i || exit 1; \
$(MAKE) SYS=atmos -C $$i || exit 1; \
$(AR) a atmos.lib $$i/*.o;\
done
cp atmos/*.tgi .
@ -104,7 +120,7 @@ atmoslib:
c16lib:
for i in c16 cbm common runtime conio dbg em joystick tgi zlib; do \
$(MAKE) SYS=c16 -C $$i || exit 1; \
$(MAKE) SYS=c16 -C $$i || exit 1; \
$(AR) a c16.lib $$i/*.o;\
done
cp c16/*.joy .
@ -173,7 +189,7 @@ geoslib:
CC=../$(CC) \
AS=../$(AS) \
AR=../$(AR) \
LD=../$(LD) \
LD=../$(LD) \
AFLAGS="-t geos -I../../../asminc" \
CFLAGS="-Osir -g -T -t geos --forget-inc-paths -I. -I../../../include" \
$(MAKE) -C geos || exit 1
@ -265,7 +281,7 @@ vic20lib:
.PHONY: clean
clean:
@for i in cbm common conio dbg em joystick mouse runtime serial tgi zlib $(ALLTARGETS); do\
$(MAKE) -C $$i clean; \
$(MAKE) -C $$i clean; \
done
.PHONY: zap

View File

@ -49,8 +49,9 @@ CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
%.joy: %.o ../runtime/zeropage.o
@$(LD) -t module -o $@ $^
%.tgi: %.o ../runtime/zeropage.o
@$(LD) -t module -o $@ $^
%.tgi: %.o ../runtime/zeropage.o atari_tgi_common.inc
@$(LD) -t module -o $@ $< ../runtime/zeropage.o
#--------------------------------------------------------------------------
# Object files
@ -107,6 +108,7 @@ OBJS = _scrsize.o \
sysrmdir.o \
systime.o \
sysuname.o \
tgi_mode_table.o\
tvtype.o \
ucase_fn.o \
wherex.o \
@ -121,7 +123,9 @@ EMDS =
JOYS = atari-stdjoy.joy atari-multijoy.joy
TGIS =
TGIS = atari-3.tgi atari-4.tgi atari-5.tgi atari-6.tgi atari-7.tgi atari-8.tgi \
atari-9.tgi atari-10.tgi atari-11.tgi atari-14.tgi atari-15.tgi atari-8p2.tgi \
atari-9p2.tgi atari-10p2.tgi atari-15p2.tgi
#--------------------------------------------------------------------------
# Targets

80
libsrc/atari/atari-10.s Normal file
View File

@ -0,0 +1,80 @@
;
; Graphics driver for the 80x192x9 (CIO mode 10, ANTIC mode F, GTIA mode $80) on the Atari.
;
; Fatih Aygun (2009)
;
.include "atari.inc"
.include "zeropage.inc"
.include "tgi-kernel.inc"
.include "tgi-mode.inc"
.include "tgi-error.inc"
.macpack generic
; ******************************************************************************
; ----------------------------------------------------------------------
;
; Constants and tables
;
; ----------------------------------------------------------------------
; Graphics mode
.define grmode 10
; X resolution
.define x_res 80
; Y resolution
.define y_res 192
; Number of colors
.define colors 9
; Pixels per byte
.define ppb 2
; Screen memory size in bytes
.define scrsize x_res * y_res / ppb
; Pixel aspect ratio
.define aspect $0400 ; 4:1
; Free memory needed
.define mem_needed 7147
; Number of screen pages
.define pages 1
.rodata
mask_table: ; Mask table to set pixels
.byte %11110000, %00001111
masks: ; Color masks
.byte $00, $11, $22, $33, $44, $55, $66, $77, $88
bar_table: ; Mask table for BAR
.byte %11111111, %00001111, %00000000
default_palette:
.byte $00, $0E, $32, $96, $68, $C4, $74, $EE, $4A
.code
; ******************************************************************************
.proc SETPALETTE
; ----------------------------------------------------------------------
;
; SETPALETTE: Set the palette (in ptr1)
;
; ----------------------------------------------------------------------
.code
; Copy the palette
ldy #colors - 1
loop: lda (ptr1),y
sta palette,y
sta PCOLR0,y
dey
bpl loop
; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
.endproc
.include "atari_tgi_common.inc"

80
libsrc/atari/atari-10p2.s Normal file
View File

@ -0,0 +1,80 @@
;
; Graphics driver for the 80x192x9 (CIO mode 10, ANTIC mode F, GTIA mode $80) on the Atari.
;
; Fatih Aygun (2009)
;
.include "atari.inc"
.include "zeropage.inc"
.include "tgi-kernel.inc"
.include "tgi-mode.inc"
.include "tgi-error.inc"
.macpack generic
; ******************************************************************************
; ----------------------------------------------------------------------
;
; Constants and tables
;
; ----------------------------------------------------------------------
; Graphics mode
.define grmode 10
; X resolution
.define x_res 80
; Y resolution
.define y_res 192
; Number of colors
.define colors 9
; Pixels per byte
.define ppb 2
; Screen memory size in bytes
.define scrsize x_res * y_res / ppb
; Pixel aspect ratio
.define aspect $0400 ; 4:1
; Free memory needed
.define mem_needed 15339
; Number of screen pages
.define pages 2
.rodata
mask_table: ; Mask table to set pixels
.byte %11110000, %00001111
masks: ; Color masks
.byte $00, $11, $22, $33, $44, $55, $66, $77, $88
bar_table: ; Mask table for BAR
.byte %11111111, %00001111, %00000000
default_palette:
.byte $00, $0E, $32, $96, $68, $C4, $74, $EE, $4A
.code
; ******************************************************************************
.proc SETPALETTE
; ----------------------------------------------------------------------
;
; SETPALETTE: Set the palette (in ptr1)
;
; ----------------------------------------------------------------------
.code
; Copy the palette
ldy #colors - 1
loop: lda (ptr1),y
sta palette,y
sta PCOLR0,y
dey
bpl loop
; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
.endproc
.include "atari_tgi_common.inc"

72
libsrc/atari/atari-11.s Normal file
View File

@ -0,0 +1,72 @@
;
; Graphics driver for the 80x192x16h (CIO mode 11, ANTIC mode F, GTIA mode $C0) on the Atari.
;
; Fatih Aygun (2009)
;
.include "atari.inc"
.include "zeropage.inc"
.include "tgi-kernel.inc"
.include "tgi-mode.inc"
.include "tgi-error.inc"
.macpack generic
; ******************************************************************************
; ----------------------------------------------------------------------
;
; Constants and tables
;
; ----------------------------------------------------------------------
; Graphics mode
.define grmode 11
; X resolution
.define x_res 80
; Y resolution
.define y_res 192
; Number of colors
.define colors 16
; Pixels per byte
.define ppb 2
; Screen memory size in bytes
.define scrsize x_res * y_res / ppb
; Pixel aspect ratio
.define aspect $0400 ; 4:1
; Free memory needed
.define mem_needed 7147
; Number of screen pages
.define pages 1
.rodata
mask_table: ; Mask table to set pixels
.byte %11110000, %00001111
masks: ; Color masks
.byte $00, $11, $22, $33, $44, $55, $66, $77, $88, $99, $aa, $bb, $cc, $dd, $ee, $ff
bar_table: ; Mask table for BAR
.byte %11111111, %00001111, %00000000
default_palette:
.byte $00, $10, $20, $30, $40, $50, $60, $70, $80, $90, $A0, $B0, $C0, $D0, $E0, $F0
.code
; ******************************************************************************
.proc SETPALETTE
; ----------------------------------------------------------------------
;
; SETPALETTE: Set the palette (in ptr1)
;
; ----------------------------------------------------------------------
.code
; No palettes
lda #TGI_ERR_INV_FUNC
sta error
rts
.endproc
.include "atari_tgi_common.inc"

85
libsrc/atari/atari-14.s Normal file
View File

@ -0,0 +1,85 @@
;
; Graphics driver for the 160x192x2 (CIO mode 14, ANTIC mode C) on the Atari.
;
; Fatih Aygun (2009)
;
.include "atari.inc"
.include "zeropage.inc"
.include "tgi-kernel.inc"
.include "tgi-mode.inc"
.include "tgi-error.inc"
.macpack generic
; ******************************************************************************
; ----------------------------------------------------------------------
;
; Constants and tables
;
; ----------------------------------------------------------------------
; Graphics mode
.define grmode 14
; X resolution
.define x_res 160
; Y resolution
.define y_res 192
; Number of colors
.define colors 2
; Pixels per byte
.define ppb 8
; Screen memory size in bytes
.define scrsize x_res * y_res / ppb
; Pixel aspect ratio
.define aspect $0200 ; 2:1
; Free memory needed
.define mem_needed 3305
; Number of screen pages
.define pages 1
.rodata
mask_table: ; Mask table to set pixels
.byte %10000000, %01000000, %00100000, %00010000, %00001000, %00000100, %00000010, %00000001
masks: ; Color masks
.byte %00000000, %11111111
bar_table: ; Mask table for BAR
.byte %11111111, %01111111, %00111111, %00011111, %00001111, %00000111, %00000011, %00000001, %00000000
default_palette:
.byte $00, $0E
.code
; ******************************************************************************
.proc SETPALETTE
; ----------------------------------------------------------------------
;
; SETPALETTE: Set the palette (in ptr1)
;
; ----------------------------------------------------------------------
.code
; Copy the palette
ldy #colors - 1
loop: lda (ptr1),y
sta palette,y
dey
bpl loop
; Get the color entries from the palette
lda palette
sta COLOR4
lda palette + 1
sta COLOR0
; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
.endproc
.include "atari_tgi_common.inc"

89
libsrc/atari/atari-15.s Normal file
View File

@ -0,0 +1,89 @@
;
; Graphics driver for the 160x192x2 (CIO mode 15, ANTIC mode E) on the Atari.
;
; Fatih Aygun (2009)
;
.include "atari.inc"
.include "zeropage.inc"
.include "tgi-kernel.inc"
.include "tgi-mode.inc"
.include "tgi-error.inc"
.macpack generic
; ******************************************************************************
; ----------------------------------------------------------------------
;
; Constants and tables
;
; ----------------------------------------------------------------------
; Graphics mode
.define grmode 15
; X resolution
.define x_res 160
; Y resolution
.define y_res 192
; Number of colors
.define colors 4
; Pixels per byte
.define ppb 4
; Screen memory size in bytes
.define scrsize x_res * y_res / ppb
; Pixel aspect ratio
.define aspect $0200 ; 2:1
; Free memory needed
.define mem_needed 7147
; Number of screen pages
.define pages 1
.rodata
mask_table: ; Mask table to set pixels
.byte %11000000, %00110000, %00001100, %00000011
masks: ; Color masks
.byte %00000000, %01010101, %10101010, %11111111
bar_table: ; Mask table for BAR
.byte %11111111, %00111111, %00001111, %00000011, %00000000
default_palette:
.byte $00, $0E, $32, $96
.code
; ******************************************************************************
.proc SETPALETTE
; ----------------------------------------------------------------------
;
; SETPALETTE: Set the palette (in ptr1)
;
; ----------------------------------------------------------------------
.code
; Copy the palette
ldy #colors - 1
loop: lda (ptr1),y
sta palette,y
dey
bpl loop
; Get the color entries from the palette
lda palette
sta COLOR4
lda palette + 1
sta COLOR0
lda palette + 2
sta COLOR1
lda palette + 3
sta COLOR2
; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
.endproc
.include "atari_tgi_common.inc"

89
libsrc/atari/atari-15p2.s Normal file
View File

@ -0,0 +1,89 @@
;
; Graphics driver for the 160x192x2 (CIO mode 15, ANTIC mode E) on the Atari.
;
; Fatih Aygun (2009)
;
.include "atari.inc"
.include "zeropage.inc"
.include "tgi-kernel.inc"
.include "tgi-mode.inc"
.include "tgi-error.inc"
.macpack generic
; ******************************************************************************
; ----------------------------------------------------------------------
;
; Constants and tables
;
; ----------------------------------------------------------------------
; Graphics mode
.define grmode 15
; X resolution
.define x_res 160
; Y resolution
.define y_res 192
; Number of colors
.define colors 4
; Pixels per byte
.define ppb 4
; Screen memory size in bytes
.define scrsize x_res * y_res / ppb
; Pixel aspect ratio
.define aspect $0200 ; 2:1
; Free memory needed
.define mem_needed 15339
; Number of screen pages
.define pages 2
.rodata
mask_table: ; Mask table to set pixels
.byte %11000000, %00110000, %00001100, %00000011
masks: ; Color masks
.byte %00000000, %01010101, %10101010, %11111111
bar_table: ; Mask table for BAR
.byte %11111111, %00111111, %00001111, %00000011, %00000000
default_palette:
.byte $00, $0E, $32, $96
.code
; ******************************************************************************
.proc SETPALETTE
; ----------------------------------------------------------------------
;
; SETPALETTE: Set the palette (in ptr1)
;
; ----------------------------------------------------------------------
.code
; Copy the palette
ldy #colors - 1
loop: lda (ptr1),y
sta palette,y
dey
bpl loop
; Get the color entries from the palette
lda palette
sta COLOR4
lda palette + 1
sta COLOR0
lda palette + 2
sta COLOR1
lda palette + 3
sta COLOR2
; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
.endproc
.include "atari_tgi_common.inc"

89
libsrc/atari/atari-3.s Normal file
View File

@ -0,0 +1,89 @@
;
; Graphics driver for the 40x24x4 (CIO mode 3, ANTIC mode 8) on the Atari.
;
; Fatih Aygun (2009)
;
.include "atari.inc"
.include "zeropage.inc"
.include "tgi-kernel.inc"
.include "tgi-mode.inc"
.include "tgi-error.inc"
.macpack generic
; ******************************************************************************
; ----------------------------------------------------------------------
;
; Constants and tables
;
; ----------------------------------------------------------------------
; Graphics mode
.define grmode 3
; X resolution
.define x_res 40
; Y resolution
.define y_res 24
; Number of colors
.define colors 4
; Pixels per byte
.define ppb 4
; Screen memory size in bytes
.define scrsize x_res * y_res / ppb
; Pixel aspect ratio
.define aspect $0100 ; 1:1
; Free memory needed
.define mem_needed 1
; Number of screen pages
.define pages 1
.rodata
mask_table: ; Mask table to set pixels
.byte %11000000, %00110000, %00001100, %00000011
masks: ; Color masks
.byte %00000000, %01010101, %10101010, %11111111
bar_table: ; Mask table for BAR
.byte %11111111, %00111111, %00001111, %00000011, %00000000
default_palette:
.byte $00, $0E, $32, $96
.code
; ******************************************************************************
.proc SETPALETTE
; ----------------------------------------------------------------------
;
; SETPALETTE: Set the palette (in ptr1)
;
; ----------------------------------------------------------------------
.code
; Copy the palette
ldy #colors - 1
loop: lda (ptr1),y
sta palette,y
dey
bpl loop
; Get the color entries from the palette
lda palette
sta COLOR4
lda palette + 1
sta COLOR0
lda palette + 2
sta COLOR1
lda palette + 3
sta COLOR2
; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
.endproc
.include "atari_tgi_common.inc"

85
libsrc/atari/atari-4.s Normal file
View File

@ -0,0 +1,85 @@
;
; Graphics driver for the 80x48x2 (CIO mode 4, ANTIC mode 9) on the Atari.
;
; Fatih Aygun (2009)
;
.include "atari.inc"
.include "zeropage.inc"
.include "tgi-kernel.inc"
.include "tgi-mode.inc"
.include "tgi-error.inc"
.macpack generic
; ******************************************************************************
; ----------------------------------------------------------------------
;
; Constants and tables
;
; ----------------------------------------------------------------------
; Graphics mode
.define grmode 4
; X resolution
.define x_res 80
; Y resolution
.define y_res 48
; Number of colors
.define colors 2
; Pixels per byte
.define ppb 8
; Screen memory size in bytes
.define scrsize x_res * y_res / ppb
; Pixel aspect ratio
.define aspect $0100 ; 1:1
; Free memory needed
.define mem_needed 1
; Number of screen pages
.define pages 1
.rodata
mask_table: ; Mask table to set pixels
.byte %10000000, %01000000, %00100000, %00010000, %00001000, %00000100, %00000010, %00000001
masks: ; Color masks
.byte %00000000, %11111111
bar_table: ; Mask table for BAR
.byte %11111111, %01111111, %00111111, %00011111, %00001111, %00000111, %00000011, %00000001, %00000000
default_palette:
.byte $00, $0E
.code
; ******************************************************************************
.proc SETPALETTE
; ----------------------------------------------------------------------
;
; SETPALETTE: Set the palette (in ptr1)
;
; ----------------------------------------------------------------------
.code
; Copy the palette
ldy #colors - 1
loop: lda (ptr1),y
sta palette,y
dey
bpl loop
; Get the color entries from the palette
lda palette
sta COLOR4
lda palette + 1
sta COLOR0
; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
.endproc
.include "atari_tgi_common.inc"

89
libsrc/atari/atari-5.s Normal file
View File

@ -0,0 +1,89 @@
;
; Graphics driver for the 80x48x4 (CIO mode 5, ANTIC mode A) on the Atari.
;
; Fatih Aygun (2009)
;
.include "atari.inc"
.include "zeropage.inc"
.include "tgi-kernel.inc"
.include "tgi-mode.inc"
.include "tgi-error.inc"
.macpack generic
; ******************************************************************************
; ----------------------------------------------------------------------
;
; Constants and tables
;
; ----------------------------------------------------------------------
; Graphics mode
.define grmode 5
; X resolution
.define x_res 80
; Y resolution
.define y_res 48
; Number of colors
.define colors 4
; Pixels per byte
.define ppb 4
; Screen memory size in bytes
.define scrsize x_res * y_res / ppb
; Pixel aspect ratio
.define aspect $0100 ; 1:1
; Free memory needed
.define mem_needed 185
; Number of screen pages
.define pages 1
.rodata
mask_table: ; Mask table to set pixels
.byte %11000000, %00110000, %00001100, %00000011
masks: ; Color masks
.byte %00000000, %01010101, %10101010, %11111111
bar_table: ; Mask table for BAR
.byte %11111111, %00111111, %00001111, %00000011, %00000000
default_palette:
.byte $00, $0E, $32, $96
.code
; ******************************************************************************
.proc SETPALETTE
; ----------------------------------------------------------------------
;
; SETPALETTE: Set the palette (in ptr1)
;
; ----------------------------------------------------------------------
.code
; Copy the palette
ldy #colors - 1
loop: lda (ptr1),y
sta palette,y
dey
bpl loop
; Get the color entries from the palette
lda palette
sta COLOR4
lda palette + 1
sta COLOR0
lda palette + 2
sta COLOR1
lda palette + 3
sta COLOR2
; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
.endproc
.include "atari_tgi_common.inc"

85
libsrc/atari/atari-6.s Normal file
View File

@ -0,0 +1,85 @@
;
; Graphics driver for the 160x96x2 (CIO mode 6, ANTIC mode B) on the Atari.
;
; Fatih Aygun (2009)
;
.include "atari.inc"
.include "zeropage.inc"
.include "tgi-kernel.inc"
.include "tgi-mode.inc"
.include "tgi-error.inc"
.macpack generic
; ******************************************************************************
; ----------------------------------------------------------------------
;
; Constants and tables
;
; ----------------------------------------------------------------------
; Graphics mode
.define grmode 6
; X resolution
.define x_res 160
; Y resolution
.define y_res 96
; Number of colors
.define colors 2
; Pixels per byte
.define ppb 8
; Screen memory size in bytes
.define scrsize x_res * y_res / ppb
; Pixel aspect ratio
.define aspect $0100 ; 1:1
; Free memory needed
.define mem_needed 1193
; Number of screen pages
.define pages 1
.rodata
mask_table: ; Mask table to set pixels
.byte %10000000, %01000000, %00100000, %00010000, %00001000, %00000100, %00000010, %00000001
masks: ; Color masks
.byte %00000000, %11111111
bar_table: ; Mask table for BAR
.byte %11111111, %01111111, %00111111, %00011111, %00001111, %00000111, %00000011, %00000001, %00000000
default_palette:
.byte $00, $0E
.code
; ******************************************************************************
.proc SETPALETTE
; ----------------------------------------------------------------------
;
; SETPALETTE: Set the palette (in ptr1)
;
; ----------------------------------------------------------------------
.code
; Copy the palette
ldy #colors - 1
loop: lda (ptr1),y
sta palette,y
dey
bpl loop
; Get the color entries from the palette
lda palette
sta COLOR4
lda palette + 1
sta COLOR0
; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
.endproc
.include "atari_tgi_common.inc"

89
libsrc/atari/atari-7.s Normal file
View File

@ -0,0 +1,89 @@
;
; Graphics driver for the 160x96x4 (CIO mode 7, ANTIC mode D) on the Atari.
;
; Fatih Aygun (2009)
;
.include "atari.inc"
.include "zeropage.inc"
.include "tgi-kernel.inc"
.include "tgi-mode.inc"
.include "tgi-error.inc"
.macpack generic
; ******************************************************************************
; ----------------------------------------------------------------------
;
; Constants and tables
;
; ----------------------------------------------------------------------
; Graphics mode
.define grmode 7
; X resolution
.define x_res 160
; Y resolution
.define y_res 96
; Number of colors
.define colors 4
; Pixels per byte
.define ppb 4
; Screen memory size in bytes
.define scrsize x_res * y_res / ppb
; Pixel aspect ratio
.define aspect $0100 ; 1:1
; Free memory needed
.define mem_needed 3209
; Number of screen pages
.define pages 1
.rodata
mask_table: ; Mask table to set pixels
.byte %11000000, %00110000, %00001100, %00000011
masks: ; Color masks
.byte %00000000, %01010101, %10101010, %11111111
bar_table: ; Mask table for BAR
.byte %11111111, %00111111, %00001111, %00000011, %00000000
default_palette:
.byte $00, $0E, $32, $96
.code
; ******************************************************************************
.proc SETPALETTE
; ----------------------------------------------------------------------
;
; SETPALETTE: Set the palette (in ptr1)
;
; ----------------------------------------------------------------------
.code
; Copy the palette
ldy #colors - 1
loop: lda (ptr1),y
sta palette,y
dey
bpl loop
; Get the color entries from the palette
lda palette
sta COLOR4
lda palette + 1
sta COLOR0
lda palette + 2
sta COLOR1
lda palette + 3
sta COLOR2
; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
.endproc
.include "atari_tgi_common.inc"

84
libsrc/atari/atari-8.s Normal file
View File

@ -0,0 +1,84 @@
;
; Graphics driver for the 320x192x2 (CIO mode 8, ANTIC mode F) on the Atari.
;
; Fatih Aygun (2009)
;
.include "atari.inc"
.include "zeropage.inc"
.include "tgi-kernel.inc"
.include "tgi-mode.inc"
.include "tgi-error.inc"
.macpack generic
; ******************************************************************************
; ----------------------------------------------------------------------
;
; Constants and tables
;
; ----------------------------------------------------------------------
; Graphics mode
.define grmode 8
; X resolution
.define x_res 320
; Y resolution
.define y_res 192
; Number of colors
.define colors 2
; Pixels per byte
.define ppb 8
; Screen memory size in bytes
.define scrsize x_res * y_res / ppb
; Pixel aspect ratio
.define aspect $0100 ; 1:1
; Free memory needed
.define mem_needed 7147
; Number of screen pages
.define pages 1
.rodata
mask_table: ; Mask table to set pixels
.byte %10000000, %01000000, %00100000, %00010000, %00001000, %00000100, %00000010, %00000001
masks: ; Color masks
.byte %00000000, %11111111
bar_table: ; Mask table for BAR
.byte %11111111, %01111111, %00111111, %00011111, %00001111, %00000111, %00000011, %00000001, %00000000
default_palette:
.byte $00, $0E
.code
; ******************************************************************************
.proc SETPALETTE
; ----------------------------------------------------------------------
;
; SETPALETTE: Set the palette (in ptr1)
;
; ----------------------------------------------------------------------
.code
; Copy the palette
ldy #colors - 1
loop: lda (ptr1),y
sta palette,y
dey
bpl loop
; Get the color entries from the palette
lda palette
sta COLOR2
lda palette + 1
sta COLOR1
; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
.endproc
.include "atari_tgi_common.inc"

84
libsrc/atari/atari-8p2.s Normal file
View File

@ -0,0 +1,84 @@
;
; Graphics driver for the 320x192x2 (CIO mode 8, ANTIC mode F) on the Atari.
;
; Fatih Aygun (2009)
;
.include "atari.inc"
.include "zeropage.inc"
.include "tgi-kernel.inc"
.include "tgi-mode.inc"
.include "tgi-error.inc"
.macpack generic
; ******************************************************************************
; ----------------------------------------------------------------------
;
; Constants and tables
;
; ----------------------------------------------------------------------
; Graphics mode
.define grmode 8
; X resolution
.define x_res 320
; Y resolution
.define y_res 192
; Number of colors
.define colors 2
; Pixels per byte
.define ppb 8
; Screen memory size in bytes
.define scrsize x_res * y_res / ppb
; Pixel aspect ratio
.define aspect $0100 ; 1:1
; Free memory needed
.define mem_needed 15339
; Number of screen pages
.define pages 2
.rodata
mask_table: ; Mask table to set pixels
.byte %10000000, %01000000, %00100000, %00010000, %00001000, %00000100, %00000010, %00000001
masks: ; Color masks
.byte %00000000, %11111111
bar_table: ; Mask table for BAR
.byte %11111111, %01111111, %00111111, %00011111, %00001111, %00000111, %00000011, %00000001, %00000000
default_palette:
.byte $00, $0E
.code
; ******************************************************************************
.proc SETPALETTE
; ----------------------------------------------------------------------
;
; SETPALETTE: Set the palette (in ptr1)
;
; ----------------------------------------------------------------------
.code
; Copy the palette
ldy #colors - 1
loop: lda (ptr1),y
sta palette,y
dey
bpl loop
; Get the color entries from the palette
lda palette
sta COLOR2
lda palette + 1
sta COLOR1
; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
.endproc
.include "atari_tgi_common.inc"

72
libsrc/atari/atari-9.s Normal file
View File

@ -0,0 +1,72 @@
;
; Graphics driver for the 80x192x16b (CIO mode 9, ANTIC mode F, GTIA mode $40) on the Atari.
;
; Fatih Aygun (2009)
;
.include "atari.inc"
.include "zeropage.inc"
.include "tgi-kernel.inc"
.include "tgi-mode.inc"
.include "tgi-error.inc"
.macpack generic
; ******************************************************************************
; ----------------------------------------------------------------------
;
; Constants and tables
;
; ----------------------------------------------------------------------
; Graphics mode
.define grmode 9
; X resolution
.define x_res 80
; Y resolution
.define y_res 192
; Number of colors
.define colors 16
; Pixels per byte
.define ppb 2
; Screen memory size in bytes
.define scrsize x_res * y_res / ppb
; Pixel aspect ratio
.define aspect $0400 ; 4:1
; Free memory needed
.define mem_needed 7147
; Number of screen pages
.define pages 1
.rodata
mask_table: ; Mask table to set pixels
.byte %11110000, %00001111
masks: ; Color masks
.byte $00, $11, $22, $33, $44, $55, $66, $77, $88, $99, $aa, $bb, $cc, $dd, $ee, $ff
bar_table: ; Mask table for BAR
.byte %11111111, %00001111, %00000000
default_palette:
.byte $00, $0F, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0A, $0B, $0C, $0D, $0E
.code
; ******************************************************************************
.proc SETPALETTE
; ----------------------------------------------------------------------
;
; SETPALETTE: Set the palette (in ptr1)
;
; ----------------------------------------------------------------------
.code
; No palettes
lda #TGI_ERR_INV_FUNC
sta error
rts
.endproc
.include "atari_tgi_common.inc"

72
libsrc/atari/atari-9p2.s Normal file
View File

@ -0,0 +1,72 @@
;
; Graphics driver for the 80x192x16b (CIO mode 9, ANTIC mode F, GTIA mode $40) on the Atari.
;
; Fatih Aygun (2009)
;
.include "atari.inc"
.include "zeropage.inc"
.include "tgi-kernel.inc"
.include "tgi-mode.inc"
.include "tgi-error.inc"
.macpack generic
; ******************************************************************************
; ----------------------------------------------------------------------
;
; Constants and tables
;
; ----------------------------------------------------------------------
; Graphics mode
.define grmode 9
; X resolution
.define x_res 80
; Y resolution
.define y_res 192
; Number of colors
.define colors 16
; Pixels per byte
.define ppb 2
; Screen memory size in bytes
.define scrsize x_res * y_res / ppb
; Pixel aspect ratio
.define aspect $0400 ; 4:1
; Free memory needed
.define mem_needed 15339
; Number of screen pages
.define pages 2
.rodata
mask_table: ; Mask table to set pixels
.byte %11110000, %00001111
masks: ; Color masks
.byte $00, $11, $22, $33, $44, $55, $66, $77, $88, $99, $aa, $bb, $cc, $dd, $ee, $ff
bar_table: ; Mask table for BAR
.byte %11111111, %00001111, %00000000
default_palette:
.byte $00, $0F, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0A, $0B, $0C, $0D, $0E
.code
; ******************************************************************************
.proc SETPALETTE
; ----------------------------------------------------------------------
;
; SETPALETTE: Set the palette (in ptr1)
;
; ----------------------------------------------------------------------
.code
; No palettes
lda #TGI_ERR_INV_FUNC
sta error
rts
.endproc
.include "atari_tgi_common.inc"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,40 @@
;
; Ullrich von Bassewitz, 31.05.2002
;
; C64 mode table for tgi_map_mode
;
.export _tgi_mode_table
.include "tgi-mode.inc"
;----------------------------------------------------------------------------
; Mode table. Contains entries of mode and driver name, the driver name being
; null terminated. A mode with code zero terminates the list. The first entry
; defines also the default mode and driver for the system.
; BEWARE: The current implementation of tgi_map_mode does not work with tables
; larger that 255 bytes!
.rodata
_tgi_mode_table:
.byte TGI_MODE_320_192_2, "ATARI8.TGI", 0
.byte TGI_MODE_160_192_4, "ATARI15.TGI", 0
.byte TGI_MODE_160_192_2, "ATARI14.TGI", 0
.byte TGI_MODE_160_96_4, "ATARI7.TGI", 0
.byte TGI_MODE_160_96_2, "ATARI6.TGI", 0
.byte TGI_MODE_80_48_4, "ATARI5.TGI", 0
.byte TGI_MODE_80_48_2, "ATARI4.TGI", 0
.byte TGI_MODE_40_24_4, "ATARI3.TGI", 0
.byte TGI_MODE_80_192_16b, "ATARI9.TGI", 0
.byte TGI_MODE_80_192_9, "ATARI10.TGI", 0
.byte TGI_MODE_80_192_16h, "ATARI11.TGI", 0
; Double paged drivers
.byte TGI_MODE_320_192_2_2p, "ATR8P2.TGI", 0
.byte TGI_MODE_80_192_16b_2p, "ATR9P2.TGI", 0
.byte TGI_MODE_160_192_4_2p, "ATR15P2.TGI", 0
.byte TGI_MODE_80_192_9_2p, "ATR10P2.TGI", 0
.byte 0 ; End marker