diff --git a/asminc/c128.inc b/asminc/c128.inc index e6c89b07b..e17bae4ce 100644 --- a/asminc/c128.inc +++ b/asminc/c128.inc @@ -163,8 +163,13 @@ SID_Read3 := $D41C ; --------------------------------------------------------------------------- ; I/O: VDC (128 only) -VDC_INDEX := $D600 -VDC_DATA := $D601 +VDC_INDEX := $D600 ; VDC address +VDC_DATA := $D601 ; VDC data + +VDC_DATA_HI := 18 +VDC_DATA_LO := 19 +VDC_CSET := 28 +VDC_DATA_RW := 31 ; --------------------------------------------------------------------------- ; I/O: CIAs diff --git a/libsrc/atari/cpeekchar.s b/libsrc/atari/cpeekchar.s index b551ed0df..6697ce230 100644 --- a/libsrc/atari/cpeekchar.s +++ b/libsrc/atari/cpeekchar.s @@ -6,7 +6,7 @@ .import mul40 .importzp ptr4 - .include "atari/atari.inc" + .include "atari.inc" .segment "CODE" diff --git a/libsrc/c128/cpeekchar.s b/libsrc/c128/cpeekchar.s index e6e7e4a12..cf82dd529 100644 --- a/libsrc/c128/cpeekchar.s +++ b/libsrc/c128/cpeekchar.s @@ -8,7 +8,7 @@ .include "zeropage.inc" - .include "c128/c128.inc" + .include "c128.inc" .segment "CODE" @@ -57,18 +57,18 @@ _cpeekchar: @s: ; get byte from vdc mem ldx #VDC_DATA_LO - stx VDC_ADDR_REG -@L0: bit VDC_ADDR_REG + stx VDC_INDEX +@L0: bit VDC_INDEX bpl @L0 - sta VDC_DATA_REG + sta VDC_DATA dex tya - stx VDC_ADDR_REG - sta VDC_DATA_REG + stx VDC_INDEX + sta VDC_DATA ldx #VDC_DATA_RW - stx VDC_ADDR_REG -@L1: bit VDC_ADDR_REG + stx VDC_INDEX +@L1: bit VDC_INDEX bpl @L1 - lda VDC_DATA_REG + lda VDC_DATA jmp @return diff --git a/libsrc/c128/cpeekcol.s b/libsrc/c128/cpeekcol.s index 95f31c7cb..d96563574 100644 --- a/libsrc/c128/cpeekcol.s +++ b/libsrc/c128/cpeekcol.s @@ -4,7 +4,7 @@ .import _gotoxy - .include "c128/c128.inc" + .include "c128.inc" .segment "CODE" @@ -33,20 +33,20 @@ _cpeekcol: @s: ; get byte from vdc mem ldx #VDC_DATA_LO - stx VDC_ADDR_REG -@L0: bit VDC_ADDR_REG + stx VDC_INDEX +@L0: bit VDC_INDEX bpl @L0 - sta VDC_DATA_REG + sta VDC_DATA dex ;;tya - stx VDC_ADDR_REG - sty VDC_DATA_REG + stx VDC_INDEX + sty VDC_DATA ldx #VDC_DATA_RW - stx VDC_ADDR_REG -@L1: bit VDC_ADDR_REG + stx VDC_INDEX +@L1: bit VDC_INDEX bpl @L1 - lda VDC_DATA_REG + lda VDC_DATA and #$0f diff --git a/libsrc/cbm/cpeekchar.s b/libsrc/cbm/cpeekchar.s deleted file mode 100644 index e8ebcdbc3..000000000 --- a/libsrc/cbm/cpeekchar.s +++ /dev/null @@ -1,39 +0,0 @@ - - .export _cpeekchar - .export _cpeekcharxy - - .import _gotoxy - - .include "cbm/cbm.inc" - - .segment "CODE" - -_cpeekcharxy: - - jsr _gotoxy ; Set cursor - -_cpeekchar: - - ldy CURS_X - lda (SCREEN_PTR),y ; get char - ldx #0 - - and #$7f - - ; 0 - $1f +$40 - ; $20 - $3f - ; $40 - $7e +$80 - - cmp #$1f - bcs @sk1 -;; clc - adc #$40 - rts - -@sk1: - cmp #$40 - bcc @end - clc - adc #$80 -@end: - rts diff --git a/libsrc/cbm/cpeekcol.s b/libsrc/cbm/cpeekcol.s deleted file mode 100644 index 0e88daf04..000000000 --- a/libsrc/cbm/cpeekcol.s +++ /dev/null @@ -1,21 +0,0 @@ - - .export _cpeekcol - .export _cpeekcolxy - - .import _gotoxy - - .include "cc65/conio.inc" - - .segment "CODE" - -_cpeekcolxy: - - jsr _gotoxy ; Set cursor - -_cpeekcol: - - ldy CURS_X - lda (CRAM_PTR),y ; get color - and #$0f - ldx #0 - rts diff --git a/libsrc/cbm510/cpeekchar.s b/libsrc/cbm510/cpeekchar.s index dc5963d2b..11787fe1e 100644 --- a/libsrc/cbm510/cpeekchar.s +++ b/libsrc/cbm510/cpeekchar.s @@ -3,8 +3,9 @@ .export _cpeekcharxy .import _gotoxy - - .include "cbm510/cbm510.inc" + + .include "cbm510.inc" + .include "extzp.inc" .segment "CODE" diff --git a/libsrc/cbm510/cpeekcol.s b/libsrc/cbm510/cpeekcol.s index 332d0aaf8..bbe7c5632 100644 --- a/libsrc/cbm510/cpeekcol.s +++ b/libsrc/cbm510/cpeekcol.s @@ -4,7 +4,8 @@ .import _gotoxy - .include "cbm510/cbm510.inc" + .include "cbm510.inc" + .include "extzp.inc" .segment "CODE" diff --git a/libsrc/cbm610/cpeekchar.s b/libsrc/cbm610/cpeekchar.s index 8cf4bd57d..217532ab5 100644 --- a/libsrc/cbm610/cpeekchar.s +++ b/libsrc/cbm610/cpeekchar.s @@ -4,7 +4,8 @@ .import _gotoxy - .include "cbm610/cbm610.inc" + .include "cbm610.inc" + .include "extzp.inc" .segment "CODE"