make auxmem run lc test if it passed in main mem

This commit is contained in:
Zellyn Hunter 2017-01-17 21:44:31 -05:00
parent 03edca5c47
commit afda89a50d
6 changed files with 126 additions and 320 deletions

View File

@ -10,24 +10,42 @@
CSW = $36
KSW = $38
LCRESULT = $10
LCRESULT2 = $11
AUXRESULT = $12
;; AUXMOVE locations
;; $3C
;; $3D
;; $3E
;; $3F
;; $42
;; $43
;; SHASUM locations
!addr SRC = $06
!addr DST = $08
!addr SHAINPUT = $eb
!addr SHALENGTH = $ee
;; Softswitch locations.
_80STORE_ONW = $C000
_80STORE_OFFW = $C001
_80STORE_OFF_W = $C000
_80STORE_ON_W = $C001
_80STORE_READ = $C018
RAMRD_ONW = $C002
RAMRD_OFFW = $C003
RAMRD_OFF_W = $C002
RAMRD_ON_W = $C003
RAMRD_READ = $C013
RAMWRT_ONW = $C004
RAMWRT_OFFW = $C005
RAMWRT_OFF_W = $C004
RAMWRT_ON_W = $C005
RAMWRT_READ = $C014
INTCXROM_ONW = $C006
INTCXROM_OFFW = $C007
INTCXROM_OFF_W = $C006
INTCXROM_ON_W = $C007
INTCXROM_READ = $C015
ALTZP_ONW = $C008
ALTZP_OFFW = $C009
ALTZP_OFF_W = $C008
ALTZP_ON_W = $C009
ALTZP_READ = $C016
SLOTC3ROM_ONW = $C00A
SLOTC3ROM_OFFW = $C00B
SLOTC3ROM_OFF_W = $C00A
SLOTC3ROM_ON_W = $C00B
SLOTC3ROM_READ = $C017
SLOTRESET = $CFFF
@ -72,11 +90,15 @@ main:
;; ROM SHA-1 checks.
;; jsr SHASUMTESTS - do this later, because it's SLOW!
end: jmp *
end:
+print
!text "END"
+printed
jmp *
!src "langcard.asm"
!src "auxmem.asm"
!src "shasumtests.asm"
;!src "shasumtests.asm"
!src "resetall.asm"
print
@ -142,7 +164,7 @@ getche lda $FEED ; FEED gets modified
jsr COUT
rts
!src "technote2.asm"
!src "../shasum/shasum.asm"
;!src "../shasum/shasum.asm"
;;; If we loaded via standard delivery, turn the motor off and fix up
;;; CSW and KSW (in case the user typed PR#6 or IN#6 to boot).
@ -175,16 +197,16 @@ standard_fixup:
COPYTOAUX
;; Use AUXMOVE routine to copy the whole program to AUX memory.
sta SLOTC3ROM_OFFW
sta SLOTC3ROM_OFF_W
lda #<START
sta $3C
sta $42
lda #>START
sta $3D
sta $43
lda #<(STRINGS-1)
lda #<(LASTSTRING-1)
sta $3E
lda #>(STRINGS-1)
lda #>(LASTSTRING-1)
sta $3F
sec ; Move from main to aux memory.
jsr AUXMOVE

Binary file not shown.

View File

@ -3,301 +3,89 @@
!zone auxmem {
AUXMEMTESTS
lda #0
sta AUXRESULT
lda MEMORY
cmp #65
bcs +
+print
!text "64K OR LESS:SKIPPING AUXMEM TEST",$8D
+printed
rts
;; Setup - store differing values in bank first and second banked areas.
+ lda $C08B ; Read and write bank 1
lda $C08B
lda #$11
sta $D17B ; $D17B is $53 in Apple II/plus/e/enhanced
cmp $D17B
beq +
+prerr $0000 ;; E0000: We tried to put the language card into read bank 1, write bank 1, but failed to write.
!text "CANNOT WRITE TO LC BANK 1 RAM"
+prerred
rts
lda #$33
+ sta $FE1F ; FE1F is $60 in Apple II/plus/e/enhanced
cmp $FE1F
beq .dotest
+prerr $0000 ;; E0000: We tried to put the language card into read RAM, write RAM, but failed to write.
!text "CANNOT WRITE TO LC RAM"
+prerred
rts
+ lda $C083 ; Read and write bank 2
lda $C083
lda #$22
sta $D17B
cmp $D17B
beq +
+prerr $0000 ;; E0000: We tried to put the language card into read bank 2, write bank 2, but failed to write.
!text "CANNOT WRITE TO LC BANK 2 RAM"
+prerred
sec
rts
;; Parameterized tests
+ +print
!text "TESTING AUX MEM",$8D
+printed
.dotest lda #<.tests
sta 0
lda #>.tests
sta 1
.outer
;; Initialize to known state:
;; - $11 in $D17B bank 1 (ROM: $53)
;; - $22 in $D17B bank 2 (ROM: $53)
;; - $33 in $FE1F (ROM: $60)
lda LCRESULT
bne .auxlc
+print
!text "LC FAILED BEFORE:SKIPPING AUXMEM LC",$8D
+printed
beq .skiplc
.auxlc ;; Run langcard tests in auxmem
lda LCRESULT
sta LCRESULT2
lda #0
sta LCRESULT
;; Store distinct values in RAM areas, to see if they stay safe.
lda $C08B ; Read and write bank 1
lda $C08B
lda #$11
sta $D17B
lda #$33
sta $FE1F
lda #$44
sta $D17B ; $D17B is $53 in Apple II/plus/e/enhanced
lda #$55
sta $FE1F ; FE1F is $60 in Apple II/plus/e/enhanced
lda $C083 ; Read and write bank 2
lda $C083
lda #$22
lda #$66
sta $D17B
lda $C080
ldy #0
jsr .zptoaux
sta ALTZP_ON_W
jsr LANGCARDTESTS_NO_CHECK
sta ALTZP_OFF_W
.inner
lda ($0),y
cmp #$ff
beq .test
tax
bmi +
ora #$80
sta .lda+1
.lda lda $C000
jmp ++
+ sta .sta+1
.sta sta $C000
++ iny
bne .inner
.test ;; ... test the triple
inc $D17B
inc $FE1F
iny
;; y now points to d17b-current,fe1f-current,bank1,bank2,fe1f-ram test quintiple
;; Test current $D17B
lda (0),y
cmp $D17B
beq +
lda $D17B
pha
jsr .printseq
+print
!text "$D17B TO CONTAIN $"
+printed
lda (0),y
jsr PRBYTE
+print
!text ", GOT $"
+printed
pla
jsr PRBYTE
lda #$8D
jsr COUT
jmp .datatesturl
+ iny
;; Test current $FE1F
lda (0),y
cmp $FE1F
beq +
lda $FE1F
pha
jsr .printseq
+print
!text "$FE1F=$"
+printed
lda (0),y
jsr PRBYTE
+print
!text ", GOT $"
+printed
pla
jsr PRBYTE
lda #$8D
jsr COUT
jmp .datatesturl
+ iny
;; Test bank 1 $D17B
lda $C088
lda (0),y
cmp $D17B
beq +
lda $D17B
pha
jsr .printseq
+print
!text "$D17B IN RAM BANK 1 TO CONTAIN $"
+printed
lda (0),y
jsr PRBYTE
+print
!text ", GOT $"
+printed
pla
jsr PRBYTE
lda #$8D
jsr COUT
jmp .datatesturl
+ iny
;; Test bank 2 $D17B
lda $C080
lda (0),y
cmp $D17B
beq +
lda $D17B
pha
jsr .printseq
+print
!text "$D17B IN RAM BANK 2 TO CONTAIN $"
+printed
lda (0),y
jsr PRBYTE
+print
!text ", GOT $"
+printed
pla
jsr PRBYTE
lda #$8D
jsr COUT
jmp .datatesturl
+ iny
;; Test RAM $FE1F
lda $C080
lda (0),y
cmp $FE1F
beq +
lda $FE1F
pha
jsr .printseq
+print
!text "RAM $FE1F=$"
+printed
lda (0),y
jsr PRBYTE
+print
!text ", GOT $"
+printed
pla
jsr PRBYTE
lda #$8D
jsr COUT
jmp .datatesturl
+ iny
lda ($0),y ; Done with the parameterized tests?
cmp #$ff
bne +
jmp .over
+ clc
tya
adc $0
sta $0
bcc +
inc $1
+ jmp .outer
.datatesturl
+prerr $0000 ;; E0000: This is a data-driven test of Language Card operation. We initialize $D17B in RAM bank 1 to $11, $D17B in RAM bank 2 to $22, and $FE1F in RAM to $33. Then, we perform a testdata-driven sequence of LDA and STA to the $C08X range. Finally we (try to) increment $D17B and $FE1F. Then we test (a) the current live value in $D17B, (b) the current live value in $FE1F, (c) the RAM bank 1 value of $D17B, (d) the RAM bank 2 value of $D17B, and (e) the RAM value of $FE1F, to see whether they match expected values. $D17B is usually $53 in ROM, and $FE1F is usally $60. For more information on the operation of the language card soft-switches, see Understanding the Apple IIe, by James Fielding Sather, Pg 5-24.
!text "DATA-DRIVEN TEST FAILED"
+prerred
rts
.printseq
tya
pha
+print
!text "AFTER SEQUENCE OF:",$8D,"LDA $C080",$8D
+printed
ldy #$0
- lda ($0),y
cmp #$ff
beq +++
tax
bmi +
lda #'L'
jsr COUT
lda #'D'
bne ++
+ lda #'S'
jsr COUT
lda #'T'
++ jsr COUT
+print
!text "A $C0"
+printed
txa
ora #$80
jsr PRBYTE
lda #$8D
jsr COUT
iny
bne -
+++
+print
!text "INC $D17B",$8D,"INC $FE1F",$8D,"EXPECTED "
+printed
pla
tay
rts
.tests
;; Format:
;; - $ff-terminated list of C0XX addresses (0-F to read C08X, 80-8F to write C0XX).
;; - quint: expected current $d17b and fe1f, then d17b in bank1, d17b in bank 2, and fe1f
;; (All sequences start with lda $C080, just to reset things to a known state.)
!byte $08, $ff ; Read $C088 (RAM read, write protected)
!byte $11, $33, $11, $22, $33 ;
!byte $00, $ff ; Read $C080 (read bank 2, write disabled)
!byte $22, $33, $11, $22, $33 ;
!byte $01, $ff ; Read $C081 (ROM read, write disabled)
!byte $53, $60, $11, $22, $33 ;
!byte $01, $09, $ff ; Read $C081, $C089 (ROM read, bank 1 write)
!byte $53, $60, $54, $22, $61 ;
!byte $01, $01, $ff ; Read $C081, $C081 (read ROM, write RAM bank 2)
!byte $53, $60, $11, $54, $61 ;
!byte $0b, $ff ; Read $C08B (read RAM bank 1, no write)
!byte $11, $33, $11, $22, $33 ;
!byte $03, $ff ; Read $C083 (read RAM bank 2, no write)
!byte $22, $33, $11, $22, $33 ;
!byte $0b, $0b, $ff ; Read $C08B, $C08B (read/write RAM bank 1)
!byte $12, $34, $12, $22, $34 ;
!byte $0f, $07, $ff ; Read $C08F, $C087 (read/write RAM bank 2)
!byte $23, $34, $11, $23, $34 ;
!byte $07, $0D, $ff ; Read $C087, read $C08D (read ROM, write bank 1)
!byte $53, $60, $54, $22, $61 ;
!byte $0b, $8b, $0b, $ff ; Read $C08B, write $C08B, read $C08B (read RAM bank 1, no write)
!byte $11, $33, $11, $22, $33 ; (this one is tricky: reset WRTCOUNT by writing halfway)
!byte $ff
nop ; Provide clean break after data when viewing disassembly
nop
nop
.over
jsr .zpfromaux
.skiplc
;; Success
+print
!text "LANGUAGE CARD TESTS SUCCEEDED",$8D
!text "AUXMEM TESTS SUCCEEDED",$8D
+printed
lda #1
sta AUXRESULT
clc
.done
rts
;;; Copy zero page to aux mem. Assumes zp pointing at main mem, and leaves it that way.
.zptoaux
ldx #0
- sta ALTZP_OFF_W
lda 0,x
sta ALTZP_ON_W
sta 0,x
inx
bne -
sta ALTZP_OFF_W
rts
;;; Copy zero page from aux mem. Assumes zp pointing at main mem, and leaves it that way.
.zpfromaux
ldx #0
- sta ALTZP_ON_W
lda 0,x
sta ALTZP_OFF_W
sta 0,x
inx
bne -
rts
} ;auxmem

View File

@ -3,15 +3,22 @@
!zone langcard {
LANGCARDTESTS
lda #0
sta LCRESULT
lda MEMORY
cmp #49
bcs +
bcs LANGCARDTESTS_NO_CHECK
+print
!text "48K:SKIPPING LANGUAGE CARD TEST",$8D
+printed
sec
rts
LANGCARDTESTS_NO_CHECK:
+print
!text "TESTING LANGUAGE CARD",$8D
+printed
;; Setup - store differing values in bank first and second banked areas.
+ lda $C08B ; Read and write bank 1
lda $C08B ; Read and write bank 1
lda $C08B
lda #$11
sta $D17B ; $D17B is $53 in Apple II/plus/e/enhanced
@ -20,6 +27,7 @@ LANGCARDTESTS
+prerr $0004 ;; E0004: We tried to put the language card into read bank 1, write bank 1, but failed to write.
!text "CANNOT WRITE TO LC BANK 1 RAM"
+prerred
sec
rts
lda #$33
+ sta $FE1F ; FE1F is $60 in Apple II/plus/e/enhanced
@ -28,6 +36,7 @@ LANGCARDTESTS
+prerr $0005 ;; E0005: We tried to put the language card into read RAM, write RAM, but failed to write.
!text "CANNOT WRITE TO LC RAM"
+prerred
sec
rts
+ lda $C083 ; Read and write bank 2
lda $C083
@ -38,6 +47,7 @@ LANGCARDTESTS
+prerr $0006 ;; E0006: We tried to put the language card into read bank 2, write bank 2, but failed to write.
!text "CANNOT WRITE TO LC BANK 2 RAM"
+prerred
sec
rts
;; Parameterized tests
@ -220,6 +230,7 @@ LANGCARDTESTS
+prerr $0007 ;; E0007: This is a data-driven test of Language Card operation. We initialize $D17B in RAM bank 1 to $11, $D17B in RAM bank 2 to $22, and $FE1F in RAM to $33. Then, we perform a testdata-driven sequence of LDA and STA to the $C08X range. Finally we (try to) increment $D17B and $FE1F. Then we test (a) the current live value in $D17B, (b) the current live value in $FE1F, (c) the RAM bank 1 value of $D17B, (d) the RAM bank 2 value of $D17B, and (e) the RAM value of $FE1F, to see whether they match expected values. $D17B is usually $53 in ROM, and $FE1F is usally $60. For more information on the operation of the language card soft-switches, see Understanding the Apple IIe, by James Fielding Sather, Pg 5-24.
!text "DATA-DRIVEN TEST FAILED"
+prerred
sec
rts
.printseq
@ -291,13 +302,14 @@ LANGCARDTESTS
nop ; Provide clean break after data when viewing disassembly
nop
nop
.over
;; Success
+print
!text "LANGUAGE CARD TESTS SUCCEEDED",$8D
+printed
.done
lda #1
sta LCRESULT
clc
rts
} ;langcard
} ;langcard

