1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-26 05:29:30 +00:00

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:
izydorst 2002-12-23 14:52:51 +00:00
parent 578443610d
commit 17a99e2709
2 changed files with 30 additions and 43 deletions

View File

@ -4,15 +4,12 @@
; 23.12.2002
;
; NOTES:
; On the real machine there are some additional pixels appearing (probably bad reads)
; VICE emulator does not show them. Needs further investigation.
; For any smart monkey that will try to optimize this: PLEASE do tests on real VDC,
; not only VICE.
;
; Only DONE routine contains C128-mode specific stuff, everything else will work in
; 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.
;
; 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
stx BITMASK
; Remeber current color value
ldx #VDC_COLORS
jsr VDCReadReg
sta OLDCOLOR
; Switch into graphics mode (set view page 0)
ldy #0
@ -312,11 +314,6 @@ INIT: cmp #TGI_MODE_640_200_2 ; Correct mode?
bne @L2
@L3:
; Remeber current color value
ldx #VDC_COLORS
jsr VDCReadReg
sta OLDCOLOR
; Done, reset the error code
lda #TGI_ERR_OK
@ -333,7 +330,8 @@ INIT: cmp #TGI_MODE_640_200_2 ; Correct mode?
DONE:
; 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?
bne @L01
@L0: lda SCN80CLR,y
@ -1240,18 +1238,13 @@ icmp:
; VDC helpers
VDCSetSourceAddr:
ldx #VDC_DATA_LO
stx VDC_ADDR_REG
@L0: bit VDC_ADDR_REG
bpl @L0
sta VDC_DATA_REG
dex
pha
tya
@L1: bit VDC_ADDR_REG
bpl @L1
stx VDC_ADDR_REG
sta VDC_DATA_REG
rts
ldx #VDC_DATA_HI
jsr VDCWriteReg
pla
ldx #VDC_DATA_LO
bne VDCWriteReg
VDCReadByte:
ldx #VDC_DATA

View File

@ -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)
; Maciej 'YTM/Elysium' Witkowiak <ytm@elysium.pl>
; 23.12.2002
;
; NOTES:
; On the real machine there are some additional pixels appearing (probably bad reads)
; VICE emulator does not show them. Needs further investigation.
; For any smart monkey that will try to optimize this: PLEASE do tests on real VDC,
; not only VICE.
;
; Only DONE routine contains C128-mode specific stuff, everything else will work in
; 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.
;
; 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
stx BITMASK
; Remeber current color value
ldx #VDC_COLORS
jsr VDCReadReg
sta OLDCOLOR
; Switch into graphics mode (set view page 0)
ldy #0
@ -322,11 +324,6 @@ INIT: cmp #TGI_MODE_640_480_2 ; Correct mode?
bne @L2
@L3:
; Remeber current color value
ldx #VDC_COLORS
jsr VDCReadReg
sta OLDCOLOR
; Done, reset the error code
lda #TGI_ERR_OK
@ -343,7 +340,7 @@ INIT: cmp #TGI_MODE_640_480_2 ; Correct mode?
DONE:
; This part is C128-mode specific
jsr $e179 ; reload character set
jsr $e179 ; reload character set and setup VDC
jsr $ff62
lda $d7 ; in 80-columns?
bne @L01
@ -1256,16 +1253,13 @@ icmp:
; VDC helpers
VDCSetSourceAddr:
ldx #VDC_DATA_LO
stx VDC_ADDR_REG
@L0: bit VDC_ADDR_REG
bpl @L0
sta VDC_DATA_REG
dex
pha
tya
stx VDC_ADDR_REG
sta VDC_DATA_REG
rts
ldx #VDC_DATA_HI
jsr VDCWriteReg
pla
ldx #VDC_DATA_LO
bne VDCWriteReg
VDCReadByte:
ldx #VDC_DATA