Skip to content

Commit

Permalink
Switch to allow async I/O using block disks
Browse files Browse the repository at this point in the history
  • Loading branch information
whscullin committed Jan 19, 2025
1 parent 213b7bb commit dabda76
Show file tree
Hide file tree
Showing 31 changed files with 1,190 additions and 675 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"allowBoolean": true
}
],
"@typescript-eslint/require-await": ["off"],
// react rules
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error"
Expand Down
2 changes: 2 additions & 0 deletions asm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
smartport
_FileInformation.txt
36 changes: 33 additions & 3 deletions asm/smartport.s
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ MSLOT EQU $7F8

; Slot I/O addresses
STATUS EQU $C080
READY EQU $C081
XREG EQU $C082
YREG EQU $C083
CARRY EQU $C084

; ROM addresses
BASIC EQU $E000
Expand Down Expand Up @@ -72,9 +76,35 @@ REENTRY PLA ; Restore slot address
TAX
JMP BOOT
DS 2
BLOCK_ENT RTS
DS 2
SMARTPOINT_ENT RTS
BLOCK_ENT JMP COMMON_ENT
SMARTPORT_ENT JMP COMMON_ENT
COMMON_ENT LDA $00 ; Save $00
PHA
LDA #$60 ; Create a known RTS because ROM may be unavailable
STA $00
JSR $0000
TSX
LDA $0100,X ; Load ROM high byte
ASL ; Convert to index for I/O register
ASL
ASL
ASL
TAX
PLA ; Restore $00
STA $00
BUSY_LOOP LDA READY,X ; STATUS will return $80 until ready
BMI BUSY_LOOP
PHA ; Save A
LDA XREG,X ; Read X register
PHA ; Save X
LDA YREG,X ; Read Y register
PHA ; Save Y
LDA CARRY,X ; Get Carry status
ROR A ; Set or clear carry
PLY ; Restore Y
PLX ; Restore X
PLA ; Restore A
RTS
PADDING DS $C7FE - PADDING
ORG $C7FE
FLAGS DFB $D7
Expand Down
Loading

0 comments on commit dabda76

Please sign in to comment.