Previous 15994 Revisions Next

r11289 Sunday 24th April, 2011 at 22:21:38 UTC by Angelo Salese
Celebrate marriage between cojag.c MAME side and jaguar.c MESS side, nw
[src/mame/drivers]cojag.c jaguar.c*
[src/mame/video]jaguar.c
[src/mess]mess.mak

src/mame/video/jaguar.c
r11288r11289
221221static void blitter_01800009_000028_000028(running_machine &machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
222222static void blitter_01800001_000018_000018(running_machine &machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
223223static void blitter_01c00001_000018_000018(running_machine &machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
224
225#ifdef MESS
226224static void blitter_00010000_xxxxxx_xxxxxx(running_machine &machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
227225static void blitter_01800001_xxxxxx_xxxxxx(running_machine &machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
228226static void blitter_x1800x01_xxxxxx_xxxxxx(running_machine &machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
229#endif
230227
231228
232229
r11288r11289
545542      }
546543   }
547544
548#ifdef MESS
549545   if (command == 0x00010000)
550546   {
551547      blitter_00010000_xxxxxx_xxxxxx(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
r11288r11289
563559      blitter_x1800x01_xxxxxx_xxxxxx(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
564560      return;
565561   }
566#endif
567562
568
569563if (LOG_BLITTER_STATS)
570564{
571565static UINT32 blitter_stats[1000][4];
r11288r11289
10281022#undef COMMAND
10291023#undef FUNCNAME
10301024
1031#ifdef MESS
10321025
10331026#define FUNCNAME   blitter_00010000_xxxxxx_xxxxxx
10341027#define COMMAND      0x00010000
r11288r11289
10601053#undef COMMAND
10611054#undef FUNCNAME
10621055
1063#endif /* MESS */
src/mame/drivers/cojag.c
r11288r11289
1/***************************************************************************
2
3    Atari CoJag hardware
4
5    driver by Aaron Giles
6
7    Games supported:
8        * Area 51 (3 Sets)
9        * Maximum Force (2 Sets)
10        * Area 51/Maximum Force Duo (2 Sets)
11        * Vicious Circle
12        * Fishin' Frenzy
13        * Freeze
14
15    To do:
16        * map out unused RAM per-game via memory_nop_read/write
17
18    Note: There is believed to be a 68020 version of Maximum Force
19            (not confirmed or dumped)
20
21****************************************************************************
22
23    Area51/Maximum Force (c)1997 Atari Games
24    Maximum Force
25    A055451
26
27    Components:
28    sdt79r3041-20j
29    Atari Jaguar CPU V1.0 6sc880hf106
30    Atari Jaguar DSP V1.0 sc414201ft (has Motorolla logo)
31    Altera epm7128elc84-15 marked A-21652
32    VIA vt83c461 IDE controller
33    Actel a1010b marked A-22096 near IDE and gun inputs
34    Dallas ds1232s watchdog
35    52MHz osc near Altera PLCC
36    40MHz osc near 79R3041
37    14.318180MHz osc near Jag DSP
38    12x hm514260cj7 RAM (near Jaguar CPU/DSP)
39    4x  sdt71256 RAM (near Boot ROMs's)
40    Atmel atf16v8b marked a-21647 (near Jag CPU)
41    Altera ep22lc-10 marked A-21648 (near Jag DSP)
42    ICT 22cv10aj marked A-21649 (near Jag CPU)
43    ICT 22cv10aj marked A-21650 (near Jag CPU)
44    ICT 22cv10aj marked A-21651 (near Jag CPU)
45    tea6320t
46    AKM ak4310vm
47    tda1554q amplifier
48    Microchip 28c16a-15 BRAM
49
50    ROM's:
51    27c4001
52    R3K MAX/A51 KIT
53    LL
54    (c)1997 Atari
55    V 1.0
56
57    27c4001
58    R3K MAX/A51 KIT
59    LH
60    (c)1997 Atari
61    V 1.0
62
63    27c4001
64    R3K MAX/A51 KIT
65    HL
66    (c)1997 Atari
67    V 1.0
68
69    27c4001
70    R3K MAX/A51 KIT
71    HH
72    (c)1997 Atari
73    V 1.0
74
75    Jumpers:
76    jsp1 (1/2 connected= w/sub 2/3 connected= normal speaker)
77    jsp2 (1/2 connected= w/sub 2/3 connected= normal speaker)
78    jamaud (1/2 connected=stereo 2/3 connected=mono)
79    jimpr (1/2 connected=hi video R impedance 2/3 connected=lo)
80    jimpg (1/2 connected=hi video G impedance 2/3 connected=lo)
81    jimpb (1/2 connected=hi video B impedance 2/3 connected=lo)
82
83    Connectors:
84    idea  standard IDE connector
85    ideb laptop size IDE connector
86    jgun1 8 pin gun input
87    jgun2 8 pin gun input
88    xtracoin 1 6 pin (coin3/4 bills?)
89    jvupdn 3 pin (?)
90    jsync 3 pin (?)
91    JAMMA
92    jspkr left/right/subwoofer output
93    hdpower 4 pin PC power connector for HD
94
95****************************************************************************
96
97Area 51 (Time Warner Interactive License)
98Atari/Mesa Logic, 1995
99
100This game runs on Atari Cojag 68k hardware.
101
102PCB Layouts
103-----------
104
105Main Board:
106
107COJAG A053538
108ATARI GAMES (C) 1994
109(Atari comment near AMP - 'MMM, DONUTS.')
110|--------------------------------------------------|
111|TDA1554Q  TEA6320T   AK4310            JXCLKTRM   |
112|JSPKR     ST91D314                        XC7336  |
113|         JSP1 JWELLSR  PAL4  PAL5                 |
114|   JSP4  JSP2 PAL1            45160 45160  *   *  |
115| HDPOWER JSP3 JWELLSB                        JXBUS|
116| SELFTEST     PAL2     PAL6   45160 45160  *   *  |
117|     LED      JWELLSG                             |
118|     LED              |------|45160 45160  *   *  |
119|J    LED              |JAGUAR|                    |
120|A                     | CPU  |45160 45160  *   *  |
121|M                     |      |                    |
122|M                     |------|                    |
123|A                                                 |
124|   14.31818MHz        |------|                    |
125|   LM613              |JAGUAR|                    |
126|   52MHz  PAL3        | DSP  |                    |
127|                      |      |                    |
128|  JSYNC               |------|                    |
129|  JVUPDN           DIP8                           |
130|              A1010B                              |
131|JPLY3   JVCR            VT83C461                  |
132|                                                  |
133|                               LED                |
134|  JPLY4    JGUN2  JGUN1  JIDEB                    |
135|--------------------------------------------------|
136Notes:
137      JAGUAR CPU - Atari Jaguar CPU (QFP208)
138      JAGUAR DSP - Atari Jaguar DSP (QFP160)
139      45160      - TMS45160DZ-70 512K x16 DRAM (SOJ40)
140                   Note: This RAM is in banks. There are 4 banks, each bank is 2MBytes x 64bit
141                   Only banks 0 and 1 are populated.
142      *          - Unpopulated DRAM positions (banks 2 and 3)
143      TDA1554Q   - Philips TDA1554Q power AMP
144      TEA6320T   - Philips TEA6320T op AMP (SOP32)
145      AK4310     - AKM AK4310VM (SOIC24)
146      ST91D314   - STS Microelectronics ST91D314 3403 op AMP (SOIC14)
147      PAL1       - ATMEL ATF16V8B PAL (labelled '136105-0006', PLCC20)
148      PAL2       - ATMEL ATF16V8B PAL (labelled '136105-0006', PLCC20)
149      PAL3       - ATMEL ATF16V8B PAL (labelled '136105-0007', PLCC20)
150      PAL4, PAL5 - Philips PL22V10-10A PAL (labelled 'MYF 136105-0008', PLCC28)
151      PAL6       - ATMEL ATF16V8B (labelled '136105-0005', PLCC20)
152      A1010B     - ACTEL A1010B Complex Programmable Logic Device (labeled 'MYF 136105-0010', PLCC44)
153      XC7336     - Xilinx XC7336 Complex PRogrammable Logic Device (labelled 'MYF 136105-0009', PLCC44)
154      VT83C461   - VIA VT83C461 IDE Hard Drive Controller (QFP100)
155      LM613      - (DIP16)
156      SELFTEST   - Test Switch
157      HDPOWER    - Standard (PC-type) 4 pin hard drive power connector
158      JSP1       - 3 pin jumper block, set to 2-3
159      JSP2       - 3 pin jumper block, set to 2-3
160      JSP3       - 3 pin jumper block, jumper not installed
161      JSP4       - 3 pin jumper block, set to 2-3
162      JWELLSR    - 3 pin jumper block, set to 2-3
163      JWELLSB    - 3 pin jumper block, set to 2-3
164      JWELLSG    - 3 pin jumper block, set to 2-3
165      JSYNC      - 3 pin jumper block, jumper not installed
166      JVUPDN     - 3 pin jumper block, jumper not installed
167      JVCR       - 3 pin jumper block, jumper not installed
168      JXCLKTRM   - 2 pin header, not shorted
169      JPLY3      - Connector for player 3 controls
170      JPLY4      - Connector for player 4 controls
171      JGUN1      - Connector for player 1 gun
172      JGUN2      - Connector for player 2 gun
173      JIDEB      - Connector for 40 pin IDE cable connected to Quantum Fireball 1080AT IDE hard drive (C/H/S = 2112/16/63)
174      JSPKR      - Connector for left/right speaker for stereo sound output
175      DIP8       - Unpopulated DIP8 socket
176      JXBUS      - 96 pin connector to top board
177
178
179Top Board:
180
181EC20X32
182A053448
183ATARI GAMES (C) 1994
184|------------------------------|
185|               136105-0002C.3P|
186| 71256                        |
187|               136105-0001C.3M|
188| 71256                        |
189|               136105-0000C.3K|
190| 71256                        |
191|               136105-0003C.3H|
192| 71256                        |
193|              LED             |
194|                              |
195| AT28C16  DS1232   XC7354     |
196|                              |
197|                              |
198|      MC68EC020               |
199|                              |
200| 50MHz                        |
201|------------------------------|
202Notes:
203      MC68EC020       - Motorola 68EC020FG25 CPU clocked at 25MHz (QFP100)
204      AT28C16         - ATMEL 2k x8 EEPROM (DIP24)
205      XC7354          - Xilinx XC7354 Complex Programmable Logic Device (labelled 'MYF 136105-0004', PLCC68, socketed)
206      DS1232          - Dallas DS1232 System Reset IC (DIP8)
207      71256           - 32K x8 SRAM (SOJ28)
208      136105-0002C.3P - 27C040 EPROM (labelled 'AREA 51 136105-0002C (C)1995 ATARI GMS CS 55FE', DIP32)
209      136105-0001C.3M - 27C040 EPROM (labelled 'AREA 51 136105-0001C (C)1995 ATARI GMS CS 3DFD', DIP32)
210      136105-0000C.3K - 27C040 EPROM (labelled 'AREA 51 136105-0000C (C)1995 ATARI GMS CS 63FC', DIP32)
211      136105-0003C.3H - 27C040 EPROM (labelled 'AREA 51 136105-0003C (C)1995 ATARI GMS CS 45FF', DIP32)
212
213****************************************************************************
214
215Maximum Force
216Atari, 1997
217
218PCB Layout
219----------
220
221MAXIMUM FORCE A055451 ATARI GAMES (C) 1996
222|-----------------------------------------------------------------------------------|
223|HM514260CJ7 HM514260CJ7 HM514260CJ7 HM514260CJ7            AT28C16                 |
224|                                                                                   |
225|HM514260CJ7 HM514260CJ7 HM514260CJ7 HM514260CJ7            PROGLL.17Y   PROGLH.21Y |
226|                                                                                   |
227|HM514260CJ7 HM514260CJ7 HM514260CJ7 HM514260CJ7            PROGHL.21V   PROGHH.21V |
228|                                                                                   |
229|                                                                                   |
230|             |------|      |------|                                                |
231|             |JAGUAR|      |JAGUAR|                                                |
232|GAL     GAL  |GPU   |      |DSP   |                     |----------|               |
233|             |------|      |------|                     |          |               |
234|                                                        |IDT       |               |
235|GAL     GAL                                     40MHz   |79R3041-20|               |
236|                                          GAL           |          |               |
237|                                    14.31818MHz         |----------|           IDE |
238|AK4310VM                                                                      CONN |
239|                                                       |-----------|               |
240|LM78L05                                     52MHz      |ALTERA MAX |               |
241|                                                       |EPM7128ELC84               |
242|        TEA6320                                        |           |               |
243|78L09                                    LM613         |           |      VIA      |
244|            MONO/STEREO                                |-----------|      VT83C461 |
245|TDA1554           SELFTEST                                                         |
246|                                                  DS1232      ACTEL_A1010B         |
247|           HDD_PWR                                                                 |
248| JSPKR |--|           JAMMA            |--| JSYNC  JVUPDN   XTRACOIN1  JGUN1  JGUN2|
249|-------|  |----------------------------|  |----------------------------------------|
250Notes:
251      JGUN1 / JGUN2 - Connector for Guns
252      VIA VT83C461 - IDE Controller
253      JSPKR - Speaker Output Connector (for use with Stereo jumper)
254
255****************************************************************************
256
257    Memory map (TBA)
258
259    ========================================================================
260    MAIN CPU
261    ========================================================================
262
263    ------------------------------------------------------------
264    000000-3FFFFF   R/W   xxxxxxxx xxxxxxxx   DRAM 0
265    400000-7FFFFF   R/W   xxxxxxxx xxxxxxxx   DRAM 1
266    800000-BFFFFF   R     xxxxxxxx xxxxxxxx   Graphic ROM bank
267    C00000-DFFFFF   R     xxxxxxxx xxxxxxxx   Sound ROM bank
268    F00000-F000FF   R/W   xxxxxxxx xxxxxxxx   Tom Internal Registers
269    F00400-F005FF   R/W   xxxxxxxx xxxxxxxx   CLUT - color lookup table A
270    F00600-F007FF   R/W   xxxxxxxx xxxxxxxx   CLUT - color lookup table B
271    F00800-F00D9F   R/W   xxxxxxxx xxxxxxxx   LBUF - line buffer A
272    F01000-F0159F   R/W   xxxxxxxx xxxxxxxx   LBUF - line buffer B
273    F01800-F01D9F   R/W   xxxxxxxx xxxxxxxx   LBUF - line buffer currently selected
274    F02000-F021FF   R/W   xxxxxxxx xxxxxxxx   GPU control registers
275    F02200-F022FF   R/W   xxxxxxxx xxxxxxxx   Blitter registers
276    F03000-F03FFF   R/W   xxxxxxxx xxxxxxxx   Local GPU RAM
277    F08800-F08D9F   R/W   xxxxxxxx xxxxxxxx   LBUF - 32-bit access to line buffer A
278    F09000-F0959F   R/W   xxxxxxxx xxxxxxxx   LBUF - 32-bit access to line buffer B
279    F09800-F09D9F   R/W   xxxxxxxx xxxxxxxx   LBUF - 32-bit access to line buffer currently selected
280    F0B000-F0BFFF   R/W   xxxxxxxx xxxxxxxx   32-bit access to local GPU RAM
281    F10000-F13FFF   R/W   xxxxxxxx xxxxxxxx   Jerry
282    F14000-F17FFF   R/W   xxxxxxxx xxxxxxxx   Joysticks and GPIO0-5
283    F18000-F1AFFF   R/W   xxxxxxxx xxxxxxxx   Jerry DSP
284    F1B000-F1CFFF   R/W   xxxxxxxx xxxxxxxx   Local DSP RAM
285    F1D000-F1DFFF   R     xxxxxxxx xxxxxxxx   Wavetable ROM
286    ------------------------------------------------------------
287
288***************************************************************************/
289
290
291#include "emu.h"
292#include "cpu/m68000/m68000.h"
293#include "cpu/mips/r3000.h"
294#include "cpu/jaguar/jaguar.h"
295#include "machine/idectrl.h"
296#include "machine/nvram.h"
297#include "sound/dac.h"
298#include "includes/jaguar.h"
299
300
301#define COJAG_CLOCK         XTAL_52MHz
302#define R3000_CLOCK         XTAL_40MHz
303#define M68K_CLOCK         XTAL_50MHz
304
305
306class cojag_state : public driver_device
307{
308public:
309   cojag_state(running_machine &machine, const driver_device_config_base &config)
310      : driver_device(machine, config),
311        m_nvram(*this, "nvram") { }
312
313   required_shared_ptr<UINT32>   m_nvram;
314   cpu_device *m_main_cpu;
315   UINT32 m_misc_control_data;
316   UINT8 m_eeprom_enable;
317   UINT32 *m_rom_base;
318   UINT32 *m_gpu_jump_address;
319   UINT8 m_gpu_command_pending;
320   UINT32 m_gpu_spin_pc;
321   UINT32 *m_main_speedup;
322   int m_main_speedup_hits;
323   UINT64 m_main_speedup_last_cycles;
324   UINT64 m_main_speedup_max_cycles;
325   UINT32 *m_main_gpu_wait;
326};
327
328
329
330/*************************************
331 *
332 *  Global variables
333 *
334 *************************************/
335
336UINT32 *jaguar_shared_ram;
337UINT32 *jaguar_gpu_ram;
338UINT32 *jaguar_gpu_clut;
339UINT32 *jaguar_dsp_ram;
340UINT32 *jaguar_wave_rom;
341UINT8 cojag_is_r3000;
342
343
344
345/*************************************
346 *
347 *  Local variables
348 *
349 *************************************/
350
351
352
353
354
355
356/*************************************
357 *
358 *  Machine init
359 *
360 *************************************/
361
362static MACHINE_RESET( cojag )
363{
364   cojag_state *state = machine.driver_data<cojag_state>();
365   UINT8 *rom = machine.region("user2")->base();
366
367   /* 68020 only: copy the interrupt vectors into RAM */
368   if (!cojag_is_r3000)
369      memcpy(jaguar_shared_ram, state->m_rom_base, 0x10);
370
371   /* configure banks for gfx/sound ROMs */
372   if (rom)
373   {
374      /* graphics banks */
375      if (cojag_is_r3000)
376      {
377         memory_configure_bank(machine, "bank1", 0, 2, rom + 0x800000, 0x400000);
378         memory_set_bank(machine, "bank1", 0);
379      }
380      memory_configure_bank(machine, "bank8", 0, 2, rom + 0x800000, 0x400000);
381      memory_set_bank(machine, "bank8", 0);
382
383      /* sound banks */
384      memory_configure_bank(machine, "bank2", 0, 8, rom + 0x000000, 0x200000);
385      memory_configure_bank(machine, "bank9", 0, 8, rom + 0x000000, 0x200000);
386      memory_set_bank(machine, "bank2", 0);
387      memory_set_bank(machine, "bank9", 0);
388   }
389
390   /* clear any spinuntil stuff */
391   jaguar_gpu_resume(machine);
392   jaguar_dsp_resume(machine);
393
394   /* halt the CPUs */
395   jaguargpu_ctrl_w(machine.device("gpu"), G_CTRL, 0, 0xffffffff);
396   jaguardsp_ctrl_w(machine.device("audiocpu"), D_CTRL, 0, 0xffffffff);
397
398   /* set blitter idle flag */
399   blitter_status = 1;
400}
401
402
403
404/*************************************
405 *
406 *  Misc. control bits
407 *
408 *************************************/
409
410static READ32_HANDLER( misc_control_r )
411{
412   cojag_state *state = space->machine().driver_data<cojag_state>();
413   /*  D7    = board reset (low)
414        D6    = audio must & reset (high)
415        D5    = volume control data (invert on write)
416        D4    = volume control clock
417        D3-D1 = audio bank 2-0
418        D0    = shared memory select (0=XBUS) */
419
420   return state->m_misc_control_data ^ 0x20;
421}
422
423
424static WRITE32_HANDLER( misc_control_w )
425{
426   cojag_state *state = space->machine().driver_data<cojag_state>();
427   logerror("%08X:misc_control_w(%02X)\n", cpu_get_previouspc(&space->device()), data);
428
429   /*  D7    = board reset (low)
430        D6    = audio must & reset (high)
431        D5    = volume control data (invert on write)
432        D4    = volume control clock
433        D3-D1 = audio bank 2-0
434        D0    = shared memory select (0=XBUS) */
435
436   /* handle resetting the DSPs */
437   if (!(data & 0x80))
438   {
439      /* clear any spinuntil stuff */
440      jaguar_gpu_resume(space->machine());
441      jaguar_dsp_resume(space->machine());
442
443      /* halt the CPUs */
444      jaguargpu_ctrl_w(space->machine().device("gpu"), G_CTRL, 0, 0xffffffff);
445      jaguardsp_ctrl_w(space->machine().device("audiocpu"), D_CTRL, 0, 0xffffffff);
446   }
447
448   /* adjust banking */
449   if (space->machine().region("user2")->base())
450   {
451      memory_set_bank(space->machine(), "bank2", (data >> 1) & 7);
452      memory_set_bank(space->machine(), "bank9", (data >> 1) & 7);
453   }
454
455   COMBINE_DATA(&state->m_misc_control_data);
456}
457
458
459
460/*************************************
461 *
462 *  32-bit access to the GPU
463 *
464 *************************************/
465
466static READ32_HANDLER( gpuctrl_r )
467{
468   return jaguargpu_ctrl_r(space->machine().device("gpu"), offset);
469}
470
471
472static WRITE32_HANDLER( gpuctrl_w )
473{
474   jaguargpu_ctrl_w(space->machine().device("gpu"), offset, data, mem_mask);
475}
476
477
478
479/*************************************
480 *
481 *  32-bit access to the DSP
482 *
483 *************************************/
484
485static READ32_HANDLER( dspctrl_r )
486{
487   return jaguardsp_ctrl_r(space->machine().device("audiocpu"), offset);
488}
489
490
491static WRITE32_HANDLER( dspctrl_w )
492{
493   jaguardsp_ctrl_w(space->machine().device("audiocpu"), offset, data, mem_mask);
494}
495
496
497static READ32_HANDLER( jaguar_wave_rom_r )
498{
499   return jaguar_wave_rom[offset];
500}
501
502
503
504/*************************************
505 *
506 *  Output ports
507 *
508 *************************************/
509
510static WRITE32_HANDLER( latch_w )
511{
512   logerror("%08X:latch_w(%X)\n", cpu_get_previouspc(&space->device()), data);
513
514   /* adjust banking */
515   if (space->machine().region("user2")->base())
516   {
517      if (cojag_is_r3000)
518         memory_set_bank(space->machine(), "bank1", data & 1);
519      memory_set_bank(space->machine(), "bank8", data & 1);
520   }
521}
522
523
524
525/*************************************
526 *
527 *  EEPROM access
528 *
529 *************************************/
530
531static READ32_HANDLER( eeprom_data_r )
532{
533   cojag_state *state = space->machine().driver_data<cojag_state>();
534   if (cojag_is_r3000)
535      return state->m_nvram[offset] | 0xffffff00;
536   else
537      return state->m_nvram[offset] | 0x00ffffff;
538}
539
540
541static WRITE32_HANDLER( eeprom_enable_w )
542{
543   cojag_state *state = space->machine().driver_data<cojag_state>();
544   state->m_eeprom_enable = 1;
545}
546
547
548static WRITE32_HANDLER( eeprom_data_w )
549{
550   cojag_state *state = space->machine().driver_data<cojag_state>();
551//  if (state->m_eeprom_enable)
552   {
553      if (cojag_is_r3000)
554         state->m_nvram[offset] = data & 0x000000ff;
555      else
556         state->m_nvram[offset] = data & 0xff000000;
557   }
558//  else
559//      logerror("%08X:error writing to disabled EEPROM\n", cpu_get_previouspc(&space->device()));
560   state->m_eeprom_enable = 0;
561}
562
563
564
565/*************************************
566 *
567 *  GPU synchronization & speedup
568 *
569 *************************************/
570
571/*
572    Explanation:
573
574    The GPU generally sits in a tight loop waiting for the main CPU to store
575    a jump address into a specific memory location. This speedup is designed
576    to catch that loop, which looks like this:
577
578        load    (r28),r21
579        jump    (r21)
580        nop
581
582    When nothing is pending, the GPU keeps the address of the load instruction
583    at (r28) so that it loops back on itself. When the main CPU wants to execute
584    a command, it stores an alternate address to (r28).
585
586    Even if we don't optimize this case, we do need to detect when a command
587    is written to the GPU in order to improve synchronization until the GPU
588    has finished. To do this, we start a temporary high frequency timer and
589    run it until we get back to the spin loop.
590*/
591
592
593static TIMER_CALLBACK( gpu_sync_timer )
594{
595   cojag_state *state = machine.driver_data<cojag_state>();
596   /* if a command is still pending, and we haven't maxed out our timer, set a new one */
597   if (state->m_gpu_command_pending && param < 1000)
598      machine.scheduler().timer_set(attotime::from_usec(50), FUNC(gpu_sync_timer), ++param);
599}
600
601
602static WRITE32_HANDLER( gpu_jump_w )
603{
604   cojag_state *state = space->machine().driver_data<cojag_state>();
605   /* update the data in memory */
606   COMBINE_DATA(state->m_gpu_jump_address);
607   logerror("%08X:GPU jump address = %08X\n", cpu_get_previouspc(&space->device()), *state->m_gpu_jump_address);
608
609   /* if the GPU is suspended, release it now */
610   jaguar_gpu_resume(space->machine());
611
612   /* start the sync timer going, and note that there is a command pending */
613   space->machine().scheduler().synchronize(FUNC(gpu_sync_timer));
614   state->m_gpu_command_pending = 1;
615}
616
617
618static READ32_HANDLER( gpu_jump_r )
619{
620   cojag_state *state = space->machine().driver_data<cojag_state>();
621   /* if the current GPU command is just pointing back to the spin loop, and */
622   /* we're reading it from the spin loop, we can optimize */
623   if (*state->m_gpu_jump_address == state->m_gpu_spin_pc && cpu_get_previouspc(&space->device()) == state->m_gpu_spin_pc)
624   {
625#if ENABLE_SPEEDUP_HACKS
626      /* spin if we're allowed */
627      jaguar_gpu_suspend(space->machine());
628#endif
629
630      /* no command is pending */
631      state->m_gpu_command_pending = 0;
632   }
633
634   /* return the current value */
635   return *state->m_gpu_jump_address;
636}
637
638
639
640/*************************************
641 *
642 *  Main CPU speedup (R3000 games)
643 *
644 *************************************/
645
646/*
647    Explanation:
648
649    Instead of sitting in a tight loop, the CPU will run the random number
650    generator over and over while waiting for an interrupt. In order to catch
651    that, we snoop the memory location it is polling, and see if it is read
652    at least 5 times in a row, each time less than 200 cycles apart. If so,
653    we assume it is spinning. Also, by waiting for 5 iterations, we let it
654    crank through some random numbers, just not several thousand every frame.
655*/
656
657#if ENABLE_SPEEDUP_HACKS
658
659
660static READ32_HANDLER( cojagr3k_main_speedup_r )
661{
662   cojag_state *state = space->machine().driver_data<cojag_state>();
663   UINT64 curcycles = state->m_main_cpu->total_cycles();
664
665   /* if it's been less than main_speedup_max_cycles cycles since the last time */
666   if (curcycles - state->m_main_speedup_last_cycles < state->m_main_speedup_max_cycles)
667   {
668      /* increment the count; if we hit 5, we can spin until an interrupt comes */
669      if (state->m_main_speedup_hits++ > 5)
670      {
671         device_spin_until_interrupt(&space->device());
672         state->m_main_speedup_hits = 0;
673      }
674   }
675
676   /* if it's been more than main_speedup_max_cycles cycles, reset our count */
677   else
678      state->m_main_speedup_hits = 0;
679
680   /* remember the last cycle count */
681   state->m_main_speedup_last_cycles = curcycles;
682
683   /* return the real value */
684   return *state->m_main_speedup;
685}
686
687#endif
688
689
690
691/*************************************
692 *
693 *  Additional main CPU speedup
694 *  (Freeze only)
695 *
696 *************************************/
697
698/*
699    Explanation:
700
701    The main CPU hands data off to the GPU to process. But rather than running
702    in parallel, the main CPU just sits and waits for the result. This speedup
703    makes sure we don't waste time emulating that spin loop.
704*/
705
706#if ENABLE_SPEEDUP_HACKS
707
708
709static READ32_HANDLER( main_gpu_wait_r )
710{
711   cojag_state *state = space->machine().driver_data<cojag_state>();
712   if (state->m_gpu_command_pending)
713      device_spin_until_interrupt(&space->device());
714   return *state->m_main_gpu_wait;
715}
716
717#endif
718
719
720
721/*************************************
722 *
723 *  Main CPU speedup (Area 51)
724 *
725 *************************************/
726
727/*
728    Explanation:
729
730    Very similar to the R3000 code, except we need to verify that the value in
731    *main_speedup is actually 0.
732*/
733
734#if ENABLE_SPEEDUP_HACKS
735
736static WRITE32_HANDLER( area51_main_speedup_w )
737{
738   cojag_state *state = space->machine().driver_data<cojag_state>();
739   UINT64 curcycles = state->m_main_cpu->total_cycles();
740
741   /* store the data */
742   COMBINE_DATA(state->m_main_speedup);
743
744   /* if it's been less than 400 cycles since the last time */
745   if (*state->m_main_speedup == 0 && curcycles - state->m_main_speedup_last_cycles < 400)
746   {
747      /* increment the count; if we hit 5, we can spin until an interrupt comes */
748      if (state->m_main_speedup_hits++ > 5)
749      {
750         device_spin_until_interrupt(&space->device());
751         state->m_main_speedup_hits = 0;
752      }
753   }
754
755   /* if it's been more than 400 cycles, reset our count */
756   else
757      state->m_main_speedup_hits = 0;
758
759   /* remember the last cycle count */
760   state->m_main_speedup_last_cycles = curcycles;
761}
762
763
764/*
765    Explanation:
766
767    The Area 51/Maximum Force duo writes to a non-aligned address, so our check
768    against 0 must handle that explicitly.
769*/
770
771static WRITE32_HANDLER( area51mx_main_speedup_w )
772{
773   cojag_state *state = space->machine().driver_data<cojag_state>();
774   UINT64 curcycles = state->m_main_cpu->total_cycles();
775
776   /* store the data */
777   COMBINE_DATA(&state->m_main_speedup[offset]);
778
779   /* if it's been less than 450 cycles since the last time */
780   if (((state->m_main_speedup[0] << 16) | (state->m_main_speedup[1] >> 16)) == 0 && curcycles - state->m_main_speedup_last_cycles < 450)
781   {
782      /* increment the count; if we hit 5, we can spin until an interrupt comes */
783      if (state->m_main_speedup_hits++ > 10)
784      {
785         device_spin_until_interrupt(&space->device());
786         state->m_main_speedup_hits = 0;
787      }
788   }
789
790   /* if it's been more than 450 cycles, reset our count */
791   else
792      state->m_main_speedup_hits = 0;
793
794   /* remember the last cycle count */
795   state->m_main_speedup_last_cycles = curcycles;
796}
797
798#endif
799
800
801
802/*************************************
803 *
804 *  Main CPU memory handlers
805 *
806 *************************************/
807
808static ADDRESS_MAP_START( r3000_map, AS_PROGRAM, 32 )
809   AM_RANGE(0x04000000, 0x047fffff) AM_RAM AM_BASE(&jaguar_shared_ram) AM_SHARE("share1")
810   AM_RANGE(0x04800000, 0x04bfffff) AM_ROMBANK("bank1")
811   AM_RANGE(0x04c00000, 0x04dfffff) AM_ROMBANK("bank2")
812   AM_RANGE(0x04e00000, 0x04e003ff) AM_DEVREADWRITE("ide", ide_controller32_r, ide_controller32_w)
813   AM_RANGE(0x04f00000, 0x04f003ff) AM_READWRITE(jaguar_tom_regs32_r, jaguar_tom_regs32_w)
814   AM_RANGE(0x04f00400, 0x04f007ff) AM_RAM AM_BASE(&jaguar_gpu_clut) AM_SHARE("share2")
815   AM_RANGE(0x04f02100, 0x04f021ff) AM_READWRITE(gpuctrl_r, gpuctrl_w)
816   AM_RANGE(0x04f02200, 0x04f022ff) AM_READWRITE(jaguar_blitter_r, jaguar_blitter_w)
817   AM_RANGE(0x04f03000, 0x04f03fff) AM_MIRROR(0x00008000) AM_RAM AM_BASE(&jaguar_gpu_ram) AM_SHARE("share3")
818   AM_RANGE(0x04f10000, 0x04f103ff) AM_READWRITE(jaguar_jerry_regs32_r, jaguar_jerry_regs32_w)
819   AM_RANGE(0x04f16000, 0x04f1600b) AM_READ(cojag_gun_input_r)   // GPI02
820   AM_RANGE(0x04f17000, 0x04f17003) AM_READ_PORT("SYSTEM")      // GPI03
821   AM_RANGE(0x04f17800, 0x04f17803) AM_WRITE(latch_w)         // GPI04
822   AM_RANGE(0x04f17c00, 0x04f17c03) AM_READ_PORT("P1_P2")      // GPI05
823   AM_RANGE(0x04f1a100, 0x04f1a13f) AM_READWRITE(dspctrl_r, dspctrl_w)
824   AM_RANGE(0x04f1a140, 0x04f1a17f) AM_READWRITE(jaguar_serial_r, jaguar_serial_w)
825   AM_RANGE(0x04f1b000, 0x04f1cfff) AM_RAM AM_BASE(&jaguar_dsp_ram) AM_SHARE("share4")
826
827   AM_RANGE(0x06000000, 0x06000003) AM_READWRITE(misc_control_r, misc_control_w)
828   AM_RANGE(0x10000000, 0x1007ffff) AM_RAM
829   AM_RANGE(0x12000000, 0x120fffff) AM_RAM      // tested in self-test only?
830   AM_RANGE(0x14000004, 0x14000007) AM_WRITE(watchdog_reset32_w)
831   AM_RANGE(0x16000000, 0x16000003) AM_WRITE(eeprom_enable_w)
832   AM_RANGE(0x18000000, 0x18001fff) AM_READWRITE(eeprom_data_r, eeprom_data_w) AM_SHARE("nvram")
833   AM_RANGE(0x1fc00000, 0x1fdfffff) AM_ROM AM_REGION("user1", 0) AM_BASE_MEMBER(cojag_state, m_rom_base)
834ADDRESS_MAP_END
835
836
837static ADDRESS_MAP_START( m68020_map, AS_PROGRAM, 32 )
838   AM_RANGE(0x000000, 0x7fffff) AM_RAM AM_BASE(&jaguar_shared_ram) AM_SHARE("share1")
839   AM_RANGE(0x800000, 0x9fffff) AM_ROM AM_REGION("user1", 0) AM_BASE_MEMBER(cojag_state, m_rom_base)
840   AM_RANGE(0xa00000, 0xa1ffff) AM_RAM
841   AM_RANGE(0xa20000, 0xa21fff) AM_READWRITE(eeprom_data_r, eeprom_data_w) AM_SHARE("nvram")
842   AM_RANGE(0xa30000, 0xa30003) AM_WRITE(watchdog_reset32_w)
843   AM_RANGE(0xa40000, 0xa40003) AM_WRITE(eeprom_enable_w)
844   AM_RANGE(0xb70000, 0xb70003) AM_READWRITE(misc_control_r, misc_control_w)
845   AM_RANGE(0xc00000, 0xdfffff) AM_ROMBANK("bank2")
846   AM_RANGE(0xe00000, 0xe003ff) AM_DEVREADWRITE("ide",  ide_controller32_r, ide_controller32_w)
847   AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE(jaguar_tom_regs32_r, jaguar_tom_regs32_w)
848   AM_RANGE(0xf00400, 0xf007ff) AM_RAM AM_BASE(&jaguar_gpu_clut) AM_SHARE("share2")
849   AM_RANGE(0xf02100, 0xf021ff) AM_READWRITE(gpuctrl_r, gpuctrl_w)
850   AM_RANGE(0xf02200, 0xf022ff) AM_READWRITE(jaguar_blitter_r, jaguar_blitter_w)
851   AM_RANGE(0xf03000, 0xf03fff) AM_MIRROR(0x008000) AM_RAM AM_BASE(&jaguar_gpu_ram) AM_SHARE("share3")
852   AM_RANGE(0xf10000, 0xf103ff) AM_READWRITE(jaguar_jerry_regs32_r, jaguar_jerry_regs32_w)
853   AM_RANGE(0xf16000, 0xf1600b) AM_READ(cojag_gun_input_r)   // GPI02
854   AM_RANGE(0xf17000, 0xf17003) AM_READ_PORT("SYSTEM")      // GPI03
855//  AM_RANGE(0xf17800, 0xf17803) AM_WRITE(latch_w)          // GPI04
856   AM_RANGE(0xf17c00, 0xf17c03) AM_READ_PORT("P1_P2")      // GPI05
857   AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE(dspctrl_r, dspctrl_w)
858   AM_RANGE(0xf1a140, 0xf1a17f) AM_READWRITE(jaguar_serial_r, jaguar_serial_w)
859   AM_RANGE(0xf1b000, 0xf1cfff) AM_RAM AM_BASE(&jaguar_dsp_ram) AM_SHARE("share4")
860ADDRESS_MAP_END
861
862
863
864/*************************************
865 *
866 *  GPU memory handlers
867 *
868 *************************************/
869
870static ADDRESS_MAP_START( gpu_map, AS_PROGRAM, 32 )
871   AM_RANGE(0x000000, 0x7fffff) AM_RAM AM_SHARE("share1")
872   AM_RANGE(0x800000, 0xbfffff) AM_ROMBANK("bank8")
873   AM_RANGE(0xc00000, 0xdfffff) AM_ROMBANK("bank9")
874   AM_RANGE(0xe00000, 0xe003ff) AM_DEVREADWRITE("ide", ide_controller32_r, ide_controller32_w)
875   AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE(jaguar_tom_regs32_r, jaguar_tom_regs32_w)
876   AM_RANGE(0xf00400, 0xf007ff) AM_RAM AM_SHARE("share2")
877   AM_RANGE(0xf02100, 0xf021ff) AM_READWRITE(gpuctrl_r, gpuctrl_w)
878   AM_RANGE(0xf02200, 0xf022ff) AM_READWRITE(jaguar_blitter_r, jaguar_blitter_w)
879   AM_RANGE(0xf03000, 0xf03fff) AM_RAM AM_SHARE("share3")
880   AM_RANGE(0xf10000, 0xf103ff) AM_READWRITE(jaguar_jerry_regs32_r, jaguar_jerry_regs32_w)
881ADDRESS_MAP_END
882
883
884
885/*************************************
886 *
887 *  DSP memory handlers
888 *
889 *************************************/
890
891static ADDRESS_MAP_START( dsp_map, AS_PROGRAM, 32 )
892   AM_RANGE(0x000000, 0x7fffff) AM_RAM AM_SHARE("share1")
893   AM_RANGE(0x800000, 0xbfffff) AM_ROMBANK("bank8")
894   AM_RANGE(0xc00000, 0xdfffff) AM_ROMBANK("bank9")
895   AM_RANGE(0xf10000, 0xf103ff) AM_READWRITE(jaguar_jerry_regs32_r, jaguar_jerry_regs32_w)
896   AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE(dspctrl_r, dspctrl_w)
897   AM_RANGE(0xf1a140, 0xf1a17f) AM_READWRITE(jaguar_serial_r, jaguar_serial_w)
898   AM_RANGE(0xf1b000, 0xf1cfff) AM_RAM AM_SHARE("share4")
899   AM_RANGE(0xf1d000, 0xf1dfff) AM_READ(jaguar_wave_rom_r) AM_BASE(&jaguar_wave_rom)
900ADDRESS_MAP_END
901
902
903
904/*************************************
905 *
906 *  Port definitions
907 *
908 *************************************/
909
910/* "FAKE0" is read at 0x04f17000
911    D23-20 = /SER-4-1
912    D19-16 = COINR4-1
913    D7     = /VSYNCNEQ
914    D6     = /S-TEST
915    D5     = /VOLUMEUP
916    D4     = /VOLUMEDOWN
917    D3-D0  = ACTC4-1
918*/
919static INPUT_PORTS_START( area51 )
920   PORT_START("P1_P2")
921   PORT_BIT( 0x000000ff, IP_ACTIVE_LOW, IPT_UNUSED )
922   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_START2 )
923   PORT_BIT( 0x0000fe00, IP_ACTIVE_LOW, IPT_UNUSED )
924
925   PORT_BIT( 0x00ff0000, IP_ACTIVE_LOW, IPT_UNUSED )
926   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_START1 )
927   PORT_BIT( 0xfe000000, IP_ACTIVE_LOW, IPT_UNUSED )
928
929   PORT_START("SYSTEM")
930   PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "FAKE0")
931   PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "FAKE0")
932
933   PORT_START("FAKE0")
934   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
935   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
936   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
937   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN4 )
938   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VOLUME_DOWN )
939   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_VOLUME_UP )
940   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )         // s-test
941   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL )   // vsyncneq
942   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
943
944   PORT_START("FAKE1_X")            /* fake analog X */
945   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 320.0/(320.0 - 7 -7), 0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10)
946
947   PORT_START("FAKE1_Y")            /* fake analog Y */
948   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, (240.0 - 1)/240, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(10)
949
950   PORT_START("FAKE2_X")            /* fake analog X */
951   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 320.0/(320.0 - 7 -7), 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(2)
952
953   PORT_START("FAKE2_Y")            /* fake analog Y */
954   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, (240.0 - 1)/240, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(10) PORT_PLAYER(2)
955
956   PORT_START("IN3")         /* gun triggers */
957   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_SPECIAL )   // gun data valid
958   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_SPECIAL )   // gun data valid
959   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
960   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
961   PORT_BIT( 0xfff00000, IP_ACTIVE_LOW, IPT_UNKNOWN )
962INPUT_PORTS_END
963
964
965static INPUT_PORTS_START( freezeat )
966   PORT_START("P1_P2")
967   PORT_BIT( 0x000000ff, IP_ACTIVE_LOW, IPT_UNUSED )
968   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_START2 )
969   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
970   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
971   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
972   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
973   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
974   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
975   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
976
977   PORT_BIT( 0x00ff0000, IP_ACTIVE_LOW, IPT_UNUSED )
978   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_START1 )
979   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
980   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
981   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
982   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
983   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
984   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
985   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
986
987   PORT_START("SYSTEM")
988   PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "FAKE0")
989   PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "FAKE0")
990
991   PORT_START("FAKE0")
992   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
993   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
994   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
995   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN4 )
996   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL )   // volume down
997   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL )   // volume up
998   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )         // s-test
999   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL )   // vsyncneq
1000   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
1001
1002   PORT_START("IN3")
1003   PORT_BIT( 0x000f0000, IP_ACTIVE_HIGH, IPT_SPECIAL )   // coin returns
1004   PORT_BIT( 0x00f00000, IP_ACTIVE_LOW, IPT_UNUSED )
1005   PORT_BIT( 0xff000000, IP_ACTIVE_LOW, IPT_UNUSED )
1006INPUT_PORTS_END
1007
1008
1009static INPUT_PORTS_START( fishfren )
1010   PORT_START("P1_P2")
1011   PORT_BIT( 0x000000ff, IP_ACTIVE_LOW, IPT_UNUSED )
1012   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_START2 )
1013   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1014   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1015   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1016   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
1017   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
1018   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
1019   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
1020
1021   PORT_BIT( 0x00ff0000, IP_ACTIVE_LOW, IPT_UNUSED )
1022   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_START1 )
1023   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1024   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1025   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1026   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
1027   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
1028   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
1029   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
1030
1031   PORT_START("SYSTEM")
1032   PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "FAKE0")
1033   PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "FAKE0")
1034
1035   PORT_START("FAKE0")
1036   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1037   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1038   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
1039   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN4 )
1040   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL )   // volume down
1041   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL )   // volume up
1042   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )         // s-test
1043   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL )   // vsyncneq
1044   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
1045
1046   PORT_START("IN3")
1047   PORT_BIT( 0x000f0000, IP_ACTIVE_HIGH, IPT_SPECIAL )   // coin returns
1048   PORT_BIT( 0x00f00000, IP_ACTIVE_LOW, IPT_UNUSED )
1049   PORT_BIT( 0xff000000, IP_ACTIVE_LOW, IPT_UNUSED )
1050INPUT_PORTS_END
1051
1052
1053static INPUT_PORTS_START( vcircle )
1054   PORT_START("P1_P2")
1055   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
1056   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
1057   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
1058   PORT_BIT( 0x000000f8, IP_ACTIVE_LOW, IPT_UNUSED )
1059   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_START2 )
1060   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1061   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1062   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1063   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
1064   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
1065   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
1066   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
1067
1068   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
1069   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
1070   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
1071   PORT_BIT( 0x00f80000, IP_ACTIVE_LOW, IPT_UNUSED )
1072   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_START1 )
1073   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1074   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1075   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1076   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
1077   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
1078   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
1079   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
1080
1081   PORT_START("SYSTEM")
1082   PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "FAKE0")
1083   PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "FAKE0")
1084
1085   PORT_START("FAKE0")
1086   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1087   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1088   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
1089   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN4 )
1090   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VOLUME_DOWN )
1091   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_VOLUME_UP )
1092   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )         // s-test
1093   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL )   // vsyncneq
1094   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
1095
1096   PORT_START("IN3")
1097   PORT_BIT( 0x000f0000, IP_ACTIVE_HIGH, IPT_SPECIAL )   // coin returns
1098   PORT_BIT( 0x00f00000, IP_ACTIVE_LOW, IPT_UNUSED )
1099   PORT_BIT( 0xff000000, IP_ACTIVE_LOW, IPT_UNUSED )
1100INPUT_PORTS_END
1101
1102
1103
1104/*************************************
1105 *
1106 *  Machine driver
1107 *
1108 *************************************/
1109
1110static const r3000_cpu_core r3000_config =
1111{
1112   0,      /* 1 if we have an FPU, 0 otherwise */
1113   4096,   /* code cache size */
1114   4096   /* data cache size */
1115};
1116
1117
1118static const jaguar_cpu_config gpu_config =
1119{
1120   jaguar_gpu_cpu_int
1121};
1122
1123
1124static const jaguar_cpu_config dsp_config =
1125{
1126   jaguar_dsp_cpu_int
1127};
1128
1129
1130static MACHINE_CONFIG_START( cojagr3k, cojag_state )
1131
1132   /* basic machine hardware */
1133   MCFG_CPU_ADD("maincpu", R3041BE, R3000_CLOCK)
1134   MCFG_CPU_CONFIG(r3000_config)
1135   MCFG_CPU_PROGRAM_MAP(r3000_map)
1136
1137   MCFG_CPU_ADD("gpu", JAGUARGPU, COJAG_CLOCK/2)
1138   MCFG_CPU_CONFIG(gpu_config)
1139   MCFG_CPU_PROGRAM_MAP(gpu_map)
1140
1141   MCFG_CPU_ADD("audiocpu", JAGUARDSP, COJAG_CLOCK/2)
1142   MCFG_CPU_CONFIG(dsp_config)
1143   MCFG_CPU_PROGRAM_MAP(dsp_map)
1144
1145   MCFG_MACHINE_RESET(cojag)
1146   MCFG_NVRAM_ADD_1FILL("nvram")
1147
1148   MCFG_IDE_CONTROLLER_ADD("ide", jaguar_external_int)
1149
1150   MCFG_TIMER_ADD("serial_timer", jaguar_serial_callback)
1151
1152   /* video hardware */
1153   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
1154
1155   MCFG_SCREEN_ADD("screen", RASTER)
1156   MCFG_SCREEN_RAW_PARAMS(COJAG_PIXEL_CLOCK/2, 456, 42, 402, 262, 17, 257)
1157   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
1158   MCFG_SCREEN_UPDATE(cojag)
1159
1160   MCFG_VIDEO_START(cojag)
1161
1162   /* sound hardware */
1163   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
1164
1165   MCFG_SOUND_ADD("dac1", DAC, 0)
1166   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
1167
1168   MCFG_SOUND_ADD("dac2", DAC, 0)
1169   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
1170MACHINE_CONFIG_END
1171
1172
1173static MACHINE_CONFIG_DERIVED( cojag68k, cojagr3k )
1174
1175   /* basic machine hardware */
1176   MCFG_CPU_REPLACE("maincpu", M68EC020, M68K_CLOCK/2)
1177   MCFG_CPU_PROGRAM_MAP(m68020_map)
1178MACHINE_CONFIG_END
1179
1180
1181
1182/*************************************
1183 *
1184 *  ROM definition(s)
1185 *
1186 *  Date Information comes from either
1187 *   ROM labels or from the Self-Test
1188 *   as "Main"
1189 *
1190 *************************************/
1191
1192/****************************************
1193
1194       ROM & Hard Disk based games
1195
1196****************************************/
1197
1198ROM_START( area51t ) /* 68020 based, Area51 Time Warner License  Date: Nov 15, 1995 */
1199   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for 68020 code */
1200   ROM_LOAD32_BYTE( "136105-0003c.3h", 0x00000, 0x80000, CRC(e70a97c4) SHA1(39dabf6bf3dc6f717a587f362d040bfb332be9e1) )
1201   ROM_LOAD32_BYTE( "136105-0002c.3p", 0x00001, 0x80000, CRC(e9c9f4bd) SHA1(7c6c50372d45dca8929767241b092339f3bab4d2) )
1202   ROM_LOAD32_BYTE( "136105-0001c.3m", 0x00002, 0x80000, CRC(6f135a81) SHA1(2d9660f240b14481e8c46bc98713e9dc12035063) )
1203   ROM_LOAD32_BYTE( "136105-0000c.3k", 0x00003, 0x80000, CRC(94f50c14) SHA1(a54552e3ac5c4f481ba4f2fc7d724534576fe76c) )
1204
1205   DISK_REGION( "ide" )
1206   DISK_IMAGE( "area51t", 0, SHA1(d2865cc7b1bb08a4393a72013a90e18d8a8f9860) )
1207ROM_END
1208
1209ROM_START( area51a ) /* 68020 based, Area51 Atari Games License  Date: Oct 25, 1995 */
1210   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for 68020 code */
1211   ROM_LOAD32_BYTE( "136105-0003a.3h", 0x00000, 0x80000, CRC(116d37e6) SHA1(5d36cae792dd349faa77cd2d8018722a28ee55c1) )
1212   ROM_LOAD32_BYTE( "136105-0002a.3p", 0x00001, 0x80000, CRC(eb10f539) SHA1(dadc4be5a442dd4bd17385033056555e528ed994) )
1213   ROM_LOAD32_BYTE( "136105-0001a.3m", 0x00002, 0x80000, CRC(c6d8322b) SHA1(90cf848a4195c51b505653cc2c74a3b9e3c851b8) )
1214   ROM_LOAD32_BYTE( "136105-0000a.3k", 0x00003, 0x80000, CRC(729eb1b7) SHA1(21864b4281b1ad17b2903e3aa294e4be74161e80) )
1215
1216   DISK_REGION( "ide" )
1217   DISK_IMAGE( "area51", 0, SHA1(3b303bc37e206a6d7339352c869f050d04186f11) )
1218ROM_END
1219
1220ROM_START( area51 ) /* R3000 based, labeled as "Area51 2-C"  Date: Nov 11 1996 */
1221   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for IDT 79R3041 code */
1222   ROM_LOAD32_BYTE( "a51_2-c.hh", 0x00000, 0x80000, CRC(13af6a1e) SHA1(69da54ed6886e825156bbcc256e8d7abd4dc1ff8) )
1223   ROM_LOAD32_BYTE( "a51_2-c.hl", 0x00001, 0x80000, CRC(8ab6649b) SHA1(9b4945bc04f8a73161638a2c5fa2fd84c6fd31b4) )
1224   ROM_LOAD32_BYTE( "a51_2-c.lh", 0x00002, 0x80000, CRC(a6524f73) SHA1(ae377a6803a4f7d1bbcc111725af121a3e82317d) )
1225   ROM_LOAD32_BYTE( "a51_2-c.ll", 0x00003, 0x80000, CRC(471b15d2) SHA1(4b5f45ee140b03a6be61475cae1c2dbef0f07457) )
1226
1227   DISK_REGION( "ide" )
1228   DISK_IMAGE( "area51", 0, SHA1(3b303bc37e206a6d7339352c869f050d04186f11) )
1229ROM_END
1230
1231ROM_START( maxforce ) /* R3000 based, labeled as "Maximum Force 5-23-97 v1.05" */
1232   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for IDT 79R3041 code */
1233   ROM_LOAD32_BYTE( "maxf_105.hh", 0x00000, 0x80000, CRC(ec7f8167) SHA1(0cf057bfb1f30c2c9621d3ed25021e7ba7bdd46e) )
1234   ROM_LOAD32_BYTE( "maxf_105.hl", 0x00001, 0x80000, CRC(3172611c) SHA1(00f14f871b737c66c20f95743740d964d0be3f24) )
1235   ROM_LOAD32_BYTE( "maxf_105.lh", 0x00002, 0x80000, CRC(84d49423) SHA1(88d9a6724f1118f2bbef5dfa27accc2b65c5ba1d) )
1236   ROM_LOAD32_BYTE( "maxf_105.ll", 0x00003, 0x80000, CRC(16d0768d) SHA1(665a6d7602a7f2f5b1f332b0220b1533143d56b1) )
1237
1238   DISK_REGION( "ide" )
1239   DISK_IMAGE( "maxforce", 0, SHA1(d54e7a8f3866bb2a1d28ae637e7c92ffa4dbe558) )
1240ROM_END
1241
1242
1243ROM_START( maxf_102 ) /* R3000 based, labeled as "Maximum Force 2-27-97 v1.02" */
1244   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for IDT 79R3041 code */
1245   ROM_LOAD32_BYTE( "maxf_102.hh", 0x00000, 0x80000, CRC(8ff7009d) SHA1(da22eae298a6e0e36f503fa091ac3913423dcd0f) )
1246   ROM_LOAD32_BYTE( "maxf_102.hl", 0x00001, 0x80000, CRC(96c2cc1d) SHA1(b332b8c042b92c736131c478cefac1c3c2d2673b) )
1247   ROM_LOAD32_BYTE( "maxf_102.lh", 0x00002, 0x80000, CRC(459ffba5) SHA1(adb40db6904e84c17f32ac6518fd2e994da7883f) )
1248   ROM_LOAD32_BYTE( "maxf_102.ll", 0x00003, 0x80000, CRC(e491be7f) SHA1(cbe281c099a4aa87067752d68cf2bb0ab3900531) )
1249
1250   DISK_REGION( "ide" )
1251   DISK_IMAGE( "maxforce", 0, SHA1(d54e7a8f3866bb2a1d28ae637e7c92ffa4dbe558) )
1252ROM_END
1253
1254
1255ROM_START( maxf_ng ) /* R3000 based, stickers say 'NO GORE' */
1256   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for IDT 79R3041 code */
1257   ROM_LOAD32_BYTE( "mf_ng_hh.21v", 0x00000, 0x80000, CRC(08791c02) SHA1(9befbff3201c7d345109b26c296fd8548dbfc95b) )
1258   ROM_LOAD32_BYTE( "mf_ng_hl.17v", 0x00001, 0x80000, CRC(52cf482c) SHA1(ff98b3f04987acef82a97a2ad35a9085fa84e6d5) )
1259   ROM_LOAD32_BYTE( "mf_ng_lh.21y", 0x00002, 0x80000, CRC(ab4ee992) SHA1(69f0fe111d3f5f31151d2922579e5073e484b1e1) )
1260   ROM_LOAD32_BYTE( "mf_ng_ll.17y", 0x00003, 0x80000, CRC(674aab43) SHA1(f79d790538756d1100b7e4ffed192a62a031a2cb) )
1261
1262   ROM_REGION( 0x800, "user2", 0 ) /* 28C16 style eeprom, currently loaded but not used */
1263   ROM_LOAD( "28c16.17z", 0x000, 0x800, CRC(1cdd9088) SHA1(4f01f02ff95f31ced87a3cdd7f171afd92551266) )
1264
1265   DISK_REGION( "ide" )
1266   DISK_IMAGE( "maxforce", 0, SHA1(d54e7a8f3866bb2a1d28ae637e7c92ffa4dbe558) )
1267ROM_END
1268
1269
1270ROM_START( area51mx )   /* 68020 based, Labeled as "68020 MAX/A51 KIT 2.0" Date: Apr 22, 1998 */
1271   ROM_REGION32_BE( 0x200000, "user1", 0 ) /* 2MB for 68020 code */
1272   ROM_LOAD32_BYTE( "area51mx.3h", 0x00000, 0x80000, CRC(47cbf30b) SHA1(23377bcc65c0fc330d5bc7e76e233bae043ac364) )
1273   ROM_LOAD32_BYTE( "area51mx.3p", 0x00001, 0x80000, CRC(a3c93684) SHA1(f6b3357bb69900a176fd6bc6b819b2f57b7d0f59) )
1274   ROM_LOAD32_BYTE( "area51mx.3m", 0x00002, 0x80000, CRC(d800ac17) SHA1(3d515c8608d8101ee9227116175b3c3f1fe22e0c) )
1275   ROM_LOAD32_BYTE( "area51mx.3k", 0x00003, 0x80000, CRC(0e78f308) SHA1(adc4c8e441eb8fe525d0a6220eb3a2a8791a7289) )
1276
1277   DISK_REGION( "ide" )
1278   DISK_IMAGE( "area51mx", 0, SHA1(5ff10f4e87094d4449eabf3de7549564ca568c7e) )
1279ROM_END
1280
1281
1282ROM_START( a51mxr3k ) /* R3000 based, Labeled as "R3K Max/A51 Kit Ver 1.0" */
1283   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for IDT 79R3041 code */
1284   ROM_LOAD32_BYTE( "a51mxr3k.hh", 0x00000, 0x80000, CRC(a984dab2) SHA1(debb3bc11ff49e87a52e89a69533a1bab7db700e) )
1285   ROM_LOAD32_BYTE( "a51mxr3k.hl", 0x00001, 0x80000, CRC(0af49d74) SHA1(c19f26056a823fd32293e9a7b3ea868640eabf49) )
1286   ROM_LOAD32_BYTE( "a51mxr3k.lh", 0x00002, 0x80000, CRC(d7d94dac) SHA1(2060a74715f36a0d7f5dd0855eda48ad1f20f095) )
1287   ROM_LOAD32_BYTE( "a51mxr3k.ll", 0x00003, 0x80000, CRC(ece9e5ae) SHA1(7e44402726f5afa6d1670b27aa43ad13d21c4ad9) )
1288
1289   DISK_REGION( "ide" )
1290   DISK_IMAGE( "area51mx", 0, SHA1(5ff10f4e87094d4449eabf3de7549564ca568c7e) )
1291ROM_END
1292
1293
1294ROM_START( vcircle )
1295   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
1296   ROM_LOAD32_BYTE( "hh", 0x00000, 0x80000, CRC(7276f5f5) SHA1(716287e370a4f300b1743103f8031afc82de38ca) )
1297   ROM_LOAD32_BYTE( "hl", 0x00001, 0x80000, CRC(146060a1) SHA1(f291989f1f0ef228757f1990fb14da5ff8f3cf8d) )
1298   ROM_LOAD32_BYTE( "lh", 0x00002, 0x80000, CRC(be4b2ef6) SHA1(4332b3036e9cb12685e914d085d9a63aa856f0be) )
1299   ROM_LOAD32_BYTE( "ll", 0x00003, 0x80000, CRC(ba8753eb) SHA1(0322e0e37d814a38d08ba191b1a97fb1a55fe461) )
1300
1301   DISK_REGION( "ide" )
1302   DISK_IMAGE( "vcircle", 0, SHA1(bfa79c4cacdc9c2cd6362f62a23056b3e35a2034) )
1303ROM_END
1304
1305
1306
1307/****************************************
1308
1309       ROM based games
1310
1311****************************************/
1312
1313
1314ROM_START( fishfren )
1315   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
1316   ROM_LOAD32_BYTE( "hh", 0x00000, 0x80000, CRC(2ef79767) SHA1(abcea584f2cbd71b05f9d7e61f40ca9da6799215) )
1317   ROM_LOAD32_BYTE( "hl", 0x00001, 0x80000, CRC(7eefd4a2) SHA1(181be04836704098082fd78cacc68ffa70e77892) )
1318   ROM_LOAD32_BYTE( "lh", 0x00002, 0x80000, CRC(bbe9ed15) SHA1(889af29afe6d984b39105aa238400392a5dfb2c5) )
1319   ROM_LOAD32_BYTE( "ll", 0x00003, 0x80000, CRC(d70d0f2c) SHA1(2689cbe56ae3d491348b241528b0fe345fa8484c) )
1320
1321   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
1322   ROMX_LOAD( "l63-56", 0x000000, 0x100000, CRC(42764ea5) SHA1(805245f01006bd974fbac56f688cfcf137ddc914), ROM_SKIP(7) )
1323   ROMX_LOAD( "l55-48", 0x000001, 0x100000, CRC(0c7592bb) SHA1(d5bd6b872abad58947842205f9eac46fd065e88f), ROM_SKIP(7) )
1324   ROMX_LOAD( "l47-40", 0x000002, 0x100000, CRC(6d7dcdb1) SHA1(914dae3b9df5c861f794b683571c5fb0c2c3c3fd), ROM_SKIP(7) )
1325   ROMX_LOAD( "l39-32", 0x000003, 0x100000, CRC(ef3b8d98) SHA1(858c3342e9693bfe887b91dde1116a1656a1a105), ROM_SKIP(7) )
1326   ROMX_LOAD( "l31-24", 0x000004, 0x100000, CRC(132d628e) SHA1(3ff9fa86092eb01f21ca3ccf1ee1e3a583cbdecb), ROM_SKIP(7) )
1327   ROMX_LOAD( "l23-16", 0x000005, 0x100000, CRC(b841f039) SHA1(79f661aee009aef2f5ad4122ae3e0ac94097a427), ROM_SKIP(7) )
1328   ROMX_LOAD( "l15-08", 0x000006, 0x100000, CRC(0800214e) SHA1(5372f2c3470619a4967958c76055486f76b5f150), ROM_SKIP(7) )
1329   ROMX_LOAD( "l07-00", 0x000007, 0x100000, CRC(f83b2e78) SHA1(83ee9d2bfba83e04fb794270926bd3e558c9aaa4), ROM_SKIP(7) )
1330   ROMX_LOAD( "h63-56", 0x800000, 0x080000, CRC(67740765) SHA1(8b22413d25e0dbfe2227d1a8a023961a4c13cb76), ROM_SKIP(7) )
1331   ROMX_LOAD( "h55-48", 0x800001, 0x080000, CRC(ffed0091) SHA1(6c8104acd7e6d95a111f9c7a4d3b6984293d72c4), ROM_SKIP(7) )
1332   ROMX_LOAD( "h47-40", 0x800002, 0x080000, CRC(6f448f72) SHA1(3a298b9851e4ba7aa611aa6c2b0dcf06f4301463), ROM_SKIP(7) )
1333   ROMX_LOAD( "h39-32", 0x800003, 0x080000, CRC(25a5bd67) SHA1(79f29bd36afb4574b9c923eee293964284713540), ROM_SKIP(7) )
1334   ROMX_LOAD( "h31-24", 0x800004, 0x080000, CRC(e7088cc0) SHA1(4cb184de748c5633e669a4675e6db9920d34811e), ROM_SKIP(7) )
1335   ROMX_LOAD( "h23-16", 0x800005, 0x080000, CRC(ab477a76) SHA1(ae9aa97dbc758cd741710fe08c6ea94a0a318451), ROM_SKIP(7) )
1336   ROMX_LOAD( "h15-08", 0x800006, 0x080000, CRC(25a423f1) SHA1(7530cf2e28e0755bfcbd70789ef5cbbfb3d94f9f), ROM_SKIP(7) )
1337   ROMX_LOAD( "h07-00", 0x800007, 0x080000, CRC(0f5f4cc6) SHA1(caa2b514fb1f2a815e63f7b8c6b79ce2dfa308c4), ROM_SKIP(7) )
1338   ROM_COPY( "user2", 0x800000, 0xc00000, 0x400000 )
1339ROM_END
1340
1341ROM_START( freezeat )
1342   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
1343   ROM_LOAD32_BYTE( "prog_eng.hh",          0x000000, 0x040000, CRC(f7cffafd) SHA1(62369de4cf0a5abab86f6bcf9621028b9e171ec3) )
1344   ROM_LOAD32_BYTE( "prog_eng.hl",          0x000001, 0x040000, CRC(17150705) SHA1(c5a32d334bffb58a816920cc1251a21acc5a6f92) )
1345   ROM_LOAD32_BYTE( "prog_eng.lh",          0x000002, 0x040000, CRC(12a903bf) SHA1(41f5949d7ed2081917af8411f92666b754564b37) )
1346   ROM_LOAD32_BYTE( "prog_eng.ll",          0x000003, 0x040000, CRC(cf69f971) SHA1(132b06f5fb49801fff7e5deb7aa71b44d5b1c6ca) )
1347
1348   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
1349   ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(b61061c5) SHA1(aeb409aa5073232d80ed81b27946e753290234f4), ROM_SKIP(7) )
1350   ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(c85acf42) SHA1(c3365caeb126a83a7e7afcda25f05849ceb5c98b), ROM_SKIP(7) )
1351   ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(67f78f59) SHA1(40b256a8939fad365c7e896cff4a959fcc70a477), ROM_SKIP(7) )
1352   ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(6be0508a) SHA1(20f617278ce1666348822d80686cecd8d9b1bc78), ROM_SKIP(7) )
1353   ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(905606e0) SHA1(866cd98ea2399fed96f76b16dce751e2c7cfdc98), ROM_SKIP(7) )
1354   ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(cdeef6fa) SHA1(1b4d58951b662040540e7d51f88c1b6f282562ee), ROM_SKIP(7) )
1355   ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(ad81f204) SHA1(58584a6c8c6cfb6366eaa10aba8a226e419f5ce9), ROM_SKIP(7) )
1356   ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(10ce7254) SHA1(2a88d45dbe78ea8358ecd8522b38d775a2fdb34a), ROM_SKIP(7) )
1357   ROMX_LOAD( "fish_eng.63-56", 0x800000, 0x100000, CRC(4a03f971) SHA1(1ae5ad9a6cd2d612c6519193134dcd5a3f6a5049), ROM_SKIP(7) )
1358   ROMX_LOAD( "fish_eng.55-48", 0x800001, 0x100000, CRC(6bc00de0) SHA1(b1b180c33906826703452875ce250b28352e2797), ROM_SKIP(7) )
1359   ROMX_LOAD( "fish_eng.47-40", 0x800002, 0x100000, CRC(41ccc677) SHA1(76ee042632cfdcc99a9bfb75f2a4ef04e08f101b), ROM_SKIP(7) )
1360   ROMX_LOAD( "fish_eng.39-32", 0x800003, 0x100000, CRC(59a8fa03) SHA1(19e91a4791e0d2dbd8578cee0fa07c491204b0dc), ROM_SKIP(7) )
1361   ROMX_LOAD( "fish_eng.31-24", 0x800004, 0x100000, CRC(c3bb50a1) SHA1(b868ac0812d1c13feae82d293bb323a93a72e1d3), ROM_SKIP(7) )
1362   ROMX_LOAD( "fish_eng.23-16", 0x800005, 0x100000, CRC(237cfc93) SHA1(15f61dc621c5328cc7752c76b2b1dae265a5e886), ROM_SKIP(7) )
1363   ROMX_LOAD( "fish_eng.15-08", 0x800006, 0x100000, CRC(65bec279) SHA1(5e99972279ee9ad32e67866fc63799579a10f2dd), ROM_SKIP(7) )
1364   ROMX_LOAD( "fish_eng.07-00", 0x800007, 0x100000, CRC(13fa20ad) SHA1(0a04fdea025109c0e604ef2a6d58cfb3adce9bd1), ROM_SKIP(7) )
1365ROM_END
1366
1367ROM_START( freezeatjp )
1368   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
1369   ROM_LOAD32_BYTE( "prog_jpn.hh",          0x000000, 0x040000, CRC(989302bf) SHA1(232927ec0a52b8bb587a3c206af8e1c6cde67860) )
1370   ROM_LOAD32_BYTE( "prog_jpn.hl",          0x000001, 0x040000, CRC(6262b760) SHA1(12ca749f5cdc6db7d19f88a21f5f955b80206784) )
1371   ROM_LOAD32_BYTE( "prog_jpn.lh",          0x000002, 0x040000, CRC(c6a12b0c) SHA1(971242b5b09e15164e7c335e684b5043510c6462) )
1372   ROM_LOAD32_BYTE( "prog_jpn.ll",          0x000003, 0x040000, CRC(241ea755) SHA1(0db3cfbe577fc78387528390ebb14dbb7a09c97d) )
1373
1374   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
1375   ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(b61061c5) SHA1(aeb409aa5073232d80ed81b27946e753290234f4), ROM_SKIP(7) )
1376   ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(c85acf42) SHA1(c3365caeb126a83a7e7afcda25f05849ceb5c98b), ROM_SKIP(7) )
1377   ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(67f78f59) SHA1(40b256a8939fad365c7e896cff4a959fcc70a477), ROM_SKIP(7) )
1378   ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(6be0508a) SHA1(20f617278ce1666348822d80686cecd8d9b1bc78), ROM_SKIP(7) )
1379   ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(905606e0) SHA1(866cd98ea2399fed96f76b16dce751e2c7cfdc98), ROM_SKIP(7) )
1380   ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(cdeef6fa) SHA1(1b4d58951b662040540e7d51f88c1b6f282562ee), ROM_SKIP(7) )
1381   ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(ad81f204) SHA1(58584a6c8c6cfb6366eaa10aba8a226e419f5ce9), ROM_SKIP(7) )
1382   ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(10ce7254) SHA1(2a88d45dbe78ea8358ecd8522b38d775a2fdb34a), ROM_SKIP(7) )
1383   ROMX_LOAD( "fish_jpn.63-56", 0x800000, 0x100000, CRC(78c65a1f) SHA1(1a97737c222809930bde9df7a55e1ff1581a3202), ROM_SKIP(7) )
1384   ROMX_LOAD( "fish_jpn.55-48", 0x800001, 0x100000, CRC(9ffac0f1) SHA1(3ba5f8de32a5febb5d3d22f59ccb477834d33934), ROM_SKIP(7) )
1385   ROMX_LOAD( "fish_jpn.47-40", 0x800002, 0x100000, CRC(18543fb7) SHA1(4ab9969de9a66d6b7b70cfa5290c1cf7bce54838), ROM_SKIP(7) )
1386   ROMX_LOAD( "fish_jpn.39-32", 0x800003, 0x100000, CRC(22578f15) SHA1(4e314b22456ed4e4282406e990207e3b9bdf6203), ROM_SKIP(7) )
1387   ROMX_LOAD( "fish_jpn.31-24", 0x800004, 0x100000, CRC(5c41b91b) SHA1(ce354c8a4a3872b009e8af9f75e8f4f0892c7a7e), ROM_SKIP(7) )
1388   ROMX_LOAD( "fish_jpn.23-16", 0x800005, 0x100000, CRC(c2462646) SHA1(207d51a2aae076bc78548cf96325e670ea41609c), ROM_SKIP(7) )
1389   ROMX_LOAD( "fish_jpn.15-08", 0x800006, 0x100000, CRC(f8d998ec) SHA1(ffce4a16fbb2fff3dc0a29c0cede4dfe6316e97b), ROM_SKIP(7) )
1390   ROMX_LOAD( "fish_jpn.07-00", 0x800007, 0x100000, CRC(e7e0daa5) SHA1(108da84cc6b4df7ae88cfdacd27c1728e59cdb81), ROM_SKIP(7) )
1391ROM_END
1392
1393ROM_START( freezeat2 )
1394   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
1395   ROM_LOAD32_BYTE( "prog.hh",              0x000000, 0x040000, CRC(a8aefa52) SHA1(ba95da93035520de4b15245f68217c59dfb69dbd) )
1396   ROM_LOAD32_BYTE( "prog.hl",              0x000001, 0x040000, CRC(152dd641) SHA1(52fa260baf1979ed8f15f8abcbbeebd8e595d0e4) )
1397   ROM_LOAD32_BYTE( "prog.lh",              0x000002, 0x040000, CRC(416d26ed) SHA1(11cf3b88415a8a5d0bb8e1df08603a85202186ef) )
1398   ROM_LOAD32_BYTE( "prog.ll",              0x000003, 0x040000, CRC(d6a5dbc8) SHA1(0e2176c35cbc59b2a5283366210409d0e930bac7) )
1399
1400   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
1401   ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(99d0dc75) SHA1(b32126eea70c7584d1c34a6ca33282fbaf4b03aa), ROM_SKIP(7) )
1402   ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(2dfdfe62) SHA1(e0554d36ef5cf4b6ce171857ea4f2737f11286a5), ROM_SKIP(7) )
1403   ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(722aee2a) SHA1(bc79433131bed5b08453d1b80324a28a552783de), ROM_SKIP(7) )
1404   ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(919e31b4) SHA1(3807d4629d8277c780dba888c23d17ba47803f27), ROM_SKIP(7) )
1405   ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(a957ac95) SHA1(ddfaca994c06976bee8b123857904e64f40b7f31), ROM_SKIP(7) )
1406   ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(a147ec66) SHA1(6291008158d581b81e025ed34ff0950983c12c67), ROM_SKIP(7) )
1407   ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(206d2f38) SHA1(6aca89df26d3602ff1da3c23f19e0782439623ff), ROM_SKIP(7) )
1408   ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(06559831) SHA1(b2c022457425d7900337cfa2fd1622336c0c0bc5), ROM_SKIP(7) )
1409   ROMX_LOAD( "fish_gr1.63-56", 0x800000, 0x100000, CRC(30c624d2) SHA1(4ced77d1663169d0cb37d6728ec52e67f05064c5), ROM_SKIP(7) )
1410   ROMX_LOAD( "fish_gr1.55-48", 0x800001, 0x100000, CRC(049cd60f) SHA1(8a7615a76b57a4e6ef5d95a5ee6c56086671dbb6), ROM_SKIP(7) )
1411   ROMX_LOAD( "fish_gr1.47-40", 0x800002, 0x100000, CRC(d6aaf3bf) SHA1(1c597bdc0e61fd0941cff5a8a93f24f108bd0daa), ROM_SKIP(7) )
1412   ROMX_LOAD( "fish_gr1.39-32", 0x800003, 0x100000, CRC(7d6ebc69) SHA1(668769297f75f9c367bc5cde26419ed092fc9dd8), ROM_SKIP(7) )
1413   ROMX_LOAD( "fish_gr1.31-24", 0x800004, 0x100000, CRC(6e5fee1f) SHA1(1eca79c8d395f881d0a05f10073998fcae70c3b1), ROM_SKIP(7) )
1414   ROMX_LOAD( "fish_gr1.23-16", 0x800005, 0x100000, CRC(a8b1e9b4) SHA1(066285928e574e656510b90bc212a8d86660bd07), ROM_SKIP(7) )
1415   ROMX_LOAD( "fish_gr1.15-08", 0x800006, 0x100000, CRC(c90080e6) SHA1(a764bdd6b4e9e727f7468a53424a9211ec5fd5a8), ROM_SKIP(7) )
1416   ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(1f20c020) SHA1(71b32386dc0444264f2f1e2a81899e0e9260994c), ROM_SKIP(7) )
1417ROM_END
1418
1419ROM_START( freezeat3 )
1420   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
1421   ROM_LOAD32_BYTE( "prog.hh",              0x000000, 0x040000, CRC(863942e6) SHA1(c7429c8a5c86ff93c64950e201cffca83dd7b7b0) )
1422   ROM_LOAD32_BYTE( "prog.hl",              0x000001, 0x040000, CRC(2acc18ef) SHA1(ead02566f7641b1d1066bd2e257b695e5c7e8437) )
1423   ROM_LOAD32_BYTE( "prog.lh",              0x000002, 0x040000, CRC(948cf20c) SHA1(86c757aa3c849ef5ba94ed4d5dbf10e833dab6bd) )
1424   ROM_LOAD32_BYTE( "prog.ll",              0x000003, 0x040000, CRC(5f44969e) SHA1(32345d7c56a3a890e71f8c71f25414d442b60af8) )
1425
1426   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
1427   ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(36799449) SHA1(bb706fe7fdc68f840702a127eed7d4519dd45869), ROM_SKIP(7) )
1428   ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(23959947) SHA1(a35a6e62c7b2be57d41b1b64be93713cbf897f0a), ROM_SKIP(7) )
1429   ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(4657e4e0) SHA1(b6c07182babcb0a106bf4a8f2e3f524371dd882d), ROM_SKIP(7) )
1430   ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(b6ea4b64) SHA1(176f94f14307c40b9c611d6f6bc9118e498cdfad), ROM_SKIP(7) )
1431   ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(7d4ce71f) SHA1(a1cf5aa9df8dd29c777c10cfdce0925981584261), ROM_SKIP(7) )
1432   ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(02db4fd1) SHA1(fce6f31802bf36d6b006f0b212f553bdf21f9374), ROM_SKIP(7) )
1433   ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(7d496d6c) SHA1(f82db0621729a00acf4077482e9dfab040ac829b), ROM_SKIP(7) )
1434   ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(3aa389d8) SHA1(52502f2f3c91d7c29261f60fe8f489a352399c96), ROM_SKIP(7) )
1435   ROMX_LOAD( "fish_gr1.63-56", 0x800000, 0x100000, CRC(ead678c9) SHA1(f83d467f6685965b6176b10adbd4e35ef808baf3), ROM_SKIP(7) )
1436   ROMX_LOAD( "fish_gr1.55-48", 0x800001, 0x100000, CRC(3591e752) SHA1(df242d2f724edfd78f7191f0ba7a8cde2c09b25f), ROM_SKIP(7) )
1437   ROMX_LOAD( "fish_gr1.47-40", 0x800002, 0x100000, CRC(e29a7a6c) SHA1(0bfb26076b390492eed81d4c4f0852c64fdccfce), ROM_SKIP(7) )
1438   ROMX_LOAD( "fish_gr1.39-32", 0x800003, 0x100000, CRC(e980f957) SHA1(78e8ef07f443ce7991a46005627d5802d36d731c), ROM_SKIP(7) )
1439   ROMX_LOAD( "fish_gr1.31-24", 0x800004, 0x100000, CRC(d90c5221) SHA1(7a330f39f3751d58157f872d92c3c2b91fe60d14), ROM_SKIP(7) )
1440   ROMX_LOAD( "fish_gr1.23-16", 0x800005, 0x100000, CRC(9be0d4de) SHA1(9bb67a1f1db77483e896fed7096c1e23c153ede4), ROM_SKIP(7) )
1441   ROMX_LOAD( "fish_gr1.15-08", 0x800006, 0x100000, CRC(122248af) SHA1(80dd5486106d475bd9f6d78919ebeb176e7becff), ROM_SKIP(7) )
1442   ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(5ae08327) SHA1(822d8292793509ebfbfce27e92a74c78c4328bda), ROM_SKIP(7) )
1443ROM_END
1444
1445ROM_START( freezeat4 )
1446   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
1447   ROM_LOAD32_BYTE( "prog.hh",              0x000000, 0x040000, CRC(80336f5e) SHA1(9946e8eebec2cd68db059f40f535ea212f41913d) )
1448   ROM_LOAD32_BYTE( "prog.hl",              0x000001, 0x040000, CRC(55125520) SHA1(13be4fbf32bcd94a2ea97fd690bd1dfdff146d33) )
1449   ROM_LOAD32_BYTE( "prog.lh",              0x000002, 0x040000, CRC(9d99c794) SHA1(f443f05a5979db66d61ef4174f0369a1cf4b7793) )
1450   ROM_LOAD32_BYTE( "prog.ll",              0x000003, 0x040000, CRC(e03700e0) SHA1(24d41750f02ee7e8fb379e517751b661400aa521) )
1451
1452   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
1453   ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(36799449) SHA1(bb706fe7fdc68f840702a127eed7d4519dd45869), ROM_SKIP(7) )
1454   ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(23959947) SHA1(a35a6e62c7b2be57d41b1b64be93713cbf897f0a), ROM_SKIP(7) )
1455   ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(4657e4e0) SHA1(b6c07182babcb0a106bf4a8f2e3f524371dd882d), ROM_SKIP(7) )
1456   ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(b6ea4b64) SHA1(176f94f14307c40b9c611d6f6bc9118e498cdfad), ROM_SKIP(7) )
1457   ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(7d4ce71f) SHA1(a1cf5aa9df8dd29c777c10cfdce0925981584261), ROM_SKIP(7) )
1458   ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(02db4fd1) SHA1(fce6f31802bf36d6b006f0b212f553bdf21f9374), ROM_SKIP(7) )
1459   ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(7d496d6c) SHA1(f82db0621729a00acf4077482e9dfab040ac829b), ROM_SKIP(7) )
1460   ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(3aa389d8) SHA1(52502f2f3c91d7c29261f60fe8f489a352399c96), ROM_SKIP(7) )
1461   ROMX_LOAD( "fish_gr1.63-56", 0x800000, 0x100000, CRC(c91b6ee4) SHA1(58d2d6b1b9847150b8b3e358842c4a097ef91475), ROM_SKIP(7) )
1462   ROMX_LOAD( "fish_gr1.55-48", 0x800001, 0x100000, CRC(65528e55) SHA1(18020cababed379f77149b7e89e80b294766df31), ROM_SKIP(7) )
1463   ROMX_LOAD( "fish_gr1.47-40", 0x800002, 0x100000, CRC(8fe4187f) SHA1(c9ceec40688617e1251142465d0e608f80a83e40), ROM_SKIP(7) )
1464   ROMX_LOAD( "fish_gr1.39-32", 0x800003, 0x100000, CRC(fdf05a42) SHA1(849e224b68be2fb396ee4cb4729517470af7c282), ROM_SKIP(7) )
1465   ROMX_LOAD( "fish_gr1.31-24", 0x800004, 0x100000, CRC(bb2cd741) SHA1(ac55a54c702d222cb1b9bb480b0f7a71bc315878), ROM_SKIP(7) )
1466   ROMX_LOAD( "fish_gr1.23-16", 0x800005, 0x100000, CRC(ea8c5984) SHA1(eca1619c17dfac154a2024ec49b4b4f9f06a50c9), ROM_SKIP(7) )
1467   ROMX_LOAD( "fish_gr1.15-08", 0x800006, 0x100000, CRC(0b00c816) SHA1(879b0e9d92fe737d740c348dc1cc376c8abfbdb8), ROM_SKIP(7) )
1468   ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(a84335c3) SHA1(340f5ddb9bff1ecd469eab8be36cc0ede84f1f5e), ROM_SKIP(7) )
1469ROM_END
1470
1471ROM_START( freezeat5 )
1472   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
1473   ROM_LOAD32_BYTE( "prog.hh",              0x000000, 0x040000, CRC(95c4fc64) SHA1(cd00efe7f760ef1e4cdc4bc8a3b368427cb15d8a) )
1474   ROM_LOAD32_BYTE( "prog.hl",              0x000001, 0x040000, CRC(ffb9cb71) SHA1(35d6a5440d63bc5b94c4447645365039169da368) )
1475   ROM_LOAD32_BYTE( "prog.lh",              0x000002, 0x040000, CRC(3ddacd80) SHA1(79f9650531847eefd83908b6ea1e8362688b377c) )
1476   ROM_LOAD32_BYTE( "prog.ll",              0x000003, 0x040000, CRC(95ebefb0) SHA1(b88b12adabd7b0902c3a78919bcec8d9a2b04168) )
1477
1478   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
1479   ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(404a10c3) SHA1(8e353ac7608bd54f0fea610c85166ad14f2faadb), ROM_SKIP(7) )
1480   ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(0b262f2f) SHA1(2a963cb5c3344091406d090edfdda498709c6aa6), ROM_SKIP(7) )
1481   ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(43f86d26) SHA1(b31d36b11052514b5bcd5bf8e400457ca572c306), ROM_SKIP(7) )
1482   ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(5cf0228f) SHA1(7a8c59cf9a7744e9f332db5f661f507323375968), ROM_SKIP(7) )
1483   ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(7a24ff98) SHA1(db9e0e8bb417f187267a6e4fc1e66ff060ee4096), ROM_SKIP(7) )
1484   ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(ea163c93) SHA1(d07ed26191d36497c56b15774625a49ecb958386), ROM_SKIP(7) )
1485   ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(d364534f) SHA1(153908bb8929a898945f768f8bc3d853c6aeaceb), ROM_SKIP(7) )
1486   ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(7ba4cb0d) SHA1(16bd487123f499b7080596dc76253081179a0f66), ROM_SKIP(7) )
1487   ROMX_LOAD( "fish_gr1.63-56", 0x800000, 0x100000, CRC(0e1fc4a9) SHA1(a200bb0af5f1e2c3f8d221ae4e9ba55b9dfb8550), ROM_SKIP(7) )
1488   ROMX_LOAD( "fish_gr1.55-48", 0x800001, 0x100000, CRC(b696b875) SHA1(16dc4d5cee3f08360cf19926584419c21d781f45), ROM_SKIP(7) )
1489   ROMX_LOAD( "fish_gr1.47-40", 0x800002, 0x100000, CRC(e78d9302) SHA1(f8b5ed992c433d63677edbeafd3e465b1d42b455), ROM_SKIP(7) )
1490   ROMX_LOAD( "fish_gr1.39-32", 0x800003, 0x100000, CRC(9b50374c) SHA1(d8af3c9d8e0459e24b974cdf2e75c7c39582912f), ROM_SKIP(7) )
1491   ROMX_LOAD( "fish_gr1.31-24", 0x800004, 0x100000, CRC(b6a19b7e) SHA1(5668b27db4dade8efb1524b8ecd1fe78498e8460), ROM_SKIP(7) )
1492   ROMX_LOAD( "fish_gr1.23-16", 0x800005, 0x100000, CRC(ff835b67) SHA1(19da2de1d067069871c33c8b25fd2eac2d03f627), ROM_SKIP(7) )
1493   ROMX_LOAD( "fish_gr1.15-08", 0x800006, 0x100000, CRC(8daf6995) SHA1(2f44031378b5fb1ba1f80a966dbe902316dc6fe8), ROM_SKIP(7) )
1494   ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(3676ac70) SHA1(640c4d4f53ca2bcae2009e402fd6ad70e40defa4), ROM_SKIP(7) )
1495ROM_END
1496
1497ROM_START( freezeat6 )
1498   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
1499   ROM_LOAD32_BYTE( "prog.hh",              0x000000, 0x040000, CRC(120711fe) SHA1(387e3cc8a1a9ea7d65c528387891d09ed9889fe3) )
1500   ROM_LOAD32_BYTE( "prog.hl",              0x000001, 0x040000, CRC(18dd292a) SHA1(00e79851140716985f43594142c97e510a06b24a) )
1501   ROM_LOAD32_BYTE( "prog.lh",              0x000002, 0x040000, CRC(ce387e72) SHA1(021a274da0b828550a47c3778e1059d4e759693a) )
1502   ROM_LOAD32_BYTE( "prog.ll",              0x000003, 0x040000, CRC(9b307b7c) SHA1(71b696802fe7c867525d2626351dcfacedabd696) )
1503
1504   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
1505   ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(293a3308) SHA1(e4c88759c3b8f8a359db83817dbd0428350b4f7e), ROM_SKIP(7) )
1506   ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(18bb4bdf) SHA1(1f6c49b3b5946390fa7582b531f8d9af3baa2567), ROM_SKIP(7) )
1507   ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(1faedcc6) SHA1(1e4ecbe4553fb3ebfbd03bd7e16066ccb531d00b), ROM_SKIP(7) )
1508   ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(536bc349) SHA1(06d7ac38b2c8cdc85e2cb531bba9c836e50c8247), ROM_SKIP(7) )
1509   ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(813d4a31) SHA1(e024f9da2f15a482d8142870baf487297b995ed9), ROM_SKIP(7) )
1510   ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(f881514b) SHA1(a694f90621e2c1569a6a5ed8920838ba5506f72e), ROM_SKIP(7) )
1511   ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(d7634655) SHA1(d7ac83c0fa5d0ec57d096d4d704fe99ee8160e09), ROM_SKIP(7) )
1512   ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(3fca32a3) SHA1(22753a9678e04d9355238e013e58d9f45315579d), ROM_SKIP(7) )
1513   ROMX_LOAD( "fish_gr1.63-56", 0x800000, 0x100000, CRC(a2b89d3a) SHA1(9cfcd0b88dea192ba39efcdccc78d1a0fd8f3388), ROM_SKIP(7) )
1514   ROMX_LOAD( "fish_gr1.55-48", 0x800001, 0x100000, CRC(766822a8) SHA1(2c9b14542a5467c1a3451559ea296da09c2cfdb9), ROM_SKIP(7) )
1515   ROMX_LOAD( "fish_gr1.47-40", 0x800002, 0x100000, CRC(112b519c) SHA1(f0e1ed1b8ad271fa9708f513b11d5cca6e550668), ROM_SKIP(7) )
1516   ROMX_LOAD( "fish_gr1.39-32", 0x800003, 0x100000, CRC(435b5d37) SHA1(ecb6e7271d993f8e315b85e69166838e66dd41a8), ROM_SKIP(7) )
1517   ROMX_LOAD( "fish_gr1.31-24", 0x800004, 0x100000, CRC(2637ae7f) SHA1(5e0bd0e08d8c1eaae725b4d55030c2698abd46e7), ROM_SKIP(7) )
1518   ROMX_LOAD( "fish_gr1.23-16", 0x800005, 0x100000, CRC(e732f1bf) SHA1(a228aee0cc36a0089716f20bfa75d87750692adb), ROM_SKIP(7) )
1519   ROMX_LOAD( "fish_gr1.15-08", 0x800006, 0x100000, CRC(7d4e2d9e) SHA1(4cb9b754b7585df4cae6bdd7085a57729d53e643), ROM_SKIP(7) )
1520   ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(8ea036af) SHA1(1f9baec6712e0ba0e8a744529e41799217760194), ROM_SKIP(7) )
1521ROM_END
1522
1523
1524/*************************************
1525 *
1526 *  Driver initialization
1527 *
1528 *************************************/
1529
1530static void cojag_common_init(running_machine &machine, UINT16 gpu_jump_offs, UINT16 spin_pc)
1531{
1532   cojag_state *state = machine.driver_data<cojag_state>();
1533   /* copy over the ROM */
1534   state->m_main_cpu = machine.device<cpu_device>("maincpu");
1535   cojag_is_r3000 = (state->m_main_cpu->type() == R3041BE);
1536
1537   /* install synchronization hooks for GPU */
1538   if (cojag_is_r3000)
1539      machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x04f0b000 + gpu_jump_offs, 0x04f0b003 + gpu_jump_offs, FUNC(gpu_jump_w));
1540   else
1541      machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf0b000 + gpu_jump_offs, 0xf0b003 + gpu_jump_offs, FUNC(gpu_jump_w));
1542   machine.device("gpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf03000 + gpu_jump_offs, 0xf03003 + gpu_jump_offs, FUNC(gpu_jump_r));
1543   state->m_gpu_jump_address = &jaguar_gpu_ram[gpu_jump_offs/4];
1544   state->m_gpu_spin_pc = 0xf03000 + spin_pc;
1545
1546   /* init the sound system and install DSP speedups */
1547   cojag_sound_init(machine);
1548}
1549
1550
1551static DRIVER_INIT( area51a )
1552{
1553   cojag_state *state = machine.driver_data<cojag_state>();
1554   cojag_common_init(machine, 0x5c4, 0x5a0);
1555
1556#if ENABLE_SPEEDUP_HACKS
1557   /* install speedup for main CPU */
1558   state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa02030, 0xa02033, FUNC(area51_main_speedup_w));
1559#endif
1560}
1561
1562
1563static DRIVER_INIT( area51 )
1564{
1565   cojag_state *state = machine.driver_data<cojag_state>();
1566   cojag_common_init(machine, 0x0c0, 0x09e);
1567
1568#if ENABLE_SPEEDUP_HACKS
1569   /* install speedup for main CPU */
1570   state->m_main_speedup_max_cycles = 120;
1571   state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x100062e8, 0x100062eb, FUNC(cojagr3k_main_speedup_r));
1572#endif
1573}
1574
1575static DRIVER_INIT( maxforce )
1576{
1577   cojag_state *state = machine.driver_data<cojag_state>();
1578   cojag_common_init(machine, 0x0c0, 0x09e);
1579
1580   /* patch the protection */
1581   state->m_rom_base[0x220/4] = 0x03e00008;
1582
1583#if ENABLE_SPEEDUP_HACKS
1584   /* install speedup for main CPU */
1585   state->m_main_speedup_max_cycles = 120;
1586   state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x1000865c, 0x1000865f, FUNC(cojagr3k_main_speedup_r));
1587#endif
1588}
1589
1590
1591static DRIVER_INIT( area51mx )
1592{
1593   cojag_state *state = machine.driver_data<cojag_state>();
1594   cojag_common_init(machine, 0x0c0, 0x09e);
1595
1596   /* patch the protection */
1597   state->m_rom_base[0x418/4] = 0x4e754e75;
1598
1599#if ENABLE_SPEEDUP_HACKS
1600   /* install speedup for main CPU */
1601   state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa19550, 0xa19557, FUNC(area51mx_main_speedup_w));
1602#endif
1603}
1604
1605
1606static DRIVER_INIT( a51mxr3k )
1607{
1608   cojag_state *state = machine.driver_data<cojag_state>();
1609   cojag_common_init(machine, 0x0c0, 0x09e);
1610
1611   /* patch the protection */
1612   state->m_rom_base[0x220/4] = 0x03e00008;
1613
1614#if ENABLE_SPEEDUP_HACKS
1615   /* install speedup for main CPU */
1616   state->m_main_speedup_max_cycles = 120;
1617   state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x10006f0c, 0x10006f0f, FUNC(cojagr3k_main_speedup_r));
1618#endif
1619}
1620
1621
1622static DRIVER_INIT( fishfren )
1623{
1624   cojag_state *state = machine.driver_data<cojag_state>();
1625   cojag_common_init(machine, 0x578, 0x554);
1626
1627#if ENABLE_SPEEDUP_HACKS
1628   /* install speedup for main CPU */
1629   state->m_main_speedup_max_cycles = 200;
1630   state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x10021b60, 0x10021b63, FUNC(cojagr3k_main_speedup_r));
1631#endif
1632}
1633
1634
1635static void init_freeze_common(running_machine &machine, offs_t main_speedup_addr)
1636{
1637   cojag_state *state = machine.driver_data<cojag_state>();
1638   cojag_common_init(machine, 0x0bc, 0x09c);
1639
1640#if ENABLE_SPEEDUP_HACKS
1641   /* install speedup for main CPU */
1642   state->m_main_speedup_max_cycles = 200;
1643   if (main_speedup_addr != 0)
1644      state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(main_speedup_addr, main_speedup_addr + 3, FUNC(cojagr3k_main_speedup_r));
1645   state->m_main_gpu_wait = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0400d900, 0x0400d900 + 3, FUNC(main_gpu_wait_r));
1646#endif
1647}
1648
1649static DRIVER_INIT( freezeat ) { init_freeze_common(machine, 0x1001a9f4); }
1650static DRIVER_INIT( freezeat2 ) { init_freeze_common(machine, 0x1001a8c4); }
1651static DRIVER_INIT( freezeat3 ) { init_freeze_common(machine, 0x1001a134); }
1652static DRIVER_INIT( freezeat4 ) { init_freeze_common(machine, 0x1001a134); }
1653static DRIVER_INIT( freezeat5 ) { init_freeze_common(machine, 0x10019b34); }
1654static DRIVER_INIT( freezeat6 ) { init_freeze_common(machine, 0x10019684); }
1655
1656
1657static DRIVER_INIT( vcircle )
1658{
1659   cojag_state *state = machine.driver_data<cojag_state>();
1660   cojag_common_init(machine, 0x5c0, 0x5a0);
1661
1662#if ENABLE_SPEEDUP_HACKS
1663   /* install speedup for main CPU */
1664   state->m_main_speedup_max_cycles = 50;
1665   state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x12005b34, 0x12005b37, FUNC(cojagr3k_main_speedup_r));
1666#endif
1667}
1668
1669
1670
1671/*************************************
1672 *
1673 *  Game driver(s)
1674 *
1675 *************************************/
1676
1677GAME( 1996, area51,    0,        cojagr3k,  area51,   area51,   ROT0, "Atari Games", "Area 51 (R3000)", 0 )
1678GAME( 1995, area51t,   area51,   cojag68k,  area51,   area51a,  ROT0, "Atari Games (Time Warner license)", "Area 51 (Time Warner license)", 0 )
1679GAME( 1995, area51a,   area51,   cojag68k,  area51,   area51a,  ROT0, "Atari Games", "Area 51 (Atari Games license)", 0 )
1680GAME( 1995, fishfren,  0,        cojagr3k,  fishfren, fishfren, ROT0, "Time Warner Interactive", "Fishin' Frenzy (prototype)", 0 )
1681GAME( 1996, freezeat,  0,        cojagr3k,  freezeat, freezeat, ROT0, "Atari Games", "Freeze (Atari) (prototype, English voice, 96/10/25)", 0 )
1682GAME( 1996, freezeatjp,freezeat, cojagr3k,  freezeat, freezeat, ROT0, "Atari Games", "Freeze (Atari) (prototype, Japanese voice, 96/10/25)", 0 )
1683GAME( 1996, freezeat2, freezeat, cojagr3k,  freezeat, freezeat2,ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/10/18)", 0 )
1684GAME( 1996, freezeat3, freezeat, cojagr3k,  freezeat, freezeat3,ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/10/07)", 0 )
1685GAME( 1996, freezeat4, freezeat, cojagr3k,  freezeat, freezeat4,ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/10/03)", 0 )
1686GAME( 1996, freezeat5, freezeat, cojagr3k,  freezeat, freezeat5,ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/09/20, AMOA-96)", 0 )
1687GAME( 1996, freezeat6, freezeat, cojagr3k,  freezeat, freezeat6,ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/09/07, Jamma-96)", 0 )
1688GAME( 1996, maxforce,  0,        cojagr3k,  area51,   maxforce, ROT0, "Atari Games", "Maximum Force v1.05", 0 )
1689GAME( 1996, maxf_102,  maxforce, cojagr3k,  area51,   maxforce, ROT0, "Atari Games", "Maximum Force v1.02", 0 )
1690GAME( 1996, maxf_ng,   maxforce, cojagr3k,  area51,   maxforce, ROT0, "Atari Games", "Maximum Force (No Gore version)", 0 )
1691GAME( 1998, area51mx,  0,        cojag68k,  area51,   area51mx, ROT0, "Atari Games", "Area 51 / Maximum Force Duo v2.0", 0 )
1692GAME( 1998, a51mxr3k,  area51mx, cojagr3k,  area51,   a51mxr3k, ROT0, "Atari Games", "Area 51 / Maximum Force Duo (R3000)", 0 )
1693GAME( 1996, vcircle,   0,        cojagr3k,  vcircle,  vcircle,  ROT0, "Atari Games", "Vicious Circle (prototype)", 0 )
src/mame/drivers/jaguar.c
r0r11289
1/***************************************************************************
2
3   Atari Jaguar (Home) & Atari CoJag (Arcade) hardware
4
5   The CoJag arcade system is based on the Jaguar system, but with an upgraded
6   main CPU (68020 or MIPS instead of the plain 68000 found in the Jaguar)
7
8    driver by Aaron Giles
9   console support originally by Nathan Woods
10
11    CoJag Games supported:
12        * Area 51 (3 Sets)
13        * Maximum Force (2 Sets)
14        * Area 51/Maximum Force Duo (2 Sets)
15        * Vicious Circle
16        * Fishin' Frenzy
17        * Freeze
18
19    To do:
20        * (CoJag) map out unused RAM per-game via memory_nop_read/write
21      * (Jaguar) support is very poor, most games aren't properly playable
22        or have severe performance issues or crashes related to the unsafe
23        blitter code.  Only Pinball Fantasies is fully playable albeit
24        without sound.
25       * The code (GPU/DSP access) should probably be refactored around the
26        16-bit interface from the plain 68k, the driver currently uses
27        trampoline functions due to the original driver being entirely
28        32-bit due to the CPUs on CoJag.
29
30    Note: There is believed to be a 68020 version of Maximum Force
31            (not confirmed or dumped)
32
33****************************************************************************
34
35    Area51/Maximum Force (c)1997 Atari Games
36    Maximum Force
37    A055451
38
39    Components:
40    sdt79r3041-20j
41    Atari Jaguar CPU V1.0 6sc880hf106
42    Atari Jaguar DSP V1.0 sc414201ft (has Motorolla logo)
43    Altera epm7128elc84-15 marked A-21652
44    VIA vt83c461 IDE controller
45    Actel a1010b marked A-22096 near IDE and gun inputs
46    Dallas ds1232s watchdog
47    52MHz osc near Altera PLCC
48    40MHz osc near 79R3041
49    14.318180MHz osc near Jag DSP
50    12x hm514260cj7 RAM (near Jaguar CPU/DSP)
51    4x  sdt71256 RAM (near Boot ROMs's)
52    Atmel atf16v8b marked a-21647 (near Jag CPU)
53    Altera ep22lc-10 marked A-21648 (near Jag DSP)
54    ICT 22cv10aj marked A-21649 (near Jag CPU)
55    ICT 22cv10aj marked A-21650 (near Jag CPU)
56    ICT 22cv10aj marked A-21651 (near Jag CPU)
57    tea6320t
58    AKM ak4310vm
59    tda1554q amplifier
60    Microchip 28c16a-15 BRAM
61
62    ROM's:
63    27c4001
64    R3K MAX/A51 KIT
65    LL
66    (c)1997 Atari
67    V 1.0
68
69    27c4001
70    R3K MAX/A51 KIT
71    LH
72    (c)1997 Atari
73    V 1.0
74
75    27c4001
76    R3K MAX/A51 KIT
77    HL
78    (c)1997 Atari
79    V 1.0
80
81    27c4001
82    R3K MAX/A51 KIT
83    HH
84    (c)1997 Atari
85    V 1.0
86
87    Jumpers:
88    jsp1 (1/2 connected= w/sub 2/3 connected= normal speaker)
89    jsp2 (1/2 connected= w/sub 2/3 connected= normal speaker)
90    jamaud (1/2 connected=stereo 2/3 connected=mono)
91    jimpr (1/2 connected=hi video R impedance 2/3 connected=lo)
92    jimpg (1/2 connected=hi video G impedance 2/3 connected=lo)
93    jimpb (1/2 connected=hi video B impedance 2/3 connected=lo)
94
95    Connectors:
96    idea  standard IDE connector
97    ideb laptop size IDE connector
98    jgun1 8 pin gun input
99    jgun2 8 pin gun input
100    xtracoin 1 6 pin (coin3/4 bills?)
101    jvupdn 3 pin (?)
102    jsync 3 pin (?)
103    JAMMA
104    jspkr left/right/subwoofer output
105    hdpower 4 pin PC power connector for HD
106
107****************************************************************************
108
109Area 51 (Time Warner Interactive License)
110Atari/Mesa Logic, 1995
111
112This game runs on Atari Cojag 68k hardware.
113
114PCB Layouts
115-----------
116
117Main Board:
118
119COJAG A053538
120ATARI GAMES (C) 1994
121(Atari comment near AMP - 'MMM, DONUTS.')
122|--------------------------------------------------|
123|TDA1554Q  TEA6320T   AK4310            JXCLKTRM   |
124|JSPKR     ST91D314                        XC7336  |
125|         JSP1 JWELLSR  PAL4  PAL5                 |
126|   JSP4  JSP2 PAL1            45160 45160  *   *  |
127| HDPOWER JSP3 JWELLSB                        JXBUS|
128| SELFTEST     PAL2     PAL6   45160 45160  *   *  |
129|     LED      JWELLSG                             |
130|     LED              |------|45160 45160  *   *  |
131|J    LED              |JAGUAR|                    |
132|A                     | CPU  |45160 45160  *   *  |
133|M                     |      |                    |
134|M                     |------|                    |
135|A                                                 |
136|   14.31818MHz        |------|                    |
137|   LM613              |JAGUAR|                    |
138|   52MHz  PAL3        | DSP  |                    |
139|                      |      |                    |
140|  JSYNC               |------|                    |
141|  JVUPDN           DIP8                           |
142|              A1010B                              |
143|JPLY3   JVCR            VT83C461                  |
144|                                                  |
145|                               LED                |
146|  JPLY4    JGUN2  JGUN1  JIDEB                    |
147|--------------------------------------------------|
148Notes:
149      JAGUAR CPU - Atari Jaguar CPU (QFP208)
150      JAGUAR DSP - Atari Jaguar DSP (QFP160)
151      45160      - TMS45160DZ-70 512K x16 DRAM (SOJ40)
152                   Note: This RAM is in banks. There are 4 banks, each bank is 2MBytes x 64bit
153                   Only banks 0 and 1 are populated.
154      *          - Unpopulated DRAM positions (banks 2 and 3)
155      TDA1554Q   - Philips TDA1554Q power AMP
156      TEA6320T   - Philips TEA6320T op AMP (SOP32)
157      AK4310     - AKM AK4310VM (SOIC24)
158      ST91D314   - STS Microelectronics ST91D314 3403 op AMP (SOIC14)
159      PAL1       - ATMEL ATF16V8B PAL (labelled '136105-0006', PLCC20)
160      PAL2       - ATMEL ATF16V8B PAL (labelled '136105-0006', PLCC20)
161      PAL3       - ATMEL ATF16V8B PAL (labelled '136105-0007', PLCC20)
162      PAL4, PAL5 - Philips PL22V10-10A PAL (labelled 'MYF 136105-0008', PLCC28)
163      PAL6       - ATMEL ATF16V8B (labelled '136105-0005', PLCC20)
164      A1010B     - ACTEL A1010B Complex Programmable Logic Device (labeled 'MYF 136105-0010', PLCC44)
165      XC7336     - Xilinx XC7336 Complex PRogrammable Logic Device (labelled 'MYF 136105-0009', PLCC44)
166      VT83C461   - VIA VT83C461 IDE Hard Drive Controller (QFP100)
167      LM613      - (DIP16)
168      SELFTEST   - Test Switch
169      HDPOWER    - Standard (PC-type) 4 pin hard drive power connector
170      JSP1       - 3 pin jumper block, set to 2-3
171      JSP2       - 3 pin jumper block, set to 2-3
172      JSP3       - 3 pin jumper block, jumper not installed
173      JSP4       - 3 pin jumper block, set to 2-3
174      JWELLSR    - 3 pin jumper block, set to 2-3
175      JWELLSB    - 3 pin jumper block, set to 2-3
176      JWELLSG    - 3 pin jumper block, set to 2-3
177      JSYNC      - 3 pin jumper block, jumper not installed
178      JVUPDN     - 3 pin jumper block, jumper not installed
179      JVCR       - 3 pin jumper block, jumper not installed
180      JXCLKTRM   - 2 pin header, not shorted
181      JPLY3      - Connector for player 3 controls
182      JPLY4      - Connector for player 4 controls
183      JGUN1      - Connector for player 1 gun
184      JGUN2      - Connector for player 2 gun
185      JIDEB      - Connector for 40 pin IDE cable connected to Quantum Fireball 1080AT IDE hard drive (C/H/S = 2112/16/63)
186      JSPKR      - Connector for left/right speaker for stereo sound output
187      DIP8       - Unpopulated DIP8 socket
188      JXBUS      - 96 pin connector to top board
189
190
191Top Board:
192
193EC20X32
194A053448
195ATARI GAMES (C) 1994
196|------------------------------|
197|               136105-0002C.3P|
198| 71256                        |
199|               136105-0001C.3M|
200| 71256                        |
201|               136105-0000C.3K|
202| 71256                        |
203|               136105-0003C.3H|
204| 71256                        |
205|              LED             |
206|                              |
207| AT28C16  DS1232   XC7354     |
208|                              |
209|                              |
210|      MC68EC020               |
211|                              |
212| 50MHz                        |
213|------------------------------|
214Notes:
215      MC68EC020       - Motorola 68EC020FG25 CPU clocked at 25MHz (QFP100)
216      AT28C16         - ATMEL 2k x8 EEPROM (DIP24)
217      XC7354          - Xilinx XC7354 Complex Programmable Logic Device (labelled 'MYF 136105-0004', PLCC68, socketed)
218      DS1232          - Dallas DS1232 System Reset IC (DIP8)
219      71256           - 32K x8 SRAM (SOJ28)
220      136105-0002C.3P - 27C040 EPROM (labelled 'AREA 51 136105-0002C (C)1995 ATARI GMS CS 55FE', DIP32)
221      136105-0001C.3M - 27C040 EPROM (labelled 'AREA 51 136105-0001C (C)1995 ATARI GMS CS 3DFD', DIP32)
222      136105-0000C.3K - 27C040 EPROM (labelled 'AREA 51 136105-0000C (C)1995 ATARI GMS CS 63FC', DIP32)
223      136105-0003C.3H - 27C040 EPROM (labelled 'AREA 51 136105-0003C (C)1995 ATARI GMS CS 45FF', DIP32)
224
225****************************************************************************
226
227Maximum Force
228Atari, 1997
229
230PCB Layout
231----------
232
233MAXIMUM FORCE A055451 ATARI GAMES (C) 1996
234|-----------------------------------------------------------------------------------|
235|HM514260CJ7 HM514260CJ7 HM514260CJ7 HM514260CJ7            AT28C16                 |
236|                                                                                   |
237|HM514260CJ7 HM514260CJ7 HM514260CJ7 HM514260CJ7            PROGLL.17Y   PROGLH.21Y |
238|                                                                                   |
239|HM514260CJ7 HM514260CJ7 HM514260CJ7 HM514260CJ7            PROGHL.21V   PROGHH.21V |
240|                                                                                   |
241|                                                                                   |
242|             |------|      |------|                                                |
243|             |JAGUAR|      |JAGUAR|                                                |
244|GAL     GAL  |GPU   |      |DSP   |                     |----------|               |
245|             |------|      |------|                     |          |               |
246|                                                        |IDT       |               |
247|GAL     GAL                                     40MHz   |79R3041-20|               |
248|                                          GAL           |          |               |
249|                                    14.31818MHz         |----------|           IDE |
250|AK4310VM                                                                      CONN |
251|                                                       |-----------|               |
252|LM78L05                                     52MHz      |ALTERA MAX |               |
253|                                                       |EPM7128ELC84               |
254|        TEA6320                                        |           |               |
255|78L09                                    LM613         |           |      VIA      |
256|            MONO/STEREO                                |-----------|      VT83C461 |
257|TDA1554           SELFTEST                                                         |
258|                                                  DS1232      ACTEL_A1010B         |
259|           HDD_PWR                                                                 |
260| JSPKR |--|           JAMMA            |--| JSYNC  JVUPDN   XTRACOIN1  JGUN1  JGUN2|
261|-------|  |----------------------------|  |----------------------------------------|
262Notes:
263      JGUN1 / JGUN2 - Connector for Guns
264      VIA VT83C461 - IDE Controller
265      JSPKR - Speaker Output Connector (for use with Stereo jumper)
266
267****************************************************************************
268
269    Memory map (TBA)
270
271    ========================================================================
272    MAIN CPU
273    ========================================================================
274
275    ------------------------------------------------------------
276    000000-3FFFFF   R/W   xxxxxxxx xxxxxxxx   DRAM 0
277    400000-7FFFFF   R/W   xxxxxxxx xxxxxxxx   DRAM 1
278    800000-BFFFFF   R     xxxxxxxx xxxxxxxx   Graphic ROM bank
279    C00000-DFFFFF   R     xxxxxxxx xxxxxxxx   Sound ROM bank
280    F00000-F000FF   R/W   xxxxxxxx xxxxxxxx   Tom Internal Registers
281    F00400-F005FF   R/W   xxxxxxxx xxxxxxxx   CLUT - color lookup table A
282    F00600-F007FF   R/W   xxxxxxxx xxxxxxxx   CLUT - color lookup table B
283    F00800-F00D9F   R/W   xxxxxxxx xxxxxxxx   LBUF - line buffer A
284    F01000-F0159F   R/W   xxxxxxxx xxxxxxxx   LBUF - line buffer B
285    F01800-F01D9F   R/W   xxxxxxxx xxxxxxxx   LBUF - line buffer currently selected
286    F02000-F021FF   R/W   xxxxxxxx xxxxxxxx   GPU control registers
287    F02200-F022FF   R/W   xxxxxxxx xxxxxxxx   Blitter registers
288    F03000-F03FFF   R/W   xxxxxxxx xxxxxxxx   Local GPU RAM
289    F08800-F08D9F   R/W   xxxxxxxx xxxxxxxx   LBUF - 32-bit access to line buffer A
290    F09000-F0959F   R/W   xxxxxxxx xxxxxxxx   LBUF - 32-bit access to line buffer B
291    F09800-F09D9F   R/W   xxxxxxxx xxxxxxxx   LBUF - 32-bit access to line buffer currently selected
292    F0B000-F0BFFF   R/W   xxxxxxxx xxxxxxxx   32-bit access to local GPU RAM
293    F10000-F13FFF   R/W   xxxxxxxx xxxxxxxx   Jerry
294    F14000-F17FFF   R/W   xxxxxxxx xxxxxxxx   Joysticks and GPIO0-5
295    F18000-F1AFFF   R/W   xxxxxxxx xxxxxxxx   Jerry DSP
296    F1B000-F1CFFF   R/W   xxxxxxxx xxxxxxxx   Local DSP RAM
297    F1D000-F1DFFF   R     xxxxxxxx xxxxxxxx   Wavetable ROM
298    ------------------------------------------------------------
299
300  Jaguar System Notes:
301
302   Protection Check
303
304   At power on, a checksum is performed on the cart to ensure it has been
305   certified by Atari. The actual checksum calculation is performed by the GPU,
306   the result being left in GPU RAM at address f03000. The GPU is instructed to
307   do the calculation when the bios sends a 1 to f02114 while it is in the
308   initialisation stage. The bios then loops, waiting for the GPU to finish the
309   calculation. When it does, it sets bit 15 of f02114 high. The bios then does
310   the compare of the checksum. The checksum algorithm is unknown, but the
311   final result must be 03d0dead. The bios checks for this particular result,
312   and if found, the cart is allowed to start. Otherwise, the background turns
313   red, and the console freezes.
314
315
316   Jaguar Logo
317
318   A real Jaguar will show the red Jaguar logo, the falling white Atari letters,
319   and the turning jaguar's head, accompanied by the sound of a flushing toilet.
320   The cart will then start. All Jaguar emulators (including this one) skip the
321   logo with the appropriate memory hack. The cart can also instruct the logo
322   be skipped by placing non-zero at location 800408. We do the same thing when
323   the cart is loaded (see the DEVICE_IMAGE_LOAD section below).
324
325
326   Start Address
327
328   The start address of a cart may be found at 800404. It is normally 802000.
329
330***************************************************************************/
331
332
333#include "emu.h"
334#include "cpu/m68000/m68000.h"
335#include "cpu/mips/r3000.h"
336#include "cpu/jaguar/jaguar.h"
337#include "machine/idectrl.h"
338#include "machine/nvram.h"
339#include "sound/dac.h"
340#include "includes/jaguar.h"
341#include "emuopts.h"
342#include "imagedev/cartslot.h"
343#include "imagedev/snapquik.h"
344#include "sound/dac.h"
345#include "machine/eeprom.h"
346
347#define COJAG_CLOCK         XTAL_52MHz
348#define R3000_CLOCK         XTAL_40MHz
349#define M68K_CLOCK         XTAL_50MHz
350
351static QUICKLOAD_LOAD( jaguar );
352static DEVICE_START( jaguar_cart );
353static DEVICE_IMAGE_LOAD( jaguar );
354
355
356class cojag_state : public driver_device
357{
358public:
359   cojag_state(running_machine &machine, const driver_device_config_base &config)
360      : driver_device(machine, config),
361        m_nvram(*this, "nvram") { }
362
363   required_shared_ptr<UINT32>   m_nvram;
364   cpu_device *m_main_cpu;
365   UINT32 m_misc_control_data;
366   UINT8 m_eeprom_enable;
367   UINT32 *m_rom_base;
368   UINT32 *m_gpu_jump_address;
369   UINT8 m_gpu_command_pending;
370   UINT32 m_gpu_spin_pc;
371   UINT32 *m_main_speedup;
372   int m_main_speedup_hits;
373   UINT64 m_main_speedup_last_cycles;
374   UINT64 m_main_speedup_max_cycles;
375   UINT32 *m_main_gpu_wait;
376};
377
378
379
380/*************************************
381 *
382 *  Global variables
383 *
384 *************************************/
385
386UINT32 *jaguar_shared_ram;
387UINT32 *jaguar_gpu_ram;
388UINT32 *jaguar_gpu_clut;
389UINT32 *jaguar_dsp_ram;
390UINT32 *jaguar_wave_rom;
391UINT32* high_rom_base;
392UINT8 cojag_is_r3000;
393static int is_jaguar;
394
395
396
397/*************************************
398 *
399 *  Local variables
400 *
401 *************************************/
402
403static UINT32 joystick_data;
404static UINT32 *rom_base;
405static size_t rom_size;
406static UINT32 *cart_base;
407static size_t cart_size;
408static UINT8 eeprom_bit_count;
409static UINT8 protection_check = 0;   /* 0 = check hasn't started yet; 1= check in progress; 2 = check is finished. */
410extern UINT8 blitter_status;
411static UINT8 using_cart = 0;
412
413static IRQ_CALLBACK(jaguar_irq_callback)
414{
415   return (irqline == 6) ? 0x40 : -1;
416}
417
418
419
420/*************************************
421 *
422 *  Machine init
423 *
424 *************************************/
425
426static MACHINE_RESET( cojag )
427{
428   cojag_state *state = machine.driver_data<cojag_state>();
429   UINT8 *rom = machine.region("user2")->base();
430
431   /* 68020 only: copy the interrupt vectors into RAM */
432   if (!cojag_is_r3000)
433      memcpy(jaguar_shared_ram, state->m_rom_base, 0x10);
434
435   /* configure banks for gfx/sound ROMs */
436   if (rom)
437   {
438      /* graphics banks */
439      if (cojag_is_r3000)
440      {
441         memory_configure_bank(machine, "bank1", 0, 2, rom + 0x800000, 0x400000);
442         memory_set_bank(machine, "bank1", 0);
443      }
444      memory_configure_bank(machine, "bank8", 0, 2, rom + 0x800000, 0x400000);
445      memory_set_bank(machine, "bank8", 0);
446
447      /* sound banks */
448      memory_configure_bank(machine, "bank2", 0, 8, rom + 0x000000, 0x200000);
449      memory_configure_bank(machine, "bank9", 0, 8, rom + 0x000000, 0x200000);
450      memory_set_bank(machine, "bank2", 0);
451      memory_set_bank(machine, "bank9", 0);
452   }
453
454   /* clear any spinuntil stuff */
455   jaguar_gpu_resume(machine);
456   jaguar_dsp_resume(machine);
457
458   /* halt the CPUs */
459   jaguargpu_ctrl_w(machine.device("gpu"), G_CTRL, 0, 0xffffffff);
460   jaguardsp_ctrl_w(machine.device("audiocpu"), D_CTRL, 0, 0xffffffff);
461
462   /* set blitter idle flag */
463   blitter_status = 1;
464
465   // normal handling of 'protection'
466   is_jaguar = 0;
467}
468
469
470static MACHINE_RESET( jaguar )
471{
472   device_set_irq_callback(machine.device("maincpu"), jaguar_irq_callback);
473
474   protection_check = 0;
475
476   /* Set up pointers for Jaguar logo */
477
478   memcpy(jaguar_shared_ram, rom_base, 0x400);   // do not increase, or Doom breaks
479
480   device_set_input_line(machine.device("maincpu"), INPUT_LINE_RESET, PULSE_LINE);
481
482   /* clear any spinuntil stuff */
483   jaguar_gpu_resume(machine);
484   jaguar_dsp_resume(machine);
485
486   /* halt the CPUs */
487   jaguargpu_ctrl_w(machine.device("gpu"), G_CTRL, 0, 0xffffffff);
488   jaguardsp_ctrl_w(machine.device("audiocpu"), D_CTRL, 0, 0xffffffff);
489
490   joystick_data = 0xffffffff;
491   eeprom_bit_count = 0;
492   blitter_status = 1;
493   if ((using_cart) && (input_port_read(machine, "CONFIG") & 2))
494   {
495      cart_base[0x102] = 1;
496      using_cart = 0;
497   }
498
499   // custom handling of 'protection'
500   is_jaguar = 1;
501}
502
503
504/********************************************************************
505*
506*  EEPROM
507*  ======
508*
509*   The EEPROM is accessed by a serial protocol using the registers
510*   0xF14000 (read data), F14800 (increment clock, write data), F15000 (reset for next word)
511*
512********************************************************************/
513/*
514static emu_file *jaguar_nvram_fopen( running_machine &machine, UINT32 openflags)
515{
516    device_image_interface *image = dynamic_cast<device_image_interface *>(machine.device("cart"));
517    astring *fname;
518    file_error filerr;
519    emu_file *file;
520    if (image->exists())
521    {
522        fname = astring_assemble_4( astring_alloc(), machine.system().name, PATH_SEPARATOR, image->basename_noext(), ".nv");
523        filerr = mame_fopen( SEARCHPATH_NVRAM, astring_c( fname), openflags, &file);
524        astring_free( fname);
525        return (filerr == FILERR_NONE) ? file : NULL;
526    }
527    else
528        return NULL;
529}
530
531static void jaguar_nvram_load(running_machine &machine)
532{
533    emu_file *nvram_file = NULL;
534    device_t *device;
535
536    for (device = machine.m_devicelist.first(); device != NULL; device = device->next())
537    {
538        device_nvram_func nvram = (device_nvram_func)device->get_config_fct(DEVINFO_FCT_NVRAM);
539        if (nvram != NULL)
540        {
541            if (nvram_file == NULL)
542                nvram_file = jaguar_nvram_fopen(machine, OPEN_FLAG_READ);
543            (*nvram)(device, nvram_file, 0);
544        }
545    }
546    if (nvram_file != NULL)
547        mame_fclose(nvram_file);
548}
549
550
551static void jaguar_nvram_save(running_machine &machine)
552{
553    emu_file *nvram_file = NULL;
554    device_t *device;
555
556    for (device = machine.m_devicelist.first(); device != NULL; device = device->next())
557    {
558        device_nvram_func nvram = (device_nvram_func)device->get_config_fct(DEVINFO_FCT_NVRAM);
559        if (nvram != NULL)
560        {
561            if (nvram_file == NULL)
562                nvram_file = jaguar_nvram_fopen(machine, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
563            // check nvram_file to avoid crash when no image is mounted or cannot be created
564            if (nvram_file)
565                (*nvram)(device, nvram_file, 1);
566        }
567    }
568
569    if (nvram_file != NULL)
570        mame_fclose(nvram_file);
571}
572
573static NVRAM_HANDLER( jaguar )
574{
575    if (read_or_write)  {
576        jaguar_nvram_save(machine);
577    }
578    else
579    {
580        if (file)
581            jaguar_nvram_load(machine);
582    }
583}
584*/
585static WRITE32_HANDLER( jaguar_eeprom_w )
586{
587   device_t *eeprom = space->machine().device("eeprom");
588   eeprom_bit_count++;
589   if (eeprom_bit_count != 9)      /* kill extra bit at end of address */
590   {
591      eeprom_write_bit(eeprom,data >> 31);
592      eeprom_set_clock_line(eeprom,PULSE_LINE);
593   }
594}
595
596static READ32_HANDLER( jaguar_eeprom_clk )
597{
598   device_t *eeprom = space->machine().device("eeprom");
599   eeprom_set_clock_line(eeprom,PULSE_LINE);   /* get next bit when reading */
600   return 0;
601}
602
603static READ32_HANDLER( jaguar_eeprom_cs )
604{
605   device_t *eeprom = space->machine().device("eeprom");
606   eeprom_set_cs_line(eeprom,ASSERT_LINE);   /* must do at end of an operation */
607   eeprom_set_cs_line(eeprom,CLEAR_LINE);      /* enable chip for next operation */
608   eeprom_write_bit(eeprom,1);         /* write a start bit */
609   eeprom_set_clock_line(eeprom,PULSE_LINE);
610   eeprom_bit_count = 0;
611   return 0;
612}
613
614
615
616/*************************************
617 *
618 *  Misc. control bits
619 *
620 *************************************/
621
622static READ32_HANDLER( misc_control_r )
623{
624   cojag_state *state = space->machine().driver_data<cojag_state>();
625   /*  D7    = board reset (low)
626        D6    = audio must & reset (high)
627        D5    = volume control data (invert on write)
628        D4    = volume control clock
629        D3-D1 = audio bank 2-0
630        D0    = shared memory select (0=XBUS) */
631
632   return state->m_misc_control_data ^ 0x20;
633}
634
635
636static WRITE32_HANDLER( misc_control_w )
637{
638   cojag_state *state = space->machine().driver_data<cojag_state>();
639   logerror("%08X:misc_control_w(%02X)\n", cpu_get_previouspc(&space->device()), data);
640
641   /*  D7    = board reset (low)
642        D6    = audio must & reset (high)
643        D5    = volume control data (invert on write)
644        D4    = volume control clock
645        D3-D1 = audio bank 2-0
646        D0    = shared memory select (0=XBUS) */
647
648   /* handle resetting the DSPs */
649   if (!(data & 0x80))
650   {
651      /* clear any spinuntil stuff */
652      jaguar_gpu_resume(space->machine());
653      jaguar_dsp_resume(space->machine());
654
655      /* halt the CPUs */
656      jaguargpu_ctrl_w(space->machine().device("gpu"), G_CTRL, 0, 0xffffffff);
657      jaguardsp_ctrl_w(space->machine().device("audiocpu"), D_CTRL, 0, 0xffffffff);
658   }
659
660   /* adjust banking */
661   if (space->machine().region("user2")->base())
662   {
663      memory_set_bank(space->machine(), "bank2", (data >> 1) & 7);
664      memory_set_bank(space->machine(), "bank9", (data >> 1) & 7);
665   }
666
667   COMBINE_DATA(&state->m_misc_control_data);
668}
669
670
671/*************************************
672 *
673 *  32-bit access to the GPU
674 *
675 *************************************/
676
677// shouldn't the DSPs be doing this calc, why is this needed for Jaguar?
678static READ32_HANDLER( gpuctrl_r )
679{
680   UINT32 result = jaguargpu_ctrl_r(space->machine().device("gpu"), offset);
681
682   if (is_jaguar)
683   {
684      if (protection_check != 1) return result;
685
686      protection_check++;
687      jaguar_gpu_ram[0] = 0x3d0dead;
688      return 0x80000000;
689   }
690   else
691      return result;
692}
693
694
695static WRITE32_HANDLER( gpuctrl_w )
696{
697   if (is_jaguar)
698      if ((!protection_check) && (offset == 5) && (data == 1)) protection_check++;
699
700   jaguargpu_ctrl_w(space->machine().device("gpu"), offset, data, mem_mask);
701}
702
703
704
705/*************************************
706 *
707 *  32-bit access to the DSP
708 *
709 *************************************/
710
711static READ32_HANDLER( dspctrl_r )
712{
713   return jaguardsp_ctrl_r(space->machine().device("audiocpu"), offset);
714}
715
716
717static WRITE32_HANDLER( dspctrl_w )
718{
719   jaguardsp_ctrl_w(space->machine().device("audiocpu"), offset, data, mem_mask);
720}
721
722
723static READ32_HANDLER( jaguar_wave_rom_r )
724{
725   return jaguar_wave_rom[offset];
726}
727
728
729/*************************************
730 *
731 *  Input ports
732 *
733 *  Information from "The Jaguar Underground Documentation"
734 *  by Klaus and Nat!
735 *
736 *************************************/
737
738static READ32_HANDLER( joystick_r )
739{
740   UINT16 joystick_result = 0xfffe;
741   UINT16 joybuts_result = 0xffef;
742   int i;
743   static const char *const keynames[2][8] =
744   {
745      { "JOY0", "JOY1", "JOY2", "JOY3", "JOY4", "JOY5", "JOY6", "JOY7" },
746      { "BUTTONS0", "BUTTONS1", "BUTTONS2", "BUTTONS3", "BUTTONS4", "BUTTONS5", "BUTTONS6", "BUTTONS7" }
747   };
748
749   /*
750     *   16        12        8         4         0
751     *   +---------+---------+---------^---------+
752     *   |  pad 1  |  pad 0  |      unused       |
753     *   +---------+---------+-------------------+
754     *     15...12   11...8          7...0
755     *
756     *   Reading this register gives you the output of the selected columns
757     *   of the pads.
758     *   The buttons pressed will appear as cleared bits.
759     *   See the description of the column addressing to map the bits
760     *   to the buttons.
761     */
762
763   for (i = 0; i < 8; i++)
764   {
765      if ((joystick_data & (0x10000 << i)) == 0)
766      {
767         joystick_result &= input_port_read(space->machine(), keynames[0][i]);
768         joybuts_result &= input_port_read(space->machine(), keynames[1][i]);
769      }
770   }
771
772   joystick_result |= eeprom_read_bit(space->machine().device("eeprom"));
773   joybuts_result |= (input_port_read(space->machine(), "CONFIG") & 0x10);
774
775   return (joystick_result << 16) | joybuts_result;
776}
777
778static WRITE32_HANDLER( joystick_w )
779{
780   /*
781     *   16        12         8         4         0
782     *   +-+-------^------+--+---------+---------+
783     *   |r|    unused    |mu|  col 1  |  col 0  |
784     *   +-+--------------+--+---------+---------+
785     *    15                8   7...4     3...0
786     *
787     *   col 0:   column control of joypad 0
788     *
789     *      Here you select which column of the joypad to poll.
790     *      The columns are:
791     *
792     *                Joystick       Joybut
793     *      col_bit|11 10  9  8     1    0
794     *      -------+--+--+--+--    ---+------
795     *         0   | R  L  D  U     A  PAUSE       (RLDU = Joypad directions)
796     *         1   | 1  4  7  *     B
797     *         2   | 2  5  8  0     C
798     *         3   | 3  6  9  #   OPTION
799     *
800     *      You select a column my clearing the appropriate bit and setting
801     *      all the other "column" bits.
802     *
803     *
804     *   col1:    column control of joypad 1
805     *
806     *      This is pretty much the same as for joypad EXCEPT that the
807     *      column addressing is reversed (strange!!)
808     *
809     *                Joystick      Joybut
810     *      col_bit|15 14 13 12     3    2
811     *      -------+--+--+--+--    ---+------
812     *         4   | 3  6  9  #   OPTION
813     *         5   | 2  5  8  0     C
814     *         6   | 1  4  7  *     B
815     *         7   | R  L  D  U     A  PAUSE     (RLDU = Joypad directions)
816     *
817     *   mute (mu):   sound control
818     *
819     *      You can turn off the sound by clearing this bit.
820     *
821     *   read enable (r):
822     *
823     *      Set this bit to read from the joysticks, clear it to write
824     *      to them.
825     */
826   COMBINE_DATA(&joystick_data);
827}
828
829
830/*************************************
831 *
832 *  Output ports
833 *
834 *************************************/
835
836static WRITE32_HANDLER( latch_w )
837{
838   logerror("%08X:latch_w(%X)\n", cpu_get_previouspc(&space->device()), data);
839
840   /* adjust banking */
841   if (space->machine().region("user2")->base())
842   {
843      if (cojag_is_r3000)
844         memory_set_bank(space->machine(), "bank1", data & 1);
845      memory_set_bank(space->machine(), "bank8", data & 1);
846   }
847}
848
849
850
851/*************************************
852 *
853 *  EEPROM access
854 *
855 *************************************/
856
857static READ32_HANDLER( eeprom_data_r )
858{
859   cojag_state *state = space->machine().driver_data<cojag_state>();
860   if (cojag_is_r3000)
861      return state->m_nvram[offset] | 0xffffff00;
862   else
863      return state->m_nvram[offset] | 0x00ffffff;
864}
865
866
867static WRITE32_HANDLER( eeprom_enable_w )
868{
869   cojag_state *state = space->machine().driver_data<cojag_state>();
870   state->m_eeprom_enable = 1;
871}
872
873
874static WRITE32_HANDLER( eeprom_data_w )
875{
876   cojag_state *state = space->machine().driver_data<cojag_state>();
877//  if (state->m_eeprom_enable)
878   {
879      if (cojag_is_r3000)
880         state->m_nvram[offset] = data & 0x000000ff;
881      else
882         state->m_nvram[offset] = data & 0xff000000;
883   }
884//  else
885//      logerror("%08X:error writing to disabled EEPROM\n", cpu_get_previouspc(&space->device()));
886   state->m_eeprom_enable = 0;
887}
888
889
890
891/*************************************
892 *
893 *  GPU synchronization & speedup
894 *
895 *************************************/
896
897/*
898    Explanation:
899
900    The GPU generally sits in a tight loop waiting for the main CPU to store
901    a jump address into a specific memory location. This speedup is designed
902    to catch that loop, which looks like this:
903
904        load    (r28),r21
905        jump    (r21)
906        nop
907
908    When nothing is pending, the GPU keeps the address of the load instruction
909    at (r28) so that it loops back on itself. When the main CPU wants to execute
910    a command, it stores an alternate address to (r28).
911
912    Even if we don't optimize this case, we do need to detect when a command
913    is written to the GPU in order to improve synchronization until the GPU
914    has finished. To do this, we start a temporary high frequency timer and
915    run it until we get back to the spin loop.
916*/
917
918
919static TIMER_CALLBACK( gpu_sync_timer )
920{
921   cojag_state *state = machine.driver_data<cojag_state>();
922   /* if a command is still pending, and we haven't maxed out our timer, set a new one */
923   if (state->m_gpu_command_pending && param < 1000)
924      machine.scheduler().timer_set(attotime::from_usec(50), FUNC(gpu_sync_timer), ++param);
925}
926
927
928static WRITE32_HANDLER( gpu_jump_w )
929{
930   cojag_state *state = space->machine().driver_data<cojag_state>();
931   /* update the data in memory */
932   COMBINE_DATA(state->m_gpu_jump_address);
933   logerror("%08X:GPU jump address = %08X\n", cpu_get_previouspc(&space->device()), *state->m_gpu_jump_address);
934
935   /* if the GPU is suspended, release it now */
936   jaguar_gpu_resume(space->machine());
937
938   /* start the sync timer going, and note that there is a command pending */
939   space->machine().scheduler().synchronize(FUNC(gpu_sync_timer));
940   state->m_gpu_command_pending = 1;
941}
942
943
944static READ32_HANDLER( gpu_jump_r )
945{
946   cojag_state *state = space->machine().driver_data<cojag_state>();
947   /* if the current GPU command is just pointing back to the spin loop, and */
948   /* we're reading it from the spin loop, we can optimize */
949   if (*state->m_gpu_jump_address == state->m_gpu_spin_pc && cpu_get_previouspc(&space->device()) == state->m_gpu_spin_pc)
950   {
951#if ENABLE_SPEEDUP_HACKS
952      /* spin if we're allowed */
953      jaguar_gpu_suspend(space->machine());
954#endif
955
956      /* no command is pending */
957      state->m_gpu_command_pending = 0;
958   }
959
960   /* return the current value */
961   return *state->m_gpu_jump_address;
962}
963
964
965
966/*************************************
967 *
968 *  Main CPU speedup (R3000 games)
969 *
970 *************************************/
971
972/*
973    Explanation:
974
975    Instead of sitting in a tight loop, the CPU will run the random number
976    generator over and over while waiting for an interrupt. In order to catch
977    that, we snoop the memory location it is polling, and see if it is read
978    at least 5 times in a row, each time less than 200 cycles apart. If so,
979    we assume it is spinning. Also, by waiting for 5 iterations, we let it
980    crank through some random numbers, just not several thousand every frame.
981*/
982
983#if ENABLE_SPEEDUP_HACKS
984
985
986static READ32_HANDLER( cojagr3k_main_speedup_r )
987{
988   cojag_state *state = space->machine().driver_data<cojag_state>();
989   UINT64 curcycles = state->m_main_cpu->total_cycles();
990
991   /* if it's been less than main_speedup_max_cycles cycles since the last time */
992   if (curcycles - state->m_main_speedup_last_cycles < state->m_main_speedup_max_cycles)
993   {
994      /* increment the count; if we hit 5, we can spin until an interrupt comes */
995      if (state->m_main_speedup_hits++ > 5)
996      {
997         device_spin_until_interrupt(&space->device());
998         state->m_main_speedup_hits = 0;
999      }
1000   }
1001
1002   /* if it's been more than main_speedup_max_cycles cycles, reset our count */
1003   else
1004      state->m_main_speedup_hits = 0;
1005
1006   /* remember the last cycle count */
1007   state->m_main_speedup_last_cycles = curcycles;
1008
1009   /* return the real value */
1010   return *state->m_main_speedup;
1011}
1012
1013#endif
1014
1015
1016
1017/*************************************
1018 *
1019 *  Additional main CPU speedup
1020 *  (Freeze only)
1021 *
1022 *************************************/
1023
1024/*
1025    Explanation:
1026
1027    The main CPU hands data off to the GPU to process. But rather than running
1028    in parallel, the main CPU just sits and waits for the result. This speedup
1029    makes sure we don't waste time emulating that spin loop.
1030*/
1031
1032#if ENABLE_SPEEDUP_HACKS
1033
1034
1035static READ32_HANDLER( main_gpu_wait_r )
1036{
1037   cojag_state *state = space->machine().driver_data<cojag_state>();
1038   if (state->m_gpu_command_pending)
1039      device_spin_until_interrupt(&space->device());
1040   return *state->m_main_gpu_wait;
1041}
1042
1043#endif
1044
1045
1046
1047/*************************************
1048 *
1049 *  Main CPU speedup (Area 51)
1050 *
1051 *************************************/
1052
1053/*
1054    Explanation:
1055
1056    Very similar to the R3000 code, except we need to verify that the value in
1057    *main_speedup is actually 0.
1058*/
1059
1060#if ENABLE_SPEEDUP_HACKS
1061
1062static WRITE32_HANDLER( area51_main_speedup_w )
1063{
1064   cojag_state *state = space->machine().driver_data<cojag_state>();
1065   UINT64 curcycles = state->m_main_cpu->total_cycles();
1066
1067   /* store the data */
1068   COMBINE_DATA(state->m_main_speedup);
1069
1070   /* if it's been less than 400 cycles since the last time */
1071   if (*state->m_main_speedup == 0 && curcycles - state->m_main_speedup_last_cycles < 400)
1072   {
1073      /* increment the count; if we hit 5, we can spin until an interrupt comes */
1074      if (state->m_main_speedup_hits++ > 5)
1075      {
1076         device_spin_until_interrupt(&space->device());
1077         state->m_main_speedup_hits = 0;
1078      }
1079   }
1080
1081   /* if it's been more than 400 cycles, reset our count */
1082   else
1083      state->m_main_speedup_hits = 0;
1084
1085   /* remember the last cycle count */
1086   state->m_main_speedup_last_cycles = curcycles;
1087}
1088
1089
1090/*
1091    Explanation:
1092
1093    The Area 51/Maximum Force duo writes to a non-aligned address, so our check
1094    against 0 must handle that explicitly.
1095*/
1096
1097static WRITE32_HANDLER( area51mx_main_speedup_w )
1098{
1099   cojag_state *state = space->machine().driver_data<cojag_state>();
1100   UINT64 curcycles = state->m_main_cpu->total_cycles();
1101
1102   /* store the data */
1103   COMBINE_DATA(&state->m_main_speedup[offset]);
1104
1105   /* if it's been less than 450 cycles since the last time */
1106   if (((state->m_main_speedup[0] << 16) | (state->m_main_speedup[1] >> 16)) == 0 && curcycles - state->m_main_speedup_last_cycles < 450)
1107   {
1108      /* increment the count; if we hit 5, we can spin until an interrupt comes */
1109      if (state->m_main_speedup_hits++ > 10)
1110      {
1111         device_spin_until_interrupt(&space->device());
1112         state->m_main_speedup_hits = 0;
1113      }
1114   }
1115
1116   /* if it's been more than 450 cycles, reset our count */
1117   else
1118      state->m_main_speedup_hits = 0;
1119
1120   /* remember the last cycle count */
1121   state->m_main_speedup_last_cycles = curcycles;
1122}
1123
1124#endif
1125
1126
1127
1128
1129
1130
1131/*************************************
1132 *
1133 *  Main CPU memory handlers
1134 *
1135 *************************************/
1136
1137// surely these should be 16-bit natively if the standard Jaguar is driven by a plain 68k?
1138// all these trampolines are not good for performance ;-)
1139
1140static READ16_HANDLER( gpuctrl_r16 )  { if (!(offset&1)) { return gpuctrl_r(space, offset>>1, mem_mask<<16) >> 16;  } else { return gpuctrl_r(space, offset>>1, mem_mask); } }
1141static WRITE16_HANDLER( gpuctrl_w16 ) { if (!(offset&1)) { gpuctrl_w(space, offset>>1, data << 16, mem_mask << 16); } else { gpuctrl_w(space, offset>>1, data, mem_mask); } }
1142static READ16_HANDLER( jaguar_blitter_r16 )  { if (!(offset&1)) { return jaguar_blitter_r(space, offset>>1, mem_mask<<16) >> 16;  } else { return jaguar_blitter_r(space, offset>>1, mem_mask); } }
1143static WRITE16_HANDLER( jaguar_blitter_w16 ) { if (!(offset&1)) { jaguar_blitter_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_blitter_w(space, offset>>1, data, mem_mask); } }
1144static READ16_HANDLER( jaguar_serial_r16 )  { if (!(offset&1)) { return jaguar_serial_r(space, offset>>1, mem_mask<<16) >> 16;  } else { return jaguar_serial_r(space, offset>>1, mem_mask); } }
1145static WRITE16_HANDLER( jaguar_serial_w16 ) { if (!(offset&1)) { jaguar_serial_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_serial_w(space, offset>>1, data, mem_mask); } }
1146static READ16_HANDLER( dspctrl_r16 )  { if (!(offset&1)) { return dspctrl_r(space, offset>>1, mem_mask<<16) >> 16;  } else { return dspctrl_r(space, offset>>1, mem_mask); } }
1147static WRITE16_HANDLER( dspctrl_w16 ) { if (!(offset&1)) { dspctrl_w(space, offset>>1, data << 16, mem_mask << 16); } else { dspctrl_w(space, offset>>1, data, mem_mask); } }
1148static READ16_HANDLER( jaguar_eeprom_cs16 )  { if (!(offset&1)) { return jaguar_eeprom_cs(space, offset>>1, mem_mask<<16) >> 16;  } else { return jaguar_eeprom_cs(space, offset>>1, mem_mask); } }
1149static READ16_HANDLER( jaguar_eeprom_clk16 )  { if (!(offset&1)) { return jaguar_eeprom_clk(space, offset>>1, mem_mask<<16) >> 16;  } else { return jaguar_eeprom_clk(space, offset>>1, mem_mask); } }
1150static WRITE16_HANDLER( jaguar_eeprom_w16 ) { if (!(offset&1)) { jaguar_eeprom_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_eeprom_w(space, offset>>1, data, mem_mask); } }
1151static READ16_HANDLER( joystick_r16 )  { if (!(offset&1)) { return joystick_r(space, offset>>1, mem_mask<<16) >> 16;  } else { return joystick_r(space, offset>>1, mem_mask); } }
1152static WRITE16_HANDLER( joystick_w16 ) { if (!(offset&1)) { joystick_w(space, offset>>1, data << 16, mem_mask << 16); } else { joystick_w(space, offset>>1, data, mem_mask); } }
1153
1154static READ32_HANDLER( jaguar_shared_ram_r ) { return jaguar_shared_ram[offset]; }
1155static WRITE32_HANDLER( jaguar_shared_ram_w ) {   COMBINE_DATA(&jaguar_shared_ram[offset]); }
1156static READ32_HANDLER( jaguar_rom_base_r ) { return rom_base[offset]; }
1157static WRITE32_HANDLER( jaguar_rom_base_w ) { /*ROM!*/ }
1158static READ32_HANDLER( jaguar_cart_base_r ) { return cart_base[offset]; }
1159static WRITE32_HANDLER( jaguar_cart_base_w ) { /*ROM!*/ }
1160static READ32_HANDLER( high_rom_base_r ) { return high_rom_base[offset]; }
1161static WRITE32_HANDLER( high_rom_base_w ) { /*ROM!*/ }
1162static READ32_HANDLER( jaguar_dsp_ram_r ) {   return jaguar_dsp_ram[offset]; }
1163static WRITE32_HANDLER( jaguar_dsp_ram_w ) { COMBINE_DATA(&jaguar_dsp_ram[offset]); }
1164static READ32_HANDLER( jaguar_gpu_clut_r ) { return jaguar_gpu_clut[offset]; }
1165static WRITE32_HANDLER( jaguar_gpu_clut_w ) { COMBINE_DATA(&jaguar_gpu_clut[offset]); }
1166static READ32_HANDLER( jaguar_gpu_ram_r ) { return jaguar_gpu_ram[offset]; }
1167static WRITE32_HANDLER( jaguar_gpu_ram_w ) { COMBINE_DATA(&jaguar_gpu_ram[offset]); }
1168
1169static READ16_HANDLER( jaguar_shared_ram_r16 )  { if (!(offset&1)) { return jaguar_shared_ram_r(space, offset>>1, mem_mask<<16) >> 16;  } else { return jaguar_shared_ram_r(space, offset>>1, mem_mask); } }
1170static WRITE16_HANDLER( jaguar_shared_ram_w16 ) { if (!(offset&1)) { jaguar_shared_ram_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_shared_ram_w(space, offset>>1, data, mem_mask); } }
1171static READ16_HANDLER( jaguar_rom_base_r16 )  { if (!(offset&1)) { return jaguar_rom_base_r(space, offset>>1, mem_mask<<16) >> 16;  } else { return jaguar_rom_base_r(space, offset>>1, mem_mask); } }
1172static WRITE16_HANDLER( jaguar_rom_base_w16 ) { if (!(offset&1)) { jaguar_rom_base_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_rom_base_w(space, offset>>1, data, mem_mask); } }
1173static READ16_HANDLER( jaguar_cart_base_r16 )  { if (!(offset&1)) { return jaguar_cart_base_r(space, offset>>1, mem_mask<<16) >> 16;  } else { return jaguar_cart_base_r(space, offset>>1, mem_mask); } }
1174static WRITE16_HANDLER( jaguar_cart_base_w16 ) { if (!(offset&1)) { jaguar_cart_base_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_cart_base_w(space, offset>>1, data, mem_mask); } }
1175static READ16_HANDLER( high_rom_base_r16 )  { if (!(offset&1)) { return high_rom_base_r(space, offset>>1, mem_mask<<16) >> 16;  } else { return high_rom_base_r(space, offset>>1, mem_mask); } }
1176static WRITE16_HANDLER( high_rom_base_w16 ) { if (!(offset&1)) { high_rom_base_w(space, offset>>1, data << 16, mem_mask << 16); } else { high_rom_base_w(space, offset>>1, data, mem_mask); } }
1177
1178static READ16_HANDLER( jaguar_dsp_ram_r16 )  { if (!(offset&1)) { return jaguar_dsp_ram_r(space, offset>>1, mem_mask<<16) >> 16;  } else { return jaguar_dsp_ram_r(space, offset>>1, mem_mask); } }
1179static WRITE16_HANDLER( jaguar_dsp_ram_w16 ) { if (!(offset&1)) { jaguar_dsp_ram_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_dsp_ram_w(space, offset>>1, data, mem_mask); } }
1180static READ16_HANDLER( jaguar_gpu_clut_r16 )  { if (!(offset&1)) { return jaguar_gpu_clut_r(space, offset>>1, mem_mask<<16) >> 16;  } else { return jaguar_gpu_clut_r(space, offset>>1, mem_mask); } }
1181static WRITE16_HANDLER( jaguar_gpu_clut_w16 ) { if (!(offset&1)) { jaguar_gpu_clut_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_gpu_clut_w(space, offset>>1, data, mem_mask); } }
1182static READ16_HANDLER( jaguar_gpu_ram_r16 )  { if (!(offset&1)) { return jaguar_gpu_ram_r(space, offset>>1, mem_mask<<16) >> 16;  } else { return jaguar_gpu_ram_r(space, offset>>1, mem_mask); } }
1183static WRITE16_HANDLER( jaguar_gpu_ram_w16 ) { if (!(offset&1)) { jaguar_gpu_ram_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_gpu_ram_w(space, offset>>1, data, mem_mask); } }
1184
1185static ADDRESS_MAP_START( jaguar_map, AS_PROGRAM, 16 )
1186   ADDRESS_MAP_GLOBAL_MASK(0xffffff)
1187   AM_RANGE(0x000000, 0x1fffff) AM_MIRROR(0x200000) AM_READWRITE( jaguar_shared_ram_r16, jaguar_shared_ram_w16 );
1188   AM_RANGE(0x800000, 0xdfffff) AM_READWRITE( jaguar_cart_base_r16, jaguar_cart_base_w16 )
1189   AM_RANGE(0xe00000, 0xe1ffff) AM_READWRITE( jaguar_rom_base_r16, jaguar_rom_base_w16 )
1190   AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE(jaguar_tom_regs_r, jaguar_tom_regs_w) // might be reversed endian of the others..
1191   AM_RANGE(0xf00400, 0xf005ff) AM_MIRROR(0x000200) AM_READWRITE(jaguar_gpu_clut_r16, jaguar_gpu_clut_w16 )
1192   AM_RANGE(0xf02100, 0xf021ff) AM_MIRROR(0x008000) AM_READWRITE(gpuctrl_r16, gpuctrl_w16)
1193   AM_RANGE(0xf02200, 0xf022ff) AM_MIRROR(0x008000) AM_READWRITE(jaguar_blitter_r16, jaguar_blitter_w16)
1194   AM_RANGE(0xf03000, 0xf03fff) AM_MIRROR(0x008000) AM_READWRITE( jaguar_gpu_ram_r16, jaguar_gpu_ram_w16 )
1195   AM_RANGE(0xf10000, 0xf103ff) AM_READWRITE(jaguar_jerry_regs_r, jaguar_jerry_regs_w) // might be reversed endian of the others..
1196   AM_RANGE(0xf14000, 0xf14003) AM_READWRITE(joystick_r16, joystick_w16)
1197   AM_RANGE(0xf14800, 0xf14803) AM_READWRITE(jaguar_eeprom_clk16,jaguar_eeprom_w16)   // GPI00
1198   AM_RANGE(0xf15000, 0xf15003) AM_READ(jaguar_eeprom_cs16)            // GPI01
1199   AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE(dspctrl_r16, dspctrl_w16)
1200   AM_RANGE(0xf1a140, 0xf1a17f) AM_READWRITE(jaguar_serial_r16, jaguar_serial_w16)
1201   AM_RANGE(0xf1b000, 0xf1cfff) AM_READWRITE(jaguar_dsp_ram_r16, jaguar_dsp_ram_w16)
1202   AM_RANGE(0xf1d000, 0xf1dfff) AM_READWRITE( high_rom_base_r16, high_rom_base_w16 )
1203ADDRESS_MAP_END
1204
1205
1206
1207/*************************************
1208 *
1209 *  Main CPU memory handlers
1210 *
1211 *************************************/
1212
1213static ADDRESS_MAP_START( r3000_map, AS_PROGRAM, 32 )
1214   AM_RANGE(0x04000000, 0x047fffff) AM_RAM AM_BASE(&jaguar_shared_ram) AM_SHARE("share1")
1215   AM_RANGE(0x04800000, 0x04bfffff) AM_ROMBANK("bank1")
1216   AM_RANGE(0x04c00000, 0x04dfffff) AM_ROMBANK("bank2")
1217   AM_RANGE(0x04e00000, 0x04e003ff) AM_DEVREADWRITE("ide", ide_controller32_r, ide_controller32_w)
1218   AM_RANGE(0x04f00000, 0x04f003ff) AM_READWRITE(jaguar_tom_regs32_r, jaguar_tom_regs32_w)
1219   AM_RANGE(0x04f00400, 0x04f007ff) AM_RAM AM_BASE(&jaguar_gpu_clut) AM_SHARE("share2")
1220   AM_RANGE(0x04f02100, 0x04f021ff) AM_READWRITE(gpuctrl_r, gpuctrl_w)
1221   AM_RANGE(0x04f02200, 0x04f022ff) AM_READWRITE(jaguar_blitter_r, jaguar_blitter_w)
1222   AM_RANGE(0x04f03000, 0x04f03fff) AM_MIRROR(0x00008000) AM_RAM AM_BASE(&jaguar_gpu_ram) AM_SHARE("share3")
1223   AM_RANGE(0x04f10000, 0x04f103ff) AM_READWRITE(jaguar_jerry_regs32_r, jaguar_jerry_regs32_w)
1224   AM_RANGE(0x04f16000, 0x04f1600b) AM_READ(cojag_gun_input_r)   // GPI02
1225   AM_RANGE(0x04f17000, 0x04f17003) AM_READ_PORT("SYSTEM")      // GPI03
1226   AM_RANGE(0x04f17800, 0x04f17803) AM_WRITE(latch_w)         // GPI04
1227   AM_RANGE(0x04f17c00, 0x04f17c03) AM_READ_PORT("P1_P2")      // GPI05
1228   AM_RANGE(0x04f1a100, 0x04f1a13f) AM_READWRITE(dspctrl_r, dspctrl_w)
1229   AM_RANGE(0x04f1a140, 0x04f1a17f) AM_READWRITE(jaguar_serial_r, jaguar_serial_w)
1230   AM_RANGE(0x04f1b000, 0x04f1cfff) AM_RAM AM_BASE(&jaguar_dsp_ram) AM_SHARE("share4")
1231
1232   AM_RANGE(0x06000000, 0x06000003) AM_READWRITE(misc_control_r, misc_control_w)
1233   AM_RANGE(0x10000000, 0x1007ffff) AM_RAM
1234   AM_RANGE(0x12000000, 0x120fffff) AM_RAM      // tested in self-test only?
1235   AM_RANGE(0x14000004, 0x14000007) AM_WRITE(watchdog_reset32_w)
1236   AM_RANGE(0x16000000, 0x16000003) AM_WRITE(eeprom_enable_w)
1237   AM_RANGE(0x18000000, 0x18001fff) AM_READWRITE(eeprom_data_r, eeprom_data_w) AM_SHARE("nvram")
1238   AM_RANGE(0x1fc00000, 0x1fdfffff) AM_ROM AM_REGION("user1", 0) AM_BASE_MEMBER(cojag_state, m_rom_base)
1239ADDRESS_MAP_END
1240
1241
1242static ADDRESS_MAP_START( m68020_map, AS_PROGRAM, 32 )
1243   AM_RANGE(0x000000, 0x7fffff) AM_RAM AM_BASE(&jaguar_shared_ram) AM_SHARE("share1")
1244   AM_RANGE(0x800000, 0x9fffff) AM_ROM AM_REGION("user1", 0) AM_BASE_MEMBER(cojag_state, m_rom_base)
1245   AM_RANGE(0xa00000, 0xa1ffff) AM_RAM
1246   AM_RANGE(0xa20000, 0xa21fff) AM_READWRITE(eeprom_data_r, eeprom_data_w) AM_SHARE("nvram")
1247   AM_RANGE(0xa30000, 0xa30003) AM_WRITE(watchdog_reset32_w)
1248   AM_RANGE(0xa40000, 0xa40003) AM_WRITE(eeprom_enable_w)
1249   AM_RANGE(0xb70000, 0xb70003) AM_READWRITE(misc_control_r, misc_control_w)
1250   AM_RANGE(0xc00000, 0xdfffff) AM_ROMBANK("bank2")
1251   AM_RANGE(0xe00000, 0xe003ff) AM_DEVREADWRITE("ide",  ide_controller32_r, ide_controller32_w)
1252   AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE(jaguar_tom_regs32_r, jaguar_tom_regs32_w)
1253   AM_RANGE(0xf00400, 0xf007ff) AM_RAM AM_BASE(&jaguar_gpu_clut) AM_SHARE("share2")
1254   AM_RANGE(0xf02100, 0xf021ff) AM_READWRITE(gpuctrl_r, gpuctrl_w)
1255   AM_RANGE(0xf02200, 0xf022ff) AM_READWRITE(jaguar_blitter_r, jaguar_blitter_w)
1256   AM_RANGE(0xf03000, 0xf03fff) AM_MIRROR(0x008000) AM_RAM AM_BASE(&jaguar_gpu_ram) AM_SHARE("share3")
1257   AM_RANGE(0xf10000, 0xf103ff) AM_READWRITE(jaguar_jerry_regs32_r, jaguar_jerry_regs32_w)
1258   AM_RANGE(0xf16000, 0xf1600b) AM_READ(cojag_gun_input_r)   // GPI02
1259   AM_RANGE(0xf17000, 0xf17003) AM_READ_PORT("SYSTEM")      // GPI03
1260//  AM_RANGE(0xf17800, 0xf17803) AM_WRITE(latch_w)          // GPI04
1261   AM_RANGE(0xf17c00, 0xf17c03) AM_READ_PORT("P1_P2")      // GPI05
1262   AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE(dspctrl_r, dspctrl_w)
1263   AM_RANGE(0xf1a140, 0xf1a17f) AM_READWRITE(jaguar_serial_r, jaguar_serial_w)
1264   AM_RANGE(0xf1b000, 0xf1cfff) AM_RAM AM_BASE(&jaguar_dsp_ram) AM_SHARE("share4")
1265ADDRESS_MAP_END
1266
1267
1268
1269/*************************************
1270 *
1271 *  GPU memory handlers
1272 *
1273 *************************************/
1274
1275static ADDRESS_MAP_START( gpu_map, AS_PROGRAM, 32 )
1276   AM_RANGE(0x000000, 0x7fffff) AM_RAM AM_SHARE("share1")
1277   AM_RANGE(0x800000, 0xbfffff) AM_ROMBANK("bank8")
1278   AM_RANGE(0xc00000, 0xdfffff) AM_ROMBANK("bank9")
1279   AM_RANGE(0xe00000, 0xe003ff) AM_DEVREADWRITE("ide", ide_controller32_r, ide_controller32_w)
1280   AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE(jaguar_tom_regs32_r, jaguar_tom_regs32_w)
1281   AM_RANGE(0xf00400, 0xf007ff) AM_RAM AM_SHARE("share2")
1282   AM_RANGE(0xf02100, 0xf021ff) AM_READWRITE(gpuctrl_r, gpuctrl_w)
1283   AM_RANGE(0xf02200, 0xf022ff) AM_READWRITE(jaguar_blitter_r, jaguar_blitter_w)
1284   AM_RANGE(0xf03000, 0xf03fff) AM_RAM AM_SHARE("share3")
1285   AM_RANGE(0xf10000, 0xf103ff) AM_READWRITE(jaguar_jerry_regs32_r, jaguar_jerry_regs32_w)
1286ADDRESS_MAP_END
1287
1288
1289
1290/*************************************
1291 *
1292 *  DSP memory handlers
1293 *
1294 *************************************/
1295
1296static ADDRESS_MAP_START( dsp_map, AS_PROGRAM, 32 )
1297   AM_RANGE(0x000000, 0x7fffff) AM_RAM AM_SHARE("share1")
1298   AM_RANGE(0x800000, 0xbfffff) AM_ROMBANK("bank8")
1299   AM_RANGE(0xc00000, 0xdfffff) AM_ROMBANK("bank9")
1300   AM_RANGE(0xf10000, 0xf103ff) AM_READWRITE(jaguar_jerry_regs32_r, jaguar_jerry_regs32_w)
1301   AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE(dspctrl_r, dspctrl_w)
1302   AM_RANGE(0xf1a140, 0xf1a17f) AM_READWRITE(jaguar_serial_r, jaguar_serial_w)
1303   AM_RANGE(0xf1b000, 0xf1cfff) AM_RAM AM_SHARE("share4")
1304   AM_RANGE(0xf1d000, 0xf1dfff) AM_READ(jaguar_wave_rom_r) AM_BASE(&jaguar_wave_rom)
1305ADDRESS_MAP_END
1306
1307/* ToDo, these maps SHOULD be merged with the ones above */
1308
1309static ADDRESS_MAP_START( jag_gpu_map, AS_PROGRAM, 32 )
1310   ADDRESS_MAP_GLOBAL_MASK(0xffffff)
1311   AM_RANGE(0x000000, 0x1fffff) AM_RAM AM_BASE(&jaguar_shared_ram) AM_MIRROR(0x200000)  AM_SHARE("share1") AM_REGION("maincpu", 0)
1312   AM_RANGE(0x800000, 0xdfffff) AM_ROM AM_BASE(&cart_base) AM_SIZE(&cart_size)  AM_SHARE("share15") AM_REGION("maincpu", 0x800000)
1313   AM_RANGE(0xe00000, 0xe1ffff) AM_ROM AM_BASE(&rom_base) AM_SIZE(&rom_size)  AM_SHARE("share16") AM_REGION("maincpu", 0xe00000)
1314   AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE(jaguar_tom_regs32_r, jaguar_tom_regs32_w)
1315   AM_RANGE(0xf00400, 0xf005ff) AM_BASE(&jaguar_gpu_clut) AM_MIRROR(0x000200) AM_RAM AM_SHARE("share2")
1316   AM_RANGE(0xf02100, 0xf021ff) AM_MIRROR(0x008000) AM_READWRITE(gpuctrl_r, gpuctrl_w)
1317   AM_RANGE(0xf02200, 0xf022ff) AM_MIRROR(0x008000) AM_READWRITE(jaguar_blitter_r, jaguar_blitter_w)
1318   AM_RANGE(0xf03000, 0xf03fff) AM_BASE(&jaguar_gpu_ram) AM_MIRROR(0x008000) AM_RAM AM_SHARE("share3")
1319   AM_RANGE(0xf10000, 0xf103ff) AM_READWRITE(jaguar_jerry_regs32_r, jaguar_jerry_regs32_w)
1320   AM_RANGE(0xf14000, 0xf14003) AM_READWRITE(joystick_r, joystick_w)
1321   AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE(dspctrl_r, dspctrl_w)
1322   AM_RANGE(0xf1a140, 0xf1a17f) AM_READWRITE(jaguar_serial_r, jaguar_serial_w)
1323   AM_RANGE(0xf1b000, 0xf1cfff) AM_BASE(&jaguar_dsp_ram) AM_RAM AM_SHARE("share4")
1324   AM_RANGE(0xf1d000, 0xf1dfff) AM_ROM AM_BASE(&high_rom_base) AM_REGION("maincpu", 0xf1d000)
1325ADDRESS_MAP_END
1326
1327static ADDRESS_MAP_START( jag_dsp_map, AS_PROGRAM, 32 )
1328   ADDRESS_MAP_GLOBAL_MASK(0xffffff)
1329   AM_RANGE(0x000000, 0x1fffff) AM_MIRROR(0x200000) AM_RAM AM_SHARE("share1") AM_REGION("maincpu", 0)
1330   AM_RANGE(0x800000, 0xdfffff) AM_ROM AM_SHARE("share15") AM_REGION("maincpu", 0x800000)
1331   AM_RANGE(0xe00000, 0xe1ffff) AM_ROM AM_SHARE("share16") AM_REGION("maincpu", 0xe00000)
1332   AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE(jaguar_tom_regs32_r, jaguar_tom_regs32_w)
1333   AM_RANGE(0xf00400, 0xf005ff) AM_MIRROR(0x000200) AM_RAM AM_SHARE("share2")
1334   AM_RANGE(0xf02100, 0xf021ff) AM_MIRROR(0x008000) AM_READWRITE(gpuctrl_r, gpuctrl_w)
1335   AM_RANGE(0xf02200, 0xf022ff) AM_MIRROR(0x008000) AM_READWRITE(jaguar_blitter_r, jaguar_blitter_w)
1336   AM_RANGE(0xf03000, 0xf03fff) AM_MIRROR(0x008000) AM_RAM AM_SHARE("share3")
1337   AM_RANGE(0xf10000, 0xf103ff) AM_READWRITE(jaguar_jerry_regs32_r, jaguar_jerry_regs32_w)
1338   AM_RANGE(0xf14000, 0xf14003) AM_READWRITE(joystick_r, joystick_w)
1339   AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE(dspctrl_r, dspctrl_w)
1340   AM_RANGE(0xf1a140, 0xf1a17f) AM_READWRITE(jaguar_serial_r, jaguar_serial_w)
1341   AM_RANGE(0xf1b000, 0xf1cfff) AM_RAM AM_SHARE("share4")
1342   AM_RANGE(0xf1d000, 0xf1dfff) AM_ROM AM_REGION("maincpu", 0xf1d000)
1343ADDRESS_MAP_END
1344
1345/*************************************
1346 *
1347 *  Port definitions
1348 *
1349 *************************************/
1350
1351/* "FAKE0" is read at 0x04f17000
1352    D23-20 = /SER-4-1
1353    D19-16 = COINR4-1
1354    D7     = /VSYNCNEQ
1355    D6     = /S-TEST
1356    D5     = /VOLUMEUP
1357    D4     = /VOLUMEDOWN
1358    D3-D0  = ACTC4-1
1359*/
1360static INPUT_PORTS_START( area51 )
1361   PORT_START("P1_P2")
1362   PORT_BIT( 0x000000ff, IP_ACTIVE_LOW, IPT_UNUSED )
1363   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_START2 )
1364   PORT_BIT( 0x0000fe00, IP_ACTIVE_LOW, IPT_UNUSED )
1365
1366   PORT_BIT( 0x00ff0000, IP_ACTIVE_LOW, IPT_UNUSED )
1367   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_START1 )
1368   PORT_BIT( 0xfe000000, IP_ACTIVE_LOW, IPT_UNUSED )
1369
1370   PORT_START("SYSTEM")
1371   PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "FAKE0")
1372   PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "FAKE0")
1373
1374   PORT_START("FAKE0")
1375   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1376   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1377   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
1378   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN4 )
1379   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VOLUME_DOWN )
1380   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_VOLUME_UP )
1381   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )         // s-test
1382   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL )   // vsyncneq
1383   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
1384
1385   PORT_START("FAKE1_X")            /* fake analog X */
1386   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 320.0/(320.0 - 7 -7), 0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10)
1387
1388   PORT_START("FAKE1_Y")            /* fake analog Y */
1389   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, (240.0 - 1)/240, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(10)
1390
1391   PORT_START("FAKE2_X")            /* fake analog X */
1392   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 320.0/(320.0 - 7 -7), 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(2)
1393
1394   PORT_START("FAKE2_Y")            /* fake analog Y */
1395   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, (240.0 - 1)/240, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(10) PORT_PLAYER(2)
1396
1397   PORT_START("IN3")         /* gun triggers */
1398   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_SPECIAL )   // gun data valid
1399   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_SPECIAL )   // gun data valid
1400   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1401   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1402   PORT_BIT( 0xfff00000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1403INPUT_PORTS_END
1404
1405
1406static INPUT_PORTS_START( freezeat )
1407   PORT_START("P1_P2")
1408   PORT_BIT( 0x000000ff, IP_ACTIVE_LOW, IPT_UNUSED )
1409   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_START2 )
1410   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1411   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1412   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1413   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
1414   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
1415   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
1416   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
1417
1418   PORT_BIT( 0x00ff0000, IP_ACTIVE_LOW, IPT_UNUSED )
1419   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_START1 )
1420   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1421   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1422   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1423   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
1424   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
1425   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
1426   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
1427
1428   PORT_START("SYSTEM")
1429   PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "FAKE0")
1430   PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "FAKE0")
1431
1432   PORT_START("FAKE0")
1433   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1434   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1435   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
1436   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN4 )
1437   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL )   // volume down
1438   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL )   // volume up
1439   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )         // s-test
1440   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL )   // vsyncneq
1441   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
1442
1443   PORT_START("IN3")
1444   PORT_BIT( 0x000f0000, IP_ACTIVE_HIGH, IPT_SPECIAL )   // coin returns
1445   PORT_BIT( 0x00f00000, IP_ACTIVE_LOW, IPT_UNUSED )
1446   PORT_BIT( 0xff000000, IP_ACTIVE_LOW, IPT_UNUSED )
1447INPUT_PORTS_END
1448
1449
1450static INPUT_PORTS_START( fishfren )
1451   PORT_START("P1_P2")
1452   PORT_BIT( 0x000000ff, IP_ACTIVE_LOW, IPT_UNUSED )
1453   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_START2 )
1454   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1455   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1456   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1457   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
1458   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
1459   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
1460   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
1461
1462   PORT_BIT( 0x00ff0000, IP_ACTIVE_LOW, IPT_UNUSED )
1463   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_START1 )
1464   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1465   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1466   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1467   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
1468   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
1469   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
1470   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
1471
1472   PORT_START("SYSTEM")
1473   PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "FAKE0")
1474   PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "FAKE0")
1475
1476   PORT_START("FAKE0")
1477   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1478   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1479   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
1480   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN4 )
1481   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL )   // volume down
1482   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL )   // volume up
1483   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )         // s-test
1484   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL )   // vsyncneq
1485   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
1486
1487   PORT_START("IN3")
1488   PORT_BIT( 0x000f0000, IP_ACTIVE_HIGH, IPT_SPECIAL )   // coin returns
1489   PORT_BIT( 0x00f00000, IP_ACTIVE_LOW, IPT_UNUSED )
1490   PORT_BIT( 0xff000000, IP_ACTIVE_LOW, IPT_UNUSED )
1491INPUT_PORTS_END
1492
1493
1494static INPUT_PORTS_START( vcircle )
1495   PORT_START("P1_P2")
1496   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
1497   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
1498   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
1499   PORT_BIT( 0x000000f8, IP_ACTIVE_LOW, IPT_UNUSED )
1500   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_START2 )
1501   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1502   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1503   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1504   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
1505   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
1506   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
1507   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
1508
1509   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
1510   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
1511   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
1512   PORT_BIT( 0x00f80000, IP_ACTIVE_LOW, IPT_UNUSED )
1513   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_START1 )
1514   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1515   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1516   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1517   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
1518   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
1519   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
1520   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
1521
1522   PORT_START("SYSTEM")
1523   PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "FAKE0")
1524   PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "FAKE0")
1525
1526   PORT_START("FAKE0")
1527   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1528   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1529   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
1530   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN4 )
1531   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VOLUME_DOWN )
1532   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_VOLUME_UP )
1533   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )         // s-test
1534   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL )   // vsyncneq
1535   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
1536
1537   PORT_START("IN3")
1538   PORT_BIT( 0x000f0000, IP_ACTIVE_HIGH, IPT_SPECIAL )   // coin returns
1539   PORT_BIT( 0x00f00000, IP_ACTIVE_LOW, IPT_UNUSED )
1540   PORT_BIT( 0xff000000, IP_ACTIVE_LOW, IPT_UNUSED )
1541INPUT_PORTS_END
1542
1543
1544static INPUT_PORTS_START( jaguar )
1545   PORT_START("JOY0")
1546   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
1547   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
1548   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
1549   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
1550   PORT_BIT( 0xf0ff, IP_ACTIVE_LOW, IPT_UNUSED )
1551
1552   PORT_START("JOY1")
1553   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P1 Keypad 1") PORT_CODE(KEYCODE_1) PORT_PLAYER(1)
1554   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P1 Keypad 4") PORT_CODE(KEYCODE_4) PORT_PLAYER(1)
1555   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P1 Keypad 7") PORT_CODE(KEYCODE_7) PORT_PLAYER(1)
1556   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P1 Keypad *") PORT_CODE(KEYCODE_K) PORT_PLAYER(1)
1557   PORT_BIT( 0xf0ff, IP_ACTIVE_LOW, IPT_UNUSED )
1558
1559   PORT_START("JOY2")
1560   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P1 Keypad 2") PORT_CODE(KEYCODE_2) PORT_PLAYER(1)
1561   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P1 Keypad 5") PORT_CODE(KEYCODE_5) PORT_PLAYER(1)
1562   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P1 Keypad 8") PORT_CODE(KEYCODE_8) PORT_PLAYER(1)
1563   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P1 Keypad 0") PORT_CODE(KEYCODE_0) PORT_PLAYER(1)
1564   PORT_BIT( 0xf0ff, IP_ACTIVE_LOW, IPT_UNUSED )
1565
1566   PORT_START("JOY3")
1567   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P1 Keypad 3") PORT_CODE(KEYCODE_3) PORT_PLAYER(1)
1568   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P1 Keypad 6") PORT_CODE(KEYCODE_6) PORT_PLAYER(1)
1569   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P1 Keypad 9") PORT_CODE(KEYCODE_9) PORT_PLAYER(1)
1570   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P1 Keypad #") PORT_CODE(KEYCODE_L) PORT_PLAYER(1)
1571   PORT_BIT( 0xf0ff, IP_ACTIVE_LOW, IPT_UNUSED )
1572
1573   PORT_START("JOY4")
1574   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P2 Keypad 3") PORT_PLAYER(2)
1575   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P2 Keypad 6") PORT_PLAYER(2)
1576   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P2 Keypad 9") PORT_PLAYER(2)
1577   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P2 Keypad #") PORT_PLAYER(2)
1578   PORT_BIT( 0x0fff, IP_ACTIVE_LOW, IPT_UNUSED )
1579
1580   PORT_START("JOY5")
1581   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P2 Keypad 2") PORT_PLAYER(2)
1582   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P2 Keypad 5") PORT_PLAYER(2)
1583   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P2 Keypad 8") PORT_PLAYER(2)
1584   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P2 Keypad 0") PORT_PLAYER(2)
1585   PORT_BIT( 0x0fff, IP_ACTIVE_LOW, IPT_UNUSED )
1586
1587   PORT_START("JOY6")
1588   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P2 Keypad 1") PORT_PLAYER(2)
1589   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P2 Keypad 4") PORT_PLAYER(2)
1590   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P2 Keypad 7") PORT_PLAYER(2)
1591   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("P2 Keypad *") PORT_PLAYER(2)
1592   PORT_BIT( 0x0fff, IP_ACTIVE_LOW, IPT_UNUSED )
1593
1594   PORT_START("JOY7")
1595   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
1596   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
1597   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
1598   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
1599   PORT_BIT( 0x0fff, IP_ACTIVE_LOW, IPT_UNUSED )
1600
1601   PORT_START("BUTTONS0")
1602   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Pause") PORT_CODE(KEYCODE_I) PORT_PLAYER(1)
1603   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 A") PORT_PLAYER(1)
1604   PORT_BIT( 0xfffc, IP_ACTIVE_LOW, IPT_UNUSED )
1605
1606   PORT_START("BUTTONS1")
1607   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 B") PORT_PLAYER(1)
1608   PORT_BIT( 0xfffd, IP_ACTIVE_LOW, IPT_UNUSED )
1609
1610   PORT_START("BUTTONS2")
1611   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 C") PORT_PLAYER(1)
1612   PORT_BIT( 0xfffd, IP_ACTIVE_LOW, IPT_UNUSED )
1613
1614   PORT_START("BUTTONS3")
1615   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Option") PORT_CODE(KEYCODE_O) PORT_PLAYER(1)
1616   PORT_BIT( 0xfffd, IP_ACTIVE_LOW, IPT_UNUSED )
1617
1618   PORT_START("BUTTONS4")
1619   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 Option") PORT_PLAYER(2)
1620   PORT_BIT( 0xfffd, IP_ACTIVE_LOW, IPT_UNUSED )
1621
1622   PORT_START("BUTTONS5")
1623   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 C") PORT_PLAYER(2)
1624   PORT_BIT( 0xfffd, IP_ACTIVE_LOW, IPT_UNUSED )
1625
1626   PORT_START("BUTTONS6")
1627   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 B") PORT_PLAYER(2)
1628   PORT_BIT( 0xfffd, IP_ACTIVE_LOW, IPT_UNUSED )
1629
1630   PORT_START("BUTTONS7")
1631   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Pause") PORT_PLAYER(2)
1632   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 A") PORT_PLAYER(2)
1633   PORT_BIT( 0xfffc, IP_ACTIVE_LOW, IPT_UNUSED )
1634
1635   PORT_START("CONFIG")
1636   PORT_CONFNAME( 0x02, 0x00, "Show Logo")
1637   PORT_CONFSETTING(    0x00, "Yes")
1638   PORT_CONFSETTING(    0x02, "No")
1639   PORT_CONFNAME( 0x10, 0x10, "TV System")
1640   PORT_CONFSETTING(    0x00, "PAL")
1641   PORT_CONFSETTING(    0x10, "NTSC")
1642INPUT_PORTS_END
1643
1644/*************************************
1645 *
1646 *  Machine driver
1647 *
1648 *************************************/
1649
1650static const r3000_cpu_core r3000_config =
1651{
1652   0,      /* 1 if we have an FPU, 0 otherwise */
1653   4096,   /* code cache size */
1654   4096   /* data cache size */
1655};
1656
1657
1658static const jaguar_cpu_config gpu_config =
1659{
1660   jaguar_gpu_cpu_int
1661};
1662
1663
1664static const jaguar_cpu_config dsp_config =
1665{
1666   jaguar_dsp_cpu_int
1667};
1668
1669
1670static MACHINE_CONFIG_START( cojagr3k, cojag_state )
1671
1672   /* basic machine hardware */
1673   MCFG_CPU_ADD("maincpu", R3041BE, R3000_CLOCK)
1674   MCFG_CPU_CONFIG(r3000_config)
1675   MCFG_CPU_PROGRAM_MAP(r3000_map)
1676
1677   MCFG_CPU_ADD("gpu", JAGUARGPU, COJAG_CLOCK/2)
1678   MCFG_CPU_CONFIG(gpu_config)
1679   MCFG_CPU_PROGRAM_MAP(gpu_map)
1680
1681   MCFG_CPU_ADD("audiocpu", JAGUARDSP, COJAG_CLOCK/2)
1682   MCFG_CPU_CONFIG(dsp_config)
1683   MCFG_CPU_PROGRAM_MAP(dsp_map)
1684
1685   MCFG_MACHINE_RESET(cojag)
1686   MCFG_NVRAM_ADD_1FILL("nvram")
1687
1688   MCFG_IDE_CONTROLLER_ADD("ide", jaguar_external_int)
1689
1690   MCFG_TIMER_ADD("serial_timer", jaguar_serial_callback)
1691
1692   /* video hardware */
1693   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
1694
1695   MCFG_SCREEN_ADD("screen", RASTER)
1696   MCFG_SCREEN_RAW_PARAMS(COJAG_PIXEL_CLOCK/2, 456, 42, 402, 262, 17, 257)
1697   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
1698   MCFG_SCREEN_UPDATE(cojag)
1699
1700   MCFG_VIDEO_START(cojag)
1701
1702   /* sound hardware */
1703   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
1704
1705   MCFG_SOUND_ADD("dac1", DAC, 0)
1706   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
1707
1708   MCFG_SOUND_ADD("dac2", DAC, 0)
1709   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
1710MACHINE_CONFIG_END
1711
1712
1713static MACHINE_CONFIG_DERIVED( cojag68k, cojagr3k )
1714
1715   /* basic machine hardware */
1716   MCFG_CPU_REPLACE("maincpu", M68EC020, M68K_CLOCK/2)
1717   MCFG_CPU_PROGRAM_MAP(m68020_map)
1718MACHINE_CONFIG_END
1719
1720
1721static MACHINE_CONFIG_START( jaguar, driver_device )
1722
1723   /* basic machine hardware */
1724   MCFG_CPU_ADD("maincpu", M68000, JAGUAR_CLOCK/2)
1725   MCFG_CPU_PROGRAM_MAP(jaguar_map)
1726
1727   MCFG_CPU_ADD("gpu", JAGUARGPU, JAGUAR_CLOCK)
1728   MCFG_CPU_CONFIG(gpu_config)
1729   MCFG_CPU_PROGRAM_MAP(jag_gpu_map)
1730
1731   MCFG_CPU_ADD("audiocpu", JAGUARDSP, JAGUAR_CLOCK)
1732   MCFG_CPU_CONFIG(dsp_config)
1733   MCFG_CPU_PROGRAM_MAP(jag_dsp_map)
1734
1735   MCFG_MACHINE_RESET(jaguar)
1736//  MCFG_NVRAM_HANDLER(jaguar)
1737
1738   MCFG_TIMER_ADD("serial_timer", jaguar_serial_callback)
1739
1740   /* video hardware */
1741   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
1742   MCFG_SCREEN_ADD("screen", RASTER)
1743   MCFG_SCREEN_REFRESH_RATE(60)
1744   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
1745   MCFG_SCREEN_RAW_PARAMS(JAGUAR_CLOCK, 456, 42, 402, 262, 17, 257)
1746   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
1747   MCFG_SCREEN_UPDATE(cojag)
1748
1749   MCFG_VIDEO_START(jaguar)
1750
1751   /* sound hardware */
1752   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
1753   MCFG_SOUND_ADD("dac1", DAC, 0)
1754   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
1755   MCFG_SOUND_ADD("dac2", DAC, 0)
1756   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
1757
1758   /* quickload */
1759   MCFG_QUICKLOAD_ADD("quickload", jaguar, "abs,bin,cof,jag,prg", 0)
1760
1761   /* cartridge */
1762   MCFG_CARTSLOT_ADD("cart")
1763   MCFG_CARTSLOT_EXTENSION_LIST("j64,rom")
1764   MCFG_CARTSLOT_INTERFACE("jaguar_cart")
1765   MCFG_CARTSLOT_START(jaguar_cart)
1766   MCFG_CARTSLOT_LOAD(jaguar)
1767
1768   /* software lists */
1769   MCFG_SOFTWARE_LIST_ADD("cart_list","jaguar")
1770
1771   MCFG_EEPROM_93C46_ADD("eeprom")
1772MACHINE_CONFIG_END
1773
1774
1775
1776/*************************************
1777 *
1778 *  Driver initialization
1779 *
1780 *************************************/
1781
1782static void jaguar_fix_endian( running_machine &machine, UINT32 addr, UINT32 size )
1783{
1784   UINT8 j[4], *RAM = machine.region("maincpu")->base();
1785   UINT32 i;
1786   size += addr;
1787   logerror("File Loaded to address range %X to %X\n",addr,size-1);
1788   for (i = addr; i < size; i+=4)
1789   {
1790      j[0] = RAM[i];
1791      j[1] = RAM[i+1];
1792      j[2] = RAM[i+2];
1793      j[3] = RAM[i+3];
1794      RAM[i] = j[3];
1795      RAM[i+1] = j[2];
1796      RAM[i+2] = j[1];
1797      RAM[i+3] = j[0];
1798   }
1799}
1800
1801static DRIVER_INIT( jaguar )
1802{
1803   state_save_register_global(machine, joystick_data);
1804   using_cart = 0;
1805
1806   for (int i=0;i<0x20000/4;i++) // the cd bios is bigger.. check
1807   {
1808      rom_base[i] = ((rom_base[i] & 0xffff0000)>>16) | ((rom_base[i] & 0x0000ffff)<<16);
1809   }
1810
1811   for (int i=0;i<0x1000/4;i++)
1812   {
1813      high_rom_base[i] = ((high_rom_base[i] & 0xffff0000)>>16) | ((high_rom_base[i] & 0x0000ffff)<<16);
1814   }
1815}
1816
1817static QUICKLOAD_LOAD( jaguar )
1818{
1819   offs_t quickload_begin = 0x4000, start = quickload_begin, skip = 0;
1820   memset(jaguar_shared_ram, 0, 0x200000);
1821   quickload_size = MIN(quickload_size, 0x200000 - quickload_begin);
1822
1823   image.fread( &image.device().machine().region("maincpu")->base()[quickload_begin], quickload_size);
1824
1825   jaguar_fix_endian(image.device().machine(), quickload_begin, quickload_size);
1826
1827   /* Deal with some of the numerous homebrew header systems */
1828      /* COF */
1829   if ((jaguar_shared_ram[0x1000] & 0xffff0000) == 0x01500000)
1830   {
1831      start = jaguar_shared_ram[0x100e];
1832      skip = jaguar_shared_ram[0x1011];
1833   }
1834   else   /* PRG */
1835   if (((jaguar_shared_ram[0x1000] & 0xffff0000) == 0x601A0000) && (jaguar_shared_ram[0x1007] == 0x4A414752))
1836   {
1837      UINT32 type = jaguar_shared_ram[0x1008] >> 16;
1838      start = ((jaguar_shared_ram[0x1008] & 0xffff) << 16) | (jaguar_shared_ram[0x1009] >> 16);
1839      skip = 28;
1840      if (type == 2) skip = 42;
1841      else if (type == 3) skip = 46;
1842   }
1843   else   /* ABS with header */
1844   if ((jaguar_shared_ram[0x1000] & 0xffff0000) == 0x601B0000)
1845   {
1846      start = ((jaguar_shared_ram[0x1005] & 0xffff) << 16) | (jaguar_shared_ram[0x1006] >> 16);
1847      skip = 36;
1848   }
1849
1850   else   /* A header used by Badcoder */
1851   if ((jaguar_shared_ram[0x1000] & 0xffff0000) == 0x72000000)
1852      skip = 96;
1853
1854   else   /* ABS binary */
1855   if (!mame_stricmp(image.filetype(), "abs"))
1856      start = 0xc000;
1857
1858   else   /* JAG binary */
1859   if (!mame_stricmp(image.filetype(), "jag"))
1860      start = 0x5000;
1861
1862
1863   /* Now that we have the info, reload the file */
1864   if ((start != quickload_begin) || (skip))
1865   {
1866      memset(jaguar_shared_ram, 0, 0x200000);
1867      image.fseek(0, SEEK_SET);
1868      image.fread( &image.device().machine().region("maincpu")->base()[start-skip], quickload_size);
1869      quickload_begin = start;
1870      jaguar_fix_endian(image.device().machine(), (start-skip)&0xfffffc, quickload_size);
1871   }
1872
1873
1874   /* Some programs are too lazy to set a stack pointer */
1875   cpu_set_reg(image.device().machine().device("maincpu"), STATE_GENSP, 0x1000);
1876   jaguar_shared_ram[0]=0x1000;
1877
1878   /* Transfer control to image */
1879   cpu_set_reg(image.device().machine().device("maincpu"), STATE_GENPC, quickload_begin);
1880   jaguar_shared_ram[1]=quickload_begin;
1881   return IMAGE_INIT_PASS;
1882}
1883
1884static DEVICE_START( jaguar_cart )
1885{
1886   /* Initialize for no cartridge present */
1887   using_cart = 0;
1888   memset( cart_base, 0, cart_size );
1889}
1890
1891static DEVICE_IMAGE_LOAD( jaguar )
1892{
1893   UINT32 size, load_offset = 0;
1894
1895   if (image.software_entry() == NULL)
1896   {
1897      size = image.length();
1898
1899      /* .rom files load & run at 802000 */
1900      if (!mame_stricmp(image.filetype(), "rom"))
1901      {
1902         load_offset = 0x2000;      // fix load address
1903         cart_base[0x101]=0x802000;   // fix exec address
1904      }
1905
1906      /* Load cart into memory */
1907      image.fread( &image.device().machine().region("maincpu")->base()[0x800000+load_offset], size);
1908   }
1909   else
1910   {
1911      size = image.get_software_region_length("rom");
1912
1913      memcpy(cart_base, image.get_software_region("rom"), size);
1914   }
1915
1916   memset(jaguar_shared_ram, 0, 0x200000);
1917
1918   jaguar_fix_endian(image.device().machine(), 0x800000+load_offset, size);
1919
1920   /* Skip the logo */
1921   using_cart = 1;
1922//  cart_base[0x102] = 1;
1923
1924   /* Transfer control to the bios */
1925   cpu_set_reg(image.device().machine().device("maincpu"), STATE_GENPC, rom_base[1]);
1926   return IMAGE_INIT_PASS;
1927}
1928
1929/*************************************
1930 *
1931 *  ROM definition(s)
1932 *
1933 *  Date Information comes from either
1934 *   ROM labels or from the Self-Test
1935 *   as "Main"
1936 *
1937 *************************************/
1938
1939/* Home System */
1940
1941ROM_START( jaguar )
1942   ROM_REGION( 0x1000000, "maincpu", 0 )  /* 4MB for RAM at 0 */
1943   ROM_LOAD16_WORD( "jagboot.rom", 0xe00000, 0x020000, CRC(fb731aaa) SHA1(f8991b0c385f4e5002fa2a7e2f5e61e8c5213356) )
1944   ROM_CART_LOAD("cart", 0x800000, 0x600000, ROM_NOMIRROR)
1945   ROM_LOAD16_WORD("jagwave.rom", 0xf1d000, 0x1000, CRC(7a25ee5b) SHA1(58117e11fd6478c521fbd3fdbe157f39567552f0) )
1946ROM_END
1947
1948ROM_START( jaguarcd )
1949   ROM_REGION( 0x1000000, "maincpu", 0 )
1950   ROM_SYSTEM_BIOS( 0, "default", "Jaguar CD" )
1951   ROMX_LOAD( "jag_cd.bin", 0xe00000, 0x040000, CRC(687068d5) SHA1(73883e7a6e9b132452436f7ab1aeaeb0776428e5), ROM_BIOS(1) )
1952   ROM_SYSTEM_BIOS( 1, "dev", "Jaguar Developer CD" )
1953   ROMX_LOAD( "jagdevcd.bin", 0xe00000, 0x040000, CRC(55a0669c) SHA1(d61b7b5912118f114ef00cf44966a5ef62e455a5), ROM_BIOS(2) )
1954   ROM_CART_LOAD("cart", 0x800000, 0x600000, ROM_NOMIRROR)
1955   ROM_LOAD16_WORD("jagwave.rom", 0xf1d000, 0x1000, CRC(7a25ee5b) SHA1(58117e11fd6478c521fbd3fdbe157f39567552f0) )
1956ROM_END
1957
1958
1959/****************************************
1960
1961       ROM & Hard Disk based games
1962
1963****************************************/
1964
1965ROM_START( area51t ) /* 68020 based, Area51 Time Warner License  Date: Nov 15, 1995 */
1966   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for 68020 code */
1967   ROM_LOAD32_BYTE( "136105-0003c.3h", 0x00000, 0x80000, CRC(e70a97c4) SHA1(39dabf6bf3dc6f717a587f362d040bfb332be9e1) )
1968   ROM_LOAD32_BYTE( "136105-0002c.3p", 0x00001, 0x80000, CRC(e9c9f4bd) SHA1(7c6c50372d45dca8929767241b092339f3bab4d2) )
1969   ROM_LOAD32_BYTE( "136105-0001c.3m", 0x00002, 0x80000, CRC(6f135a81) SHA1(2d9660f240b14481e8c46bc98713e9dc12035063) )
1970   ROM_LOAD32_BYTE( "136105-0000c.3k", 0x00003, 0x80000, CRC(94f50c14) SHA1(a54552e3ac5c4f481ba4f2fc7d724534576fe76c) )
1971
1972   DISK_REGION( "ide" )
1973   DISK_IMAGE( "area51t", 0, SHA1(d2865cc7b1bb08a4393a72013a90e18d8a8f9860) )
1974ROM_END
1975
1976ROM_START( area51a ) /* 68020 based, Area51 Atari Games License  Date: Oct 25, 1995 */
1977   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for 68020 code */
1978   ROM_LOAD32_BYTE( "136105-0003a.3h", 0x00000, 0x80000, CRC(116d37e6) SHA1(5d36cae792dd349faa77cd2d8018722a28ee55c1) )
1979   ROM_LOAD32_BYTE( "136105-0002a.3p", 0x00001, 0x80000, CRC(eb10f539) SHA1(dadc4be5a442dd4bd17385033056555e528ed994) )
1980   ROM_LOAD32_BYTE( "136105-0001a.3m", 0x00002, 0x80000, CRC(c6d8322b) SHA1(90cf848a4195c51b505653cc2c74a3b9e3c851b8) )
1981   ROM_LOAD32_BYTE( "136105-0000a.3k", 0x00003, 0x80000, CRC(729eb1b7) SHA1(21864b4281b1ad17b2903e3aa294e4be74161e80) )
1982
1983   DISK_REGION( "ide" )
1984   DISK_IMAGE( "area51", 0, SHA1(3b303bc37e206a6d7339352c869f050d04186f11) )
1985ROM_END
1986
1987ROM_START( area51 ) /* R3000 based, labeled as "Area51 2-C"  Date: Nov 11 1996 */
1988   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for IDT 79R3041 code */
1989   ROM_LOAD32_BYTE( "a51_2-c.hh", 0x00000, 0x80000, CRC(13af6a1e) SHA1(69da54ed6886e825156bbcc256e8d7abd4dc1ff8) )
1990   ROM_LOAD32_BYTE( "a51_2-c.hl", 0x00001, 0x80000, CRC(8ab6649b) SHA1(9b4945bc04f8a73161638a2c5fa2fd84c6fd31b4) )
1991   ROM_LOAD32_BYTE( "a51_2-c.lh", 0x00002, 0x80000, CRC(a6524f73) SHA1(ae377a6803a4f7d1bbcc111725af121a3e82317d) )
1992   ROM_LOAD32_BYTE( "a51_2-c.ll", 0x00003, 0x80000, CRC(471b15d2) SHA1(4b5f45ee140b03a6be61475cae1c2dbef0f07457) )
1993
1994   DISK_REGION( "ide" )
1995   DISK_IMAGE( "area51", 0, SHA1(3b303bc37e206a6d7339352c869f050d04186f11) )
1996ROM_END
1997
1998ROM_START( maxforce ) /* R3000 based, labeled as "Maximum Force 5-23-97 v1.05" */
1999   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for IDT 79R3041 code */
2000   ROM_LOAD32_BYTE( "maxf_105.hh", 0x00000, 0x80000, CRC(ec7f8167) SHA1(0cf057bfb1f30c2c9621d3ed25021e7ba7bdd46e) )
2001   ROM_LOAD32_BYTE( "maxf_105.hl", 0x00001, 0x80000, CRC(3172611c) SHA1(00f14f871b737c66c20f95743740d964d0be3f24) )
2002   ROM_LOAD32_BYTE( "maxf_105.lh", 0x00002, 0x80000, CRC(84d49423) SHA1(88d9a6724f1118f2bbef5dfa27accc2b65c5ba1d) )
2003   ROM_LOAD32_BYTE( "maxf_105.ll", 0x00003, 0x80000, CRC(16d0768d) SHA1(665a6d7602a7f2f5b1f332b0220b1533143d56b1) )
2004
2005   DISK_REGION( "ide" )
2006   DISK_IMAGE( "maxforce", 0, SHA1(d54e7a8f3866bb2a1d28ae637e7c92ffa4dbe558) )
2007ROM_END
2008
2009
2010ROM_START( maxf_102 ) /* R3000 based, labeled as "Maximum Force 2-27-97 v1.02" */
2011   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for IDT 79R3041 code */
2012   ROM_LOAD32_BYTE( "maxf_102.hh", 0x00000, 0x80000, CRC(8ff7009d) SHA1(da22eae298a6e0e36f503fa091ac3913423dcd0f) )
2013   ROM_LOAD32_BYTE( "maxf_102.hl", 0x00001, 0x80000, CRC(96c2cc1d) SHA1(b332b8c042b92c736131c478cefac1c3c2d2673b) )
2014   ROM_LOAD32_BYTE( "maxf_102.lh", 0x00002, 0x80000, CRC(459ffba5) SHA1(adb40db6904e84c17f32ac6518fd2e994da7883f) )
2015   ROM_LOAD32_BYTE( "maxf_102.ll", 0x00003, 0x80000, CRC(e491be7f) SHA1(cbe281c099a4aa87067752d68cf2bb0ab3900531) )
2016
2017   DISK_REGION( "ide" )
2018   DISK_IMAGE( "maxforce", 0, SHA1(d54e7a8f3866bb2a1d28ae637e7c92ffa4dbe558) )
2019ROM_END
2020
2021
2022ROM_START( maxf_ng ) /* R3000 based, stickers say 'NO GORE' */
2023   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for IDT 79R3041 code */
2024   ROM_LOAD32_BYTE( "mf_ng_hh.21v", 0x00000, 0x80000, CRC(08791c02) SHA1(9befbff3201c7d345109b26c296fd8548dbfc95b) )
2025   ROM_LOAD32_BYTE( "mf_ng_hl.17v", 0x00001, 0x80000, CRC(52cf482c) SHA1(ff98b3f04987acef82a97a2ad35a9085fa84e6d5) )
2026   ROM_LOAD32_BYTE( "mf_ng_lh.21y", 0x00002, 0x80000, CRC(ab4ee992) SHA1(69f0fe111d3f5f31151d2922579e5073e484b1e1) )
2027   ROM_LOAD32_BYTE( "mf_ng_ll.17y", 0x00003, 0x80000, CRC(674aab43) SHA1(f79d790538756d1100b7e4ffed192a62a031a2cb) )
2028
2029   ROM_REGION( 0x800, "user2", 0 ) /* 28C16 style eeprom, currently loaded but not used */
2030   ROM_LOAD( "28c16.17z", 0x000, 0x800, CRC(1cdd9088) SHA1(4f01f02ff95f31ced87a3cdd7f171afd92551266) )
2031
2032   DISK_REGION( "ide" )
2033   DISK_IMAGE( "maxforce", 0, SHA1(d54e7a8f3866bb2a1d28ae637e7c92ffa4dbe558) )
2034ROM_END
2035
2036
2037ROM_START( area51mx )   /* 68020 based, Labeled as "68020 MAX/A51 KIT 2.0" Date: Apr 22, 1998 */
2038   ROM_REGION32_BE( 0x200000, "user1", 0 ) /* 2MB for 68020 code */
2039   ROM_LOAD32_BYTE( "area51mx.3h", 0x00000, 0x80000, CRC(47cbf30b) SHA1(23377bcc65c0fc330d5bc7e76e233bae043ac364) )
2040   ROM_LOAD32_BYTE( "area51mx.3p", 0x00001, 0x80000, CRC(a3c93684) SHA1(f6b3357bb69900a176fd6bc6b819b2f57b7d0f59) )
2041   ROM_LOAD32_BYTE( "area51mx.3m", 0x00002, 0x80000, CRC(d800ac17) SHA1(3d515c8608d8101ee9227116175b3c3f1fe22e0c) )
2042   ROM_LOAD32_BYTE( "area51mx.3k", 0x00003, 0x80000, CRC(0e78f308) SHA1(adc4c8e441eb8fe525d0a6220eb3a2a8791a7289) )
2043
2044   DISK_REGION( "ide" )
2045   DISK_IMAGE( "area51mx", 0, SHA1(5ff10f4e87094d4449eabf3de7549564ca568c7e) )
2046ROM_END
2047
2048
2049ROM_START( a51mxr3k ) /* R3000 based, Labeled as "R3K Max/A51 Kit Ver 1.0" */
2050   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for IDT 79R3041 code */
2051   ROM_LOAD32_BYTE( "a51mxr3k.hh", 0x00000, 0x80000, CRC(a984dab2) SHA1(debb3bc11ff49e87a52e89a69533a1bab7db700e) )
2052   ROM_LOAD32_BYTE( "a51mxr3k.hl", 0x00001, 0x80000, CRC(0af49d74) SHA1(c19f26056a823fd32293e9a7b3ea868640eabf49) )
2053   ROM_LOAD32_BYTE( "a51mxr3k.lh", 0x00002, 0x80000, CRC(d7d94dac) SHA1(2060a74715f36a0d7f5dd0855eda48ad1f20f095) )
2054   ROM_LOAD32_BYTE( "a51mxr3k.ll", 0x00003, 0x80000, CRC(ece9e5ae) SHA1(7e44402726f5afa6d1670b27aa43ad13d21c4ad9) )
2055
2056   DISK_REGION( "ide" )
2057   DISK_IMAGE( "area51mx", 0, SHA1(5ff10f4e87094d4449eabf3de7549564ca568c7e) )
2058ROM_END
2059
2060
2061ROM_START( vcircle )
2062   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
2063   ROM_LOAD32_BYTE( "hh", 0x00000, 0x80000, CRC(7276f5f5) SHA1(716287e370a4f300b1743103f8031afc82de38ca) )
2064   ROM_LOAD32_BYTE( "hl", 0x00001, 0x80000, CRC(146060a1) SHA1(f291989f1f0ef228757f1990fb14da5ff8f3cf8d) )
2065   ROM_LOAD32_BYTE( "lh", 0x00002, 0x80000, CRC(be4b2ef6) SHA1(4332b3036e9cb12685e914d085d9a63aa856f0be) )
2066   ROM_LOAD32_BYTE( "ll", 0x00003, 0x80000, CRC(ba8753eb) SHA1(0322e0e37d814a38d08ba191b1a97fb1a55fe461) )
2067
2068   DISK_REGION( "ide" )
2069   DISK_IMAGE( "vcircle", 0, SHA1(bfa79c4cacdc9c2cd6362f62a23056b3e35a2034) )
2070ROM_END
2071
2072
2073
2074/****************************************
2075
2076       ROM based games
2077
2078****************************************/
2079
2080
2081ROM_START( fishfren )
2082   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
2083   ROM_LOAD32_BYTE( "hh", 0x00000, 0x80000, CRC(2ef79767) SHA1(abcea584f2cbd71b05f9d7e61f40ca9da6799215) )
2084   ROM_LOAD32_BYTE( "hl", 0x00001, 0x80000, CRC(7eefd4a2) SHA1(181be04836704098082fd78cacc68ffa70e77892) )
2085   ROM_LOAD32_BYTE( "lh", 0x00002, 0x80000, CRC(bbe9ed15) SHA1(889af29afe6d984b39105aa238400392a5dfb2c5) )
2086   ROM_LOAD32_BYTE( "ll", 0x00003, 0x80000, CRC(d70d0f2c) SHA1(2689cbe56ae3d491348b241528b0fe345fa8484c) )
2087
2088   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
2089   ROMX_LOAD( "l63-56", 0x000000, 0x100000, CRC(42764ea5) SHA1(805245f01006bd974fbac56f688cfcf137ddc914), ROM_SKIP(7) )
2090   ROMX_LOAD( "l55-48", 0x000001, 0x100000, CRC(0c7592bb) SHA1(d5bd6b872abad58947842205f9eac46fd065e88f), ROM_SKIP(7) )
2091   ROMX_LOAD( "l47-40", 0x000002, 0x100000, CRC(6d7dcdb1) SHA1(914dae3b9df5c861f794b683571c5fb0c2c3c3fd), ROM_SKIP(7) )
2092   ROMX_LOAD( "l39-32", 0x000003, 0x100000, CRC(ef3b8d98) SHA1(858c3342e9693bfe887b91dde1116a1656a1a105), ROM_SKIP(7) )
2093   ROMX_LOAD( "l31-24", 0x000004, 0x100000, CRC(132d628e) SHA1(3ff9fa86092eb01f21ca3ccf1ee1e3a583cbdecb), ROM_SKIP(7) )
2094   ROMX_LOAD( "l23-16", 0x000005, 0x100000, CRC(b841f039) SHA1(79f661aee009aef2f5ad4122ae3e0ac94097a427), ROM_SKIP(7) )
2095   ROMX_LOAD( "l15-08", 0x000006, 0x100000, CRC(0800214e) SHA1(5372f2c3470619a4967958c76055486f76b5f150), ROM_SKIP(7) )
2096   ROMX_LOAD( "l07-00", 0x000007, 0x100000, CRC(f83b2e78) SHA1(83ee9d2bfba83e04fb794270926bd3e558c9aaa4), ROM_SKIP(7) )
2097   ROMX_LOAD( "h63-56", 0x800000, 0x080000, CRC(67740765) SHA1(8b22413d25e0dbfe2227d1a8a023961a4c13cb76), ROM_SKIP(7) )
2098   ROMX_LOAD( "h55-48", 0x800001, 0x080000, CRC(ffed0091) SHA1(6c8104acd7e6d95a111f9c7a4d3b6984293d72c4), ROM_SKIP(7) )
2099   ROMX_LOAD( "h47-40", 0x800002, 0x080000, CRC(6f448f72) SHA1(3a298b9851e4ba7aa611aa6c2b0dcf06f4301463), ROM_SKIP(7) )
2100   ROMX_LOAD( "h39-32", 0x800003, 0x080000, CRC(25a5bd67) SHA1(79f29bd36afb4574b9c923eee293964284713540), ROM_SKIP(7) )
2101   ROMX_LOAD( "h31-24", 0x800004, 0x080000, CRC(e7088cc0) SHA1(4cb184de748c5633e669a4675e6db9920d34811e), ROM_SKIP(7) )
2102   ROMX_LOAD( "h23-16", 0x800005, 0x080000, CRC(ab477a76) SHA1(ae9aa97dbc758cd741710fe08c6ea94a0a318451), ROM_SKIP(7) )
2103   ROMX_LOAD( "h15-08", 0x800006, 0x080000, CRC(25a423f1) SHA1(7530cf2e28e0755bfcbd70789ef5cbbfb3d94f9f), ROM_SKIP(7) )
2104   ROMX_LOAD( "h07-00", 0x800007, 0x080000, CRC(0f5f4cc6) SHA1(caa2b514fb1f2a815e63f7b8c6b79ce2dfa308c4), ROM_SKIP(7) )
2105   ROM_COPY( "user2", 0x800000, 0xc00000, 0x400000 )
2106ROM_END
2107
2108ROM_START( freezeat )
2109   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
2110   ROM_LOAD32_BYTE( "prog_eng.hh",          0x000000, 0x040000, CRC(f7cffafd) SHA1(62369de4cf0a5abab86f6bcf9621028b9e171ec3) )
2111   ROM_LOAD32_BYTE( "prog_eng.hl",          0x000001, 0x040000, CRC(17150705) SHA1(c5a32d334bffb58a816920cc1251a21acc5a6f92) )
2112   ROM_LOAD32_BYTE( "prog_eng.lh",          0x000002, 0x040000, CRC(12a903bf) SHA1(41f5949d7ed2081917af8411f92666b754564b37) )
2113   ROM_LOAD32_BYTE( "prog_eng.ll",          0x000003, 0x040000, CRC(cf69f971) SHA1(132b06f5fb49801fff7e5deb7aa71b44d5b1c6ca) )
2114
2115   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
2116   ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(b61061c5) SHA1(aeb409aa5073232d80ed81b27946e753290234f4), ROM_SKIP(7) )
2117   ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(c85acf42) SHA1(c3365caeb126a83a7e7afcda25f05849ceb5c98b), ROM_SKIP(7) )
2118   ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(67f78f59) SHA1(40b256a8939fad365c7e896cff4a959fcc70a477), ROM_SKIP(7) )
2119   ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(6be0508a) SHA1(20f617278ce1666348822d80686cecd8d9b1bc78), ROM_SKIP(7) )
2120   ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(905606e0) SHA1(866cd98ea2399fed96f76b16dce751e2c7cfdc98), ROM_SKIP(7) )
2121   ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(cdeef6fa) SHA1(1b4d58951b662040540e7d51f88c1b6f282562ee), ROM_SKIP(7) )
2122   ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(ad81f204) SHA1(58584a6c8c6cfb6366eaa10aba8a226e419f5ce9), ROM_SKIP(7) )
2123   ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(10ce7254) SHA1(2a88d45dbe78ea8358ecd8522b38d775a2fdb34a), ROM_SKIP(7) )
2124   ROMX_LOAD( "fish_eng.63-56", 0x800000, 0x100000, CRC(4a03f971) SHA1(1ae5ad9a6cd2d612c6519193134dcd5a3f6a5049), ROM_SKIP(7) )
2125   ROMX_LOAD( "fish_eng.55-48", 0x800001, 0x100000, CRC(6bc00de0) SHA1(b1b180c33906826703452875ce250b28352e2797), ROM_SKIP(7) )
2126   ROMX_LOAD( "fish_eng.47-40", 0x800002, 0x100000, CRC(41ccc677) SHA1(76ee042632cfdcc99a9bfb75f2a4ef04e08f101b), ROM_SKIP(7) )
2127   ROMX_LOAD( "fish_eng.39-32", 0x800003, 0x100000, CRC(59a8fa03) SHA1(19e91a4791e0d2dbd8578cee0fa07c491204b0dc), ROM_SKIP(7) )
2128   ROMX_LOAD( "fish_eng.31-24", 0x800004, 0x100000, CRC(c3bb50a1) SHA1(b868ac0812d1c13feae82d293bb323a93a72e1d3), ROM_SKIP(7) )
2129   ROMX_LOAD( "fish_eng.23-16", 0x800005, 0x100000, CRC(237cfc93) SHA1(15f61dc621c5328cc7752c76b2b1dae265a5e886), ROM_SKIP(7) )
2130   ROMX_LOAD( "fish_eng.15-08", 0x800006, 0x100000, CRC(65bec279) SHA1(5e99972279ee9ad32e67866fc63799579a10f2dd), ROM_SKIP(7) )
2131   ROMX_LOAD( "fish_eng.07-00", 0x800007, 0x100000, CRC(13fa20ad) SHA1(0a04fdea025109c0e604ef2a6d58cfb3adce9bd1), ROM_SKIP(7) )
2132ROM_END
2133
2134ROM_START( freezeatjp )
2135   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
2136   ROM_LOAD32_BYTE( "prog_jpn.hh",          0x000000, 0x040000, CRC(989302bf) SHA1(232927ec0a52b8bb587a3c206af8e1c6cde67860) )
2137   ROM_LOAD32_BYTE( "prog_jpn.hl",          0x000001, 0x040000, CRC(6262b760) SHA1(12ca749f5cdc6db7d19f88a21f5f955b80206784) )
2138   ROM_LOAD32_BYTE( "prog_jpn.lh",          0x000002, 0x040000, CRC(c6a12b0c) SHA1(971242b5b09e15164e7c335e684b5043510c6462) )
2139   ROM_LOAD32_BYTE( "prog_jpn.ll",          0x000003, 0x040000, CRC(241ea755) SHA1(0db3cfbe577fc78387528390ebb14dbb7a09c97d) )
2140
2141   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
2142   ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(b61061c5) SHA1(aeb409aa5073232d80ed81b27946e753290234f4), ROM_SKIP(7) )
2143   ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(c85acf42) SHA1(c3365caeb126a83a7e7afcda25f05849ceb5c98b), ROM_SKIP(7) )
2144   ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(67f78f59) SHA1(40b256a8939fad365c7e896cff4a959fcc70a477), ROM_SKIP(7) )
2145   ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(6be0508a) SHA1(20f617278ce1666348822d80686cecd8d9b1bc78), ROM_SKIP(7) )
2146   ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(905606e0) SHA1(866cd98ea2399fed96f76b16dce751e2c7cfdc98), ROM_SKIP(7) )
2147   ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(cdeef6fa) SHA1(1b4d58951b662040540e7d51f88c1b6f282562ee), ROM_SKIP(7) )
2148   ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(ad81f204) SHA1(58584a6c8c6cfb6366eaa10aba8a226e419f5ce9), ROM_SKIP(7) )
2149   ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(10ce7254) SHA1(2a88d45dbe78ea8358ecd8522b38d775a2fdb34a), ROM_SKIP(7) )
2150   ROMX_LOAD( "fish_jpn.63-56", 0x800000, 0x100000, CRC(78c65a1f) SHA1(1a97737c222809930bde9df7a55e1ff1581a3202), ROM_SKIP(7) )
2151   ROMX_LOAD( "fish_jpn.55-48", 0x800001, 0x100000, CRC(9ffac0f1) SHA1(3ba5f8de32a5febb5d3d22f59ccb477834d33934), ROM_SKIP(7) )
2152   ROMX_LOAD( "fish_jpn.47-40", 0x800002, 0x100000, CRC(18543fb7) SHA1(4ab9969de9a66d6b7b70cfa5290c1cf7bce54838), ROM_SKIP(7) )
2153   ROMX_LOAD( "fish_jpn.39-32", 0x800003, 0x100000, CRC(22578f15) SHA1(4e314b22456ed4e4282406e990207e3b9bdf6203), ROM_SKIP(7) )
2154   ROMX_LOAD( "fish_jpn.31-24", 0x800004, 0x100000, CRC(5c41b91b) SHA1(ce354c8a4a3872b009e8af9f75e8f4f0892c7a7e), ROM_SKIP(7) )
2155   ROMX_LOAD( "fish_jpn.23-16", 0x800005, 0x100000, CRC(c2462646) SHA1(207d51a2aae076bc78548cf96325e670ea41609c), ROM_SKIP(7) )
2156   ROMX_LOAD( "fish_jpn.15-08", 0x800006, 0x100000, CRC(f8d998ec) SHA1(ffce4a16fbb2fff3dc0a29c0cede4dfe6316e97b), ROM_SKIP(7) )
2157   ROMX_LOAD( "fish_jpn.07-00", 0x800007, 0x100000, CRC(e7e0daa5) SHA1(108da84cc6b4df7ae88cfdacd27c1728e59cdb81), ROM_SKIP(7) )
2158ROM_END
2159
2160ROM_START( freezeat2 )
2161   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
2162   ROM_LOAD32_BYTE( "prog.hh",              0x000000, 0x040000, CRC(a8aefa52) SHA1(ba95da93035520de4b15245f68217c59dfb69dbd) )
2163   ROM_LOAD32_BYTE( "prog.hl",              0x000001, 0x040000, CRC(152dd641) SHA1(52fa260baf1979ed8f15f8abcbbeebd8e595d0e4) )
2164   ROM_LOAD32_BYTE( "prog.lh",              0x000002, 0x040000, CRC(416d26ed) SHA1(11cf3b88415a8a5d0bb8e1df08603a85202186ef) )
2165   ROM_LOAD32_BYTE( "prog.ll",              0x000003, 0x040000, CRC(d6a5dbc8) SHA1(0e2176c35cbc59b2a5283366210409d0e930bac7) )
2166
2167   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
2168   ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(99d0dc75) SHA1(b32126eea70c7584d1c34a6ca33282fbaf4b03aa), ROM_SKIP(7) )
2169   ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(2dfdfe62) SHA1(e0554d36ef5cf4b6ce171857ea4f2737f11286a5), ROM_SKIP(7) )
2170   ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(722aee2a) SHA1(bc79433131bed5b08453d1b80324a28a552783de), ROM_SKIP(7) )
2171   ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(919e31b4) SHA1(3807d4629d8277c780dba888c23d17ba47803f27), ROM_SKIP(7) )
2172   ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(a957ac95) SHA1(ddfaca994c06976bee8b123857904e64f40b7f31), ROM_SKIP(7) )
2173   ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(a147ec66) SHA1(6291008158d581b81e025ed34ff0950983c12c67), ROM_SKIP(7) )
2174   ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(206d2f38) SHA1(6aca89df26d3602ff1da3c23f19e0782439623ff), ROM_SKIP(7) )
2175   ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(06559831) SHA1(b2c022457425d7900337cfa2fd1622336c0c0bc5), ROM_SKIP(7) )
2176   ROMX_LOAD( "fish_gr1.63-56", 0x800000, 0x100000, CRC(30c624d2) SHA1(4ced77d1663169d0cb37d6728ec52e67f05064c5), ROM_SKIP(7) )
2177   ROMX_LOAD( "fish_gr1.55-48", 0x800001, 0x100000, CRC(049cd60f) SHA1(8a7615a76b57a4e6ef5d95a5ee6c56086671dbb6), ROM_SKIP(7) )
2178   ROMX_LOAD( "fish_gr1.47-40", 0x800002, 0x100000, CRC(d6aaf3bf) SHA1(1c597bdc0e61fd0941cff5a8a93f24f108bd0daa), ROM_SKIP(7) )
2179   ROMX_LOAD( "fish_gr1.39-32", 0x800003, 0x100000, CRC(7d6ebc69) SHA1(668769297f75f9c367bc5cde26419ed092fc9dd8), ROM_SKIP(7) )
2180   ROMX_LOAD( "fish_gr1.31-24", 0x800004, 0x100000, CRC(6e5fee1f) SHA1(1eca79c8d395f881d0a05f10073998fcae70c3b1), ROM_SKIP(7) )
2181   ROMX_LOAD( "fish_gr1.23-16", 0x800005, 0x100000, CRC(a8b1e9b4) SHA1(066285928e574e656510b90bc212a8d86660bd07), ROM_SKIP(7) )
2182   ROMX_LOAD( "fish_gr1.15-08", 0x800006, 0x100000, CRC(c90080e6) SHA1(a764bdd6b4e9e727f7468a53424a9211ec5fd5a8), ROM_SKIP(7) )
2183   ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(1f20c020) SHA1(71b32386dc0444264f2f1e2a81899e0e9260994c), ROM_SKIP(7) )
2184ROM_END
2185
2186ROM_START( freezeat3 )
2187   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
2188   ROM_LOAD32_BYTE( "prog.hh",              0x000000, 0x040000, CRC(863942e6) SHA1(c7429c8a5c86ff93c64950e201cffca83dd7b7b0) )
2189   ROM_LOAD32_BYTE( "prog.hl",              0x000001, 0x040000, CRC(2acc18ef) SHA1(ead02566f7641b1d1066bd2e257b695e5c7e8437) )
2190   ROM_LOAD32_BYTE( "prog.lh",              0x000002, 0x040000, CRC(948cf20c) SHA1(86c757aa3c849ef5ba94ed4d5dbf10e833dab6bd) )
2191   ROM_LOAD32_BYTE( "prog.ll",              0x000003, 0x040000, CRC(5f44969e) SHA1(32345d7c56a3a890e71f8c71f25414d442b60af8) )
2192
2193   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
2194   ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(36799449) SHA1(bb706fe7fdc68f840702a127eed7d4519dd45869), ROM_SKIP(7) )
2195   ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(23959947) SHA1(a35a6e62c7b2be57d41b1b64be93713cbf897f0a), ROM_SKIP(7) )
2196   ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(4657e4e0) SHA1(b6c07182babcb0a106bf4a8f2e3f524371dd882d), ROM_SKIP(7) )
2197   ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(b6ea4b64) SHA1(176f94f14307c40b9c611d6f6bc9118e498cdfad), ROM_SKIP(7) )
2198   ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(7d4ce71f) SHA1(a1cf5aa9df8dd29c777c10cfdce0925981584261), ROM_SKIP(7) )
2199   ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(02db4fd1) SHA1(fce6f31802bf36d6b006f0b212f553bdf21f9374), ROM_SKIP(7) )
2200   ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(7d496d6c) SHA1(f82db0621729a00acf4077482e9dfab040ac829b), ROM_SKIP(7) )
2201   ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(3aa389d8) SHA1(52502f2f3c91d7c29261f60fe8f489a352399c96), ROM_SKIP(7) )
2202   ROMX_LOAD( "fish_gr1.63-56", 0x800000, 0x100000, CRC(ead678c9) SHA1(f83d467f6685965b6176b10adbd4e35ef808baf3), ROM_SKIP(7) )
2203   ROMX_LOAD( "fish_gr1.55-48", 0x800001, 0x100000, CRC(3591e752) SHA1(df242d2f724edfd78f7191f0ba7a8cde2c09b25f), ROM_SKIP(7) )
2204   ROMX_LOAD( "fish_gr1.47-40", 0x800002, 0x100000, CRC(e29a7a6c) SHA1(0bfb26076b390492eed81d4c4f0852c64fdccfce), ROM_SKIP(7) )
2205   ROMX_LOAD( "fish_gr1.39-32", 0x800003, 0x100000, CRC(e980f957) SHA1(78e8ef07f443ce7991a46005627d5802d36d731c), ROM_SKIP(7) )
2206   ROMX_LOAD( "fish_gr1.31-24", 0x800004, 0x100000, CRC(d90c5221) SHA1(7a330f39f3751d58157f872d92c3c2b91fe60d14), ROM_SKIP(7) )
2207   ROMX_LOAD( "fish_gr1.23-16", 0x800005, 0x100000, CRC(9be0d4de) SHA1(9bb67a1f1db77483e896fed7096c1e23c153ede4), ROM_SKIP(7) )
2208   ROMX_LOAD( "fish_gr1.15-08", 0x800006, 0x100000, CRC(122248af) SHA1(80dd5486106d475bd9f6d78919ebeb176e7becff), ROM_SKIP(7) )
2209   ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(5ae08327) SHA1(822d8292793509ebfbfce27e92a74c78c4328bda), ROM_SKIP(7) )
2210ROM_END
2211
2212ROM_START( freezeat4 )
2213   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
2214   ROM_LOAD32_BYTE( "prog.hh",              0x000000, 0x040000, CRC(80336f5e) SHA1(9946e8eebec2cd68db059f40f535ea212f41913d) )
2215   ROM_LOAD32_BYTE( "prog.hl",              0x000001, 0x040000, CRC(55125520) SHA1(13be4fbf32bcd94a2ea97fd690bd1dfdff146d33) )
2216   ROM_LOAD32_BYTE( "prog.lh",              0x000002, 0x040000, CRC(9d99c794) SHA1(f443f05a5979db66d61ef4174f0369a1cf4b7793) )
2217   ROM_LOAD32_BYTE( "prog.ll",              0x000003, 0x040000, CRC(e03700e0) SHA1(24d41750f02ee7e8fb379e517751b661400aa521) )
2218
2219   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
2220   ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(36799449) SHA1(bb706fe7fdc68f840702a127eed7d4519dd45869), ROM_SKIP(7) )
2221   ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(23959947) SHA1(a35a6e62c7b2be57d41b1b64be93713cbf897f0a), ROM_SKIP(7) )
2222   ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(4657e4e0) SHA1(b6c07182babcb0a106bf4a8f2e3f524371dd882d), ROM_SKIP(7) )
2223   ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(b6ea4b64) SHA1(176f94f14307c40b9c611d6f6bc9118e498cdfad), ROM_SKIP(7) )
2224   ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(7d4ce71f) SHA1(a1cf5aa9df8dd29c777c10cfdce0925981584261), ROM_SKIP(7) )
2225   ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(02db4fd1) SHA1(fce6f31802bf36d6b006f0b212f553bdf21f9374), ROM_SKIP(7) )
2226   ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(7d496d6c) SHA1(f82db0621729a00acf4077482e9dfab040ac829b), ROM_SKIP(7) )
2227   ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(3aa389d8) SHA1(52502f2f3c91d7c29261f60fe8f489a352399c96), ROM_SKIP(7) )
2228   ROMX_LOAD( "fish_gr1.63-56", 0x800000, 0x100000, CRC(c91b6ee4) SHA1(58d2d6b1b9847150b8b3e358842c4a097ef91475), ROM_SKIP(7) )
2229   ROMX_LOAD( "fish_gr1.55-48", 0x800001, 0x100000, CRC(65528e55) SHA1(18020cababed379f77149b7e89e80b294766df31), ROM_SKIP(7) )
2230   ROMX_LOAD( "fish_gr1.47-40", 0x800002, 0x100000, CRC(8fe4187f) SHA1(c9ceec40688617e1251142465d0e608f80a83e40), ROM_SKIP(7) )
2231   ROMX_LOAD( "fish_gr1.39-32", 0x800003, 0x100000, CRC(fdf05a42) SHA1(849e224b68be2fb396ee4cb4729517470af7c282), ROM_SKIP(7) )
2232   ROMX_LOAD( "fish_gr1.31-24", 0x800004, 0x100000, CRC(bb2cd741) SHA1(ac55a54c702d222cb1b9bb480b0f7a71bc315878), ROM_SKIP(7) )
2233   ROMX_LOAD( "fish_gr1.23-16", 0x800005, 0x100000, CRC(ea8c5984) SHA1(eca1619c17dfac154a2024ec49b4b4f9f06a50c9), ROM_SKIP(7) )
2234   ROMX_LOAD( "fish_gr1.15-08", 0x800006, 0x100000, CRC(0b00c816) SHA1(879b0e9d92fe737d740c348dc1cc376c8abfbdb8), ROM_SKIP(7) )
2235   ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(a84335c3) SHA1(340f5ddb9bff1ecd469eab8be36cc0ede84f1f5e), ROM_SKIP(7) )
2236ROM_END
2237
2238ROM_START( freezeat5 )
2239   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
2240   ROM_LOAD32_BYTE( "prog.hh",              0x000000, 0x040000, CRC(95c4fc64) SHA1(cd00efe7f760ef1e4cdc4bc8a3b368427cb15d8a) )
2241   ROM_LOAD32_BYTE( "prog.hl",              0x000001, 0x040000, CRC(ffb9cb71) SHA1(35d6a5440d63bc5b94c4447645365039169da368) )
2242   ROM_LOAD32_BYTE( "prog.lh",              0x000002, 0x040000, CRC(3ddacd80) SHA1(79f9650531847eefd83908b6ea1e8362688b377c) )
2243   ROM_LOAD32_BYTE( "prog.ll",              0x000003, 0x040000, CRC(95ebefb0) SHA1(b88b12adabd7b0902c3a78919bcec8d9a2b04168) )
2244
2245   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
2246   ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(404a10c3) SHA1(8e353ac7608bd54f0fea610c85166ad14f2faadb), ROM_SKIP(7) )
2247   ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(0b262f2f) SHA1(2a963cb5c3344091406d090edfdda498709c6aa6), ROM_SKIP(7) )
2248   ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(43f86d26) SHA1(b31d36b11052514b5bcd5bf8e400457ca572c306), ROM_SKIP(7) )
2249   ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(5cf0228f) SHA1(7a8c59cf9a7744e9f332db5f661f507323375968), ROM_SKIP(7) )
2250   ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(7a24ff98) SHA1(db9e0e8bb417f187267a6e4fc1e66ff060ee4096), ROM_SKIP(7) )
2251   ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(ea163c93) SHA1(d07ed26191d36497c56b15774625a49ecb958386), ROM_SKIP(7) )
2252   ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(d364534f) SHA1(153908bb8929a898945f768f8bc3d853c6aeaceb), ROM_SKIP(7) )
2253   ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(7ba4cb0d) SHA1(16bd487123f499b7080596dc76253081179a0f66), ROM_SKIP(7) )
2254   ROMX_LOAD( "fish_gr1.63-56", 0x800000, 0x100000, CRC(0e1fc4a9) SHA1(a200bb0af5f1e2c3f8d221ae4e9ba55b9dfb8550), ROM_SKIP(7) )
2255   ROMX_LOAD( "fish_gr1.55-48", 0x800001, 0x100000, CRC(b696b875) SHA1(16dc4d5cee3f08360cf19926584419c21d781f45), ROM_SKIP(7) )
2256   ROMX_LOAD( "fish_gr1.47-40", 0x800002, 0x100000, CRC(e78d9302) SHA1(f8b5ed992c433d63677edbeafd3e465b1d42b455), ROM_SKIP(7) )
2257   ROMX_LOAD( "fish_gr1.39-32", 0x800003, 0x100000, CRC(9b50374c) SHA1(d8af3c9d8e0459e24b974cdf2e75c7c39582912f), ROM_SKIP(7) )
2258   ROMX_LOAD( "fish_gr1.31-24", 0x800004, 0x100000, CRC(b6a19b7e) SHA1(5668b27db4dade8efb1524b8ecd1fe78498e8460), ROM_SKIP(7) )
2259   ROMX_LOAD( "fish_gr1.23-16", 0x800005, 0x100000, CRC(ff835b67) SHA1(19da2de1d067069871c33c8b25fd2eac2d03f627), ROM_SKIP(7) )
2260   ROMX_LOAD( "fish_gr1.15-08", 0x800006, 0x100000, CRC(8daf6995) SHA1(2f44031378b5fb1ba1f80a966dbe902316dc6fe8), ROM_SKIP(7) )
2261   ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(3676ac70) SHA1(640c4d4f53ca2bcae2009e402fd6ad70e40defa4), ROM_SKIP(7) )
2262ROM_END
2263
2264ROM_START( freezeat6 )
2265   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
2266   ROM_LOAD32_BYTE( "prog.hh",              0x000000, 0x040000, CRC(120711fe) SHA1(387e3cc8a1a9ea7d65c528387891d09ed9889fe3) )
2267   ROM_LOAD32_BYTE( "prog.hl",              0x000001, 0x040000, CRC(18dd292a) SHA1(00e79851140716985f43594142c97e510a06b24a) )
2268   ROM_LOAD32_BYTE( "prog.lh",              0x000002, 0x040000, CRC(ce387e72) SHA1(021a274da0b828550a47c3778e1059d4e759693a) )
2269   ROM_LOAD32_BYTE( "prog.ll",              0x000003, 0x040000, CRC(9b307b7c) SHA1(71b696802fe7c867525d2626351dcfacedabd696) )
2270
2271   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
2272   ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(293a3308) SHA1(e4c88759c3b8f8a359db83817dbd0428350b4f7e), ROM_SKIP(7) )
2273   ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(18bb4bdf) SHA1(1f6c49b3b5946390fa7582b531f8d9af3baa2567), ROM_SKIP(7) )
2274   ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(1faedcc6) SHA1(1e4ecbe4553fb3ebfbd03bd7e16066ccb531d00b), ROM_SKIP(7) )
2275   ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(536bc349) SHA1(06d7ac38b2c8cdc85e2cb531bba9c836e50c8247), ROM_SKIP(7) )
2276   ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(813d4a31) SHA1(e024f9da2f15a482d8142870baf487297b995ed9), ROM_SKIP(7) )
2277   ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(f881514b) SHA1(a694f90621e2c1569a6a5ed8920838ba5506f72e), ROM_SKIP(7) )
2278   ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(d7634655) SHA1(d7ac83c0fa5d0ec57d096d4d704fe99ee8160e09), ROM_SKIP(7) )
2279   ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(3fca32a3) SHA1(22753a9678e04d9355238e013e58d9f45315579d), ROM_SKIP(7) )
2280   ROMX_LOAD( "fish_gr1.63-56", 0x800000, 0x100000, CRC(a2b89d3a) SHA1(9cfcd0b88dea192ba39efcdccc78d1a0fd8f3388), ROM_SKIP(7) )
2281   ROMX_LOAD( "fish_gr1.55-48", 0x800001, 0x100000, CRC(766822a8) SHA1(2c9b14542a5467c1a3451559ea296da09c2cfdb9), ROM_SKIP(7) )
2282   ROMX_LOAD( "fish_gr1.47-40", 0x800002, 0x100000, CRC(112b519c) SHA1(f0e1ed1b8ad271fa9708f513b11d5cca6e550668), ROM_SKIP(7) )
2283   ROMX_LOAD( "fish_gr1.39-32", 0x800003, 0x100000, CRC(435b5d37) SHA1(ecb6e7271d993f8e315b85e69166838e66dd41a8), ROM_SKIP(7) )
2284   ROMX_LOAD( "fish_gr1.31-24", 0x800004, 0x100000, CRC(2637ae7f) SHA1(5e0bd0e08d8c1eaae725b4d55030c2698abd46e7), ROM_SKIP(7) )
2285   ROMX_LOAD( "fish_gr1.23-16", 0x800005, 0x100000, CRC(e732f1bf) SHA1(a228aee0cc36a0089716f20bfa75d87750692adb), ROM_SKIP(7) )
2286   ROMX_LOAD( "fish_gr1.15-08", 0x800006, 0x100000, CRC(7d4e2d9e) SHA1(4cb9b754b7585df4cae6bdd7085a57729d53e643), ROM_SKIP(7) )
2287   ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(8ea036af) SHA1(1f9baec6712e0ba0e8a744529e41799217760194), ROM_SKIP(7) )
2288ROM_END
2289
2290
2291/*************************************
2292 *
2293 *  Driver initialization
2294 *
2295 *************************************/
2296
2297static void cojag_common_init(running_machine &machine, UINT16 gpu_jump_offs, UINT16 spin_pc)
2298{
2299   cojag_state *state = machine.driver_data<cojag_state>();
2300   /* copy over the ROM */
2301   state->m_main_cpu = machine.device<cpu_device>("maincpu");
2302   cojag_is_r3000 = (state->m_main_cpu->type() == R3041BE);
2303
2304   /* install synchronization hooks for GPU */
2305   if (cojag_is_r3000)
2306      machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x04f0b000 + gpu_jump_offs, 0x04f0b003 + gpu_jump_offs, FUNC(gpu_jump_w));
2307   else
2308      machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf0b000 + gpu_jump_offs, 0xf0b003 + gpu_jump_offs, FUNC(gpu_jump_w));
2309   machine.device("gpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf03000 + gpu_jump_offs, 0xf03003 + gpu_jump_offs, FUNC(gpu_jump_r));
2310   state->m_gpu_jump_address = &jaguar_gpu_ram[gpu_jump_offs/4];
2311   state->m_gpu_spin_pc = 0xf03000 + spin_pc;
2312
2313   /* init the sound system and install DSP speedups */
2314   cojag_sound_init(machine);
2315}
2316
2317
2318static DRIVER_INIT( area51a )
2319{
2320   cojag_state *state = machine.driver_data<cojag_state>();
2321   cojag_common_init(machine, 0x5c4, 0x5a0);
2322
2323#if ENABLE_SPEEDUP_HACKS
2324   /* install speedup for main CPU */
2325   state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa02030, 0xa02033, FUNC(area51_main_speedup_w));
2326#endif
2327}
2328
2329
2330static DRIVER_INIT( area51 )
2331{
2332   cojag_state *state = machine.driver_data<cojag_state>();
2333   cojag_common_init(machine, 0x0c0, 0x09e);
2334
2335#if ENABLE_SPEEDUP_HACKS
2336   /* install speedup for main CPU */
2337   state->m_main_speedup_max_cycles = 120;
2338   state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x100062e8, 0x100062eb, FUNC(cojagr3k_main_speedup_r));
2339#endif
2340}
2341
2342static DRIVER_INIT( maxforce )
2343{
2344   cojag_state *state = machine.driver_data<cojag_state>();
2345   cojag_common_init(machine, 0x0c0, 0x09e);
2346
2347   /* patch the protection */
2348   state->m_rom_base[0x220/4] = 0x03e00008;
2349
2350#if ENABLE_SPEEDUP_HACKS
2351   /* install speedup for main CPU */
2352   state->m_main_speedup_max_cycles = 120;
2353   state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x1000865c, 0x1000865f, FUNC(cojagr3k_main_speedup_r));
2354#endif
2355}
2356
2357
2358static DRIVER_INIT( area51mx )
2359{
2360   cojag_state *state = machine.driver_data<cojag_state>();
2361   cojag_common_init(machine, 0x0c0, 0x09e);
2362
2363   /* patch the protection */
2364   state->m_rom_base[0x418/4] = 0x4e754e75;
2365
2366#if ENABLE_SPEEDUP_HACKS
2367   /* install speedup for main CPU */
2368   state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa19550, 0xa19557, FUNC(area51mx_main_speedup_w));
2369#endif
2370}
2371
2372
2373static DRIVER_INIT( a51mxr3k )
2374{
2375   cojag_state *state = machine.driver_data<cojag_state>();
2376   cojag_common_init(machine, 0x0c0, 0x09e);
2377
2378   /* patch the protection */
2379   state->m_rom_base[0x220/4] = 0x03e00008;
2380
2381#if ENABLE_SPEEDUP_HACKS
2382   /* install speedup for main CPU */
2383   state->m_main_speedup_max_cycles = 120;
2384   state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x10006f0c, 0x10006f0f, FUNC(cojagr3k_main_speedup_r));
2385#endif
2386}
2387
2388
2389static DRIVER_INIT( fishfren )
2390{
2391   cojag_state *state = machine.driver_data<cojag_state>();
2392   cojag_common_init(machine, 0x578, 0x554);
2393
2394#if ENABLE_SPEEDUP_HACKS
2395   /* install speedup for main CPU */
2396   state->m_main_speedup_max_cycles = 200;
2397   state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x10021b60, 0x10021b63, FUNC(cojagr3k_main_speedup_r));
2398#endif
2399}
2400
2401
2402static void init_freeze_common(running_machine &machine, offs_t main_speedup_addr)
2403{
2404   cojag_state *state = machine.driver_data<cojag_state>();
2405   cojag_common_init(machine, 0x0bc, 0x09c);
2406
2407#if ENABLE_SPEEDUP_HACKS
2408   /* install speedup for main CPU */
2409   state->m_main_speedup_max_cycles = 200;
2410   if (main_speedup_addr != 0)
2411      state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(main_speedup_addr, main_speedup_addr + 3, FUNC(cojagr3k_main_speedup_r));
2412   state->m_main_gpu_wait = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0400d900, 0x0400d900 + 3, FUNC(main_gpu_wait_r));
2413#endif
2414}
2415
2416static DRIVER_INIT( freezeat ) { init_freeze_common(machine, 0x1001a9f4); }
2417static DRIVER_INIT( freezeat2 ) { init_freeze_common(machine, 0x1001a8c4); }
2418static DRIVER_INIT( freezeat3 ) { init_freeze_common(machine, 0x1001a134); }
2419static DRIVER_INIT( freezeat4 ) { init_freeze_common(machine, 0x1001a134); }
2420static DRIVER_INIT( freezeat5 ) { init_freeze_common(machine, 0x10019b34); }
2421static DRIVER_INIT( freezeat6 ) { init_freeze_common(machine, 0x10019684); }
2422
2423
2424static DRIVER_INIT( vcircle )
2425{
2426   cojag_state *state = machine.driver_data<cojag_state>();
2427   cojag_common_init(machine, 0x5c0, 0x5a0);
2428
2429#if ENABLE_SPEEDUP_HACKS
2430   /* install speedup for main CPU */
2431   state->m_main_speedup_max_cycles = 50;
2432   state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x12005b34, 0x12005b37, FUNC(cojagr3k_main_speedup_r));
2433#endif
2434}
2435
2436
2437
2438/*************************************
2439 *
2440 *  Game driver(s)
2441 *
2442 *************************************/
2443
2444/*    YEAR   NAME      PARENT    COMPAT  MACHINE   INPUT     INIT      COMPANY    FULLNAME */
2445CONS( 1993,  jaguar,   0,        0,      jaguar,   jaguar,   jaguar,   "Atari",   "Jaguar", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
2446CONS( 1995,  jaguarcd, jaguar,   0,      jaguar,   jaguar,   jaguar,   "Atari",   "Jaguar CD", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
2447
2448GAME( 1996, area51,    0,        cojagr3k,  area51,   area51,   ROT0, "Atari Games", "Area 51 (R3000)", 0 )
2449GAME( 1995, area51t,   area51,   cojag68k,  area51,   area51a,  ROT0, "Atari Games (Time Warner license)", "Area 51 (Time Warner license)", 0 )
2450GAME( 1995, area51a,   area51,   cojag68k,  area51,   area51a,  ROT0, "Atari Games", "Area 51 (Atari Games license)", 0 )
2451GAME( 1995, fishfren,  0,        cojagr3k,  fishfren, fishfren, ROT0, "Time Warner Interactive", "Fishin' Frenzy (prototype)", 0 )
2452GAME( 1996, freezeat,  0,        cojagr3k,  freezeat, freezeat, ROT0, "Atari Games", "Freeze (Atari) (prototype, English voice, 96/10/25)", 0 )
2453GAME( 1996, freezeatjp,freezeat, cojagr3k,  freezeat, freezeat, ROT0, "Atari Games", "Freeze (Atari) (prototype, Japanese voice, 96/10/25)", 0 )
2454GAME( 1996, freezeat2, freezeat, cojagr3k,  freezeat, freezeat2,ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/10/18)", 0 )
2455GAME( 1996, freezeat3, freezeat, cojagr3k,  freezeat, freezeat3,ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/10/07)", 0 )
2456GAME( 1996, freezeat4, freezeat, cojagr3k,  freezeat, freezeat4,ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/10/03)", 0 )
2457GAME( 1996, freezeat5, freezeat, cojagr3k,  freezeat, freezeat5,ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/09/20, AMOA-96)", 0 )
2458GAME( 1996, freezeat6, freezeat, cojagr3k,  freezeat, freezeat6,ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/09/07, Jamma-96)", 0 )
2459GAME( 1996, maxforce,  0,        cojagr3k,  area51,   maxforce, ROT0, "Atari Games", "Maximum Force v1.05", 0 )
2460GAME( 1996, maxf_102,  maxforce, cojagr3k,  area51,   maxforce, ROT0, "Atari Games", "Maximum Force v1.02", 0 )
2461GAME( 1996, maxf_ng,   maxforce, cojagr3k,  area51,   maxforce, ROT0, "Atari Games", "Maximum Force (No Gore version)", 0 )
2462GAME( 1998, area51mx,  0,        cojag68k,  area51,   area51mx, ROT0, "Atari Games", "Area 51 / Maximum Force Duo v2.0", 0 )
2463GAME( 1998, a51mxr3k,  area51mx, cojagr3k,  area51,   a51mxr3k, ROT0, "Atari Games", "Area 51 / Maximum Force Duo (R3000)", 0 )
2464GAME( 1996, vcircle,   0,        cojagr3k,  vcircle,  vcircle,  ROT0, "Atari Games", "Vicious Circle (prototype)", 0 )
src/mess/mess.mak
r11288r11289
677677   $(MESS_DRIVERS)/a7800.o      \
678678   $(MESS_VIDEO)/a7800.o      \
679679   $(MESS_DRIVERS)/a2600.o      \
680   $(MESS_DRIVERS)/jaguar.o   \
680   $(MAME_DRIVERS)/jaguar.o   \
681681   $(MESS_FORMATS)/a26_cas.o   \
682682   $(MESS_FORMATS)/atarist_dsk.o   \
683683   $(MESS_DRIVERS)/atarist.o   \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team