Smartport seems to work

This commit is contained in:
Florian Reitz 2018-05-29 00:36:39 +02:00
parent 0c64c93efb
commit 06739f1d19
6 changed files with 111 additions and 103 deletions

Binary file not shown.

View File

@ -1,28 +1,28 @@
:10000000A220A200A203A23C0878A960853D203D61 :10000000A220A200A203A20078A960853F203F00A1
:1000100000BABD00018DF807290F28853D0A0A0A9C :10001000BABD0001588DF807290F853FA80A0A0AC2
:100020000A852BAA2CFFCFA000B916C9F0080980B9 :100020000A853EAA2CFFCFA000B916C9F00D0980A1
:10003000995007C810F32C61C03005204ACA900BB4 :10003000995007C810F3A9C520A8FC2C61C0100B6B
:10004000ADF8073A854164406C40002000C8A90122 :10004000ADF8073A854164406C40002000C8C90003
:100050008542A62B8643A9088545644464476446C7 :10005000D0EEA9088545644464476446207ECAB052
:100060002CFFCF2070CAA9018542A62B8643A90A7E :10006000DFA90A854564446447A9018546207ECA04
:10007000854564446447A90185462CFFCF2070CA9A :10007000B0CE4C01081890013808FAA004B93D0030
:10008000A62B4C0108D848A52B48A53D48A54048BB :10008000488810F9863D78A960853F203F00BABDB9
:10009000A541480878A960853D203D00BABD000112 :100090000001588DF807290F853FA80A0A0A0A852A
:1000A0008DF807290F28853D0A0A0A0A852BAA2CF4 :1000A0003EAA2CFFCF203FCA9004A92F8015A9801B
:1000B000FFCF204ACA9004A92F802CA9803C83C07E :1000B0003C83C0D0052000C8B009A53D4828B03415
:1000C000F020A542F00DC901F00EC902F00FA90100 :1000C0002057CADAA63F9D7804689DF804989D7869
:1000D0003880142062CA800F2070CA800A20D9CAD2 :1000D0000508689DF805A00068993D00C8C0059016
:1000E00080052000C890DBBA9D05016885416885C0 :1000E000F7BDF80548BD780548BDF80448BD78045B
:1000F0004068853D68852B6860000000FFFFB7857C :1000F000FA7A2860182058CB80C900000000977554
:10010000A9039D81C0BD83C009019D83C0A9079D2E :10010000A9039D81C0BD83C009019D83C0A9079D2E
:1001100082C0A00AA9FF9D80C03C81C010FB88D08E :1001100082C0A00AA9FF9D80C03C81C010FB88D08E
:10012000F5BD83C029FE9D83C0A93D8540A9C98531 :10012000F5BD83C029FE9D83C0A93D8540A9C98531
:1001300041206DC92081C9C901D065A9498540A95F :1001300041206DC92081C9C901D065A9498540A95F
:10014000C98541206DC9209AC9C901D056A43DB9BD :10014000C98541206DC9209AC9C901D056A43FB9BB
:10015000F805C9AAD04AA9558540A9C98541206D8D :10015000F805C9AAD04AA9558540A9C98541206D8D
:10016000C92081C9A9618540A9C98541206DC920DF :10016000C92081C9A9618540A9C98541206DC920DF
:1001700081C9C901F0E0C900D026A95B8540A9C9A1 :1001700081C9C901F0E0C900D026A95B8540A9C9A1
:100180008541206DC9209AC9C900D014A43DB97811 :100180008541206DC9209AC9C900D014A43FB9780F
:10019000042940F048BD83C009109D83C04CEFC8BE :10019000042940F048BD83C009109D83C04CEFC8BE
:1001A0004C04C9A9558540A9C98541206DC9A967D5 :1001A0004C04C9A9558540A9C98541206DC9A967D5
:1001B0008540A9C98541206DC92081C9C901F0E3E5 :1001B0008540A9C98541206DC92081C9C901F0E3E5
@ -32,7 +32,7 @@
:1001F00083C009809D83C0BD81C009049D81C01852 :1001F00083C009809D83C0BD81C009049D81C01852
:10020000A000900338A027BD83C009019D83C0A929 :10020000A000900338A027BD83C009019D83C0A929
:10021000009D82C0986020204170706C655D5B53CA :10021000009D82C0986020204170706C655D5B53CA
:10022000642076312E312028632932303137204640 :10022000642076312E32202863293230313820463E
:100230006C6F7269616E20526569747A00400000CB :100230006C6F7269616E20526569747A00400000CB
:100240000000954100000000F948000001AA875015 :100240000000954100000000F948000001AA875015
:1002500000000200FF7700000000FF7A00000000AD :1002500000000200FF7700000000FF7A00000000AD
@ -41,61 +41,61 @@
:1002800060A9FF9D80C03C81C010FBBD80C08980FB :1002800060A9FF9D80C03C81C010FBBD80C08980FB
:10029000D0EF48A9FF9D80C068602081C9485AA05E :10029000D0EF48A9FF9D80C068602081C9485AA05E
:1002A000044CA9C9A9FF9D80C03C81C010FBBD8042 :1002A000044CA9C9A9FF9D80C03C81C010FBBD8042
:1002B000C04888D0EFA43D6899F80568997805682A :1002B000C04888D0EFA43F6899F805689978056828
:1002C00099F804689978047AA9FF9D80C06860DA7B :1002C00099F804689978047AA9FF9D80C06860DA7B
:1002D0005A8AA8A63DA5469DF805A5479D78059E86 :1002D0005AA63FA43EA5469DF805A5479D78059ED4
:1002E000F8049E7804A9802543F005A9019DF8042F :1002E000F8049E78049845432970F005A9029DF80A
:1002F000A53D48A9702543853DC43DF007BDF804E0 :1002F0000424431007BDF8041A9DF804A91039839B
:100300001A9DF80468853DA9103983C0D011A00951 :10030000C0D011A0091EF8053E78053EF8043E78DD
:100310001EF8053E78053EF8043E780488D0F17A50 :100310000488D0F17AFA605AA43F9D80C0B978046D
:10032000FA605AA43D9D80C0B978049D80C0B9F898 :100320009D80C0B9F8049D80C0B978059D80C0B992
:10033000049D80C0B978059D80C0B9F8059D80C036 :10033000F8059D80C0A9FF9D80C02081C97A6048D2
:10034000A9FF9D80C02081C97A6048A9403C83C034 :10034000A9403C83C018F00138686048A9203C836C
:1003500018F00138686048A9203C83C018F00138C3 :10035000C018F001386860A542F00CC901F00BC963
:100360006860A9002056CA9002A92BA2FFA0FF60D6 :1003600002F00AA90138604C70CA4C7ECA4CE7CA38
:1003700020CFC9BD83C029FE9D83C0A9512022CAB8 :10037000A500204BCA9002A92BA2FFA0FF6020CFAE
:10038000C900D050A9FF9D80C0BD80C0C9FED0F477 :10038000C9BD83C029FE9D83C0A9512017CAC900D9
:10039000BD81C009109D81C0A9FF9D80C0A000BD86 :10039000D050A9FF9D80C0BD80C0C9FED0F4BD81F2
:1003A00080C09144C8D0F8E645BD80C09144C8D013 :1003A000C009109D81C0A9FF9D80C0A000BD80C074
:1003B000F8C645BD80C0BD80C0BD80C0BD81C0291C :1003B0009144C8D0F8E645BD80C09144C8D0F8C685
:1003C000EF9D81C018A9000848BD83C009019D8325 :1003C00045BD80C0BD80C0BD80C0BD81C029EF9D3E
:1003D000C068286038A92780EE2056CAB06720CFB1 :1003D00081C018A9000848BD83C009019D83C06879
:1003E000C9BD83C029FE9D83C0A9582022CAC90067 :1003E000286038A92780EE204BCAB06720CFC9BD4E
:1003F000D04EA9FF9D80C0A9FE9D80C0A000B14441 :1003F00083C029FE9D83C0A9582017CAC900D04ECA
:100400009D80C0C8D0F8E645B1449D80C0C8D0F8F2 :10040000A9FF9D80C0A9FE9D80C0A000B1449D8031
:10041000C645A9FF9D80C09D80C09D80C0BD80C095 :10041000C0C8D0F8E645B1449D80C0C8D0F8C645F4
:10042000291FC905D01A18A9000848A9FF9D80C036 :10042000A9FF9D80C09D80C09D80C0BD80C0291F48
:10043000BD80C0F0F6BD83C009019D83C0682860FF :10043000C905D01A18A5000848A9FF9D80C0BD8035
:1004400038A92780E438A92B80DF000000000000D5 :10044000C0F0F6BD83C009019D83C068286038A94B
:10045000000000000000000000000000000000009C :100450002780E438A92B80DFA004B9480048881021
:10046000000000000000000000000000000000008C :10046000F9BABD0D0185481869039D0D01BD0E0146
:10047000000000000000000000000000000000007C :10047000854969009D0E01A001B1488542C8B14877
:10048000000000000000000000000000000000006C :10048000AAC8B14885498648A901A642E00AB01A1F
:10049000000000000000000000000000000000005C :10049000B248DDE1CCD027A001B148A43F9978064D
:1004A000000000000000000000000000000000004C :1004A0008A0AAA20C2CBB002A900AAA00068994873
:1004B000000000000000000000000000000000003C :1004B00000C8C00590F78AA002A200C90160A90483
:1004C000000000000000000000000000000000002C :1004C00080E87CEBCC2046CCA43FB97806D00EA5C2
:1004D000000000000000000000000000000000001C :1004D0004CF004A9213860A904924A1860A64CF097
:1004E000000000000000000000000000000000000C :1004E00016CAF008CACAF00FA9213860A901924AB9
:1004F00000000000000000000000000000000000FC :1004F000A8A900914A1860A9E8A63E203FCAB00208
:1005000000000000000000000000000000000000EB :100500000910204BCA90020904924AA001A9FF9148
:1005100000000000000000000000000000000000DB :100510004AC8914AC8A900914AA54CF00CA004B958
:1005200000000000000000000000000000000000CB :10052000FBCC914AC8C01990F618602046CCA64C66
:1005300000000000000000000000000000000000BB :10053000F00FCAF00CCAF006CAF007CAF003A921EE
:1005400000000000000000000000000000000000AB :100540003860A91F3860A002B148854AC8B1488503
:10055000000000000000000000000000000000009B :100550004BC8B148854C602071CC900160A63EA488
:10056000000000000000000000000000000000008B :100560003F4C7ECA2071CC900160A63EA43F4CE770
:10057000000000000000000000000000000000007B :10057000CAB97806F044C901F00EC902F00EC903E9
:10058000000000000000000000000000000000006B :10058000F010C904F0118032A53E8010A53E09800C
:10059000000000000000000000000000000000005B :10059000800AA53E3A8005A53E3A09808543A0021F
:1005A000000000000000000000000000000000004B :1005A000B1488544C8B1488545C8B1488546C8B1F9
:1005B000000000000000000000000000000000003B :1005B000488547C8B148D0061860A9113860A92DF0
:1005C000000000000000000000000000000000002B :1005C0003860B97806F004A9001860A9113860B93C
:1005D000000000000000000000000000000000001B :1005D000780618F003A9113860A9013860A92738F6
:1005E000000000000000000000000000000000000B :1005E0006003030301030101010404C5CB57CC647C
:1005F00000000000000000000000000000000000FB :1005F000CCC2CC2BCCCFCCD9CCD9CCDDCCDDCC1063
:1006000000000000000000000000000000000000EA :100600004150504C455D5B53442020202020202049
:1006100000000000000000000000000000000000DA :1006100002001200000000000000000000000000C6
:1006200000000000000000000000000000000000CA :1006200000000000000000000000000000000000CA
:1006300000000000000000000000000000000000BA :1006300000000000000000000000000000000000BA
:1006400000000000000000000000000000000000AA :1006400000000000000000000000000000000000AA

