home *** CD-ROM | disk | FTP | other *** search
/ Commodore Free 9 / Commodore_Free_Issue_09_2007_Commodore_Computer_Club.d64 / t.mmc2iec < prev    next >
Text File  |  2023-02-26  |  5KB  |  168 lines

  1. u       Commodore MMC2IEC DEVICE
  2.  
  3. The MMC2IEC device It has always been
  4. tricky to transfer data between a PC
  5. and a Commodore 64. As the old machine
  6. lacks any even remotely modern
  7. interfaces, tricks of some sort are
  8. always required to do the transfer.
  9. The MMC2IEC device can be seen as yet
  10. another one of these tricks, but it
  11. does so much more.
  12.  
  13. Description The MMC2IEC device tries
  14. to simulate a 1541 disk drive
  15. connected to the C64 using the IEC bus
  16. and accessing data from a SD/MMC flash
  17. memory card. The MMC2IEC is both
  18. greatly limited and greatly extended
  19. in features when comparing to the
  20. original 1541:
  21.  
  22. Features: Supports C64 kernel LOAD and
  23. SAVE functions. Supports wildcards.
  24. Supports all? SD and MMC cards. Up to
  25. 1 GB tested. Thorough FAT16 and FAT32
  26. support. Directory listing and
  27. changing supported through LOAD
  28. commands. PRG file load and save. D64
  29. image readonly support. LOAD"$"
  30. produces a realistic listing when a
  31. D64 image is active. T64 image
  32. readonly support. LOAD"$" produces a
  33. tape contents listing.
  34.  
  35. Limitations: No fast loader support.
  36. None of the Commodore DOS functions
  37. beside LOAD and SAVE works. Few, if
  38. any, D64 games with loaders work. No
  39. long filenames. SD card write protect
  40. switch not (yet) implemented...
  41.  
  42. Background and credits The idea of
  43. transferring data to the C64 from a
  44. flash media was conceived long ago as
  45. I did an university project. In
  46. cooperation with other students we
  47. created a data logger interfacing a
  48. SD-card using an AVR. The SD-card data
  49. access and FAT driver modules were
  50. created back then and they were
  51. thoroughly tested. The FAT driver is
  52. not completely my own invention, it is
  53. a partial rewrite of work done by
  54. Angelo Bannack and Giordano Bruno
  55. Wolaniuk who used work done by Pascal
  56. Stang. See fat.c for details.
  57.  
  58. At some point I discovered Jan
  59. Derogee's 1541-III device which was a
  60. major inspiration. Before that I
  61. considered creating a C64 datasette
  62. simulator, but the 1541-III made me
  63. realise that it was possible to
  64. simulate a 1541.
  65.  
  66. The MMC2IEC project thus started as an
  67. attempt to port Derogee's 1541-III
  68. from PIC to the Atmel AVR architecture
  69. such that I could combine it with my
  70. FAT and SD-card modules. Soon enough I
  71. gave up the porting and implemented
  72. the IEC and 1541simulation from
  73. scratch, but it would have been
  74. impossible without referring to
  75. Derogee's project all the time.
  76.  
  77. At a later point I realised that the
  78. MMC2IEC was perfectly suited for
  79. embedding in a C64-DTV mod. And so far
  80. I have only tested the MMC2IEC on a
  81. DTV in conjunction with my Wooden DTV
  82. mod. This project is open source under
  83. the GPL license.
  84.  
  85. Usage guide The MMC2IEC device
  86. implements accessing FAT16/32
  87. filesystems on MMC or SD flash media.
  88. The CBM IEC protocol is implemented
  89. and the kernel load and save routines
  90. on the C64 works, loading from either
  91. PRG, D64 or T64 files, and  saving
  92. only to PRG type files in FAT.
  93. Selecting directories and images is
  94. possible through LOAD"xxx" commands
  95. issued on the CBM.
  96.  
  97. This is a quick overview of the
  98. commands,
  99. say MMC2IEC is IEC device 8:
  100. Read < as the petscii back-arrow.
  101.  
  102. LOAD"<<",8 Reset SD card state. Do
  103. this if the SD card is exchanged. In
  104. FAT mode: (the default mode)
  105.  
  106. LOAD"$",8 Gets directory listing,
  107. equivalent to LOAD".",8
  108.  
  109. LOAD"gamesdir",8 Enter the "gamesdir"
  110. directory, and get listing.
  111.  
  112. LOAD"..",8 Up one directory and get
  113. directory listing.
  114.  
  115. LOAD"tetris.prg",8 Loads the
  116. "tetris.prg" program file.
  117.  
  118. SAVE"example.prg",8 Save into
  119. "example.prg" which is a FAT file.
  120.  
  121. LOAD"disk.d64",8 Loads the disk.d64
  122. image and enters D64 mode.
  123.  
  124. LOAD"tape.t64",8 Loads the tape.t64
  125. image and enters T64 mode.
  126.  
  127. In D64 mode:
  128. Load "$", "*", wildcards, filenames
  129. works (almost) as espected on a 1541.
  130.  
  131. LOAD"<",8 (back-arrow). Escape D64
  132. mode, and back to FAT mode.
  133.  
  134. SAVE"abc",8 Fools the CBM, but
  135. has no effect. Saves in D64 are not
  136. implemented
  137.  
  138. In T64 mode:
  139. Load "$", "*", wildcards, filenames
  140. works as if it was a D64.
  141.  
  142. LOAD"<",8 (back-arrow). Escape T64
  143. mode, and back to FAT mode.
  144. SAVE"abc",8  Fools the CBM, but has no
  145. effect.
  146.  
  147. Make your own MMC2IEC? Releasing all
  148. this detailed information about my
  149. MMC2IEC device is also to encourage
  150. people to make their own devices. I
  151. would be happy if others benefit from
  152. my work on the MMC2IEC project. All I
  153. require is that proper credits are
  154. given. If you build a MMC2IEC device
  155. or just use some of the code modules,
  156. please email me with your experiences.
  157. I would also like to know if you
  158. improve the code. Happy Hacking!
  159.  
  160. By Lars Pontoppidan Feb 2007
  161. http://pontoppidan.info/lars/index.php
  162. ?proj=mmc2iec
  163.  
  164.  
  165. ...end...
  166. www.commodorefree.com
  167.  
  168.  
  169.