Previous 15994 Revisions Next

r7741 Tuesday 6th April, 2010 at 23:00:25 UTC by Angelo Salese
First step in supporting master cycle delays in the SNES driver
[src/emu/cpu/g65816]g65816.c g65816.h g65816cm.h
[src/mame/drivers]nss.c snesb.c
[src/mess/drivers]snes.c

src/mame/drivers/snesb.c
r7740r7741
503503   MDRV_DRIVER_DATA(snes_state)
504504
505505   /* basic machine hardware */
506   MDRV_CPU_ADD("maincpu", G65816, 3580000)   /* 2.68Mhz, also 3.58Mhz */
506   MDRV_CPU_ADD("maincpu", 5A22, 3580000*6)   /* 2.68Mhz, also 3.58Mhz */
507507   MDRV_CPU_PROGRAM_MAP(snesb_map)
508508
509509   /* audio CPU */
src/mame/drivers/nss.c
r7740r7741
449449   MDRV_DRIVER_DATA(snes_state)
450450
451451   /* basic machine hardware */
452   MDRV_CPU_ADD("maincpu", G65816, 3580000)   /* 2.68Mhz, also 3.58Mhz */
452   MDRV_CPU_ADD("maincpu", 5A22, 3580000*6)   /* 2.68Mhz, also 3.58Mhz */
453453   MDRV_CPU_PROGRAM_MAP(snes_map)
454454
455455   MDRV_CPU_ADD("soundcpu", SPC700, 2048000/2)   /* 2.048 Mhz, but internal divider */
src/emu/cpu/g65816/g65816.c
r7740r7741
100100   assert(device != NULL);
101101   assert(device->token != NULL);
102102   assert(device->type == CPU);
103   assert(cpu_get_type(device) == CPU_G65816);
103   assert(cpu_get_type(device) == CPU_G65816 || cpu_get_type(device) == CPU_5A22);
104104   return (g65816i_cpu_struct *)device->token;
105105}
106106
r7740r7741
339339   g65816_set_irq_callback(cpustate, irqcallback);
340340   cpustate->device = device;
341341   cpustate->program = device->space(AS_PROGRAM);
342   cpustate->cpu_type = CPU_TYPE_G65816;
342343
343344   state_save_register_device_item(device, 0, cpustate->a);
344345   state_save_register_device_item(device, 0, cpustate->b);
r7740r7741
523524   }
524525}
525526
527/*
528SNES specific, used to handle master cycles
529*/
530
531static CPU_INIT( 5a22 )
532{
533   g65816i_cpu_struct *cpustate = get_safe_token(device);
534
535   CPU_INIT_CALL(g65816);
536
537   cpustate->cpu_type = CPU_TYPE_5A22;
538}
539
540
541CPU_GET_INFO( 5a22 )
542{
543   switch (state)
544   {
545      /* --- the following bits of info are returned as pointers to data or functions --- */
546      case CPUINFO_FCT_INIT:                     info->init = CPU_INIT_NAME(5a22);   break;
547
548      /* --- the following bits of info are returned as NULL-terminated strings --- */
549      case DEVINFO_STR_NAME:                     strcpy(info->s, "5A22");         break;
550
551      default:                              CPU_GET_INFO_CALL(g65816);            break;
552   }
553}
554
526555/* ======================================================================== */
527556/* ============================== END OF FILE ============================= */
528557/* ======================================================================== */
src/emu/cpu/g65816/g65816.h
r7740r7741
5959/* Main interface function */
6060CPU_GET_INFO( g65816 );
6161#define CPU_G65816 CPU_GET_INFO_NAME( g65816 )
62CPU_GET_INFO( 5a22 );
63#define CPU_5A22 CPU_GET_INFO_NAME( 5a22 )
6264
65#define CPU_TYPE_G65816 0
66#define CPU_TYPE_5A22 1
67
68
6369void g65816_set_read_vector_callback(running_device *device, read8_space_func read_vector);
6470
6571
src/emu/cpu/g65816/g65816cm.h
r7740r7741
106106   uint source;
107107   uint destination;
108108   int ICount;
109   int cpu_type;
109110};
110111
111112extern void (*const *const g65816i_opcodes[])(g65816i_cpu_struct *cpustate);
r7740r7741
242243#define CLK_W_S         2
243244#define CLK_W_SIY      5
244245
245#define CLK(A)         CLOCKS -= (A)
246#define CLK(A)         CLOCKS -= (cpustate->cpu_type == CPU_TYPE_G65816 ? A : A*6)
246247#define USE_ALL_CLKS()   CLOCKS = 0
247248
248249
src/mess/drivers/snes.c
r7740r7741
514514      state->scope[port].pause_lock = 0;
515515
516516   /* If we have pressed fire or cursor and we are on-screen and SuperScope is in Port2, then latch video signal.
517   Notice that we only latch Port2 because its IOBit pin is connected to bit7 of the IO Port, while Port1 has
517   Notice that we only latch Port2 because its IOBit pin is connected to bit7 of the IO Port, while Port1 has
518518   IOBit pin connected to bit6 of the IO Port, and the latter is not detected by the H/V Counters. In other
519519   words, you can connect SuperScope to Port1, but there is no way SNES could detect its on-screen position */
520520   if ((state->scope[port].buttons & 0xc0) && !(state->scope[port].buttons & 0x02) && port == 1)
r7740r7741
692692   MDRV_DRIVER_DATA(snes_state)
693693
694694   /* basic machine hardware */
695   MDRV_CPU_ADD("maincpu", G65816, MCLK_NTSC/6)   /* 2.68 MHz, also 3.58 MHz */
695   MDRV_CPU_ADD("maincpu", 5A22, MCLK_NTSC)   /* 2.68 MHz, also 3.58 MHz */
696696   MDRV_CPU_PROGRAM_MAP(snes_map)
697697
698698   MDRV_CPU_ADD("soundcpu", SPC700, 1024000)   /* 1.024 MHz */
r7740r7741
737737
738738static MACHINE_DRIVER_START( snespal )
739739   MDRV_IMPORT_FROM(snes)
740   MDRV_CPU_REPLACE("maincpu", G65816, MCLK_PAL/6)
740   MDRV_CPU_REPLACE("maincpu", 5A22, MCLK_PAL)
741741
742742   MDRV_SCREEN_MODIFY("screen")
743743   MDRV_SCREEN_RAW_PARAMS(DOTCLK_PAL, SNES_HTOTAL, 0, SNES_SCR_WIDTH, SNES_VTOTAL_PAL, 0, SNES_SCR_HEIGHT_PAL)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team