View File

@ -11,12 +11,12 @@ RESETALL
tay
pla
sta _80STORE_OFFW
sta RAMRD_OFFW
sta RAMWRT_OFFW
sta INTCXROM_OFFW
sta ALTZP_OFFW
sta SLOTC3ROM_OFFW
sta _80STORE_OFF_W
sta RAMRD_OFF_W
sta RAMWRT_OFF_W
sta INTCXROM_OFF_W
sta ALTZP_OFF_W
sta SLOTC3ROM_OFF_W
sta SLOTRESET
;; Restore return address from Y and A.

View File

@ -1,21 +1,5 @@
# V0 Errors
## E0000
This is a data-driven test of Language Card operation. We initialize $D17B in RAM bank 1 to $11, $D17B in RAM bank 2 to $22, and $FE1F in RAM to $33. Then, we perform a testdata-driven sequence of LDA and STA to the $C08X range. Finally we (try to) increment $D17B and $FE1F. Then we test (a) the current live value in $D17B, (b) the current live value in $FE1F, (c) the RAM bank 1 value of $D17B, (d) the RAM bank 2 value of $D17B, and (e) the RAM value of $FE1F, to see whether they match expected values. $D17B is usually $53 in ROM, and $FE1F is usally $60. For more information on the operation of the language card soft-switches, see Understanding the Apple IIe, by James Fielding Sather, Pg 5-24.
## E0000
We tried to put the language card into read RAM, write RAM, but failed to write.
## E0000
We tried to put the language card into read bank 1, write bank 1, but failed to write.
## E0000
We tried to put the language card into read bank 2, write bank 2, but failed to write.
## E0001
The machine identification routines from http://www.1000bit.it/support/manuali/apple/technotes/misc/tn.misc.02.html failed to identify the model.