]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
ALG Platoon and Space Pirates ROM descrambling. Implemented LD drive command that...
authorToni Wilen <twilen@winuae.net>
Thu, 11 Mar 2021 16:18:16 +0000 (18:18 +0200)
committerToni Wilen <twilen@winuae.net>
Thu, 11 Mar 2021 16:18:16 +0000 (18:18 +0200)
arcadia.cpp
rommgr.cpp

index 42387735cdd7d8b4b7def37ed200e5a3b4c6c02c..f72025289e885b0db06e298fbc63d8588d7691ae 100644 (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) {
index 78383d06f1838c904776dcf004b998050ee74980..b4aa84cfd94745bb8b168155ccea46bc4885a53c 100644 (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) {