src/mess/drivers/jaguar.c
| r6182 | r6183 | |
| 37 | 37 | F1D000-F1DFFF R xxxxxxxx xxxxxxxx Wavetable ROM |
| 38 | 38 | ------------------------------------------------------------ |
| 39 | 39 | |
| 40 | **************************************************************************** |
| 41 | |
| 42 | Protection Check |
| 43 | |
| 44 | At power on, a checksum is performed on the cart to ensure it has been |
| 45 | certified by Atari. The actual checksum calculation is performed by the GPU, |
| 46 | the result being left in GPU RAM at address f03000. The GPU is instructed to |
| 47 | do the calculation when the bios sends a 1 to f02114 while it is in the |
| 48 | initialisation stage. The bios then loops, waiting for the GPU to finish the |
| 49 | calculation. When it does, it sets bit 15 of f02114 high. The bios then does |
| 50 | the compare of the checksum. The checksum algorithm is unknown, but the |
| 51 | final result must be 03d0dead. The bios checks for this particular result, |
| 52 | and if found, the cart is allowed to start. Otherwise, the background turns |
| 53 | red, and the console freezes. |
| 54 | |
| 55 | |
| 56 | Jaguar Logo |
| 57 | |
| 58 | A real Jaguar will show the red Jaguar logo, the falling white Atari letters, |
| 59 | and the turning jaguar's head, accompanied by the sound of a flushing toilet. |
| 60 | The cart will then start. All Jaguar emulators (including this one) skip the |
| 61 | logo with the appropriate memory hack. The cart can also instruct the logo |
| 62 | be skipped by placing non-zero at location 800408. We do the same thing when |
| 63 | the cart is loaded (see the DEVICE_IMAGE_LOAD section below). |
| 64 | |
| 65 | |
| 66 | Start Address |
| 67 | |
| 68 | The start address of a cart may be found at 800404. It is normally 802000. |
| 69 | |
| 70 | |
| 40 | 71 | ***************************************************************************/ |
| 41 | 72 | |
| 42 | 73 | |
| r6182 | r6183 | |
| 83 | 114 | static UINT32 *cart_base; |
| 84 | 115 | static size_t cart_size; |
| 85 | 116 | static UINT8 eeprom_bit_count; |
| 117 | static UINT8 protection_check = 0; /* 0 = check hasn't started yet; 1= check in progress; 2 = check is finished. */ |
| 86 | 118 | |
| 87 | 119 | |
| 88 | 120 | static IRQ_CALLBACK(jaguar_irq_callback) |
| r6182 | r6183 | |
| 100 | 132 | { |
| 101 | 133 | cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), jaguar_irq_callback); |
| 102 | 134 | |
| 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; |
| 107 | 136 | |
| 108 | 137 | /* Set up pointers for Jaguar logo */ |
| 109 | 138 | memcpy(jaguar_shared_ram, rom_base, 0x10); |
| r6182 | r6183 | |
| 269 | 298 | |
| 270 | 299 | static READ32_HANDLER( gpuctrl_r ) |
| 271 | 300 | { |
| 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); |
| 273 | 309 | } |
| 274 | 310 | |
| 275 | 311 | |
| 276 | 312 | static WRITE32_HANDLER( gpuctrl_w ) |
| 277 | 313 | { |
| 314 | if ((!protection_check) && (offset == 5) && (data == 1)) protection_check++; |
| 278 | 315 | jaguargpu_ctrl_w(cputag_get_cpu(space->machine, "gpu"), offset, data, mem_mask); |
| 279 | 316 | } |
| 280 | 317 | |
| r6182 | r6183 | |
| 704 | 741 | cart_base[i] = ((j & 0xff) << 24) | ((j & 0xff00) << 8) | ((j & 0xff0000) >> 8) | ((j & 0xff000000) >> 24); |
| 705 | 742 | } |
| 706 | 743 | |
| 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; |
| 710 | 746 | |
| 711 | 747 | /* Transfer control to the bios */ |
| 712 | 748 | cpu_set_reg(cputag_get_cpu(image->machine, "maincpu"), REG_GENPC, rom_base[1]); |