fixed addressing problems seen on the Real Machine (tm)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1831 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -4,15 +4,12 @@
|
|||||||
; 23.12.2002
|
; 23.12.2002
|
||||||
;
|
;
|
||||||
; NOTES:
|
; NOTES:
|
||||||
; On the real machine there are some additional pixels appearing (probably bad reads)
|
; For any smart monkey that will try to optimize this: PLEASE do tests on real VDC,
|
||||||
; VICE emulator does not show them. Needs further investigation.
|
; not only VICE.
|
||||||
;
|
;
|
||||||
; Only DONE routine contains C128-mode specific stuff, everything else will work in
|
; Only DONE routine contains C128-mode specific stuff, everything else will work in
|
||||||
; C64-mode of C128 (C64 needs full VDC init then).
|
; C64-mode of C128 (C64 needs full VDC init then).
|
||||||
;
|
;
|
||||||
; X-axis resolution can be changed by manipulating xres header field so
|
|
||||||
; any resolution 8..708 is possible only with gfx-mode initialization and CALC changed.
|
|
||||||
;
|
|
||||||
; With special initialization and CALC we can get 320x200 double-pixel mode.
|
; With special initialization and CALC we can get 320x200 double-pixel mode.
|
||||||
;
|
;
|
||||||
; Color translation values for BROWN and GRAY3 are obviously wrong, they could
|
; Color translation values for BROWN and GRAY3 are obviously wrong, they could
|
||||||
@@ -300,6 +297,11 @@ INIT: cmp #TGI_MODE_640_200_2 ; Correct mode?
|
|||||||
@L1: ldx #$FF
|
@L1: ldx #$FF
|
||||||
stx BITMASK
|
stx BITMASK
|
||||||
|
|
||||||
|
; Remeber current color value
|
||||||
|
ldx #VDC_COLORS
|
||||||
|
jsr VDCReadReg
|
||||||
|
sta OLDCOLOR
|
||||||
|
|
||||||
; Switch into graphics mode (set view page 0)
|
; Switch into graphics mode (set view page 0)
|
||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
@@ -312,11 +314,6 @@ INIT: cmp #TGI_MODE_640_200_2 ; Correct mode?
|
|||||||
bne @L2
|
bne @L2
|
||||||
@L3:
|
@L3:
|
||||||
|
|
||||||
; Remeber current color value
|
|
||||||
ldx #VDC_COLORS
|
|
||||||
jsr VDCReadReg
|
|
||||||
sta OLDCOLOR
|
|
||||||
|
|
||||||
; Done, reset the error code
|
; Done, reset the error code
|
||||||
|
|
||||||
lda #TGI_ERR_OK
|
lda #TGI_ERR_OK
|
||||||
@@ -333,7 +330,8 @@ INIT: cmp #TGI_MODE_640_200_2 ; Correct mode?
|
|||||||
|
|
||||||
DONE:
|
DONE:
|
||||||
; This part is C128-mode specific
|
; This part is C128-mode specific
|
||||||
jsr $ce0c ; reload character set
|
jsr $e179 ; reload character set and setup VDC
|
||||||
|
jsr $ff62
|
||||||
lda $d7 ; in 80-columns?
|
lda $d7 ; in 80-columns?
|
||||||
bne @L01
|
bne @L01
|
||||||
@L0: lda SCN80CLR,y
|
@L0: lda SCN80CLR,y
|
||||||
@@ -1240,18 +1238,13 @@ icmp:
|
|||||||
; VDC helpers
|
; VDC helpers
|
||||||
|
|
||||||
VDCSetSourceAddr:
|
VDCSetSourceAddr:
|
||||||
ldx #VDC_DATA_LO
|
pha
|
||||||
stx VDC_ADDR_REG
|
|
||||||
@L0: bit VDC_ADDR_REG
|
|
||||||
bpl @L0
|
|
||||||
sta VDC_DATA_REG
|
|
||||||
dex
|
|
||||||
tya
|
tya
|
||||||
@L1: bit VDC_ADDR_REG
|
ldx #VDC_DATA_HI
|
||||||
bpl @L1
|
jsr VDCWriteReg
|
||||||
stx VDC_ADDR_REG
|
pla
|
||||||
sta VDC_DATA_REG
|
ldx #VDC_DATA_LO
|
||||||
rts
|
bne VDCWriteReg
|
||||||
|
|
||||||
VDCReadByte:
|
VDCReadByte:
|
||||||
ldx #VDC_DATA
|
ldx #VDC_DATA
|
||||||
|
|||||||
@@ -1,19 +1,16 @@
|
|||||||
;
|
;
|
||||||
; Graphics driver for the 640x480x2 mode on the C128 VDC
|
; Graphics driver for the 640x480x2 mode on the C128 VDC 64k
|
||||||
; (values for this mode based on Fred Bowen's document)
|
; (values for this mode based on Fred Bowen's document)
|
||||||
; Maciej 'YTM/Elysium' Witkowiak <ytm@elysium.pl>
|
; Maciej 'YTM/Elysium' Witkowiak <ytm@elysium.pl>
|
||||||
; 23.12.2002
|
; 23.12.2002
|
||||||
;
|
;
|
||||||
; NOTES:
|
; NOTES:
|
||||||
; On the real machine there are some additional pixels appearing (probably bad reads)
|
; For any smart monkey that will try to optimize this: PLEASE do tests on real VDC,
|
||||||
; VICE emulator does not show them. Needs further investigation.
|
; not only VICE.
|
||||||
;
|
;
|
||||||
; Only DONE routine contains C128-mode specific stuff, everything else will work in
|
; Only DONE routine contains C128-mode specific stuff, everything else will work in
|
||||||
; C64-mode of C128 (C64 needs full VDC init then).
|
; C64-mode of C128 (C64 needs full VDC init then).
|
||||||
;
|
;
|
||||||
; X-axis resolution can be changed by manipulating xres header field so
|
|
||||||
; any resolution 8..708 is possible only with gfx-mode initialization and CALC changed.
|
|
||||||
;
|
|
||||||
; With special initialization and CALC we can get 320x200 double-pixel mode.
|
; With special initialization and CALC we can get 320x200 double-pixel mode.
|
||||||
;
|
;
|
||||||
; Color translation values for BROWN and GRAY3 are obviously wrong, they could
|
; Color translation values for BROWN and GRAY3 are obviously wrong, they could
|
||||||
@@ -310,6 +307,11 @@ INIT: cmp #TGI_MODE_640_480_2 ; Correct mode?
|
|||||||
@L11: ldx #$FF
|
@L11: ldx #$FF
|
||||||
stx BITMASK
|
stx BITMASK
|
||||||
|
|
||||||
|
; Remeber current color value
|
||||||
|
ldx #VDC_COLORS
|
||||||
|
jsr VDCReadReg
|
||||||
|
sta OLDCOLOR
|
||||||
|
|
||||||
; Switch into graphics mode (set view page 0)
|
; Switch into graphics mode (set view page 0)
|
||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
@@ -322,11 +324,6 @@ INIT: cmp #TGI_MODE_640_480_2 ; Correct mode?
|
|||||||
bne @L2
|
bne @L2
|
||||||
@L3:
|
@L3:
|
||||||
|
|
||||||
; Remeber current color value
|
|
||||||
ldx #VDC_COLORS
|
|
||||||
jsr VDCReadReg
|
|
||||||
sta OLDCOLOR
|
|
||||||
|
|
||||||
; Done, reset the error code
|
; Done, reset the error code
|
||||||
|
|
||||||
lda #TGI_ERR_OK
|
lda #TGI_ERR_OK
|
||||||
@@ -343,7 +340,7 @@ INIT: cmp #TGI_MODE_640_480_2 ; Correct mode?
|
|||||||
|
|
||||||
DONE:
|
DONE:
|
||||||
; This part is C128-mode specific
|
; This part is C128-mode specific
|
||||||
jsr $e179 ; reload character set
|
jsr $e179 ; reload character set and setup VDC
|
||||||
jsr $ff62
|
jsr $ff62
|
||||||
lda $d7 ; in 80-columns?
|
lda $d7 ; in 80-columns?
|
||||||
bne @L01
|
bne @L01
|
||||||
@@ -1256,16 +1253,13 @@ icmp:
|
|||||||
; VDC helpers
|
; VDC helpers
|
||||||
|
|
||||||
VDCSetSourceAddr:
|
VDCSetSourceAddr:
|
||||||
ldx #VDC_DATA_LO
|
pha
|
||||||
stx VDC_ADDR_REG
|
|
||||||
@L0: bit VDC_ADDR_REG
|
|
||||||
bpl @L0
|
|
||||||
sta VDC_DATA_REG
|
|
||||||
dex
|
|
||||||
tya
|
tya
|
||||||
stx VDC_ADDR_REG
|
ldx #VDC_DATA_HI
|
||||||
sta VDC_DATA_REG
|
jsr VDCWriteReg
|
||||||
rts
|
pla
|
||||||
|
ldx #VDC_DATA_LO
|
||||||
|
bne VDCWriteReg
|
||||||
|
|
||||||
VDCReadByte:
|
VDCReadByte:
|
||||||
ldx #VDC_DATA
|
ldx #VDC_DATA
|
||||||
|
|||||||
Reference in New Issue
Block a user