drv/sdc: Implement "SDC@" as a BLK@ word
"0 LIST" in the RC2014 emulator w/ SD card works!
This commit is contained in:
parent
f3c92684a0
commit
47a7133b8b
22
drv/sdc.fs
22
drv/sdc.fs
@ -156,15 +156,20 @@
|
||||
0
|
||||
;
|
||||
|
||||
( dstaddr blkno -- f )
|
||||
: SDC@
|
||||
: _err
|
||||
_desel
|
||||
ABORT" SDC error"
|
||||
;
|
||||
|
||||
( dstaddr blkno -- )
|
||||
: _sdc@
|
||||
_sel
|
||||
0x51 ( CMD17 )
|
||||
0 ROT ( a cmd 0 blkno )
|
||||
_cmd
|
||||
IF _desel 0 EXIT THEN
|
||||
IF _err THEN
|
||||
_wait
|
||||
0xfe = NOT IF _desel 0 EXIT THEN
|
||||
0xfe = NOT IF _err THEN
|
||||
0 SWAP ( crc a )
|
||||
512 0 DO ( crc a )
|
||||
DUP ( crc a a )
|
||||
@ -180,5 +185,12 @@
|
||||
_idle + ( crc2 )
|
||||
_wait DROP
|
||||
_desel
|
||||
= ( success if crc1 == crc2 )
|
||||
= NOT IF _err THEN
|
||||
;
|
||||
|
||||
: SDC@
|
||||
2 * DUP BLK( SWAP ( b a b )
|
||||
_sdc@
|
||||
1+ BLK( 512 + SWAP
|
||||
_sdc@
|
||||
;
|
||||
|
Loading…
Reference in New Issue
Block a user