View File

@ -29,7 +29,7 @@ BLOCKNUM := $46 ; block number, two bytes
; Smartport ; Smartport
SMPARAMLIST := $48 ; parameter list, two bytes SMPARAMLIST := $48 ; parameter list, two bytes
SMCMDLIST := $4A ; command list, two bytes SMCMDLIST := $4A ; command list, two bytes
SMCSCODE := $AC SMCSCODE := $4C
SMZPAREA = SMPARAMLIST SMZPAREA = SMPARAMLIST
SMZPSIZE = SMCSCODE-SMZPAREA+1 SMZPSIZE = SMCSCODE-SMZPAREA+1
SMCMD = DCMD SMCMD = DCMD

View File

@ -57,7 +57,9 @@
; LDX #$3C ; LDX #$3C
SEI ; find slot SEI ; find slot
JSR KNOWNRTS LDA #$60 ; opcode for RTS
STA SLOT
JSR SLOT
TSX TSX
LDA $0100,X LDA $0100,X
CLI CLI
@ -73,17 +75,16 @@
TAX ; X holds now SLOT16 TAX ; X holds now SLOT16
BIT $CFFF BIT $CFFF
LDY #0 ; display copyright message
@DRAW: LDA TEXT,Y
BEQ @OAPPLE ; check for NULL
ORA #$80 ; set MSB
STA $0750,Y ; put second to last line
INY
BPL @DRAW
; LDY #0 ; display copyright message LDA #197
;@DRAW: LDA TEXT,Y JSR $FCA8 ; wait for 100 ms
; BEQ @OAPPLE ; check for NULL
; ORA #$80
; STA $0750,Y ; put second to last line
; INY
; BPL @DRAW
; LDA #197
; JSR $FCA8 ; wait for 100 ms
@OAPPLE: BIT OAPPLE ; check for OA key @OAPPLE: BIT OAPPLE ; check for OA key
BPL @INIT ; and skip boot if pressed BPL @INIT ; and skip boot if pressed
@ -145,9 +146,9 @@ DRIVER: CLC ; ProDOS entry
; Has this to be done every time this gets called or only on boot??? ; Has this to be done every time this gets called or only on boot???
SEI SEI
LDA #$60 ; opcode for RTS LDA #$60 ; opcode for RTS
STA SLOT STA SLOT
JSR SLOT JSR SLOT
TSX TSX
LDA $0100,X LDA $0100,X
CLI CLI

