Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async block disks #246

Merged
merged 5 commits into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading