Previous 199869 Revisions Next

r21048 Wednesday 13th February, 2013 at 21:48:06 UTC by Angelo Salese
Hooked up my theory for some other games, it's mostly right except it needs a decrypter expert (that isn't me ...)
[src/emu/video]stvvdp2.c
[src/mame/machine]stvprot.c

trunk/src/emu/video/stvvdp2.c
r21047r21048
57345734
57355735      if ( window_control )
57365736      {
5737         popmessage("Window control for RBG");
5737         //popmessage("Window control for RBG");
57385738         stv2_current_tilemap.window_control = window_control;
57395739         stv_vdp2_apply_window_on_layer(mycliprect);
57405740      }
trunk/src/mame/machine/stvprot.c
r21047r21048
120120   {
121121      if(offset == 3)
122122      {
123         UINT32 res;
123124         logerror("A-Bus control protection read at %06x with data = %08x\n",space.device().safe_pc(),a_bus[3]);
124125         #ifdef MAME_DEBUG
125126         popmessage("Prot read at %06x with data = %08x",space.device().safe_pc(),a_bus[3]);
126127         #endif
127         switch(a_bus[3])
128         switch(a_bus[3] >> 16)
128129         {
130            case 0x1212:
131               if(ctrl_index & 2)
132               {
133                  res = (ROM[ctrl_index / 4] & 0xffff) << 16;
134                  res |= (ROM[(ctrl_index+4) / 4] & 0xffff0000) >> 16;
135               }
136               else
137               {
138                  res = ROM[ctrl_index / 4] & 0xffff0000;
139                  res |= ROM[ctrl_index / 4] & 0xffff;
140               }
141               ctrl_index+=4;
142               return res;
129143         }
130144      }
131145      return a_bus[offset];
r21047r21048
143157   logerror("A-Bus control protection write at %06x: [%02x] <- %08x\n",space.device().safe_pc(),offset,data);
144158   if(offset == 3)
145159   {
146      logerror("MAIN : %08x  DATA : %08x\n",a_bus[3],a_bus[2]);
160      int a_bus_vector;
147161
162      a_bus_vector = a_bus[2] >> 16;
163      a_bus_vector|= (a_bus[2] & 0xffff) << 16;
164      a_bus_vector<<= 1;
165
148166      //MAIN : 12120000  DATA : 0ad20069 Tecmo logo
149      if(a_bus[3] == 0x12120000 && a_bus[2] == 0x0ad20069)
150      {
151         // ...
152      }
153167      //MAIN : 12120000  DATA : e332006b title screen
154      if(a_bus[3] == 0x12120000 && a_bus[2] == 0xe332006b)
168
169      /* TODO: encrypted / compressed data.
170         Both points to a section that has a string ("TECMO" / "TITLE") */
171
172      //printf("MAIN : %08x  DATA : %08x %08x\n",a_bus[3],a_bus[2],a_bus_vector);
173
174      switch(a_bus[3] >> 16)
155175      {
156         // ...
176         case 0x1212:
177            ctrl_index = a_bus_vector;
178            break;
157179      }
158180   }
159181   //popmessage("%04x %04x",data,offset/4);
r21047r21048
316338   logerror("A-Bus control protection write at %06x: [%02x] <- %08x\n",space.device().safe_pc(),offset,data);
317339   if(offset == 3)
318340   {
319      //logerror("MAIN : %08x  DATA : %08x\n",a_bus[3],a_bus[2]);
341//      int a_bus_vector;
342
343//      a_bus_vector = a_bus[2] >> 16;
344//      a_bus_vector|= (a_bus[2] & 0xffff) << 16;
345//      a_bus_vector<<= 1;
346//      printf("MAIN : %08x  DATA : %08x %08x\n",a_bus[3],a_bus[2],a_bus_vector);
320347      switch(a_bus[3])
321348      {
322349         case 0x77770000: ctrl_index = 0; break;
r21047r21048
336363*
337364*************************/
338365
339#define ELANDORE_CTRL_1_HUMAN   0xff7f0000
340#define ELANDORE_CTRL_2_HUMAN   0xffbf0000
341
342#define ELANDORE_CTRL_1_DRAGON  0xf9ff0000
343#define ELANDORE_CTRL_2_DRAGON  0xfbff0000
344#define ELANDORE_CTRL_3_DRAGON  0xfe7f0000
345#define ELANDORE_CTRL_4_DRAGON  0xfd7f0000
346#define ELANDORE_CTRL_5_DRAGON  0xfeff0000
347#define ELANDORE_CTRL_6_DRAGON  0xf9bf0000
348
349366static READ32_HANDLER( elandore_prot_r )
350367{
351368   UINT32 *ROM = (UINT32 *)space.machine().root_device().memregion("abus")->base();
r21047r21048
354371   {
355372      if(offset == 3)
356373      {
374         UINT32 res;
357375         logerror("A-Bus control protection read at %06x with data = %08x\n",space.device().safe_pc(),a_bus[3]);
358376         #ifdef MAME_DEBUG
359377         popmessage("Prot read at %06x with data = %08x",space.device().safe_pc(),a_bus[3]);
360378         #endif
361         switch(a_bus[3])
379         switch(a_bus[3] >> 16)
362380         {
363            case ELANDORE_CTRL_1_HUMAN:
364            case ELANDORE_CTRL_2_HUMAN:
365            case ELANDORE_CTRL_1_DRAGON:
366            case ELANDORE_CTRL_2_DRAGON:
367            case ELANDORE_CTRL_3_DRAGON:
368            case ELANDORE_CTRL_4_DRAGON:
369            case ELANDORE_CTRL_5_DRAGON:
370            case ELANDORE_CTRL_6_DRAGON:
371               //ctrl_index++;
372               return ROM[ctrl_index];
381            default:
382               if(ctrl_index & 2)
383               {
384                  res = (ROM[ctrl_index / 4] & 0xffff) << 16;
385                  res |= (ROM[(ctrl_index+4) / 4] & 0xffff0000) >> 16;
386               }
387               else
388               {
389                  res = ROM[ctrl_index / 4] & 0xffff0000;
390                  res |= ROM[ctrl_index / 4] & 0xffff;
391               }
392               ctrl_index+=4;
393               return res;
373394         }
374395      }
375396      return a_bus[offset];
r21047r21048
387408   logerror("A-Bus control protection write at %06x: [%02x] <- %08x\n",space.device().safe_pc(),offset,data);
388409   if(offset == 3)
389410   {
390      /* a bus value 2 seed is used too here. */
391      //logerror("MAIN : %08x  DATA : %08x\n",a_bus[3],a_bus[2]);
392      switch(a_bus[3])
411      int a_bus_vector;
412
413      a_bus_vector = a_bus[2] >> 16;
414      a_bus_vector|= (a_bus[2] & 0xffff) << 16;
415      a_bus_vector<<= 1;
416
417      //printf("MAIN : %08x  DATA : %08x %08x\n",a_bus[3],a_bus[2],a_bus_vector);
418      switch(a_bus[3] >> 16)
393419      {
394         case ELANDORE_CTRL_1_HUMAN: // (human polygons)
395            ctrl_index = ((0x0000000/4) + ((a_bus[2] & 0xff)<<12) + ((a_bus[2] & 0x0fff0000)>>16)/4);
420         default:
421            ctrl_index = a_bus_vector;
396422            break;
397         case ELANDORE_CTRL_2_HUMAN: // (human polygons)
398            ctrl_index = ((0x0000000/4) + ((a_bus[2] & 0xff)<<12) + ((a_bus[2] & 0x0fff0000)>>16)/4);
399            break;
400         case ELANDORE_CTRL_1_DRAGON://KAIN / THUNDER (dragon polygons)
401            ctrl_index = ((0x0000000/4) + ((a_bus[2] & 0xff)<<12) + ((a_bus[2] & 0x0fff0000)>>16)/4);
402            break;
403         case ELANDORE_CTRL_2_DRAGON://REVI CURIO / DARK (dragon polygons)
404            ctrl_index = ((0x0000000/4) + ((a_bus[2] & 0xff)<<12) + ((a_bus[2] & 0x0fff0000)>>16)/4);
405            break;
406         case ELANDORE_CTRL_3_DRAGON://RUBONE / POISON (dragon polygons)
407            ctrl_index = ((0x0000000/4) + ((a_bus[2] & 0xff)<<12) + ((a_bus[2] & 0x0fff0000)>>16)/4);
408            break;
409         case ELANDORE_CTRL_4_DRAGON://TINA / MAGICAL GIRL (dragon polygons)
410            ctrl_index = ((0x0000000/4) + ((a_bus[2] & 0xff)<<12) + ((a_bus[2] & 0x0fff0000)>>16)/4);
411            break;
412         case ELANDORE_CTRL_5_DRAGON://KEYAKI / FIRE (dragon polygons)
413            ctrl_index = ((0x0000000/4) + ((a_bus[2] & 0xff)<<12) + ((a_bus[2] & 0x0fff0000)>>16)/4);
414            break;
415         case ELANDORE_CTRL_6_DRAGON://SION / WIND (dragon polygons)
416            ctrl_index = ((0x0000000/4) + ((a_bus[2] & 0xff)<<12) + ((a_bus[2] & 0x0fff0000)>>16)/4);
417            break;
418423      }
419424   }
420425   //popmessage("%04x %04x",data,offset/4);
r21047r21048
439444
440445Directory listing for Final Fight Revenge (Saturn Version):
441446
442Most of these file names could be found at relative address 0x346a0 (0x22346a0)
447In the ST-V version, most of these file names could be found at relative address 0x346a0 (0x22346a0)
448Also, there's a table at 0x260000 (0x2260000), this points to offsets to the ROM (and are sent to the protection device),
449and the size of it
443450
444451fad      size     file name   date
445452000000aa 00003000  2000/2/8
r21047r21048
68969600002207 0001efc0 _WHSRCHR.BIN;1 1999/11/9
69069700002203 00001cf4 _WHSRMAP.BIN;1 1999/11/9
691698*/
692static const UINT32 vector_prot[] = { 0x0603B1B2,0x234 };
693699
694
695700static READ32_HANDLER( ffreveng_prot_r )
696701{
697702   UINT32 *ROM = (UINT32 *)space.machine().root_device().memregion("abus")->base();
r21047r21048
700705   {
701706      if(offset == 3)
702707      {
708         #if 0
709         UINT32 res;
710         #endif
703711         logerror("A-Bus control protection read at %06x with data = %08x\n",space.device().safe_pc(),a_bus[3]);
704         #ifdef MAME_DEBUG
705         popmessage("Prot read at %06x with data = %08x",space.device().safe_pc(),a_bus[3]);
706         #endif
707         switch(a_bus[3])
712         switch(a_bus[3] >> 16)
708713         {
709            case 0x10da0000://ffreveng, boot vectors at $6080000,test mode
710               ctrl_index++;
711               if(ctrl_index > 2)
712                  return 0x234;
714            case 0x10da://ffreveng, boot vectors at $6080000,test mode
715            case 0x10d7://ffreveng, boot vectors at $6080000,attract mode
716               #if 0
717               if(ctrl_index & 2)
718               {
719                  res = (ROM[ctrl_index / 4] & 0xffff) << 16;
720                  res |= (ROM[(ctrl_index+4) / 4] & 0xffff0000) >> 16;
721               }
713722               else
714                  return vector_prot[ctrl_index-1];
715            case 0x10d70000://ffreveng, boot vectors at $6080000,attract mode
716               ctrl_index++;
717               return ROM[ctrl_index];
723               {
724                  res = ROM[ctrl_index / 4] & 0xffff0000;
725                  res |= ROM[ctrl_index / 4] & 0xffff;
726               }
727               #endif
728               ctrl_index+=4;
729               return 0;
718730         }
719731      }
720732      return a_bus[offset];
r21047r21048
732744   logerror("A-Bus control protection write at %06x: [%02x] <- %08x\n",space.device().safe_pc(),offset,data);
733745   if(offset == 3)
734746   {
735      //logerror("MAIN : %08x  DATA : %08x\n",a_bus[3],a_bus[2]);
736      switch(a_bus[3])
747      int a_bus_vector;
748
749      a_bus_vector = a_bus[2] >> 16;
750      a_bus_vector|= (a_bus[2] & 0xffff) << 16;
751      a_bus_vector<<= 1;
752
753      printf("MAIN : %08x  DATA : %08x %08x\n",a_bus[3],a_bus[2],a_bus_vector);
754      switch(a_bus[3] >> 16)
737755      {
738         /*ffreveng*/
739         case 0x10d70000: ctrl_index = 0; break;
740         case 0x10da0000: ctrl_index = 0; break;
756         case 0x10d7: ctrl_index = a_bus_vector; break;
757         case 0x10da: ctrl_index = a_bus_vector; break;
758         default:
759            ctrl_index = 0;
741760      }
742761   }
743762   //popmessage("%04x %04x",data,offset/4);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team