Added size checking code contributed by Marco van den Heuvel.

git-svn-id: svn://svn.cc65.org/cc65/trunk@4566 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2010-02-01 07:15:41 +00:00
parent 80b1dddb7f
commit 3bf4afae50

View File

@@ -3,6 +3,10 @@
; (based on code by Ullrich von Bassewitz) ; (based on code by Ullrich von Bassewitz)
; Maciej 'YTM/Elysium' Witkowiak <ytm@elysium.pl> ; Maciej 'YTM/Elysium' Witkowiak <ytm@elysium.pl>
; 06,20.12.2002 ; 06,20.12.2002
;
; VDC test added by
; Marco van den Heuvel, 2010-01-22
;
.include "zeropage.inc" .include "zeropage.inc"
@@ -67,35 +71,49 @@ window: .res 256 ; memory window
; ;
INSTALL: INSTALL:
; do test for VDC presence here??? ldx #0
ldy #0
lda #VDC_CSET ; determine size of RAM...
sta VDC_ADDR_REG
ldx #VDC_CSET ; determine size of RAM... @L0: bit VDC_ADDR_REG
jsr vdcgetreg bmi @present
sta tmp1 inx
ora #%00010000 bne @L0
jsr vdcputreg ; turn on 64k iny
bne @L0
lda #<EM_ERR_NO_DEVICE
ldx #>EM_ERR_NO_DEVICE
rts
jsr settestadr1 ; save original value of test byte @present:
jsr vdcgetbyte ldx #VDC_CSET ; determine size of RAM...
sta tmp2 jsr vdcgetreg
sta tmp1
ora #%00010000
jsr vdcputreg ; turn on 64k
lda #$55 ; write $55 here jsr settestadr1 ; save original value of test byte
ldy #ptr1 jsr vdcgetbyte
jsr test64k ; read it here and there sta tmp2
lda #$aa ; write $aa here
ldy #ptr2
jsr test64k ; read it here and there
jsr settestadr1 lda #$55 ; write $55 here
lda tmp2 ldy #ptr1
jsr vdcputbyte ; restore original value of test byte jsr test64k ; read it here and there
lda #$aa ; write $aa here
ldy #ptr2
jsr test64k ; read it here and there
lda ptr1 ; do bytes match? jsr settestadr1
cmp ptr1+1 lda tmp2
bne @have64k jsr vdcputbyte ; restore original value of test byte
lda ptr2
cmp ptr2+1 lda ptr1 ; do bytes match?
bne @have64k cmp ptr1+1
bne @have64k
lda ptr2
cmp ptr2+1
bne @have64k
ldx #VDC_CSET ldx #VDC_CSET
lda tmp1 lda tmp1