SIO Commands

SIO device number: $73 + deviceID

Command aux1 aux2 direction length description firmware
$00 - - SIO2SD->ATARI ($40) 1 device status (see below) 1.0
$01 disk number (1-15,128-228) # of disks (1-4) SIO2SD->ATARI ($40) 54*# of disks get disk mapping parameters 1.0
$02 disk number (1-15,129-228) # of disks (1-4) ATARI->SIO2SD ($80) 54*# of disks set disk mapping parameters 1.0
$03 disk number (1-15,129-228) # of disks (1-100) - ($00) - disconnect disks 1.0
$04 # of entries (1-4) flags (0-3) SIO2SD->ATARI ($40) 54*# of entries get next entries from current directory 1.0
$05 - - ATARI->SIO2SD ($80) 54 change current directory to given 1.0
$06 - - - ($00) - go to parent directory 1.0
$07 - - - ($00) - go to main directory 3.0
$08 - - SIO2SD->ATARI ($40) 54 get current directory 3.0
$09 object types - ATARI->SIO2SD ($80) 16 set searching mask 3.0
$0A - - SIO2SD->ATARI ($40) 2 get number of entries in current directory (matching to given mask) 3.0
$0B object type - ATARI->SIO2SD ($80) 39 create new object in current directory 3.0
$0C - - ATARI->SIO2SD ($80) 54 delete given file 3.0
$0D - - ATARI->SIO2SD ($80) 54 rename given object 3.0
$0E - - SIO2SD->ATARI ($40) 54 find files matching to given mask (in whole SD card) 3.0
$0F - - ATARI->SIO2SD->ATARI ($C0) 54 get parent directory for given object 3.0
$10 line number - ATARI->SIO2SD ($80) 40 display custom data on LCD 2.0
$11 - - SIO2SD->ATARI ($40) 1 get firmware version 3.0
$12 - - SIO2SD->ATARI ($40) 16 get config bytes 3.0
$13 - - ATARI->SIO2SD ($80) 16 set config bytes 3.0
$14 - - SIO2SD->ATARI ($40) 15 get virtual disk mappings 3.0
$15 - - ATARI->SIO2SD ($80) 15 set virtual disk mappings 3.0
$1E - - SIO2SD->ATARI ($40) 1 get hsindex for standard turbo 3.0
$1F - - SIO2SD->ATARI ($40) 1 get hsindex for 7th-bit turbo 3.0
$20 parameters - ATARI->SIO2SD ($80) 39 create/open file 3.0
$21 - - ATARI->SIO2SD ($80) 54 open file 3.0
$22 - - SIO2SD->ATARI ($40) 3 get current I/O position (in bytes) 3.0
$23 - - ATARI->SIO2SD ($80) 3 set current I/O position (in bytes) 3.0
$24 length - SIO2SD->ATARI ($40) length read ’length’ bytes from current position 3.0
$25 length - ATARI->SIO2SD ($80) length write ’length’ bytes on current position 3.0
$26 - - SIO2SD->ATARI ($40) 3 get length of opened file (in bytes) 3.0
$27 - - ATARI->SIO2SD ($80) 3 set length of opened file (in bytes) 3.0

$00

status:

  • 0 - no card in slot
  • 1 - card in slot
  • 2 - card in slot, drive mappings and current directory have changed
  • 3 - card in slot, drive mappings have changed
  • 4 - card in slot, current directory has changed

$01,$02,$03,$14,$15

drive numbers:

  • <1-15> - standard drives D1 do D15
  • <129-228> - virtual drives V0 do V99
  • 128 - configuration disk

$04

flags (bit 0 = start/continue , bit 1 = forward/backward):

  • 0 - continue forward
  • 1 - set position on the first file and return first files
  • 2 - continue backward
  • 3 - set postion on the last file and return last files

$09

types mask:

  • 1 - directories
  • 2 - files
  • 3 - files and directories

data:

  • Mask is given as a zero ending string containing up to 16B in the format: []text[] or []text[].[]text[]

$0B

object type:

  • 1 - directory
  • 2 - file (created file has no bytes, but such file is treated as an ATR file)

$0D

  • bytes <0-38> - new object name
  • bytes <39-53> - original object data

$0E

  • Before running this command mask has to be set (command $09)

$12,$13

  • byte 0 - set turbo speed (hsindex) (0-16 speed , 17 - turn off turbo)
  • byte 1 - set turbo speed fo 7th-bit/XF551 mode
  • byte 2 - set MMC/SD transmission speed
    • 0 - high speed - about 2.4Mb/s
    • 1 - medium speed - about 900kb/s
    • 2 - low speed - about 500kb/s
  • byte 3 - LED mode
    • 0 - read/write on SD card
    • 1 - read/write on SIO
    • 2 - SD activity/SIO activity
  • byte 4 - SIO2SD device id (0-3)
  • byte 5 - ATR’s write protection mode
    • 0 - ATR’s always can be modified
    • 1 - obey ATR’s write protection flag
    • 2 - ATR’s are always write protected
  • byte 6 - key repetition delay (0-50 w 1/50s)
  • byte 7 - key repetition frequency (0-10 w 1/50s)
  • bytes 8-15 - not used

$14,$15

Virutal drives mappings. One byte for every standard drive (D1-D15). Every byte contains virtual (or even real) drive number mapped to given real drive.

  • values 1 - 15 are disks D1 to D15 (1 = D1, 2 = D2, etc.)
  • values 129 - 228 are virtual disks V0 to V99 (129 = V0, 130 = V1, etc.)
  • value 128 is the configuration program

$20

parameters (bit 0 = location choice, bit 1 = do not create file if not present):

  • 0 - open/create file using given name in main (ATARI) directory
  • 1 - open/create file using given name in current directory
  • 2 - open file using given name in main (ATARI) directory
  • 3 - open file using given name in current directory

$0B,$0D,$20

Name of file:

Name should have up to 39 characters (filled with zeros). If there is no zero in the name then spaces are stripped from the right, so it is also possible to fill up name using spaces, not zeros. All bad characters (characters with codes less than 32, higher than 126 and ‘', ‘/’, ‘:’, ‘*’, ‘?’, ‘"’, ‘<’, ‘>’, ‘|’) will be silently ignored. For example: name “test/name” will be trated as “testname”. It also means that Atari EOL (155) will be ignored, so it can be present at the end of the name.

$01,$02,$04,$05,$08,$21

object parameters (54B)

  • bytes 0-38 - object name
  • byte 39 - object type
    • 0 - disconnected (only commands $01 and $02)
    • 1 - directory
    • 2 - file
    • 3 - empty disk (only commands $01 and $02)
  • bytes 40-43 - number of first cluster
  • bytes 44-47 - length (only files, zero for directories)
  • bytes 48-53 - entry localization in parent directory