Previous 15994 Revisions Next

r5342 Monday 3rd August, 2009 at 13:24:56 UTC by Robbbert
[JAGUAR] Take Two
- Logo passes protection check
- Quickload works
- More games are working
[src/mame/video]jagobj.c jaguar.c
[src/mess/drivers]jaguar.c

src/mame/video/jagobj.c
r5341r5342
872872      /* 3: branch if object processor flag is set */
873873      case 3:
874874         if (logit) logerror("        branch if object flag set to %06X\n", link << 3);
875         fprintf(stderr, "Unhandled branch!\n");
876         link = 0, taken = 1;
875         taken = gpu_regs[OBF] & 1;
877876         break;
878877
879878      /* 4: branch on second half of display line */
r5341r5342
884883
885884      default:
886885         fprintf(stderr, "Invalid branch!\n");
887         link = 0, taken = 1;
886         link = 0; taken = 1;
888887         break;
889888   }
890889
r5341r5342
909908
910909   /* erase the scanline first */
911910   scanline = _scanline;
912   for (x = 0; x < 336; x++)
911   for (x = 0; x < 360; x++)
913912      scanline[x] = gpu_regs[BG];
914913
915914   logit = LOG_OBJECTS;
r5341r5342
935934            objdata = process_scaled_bitmap(machine, objdata, vc, logit);
936935            break;
937936
937
938         /* GPU interrupt */
939         case 2:
940            gpu_regs[OB_HH]=objdata[1];
941            gpu_regs[OB_HL]=objdata[2];
942            gpu_regs[OB_LH]=objdata[3];
943            gpu_regs[OB_LL]=objdata[4];
944            cpu_irq_state |= 2;
945            update_cpu_irq(machine);
946            done=1;
947            break;
948
938949         /* branch */
939950         case 3:
940951            if (logit)
src/mame/video/jaguar.c
r5341r5342
661661            jaguar_set_palette(gpu_regs[VMODE]);
662662            break;
663663
664         case OBF:   /* clear GPU interrupt */
665            cpu_irq_state &= 0xfd;
666            update_cpu_irq(space->machine);
667            break;
668
664669         case HP:
665670         case HBB:
666671         case HBE:
r5341r5342
685690            {
686691               rectangle visarea;
687692               visarea.min_x = hbend / 2;
688               visarea.max_x = hbstart / 2 - 1;
693               visarea.max_x = MIN((hbstart >> 1) - 1, 0x19c);
694//               visarea.max_x = hbstart / 2 - 1;
689695               visarea.min_y = vbend / 2;
690696               visarea.max_y = vbstart / 2 - 1;
691697               video_screen_configure(space->machine->primary_screen, hperiod / 2, vperiod / 2, &visarea, HZ_TO_ATTOSECONDS((double)COJAG_PIXEL_CLOCK * 2 / hperiod / vperiod));
src/mess/drivers/jaguar.c
r5341r5342
55    Nathan Woods
66    based on MAME cojag driver by Aaron Giles
77
8    Game status:
9   Working: Alien vs Predator, Zool2, Power Drive Rally.
10   Raiden works until the end of the first stage, then hangs.
11   Pinball Fantasies works but no sound.
12   Rayman runs somewhat, with bad graphics and no sound.
13   Brutal Sports and 2 other games get an access violation in the blitter.
14   The rest do little or nothing.
15   None of the homebrew/quickload do anything at all.
168
17    TODO: Lots...
18
199****************************************************************************
2010
2111    Memory map (TBA)
r5341r5342
6353#define JAGUAR_CLOCK      26.6e6
6454
6555static QUICKLOAD_LOAD( jaguar );
56static DEVICE_IMAGE_LOAD( jaguar );
6657
6758/*************************************
6859 *
r5341r5342
110101{
111102   cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), jaguar_irq_callback);
112103
113   *((UINT32 *) jaguar_gpu_ram) = 0x3d0dead;
104   /* Break the protection */
105   jaguar_gpu_ram[0] = 0x3d0dead;
106   rom_base[0x4da]=(rom_base[0x4da]&0xffff0000) | 1234;
107   rom_base[0x4db]=(rom_base[0x4db]&0xffff) | 56780000;
114108
115   memset(jaguar_shared_ram, 0, 0x200000);
109   /* Set up pointers for Jaguar logo */
116110   memcpy(jaguar_shared_ram, rom_base, 0x10);
117   if (cart_base[1] != 0)
118      rom_base[0x53c / 4] = 0x67000002;
119111   cpu_set_reg(cputag_get_cpu(machine, "maincpu"), REG_GENPC, rom_base[1]);
120112
121113#if 0
r5341r5342
203195{
204196   UINT16 joystick_result = 0xffff;
205197   UINT16 joybuts_result = 0xffff;
206   UINT32 result;
207198   int i;
208199   static const char *const keynames[2][8] =
209200         {
r5341r5342
236227      }
237228   }
238229
239   result = joystick_result;
240   result <<= 16;
241   result |= joybuts_result;
242   return result;
230   return (joystick_result << 16) | joybuts_result;
243231}
244232
245233static WRITE32_HANDLER( joystick_w )
r5341r5342
304292
305293
306294static ADDRESS_MAP_START( jaguar_map, ADDRESS_SPACE_PROGRAM, 32 )
307   AM_RANGE(0x000000, 0x1fffff) AM_RAM AM_BASE(&jaguar_shared_ram) AM_SHARE(1) AM_MIRROR(0x200000)
308   AM_RANGE(0x800000, 0xdfffff) AM_ROM AM_BASE(&cart_base) AM_SIZE(&cart_size)
309   AM_RANGE(0xe00000, 0xe1ffff) AM_ROM AM_BASE(&rom_base) AM_SIZE(&rom_size)
295   ADDRESS_MAP_GLOBAL_MASK(0xffffff)
296   AM_RANGE(0x000000, 0x1fffff) AM_RAM AM_BASE(&jaguar_shared_ram) AM_MIRROR(0x200000) AM_SHARE(1) AM_REGION("maincpu", 0)
297   AM_RANGE(0x800000, 0xdfffff) AM_ROM AM_BASE(&cart_base) AM_SIZE(&cart_size) AM_REGION("maincpu", 0x800000)
298   AM_RANGE(0xe00000, 0xe1ffff) AM_ROM AM_BASE(&rom_base) AM_SIZE(&rom_size) AM_REGION("maincpu", 0xe00000)
310299   AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE(jaguar_tom_regs32_r, jaguar_tom_regs32_w)
311300   AM_RANGE(0xf00400, 0xf007ff) AM_RAM AM_BASE(&jaguar_gpu_clut) AM_SHARE(2)
312   AM_RANGE(0xf00800, 0xf01d9f) AM_MIRROR(0x008000) AM_RAM   // Line Buffer Test Areas
301//   AM_RANGE(0xf00800, 0xf01d9f) AM_MIRROR(0x008000) AM_RAM   // Line Buffer Test Areas
313302   AM_RANGE(0xf02100, 0xf021ff) AM_MIRROR(0x008000) AM_READWRITE(gpuctrl_r, gpuctrl_w)
314303   AM_RANGE(0xf02200, 0xf022ff) AM_MIRROR(0x008000) AM_READWRITE(jaguar_blitter_r, jaguar_blitter_w)
315304   AM_RANGE(0xf03000, 0xf03fff) AM_MIRROR(0x008000) AM_RAM AM_BASE(&jaguar_gpu_ram) AM_SHARE(3)
r5341r5342
332321
333322/*************************************
334323 *
335 *  GPU memory handlers
324 *  GPU/DSP memory handlers
336325 *
337326 *************************************/
338327
339328static ADDRESS_MAP_START( gpu_map, ADDRESS_SPACE_PROGRAM, 32 )
340   AM_RANGE(0x000000, 0x1fffff) AM_RAM AM_SHARE(1) AM_MIRROR(0x200000)
329   ADDRESS_MAP_GLOBAL_MASK(0xffffff)
330   AM_RANGE(0x000000, 0x1fffff) AM_MIRROR(0x200000) AM_RAM AM_SHARE(1)
341331   AM_RANGE(0x800000, 0xdfffff) AM_ROMBANK(15)
342332   AM_RANGE(0xe00000, 0xe1ffff) AM_ROMBANK(16)
343
344333   AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE(jaguar_tom_regs32_r, jaguar_tom_regs32_w)
345334   AM_RANGE(0xf00400, 0xf007ff) AM_RAM AM_SHARE(2)
346   AM_RANGE(0xf02100, 0xf021ff) AM_READWRITE(gpuctrl_r, gpuctrl_w)
347   AM_RANGE(0xf02200, 0xf022ff) AM_READWRITE(jaguar_blitter_r, jaguar_blitter_w)
348   AM_RANGE(0xf03000, 0xf03fff) AM_RAM AM_SHARE(3) AM_MIRROR(0x008000)
335   AM_RANGE(0xf02100, 0xf021ff) AM_MIRROR(0x008000) AM_READWRITE(gpuctrl_r, gpuctrl_w)
336   AM_RANGE(0xf02200, 0xf022ff) AM_MIRROR(0x008000) AM_READWRITE(jaguar_blitter_r, jaguar_blitter_w)
337   AM_RANGE(0xf03000, 0xf03fff) AM_MIRROR(0x008000) AM_RAM AM_SHARE(3)
349338   AM_RANGE(0xf10000, 0xf103ff) AM_READWRITE(jaguar_jerry_regs32_r, jaguar_jerry_regs32_w)
350ADDRESS_MAP_END
351
352
353
354/*************************************
355 *
356 *  DSP memory handlers
357 *
358 *************************************/
359
360static ADDRESS_MAP_START( dsp_map, ADDRESS_SPACE_PROGRAM, 32 )
361   AM_RANGE(0x000000, 0x1fffff) AM_RAM AM_SHARE(1) AM_MIRROR(0x200000)
362   AM_RANGE(0x800000, 0xdfffff) AM_ROMBANK(15)
363   AM_RANGE(0xe00000, 0xe1ffff) AM_ROMBANK(16)
364   AM_RANGE(0xf10000, 0xf103ff) AM_READWRITE(jaguar_jerry_regs32_r, jaguar_jerry_regs32_w)
339   AM_RANGE(0xf14000, 0xf14003) AM_READWRITE(joystick_r, joystick_w)
365340   AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE(dspctrl_r, dspctrl_w)
366341   AM_RANGE(0xf1a140, 0xf1a17f) AM_READWRITE(jaguar_serial_r, jaguar_serial_w)
367342   AM_RANGE(0xf1b000, 0xf1cfff) AM_RAM AM_SHARE(4)
r5341r5342
504479
505480   MDRV_CPU_ADD("audiocpu", JAGUARDSP, JAGUAR_CLOCK)
506481   MDRV_CPU_CONFIG(dsp_config)
507   MDRV_CPU_PROGRAM_MAP(dsp_map)
482   MDRV_CPU_PROGRAM_MAP(gpu_map)
508483
509484   MDRV_MACHINE_RESET(jaguar)
510485
r5341r5342
532507   /* cartridge */
533508   MDRV_CARTSLOT_ADD("cart")
534509   MDRV_CARTSLOT_EXTENSION_LIST("jag,abs,rom,j64")
510   MDRV_CARTSLOT_LOAD(jaguar)
535511MACHINE_DRIVER_END
536512
537513
r5341r5342
575551
576552static QUICKLOAD_LOAD( jaguar )
577553{
554   int i,j;
578555   offs_t quickload_begin = 0x4000;
556   memset(jaguar_shared_ram, 0, 0x200000);
579557   quickload_size = MIN(quickload_size, 0x200000 - quickload_begin);
580558   image_fread(image, &memory_region(image->machine, "maincpu")[quickload_begin], quickload_size);
559
560   /* Fix endian-ness */
561   for (i = quickload_begin / 4; i < quickload_size / 4; i++)
562   {
563      j = jaguar_shared_ram[i];
564      jaguar_shared_ram[i] = ((j & 0xff) << 24) | ((j & 0xff00) << 8) | ((j & 0xff0000) >> 8) | ((j & 0xff000000) >> 24);
565   }
566
567   /* Transfer control to image */
581568   cpu_set_reg(cputag_get_cpu(image->machine, "maincpu"), REG_GENPC, quickload_begin);
582569   return INIT_PASS;
583570}
584571
572static DEVICE_IMAGE_LOAD( jaguar )
573{
574   int i,j;
575   image_fread(image, cart_base, image_length(image));
576   memset(jaguar_shared_ram, 0, 0x200000);
577   memcpy(jaguar_shared_ram, rom_base, 0x10);
585578
579   /* Fix endian-ness */
580   for (i = 0; i < image_length(image) / 4; i++)
581   {
582      j = cart_base[i];
583      cart_base[i] = ((j & 0xff) << 24) | ((j & 0xff00) << 8) | ((j & 0xff0000) >> 8) | ((j & 0xff000000) >> 24);
584   }
585
586   /* Disable logo - breaks Doom */
587   rom_base[0x53c / 4] = 0x67000002;
588
589   /* Transfer control to the bios */
590   cpu_set_reg(cputag_get_cpu(image->machine, "maincpu"), REG_GENPC, rom_base[1]);
591   return INIT_PASS;
592}
593
586594/*************************************
587595 *
588596 *  Game driver(s)
r5341r5342
590598 *************************************/
591599
592600/*    YEAR   NAME      PARENT    COMPAT  MACHINE   INPUT     INIT      CONFIG  COMPANY    FULLNAME */
593CONS( 1993,  jaguar,   0,        0,      jaguar,   jaguar,   jaguar,   0,      "Atari",   "Atari Jaguar", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING)
594CONS( 1995,  jaguarcd, jaguar,   0,      jaguar,   jaguar,   jaguar,   0,      "Atari",   "Atari Jaguar CD", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GA\
595ME_NOT_WORKING)
601CONS( 1993,  jaguar,   0,        0,      jaguar,   jaguar,   jaguar,   0,      "Atari",   "Atari Jag", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING)
602CONS( 1995,  jaguarcd, jaguar,   0,      jaguar,   jaguar,   jaguar,   0,      "Atari",   "Atari Jaguar CD", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team