Previous 199869 Revisions Next

r21045 Wednesday 13th February, 2013 at 20:46:11 UTC by Angelo Salese
Improved protection in Steep Slope Sliders [Angelo Salese]
[src/mame/machine]stvprot.c

trunk/src/mame/machine/stvprot.c
r21044r21045
178178   {
179179      if(offset == 3)
180180      {
181         UINT32 res;
182
181183         logerror("A-Bus control protection read at %06x with data = %08x\n",space.device().safe_pc(),a_bus[3]);
182184         #ifdef MAME_DEBUG
183185         popmessage("Prot read at %06x with data = %08x",space.device().safe_pc(),a_bus[3]);
184186         #endif
185         switch(a_bus[3])
187         switch(a_bus[3]>>16)
186188         {
187            case 0x2c5b0000://sss
188            case 0x47f10000:
189            case 0xfcda0000:
190            case 0xb5e60000:
191            case 0x392c0000:
192            case 0x77c30000:
193            case 0x8a620000:
194               ctrl_index++;
195               return ROM[ctrl_index];
189            case 0x2c5b:
190            case 0x47f1:
191            case 0xfcda:
192            case 0xb5e6:
193            case 0x392c:
194            case 0x77c3:
195            case 0x8a62:
196               if(ctrl_index & 2)
197               {
198                  res = (ROM[ctrl_index / 4] & 0xffff) << 16;
199                  res |= (ROM[(ctrl_index+4) / 4] & 0xffff0000) >> 16;
200               }
201               else
202               {
203                  res = ROM[ctrl_index / 4] & 0xffff0000;
204                  res |= ROM[ctrl_index / 4] & 0xffff;
205               }
206               ctrl_index+=4;
207               return res;
196208         }
197209      }
198210      return a_bus[offset];
r21044r21045
210222   logerror("A-Bus control protection write at %06x: [%02x] <- %08x\n",space.device().safe_pc(),offset,data);
211223   if(offset == 3)
212224   {
213      //logerror("MAIN : %08x  DATA : %08x\n",a_bus[3],a_bus[2]);
214      switch(a_bus[3])
225      int a_bus_vector;
226
227      a_bus_vector = a_bus[2] >> 16;
228      a_bus_vector|= (a_bus[2] & 0xffff) << 16;
229      a_bus_vector<<= 1;
230
231      /*
232MAIN : 2c5b0000  DATA : 000000a6 014c0000
233MAIN : 47f10000  DATA : 0f9800a6 014c1f30
234MAIN : fcda0000  DATA : 1d4800a6 014c3a90
235MAIN : b5e60000  DATA : 29e300a6 014c53c6
236MAIN : 392c0000  DATA : 38e900a6 014c71d2
237MAIN : 77c30000  DATA : 462500a6 014c8c4a
238MAIN : 8a620000  DATA : 555c00a6 014caab8
239      */
240
241//      printf("MAIN : %08x  DATA : %08x %08x\n",a_bus[3],a_bus[2],a_bus_vector);
242      switch(a_bus[3] >> 16)
215243      {
216         case 0x2c5b0000: ctrl_index = (0x145ffac/4)-1; break;
217         case 0x47f10000: ctrl_index = ((0x145ffac+0xbaf0)/4)-1; break;
218         case 0xfcda0000: ctrl_index = ((0x145ffac+0x12fd0)/4)-1; break;
219         case 0xb5e60000: ctrl_index = ((0x145ffac+0x1a4c4)/4)-1; break;
220         case 0x392c0000: ctrl_index = ((0x145ffac+0x219b0)/4)-1; break;
221         case 0x77c30000: ctrl_index = ((0x145ffac+0x28ea0)/4)-1; break;
222         case 0x8a620000: ctrl_index = ((0x145ffac+0x30380)/4)-1; break;
244         /* Note: only the first value is TRUSTED (because it's tested in the code).
245            Others are hand-tuned by checking if there isn't any garbage during display. */
246         case 0x2c5b: ctrl_index = (a_bus_vector-0x60054); break;
247         case 0x47f1: ctrl_index = (a_bus_vector-0x56498); break;
248         case 0xfcda: ctrl_index = (a_bus_vector-0x50b0c); break;
249         case 0xb5e6: ctrl_index = (a_bus_vector-0x4af56); break;
250         case 0x392c: ctrl_index = (a_bus_vector-0x45876); break;
251         case 0x77c3: ctrl_index = (a_bus_vector-0x3fe02); break;
252         case 0x8a62: ctrl_index = (a_bus_vector-0x3a784); break;
253         default:
254            ctrl_index = 0;
255            popmessage("Unknown SSS seed %04x, contact MAMEdev",a_bus[3] >> 16);
256            break;
223257      }
258
259//      printf("%08x\n",ctrl_index);
224260   }
225261}
226262

Previous 199869 Revisions Next


© 1997-2024 The MAME Team