Introduction
============
  
   SD2IEC LCD 0.6d is my try to extend the SD2IEC/MCC2IEC controllers with a LCD display.
   It is bases heavily on the SD2IEC 0.6.6 firmware by Ingo Korb, who did a great job there!
      
   Note that i made several modifications of the firmware. Ingo Korb is not responsible for
   any wanted or unwanted features of this firmware version. 

   Since this is a slightly unfinished fun project (sorry, not so much spare time at the moment)
   i am publishing it as it is in the hope that it will be useful.
   
   There's no guarantee that the code works or that the suggested hardware modifications are correct.
   Use it on your own risk!
             
      
Additional Features
===================

   * Based on the SD2IEC Firmware V0.6.6 by Ingo Korb
   
   * Runs on Atmel ATMEGA32 MCU. Should run on ATMEGA644P MCU too (not yet tested).
   
   * Display various information like
      - current path (D:<path>)
      - current D64 image (D:<Image.d64>)
      - file access (L/S/R:<file>)
      - error messages (E:<message>)
      - user defined messages
      - and a nice boot screen (-;
   
   * Support HD 44780 compatible displays (2x16 or 2x20 chars) 


Removed Features
================

I fitted in the LCD routines at the price of: 

  - No debug code (UART output)
  - No bootloader support on ATMEGA32 (sorry, not enough space)


Additional Commands available via IEC
=====================================
    
  XT* Text Commands
  -----------------
  
   The display can be accessed from the c64! 
   Use commands "XT1" and "XT2" to send text to display line 1 or 2.
   The addressed line will be cleared before text is printed.

   Example 1 - send "Lightyears ahead!" to line1: 

      OPEN15,8,15,"XT1Lightyears ahead!" 

   The "XTC" command allows to send a control code followed by data, which makes it possible
   to program the display from the C64 side, e.g. define own characters.

   Example2 - clear the screen: 

      OPEN15,8,15,"XT1"+CHR$(1) will clear the screen.
  
   Example 3 - define a special character with a "heart" (line 2) and print it 3 times (line 3):
     1 OPEN15,8,15
     2 PRINT#15,"XTC"+CHR$(64)+CHR$(27)+CHR$(31)+CHR$(31)+CHR$(14)+CHR$(4)+CHR$(0)+CHR$(0)
     3 print#15,"XT1"+CHR$(8)+CHR$(8)+CHR$(8)
     4 CLOSE15


  Display About Message 
  ----------------------

   The XA command shows a small about message:  
   
   Example:

      OPEN15,8,15,"XA" 

  Display Greetings & Credits 
  ---------------------------

   The XG command shows the greetings and credits:  
   
   Example:

      OPEN15,8,15,"XG" 


  Undocumented experimental feature 
  ----------------------------------

   The XX command is not documented. It might cause skynet to
   link all computers together to play a game of global 
   thermonuclear war.
   
   Maybe your C64 is not connected to skynet, so you'll give it a try.
   Good luck!   
       
   Example:

      OPEN15,8,15,"XX" 

 
LCD Hardware
============

   Every HD 44780 compatible displays (2x16 or 2x20 chars) should work 
   The display is accessed in 4-bit mode.
   
   Different pinouts have to be used depending on the hardware variant 
   of the SD2IEC / MMC2IEC device: 
    
   
   sd2iec V1.4  by Shadowolf (sw1 variant) 
   MMC2IEC by Lars Pontoppidan (larsp variant) 
   -------------------------------------------
    (original design, also used by PCBs from Peter Sieg) 
   
   Display  Atmega
   RS       PB0
   RW       PB1
   E        PB2
   DB4      PC4
   DB5      PC5
   DB6      PC6
   DB7      PC7


   sd2iec V1.6 by Shadowolf (sw2 variant) 
   --------------------------------------
   ATTENTION: I have not yet tested this pinout so it might be possible that it is not working.
   			  At least it will be hard to solder the display to PB0,PB1 and PB3 if using a TQFP44 mcu. 
	   
   Display  Atmega
   RS       PB0
   RW       PB1
   E        PB3
   
   DB4      PC4
   DB5      PC5
   DB6      PC6
   DB7      PC7

   For other variants please feel encouraged to change the lcd.h to suit your needs.
    

Credits
=======

   Ingo Korb alias for his great SD2IEC firmware.
   Shadowolf for his outstanding hardware designs running the SD2IEC firmware.
   Lars Pontoppidan for creating the MMC2IEC in the first place.
   Jim Brain & ChaN for basic code like IEC routines and FAT driver.
   Commodore for the good times.

Licence
=======

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; version 2 of the License only.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   
   
-------------------------------------------------------------------------------------------------

Original README from SD2IEC 0.6.6 by Ingo Korb


sd2iec - a controller/interface adapting SD/MMC to the CBM serial bus
Copyright (C) 2007,2008  Ingo Korb <ingo@akana.de>
Parts based on code from others, see comments in main.c for details.
JiffyDos send based on code by M.Kiesel
Fat LFN support and lots of other ideas by Jim Brain
crc7.c generated by pycrc, see comments in it for pycrc licence.

Free software under GPL version 2 ONLY, see comments in main.c and
COPYING for details.

FIXME:This file still needs to be expanded. A lot.

Introduction:
=============
sd2iec is a device for the Commodore serial bus that allows accessing an SD
or MMC card - think of it as a 1541 with a modern storage medium instead of
disks. The project was inspired by (and uses a few bits of code from)
MMC2IEC[1] by Lars Pontoppidan and runs on the same hardware.

Currently the compatibility is slightly higher than MMC2IEC 0.8, but there
are still lots of features missing. Anything that tries execute code on the
1541 will not work, this includes every software-fastloader.

[1] Homepage: http://pontoppidan.info/lars/index.php?proj=mmc2iec

Supported commands:
===================
- General notes:
  Any command not listed below is currently not supported.

- Directory filters:
  To show only directories, both =B (CMD-compatible) and =D can be used.
  On a real Commodore drive D matches everything.
  To include hidden files in the directory, use *=H - on a 1541 this doesn't
  do anything. sd2iec marks hidden files with an H after the lock mark,
  i.e. "PRG<H" or "PRG H".

- CD/MD/RD:
  Subdirectory access is compatible to the syntax used by the CMD drives,
  although drive/partition numbers are completely ignored.

  Quick syntax overview:
    CD:_         changes into the parent dir (_ is the left arrow on the C64)
    CD:foo       changes into foo
    CD/foo       dito
    CD//foo      changes into \foo
    CD/foo/:bar  changes into foo\bar
    CD/foo/bar   dito

  MD uses a syntax similiar to CD and will create the directory listed
  after the colon (:) relative to any directory listed before it.

    MD/foo/:bar  creates bar in foo
    MD//foo/:bar creates bar in \foo

  RD can only remove subdirectories of the current directory.

    RD:foo       deletes foo

  CD is also used to mount/unmount image files. Just change into them
  as if they were a directory and use CD:_ to leave. Please note that
  image files are detected by file extension only and there is no reliable
  way to see if a file is a valid image file.

- S:
  Name matching is fully supported, directories are ignored.

- U0
  Device address changing with "U0>"+chr$(new address) is supported,
  other U0 commands are currently not implemented.

- U1/U2/B-R/B-W
  Block reading and writing is fully supported while a D64 image is mounted.

- B-P
  Supported, not checked against the original rom at all.

- UI+/UI-
  Switching the slightly faster bus protocol for the VC20 on and off works,
  it hasn't been tested much though.

- UI/UJ
  Soft/Hard reset - UI just sets the "73,SD2IEC..." message on the
  error channel, UJ causes a restart of the AVR processor (skipping
  the bootloader if installed).

- X: Extended commands. If you use JiffyDOS, you can send them by using
  @"X..." - without quotes you'll just receive an error.

  - XJ+/XJ-  Set or reset the JiffyDOS protocol support flag. Default state
             is disabled for compatibility reasons. This flag can be saved
             in the EEPROM using XW.

  - XCnum    Set oscillator calibration value to num (must be between
             0 and 255). Default is whatever your chip defaults to. This
             value can be saved in the EEPROM using XW.

  - X        X without any following characters reports the current state
             of all extended parameters via the error channel, similiar
             to DolphinDOS. Example result: "03,J-:C152,08,00"
             The track indicates the current device address.

  - XS:name  Set up a swap list - see "Changing Disk Images" below.
    XS       Disable swap list

  - XW       Store configuration to EEPROM
             This commands stores the current configuration in the EEPROM.
             It will automatically be read when the AVR is reset, so
             any changes you made will persist even after turning off
             the hardware.

             The stored configuration includes the oscillator calibration
             value, the JiffyDOS protocol support flag and the current
             device address. If you have changed the device address by
             software, sd2iec will power up with that address unless you
             have changed the device address jumpers (if available) to
             a different setting than the one active at the time the
             configuration was saved. You can think of this feature as
             changing the meaning of one specific setting of the jumpers
             to a different address if this sounds logical enough to you.

             The "hardware overrides software overrides hardware" priority
             was chosen to allow accessing sd2iec even when it is soft-
             configured for a device number that is already taken by
             another device on the bus without having to remove that
             device to reconfigure sd2iec (e.g. when using a C128D).

 Currently the only things saved are the
             oscillator calibration, the JiffyDOS protocol support flag

- M-R, M-W, M-E
  Memory reading returns random data of the requested length. Memory writing
  knows about the address used for changing the device address on a 1541 and
  will change the address of sd2iec to the requested value. It will also
  check if the transmitted data corresponds to any of the known software
  fastloaders so the correct emulation code can be used when M-E is called.

- E-R, E-W
  Both commands work like M-R and M-W, but instead of reading/writing RAM
  they allow access to a user-area of the EEPROM. This area currently holds
  512 bytes and accesses beyond its end will result in a 32 SYNTAX ERROR.
  It is strongly recommended to work on a protocol for sharing this area
  between multiple applications that want to store their configuration in
  there, but that is beyond the scope of this project.

  As the contents of the EEPROM have to be copied to RAM before they can
  be sent to the computer it is not possible to read more data with a
  single command than the error message buffer (default size: 36 bytes)
  can hold. Similiarly, writing is restricted by the size of the command
  buffer (at least 42 bytes for compatibility, expected to be at least
  100 bytes in release versions).

  The user-area does not interfere with the stored configuration (XW) in
  any way.

Long File Names:
================
Long file names (i.e names not within the 8.3 limits) are supported on
FAT, but for compatibility reasons the 8.3 name is used if the long
name exceeds 16 characters. If you use anything but ASCII characters
on the PC or their PETSCII equivalents on the Commodore you may
get strange characters on the other system because the LFN use
unicode characters on disk, but sd2iec parses only the low byte
of each character in the name.

Software fastloaders:
=====================
There is currently support for one software fastloader in the code. It is
detected by the CRC of its 493 byte long floppy code and the M-E address
0x0303. I've seen the same code under multiple names, among them
"Turbodisk" (both 2.1 and 2.2) and "Fast-Load". Unfortunately the timing
requirements are extremely tight and cannot be met with the internal RC
oscillator of the AVR even if calibrated. You really need an external
8MHz crystal or the data read by the C64 will be gibberish.

The Final Cartridge III fastloader and fastsaver are both supported and
might work without a crystal. The fastloader used by programs freezed
with the "Fast Disk" option of FC3 is NOT supported.

The software fastloader used by the Action Replay 6 is disabled by
returning an unknown value when the cartridge tries to determine the
drive type.

JiffyDOS:
=========
The JiffyDOS protocol has very relaxed timing constraints compared to
Turbodisk, but still not as relaxed as the standard Commodore IEC protocol.
Jiffy seems to tolerate slightly mis-tuned RC oscillators, but you still
shouldn't expect it to work without oscillator calibration. If the
frequency error is too big you WILL get wrong data which usually manifests
as a FILE NOT FOUND error because the name the drive received was already
garbled.

M2I files:
==========
M2I files are fully supported. sd2iec supports SEQ and USR files in this
format in addition to PRG and DEL which were already implemented in MMC2IEC.
For compatibility reasons the file type is not checked when opening files.
Inside an M2I file the files are always shown as 0 (DEL) or 1 blocks
because calling stat for every file was slowing down the directory listing
too much.

Changing Disk Images
====================
Because some programs require more than one disk side there is support
for changing the currently mounted disk image with a button connected
to the disk change pin.

If your circuit doesn't have a disk change pin/button you might be able to
add it yourself:
- For the original MMC2IEC and the NKC MMC2IEC:
  Connect a button from PA4 to ground. PA4 is pin 36 on the DIL version
  of the controller or pin 33 on the surface-mount version.
- For Shadowolf's MMC2IEC 1.x PCBs:
  Connect a button from PC4 to ground. PC4 is pin 23 on the DIL version
  of the controller or pin 23 on the surface-mount version.
- Any other circuit without disk change pin on a convenient connector
  somewhere and no button dedicated to that function: Please check
  with the supplier of the board and read config.h in the sources
  to find out how to connect it.

To use this functionality, create a text file that lists the file
names of all disk images you want to swap between, one per line. The
file names are not parsed in any way, so you can include FAT paths of
the disk images if you use / instead of \. After that you can set up
the swap list by sending "XS:filename" over the command channel with
filename being the name of the image list you created (again,
unparsed).

After sending XS the first image in the list is automatically
mounted. To switch to the next image in the list, push the button. If
the new image was mounted successfully both LEDs will blink twice.
When you've reached the last image in the list pushing the button will
mount the first image again. All of this is completely compatible with
normal image mounting/unmounting, so you can unmount the disk image
any time you want and resume the mount cycle later by pushing the
button.

Due to the way this feature is implemented you are not limited to a
swap list containing just D64 images, M2I and even FAT directories
will work too.

If you press the button when no list has been set before or when the
previous list was cleared by sending XS the software will look for a
file called AUTOSWAP.LST in the current (FAT-)directory and use this
as the current swap list until you deactivate it or manually change
the directory (otherwise an AUTOSWAP.LST in the new directory would be
ignored until you send XS, killing the nice "it just works" feeling).

Please note: The extended swap list navigation and sleep mode
features introduced in 0.7 were backported to 0.6.6. Please check
the documentation of sd2iec 0.7 for details.

Other important notes:
======================
- File overwrite (@foo) is implemented by deleting the file first.
- File sizes in the directory are in blocks (of 254 bytes), but
  the blocks free message actually reports free clusters. It is
  a compromise of compatibility, accuracy and code size.
- If known, the low byte of the next line link pointer of the directory
  listing will be set to (filesize MOD 254)+2, so you can calculate the
  true size of the file if required. The 2 is added so it can never be
  mistaken for an end marker (0) or for the default value (1, used by at
  least the 1541 and 1571 disk drives).

Compilation notes:
==================
sd2iec is set up to be compiled in multiple configurations, controlled by
configuration files. By default the Makefile looks for a file named
'config', but you can override it by providing the name on the make
command line with "make CONFIG=filename". If you are using *BSD you
may have to edit the Makefile to use another awk implementation
instead of gawk - unfortunately WinAVR compatibility requires
using gawk in there.

An example configuration file named "config-example" is provided with
the source code, as well as abridged files corresponding to the
release binaries. If you want to compile sd2iec for a custom hardware
you may have to edit config.h too to change the port definitions.

-----------------------------------------------------------------------------

Original README from Ingo Korb

sd2iec - a controller/interface adapting SD/MMC to the CBM serial bus
Copyright (C) 2007,2008  Ingo Korb <ingo@akana.de>
Parts based on code from others, see comments in main.c for details.
JiffyDos send based on code by M.Kiesel
Fat LFN support and lots of other ideas by Jim Brain
crc7.c generated by pycrc, see comments in it for pycrc licence.

Free software under GPL version 2 ONLY, see comments in main.c and
COPYING for details.

FIXME:This file still needs to be expanded. A lot.

Introduction:
=============
sd2iec is a device for the Commodore serial bus that allows accessing an SD
or MMC card - think of it as a 1541 with a modern storage medium instead of
disks. The project was inspired by (and uses a few bits of code from)
MMC2IEC[1] by Lars Pontoppidan and runs on the same hardware.

Currently the compatibility is slightly higher than MMC2IEC 0.8, but there
are still lots of features missing. Anything that tries execute code on the
1541 will not work, this includes every software-fastloader.

[1] Homepage: http://pontoppidan.info/lars/index.php?proj=mmc2iec

Supported commands:
===================
- General notes:
  Any command not listed below is currently not supported.

- Directory filters:
  To show only directories, both =B (CMD-compatible) and =D can be used.
  On a real Commodore drive D matches everything.
  To include hidden files in the directory, use *=H - on a 1541 this doesn't
  do anything. sd2iec marks hidden files with an H after the lock mark,
  i.e. "PRG<H" or "PRG H".

- CD/MD/RD:
  Subdirectory access is compatible to the syntax used by the CMD drives,
  although drive/partition numbers are completely ignored.

  Quick syntax overview:
    CD:_         changes into the parent dir (_ is the left arrow on the C64)
    CD:foo       changes into foo
    CD/foo       dito
    CD//foo      changes into \foo
    CD/foo/:bar  changes into foo\bar
    CD/foo/bar   dito

  MD uses a syntax similiar to CD and will create the directory listed
  after the colon (:) relative to any directory listed before it.

    MD/foo/:bar  creates bar in foo
    MD//foo/:bar creates bar in \foo

  RD can only remove subdirectories of the current directory.

    RD:foo       deletes foo

  CD is also used to mount/unmount image files. Just change into them
  as if they were a directory and use CD:_ to leave. Please note that
  image files are detected by file extension only and there is no reliable
  way to see if a file is a valid image file.

- S:
  Name matching is fully supported, directories are ignored.

- U0
  Device address changing with "U0>"+chr$(new address) is supported,
  other U0 commands are currently not implemented.

- U1/U2/B-R/B-W
  Block reading and writing is fully supported while a D64 image is mounted.

- B-P
  Supported, not checked against the original rom at all.

- UI+/UI-
  Switching the slightly faster bus protocol for the VC20 on and off works,
  it hasn't been tested much though.

- UI/UJ
  Soft/Hard reset - UI just sets the "73,SD2IEC..." message on the
  error channel, UJ causes a restart of the AVR processor (skipping
  the bootloader if installed).

- X: Extended commands. If you use JiffyDOS, you can send them by using
  @"X..." - without quotes you'll just receive an error.

  - XJ+/XJ-  Set or reset the JiffyDOS protocol support flag. Default state
             is disabled for compatibility reasons. This flag can be saved
             in the EEPROM using XW.

  - XCnum    Set oscillator calibration value to num (must be between
             0 and 255). Default is whatever your chip defaults to. This
             value can be saved in the EEPROM using XW.

  - X        X without any following characters reports the current state
             of all extended parameters via the error channel, similiar
             to DolphinDOS. Example result: "03,J-:C152,08,00"
             The track indicates the current device address.

  - XS:name  Set up a swap list - see "Changing Disk Images" below.
    XS       Disable swap list

  - XW       Store configuration to EEPROM
             This commands stores the current configuration in the EEPROM.
             It will automatically be read when the AVR is reset, so
             any changes you made will persist even after turning off
             the hardware.

             The stored configuration includes the oscillator calibration
             value, the JiffyDOS protocol support flag and the current
             device address. If you have changed the device address by
             software, sd2iec will power up with that address unless you
             have changed the device address jumpers (if available) to
             a different setting than the one active at the time the
             configuration was saved. You can think of this feature as
             changing the meaning of one specific setting of the jumpers
             to a different address if this sounds logical enough to you.

             The "hardware overrides software overrides hardware" priority
             was chosen to allow accessing sd2iec even when it is soft-
             configured for a device number that is already taken by
             another device on the bus without having to remove that
             device to reconfigure sd2iec (e.g. when using a C128D).

 Currently the only things saved are the
             oscillator calibration, the JiffyDOS protocol support flag

- M-R, M-W, M-E
  Memory reading returns random data of the requested length. Memory writing
  knows about the address used for changing the device address on a 1541 and
  will change the address of sd2iec to the requested value. It will also
  check if the transmitted data corresponds to any of the known software
  fastloaders so the correct emulation code can be used when M-E is called.

- E-R, E-W
  Both commands work like M-R and M-W, but instead of reading/writing RAM
  they allow access to a user-area of the EEPROM. This area currently holds
  512 bytes and accesses beyond its end will result in a 32 SYNTAX ERROR.
  It is strongly recommended to work on a protocol for sharing this area
  between multiple applications that want to store their configuration in
  there, but that is beyond the scope of this project.

  As the contents of the EEPROM have to be copied to RAM before they can
  be sent to the computer it is not possible to read more data with a
  single command than the error message buffer (default size: 36 bytes)
  can hold. Similiarly, writing is restricted by the size of the command
  buffer (at least 42 bytes for compatibility, expected to be at least
  100 bytes in release versions).

  The user-area does not interfere with the stored configuration (XW) in
  any way.

Long File Names:
================
Long file names (i.e names not within the 8.3 limits) are supported on
FAT, but for compatibility reasons the 8.3 name is used if the long
name exceeds 16 characters. If you use anything but ASCII characters
on the PC or their PETSCII equivalents on the Commodore you may
get strange characters on the other system because the LFN use
unicode characters on disk, but sd2iec parses only the low byte
of each character in the name.

Software fastloaders:
=====================
There is currently support for one software fastloader in the code. It is
detected by the CRC of its 493 byte long floppy code and the M-E address
0x0303. I've seen the same code under multiple names, among them
"Turbodisk" (both 2.1 and 2.2) and "Fast-Load". Unfortunately the timing
requirements are extremely tight and cannot be met with the internal RC
oscillator of the AVR even if calibrated. You really need an external
8MHz crystal or the data read by the C64 will be gibberish.

The Final Cartridge III fastloader and fastsaver are both supported and
might work without a crystal. The fastloader used by programs freezed
with the "Fast Disk" option of FC3 is NOT supported.

The software fastloader used by the Action Replay 6 is disabled by
returning an unknown value when the cartridge tries to determine the
drive type.

JiffyDOS:
=========
The JiffyDOS protocol has very relaxed timing constraints compared to
Turbodisk, but still not as relaxed as the standard Commodore IEC protocol.
Jiffy seems to tolerate slightly mis-tuned RC oscillators, but you still
shouldn't expect it to work without oscillator calibration. If the
frequency error is too big you WILL get wrong data which usually manifests
as a FILE NOT FOUND error because the name the drive received was already
garbled.

M2I files:
==========
M2I files are fully supported. sd2iec supports SEQ and USR files in this
format in addition to PRG and DEL which were already implemented in MMC2IEC.
For compatibility reasons the file type is not checked when opening files.
Inside an M2I file the files are always shown as 0 (DEL) or 1 blocks
because calling stat for every file was slowing down the directory listing
too much.

Changing Disk Images
====================
Because some programs require more than one disk side there is support
for changing the currently mounted disk image with a button connected
to the disk change pin.

If your circuit doesn't have a disk change pin/button you might be able to
add it yourself:
- For the original MMC2IEC and the NKC MMC2IEC:
  Connect a button from PA4 to ground. PA4 is pin 36 on the DIL version
  of the controller or pin 33 on the surface-mount version.
- For Shadowolf's MMC2IEC 1.x PCBs:
  Connect a button from PC4 to ground. PC4 is pin 23 on the DIL version
  of the controller or pin 23 on the surface-mount version.
- Any other circuit without disk change pin on a convenient connector
  somewhere and no button dedicated to that function: Please check
  with the supplier of the board and read config.h in the sources
  to find out how to connect it.

To use this functionality, create a text file that lists the file
names of all disk images you want to swap between, one per line. The
file names are not parsed in any way, so you can include FAT paths of
the disk images if you use / instead of \. After that you can set up
the swap list by sending "XS:filename" over the command channel with
filename being the name of the image list you created (again,
unparsed).

After sending XS the first image in the list is automatically
mounted. To switch to the next image in the list, push the button. If
the new image was mounted successfully both LEDs will blink twice.
When you've reached the last image in the list pushing the button will
mount the first image again. All of this is completely compatible with
normal image mounting/unmounting, so you can unmount the disk image
any time you want and resume the mount cycle later by pushing the
button.

Due to the way this feature is implemented you are not limited to a
swap list containing just D64 images, M2I and even FAT directories
will work too.

If you press the button when no list has been set before or when the
previous list was cleared by sending XS the software will look for a
file called AUTOSWAP.LST in the current (FAT-)directory and use this
as the current swap list until you deactivate it or manually change
the directory (otherwise an AUTOSWAP.LST in the new directory would be
ignored until you send XS, killing the nice "it just works" feeling).

Please note: The extended swap list navigation and sleep mode
features introduced in 0.7 were backported to 0.6.6. Please check
the documentation of sd2iec 0.7 for details.

Other important notes:
======================
- File overwrite (@foo) is implemented by deleting the file first.
- File sizes in the directory are in blocks (of 254 bytes), but
  the blocks free message actually reports free clusters. It is
  a compromise of compatibility, accuracy and code size.
- If known, the low byte of the next line link pointer of the directory
  listing will be set to (filesize MOD 254)+2, so you can calculate the
  true size of the file if required. The 2 is added so it can never be
  mistaken for an end marker (0) or for the default value (1, used by at
  least the 1541 and 1571 disk drives).

Compilation notes:
==================
sd2iec is set up to be compiled in multiple configurations, controlled by
configuration files. By default the Makefile looks for a file named
'config', but you can override it by providing the name on the make
command line with "make CONFIG=filename". If you are using *BSD you
may have to edit the Makefile to use another awk implementation
instead of gawk - unfortunately WinAVR compatibility requires
using gawk in there.

An example configuration file named "config-example" is provided with
the source code, as well as abridged files corresponding to the
release binaries. If you want to compile sd2iec for a custom hardware
you may have to edit config.h too to change the port definitions.
