Previous 15994 Revisions Next

r5113 Monday 29th June, 2009 at 12:22:31 UTC by Robbbert
[JAGUAR] WIP
[src/mess/drivers]jaguar.c
[src/mess/video]jagobj.c jaguar.c

src/mess/video/jaguar.c
r5112r5113
464464 
465465      /* others */
466466      default:   // RGB24, DIRECT16
467         logerror("Can't handle mode %X\n", vmode);
467         printf("Can't handle mode %X\n", vmode);
468468         break;
469469   }
470470}
r5112r5113
549549      return;
550550   }
551551#endif
552 
553 
554if (LOG_BLITTER_STATS)
555{
556static UINT32 blitter_stats[1000][4];
557static UINT64 blitter_pixels[1000];
558static int blitter_count = 0;
559static int reps = 0;
560int i;
561for (i = 0; i < blitter_count; i++)
562   if (blitter_stats[i][0] == (blitter_regs[B_CMD] & STATIC_COMMAND_MASK) &&
563      blitter_stats[i][1] == (blitter_regs[A1_FLAGS] & STATIC_FLAGS_MASK) &&
564      blitter_stats[i][2] == (blitter_regs[A2_FLAGS] & STATIC_FLAGS_MASK))
565      break;
566if (i == blitter_count)
567{
568   blitter_stats[i][0] = blitter_regs[B_CMD] & STATIC_COMMAND_MASK;
569   blitter_stats[i][1] = blitter_regs[A1_FLAGS] & STATIC_FLAGS_MASK;
570   blitter_stats[i][2] = blitter_regs[A2_FLAGS] & STATIC_FLAGS_MASK;
571   blitter_stats[i][3] = 0;
572   blitter_pixels[i] = 0;
573   blitter_count++;
574}
575blitter_stats[i][3]++;
576blitter_pixels[i] += (blitter_regs[B_COUNT] & 0xffff) * (blitter_regs[B_COUNT] >> 16);
577if (++reps % 100 == 99)
578{
579   mame_printf_debug("---\nBlitter stats:\n");
580   for (i = 0; i < blitter_count; i++)
581      mame_printf_debug("  CMD=%08X A1=%08X A2=%08X %6d times, %08X%08X pixels\n",
582            blitter_stats[i][0], blitter_stats[i][1], blitter_stats[i][2],
583            blitter_stats[i][3], (UINT32)(blitter_pixels[i] >> 32), (UINT32)(blitter_pixels[i]));
584   mame_printf_debug("---\n");
585}
586}
587 
588552   generic_blitter(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
589//   profiler_mark(PROFILER_END);
590553}
591554 
592 
593555READ32_HANDLER( jaguar_blitter_r )
594556{
595557   switch (offset)
r5112r5113
737699 
738700 
739701 
702 
740703/*************************************
741704 *
742705 *  Gun input
r5112r5113
857820VIDEO_UPDATE( cojag )
858821{
859822   /* if not enabled, just blank */
860   if (!(gpu_regs[VMODE] & 1))
861   {
823   if (gpu_regs[VMODE] & 1)
824      copybitmap(bitmap, screen_bitmap, 0, 0, 0, 0, cliprect);
825   else
862826      bitmap_fill(bitmap, cliprect, 0);
863      return 0;
864   }
865827 
866   /* render the object list */
867   copybitmap(bitmap, screen_bitmap, 0, 0, 0, 0, cliprect);
868828   return 0;
869829}
870830 
src/mess/video/jagobj.c
r5112r5113
642642            break;
643643 
644644         default:
645            fprintf(stderr, "Unhandled bitmap source depth = %d\n", depthlog);
645            fprintf(stderr, "Standard bitmap: Unhandled bitmap source depth = %d\n", depthlog);
646646            break;
647647      }
648648 
r5112r5113
805805               break;
806806 
807807            default:
808               fprintf(stderr, "Unhandled scaled bitmap source depth = %d\n", depthlog);
808               fprintf(stderr, "Scaled Bitmap: Unhandled scaled bitmap source depth = %d\n", depthlog);
809809               break;
810810         }
811811      }
r5112r5113
831831 
832832/*************************************
833833 *
834 *  Brach object processor
834 *  Branch object processor
835835 *
836836 *************************************/
837837 
r5112r5113
909909 
910910   /* erase the scanline first */
911911   scanline = _scanline;
912   for (x = 0; x < 336; x++)
912   for (x = 0; x < 360; x++)
913913      scanline[x] = gpu_regs[BG];
914914 
915915   logit = LOG_OBJECTS;
r5112r5113
935935            objdata = process_scaled_bitmap(machine, objdata, vc, logit);
936936            break;
937937 
938         /* interrupt gpu - this is guesswork */
939         case 2:
940         {
941            done = 1;
942 
943            if (logit)
944               logerror("int gpu   = %08X-%08X\n", objdata[0], objdata[1]);
945             
946            cpu_irq_state |= 4;
947            update_cpu_irq(machine);
948            break;
949         }
950 
938951         /* branch */
939952         case 3:
940953            if (logit)
src/mess/drivers/jaguar.c
r5112r5113
5252#include "sound/dac.h"
5353
5454#define JAGUAR_CLOCK      XTAL_52MHz
55#define R3000_CLOCK         XTAL_40MHz
56#define M68K_CLOCK         XTAL_50MHz
55#define M68K_CLOCK      XTAL_50MHz
5756
5857static QUICKLOAD_LOAD( jaguar );
5958
r5112r5113
130129   jaguar_dsp_resume(machine);
131130
132131   /* halt the CPUs */
133   jaguargpu_ctrl_w(cputag_get_cpu(machine, "gpu"), G_CTRL, 0, 0);
134   jaguardsp_ctrl_w(cputag_get_cpu(machine, "audiocpu"), D_CTRL, 0, 0);
132   jaguargpu_ctrl_w(cputag_get_cpu(machine, "gpu"), G_CTRL, 0, 0xffffffff);
133   jaguardsp_ctrl_w(cputag_get_cpu(machine, "audiocpu"), D_CTRL, 0, 0xffffffff);
135134
136135   /* init the sound system */
137136   cojag_sound_reset(machine);
r5112r5113
177176}
178177
179178
179static READ32_HANDLER( jaguar_wave_rom_r )
180{
181   return jaguar_wave_rom[offset];
182}
180183
181184/*************************************
182185 *
r5112r5113
283286
284287
285288
289
286290/*************************************
287291 *
288292 *  Main CPU memory handlers
r5112r5113
291295
292296
293297static ADDRESS_MAP_START( jaguar_map, ADDRESS_SPACE_PROGRAM, 32 )
294   AM_RANGE(0x000000, 0x1fffff) AM_RAM AM_BASE(&jaguar_shared_ram) AM_SHARE(1)// AM_MIRROR(0x200000)
298   AM_RANGE(0x000000, 0x1fffff) AM_RAM AM_BASE(&jaguar_shared_ram) AM_SHARE(1) AM_MIRROR(0x200000)
295299   AM_RANGE(0x800000, 0xdfffff) AM_ROM AM_BASE(&cart_base) AM_SIZE(&cart_size)
296300   AM_RANGE(0xe00000, 0xe1ffff) AM_ROM AM_BASE(&rom_base) AM_SIZE(&rom_size)
297301   AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE(jaguar_tom_regs32_r, jaguar_tom_regs32_w)
298302   AM_RANGE(0xf00400, 0xf007ff) AM_RAM AM_BASE(&jaguar_gpu_clut) AM_SHARE(2)
303   AM_RANGE(0xf00800, 0xf01d9f) AM_MIRROR(0x008000) AM_RAM   // Line Buffer Test Areas
299304   AM_RANGE(0xf02100, 0xf021ff) AM_MIRROR(0x008000) AM_READWRITE(gpuctrl_r, gpuctrl_w)
300305   AM_RANGE(0xf02200, 0xf022ff) AM_MIRROR(0x008000) AM_READWRITE(jaguar_blitter_r, jaguar_blitter_w)
301306   AM_RANGE(0xf03000, 0xf03fff) AM_MIRROR(0x008000) AM_RAM AM_BASE(&jaguar_gpu_ram) AM_SHARE(3)
r5112r5113
303308   AM_RANGE(0xf14000, 0xf14003) AM_READWRITE(joystick_r, joystick_w)
304309   AM_RANGE(0xf14800, 0xf14fff) AM_NOP         // GPI00
305310   AM_RANGE(0xf15000, 0xf15fff) AM_NOP         // GPI01
306   //AM_RANGE(0xf16000, 0xf1600b) AM_READ(cojag_gun_input_r)   // GPI02
311   AM_RANGE(0xf16000, 0xf1600b) AM_READ(cojag_gun_input_r)   // GPI02
307312   AM_RANGE(0xf17000, 0xf177ff) AM_NOP         // GPI03
308313   //AM_RANGE(0xf17800, 0xf17803) AM_WRITE(latch_w)   // GPI04
309314   AM_RANGE(0xf17800, 0xf17bff) AM_NOP         // GPI04
r5112r5113
311316   AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE(dspctrl_r, dspctrl_w)
312317   AM_RANGE(0xf1a140, 0xf1a17f) AM_READWRITE(jaguar_serial_r, jaguar_serial_w)
313318   AM_RANGE(0xf1b000, 0xf1cfff) AM_RAM AM_BASE(&jaguar_dsp_ram) AM_SHARE(4)
314   //AM_SHARE(0xf1d00, 0xf1dfff) AM_READ(jaguar_wave_table_r) //p78
319   AM_RANGE(0xf1d000, 0xf1dfff) AM_READ(jaguar_wave_rom_r)
315320ADDRESS_MAP_END
316321
317322
r5112r5113
437442   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON5) PORT_NAME(DEF_STR(Pause)) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CODE(JOYCODE_BUTTON5 ) PORT_PLAYER(2)
438443   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("A") PORT_CODE(KEYCODE_SLASH_PAD) PORT_CODE(JOYCODE_BUTTON1 ) PORT_PLAYER(2)
439444   PORT_BIT( 0xfffc, IP_ACTIVE_LOW, IPT_UNUSED )
445
446   /* The remaining ports are needed by the game "Flip Out" */
447   PORT_START("FAKE1_X")            /* fake analog X */
448//   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 320.0/(320.0 - 7 -7), 0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10)
449
450   PORT_START("FAKE1_Y")            /* fake analog Y */
451//   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, (240.0 - 1)/240, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(10)
452
453   PORT_START("FAKE2_X")            /* fake analog X */
454//   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)
455
456   PORT_START("FAKE2_Y")            /* fake analog Y */
457//   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)
458
459   PORT_START("IN3")         /* gun triggers */
460//   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_SPECIAL )   // gun data valid
461//   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_SPECIAL )   // gun data valid
462//   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
463//   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
464//   PORT_BIT( 0xfff00000, IP_ACTIVE_LOW, IPT_UNKNOWN )
440465INPUT_PORTS_END
441466
442467

Previous 15994 Revisions Next


© 1998-2018 The MESS Team