Previous 15994 Revisions Next

r13290 Thursday 17th November, 2011 at 11:33:39 UTC by Miodrag Milanović
made jaguar coexist in mame and mess (no whatsnew)
[src/mame/audio]jaguar.c
[src/mame/drivers]jaguar.c
[src/mame/includes]jaguar.h
[src/mame/video]jagobj.c

src/mame/audio/jaguar.c
r13289r13290
262262   }
263263
264264#if ENABLE_SPEEDUP_HACKS
265   machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf1a100, 0xf1a103, FUNC(dsp_flags_w));
265   if (jaguar_hacks_enabled)
266      machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf1a100, 0xf1a103, FUNC(dsp_flags_w));
267
266268#endif
267269}
268270
r13289r13290
369371
370372TIMER_DEVICE_CALLBACK( jaguar_serial_callback )
371373{
372   /* assert the A2S IRQ on CPU #2 (DSP) */
373   cputag_set_input_line(timer.machine(), "audiocpu", 1, ASSERT_LINE);
374   jaguar_dsp_resume(timer.machine());
374   if (jaguar_hacks_enabled) {
375      /* assert the A2S IRQ on CPU #2 (DSP) */
376      cputag_set_input_line(timer.machine(), "audiocpu", 1, ASSERT_LINE);
377      jaguar_dsp_resume(timer.machine());
375378
376   /* fix flaky code in interrupt handler which thwarts our speedup */
377   if ((jaguar_dsp_ram[0x3e/4] & 0xffff) == 0xbfbc &&
378      (jaguar_dsp_ram[0x42/4] & 0xffff) == 0xe400)
379   {
380      /* move the store r28,(r29) into the branch delay slot, swapping it with */
381      /* the nop that's currently there */
382      jaguar_dsp_ram[0x3e/4] = (jaguar_dsp_ram[0x3e/4] & 0xffff0000) | 0xe400;
383      jaguar_dsp_ram[0x42/4] = (jaguar_dsp_ram[0x42/4] & 0xffff0000) | 0xbfbc;
379      /* fix flaky code in interrupt handler which thwarts our speedup */
380      if ((jaguar_dsp_ram[0x3e/4] & 0xffff) == 0xbfbc &&
381         (jaguar_dsp_ram[0x42/4] & 0xffff) == 0xe400)
382      {
383         /* move the store r28,(r29) into the branch delay slot, swapping it with */
384         /* the nop that's currently there */
385         jaguar_dsp_ram[0x3e/4] = (jaguar_dsp_ram[0x3e/4] & 0xffff0000) | 0xe400;
386         jaguar_dsp_ram[0x42/4] = (jaguar_dsp_ram[0x42/4] & 0xffff0000) | 0xbfbc;
387      }
388   } else {
389      /* assert the A2S IRQ on CPU #2 (DSP) */
390      cputag_set_input_line(timer.machine(), "audiocpu", 1, ASSERT_LINE);
391      jaguar_dsp_resume(timer.machine());
384392   }
385393}
386394
src/mame/includes/jaguar.h
r13289r13290
55*************************************************************************/
66
77#ifndef ENABLE_SPEEDUP_HACKS
8#ifndef MESS
98#define ENABLE_SPEEDUP_HACKS 1
10#else
11#define ENABLE_SPEEDUP_HACKS 0
12#endif /* MESS */
139#endif
1410
1511/* CoJag and Jaguar have completely different XTALs, pixel clock in Jaguar is the same as the GPU one */
r13289r13290
2622extern UINT32 *jaguar_gpu_clut;
2723extern UINT32 *jaguar_dsp_ram;
2824extern UINT32 *jaguar_wave_rom;
25extern bool jaguar_hacks_enabled;
2926
3027/*----------- defined in audio/jaguar.c -----------*/
3128
src/mame/video/jagobj.c
r13289r13290
972972   UINT32 link = (lower >> 24) | ((upper & 0x7ff) << 8);
973973   int taken = 0;
974974
975#ifndef MESS
976   if ((ypos & 1) && ypos != 0x7ff)
977      fprintf(stderr, "        branch cc=%d ypos=%X link=%06X - \n", cc, ypos, link << 3);
978#endif
975//   if ((ypos & 1) && ypos != 0x7ff)
976//      fprintf(stderr, "        branch cc=%d ypos=%X link=%06X - \n", cc, ypos, link << 3);
979977
980978   switch (cc)
981979   {
r13289r13290
10911089               logerror("stop   = %08X-%08X\n", objdata[0], objdata[1]);
10921090            if (interrupt)
10931091            {
1094#ifndef MESS
1095               fprintf(stderr, "stop int=%d\n", interrupt);
1096#endif
1092//               fprintf(stderr, "stop int=%d\n", interrupt);
10971093               cpu_irq_state |= 4;
10981094               update_cpu_irq(machine);
10991095            }
src/mame/drivers/jaguar.c
r13289r13290
390390UINT32 *jaguar_wave_rom;
391391UINT32* high_rom_base;
392392UINT8 cojag_is_r3000;
393bool jaguar_hacks_enabled;
393394static int is_jaguar;
394395
395396
r13289r13290
950951   {
951952#if ENABLE_SPEEDUP_HACKS
952953      /* spin if we're allowed */
953      jaguar_gpu_suspend(space->machine());
954      if (jaguar_hacks_enabled) jaguar_gpu_suspend(space->machine());
954955#endif
955956
956957      /* no command is pending */
r13289r13290
18001801
18011802static DRIVER_INIT( jaguar )
18021803{
1804   jaguar_hacks_enabled = false;
18031805   state_save_register_global(machine, joystick_data);
18041806   using_cart = 0;
18051807
r13289r13290
23172319
23182320static DRIVER_INIT( area51a )
23192321{
2322   jaguar_hacks_enabled = true;
23202323   cojag_common_init(machine, 0x5c4, 0x5a0);
23212324
23222325#if ENABLE_SPEEDUP_HACKS
r13289r13290
23322335
23332336static DRIVER_INIT( area51 )
23342337{
2338   jaguar_hacks_enabled = true;
23352339   cojag_common_init(machine, 0x0c0, 0x09e);
23362340
23372341#if ENABLE_SPEEDUP_HACKS
r13289r13290
23472351
23482352static DRIVER_INIT( maxforce )
23492353{
2354   jaguar_hacks_enabled = true;
23502355   cojag_state *state = machine.driver_data<cojag_state>();
23512356   cojag_common_init(machine, 0x0c0, 0x09e);
23522357
r13289r13290
23632368
23642369static DRIVER_INIT( area51mx )
23652370{
2371   jaguar_hacks_enabled = true;
23662372   cojag_state *state = machine.driver_data<cojag_state>();
23672373   cojag_common_init(machine, 0x0c0, 0x09e);
23682374
r13289r13290
23782384
23792385static DRIVER_INIT( a51mxr3k )
23802386{
2387   jaguar_hacks_enabled = true;
23812388   cojag_state *state = machine.driver_data<cojag_state>();
23822389   cojag_common_init(machine, 0x0c0, 0x09e);
23832390
r13289r13290
23942401
23952402static DRIVER_INIT( fishfren )
23962403{
2404   jaguar_hacks_enabled = true;
23972405   cojag_common_init(machine, 0x578, 0x554);
23982406
23992407#if ENABLE_SPEEDUP_HACKS
r13289r13290
24252433#endif
24262434}
24272435
2428static DRIVER_INIT( freezeat ) { init_freeze_common(machine, 0x1001a9f4); }
2429static DRIVER_INIT( freezeat2 ) { init_freeze_common(machine, 0x1001a8c4); }
2430static DRIVER_INIT( freezeat3 ) { init_freeze_common(machine, 0x1001a134); }
2431static DRIVER_INIT( freezeat4 ) { init_freeze_common(machine, 0x1001a134); }
2432static DRIVER_INIT( freezeat5 ) { init_freeze_common(machine, 0x10019b34); }
2433static DRIVER_INIT( freezeat6 ) { init_freeze_common(machine, 0x10019684); }
2436static DRIVER_INIT( freezeat ) { jaguar_hacks_enabled = true; init_freeze_common(machine, 0x1001a9f4); }
2437static DRIVER_INIT( freezeat2 ) { jaguar_hacks_enabled = true; init_freeze_common(machine, 0x1001a8c4); }
2438static DRIVER_INIT( freezeat3 ) { jaguar_hacks_enabled = true; init_freeze_common(machine, 0x1001a134); }
2439static DRIVER_INIT( freezeat4 ) { jaguar_hacks_enabled = true; init_freeze_common(machine, 0x1001a134); }
2440static DRIVER_INIT( freezeat5 ) { jaguar_hacks_enabled = true; init_freeze_common(machine, 0x10019b34); }
2441static DRIVER_INIT( freezeat6 ) { jaguar_hacks_enabled = true; init_freeze_common(machine, 0x10019684); }
24342442
24352443
24362444static DRIVER_INIT( vcircle )
24372445{
2446   jaguar_hacks_enabled = true;
24382447   cojag_common_init(machine, 0x5c0, 0x5a0);
24392448
24402449#if ENABLE_SPEEDUP_HACKS

Previous 15994 Revisions Next


© 1998-2018 The MESS Team