View File

@ -178,6 +178,7 @@ COMMAND: PHY ; save Y
;******************************* ;*******************************
; ;
; Check for card detect ; Check for card detect
; X must contain SLOT16
; ;
; C Clear - card in slot ; C Clear - card in slot
; Set - no card in slot ; Set - no card in slot
@ -197,6 +198,7 @@ CARDDET: PHA
;******************************* ;*******************************
; ;
; Check for write protect ; Check for write protect
; X must contain SLOT16
; ;
; C Clear - card not protected ; C Clear - card not protected
; Set - card write protected ; Set - card write protected

View File

@ -15,6 +15,7 @@
.import READ .import READ
.import WRITE .import WRITE
.import CARDDET
.import WRPROT .import WRPROT
.include "AppleIISd.inc" .include "AppleIISd.inc"
@ -42,16 +43,16 @@ SMARTPORT: LDY #SMZPSIZE-1 ; save zeropage area for Smarport
DEY DEY
BPL @SAVEZP BPL @SAVEZP
TSX ; get parameter list pointer TSX ; get call address
LDA $101+SMZPSIZE,X LDA $103+PDZPSIZE+SMZPSIZE,X
STA SMPARAMLIST STA SMPARAMLIST ; store temporarily
CLC CLC
ADC #3 ; adjust return address ADC #3 ; adjust return address
STA $101+SMZPSIZE,X STA $103+PDZPSIZE+SMZPSIZE,X
LDA $102+SMZPSIZE,X LDA $104+PDZPSIZE+SMZPSIZE,X
STA SMPARAMLIST+1 STA SMPARAMLIST+1
ADC #0 ADC #0
STA $102+SMZPSIZE,X STA $104+PDZPSIZE+SMZPSIZE,X
LDY #1 ; get command code LDY #1 ; get command code
LDA (SMPARAMLIST),Y LDA (SMPARAMLIST),Y
@ -61,8 +62,8 @@ SMARTPORT: LDY #SMZPSIZE-1 ; save zeropage area for Smarport
TAX TAX
INY INY
LDA (SMPARAMLIST),Y LDA (SMPARAMLIST),Y
STA SMPARAMLIST+1 ; TODO: why overwrite, again? STA SMPARAMLIST+1 ; is now parameter list
STX SMPARAMLIST STX SMPARAMLIST
LDA #ERR_BADCMD ; suspect bad command LDA #ERR_BADCMD ; suspect bad command
LDX SMCMD LDX SMCMD
@ -78,8 +79,8 @@ SMARTPORT: LDY #SMZPSIZE-1 ; save zeropage area for Smarport
LDY SLOT LDY SLOT
STA DRVNUM,Y STA DRVNUM,Y
TXA TXA ; SMCMD
ASL A ; shift for use or word addresses ASL A ; shift for use of word addresses
TAX TAX
JSR @JMPSPCOMMAND ; Y holds SLOT JSR @JMPSPCOMMAND ; Y holds SLOT
BCS @END ; jump on error BCS @END ; jump on error
@ -95,7 +96,7 @@ SMARTPORT: LDY #SMZPSIZE-1 ; save zeropage area for Smarport
TXA TXA
LDY #2 ; highbyte of # bytes transferred LDY #2 ; highbyte of # bytes transferred
LDY #0 ; low byte of # bytes transferred LDX #0 ; low byte of # bytes transferred
CMP #1 ; C=1 if A != NO_ERR CMP #1 ; C=1 if A != NO_ERR
RTS RTS
@ -145,9 +146,13 @@ SMSTATUS: JSR GETCSLIST
CLC CLC
RTS RTS
@STATUS03: LDA #$F8 ; block device, read, write, format, @STATUS03: LDA #$E8 ; block device, read, write, format,
; online, no write-protect ; not online, no write-protect
JSR WRPROT LDX SLOT16
JSR CARDDET
BCS @WRPROT
ORA #$10 ; card inserted
@WRPROT: JSR WRPROT
BCC @STATUSBYTE BCC @STATUSBYTE
ORA #$04 ; SD card write-protected ORA #$04 ; SD card write-protected
@STATUSBYTE:STA (SMCMDLIST) @STATUSBYTE:STA (SMCMDLIST)
@ -206,7 +211,7 @@ SMCONTROL: JSR GETCSLIST
; ;
GETCSLIST: LDY #2 GETCSLIST: LDY #2
LDA (SMPARAMLIST),Y LDA (SMPARAMLIST),Y
STA SMCMDLIST ; get list pointer STA SMCMDLIST ; get buffer pointer
INY INY
LDA (SMPARAMLIST),Y LDA (SMPARAMLIST),Y
STA SMCMDLIST+1 STA SMCMDLIST+1