Copy Link
Add to Bookmark
Report

Super Magic Drive file format information

Dreamcast's profile picture
Published in 
MegaDrive
 · 18 Nov 2018

Super Magic Drive file format information
by Charles MacDonald
WWW: http://cgfm2.emuviews.com

Introduction
I've verified all of this information on a real SMD, though I'll say the usual and warn that using any of this is at your own risk. :)

1.) 68000 program files
Files generated by the copier are either single files as large as the floppy disk being used (720K to 1.6MB supported), or split files in units of 512k.

Most SMD utilities will merge split files into single files larger than a single disk. These can still be used by the SMD by splitting them again or sending them through the parallel port.

The files consist of a 512-byte header, and then several 16k blocks of interlaved 68000 program data. Each block is comprised of an 8K section of all the even bytes, and then an 8K section of all the odd bytes.

Here is some "C" pseudocode for a function to convert a single block to a raw binary format.

 
void smd2bin(char *inblk, char *outblk)
{
for(int n = 0; n < 0x2000; n += 1) {
outblk[(n * 2 + 0)] = inblk[(0x0000 + n)];
outblk[(n * 2 + 1)] = inblk[(0x2000 + n)];
}
}


The SMD does not assign an extension to single format files, though by tradition people give the '.SMD' extension. Split files range from '.1' to '.8'. The last file in a split set has byte 02h of the header set to 00h, while other files have the same byte set to 40h.

Header format:

 
Byte 00h : Size of file in 16K blocks.
Byte 01h : 03h
Byte 02h : Split file indicator (00h=single or last file, 40h=split file)
Byte 08h : AAh
Byte 09h : BBh
Byte 0Ah : 06h


The remainder of the header should be set to zero.

2.) Z80 program files
The SMD can accept Z80 programs, which are executed by the machine in the Mark-III compatability mode. For some reason, these files only work when loaded via floppy, as opposed to the parallel port. This could be a limitation of the SMD's firmware or an issue with the transfer utility, which may only expect to send 68000 programs.

The files consist of a 512-byte header, and then the raw Z80 program data.

Header format:

 
Byte 00h : Size of file in 16K blocks.
Byte 01h : 02h


The remainder of the header should be set to zero.

3.) Save RAM files
Cartridge games can store data in battery-backed RAM or EEPROM. Battery backed RAM is 8-bits wide, and can be wired to even or odd addresses.

The SMD handles this by having a 32k SRAM chip wired to both addresses, which gives 16k of usable memory. The SMD does not support EEPROM for storing data.

The files consist of a 512-byte header, and then a 32k image of the raw battery-backed RAM data.

Header format:

 
Byte 00h : 00h
Byte 01h : 00h
Byte 08h : AAh
Byte 09h : BBh
Byte 0Ah : 07h


The remainder of the header should be set to zero.

4.) Acknowledgments
Thanks go to Bart Trzynadlowski for information on the SMD format.

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT