ALG Platoon and Space Pirates ROM descrambling. Implemented LD drive command that Platoon requires.

This commit is contained in:
Toni Wilen 2021-03-11 18:18:16 +02:00
parent 2a9ab35d6c
commit 91146b8d47
2 changed files with 34 additions and 0 deletions

View File

@ -828,6 +828,14 @@ static void sony_serial_read(uae_u16 w)
if (log_ld)
write_log(_T("LD: INDEX OFF\n"));
break;
case 0x56: // CL
ld_mode = LD_MODE_STILL;
ld_direction = 0;
pausevideograb(1);
ack();
if (log_ld)
write_log(_T("LD: CL\n"));
break;
case 0x60: // ADDR INQ '`'
{
if (isvideograb() && ld_direction == 0) {

View File

@ -1916,6 +1916,32 @@ struct zfile *read_rom (struct romdata *prd)
if (!ok)
byteswap(buf, size);
}
if (ok) {
if (rd->id == 197) {
// ALG Platoon
uae_u8 *tmp = xmalloc(uae_u8, size);
if (tmp) {
memcpy(tmp, buf, size);
static const int platoon[] = { 0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15,16,24,20,28,18,26,22,30,17,25,21,29,19,27,23,31 };
for (int i = 0; i < 32; i++) {
memcpy(buf + i * 0x2000, tmp + platoon[i] * 0x2000, 0x2000);
}
xfree(tmp);
}
} else if (rd->id == 182 || rd->id == 183) {
// ALG Space Pirates
uae_u8 *tmp = xmalloc(uae_u8, size);
if (tmp) {
memcpy(tmp, buf, size);
static const int sp[] = { 33,32,34,35,49,48,50,51,45,44,46,47,61,60,62,63,37,36,38,39,53,52,54,55,41,40,42,43,57,56,58,59,
33,32,34,35,49,48,50,51,45,44,46,47,61,60,62,63,37,36,38,39,53,52,54,55,41,40,42,43,57,56,58,59 };
for (int i = 0; i < 64; i++) {
memcpy(buf + i * 0x1000, tmp + sp[i] * 0x1000, 0x1000);
}
xfree(tmp);
}
}
}
if (ok) {
struct zfile *zf = zfile_fopen_empty (NULL, name, size);
if (zf) {