langcard: fixed current tests

This commit is contained in:
Zellyn Hunter 2016-12-17 20:49:28 -05:00
parent 083d72d19b
commit 5598661ff6
5 changed files with 94 additions and 34 deletions

Binary file not shown.

View File

@ -2,6 +2,7 @@
;;; Copyright © 2016 Zellyn Hunter <zellyn@gmail.com>
!zone langcard {
lda MEMORY
cmp #49
bcs +
@ -10,10 +11,10 @@
+printed
beq .done2
;; Setup - store differing values in bank first and second banked areas.
+ lda $C08B ; Read and write First 4K bank
+ lda $C08B ; Read and write bank 1
lda $C08B
lda #$55
sta $D17B ; D17B is $53 in Apple II/plus/e/enhanced
sta $D17B ; $D17B is $53 in Apple II/plus/e/enhanced
cmp $D17B
beq +
+prerr $0003 ;; E0003: We tried to put the language card into read bank 1, write bank 1, but failed to write.
@ -27,7 +28,7 @@
!text "CANNOT WRITE TO LC RAM"
+prerred
beq .done2
+ lda $C083 ; Read and write Second 4K bank
+ lda $C083 ; Read and write bank 2
lda $C083
lda #$AA
sta $D17B
@ -40,7 +41,7 @@
;; Test that we're reading the right things
+ lda $C088 ; RAM read, bank 1
+ lda $C088 ; RAM read, bank 1, write disabled
lda $D17B
cmp #$55
beq ++
@ -49,26 +50,26 @@
+prerr $0006 ;; E0006: Read $C088 (read bank 1), but the language card is still reading bank 2.
!text "$C088: BANK 2 ACTIVE"
+prerred
.done2 beq .done3
beq .done2
+ cmp #$53
bne +
+prerr $0007 ;; E0007: Read $C088 (read bank 1), but the language card is reading ROM.
!text "$C088: ROM ACTIVE"
+prerred
beq .done3
beq .done2
+ +prerra $0008 ;; E0008: Read $C088 (read bank 1), but the check byte ($D17B) is an unknown value.
!text "$C088: UNKNOWN BYTE"
+prerred
beq .done3
++ dec $D17B
beq .done2
++ inc $D17B
eor $D17B
beq +
+prerr $0009 ;; E0009: Read $C088 (read bank 1, write-protected), but successfully wrote byte ($D17B).
!text "$C088: ALLOWED WRITE"
+prerred
beq .done3
.done2 beq .done3
+ lda $C080 ; RAM read, bank 2
+ lda $C080 ; RAM read, bank 2, write disabled
lda $D17B
cmp #$AA
beq ++
@ -87,16 +88,16 @@
+ +prerra $000C ;; E000C: Read $C080 (read bank 2), but the check byte ($D17B) is an unknown value.
!text "$C080: UNKNOWN BYTE"
+prerred
.done3 beq .done4
++ dec $D17B
beq .done3
++ inc $D17B
eor $D17B
beq +
+prerr $000D ;; E000D: Read $C080 (read bank 2, write-protected), but successfully wrote byte ($D17B).
!text "$C080: ALLOWED WRITE"
+prerred
beq .done4
beq .done3
+ lda $C081 ; ROM read
+ lda $C081 ; ROM read, bank 2 no write
lda $D17B
cmp #$53
beq ++
@ -105,26 +106,26 @@
+prerr $000E ;; E000E: Read $C081 (read ROM), but the language card is still reading bank 1.
!text "$C081: BANK 1 ACTIVE"
+prerred
beq .done4
beq .done3
+ cmp #$AA
bne +
+prerr $000F ;; E000F: Read $C081 (read ROM), but the language card is reading bank 2.
!text "$C081: BANK 1 ACTIVE"
+prerred
beq .done
beq .done3
+ +prerra $0010 ;; E0010: Read $C081 (read ROM), but the check byte ($D17B) is an unknown value.
!text "$C081: UNKNOWN BYTE"
+prerred
beq .done
beq .done3
++ dec $D17B
eor $D17B
beq +
+prerr $0011 ;; E0011: Read $C081 (read ROM), but successfully modified byte ($D17B).
!text "$C081: ALLOWED WRITE"
+prerred
beq .done
.done3 beq .done4
+ lda $C089 ; ROM read
+ lda $C089 ; ROM read, bank 1 write
lda $D17B
cmp #$53
beq ++
@ -133,53 +134,81 @@
+prerr $0012 ;; E0012: Read $C089 (read ROM), but the language card is still reading bank 1.
!text "$C089: BANK 1 ACTIVE"
+prerred
beq .done
beq .done4
+ cmp #$AA
bne +
+prerr $0013 ;; E0013: Read $C089 (read ROM), but the language card is reading bank 2.
!text "$C089: BANK 1 ACTIVE"
+prerred
beq .done
beq .done4
+ +prerra $0014 ;; E0014: Read $C089 (read ROM), but the check byte ($D17B) is an unknown value.
!text "$C089: UNKNOWN BYTE"
+prerred
beq .done
++ dec $D17B
beq .done4
++ inc $D17B ; bank 1 now holds $54 instead of $55
eor $D17B
beq +
+prerr $0015 ;; E0015: Read $C089 (read ROM), but successfully modified byte ($D17B).
!text "$C089: ALLOWED WRITE"
+prerred
.done4 beq .done
beq .done4
+ lda $C08B ; RAM read, bank 1
lda $D17B
cmp #$55
cmp #$54
beq ++
cmp #$AA
bne +
+prerr $0016 ;; E0016: Read $C08B (read bank 1), but the language card is still reading bank 2.
!text "$C08B: BANK 2 ACTIVE"
+prerred
beq .done
beq .done4
+ cmp #$53
bne +
+prerr $0017 ;; E0017: Read $C08B (read bank 1), but the language card is reading ROM.
!text "$C08B: ROM ACTIVE"
+prerred
beq .done
+ cmp #$54
beq .done4
+ cmp #$55
bne +
+prerr $0018 ;; E0018: Read $C08B (read bank 1), but byte was previously decremented during single-read $C089 or $C081 phase, which should have Write-protected RAM.
!text "$C08B: PREVIOUS WRITE SUCCEEDED"
+prerr $0018 ;; E0018: Read $C08B (read bank 1); byte should have been previously incremented from ROM ($53) to $54 because of lda $C089 after previous lda $C081.
!text "$C08B: PREVIOUS WRITE FAILED"
+prerred
beq .done
beq .done4
+ +prerra $0019 ;; E0019: Read $C08B (read bank 1), but the check byte ($D17B) is an unknown value.
!text "$C08B: UNKNOWN BYTE"
+prerred
beq .done
.done4 beq .done5
++
+ lda $C083 ; RAM read, bank 2
lda $D17B
cmp #$AA
beq ++
cmp #$54
bne +
+prerr $001A ;; E001A: Read $C083 (read bank 2), but the language card is still reading bank 1.
!text "$C083: BANK 1 ACTIVE"
+prerred
beq .done5
+ cmp #$53
bne +
+prerr $001B ;; E001B: Read $C083 (read bank 2), but the language card is reading ROM.
!text "$C083: ROM ACTIVE"
+prerred
beq .done5
+ cmp #$52
bne +
+prerr $001C ;; E001C: Read $C083 (read bank 2); byte should have been previously NOT been writable to be decremented from ROM ($53) to $52 because of single lda $C081 after previous lda $C080.
!text "$C083: PREVIOUS WRITE SUCCEEDED"
+prerred
beq .done5
+ +prerra $001D ;; E001D: Read $C083 (read bank 2), but the check byte ($D17B) is an unknown value.
!text "$C083: UNKNOWN BYTE"
+prerred
.done5 jmp .done
++
;; Success
+print
!text "LANGUAGE CARD TESTS SUCCEEDED",$8D

View File

@ -15,6 +15,8 @@
}
!macro prerr NUM {
ldy #>NUM
ldx #<NUM
jsr LASTSTRING
!set TEMP = *
* = LASTSTRING

View File

@ -23,3 +23,16 @@ D768 85
D76E 65
* Links to things to test
** TODO [[https://groups.google.com/d/msg/comp.sys.apple2/RMnus8p6xp8/TDfD2HVtDwAJ][csa2: question on HGR behavior with enhanced 128K Apple //e]]
* Language card operation
| Bank 2 | Bank 1 | | Action | RAM | Alt Bank 2 | Alt Bank 1 |
|--------+--------+-----+------------+--------------+------------+------------|
| C080 | C088 | R/W | WRTCOUNT=0 | READ ENABLE | C084 | C08C |
| C081 | C089 | R | WRTCOUNT++ | READ DISABLE | C085 | C08D |
| | | W | WRTCOUNT=0 | READ DISABLE | | |
| C082 | C08A | R/W | WRTCOUNT=0 | READ DISABLE | C086 | C08E |
| C083 | C08B | R | WRTCOUNT++ | READ ENABLE | C087 | C08F |
| | | W | WRTCOUNT=0 | READ ENABLE | | |
Writing to high RAM is enabled when WRTCOUNT >= 2
Source: UtA2e, pg 5-24.

View File

@ -94,8 +94,24 @@ Read $C08B (read bank 1), but the language card is reading ROM.
## E0018
Read $C08B (read bank 1), but byte was previously decremented during single-read $C089 or $C081 phase, which should have Write-protected RAM.
Read $C08B (read bank 1); byte should have been previously incremented from ROM ($53) to $54 because of lda $C089 after previous lda $C081.
## E0019
Read $C08B (read bank 1), but the check byte ($D17B) is an unknown value.
## E001A
Read $C083 (read bank 2), but the language card is still reading bank 1.
## E001B
Read $C083 (read bank 2), but the language card is reading ROM.
## E001C
Read $C083 (read bank 2); byte should have been previously NOT been writable to be decremented from ROM ($53) to $52 because of single lda $C081 after previous lda $C080.
## E001D
Read $C083 (read bank 2), but the check byte ($D17B) is an unknown value.