Skip RAMRD softswitch on <128K, broken emu check

This commit is contained in:
Zellyn Hunter 2017-02-03 23:10:22 -05:00
parent d96d081c9a
commit 215f4cb391
4 changed files with 74 additions and 3 deletions

Binary file not shown.

View File

@ -5,7 +5,59 @@
jsr IDENTIFY
lda $C082 ; Put ROM back in place.
+print
;; Fix up possibly broken MEMORY count on IIe machines.
;; See UtAIIe: 5-38
lda MACHINE
cmp #IIe
bne +++
jsr RESETALL
sta SET_80STORE
lda SET_HIRES
lda SET_PAGE2
lda #$00
sta $400
lda #$88
sta $2000
cmp $400
beq .has65k
cmp $2000
bne .has64k
cmp $2000
bne .has64k
;; Okay, it looks like we have 128K. But what if our emulator
;; is just broken, and we're reading and writing the same bank of
;; RAM for both main and aux mem? Let's check for that explicitly.
jsr RESETALL
lda #$88
sta $400
lda #$89
sta SET_RAMWRT
sta $400
lda #$88
sta RESET_RAMWRT
cmp $400
bne +
cmp $400
beq ++
+ +prerr $000C ;; E000C: $400 main memory and $300 aux memory seem to write to the same place, which is probably an emulator bug.
!text "MAIN AND AUX ARE SAME RAM"
+prerred
jmp end
.has64k
lda #64
!byte $2C
.has65k lda #65
sta MEMORY
++ jsr RESETALL
lda #'A'
sta $400
+++ +print
!text "MEMORY:"
+printed
lda MEMORY

View File

@ -35,6 +35,21 @@ SOFTSWITCHTESTS
lda #(.readswitches-.writeswitches)/6
sta .loopcount
;; Check memory: <= 65K: don't test RAMRD
lda MEMORY
cmp #66
bcs .wrtloop ; Enough memory: continue
;; Not enough: skip one loop iteration, and increment SRC past RAMRD addresses
dec .loopcount
clc
lda SRC
adc #6
sta SRC
lda SRC+1
adc #0
sta SRC+1
.wrtloop
;; Copy reset/set/read locations to .resetloc, .setloc, .readloc
ldy #0
@ -242,11 +257,11 @@ SOFTSWITCHTESTS
rts
.writeswitches
!word RESET_80STORE, SET_80STORE, READ_80STORE
!word RESET_RAMRD, SET_RAMRD, READ_RAMRD
!word RESET_RAMWRT, SET_RAMWRT, READ_RAMWRT
!word RESET_INTCXROM, SET_INTCXROM, READ_INTCXROM
!word RESET_80STORE, SET_80STORE, READ_80STORE
!word RESET_ALTZP, SET_ALTZP, READ_ALTZP
!word RESET_INTCXROM, SET_INTCXROM, READ_INTCXROM
!word RESET_SLOTC3ROM, SET_SLOTC3ROM, READ_SLOTC3ROM
!word RESET_80COL, SET_80COL, READ_80COL
!word RESET_ALTCHRSET, SET_ALTCHRSET, READ_ALTCHRSET

View File

@ -43,3 +43,7 @@ This is a data-driven test of main and auxiliary memory softswitch operation. We
## E000B
This is a the Cxxx-ROM check part of the auxiliary memory data-driven test (see E000A for a description of the other part). After a full reset, we perform a testdata-driven sequence of instructions. Finally we check which parts of Cxxx ROM seem to be visible. We check C100-C2FF, C300-C3FF, C400-C7FF (which should be the same as C100-C2FF), and C800-CFFE. For more details, see Understanding the Apple IIe, by James Fielding Sather, Pg 5-28.
## E000C
$400 main memory and $300 aux memory seem to write to the same place, which is probably an emulator bug.