First post, by anetanel
I backed up an old kids software floppy that uses Eliashim's CodeSafe protection, with Kryoflux, and converted the image to a PSI file.
These are the commands that I used:
pfi /Users/netanel/Documents/Floppies/ktavkat/track00.0.raw ktavkat.pfi
pfi ktavkat.pfi -p decode pri ktavkat.pri
pri ktavkat.pri -p decode mfm ktavkat.psi
I'm able to load the PSI file in PCE, but when running the executable (k.exe), it seems that the floppy controller is sent an illegal command and errors.
The error message in the emulator console is:
E8272: CMD=71 D=? INVALID
in the emulator window, the copy protection displays an error "Floppy Disk Controller Failure", and any further access to the floppy hangs the emulator, and repeating error messages appear in console:
0000:2F2C: undefined operation [C8 a5]
0000:2F2E: undefined operation [C8 a5]
0000:2F30: undefined operation [C8 a5]
0000:2FCD: undefined operation [66 02]
0000:2FD4: undefined operation [67 03]
I had success loading another copy protected floppy image (Loom) in PCE, so I know that my method should work.
I'm also able to write the flux backup back to an empty floppy, and it works on a real 386 machine. So the backup is file too.
Digging a bit in the emulator code, it seems that whatever CMD=71 is, it is not implemented in the floppy controller emulator.
(e8727.c)
static
void cmd_invalid (e8272_t *fdc)
{
#if E8272_DEBUG >= 0
fprintf (stderr, "E8272: CMD=%02X D=? INVALID\n", fdc->cmd[0]);
#endif
fdc->res[0] = 0x80;
cmd_result (fdc, 1);
}
static struct {
unsigned char mask;
unsigned char val;
unsigned cnt;
void (*start_cmd) (e8272_t *fdc);
} cmd_tab[] = {
{ 0x1f, 0x06, 9, cmd_read },
{ 0x1f, 0x0c, 9, cmd_read_deleted },
{ 0x1f, 0x02, 9, cmd_read_track },
{ 0x3f, 0x0a, 2, cmd_read_id },
{ 0x3f, 0x05, 9, cmd_write },
{ 0x3f, 0x0d, 6, cmd_format },
{ 0xff, 0x07, 2, cmd_recalibrate },
{ 0xff, 0x0f, 3, cmd_seek },
{ 0xff, 0x08, 1, cmd_sense_int_status },
{ 0xff, 0x04, 2, cmd_sense_drive_status },
{ 0xff, 0x03, 3, cmd_specify },
{ 0x00, 0x00, 1, cmd_invalid }
};
I was not able to find (yet) what 71 is. My C skills are very rudimentary, and I'm not sure even if this is 71 in decimal or hex...
I've attached the PSI file, for anyone to take a shot at it.
Any help is appreciated!