Compare commits

...

5 Commits
master ... 6502

Author SHA1 Message Date
Florian Reitz
27cad58424 Fix in INIT 2021-08-24 18:53:52 +02:00
Florian Reitz
06139a74f8 Merge branch 'master' into 6502 2021-04-19 18:12:00 +02:00
Florian Reitz
a790af1af4 Merge remote-tracking branch 'origin/devel' into 6502 2020-02-09 17:52:17 +01:00
Florian Reitz
dd571057de Translation bugs 2019-11-10 09:28:31 +01:00
Florian Reitz
181b85b616 Changes for 6502 cpu 2019-08-10 21:16:10 +02:00
7 changed files with 195 additions and 47 deletions

View File

@ -9,7 +9,7 @@
# Space or comma separated list of cc65 supported target platforms to build for. # Space or comma separated list of cc65 supported target platforms to build for.
# Default: c64 (lowercase!) # Default: c64 (lowercase!)
TARGETS := apple2enh TARGETS := apple2
# Name of the final, single-file executable. # Name of the final, single-file executable.
# Default: name of the current dir with target name appended # Default: name of the current dir with target name appended

View File

@ -53,6 +53,7 @@ SS := DATA+3
DUMMY = $FF DUMMY = $FF
FRX = $10 ; CTRL register FRX = $10 ; CTRL register
ECE = $04 ECE = $04
TC = $80
SS0 = $01 ; SS register SS0 = $01 ; SS register
SDHC = $10 SDHC = $10
WP = $20 WP = $20

View File

