Avoid unwanted i/o access.

Depending on the 6502, LDA addr,X and/or STA addr,X produce additional phantom reads. In order to avoid those phantom reads to do i/o access, I used the "classic" approach of moving those reads from page $C0 to page $BF.
This commit is contained in:
Oliver Schmidt 2022-08-08 15:09:42 +02:00
parent 472454c19d
commit ae5cb754fb
2 changed files with 23 additions and 12 deletions

View File

@ -17,10 +17,15 @@ XLEN = $BE52 ;length of command string-1.
XCNUM = $BE53 ;CI cmd no. (ext cmd - 0).
PBITS = $BE54 ;Command parameter bits.
XRETURN = $FF58 ;Known RTS instruction.
InputByte = $c08e
OutputByte = $c08d
InputFlags = $c08b
OutputFlags = $c087
; have 6502 absolute indexed access phantom reads
; happen on page $bf to avoid unwanted i/o access
IndexOffset = $8f
InputByte = $c08e - IndexOffset
OutputByte = $c08d - IndexOffset
InputFlags = $c08b - IndexOffset
OutputFlags = $c087 - IndexOffset
ReadBlockCommand = $01
WriteBlockCommand = $02
@ -76,9 +81,10 @@ DetectSlot:
asl
asl
asl
tax
clc
bcc Start
adc #IndexOffset
tax
bcc Start ;always
nextSlot:
dex
bne DetectSlot

View File

@ -19,10 +19,14 @@ IOError = $27
NoDevice = $28
WriteProtect = $2B
InputByte = $c08e
OutputByte = $c08d
InputFlags = $c08b
OutputFlags = $c087
; have 6502 absolute indexed access phantom reads
; happen on page $bf to avoid unwanted i/o access
IndexOffset = $8f
InputByte = $c08e - IndexOffset
OutputByte = $c08d - IndexOffset
InputFlags = $c08b - IndexOffset
OutputFlags = $c087 - IndexOffset
ResetCommand = $00
ReadBlockCommand = $01
@ -85,9 +89,10 @@ DetectSlot:
asl
asl
asl
tax
clc
bcc Init
adc #IndexOffset
tax
bcc Init ;always
nextSlot:
dex
bne DetectSlot