home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Free 9
/
Commodore_Free_Issue_09_2007_Commodore_Computer_Club.d64
/
t.mmc2iec
< prev
next >
Wrap
Text File
|
2023-02-26
|
5KB
|
168 lines
u Commodore MMC2IEC DEVICE
The MMC2IEC device It has always been
tricky to transfer data between a PC
and a Commodore 64. As the old machine
lacks any even remotely modern
interfaces, tricks of some sort are
always required to do the transfer.
The MMC2IEC device can be seen as yet
another one of these tricks, but it
does so much more.
Description The MMC2IEC device tries
to simulate a 1541 disk drive
connected to the C64 using the IEC bus
and accessing data from a SD/MMC flash
memory card. The MMC2IEC is both
greatly limited and greatly extended
in features when comparing to the
original 1541:
Features: Supports C64 kernel LOAD and
SAVE functions. Supports wildcards.
Supports all? SD and MMC cards. Up to
1 GB tested. Thorough FAT16 and FAT32
support. Directory listing and
changing supported through LOAD
commands. PRG file load and save. D64
image readonly support. LOAD"$"
produces a realistic listing when a
D64 image is active. T64 image
readonly support. LOAD"$" produces a
tape contents listing.
Limitations: No fast loader support.
None of the Commodore DOS functions
beside LOAD and SAVE works. Few, if
any, D64 games with loaders work. No
long filenames. SD card write protect
switch not (yet) implemented...
Background and credits The idea of
transferring data to the C64 from a
flash media was conceived long ago as
I did an university project. In
cooperation with other students we
created a data logger interfacing a
SD-card using an AVR. The SD-card data
access and FAT driver modules were
created back then and they were
thoroughly tested. The FAT driver is
not completely my own invention, it is
a partial rewrite of work done by
Angelo Bannack and Giordano Bruno
Wolaniuk who used work done by Pascal
Stang. See fat.c for details.
At some point I discovered Jan
Derogee's 1541-III device which was a
major inspiration. Before that I
considered creating a C64 datasette
simulator, but the 1541-III made me
realise that it was possible to
simulate a 1541.
The MMC2IEC project thus started as an
attempt to port Derogee's 1541-III
from PIC to the Atmel AVR architecture
such that I could combine it with my
FAT and SD-card modules. Soon enough I
gave up the porting and implemented
the IEC and 1541simulation from
scratch, but it would have been
impossible without referring to
Derogee's project all the time.
At a later point I realised that the
MMC2IEC was perfectly suited for
embedding in a C64-DTV mod. And so far
I have only tested the MMC2IEC on a
DTV in conjunction with my Wooden DTV
mod. This project is open source under
the GPL license.
Usage guide The MMC2IEC device
implements accessing FAT16/32
filesystems on MMC or SD flash media.
The CBM IEC protocol is implemented
and the kernel load and save routines
on the C64 works, loading from either
PRG, D64 or T64 files, and saving
only to PRG type files in FAT.
Selecting directories and images is
possible through LOAD"xxx" commands
issued on the CBM.
This is a quick overview of the
commands,
say MMC2IEC is IEC device 8:
Read < as the petscii back-arrow.
LOAD"<<",8 Reset SD card state. Do
this if the SD card is exchanged. In
FAT mode: (the default mode)
LOAD"$",8 Gets directory listing,
equivalent to LOAD".",8
LOAD"gamesdir",8 Enter the "gamesdir"
directory, and get listing.
LOAD"..",8 Up one directory and get
directory listing.
LOAD"tetris.prg",8 Loads the
"tetris.prg" program file.
SAVE"example.prg",8 Save into
"example.prg" which is a FAT file.
LOAD"disk.d64",8 Loads the disk.d64
image and enters D64 mode.
LOAD"tape.t64",8 Loads the tape.t64
image and enters T64 mode.
In D64 mode:
Load "$", "*", wildcards, filenames
works (almost) as espected on a 1541.
LOAD"<",8 (back-arrow). Escape D64
mode, and back to FAT mode.
SAVE"abc",8 Fools the CBM, but
has no effect. Saves in D64 are not
implemented
In T64 mode:
Load "$", "*", wildcards, filenames
works as if it was a D64.
LOAD"<",8 (back-arrow). Escape T64
mode, and back to FAT mode.
SAVE"abc",8 Fools the CBM, but has no
effect.
Make your own MMC2IEC? Releasing all
this detailed information about my
MMC2IEC device is also to encourage
people to make their own devices. I
would be happy if others benefit from
my work on the MMC2IEC project. All I
require is that proper credits are
given. If you build a MMC2IEC device
or just use some of the code modules,
please email me with your experiences.
I would also like to know if you
improve the code. Happy Hacking!
By Lars Pontoppidan Feb 2007
http://pontoppidan.info/lars/index.php
?proj=mmc2iec
...end...
www.commodorefree.com