Previous 15994 Revisions Next

r6183 Sunday 25th October, 2009 at 04:51:17 UTC by Robbbert
[JAGUAR] Simulate the protection check instead of hacking it out.
[src/mess/drivers]jaguar.c

src/mess/drivers/jaguar.c
r6182r6183
3737    F1D000-F1DFFF   R     xxxxxxxx xxxxxxxx   Wavetable ROM
3838    ------------------------------------------------------------
3939
40****************************************************************************
41
42Protection Check
43
44At power on, a checksum is performed on the cart to ensure it has been
45certified by Atari. The actual checksum calculation is performed by the GPU,
46the result being left in GPU RAM at address f03000. The GPU is instructed to
47do the calculation when the bios sends a 1 to f02114 while it is in the
48initialisation stage. The bios then loops, waiting for the GPU to finish the
49calculation. When it does, it sets bit 15 of f02114 high. The bios then does
50the compare of the checksum. The checksum algorithm is unknown, but the
51final result must be 03d0dead. The bios checks for this particular result,
52and if found, the cart is allowed to start. Otherwise, the background turns
53red, and the console freezes.
54
55
56Jaguar Logo
57
58A real Jaguar will show the red Jaguar logo, the falling white Atari letters,
59and the turning jaguar's head, accompanied by the sound of a flushing toilet.
60The cart will then start. All Jaguar emulators (including this one) skip the
61logo with the appropriate memory hack. The cart can also instruct the logo
62be skipped by placing non-zero at location 800408. We do the same thing when
63the cart is loaded (see the DEVICE_IMAGE_LOAD section below).
64
65
66Start Address
67
68The start address of a cart may be found at 800404. It is normally 802000.
69
70
4071***************************************************************************/
4172
4273
r6182r6183
83114static UINT32 *cart_base;
84115static size_t cart_size;
85116static UINT8 eeprom_bit_count;
117static UINT8 protection_check = 0;   /* 0 = check hasn't started yet; 1= check in progress; 2 = check is finished. */
86118
87119
88120static IRQ_CALLBACK(jaguar_irq_callback)
r6182r6183
100132{
101133   cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), jaguar_irq_callback);
102134
103   /* Break the protection */
104   jaguar_gpu_ram[0] = 0x3d0dead;
105   rom_base[0x4da]=(rom_base[0x4da]&0xffff0000) | 1234;
106   rom_base[0x4db]=(rom_base[0x4db]&0xffff) | 56780000;
135   protection_check = 0;
107136
108137   /* Set up pointers for Jaguar logo */
109138   memcpy(jaguar_shared_ram, rom_base, 0x10);
r6182r6183
269298
270299static READ32_HANDLER( gpuctrl_r )
271300{
272   return jaguargpu_ctrl_r(cputag_get_cpu(space->machine, "gpu"), offset);
301   if (protection_check == 1)
302   {
303      protection_check++;
304      jaguar_gpu_ram[0] = 0x3d0dead;
305      return 0x80000000;
306   }
307   else
308      return jaguargpu_ctrl_r(cputag_get_cpu(space->machine, "gpu"), offset);
273309}
274310
275311
276312static WRITE32_HANDLER( gpuctrl_w )
277313{
314   if ((!protection_check) && (offset == 5) && (data == 1)) protection_check++;
278315   jaguargpu_ctrl_w(cputag_get_cpu(space->machine, "gpu"), offset, data, mem_mask);
279316}
280317
r6182r6183
704741      cart_base[i] = ((j & 0xff) << 24) | ((j & 0xff00) << 8) | ((j & 0xff0000) >> 8) | ((j & 0xff000000) >> 24);
705742   }
706743
707   /* Disable logo? - can't do this because of core fatal warning */
708   //if (input_port_read(image->machine, "CONFIG") & 2)
709      rom_base[0x53c / 4] = 0x67000002;
744   /* Skip the logo */
745   cart_base[0x102] = 1;
710746
711747   /* Transfer control to the bios */
712748   cpu_set_reg(cputag_get_cpu(image->machine, "maincpu"), REG_GENPC, rom_base[1]);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team