@ -1,7 +1,7 @@
;******************************* ;*******************************
; ;
; Apple][Sd Firmware ; Apple][Sd Firmware
; Version 1.2.2 ; Version 1.2.3
; Main source ; Main source
; ;
; (c) Florian Reitz, 2017 - 2021 ; (c) Florian Reitz, 2017 - 2021
@ -90,9 +90,14 @@
BPL @INIT ; and skip boot if pressed BPL @INIT ; and skip boot if pressed
@NEXTSLOT: LDA CURSLOT ; skip boot when no card @NEXTSLOT: LDA CURSLOT ; skip boot when no card
DEC A SBC #1
STA CMDHI ; use CMDHI/LO as pointer STA CMDHI ; use CMDHI/LO as pointer
.IFPC02
STZ CMDLO STZ CMDLO
.ELSE
LDA #0
STA CMDLO
.ENDIF
JMP (CMDLO) JMP (CMDLO)
@INIT: JSR INIT @INIT: JSR INIT
@ -107,16 +112,29 @@
; load disk blocks 0 and 1 to $800 and $A00 ; load disk blocks 0 and 1 to $800 and $A00
@BOOT: LDA #$08 ; load to $800 @BOOT: LDA #$08 ; load to $800
STA BUFFER+1 ; buffer hi STA BUFFER+1 ; buffer hi
.IFPC02
STZ BUFFER ; buffer lo STZ BUFFER ; buffer lo
STZ BLOCKNUM+1 ; block hi STZ BLOCKNUM+1 ; block hi
STZ BLOCKNUM ; block lo STZ BLOCKNUM ; block lo
.ELSE
LDA #0
STA BUFFER
STA BLOCKNUM+1
STA BLOCKNUM
.ENDIF
JSR READ JSR READ
BCS @NEXTSLOT ; load not successful BCS @NEXTSLOT ; load not successful
LDA #$0A LDA #$0A
STA BUFFER+1 ; buffer hi STA BUFFER+1 ; buffer hi
.IFPC02
STZ BUFFER ; buffer lo STZ BUFFER ; buffer lo
STZ BLOCKNUM+1 ; block hi STZ BLOCKNUM+1 ; block hi
.ELSE
LDA #0
STA BUFFER
STA BLOCKNUM+1
.ENDIF
LDA #$01 LDA #$01
STA BLOCKNUM ; block lo STA BLOCKNUM ; block lo
JSR READ JSR READ
@ -135,7 +153,12 @@ DRIVER: CLC ; ProDOS entry
SEC ; Smartport entry SEC ; Smartport entry
@PRODOS: PHP ; transfer P to X @PRODOS: PHP ; transfer P to X
.IFPC02
PLX PLX
.ELSE
PLA
TAX
.ENDIF
LDY #PDZPSIZE-1 ; save zeropage area for ProDOS LDY #PDZPSIZE-1 ; save zeropage area for ProDOS
@SAVEZP: LDA PDZPAREA,Y @SAVEZP: LDA PDZPAREA,Y
PHA PHA
@ -172,7 +195,8 @@ DRIVER: CLC ; ProDOS entry
BCS @SMARTPORT ; Smartport dispatcher BCS @SMARTPORT ; Smartport dispatcher
JSR PRODOS ; ProDOS dispatcher JSR PRODOS ; ProDOS dispatcher
@END: PHX @END: .IFPC02
PHX
LDX SLOT ; X holds $0s LDX SLOT ; X holds $0s
STA R30,X ; save A STA R30,X ; save A
PLA PLA
@ -182,6 +206,21 @@ DRIVER: CLC ; ProDOS entry
PHP PHP
PLA PLA
STA R33,X ; save P STA R33,X ; save P
.ELSE
PHP
PHA
TXA
PHA
LDX SLOT
PLA
STA R31,X ; save X
TYA
STA R32,X ; save Y
PLA
STA R30,X ; save A
PLA
STA R33,X ; save P
.ENDIF
LDY #0 LDY #0
@RESTZP: PLA ; restore zeropage area @RESTZP: PLA ; restore zeropage area
@ -190,6 +229,7 @@ DRIVER: CLC ; ProDOS entry
CPY #PDZPSIZE CPY #PDZPSIZE
BCC @RESTZP BCC @RESTZP
.IFPC02
LDA R33,X ; get retval LDA R33,X ; get retval
PHA PHA
LDA R32,X LDA R32,X
@ -200,11 +240,25 @@ DRIVER: CLC ; ProDOS entry
PLX ; restore X PLX ; restore X
PLY ; restore Y PLY ; restore Y
PLP ; restore P PLP ; restore P
.ELSE
LDA R33,X
PHA
LDA R30,X
PHA
LDA R32,X
PHA
LDA R31,X
TAX ; restore X
PLA
TAY ; restore Y
PLA ; restore A
PLP ; restore P
.ENDIF
RTS RTS
@SMARTPORT: CLC @SMARTPORT: CLC
JSR SMARTPORT JSR SMARTPORT
BRA @END JMP @END
;******************************* ;*******************************
@ -220,15 +274,21 @@ DRIVER: CLC ; ProDOS entry
;******************************* ;*******************************
.segment "EXTROM" .segment "EXTROM"
INIT: STZ CTRL,X ; reset SPI controller INIT:
.IFPC02
STZ CTRL,X ; reset SPI controller
.ELSE
LDA #0
STA CTRL,X
.ENDIF
LDA #SS0 ; set CS high LDA #SS0 ; set CS high
STA SS,X STA SS,X
LDY #10 LDY #10
LDA #DUMMY
@LOOP: STA DATA,X @LOOP: LDA #DUMMY
@WAIT: BIT CTRL,X STA DATA,X
BPL @WAIT @WAIT: LDA CTRL,X
BPL @WAIT ; wait for TC (bit 7) to get high
DEY DEY
BNE @LOOP ; do 10 times BNE @LOOP ; do 10 times
LDA SS,X LDA SS,X
@ -354,7 +414,7 @@ INIT: STZ CTRL,X ; reset SPI controller
KNOWNRTS: RTS KNOWNRTS: RTS
TEXT: .asciiz " Apple][Sd v1.2.2 (c)2021 Florian Reitz" TEXT: .asciiz " Apple][Sd v1.2.3 (c)2021 Florian Reitz"
.assert(*-TEXT)=40, error, "TEXT must be 40 bytes long" .assert(*-TEXT)=40, error, "TEXT must be 40 bytes long"

View File

@ -1,7 +1,7 @@
;******************************* ;*******************************
; ;
; Apple][Sd Firmware ; Apple][Sd Firmware
; Version 1.2.2 ; Version 1.2.3
; Helper functions ; Helper functions
; ;
; (c) Florian Reitz, 2017 - 2021 ; (c) Florian Reitz, 2017 - 2021
@ -32,16 +32,27 @@
; ;
;******************************* ;*******************************
SDCMD: PHY SDCMD: .IFPC02
PHY
.ELSE
TYA
PHA
.ENDIF
LDY #0 LDY #0
@LOOP: LDA (CMDLO),Y @LOOP: LDA (CMDLO),Y
STA DATA,X STA DATA,X
@WAIT: BIT CTRL,X ; TC is in N @WAIT: LDA CTRL,X ; TC is in N
BPL @WAIT BPL @WAIT
INY INY
CPY #6 CPY #6
BCC @LOOP BCC @LOOP
.IFPC02
PLY PLY
.ELSE
PLA
TAY
.ENDIF
RTS RTS
@ -54,8 +65,9 @@ SDCMD: PHY
GETR1: LDA #DUMMY GETR1: LDA #DUMMY
STA DATA,X STA DATA,X
@WAIT: BIT CTRL,X @WAIT: LDA CTRL,X ; TC is in N
BPL @WAIT BPL @WAIT
LDA DATA,X ; get response LDA DATA,X ; get response
BMI GETR1 ; wait for MSB=0 BMI GETR1 ; wait for MSB=0
PHA PHA
@ -74,13 +86,19 @@ GETR1: LDA #DUMMY
GETR3: JSR GETR1 ; get R1 first GETR3: JSR GETR1 ; get R1 first
PHA ; save R1 PHA ; save R1
.IFPC02
PHY ; save Y PHY ; save Y
.ELSE
TYA
PHA
.ENDIF
LDY #04 ; load counter LDY #04 ; load counter
JMP @WAIT ; first byte is already there JMP @WAIT ; first byte is already there
@LOOP: LDA #DUMMY ; send dummy @LOOP: LDA #DUMMY ; send dummy
STA DATA,X STA DATA,X
@WAIT: BIT CTRL,X @WAIT: LDA CTRL,X ; TC is in N
BPL @WAIT BPL @WAIT
LDA DATA,X LDA DATA,X
PHA PHA
DEY DEY
@ -94,7 +112,12 @@ GETR3: JSR GETR1 ; get R1 first
STA R31,Y STA R31,Y
PLA PLA
STA R30,Y ; R30 is MSB STA R30,Y ; R30 is MSB
.IFPC02
PLY ; restore Y PLY ; restore Y
.ELSE
PLA
TAY
.ENDIF
LDA #DUMMY LDA #DUMMY
STA DATA,X ; send another dummy STA DATA,X ; send another dummy
PLA ; restore R1 PLA ; restore R1
@ -110,16 +133,29 @@ GETR3: JSR GETR1 ; get R1 first
; ;
;******************************* ;*******************************
GETBLOCK: PHX ; save X GETBLOCK: .IFPC02
PHX ; save X
PHY ; save Y PHY ; save Y
.ELSE
TXA
PHA ; save X
TYA
PHA ; save y
.ENDIF
LDX SLOT ; SLOT is now in X LDX SLOT ; SLOT is now in X
LDY SLOT16 LDY SLOT16
LDA BLOCKNUM ; store block num LDA BLOCKNUM ; store block num
STA R33,X ; in R30-R33 STA R33,X ; in R30-R33
LDA BLOCKNUM+1 LDA BLOCKNUM+1
STA R32,X STA R32,X
.IFPC02
STZ R31,X STZ R31,X
STZ R30,X STZ R30,X
.ELSE
LDA #0
STA R31,X
STA R30,X
.ENDIF
TYA ; get SLOT16 TYA ; get SLOT16
EOR DSNUMBER EOR DSNUMBER
@ -131,7 +167,11 @@ GETBLOCK: PHX ; save X
@DRIVE: BIT DSNUMBER ; drive number @DRIVE: BIT DSNUMBER ; drive number
BPL @SDHC ; D1 BPL @SDHC ; D1
LDA R31,X ; D2 LDA R31,X ; D2
.IFPC02
INC A INC A
.ELSE
ADC #1
.ENDIF
STA R31,X STA R31,X
@SDHC: LDA #SDHC @SDHC: LDA #SDHC
@ -146,20 +186,29 @@ GETBLOCK: PHX ; save X
DEY DEY
BNE @LOOP BNE @LOOP
@END: PLY ; restore Y @END: .IFPC02
PLY ; restore Y
PLX ; restore X PLX ; restore X
.ELSE
PLA
TAY ; restore y
PLA
TAX ; restore x
.ENDIF
RTS RTS
;******************************* ;*******************************
; ;
; Send SD command ; Send SD command
; X must contain SLOT16
; Cmd is in A ; Cmd is in A
; ;
; Y is destroyed
;
;******************************* ;*******************************
COMMAND: PHY ; save Y COMMAND: LDY SLOT
LDY SLOT
STA DATA,X ; send command STA DATA,X ; send command
LDA R30,Y ; get arg from R30 on LDA R30,Y ; get arg from R30 on
STA DATA,X STA DATA,X
@ -172,7 +221,6 @@ COMMAND: PHY ; save Y
LDA #DUMMY LDA #DUMMY
STA DATA,X ; dummy crc STA DATA,X ; dummy crc
JSR GETR1 JSR GETR1
PLY ; restore Y
RTS RTS
@ -188,7 +236,7 @@ COMMAND: PHY ; save Y
CARDDET: PHA CARDDET: PHA
LDA #CD ; 0: card in LDA #CD ; 0: card in
BIT SS,X ; 1: card out AND SS,X ; 1: card out
CLC CLC
BEQ @DONE ; card is in BEQ @DONE ; card is in
SEC ; card is out SEC ; card is out
@ -208,7 +256,7 @@ CARDDET: PHA
WRPROT: PHA WRPROT: PHA
LDA #WP ; 0: write enabled LDA #WP ; 0: write enabled
BIT SS,X ; 1: write disabled AND SS,X ; 1: write disabled
CLC CLC
BEQ @DONE BEQ @DONE
SEC SEC
@ -228,7 +276,7 @@ WRPROT: PHA
INITED: PHA INITED: PHA
LDA #CARD_INIT ; 0: card not initialized LDA #CARD_INIT ; 0: card not initialized
BIT SS,X ; 1: card initialized AND SS,X ; 1: card initialized
CLC CLC
BNE @DONE BNE @DONE
SEC SEC

View File

@ -1,7 +1,7 @@
;******************************* ;*******************************
; ;
; Apple][Sd Firmware ; Apple][Sd Firmware
; Version 1.2.2 ; Version 1.2.3
; ProDOS functions ; ProDOS functions
; ;
; (c) Florian Reitz, 2017 - 2021 ; (c) Florian Reitz, 2017 - 2021
@ -171,11 +171,11 @@ READ: JSR CARDDET ; check for card
@IOERROR: SEC ; an error occured @IOERROR: SEC ; an error occured
LDA #ERR_IOERR LDA #ERR_IOERR
BRA @DONE BCS @DONE
@NDERROR: SEC ; an error occured @NDERROR: SEC ; an error occured
LDA #ERR_NODRIVE LDA #ERR_NODRIVE
BRA @DONE BCS @DONE
;******************************* ;*******************************
@ -251,8 +251,8 @@ WRITE: JSR WRPROT
@IOERROR: SEC ; an error occured @IOERROR: SEC ; an error occured
LDA #ERR_IOERR LDA #ERR_IOERR
BRA @DONE BCS @DONE
@WPERROR: SEC @WPERROR: SEC
LDA #ERR_NOWRITE LDA #ERR_NOWRITE
BRA @DONE BCS @DONE

View File

@ -1,10 +1,10 @@
;******************************* ;*******************************
; ;
; Apple][Sd Firmware ; Apple][Sd Firmware
; Version 1.2.2 ; Version 1.2
; Smartport functions ; Smartport functions
; ;
; (c) Florian Reitz, 2017 - 2021 ; (c) Florian Reitz, 2017 - 2018
; ;
; X register usually contains SLOT16 ; X register usually contains SLOT16
; Y register is used for counting or SLOT ; Y register is used for counting or SLOT
@ -70,7 +70,12 @@ SMARTPORT: LDY #SMZPSIZE-1 ; save zeropage area for Smarport
CPX #$09+1 ; command too large CPX #$09+1 ; command too large
BCS @END BCS @END
.IFPC02
LDA (SMPARAMLIST) ; parameter count LDA (SMPARAMLIST) ; parameter count
.ELSE
LDY #0
LDA (SMPARAMLIST),Y
.ENDIF
CMP REQPARAMCOUNT,X CMP REQPARAMCOUNT,X
BNE @COUNTMISMATCH BNE @COUNTMISMATCH
@ -82,7 +87,15 @@ SMARTPORT: LDY #SMZPSIZE-1 ; save zeropage area for Smarport
TXA ; SMCMD TXA ; SMCMD
ASL A ; shift for use of word addresses ASL A ; shift for use of word addresses
TAX TAX
.IFPC02
JSR @JMPSPCOMMAND ; Y holds SLOT JSR @JMPSPCOMMAND ; Y holds SLOT
.ELSE
LDA SPDISPATCH+1,X
PHA
LDA SPDISPATCH,X
PHA
RTS ; jump to cmd offset
.ENDIF
BCS @END ; jump on error BCS @END ; jump on error
LDA #NO_ERR LDA #NO_ERR
@ -95,19 +108,19 @@ SMARTPORT: LDY #SMZPSIZE-1 ; save zeropage area for Smarport
BCC @RESTZP BCC @RESTZP
TXA TXA
;warum feste anzahl an bytes für return wert?
LDY #2 ; highbyte of # bytes transferred LDY #2 ; highbyte of # bytes transferred
LDX #0 ; low byte of # bytes transferred LDX #0 ; low byte of # bytes transferred
;warum wird mit #1 verglichen?
CMP #1 ; C=1 if A != NO_ERR CMP #1 ; C=1 if A != NO_ERR
RTS RTS
@COUNTMISMATCH: @COUNTMISMATCH:
LDA #ERR_BADPCNT LDA #ERR_BADPCNT
BRA @END BNE @END
.IFPC02
@JMPSPCOMMAND: ; use offset from cmd*2 @JMPSPCOMMAND: ; use offset from cmd*2
JMP (SPDISPATCH,X) JMP (SPDISPATCH,X)
.ENDIF
@ -126,7 +139,12 @@ SMSTATUS: JSR GETCSLIST
; TODO support partitions based on card size ; TODO support partitions based on card size
@STATUS00: LDA #4 ; support 4 partitions @STATUS00: LDA #4 ; support 4 partitions
.IFPC02
STA (SMCMDLIST) STA (SMCMDLIST)
.ELSE
LDY #0
STA (SMCMDLIST),Y
.ENDIF
LDY #7 LDY #7
@LOOP00: LDA STATUS00DATA-1,Y @LOOP00: LDA STATUS00DATA-1,Y
@ -148,7 +166,12 @@ SMSTATUS: JSR GETCSLIST
RTS RTS
@GETDCB: LDA #1 ; return 'empty' DCB, one byte @GETDCB: LDA #1 ; return 'empty' DCB, one byte
.IFPC02
STA (SMCMDLIST) STA (SMCMDLIST)
.ELSE
LDY #0
STA (SMCMDLIST),Y
.ENDIF
TAY TAY
LDA #NO_ERR LDA #NO_ERR
STA (SMCMDLIST),Y STA (SMCMDLIST),Y
@ -164,7 +187,12 @@ SMSTATUS: JSR GETCSLIST
@WRPROT: JSR WRPROT @WRPROT: JSR WRPROT
BCC @STATUSBYTE BCC @STATUSBYTE
ORA #$04 ; SD card write-protected ORA #$04 ; SD card write-protected
@STATUSBYTE:STA (SMCMDLIST) @STATUSBYTE:.IFPC02
STA (SMCMDLIST)
.ELSE
LDY #0
STA (SMCMDLIST),Y
.ENDIF
LDY #1 ; block count, always $00FFFF LDY #1 ; block count, always $00FFFF
LDA #$FF LDA #$FF
@ -280,18 +308,18 @@ TRANSLATE: LDA DRVNUM,Y
BEQ @UNIT3 BEQ @UNIT3
CMP #4 CMP #4
BEQ @UNIT4 BEQ @UNIT4
BRA @BADUNIT ; only 4 partitions are supported BNE @BADUNIT ; only 4 partitions are supported
@UNIT1: LDA SLOT16 ; this slot @UNIT1: LDA SLOT16 ; this slot
BRA @STORE BNE @STORE
@UNIT2: LDA SLOT16 @UNIT2: LDA SLOT16
ORA #$80 ; drive 1 ORA #$80 ; drive 1
BRA @STORE BNE @STORE
@UNIT3: LDA SLOT16 @UNIT3: LDA SLOT16
DEC A ; phantom slot SBC #1 ; phantom slot
BRA @STORE BNE @STORE
@UNIT4: LDA SLOT16 @UNIT4: LDA SLOT16
DEC A ; phantom slot SBC #1 ; phantom slot
ORA #$80 ; drive 1 ORA #$80 ; drive 1
@STORE: STA DSNUMBER ; store in ProDOS variable @STORE: STA DSNUMBER ; store in ProDOS variable

View File

@ -1,4 +1,5 @@
# AppleIISd # AppleIISd
SD card based ProFile replacement for enhanced Apple IIe and IIgs computers SD card based ProFile replacement for enhanced Apple IIe and IIgs computers
The **AppleIISd** is a SD card based replaced for the ProFile harddrive. In contrast to other SD card based devices, this card does not replace a Disk II drive. Data is saved directly onto the SD card, not via images on a FAT system, like on other cards. The SD card is accessable with [CiderPress](http://a2ciderpress.com/). The **AppleIISd** is a SD card based replaced for the ProFile harddrive. In contrast to other SD card based devices, this card does not replace a Disk II drive. Data is saved directly onto the SD card, not via images on a FAT system, like on other cards. The SD card is accessable with [CiderPress](http://a2ciderpress.com/).
@ -8,6 +9,7 @@ A Xilinx CPLD is used as a SPI controller and translates, together with the ROM
The assembler sources are written for CC65. The [schematics](Binary/AppleIISd.pdf) are available as PDF. The assembler sources are written for CC65. The [schematics](Binary/AppleIISd.pdf) are available as PDF.
## Features ## Features
* works with ProDOS and GS/OS * works with ProDOS and GS/OS
* up to 128MB storage space (4x 65535 blocks) * up to 128MB storage space (4x 65535 blocks)
* ProDOS and Smartport driver in ROM * ProDOS and Smartport driver in ROM
@ -18,7 +20,9 @@ The assembler sources are written for CC65. The [schematics](Binary/AppleIISd.pd
* Skip boot when Open-Apple key is pressed * Skip boot when Open-Apple key is pressed
## Requirements ## Requirements
The AppleIISd requires an enhanced IIe or IIgs computer. The ROM code uses some 65c02 opcodes and will therefore not work on a II, II+ or unenhanced IIe. It has been tested in the following combinations: The AppleIISd requires an enhanced IIe or IIgs computer. The ROM code uses some 65c02 opcodes and will therefore not work on a II, II+ or unenhanced IIe. It has been tested in the following combinations:
* Apple IIgs Rom 01, GS/OS 6.0.4 * Apple IIgs Rom 01, GS/OS 6.0.4
* Apple IIgs Rom 01, Prodos 2.4.1 * Apple IIgs Rom 01, Prodos 2.4.1
* Apple IIgs Rom 01, Prodos 1.9 * Apple IIgs Rom 01, Prodos 1.9
@ -27,6 +31,7 @@ The AppleIISd requires an enhanced IIe or IIgs computer. The ROM code uses some
* Apple IIe enhanced, 64k, Prodos 1.9 * Apple IIe enhanced, 64k, Prodos 1.9
## Binary distribution ## Binary distribution
The following files in [Binary/](Binary) have been provided to eliminate the need to compile assembler or VHDL sources. The following files in [Binary/](Binary) have been provided to eliminate the need to compile assembler or VHDL sources.
| File | Purpose | | File | Purpose |
@ -41,6 +46,7 @@ The following files in [Binary/](Binary) have been provided to eliminate the nee
| Gerber_Vx.x.zip | Gerber files for different hw revisions | | Gerber_Vx.x.zip | Gerber files for different hw revisions |
## Smartport drive remapping ## Smartport drive remapping
The AppleIISd features Smartport drivers in ROM to provide more than two drives in both GS/OS and ProDOS. The AppleIISd features Smartport drivers in ROM to provide more than two drives in both GS/OS and ProDOS.
As ProDOS supports only two drives per slot, additional drives on a Smartport device are mapped to 'phantom slots'. Version prior to version 2 supported only the remapping of drives when the card was in slot 5. Starting with version 2, the remapping seems to work on all slots. The following list shows the assignments as slot/drive, when no other devices are attached: As ProDOS supports only two drives per slot, additional drives on a Smartport device are mapped to 'phantom slots'. Version prior to version 2 supported only the remapping of drives when the card was in slot 5. Starting with version 2, the remapping seems to work on all slots. The following list shows the assignments as slot/drive, when no other devices are attached:
@ -56,15 +62,19 @@ As ProDOS supports only two drives per slot, additional drives on a Smartport de
When more devices are connected, things get a little confusing ;-) When more devices are connected, things get a little confusing ;-)
## Building the sources ## Building the sources
Be sure to have the newest version of CC65 (V2.16) and some kind of Make instaled, then type one of the following comands: Be sure to have the newest version of CC65 (V2.16) and some kind of Make instaled, then type one of the following comands:
```
```bash
make # generate binaries make # generate binaries
make OPTIONS=mapfile,listing # generate mapfile and listing, too make OPTIONS=mapfile,listing # generate mapfile and listing, too
make clean # delete binaries make clean # delete binaries
``` ```
Alternatively use the VisualStudio solution. Alternatively use the VisualStudio solution.
## Timing ## Timing
The clock of the SPI bus *SCK* may be derived from either *Phi0* or the *7M* clock. Additionally, the divisor may be 2 to 8. The clock of the SPI bus *SCK* may be derived from either *Phi0* or the *7M* clock. Additionally, the divisor may be 2 to 8.
The following measurements were taken with the divisor set to 2, resulting in *fSCK* of 500kHz and 3.5MHz. Reading of a byte requires that a dummy byte is sent on the bus, before the answer can be read. Therefore the measurement is the time between sending the byte and receiving the answer. The measurement for reading of a whole 512 byte block includes the SD card commands to do so. The following measurements were taken with the divisor set to 2, resulting in *fSCK* of 500kHz and 3.5MHz. Reading of a byte requires that a dummy byte is sent on the bus, before the answer can be read. Therefore the measurement is the time between sending the byte and receiving the answer. The measurement for reading of a whole 512 byte block includes the SD card commands to do so.
@ -78,7 +88,7 @@ This shows that the required to read a single byte can be reduced significantly
The time for reading a 512 byte block could *only* be halved, but there are for sure opportunities for optimization in the code surrounding the reading. The time for reading a 512 byte block could *only* be halved, but there are for sure opportunities for optimization in the code surrounding the reading.
``` ```asm
* single byte @ 500kHz * single byte @ 500kHz
LDA #$FF LDA #$FF
STA $C0C0 STA $C0C0
@ -97,8 +107,8 @@ STA $C0C0
LDA $C0C0 LDA $C0C0
``` ```
## Registers ## Registers
The control registers of the *AppleIISd* are mapped to the usual I/O space at **$C0n0 - $C0n3**, where n is slot+8. All registers and bits are read/write, except where noted. The control registers of the *AppleIISd* are mapped to the usual I/O space at **$C0n0 - $C0n3**, where n is slot+8. All registers and bits are read/write, except where noted.
| Address | Function | Default value | | Address | Function | Default value |
@ -131,14 +141,15 @@ The control registers of the *AppleIISd* are mapped to the usual I/O space at **
**INIT** Initialized - This bit is set to 1 when the SD card has been initialized by the firmware. Do not write manually. **INIT** Initialized - This bit is set to 1 when the SD card has been initialized by the firmware. Do not write manually.
## TODOs ## TODOs
* Much more testing * Much more testing
* Enable more than 4 volumes under GS/OS * Enable more than 4 volumes under GS/OS
* Support for 6502 CPUs * Support for 6502 CPUs
* Support for CP/M * Support for CP/M
## Known Bugs ## Known Bugs
* Programs not startable from partitions 3 and 4 under ProDOS
* Programs not startable from partitions 3 and 4 under ProDOS
![Front_Img_Smd](Images/Card%20Front%20SMD.jpg) ![Front_Img_Smd](Images/Card%20Front%20SMD.jpg)
![Front_Img](Images/Card%20Front.jpg) ![Front_Img](Images/Card%20Front.jpg)