1
0
mirror of https://github.com/cc65/cc65.git synced 2025-02-27 14:29:52 +00:00

Quite some minor changes to have the two C128 TGI driver source files only differ where they are semantically different.

git-svn-id: svn://svn.cc65.org/cc65/trunk@4552 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
ol.sc 2010-01-23 08:55:37 +00:00
parent 5175f95341
commit 16129b2724
2 changed files with 70 additions and 69 deletions

View File

@ -453,8 +453,8 @@ SETPALETTE:
ora COLTRANS,y ora COLTRANS,y
ldx #VDC_COLORS ldx #VDC_COLORS
jsr VDCWriteReg ; Clear error code jsr VDCWriteReg
lda #TGI_ERR_OK lda #TGI_ERR_OK ; Clear error code
sta ERROR sta ERROR
rts rts
@ -766,59 +766,59 @@ BAR:
; Original code for a horizontal line ; Original code for a horizontal line
HORLINE: HORLINE:
lda X1 lda X1
pha pha
lda X1+1 lda X1+1
pha pha
jsr CALC ; get data for LEFT jsr CALC ; get data for LEFT
lda BITMASKL,x ; remember left address and bitmask lda BITMASKL,x ; remember left address and bitmask
pha pha
lda ADDR lda ADDR
pha pha
lda ADDR+1 lda ADDR+1
pha pha
lda X2 lda X2
sta X1 sta X1
lda X2+1 lda X2+1
sta X1+1 sta X1+1
jsr CALC ; get data for RIGHT jsr CALC ; get data for RIGHT
lda BITMASKR,x lda BITMASKR,x
sta TEMP3 sta TEMP3
pla ; recall data for LEFT pla ; recall data for LEFT
sta X1+1 sta X1+1
pla pla
sta X1 ; put left address into X1 sta X1 ; put left address into X1
pla pla
cmp #%11111111 ; if left bit <> 0 cmp #%11111111 ; if left bit <> 0
beq @L1 beq @L1
sta TEMP2 ; do left byte only... sta TEMP2 ; do left byte only...
lda X1 lda X1
ldy X1+1 ldy X1+1
jsr VDCSetSourceAddr jsr VDCSetSourceAddr
jsr VDCReadByte jsr VDCReadByte
sta TEMP sta TEMP
eor BITMASK eor BITMASK
and TEMP2 and TEMP2
eor TEMP eor TEMP
pha pha
lda X1 lda X1
ldy X1+1 ldy X1+1
jsr VDCSetSourceAddr jsr VDCSetSourceAddr
pla pla
jsr VDCWriteByte jsr VDCWriteByte
inc X1 ; ... and proceed inc X1 ; ... and proceed
bne @L1 bne @L1
inc X1+1 inc X1+1
; do right byte (if Y2=0 ++ADDR and skip) ; do right byte (if Y2=0 ++ADDR and skip)
@L1: lda TEMP3 @L1: lda TEMP3
cmp #%11111111 ; if right bit <> 7 cmp #%11111111 ; if right bit <> 7
bne @L11 bne @L11
inc ADDR ; right bit = 7 - the next one is the last inc ADDR ; right bit = 7 - the next one is the last
bne @L10 bne @L10
inc ADDR+1 inc ADDR+1
@L10: bne @L2 @L10: bne @L2
@ -881,6 +881,7 @@ HORLINE:
@L5: jmp HORLINE @L5: jmp HORLINE
; ------------------------------------------------------------------------ ; ------------------------------------------------------------------------
; TEXTSTYLE: Set the style used when calling OUTTEXT. Text scaling in X and Y ; TEXTSTYLE: Set the style used when calling OUTTEXT. Text scaling in X and Y
; direction is passend in X/Y, the text direction is passed in A. ; direction is passend in X/Y, the text direction is passed in A.

View File

@ -56,7 +56,7 @@ VDC_DATA = 31
; capabilities of the driver ; capabilities of the driver
.byte $74, $67, $69 ; "tgi" .byte $74, $67, $69 ; "tgi"
.byte TGI_API_VERSION ; TGI version number .byte TGI_API_VERSION ; TGI API version number
xres: .word 640 ; X resolution xres: .word 640 ; X resolution
yres: .word 480 ; Y resolution yres: .word 480 ; Y resolution
.byte 2 ; Number of drawing colors .byte 2 ; Number of drawing colors
@ -123,7 +123,7 @@ BITMASK: .res 1 ; $00 = clear, $FF = set pixels
OLDCOLOR: .res 1 ; colors before entering gfx mode OLDCOLOR: .res 1 ; colors before entering gfx mode
; Line routine stuff (combined with CIRCLE to save space) ; Line routine stuff
COUNT: .res 2 COUNT: .res 2
NY: .res 2 NY: .res 2
@ -283,13 +283,13 @@ UNINSTALL:
INIT: INIT:
lda pages ; is there enough memory? lda pages ; is there enough memory?
bne @L11 ; Jump if there is one screen bne @L1 ; Jump if there is one screen
lda #TGI_ERR_INV_MODE ; Error lda #TGI_ERR_INV_MODE ; Error
bne @L9 bne @L9
; Initialize variables ; Initialize variables
@L11: ldx #$FF @L1: ldx #$FF
stx BITMASK stx BITMASK
; Remeber current color value ; Remeber current color value
@ -494,23 +494,23 @@ GETDEFPALETTE:
SETPIXEL: SETPIXEL:
jsr CALC ; Calculate coordinates jsr CALC ; Calculate coordinates
stx TEMP stx TEMP
lda ADDR lda ADDR
ldy ADDR+1 ldy ADDR+1
jsr VDCSetSourceAddr jsr VDCSetSourceAddr
jsr VDCReadByte jsr VDCReadByte
ldx TEMP ldx TEMP
sta TEMP sta TEMP
eor BITMASK eor BITMASK
and BITTAB,X and BITTAB,X
eor TEMP eor TEMP
pha pha
lda ADDR lda ADDR
ldy ADDR+1 ldy ADDR+1
jsr VDCSetSourceAddr jsr VDCSetSourceAddr
pla pla
jsr VDCWriteByte jsr VDCWriteByte
@L9: rts @L9: rts
@ -645,7 +645,7 @@ LINE:
bne @L0167 bne @L0167
rts rts
; setpixel(X1,Y1) ; setpixel(X1,Y1)
@L0167: jsr SETPIXEL @L0167: jsr SETPIXEL
; pb = err + ny ; pb = err + ny
lda ERR lda ERR
clc clc