Previous 199869 Revisions Next

r32353 Wednesday 24th September, 2014 at 14:46:27 UTC by Osso
tms340x0_device: converted to use inline config, devcb and delegates. (nw)
[src/emu/cpu/tms34010]34010gfx.c tms34010.c tms34010.h
[src/mame/drivers]artmagic.c btoads.c coolpool.c exterm.c harddriv.c jpmimpct.c lethalj.c metalmx.c micro3d.c midtunit.c midwunit.c midxunit.c midyunit.c midzeus.c potgoldu.c skeetsht.c skimaxx.c tickee.c xtheball.c
[src/mame/includes]artmagic.h btoads.h coolpool.h exterm.h harddriv.h jpmimpct.h lethalj.h metalmx.h micro3d.h midtunit.h midxunit.h midyunit.h
[src/mame/machine]harddriv.c inder_vid.c inder_vid.h midtunit.c
[src/mame/video]artmagic.c btoads.c exterm.c harddriv.c jpmimpct.c lethalj.c micro3d.c midtunit.c midyunit.c

trunk/src/mame/drivers/micro3d.c
r32352r32353
282282
283283/*************************************
284284 *
285 *  Device Configuration
286 *
287 *************************************/
288
289static const tms340x0_config vgb_config =
290{
291   FALSE,                          /* halt on reset */
292   "screen",                       /* the screen operated on */
293   XTAL_40MHz / 8,                 /* pixel clock */
294   4,                              /* pixels per clock */
295   micro3d_scanline_update,        /* scanline updater (indexed16) */
296   NULL,                           /* scanline updater (rgb32) */
297   micro3d_tms_interrupt,          /* Generate interrupt */
298   NULL,
299   NULL
300};
301
302/*************************************
303 *
304285 *  Machine driver
305286 *
306287 *************************************/
r32352r32353
312293   MCFG_CPU_VBLANK_INT_DRIVER("screen", micro3d_state,  micro3d_vblank)
313294
314295   MCFG_CPU_ADD("vgb", TMS34010, XTAL_40MHz)
315   MCFG_TMS340X0_CONFIG(vgb_config)
316296   MCFG_CPU_PROGRAM_MAP(vgbmem)
297   MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
298   MCFG_TMS340X0_PIXEL_CLOCK(XTAL_40MHz / 8) /* pixel clock */
299   MCFG_TMS340X0_PIXELS_PER_CLOCK(4) /* pixels per clock */
300   MCFG_TMS340X0_SCANLINE_IND16_CB(micro3d_state, scanline_update)        /* scanline updater (indexed16) */
301   MCFG_TMS340X0_OUTPUT_INT_CB(WRITELINE(micro3d_state, tms_interrupt))
317302
318303   MCFG_CPU_ADD("drmath", AM29000, XTAL_32MHz / 2)
319304   MCFG_CPU_PROGRAM_MAP(drmath_prg)
trunk/src/mame/drivers/jpmimpct.c
r32352r32353
819819 *
820820 *************************************/
821821
822static void jpmimpct_tms_irq(device_t *device, int state)
822WRITE_LINE_MEMBER(jpmimpct_state::tms_irq)
823823{
824   jpmimpct_state *drvstate = device->machine().driver_data<jpmimpct_state>();
825   drvstate->m_tms_irq = state;
826   drvstate->update_irqs();
824   m_tms_irq = state;
825   update_irqs();
827826}
828827
829static const tms340x0_config tms_config =
830{
831   TRUE,                       /* halt on reset */
832   "screen",                   /* the screen operated on */
833   40000000/16,                /* pixel clock */
834   4,                          /* pixels per clock */
835   NULL,                       /* scanline updater (indexed16) */
836   jpmimpct_scanline_update,   /* scanline updater (rgb32) */
837   jpmimpct_tms_irq,           /* generate interrupt */
838   jpmimpct_to_shiftreg,       /* write to shiftreg function */
839   jpmimpct_from_shiftreg      /* read from shiftreg function */
840};
841828
842
843829/*************************************
844830 *
845831 *  Machine driver
r32352r32353
851837   MCFG_CPU_PROGRAM_MAP(m68k_program_map)
852838
853839   MCFG_CPU_ADD("dsp", TMS34010, 40000000)
854   MCFG_TMS340X0_CONFIG(tms_config)
855840   MCFG_CPU_PROGRAM_MAP(tms_program_map)
841   MCFG_TMS340X0_HALT_ON_RESET(TRUE) /* halt on reset */
842   MCFG_TMS340X0_PIXEL_CLOCK(40000000/16) /* pixel clock */
843   MCFG_TMS340X0_PIXELS_PER_CLOCK(4) /* pixels per clock */
844   MCFG_TMS340X0_SCANLINE_RGB32_CB(jpmimpct_state, scanline_update)   /* scanline updater (rgb32) */
845   MCFG_TMS340X0_OUTPUT_INT_CB(WRITELINE(jpmimpct_state, tms_irq))
846   MCFG_TMS340X0_TO_SHIFTREG_CB(jpmimpct_state, to_shiftreg)       /* write to shiftreg function */
847   MCFG_TMS340X0_FROM_SHIFTREG_CB(jpmimpct_state, from_shiftreg)      /* read from shiftreg function */
856848
857849   MCFG_QUANTUM_TIME(attotime::from_hz(30000))
858850   MCFG_MACHINE_START_OVERRIDE(jpmimpct_state,jpmimpct)
trunk/src/mame/drivers/btoads.c
r32352r32353
292292INPUT_PORTS_END
293293
294294
295
296295/*************************************
297296 *
298 *  34010 configuration
299 *
300 *************************************/
301
302static const tms340x0_config tms_config =
303{
304   FALSE,                          /* halt on reset */
305   "screen",                       /* the screen operated on */
306   VIDEO_CLOCK/2,                  /* pixel clock */
307   1,                              /* pixels per clock */
308   NULL,                           /* scanline callback (indexed16) */
309   btoads_state::static_scanline_update, /* scanline callback (rgb32) */
310   NULL,                           /* generate interrupt */
311   btoads_state::static_to_shiftreg,               /* write to shiftreg function */
312   btoads_state::static_from_shiftreg          /* read from shiftreg function */
313};
314
315
316
317/*************************************
318 *
319297 *  Machine drivers
320298 *
321299 *************************************/
r32352r32353
323301static MACHINE_CONFIG_START( btoads, btoads_state )
324302
325303   MCFG_CPU_ADD("maincpu", TMS34020, CPU_CLOCK/2)
326   MCFG_TMS340X0_CONFIG(tms_config)
327304   MCFG_CPU_PROGRAM_MAP(main_map)
305   MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
306   MCFG_TMS340X0_PIXEL_CLOCK(VIDEO_CLOCK/2) /* pixel clock */
307   MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */   
308   MCFG_TMS340X0_SCANLINE_RGB32_CB(btoads_state, scanline_update)     /* scanline updater (RGB32) */
309   MCFG_TMS340X0_TO_SHIFTREG_CB(btoads_state, to_shiftreg)  /* write to shiftreg function */
310   MCFG_TMS340X0_FROM_SHIFTREG_CB(btoads_state, from_shiftreg) /* read from shiftreg function */
328311
329312   MCFG_CPU_ADD("audiocpu", Z80, SOUND_CLOCK/4)
330313   MCFG_CPU_PROGRAM_MAP(sound_map)
trunk/src/mame/drivers/midwunit.c
r32352r32353
611611
612612/*************************************
613613 *
614 *  34010 configuration
615 *
616 *************************************/
617
618static const tms340x0_config tms_config =
619{
620   FALSE,                          /* halt on reset */
621   "screen",                       /* the screen operated on */
622   PIXEL_CLOCK,                    /* pixel clock */
623   1,                              /* pixels per clock */
624   midtunit_scanline_update,       /* scanline updater (indexed16) */
625   NULL,                           /* scanline updater (rgb32) */
626   NULL,                           /* generate interrupt */
627   midtunit_to_shiftreg,           /* write to shiftreg function */
628   midtunit_from_shiftreg          /* read from shiftreg function */
629};
630
631
632
633/*************************************
634 *
635614 *  Machine drivers
636615 *
637616 *************************************/
r32352r32353
639618static MACHINE_CONFIG_START( wunit, midwunit_state )
640619
641620   MCFG_CPU_ADD("maincpu", TMS34010, 50000000)
642   MCFG_TMS340X0_CONFIG(tms_config)
643621   MCFG_CPU_PROGRAM_MAP(main_map)
622   MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
623   MCFG_TMS340X0_PIXEL_CLOCK(PIXEL_CLOCK) /* pixel clock */
624   MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */   
625   MCFG_TMS340X0_SCANLINE_IND16_CB(midtunit_state, scanline_update)       /* scanline updater (indexed16) */
626   MCFG_TMS340X0_TO_SHIFTREG_CB(midtunit_state, to_shiftreg)           /* write to shiftreg function */
627   MCFG_TMS340X0_FROM_SHIFTREG_CB(midtunit_state, from_shiftreg)          /* read from shiftreg function */
644628
645629   MCFG_MACHINE_RESET_OVERRIDE(midwunit_state,midwunit)
646630   MCFG_NVRAM_ADD_0FILL("nvram")
trunk/src/mame/drivers/lethalj.c
r32352r32353
625625
626626/*************************************
627627 *
628 *  34010 configuration
629 *
630 *************************************/
631
632static const tms340x0_config tms_config =
633{
634   FALSE,                          /* halt on reset */
635   "screen",                       /* the screen operated on */
636   VIDEO_CLOCK,                    /* pixel clock */
637   1,                              /* pixels per clock */
638   lethalj_scanline_update,        /* scanline update */
639   NULL,                           /* generate interrupt */
640   NULL,                           /* write to shiftreg function */
641   NULL                            /* read from shiftreg function */
642};
643
644static const tms340x0_config tms_config_lethalj =
645{
646   FALSE,                          /* halt on reset */
647   "screen",                       /* the screen operated on */
648   VIDEO_CLOCK_LETHALJ,            /* pixel clock */
649   1,                              /* pixels per clock */
650   lethalj_scanline_update,        /* scanline update */
651   NULL,                           /* generate interrupt */
652   NULL,                           /* write to shiftreg function */
653   NULL                            /* read from shiftreg function */
654};
655
656
657
658/*************************************
659 *
660628 *  Machine drivers
661629 *
662630 *************************************/
r32352r32353
665633
666634   /* basic machine hardware */
667635   MCFG_CPU_ADD("maincpu", TMS34010, MASTER_CLOCK)
668   MCFG_TMS340X0_CONFIG(tms_config)
669636   MCFG_CPU_PROGRAM_MAP(lethalj_map)
637   MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
638   MCFG_TMS340X0_PIXEL_CLOCK(VIDEO_CLOCK) /* pixel clock */
639   MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
640   MCFG_TMS340X0_SCANLINE_IND16_CB(lethalj_state, scanline_update)     /* scanline updater (indexed16) */
670641
671642   MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH)
672643
r32352r32353
695666static MACHINE_CONFIG_DERIVED( lethalj, gameroom )
696667
697668   MCFG_CPU_MODIFY("maincpu")
698   MCFG_TMS340X0_CONFIG(tms_config_lethalj)
669   MCFG_TMS340X0_PIXEL_CLOCK(VIDEO_CLOCK_LETHALJ) /* pixel clock */
699670
700671   MCFG_SCREEN_MODIFY("screen")
701672   MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK_LETHALJ, 689, 0, 512, 259, 0, 236)
trunk/src/mame/drivers/tickee.c
r32352r32353
4242
4343   tickee_state(const machine_config &mconfig, device_type type, const char *tag)
4444      : driver_device(mconfig, type, tag),
45      m_tlc34076(*this, "tlc34076"),
46      m_vram(*this, "vram"),
47      m_control(*this, "control"),
4845      m_maincpu(*this, "maincpu"),
4946      m_oki(*this, "oki"),
50      m_screen(*this, "screen") { }
47      m_screen(*this, "screen"),
48      m_tlc34076(*this, "tlc34076"),
49      m_vram(*this, "vram"),
50      m_control(*this, "control") { }
5151
52   required_device<cpu_device> m_maincpu;
53   optional_device<okim6295_device> m_oki;
54   required_device<screen_device> m_screen;
5255   required_device<tlc34076_device> m_tlc34076;
56   
5357   required_shared_ptr<UINT16> m_vram;
5458   optional_shared_ptr<UINT16> m_control;
59   
5560   emu_timer *m_setup_gun_timer;
5661   int m_beamxadd;
5762   int m_beamyadd;
5863   int m_palette_bank;
5964   UINT8 m_gunx[2];
6065   void get_crosshair_xy(int player, int &x, int &y);
66   
6167   DECLARE_WRITE16_MEMBER(rapidfir_transparent_w);
6268   DECLARE_READ16_MEMBER(rapidfir_transparent_r);
6369   DECLARE_WRITE16_MEMBER(tickee_control_w);
r32352r32353
7480   TIMER_CALLBACK_MEMBER(trigger_gun_interrupt);
7581   TIMER_CALLBACK_MEMBER(clear_gun_interrupt);
7682   TIMER_CALLBACK_MEMBER(setup_gun_interrupts);
77   required_device<cpu_device> m_maincpu;
78   optional_device<okim6295_device> m_oki;
79   required_device<screen_device> m_screen;
83   
84   TMS340X0_TO_SHIFTREG_CB_MEMBER(rapidfir_to_shiftreg);
85   TMS340X0_FROM_SHIFTREG_CB_MEMBER(rapidfir_from_shiftreg);
86   TMS340X0_SCANLINE_RGB32_CB_MEMBER(scanline_update);
87   TMS340X0_SCANLINE_RGB32_CB_MEMBER(rapidfir_scanline_update);
8088
8189protected:
8290   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
r32352r32353
195203 *
196204 *************************************/
197205
198static void scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params)
206TMS340X0_SCANLINE_RGB32_CB_MEMBER(tickee_state::scanline_update)
199207{
200   tickee_state *state = screen.machine().driver_data<tickee_state>();
201   UINT16 *src = &state->m_vram[(params->rowaddr << 8) & 0x3ff00];
208   UINT16 *src = &m_vram[(params->rowaddr << 8) & 0x3ff00];
202209   UINT32 *dest = &bitmap.pix32(scanline);
203   const rgb_t *pens = state->m_tlc34076->get_pens();
210   const rgb_t *pens = m_tlc34076->get_pens();
204211   int coladdr = params->coladdr << 1;
205212   int x;
206213
207214   /* blank palette: fill with pen 255 */
208   if (state->m_control[2])
215   if (m_control[2])
209216   {
210217      for (x = params->heblnk; x < params->hsblnk; x++)
211218         dest[x] = pens[0xff];
r32352r32353
221228}
222229
223230
224static void rapidfir_scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params)
231TMS340X0_SCANLINE_RGB32_CB_MEMBER(tickee_state::rapidfir_scanline_update)
225232{
226   tickee_state *state = screen.machine().driver_data<tickee_state>();
227   UINT16 *src = &state->m_vram[(params->rowaddr << 8) & 0x3ff00];
233   UINT16 *src = &m_vram[(params->rowaddr << 8) & 0x3ff00];
228234   UINT32 *dest = &bitmap.pix32(scanline);
229   const rgb_t *pens = state->m_tlc34076->get_pens();
235   const rgb_t *pens = m_tlc34076->get_pens();
230236   int coladdr = params->coladdr << 1;
231237   int x;
232238
233   if (state->m_palette_bank)
239   if (m_palette_bank)
234240   {
235241      /* blank palette: fill with pen 255 */
236242      for (x = params->heblnk; x < params->hsblnk; x += 2)
r32352r32353
291297}
292298
293299
294static void rapidfir_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
300TMS340X0_TO_SHIFTREG_CB_MEMBER(tickee_state::rapidfir_to_shiftreg)
295301{
296   tickee_state *state = space.machine().driver_data<tickee_state>();
297302   if (address < 0x800000)
298      memcpy(shiftreg, &state->m_vram[TOWORD(address)], TOBYTE(0x2000));
303      memcpy(shiftreg, &m_vram[TOWORD(address)], TOBYTE(0x2000));
299304}
300305
301306
302static void rapidfir_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
307TMS340X0_FROM_SHIFTREG_CB_MEMBER(tickee_state::rapidfir_from_shiftreg)
303308{
304   tickee_state *state = space.machine().driver_data<tickee_state>();
305309   if (address < 0x800000)
306      memcpy(&state->m_vram[TOWORD(address)], shiftreg, TOBYTE(0x2000));
310      memcpy(&m_vram[TOWORD(address)], shiftreg, TOBYTE(0x2000));
307311}
308312
309313
r32352r32353
731735
732736/*************************************
733737 *
734 *  34010 configuration
735 *
736 *************************************/
737
738static const tms340x0_config tms_config =
739{
740   FALSE,                          /* halt on reset */
741   "screen",                       /* the screen operated on */
742   VIDEO_CLOCK/2,                  /* pixel clock */
743   1,                              /* pixels per clock */
744   NULL,                           /* scanline callback (indexed16) */
745   scanline_update,                /* scanline callback (rgb32) */
746   NULL,                           /* generate interrupt */
747   NULL,                           /* write to shiftreg function */
748   NULL                            /* read from shiftreg function */
749};
750
751
752static const tms340x0_config rapidfir_tms_config =
753{
754   FALSE,                          /* halt on reset */
755   "screen",                       /* the screen operated on */
756   VIDEO_CLOCK/2,                  /* pixel clock */
757   1,                              /* pixels per clock */
758   NULL,                           /* scanline callback (indexed16) */
759   rapidfir_scanline_update,       /* scanline callback (rgb32) */
760   NULL,                           /* generate interrupt */
761   rapidfir_to_shiftreg,           /* write to shiftreg function */
762   rapidfir_from_shiftreg          /* read from shiftreg function */
763};
764
765
766
767/*************************************
768 *
769738 *  Machine drivers
770739 *
771740 *************************************/
r32352r32353
774743
775744   /* basic machine hardware */
776745   MCFG_CPU_ADD("maincpu", TMS34010, XTAL_40MHz)
777   MCFG_TMS340X0_CONFIG(tms_config)
778746   MCFG_CPU_PROGRAM_MAP(tickee_map)
747   MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
748   MCFG_TMS340X0_PIXEL_CLOCK(VIDEO_CLOCK/2) /* pixel clock */
749   MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */   
750   MCFG_TMS340X0_SCANLINE_RGB32_CB(tickee_state, scanline_update) /* scanline callback (rgb32) */
779751
780752   MCFG_MACHINE_RESET_OVERRIDE(tickee_state,tickee)
781753   MCFG_NVRAM_ADD_1FILL("nvram")
r32352r32353
819791
820792   /* basic machine hardware */
821793   MCFG_CPU_ADD("maincpu", TMS34010, XTAL_50MHz)
822   MCFG_TMS340X0_CONFIG(rapidfir_tms_config)
823   MCFG_CPU_PROGRAM_MAP(rapidfir_map)
794   MCFG_CPU_PROGRAM_MAP(rapidfir_map)         
795   MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
796   MCFG_TMS340X0_PIXEL_CLOCK(VIDEO_CLOCK/2) /* pixel clock */
797   MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */   
798   MCFG_TMS340X0_SCANLINE_RGB32_CB(tickee_state, rapidfir_scanline_update)       /* scanline callback (rgb32) */
799   MCFG_TMS340X0_TO_SHIFTREG_CB(tickee_state, rapidfir_to_shiftreg)           /* write to shiftreg function */
800   MCFG_TMS340X0_FROM_SHIFTREG_CB(tickee_state, rapidfir_from_shiftreg)          /* read from shiftreg function */
824801
825802   MCFG_MACHINE_RESET_OVERRIDE(tickee_state,rapidfir)
826803   MCFG_NVRAM_ADD_1FILL("nvram")
r32352r32353
846823
847824   /* basic machine hardware */
848825   MCFG_CPU_ADD("maincpu", TMS34010, XTAL_40MHz)
849   MCFG_TMS340X0_CONFIG(tms_config)
850826   MCFG_CPU_PROGRAM_MAP(mouseatk_map)
827   MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
828   MCFG_TMS340X0_PIXEL_CLOCK(VIDEO_CLOCK/2) /* pixel clock */
829   MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */   
830   MCFG_TMS340X0_SCANLINE_RGB32_CB(tickee_state, scanline_update) /* scanline callback (rgb32) */
851831
852832   MCFG_MACHINE_RESET_OVERRIDE(tickee_state,tickee)
853833   MCFG_NVRAM_ADD_1FILL("nvram")
trunk/src/mame/drivers/midyunit.c
r32352r32353
10621062
10631063/*************************************
10641064 *
1065 *  34010 configuration
1066 *
1067 *************************************/
1068
1069static const tms340x0_config zunit_tms_config =
1070{
1071   FALSE,                          /* halt on reset */
1072   "screen",                       /* the screen operated on */
1073   MEDRES_PIXEL_CLOCK,             /* pixel clock */
1074   2,                              /* pixels per clock */
1075   midyunit_scanline_update,       /* scanline updater (indexed16) */
1076   NULL,                           /* scanline updater (rgb32) */
1077   NULL,                           /* generate interrupt */
1078   midyunit_to_shiftreg,           /* write to shiftreg function */
1079   midyunit_from_shiftreg          /* read from shiftreg function */
1080};
1081
1082static const tms340x0_config yunit_tms_config =
1083{
1084   FALSE,                          /* halt on reset */
1085   "screen",                       /* the screen operated on */
1086   STDRES_PIXEL_CLOCK,             /* pixel clock */
1087   2,                              /* pixels per clock */
1088   midyunit_scanline_update,       /* scanline updater (indexed16) */
1089   NULL,                           /* scanline updater (rgb32) */
1090   NULL,                           /* generate interrupt */
1091   midyunit_to_shiftreg,           /* write to shiftreg function */
1092   midyunit_from_shiftreg          /* read from shiftreg function */
1093};
1094
1095
1096
1097/*************************************
1098 *
10991065 *  Z-unit machine driver
11001066 *
11011067 *************************************/
r32352r32353
11041070
11051071   /* basic machine hardware */
11061072   MCFG_CPU_ADD("maincpu", TMS34010, FAST_MASTER_CLOCK)
1107   MCFG_TMS340X0_CONFIG(zunit_tms_config)
11081073   MCFG_CPU_PROGRAM_MAP(main_map)
1074   MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
1075   MCFG_TMS340X0_PIXEL_CLOCK(MEDRES_PIXEL_CLOCK) /* pixel clock */
1076   MCFG_TMS340X0_PIXELS_PER_CLOCK(2) /* pixels per clock */   
1077   MCFG_TMS340X0_SCANLINE_IND16_CB(midyunit_state, scanline_update)       /* scanline updater (indexed16) */
1078   MCFG_TMS340X0_TO_SHIFTREG_CB(midyunit_state, to_shiftreg)           /* write to shiftreg function */
1079   MCFG_TMS340X0_FROM_SHIFTREG_CB(midyunit_state, from_shiftreg)          /* read from shiftreg function */
11091080
11101081   MCFG_MACHINE_RESET_OVERRIDE(midyunit_state,midyunit)
11111082   MCFG_NVRAM_ADD_0FILL("nvram")
r32352r32353
11411112
11421113   /* basic machine hardware */
11431114   MCFG_CPU_ADD("maincpu", TMS34010, SLOW_MASTER_CLOCK)
1144   MCFG_TMS340X0_CONFIG(yunit_tms_config)
11451115   MCFG_CPU_PROGRAM_MAP(main_map)
1116   MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
1117   MCFG_TMS340X0_PIXEL_CLOCK(STDRES_PIXEL_CLOCK) /* pixel clock */
1118   MCFG_TMS340X0_PIXELS_PER_CLOCK(2) /* pixels per clock */   
1119   MCFG_TMS340X0_SCANLINE_IND16_CB(midyunit_state, scanline_update)       /* scanline updater (indexed16) */
1120   MCFG_TMS340X0_TO_SHIFTREG_CB(midyunit_state, to_shiftreg)           /* write to shiftreg function */
1121   MCFG_TMS340X0_FROM_SHIFTREG_CB(midyunit_state, from_shiftreg)          /* read from shiftreg function */
11461122
11471123   MCFG_MACHINE_RESET_OVERRIDE(midyunit_state,midyunit)
11481124   MCFG_NVRAM_ADD_0FILL("nvram")
trunk/src/mame/drivers/artmagic.c
r32352r32353
4444 *
4545 *************************************/
4646
47static void update_irq_state(running_machine &machine)
47void artmagic_state::update_irq_state()
4848{
49   artmagic_state *state = machine.driver_data<artmagic_state>();
50   state->m_maincpu->set_input_line(4, state->m_tms_irq  ? ASSERT_LINE : CLEAR_LINE);
51   state->m_maincpu->set_input_line(5, state->m_hack_irq ? ASSERT_LINE : CLEAR_LINE);
49   m_maincpu->set_input_line(4, m_tms_irq  ? ASSERT_LINE : CLEAR_LINE);
50   m_maincpu->set_input_line(5, m_hack_irq ? ASSERT_LINE : CLEAR_LINE);
5251}
5352
5453
55static void m68k_gen_int(device_t *device, int state)
54WRITE_LINE_MEMBER(artmagic_state::m68k_gen_int)
5655{
57   artmagic_state *drvstate = device->machine().driver_data<artmagic_state>();
58   drvstate->m_tms_irq = state;
59   update_irq_state(device->machine());
56   m_tms_irq = state;
57   update_irq_state();
6058}
6159
6260
r32352r32353
8381void artmagic_state::machine_reset()
8482{
8583   m_tms_irq = m_hack_irq = 0;
86   update_irq_state(machine());
84   update_irq_state();
8785}
8886
8987
r32352r32353
121119   {
122120   case TIMER_IRQ_OFF:
123121      m_hack_irq = 0;
124      update_irq_state(machine());
122      update_irq_state();
125123      break;
126124   default:
127125      assert_always(FALSE, "Unknown id in artmagic_state::device_timer");
r32352r32353
136134   if (pc == 0x18c2 || pc == 0x18e4)
137135   {
138136      m_hack_irq = 1;
139      update_irq_state(machine());
137      update_irq_state();
140138      timer_set(attotime::from_usec(1), TIMER_IRQ_OFF);
141139   }
142140   return ioport("300000")->read();
r32352r32353
475473 *
476474 *************************************/
477475
478static const tms340x0_config tms_config =
479{
480   TRUE,                           /* halt on reset */
481   "screen",                       /* the screen operated on */
482   MASTER_CLOCK_40MHz/6,           /* pixel clock */
483   1,                              /* pixels per clock */
484   NULL,                           /* scanline update (indexed16) */
485   artmagic_scanline,              /* scanline update (rgb32) */
486   m68k_gen_int,                   /* generate interrupt */
487   artmagic_to_shiftreg,           /* write to shiftreg function */
488   artmagic_from_shiftreg          /* read from shiftreg function */
489};
490
491
492476static ADDRESS_MAP_START( tms_map, AS_PROGRAM, 16, artmagic_state )
493477   AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_SHARE("vram0")
494478   AM_RANGE(0x00400000, 0x005fffff) AM_RAM AM_SHARE("vram1")
r32352r32353
827811   MCFG_CPU_PROGRAM_MAP(main_map)
828812
829813   MCFG_CPU_ADD("tms", TMS34010, MASTER_CLOCK_40MHz)
830   MCFG_TMS340X0_CONFIG(tms_config)
831814   MCFG_CPU_PROGRAM_MAP(tms_map)
815   MCFG_TMS340X0_HALT_ON_RESET(TRUE) /* halt on reset */
816   MCFG_TMS340X0_PIXEL_CLOCK(MASTER_CLOCK_40MHz/6) /* pixel clock */
817   MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
818   MCFG_TMS340X0_SCANLINE_RGB32_CB(artmagic_state, scanline)              /* scanline update (rgb32) */
819   MCFG_TMS340X0_OUTPUT_INT_CB(WRITELINE(artmagic_state, m68k_gen_int))
820   MCFG_TMS340X0_TO_SHIFTREG_CB(artmagic_state, to_shiftreg)           /* write to shiftreg function */
821   MCFG_TMS340X0_FROM_SHIFTREG_CB(artmagic_state, from_shiftreg)          /* read from shiftreg function */
832822
833823   MCFG_QUANTUM_TIME(attotime::from_hz(6000))
834824   MCFG_NVRAM_ADD_1FILL("nvram")
trunk/src/mame/drivers/coolpool.c
r32352r32353
5757 *
5858 *************************************/
5959
60static void amerdart_scanline(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params)
60TMS340X0_SCANLINE_RGB32_CB_MEMBER(coolpool_state::amerdart_scanline)
6161{
62   coolpool_state *state = screen.machine().driver_data<coolpool_state>();
63
64   UINT16 *vram = &state->m_vram_base[(params->rowaddr << 8) & 0xff00];
62   UINT16 *vram = &m_vram_base[(params->rowaddr << 8) & 0xff00];
6563   UINT32 *dest = &bitmap.pix32(scanline);
6664   rgb_t pens[16];
6765   int coladdr = params->coladdr;
r32352r32353
7169   if (scanline < 256)
7270      for (x = 0; x < 16; x++)
7371      {
74         UINT16 pal = state->m_vram_base[x];
72         UINT16 pal = m_vram_base[x];
7573         pens[x] = rgb_t(pal4bit(pal >> 4), pal4bit(pal >> 8), pal4bit(pal >> 12));
7674      }
7775
r32352r32353
8684}
8785
8886
89static void coolpool_scanline(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params)
87TMS340X0_SCANLINE_RGB32_CB_MEMBER(coolpool_state::coolpool_scanline)
9088{
91   coolpool_state *state = screen.machine().driver_data<coolpool_state>();
92
93   UINT16 *vram = &state->m_vram_base[(params->rowaddr << 8) & 0x1ff00];
89   UINT16 *vram = &m_vram_base[(params->rowaddr << 8) & 0x1ff00];
9490   UINT32 *dest = &bitmap.pix32(scanline);
95   const rgb_t *pens = state->m_tlc34076->get_pens();
91   const rgb_t *pens = m_tlc34076->get_pens();
9692   int coladdr = params->coladdr;
9793   int x;
9894
r32352r32353
112108 *
113109 *************************************/
114110
115static void coolpool_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
111TMS340X0_TO_SHIFTREG_CB_MEMBER(coolpool_state::to_shiftreg)
116112{
117   coolpool_state *state = space.machine().driver_data<coolpool_state>();
118
119   memcpy(shiftreg, &state->m_vram_base[TOWORD(address) & ~TOWORD(0xfff)], TOBYTE(0x1000));
113   memcpy(shiftreg, &m_vram_base[TOWORD(address) & ~TOWORD(0xfff)], TOBYTE(0x1000));
120114}
121115
122116
123static void coolpool_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
117TMS340X0_FROM_SHIFTREG_CB_MEMBER(coolpool_state::from_shiftreg)
124118{
125   coolpool_state *state = space.machine().driver_data<coolpool_state>();
126
127   memcpy(&state->m_vram_base[TOWORD(address) & ~TOWORD(0xfff)], shiftreg, TOBYTE(0x1000));
119   memcpy(&m_vram_base[TOWORD(address) & ~TOWORD(0xfff)], shiftreg, TOBYTE(0x1000));
128120}
129121
130122
r32352r32353
790782INPUT_PORTS_END
791783
792784
793
794785/*************************************
795786 *
796 *  34010 configuration
797 *
798 *************************************/
799
800static const tms340x0_config tms_config_amerdart =
801{
802   FALSE,                          /* halt on reset */
803   "screen",                       /* the screen operated on */
804   XTAL_40MHz/12,                  /* pixel clock */
805   2,                              /* pixels per clock */
806   NULL,                           /* scanline callback (indexed16) */
807   amerdart_scanline,              /* scanline callback (rgb32) */
808   NULL,                           /* generate interrupt */
809   coolpool_to_shiftreg,           /* write to shiftreg function */
810   coolpool_from_shiftreg          /* read from shiftreg function */
811};
812
813
814static const tms340x0_config tms_config_coolpool =
815{
816   FALSE,                          /* halt on reset */
817   "screen",                       /* the screen operated on */
818   XTAL_40MHz/6,                   /* pixel clock */
819   1,                              /* pixels per clock */
820   NULL,                           /* scanline callback (indexed16) */
821   coolpool_scanline,              /* scanline callback (rgb32) */
822   NULL,                           /* generate interrupt */
823   coolpool_to_shiftreg,           /* write to shiftreg function */
824   coolpool_from_shiftreg          /* read from shiftreg function */
825};
826
827
828
829/*************************************
830 *
831787 *  Machine drivers
832788 *
833789 *************************************/
r32352r32353
836792
837793   /* basic machine hardware */
838794   MCFG_CPU_ADD("maincpu", TMS34010, XTAL_40MHz)
839   MCFG_TMS340X0_CONFIG(tms_config_amerdart)
840795   MCFG_CPU_PROGRAM_MAP(amerdart_map)
796   MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
797   MCFG_TMS340X0_PIXEL_CLOCK(XTAL_40MHz/12) /* pixel clock */
798   MCFG_TMS340X0_PIXELS_PER_CLOCK(2) /* pixels per clock */
799   MCFG_TMS340X0_SCANLINE_RGB32_CB(coolpool_state, amerdart_scanline) /* scanline callback (rgb32) */
800   MCFG_TMS340X0_TO_SHIFTREG_CB(coolpool_state, to_shiftreg)  /* write to shiftreg function */
801   MCFG_TMS340X0_FROM_SHIFTREG_CB(coolpool_state, from_shiftreg) /* read from shiftreg function */
841802
842803   MCFG_CPU_ADD("dsp", TMS32015, XTAL_40MHz/2)
843804   MCFG_CPU_PROGRAM_MAP(amerdart_dsp_pgm_map)
r32352r32353
867828
868829   /* basic machine hardware */
869830   MCFG_CPU_ADD("maincpu", TMS34010, XTAL_40MHz)
870   MCFG_TMS340X0_CONFIG(tms_config_coolpool)
871831   MCFG_CPU_PROGRAM_MAP(coolpool_map)
872
832   MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
833   MCFG_TMS340X0_PIXEL_CLOCK(XTAL_40MHz/6) /* pixel clock */
834   MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
835   MCFG_TMS340X0_SCANLINE_RGB32_CB(coolpool_state, coolpool_scanline) /* scanline callback (rgb32) */
836   MCFG_TMS340X0_TO_SHIFTREG_CB(coolpool_state, to_shiftreg)  /* write to shiftreg function */
837   MCFG_TMS340X0_FROM_SHIFTREG_CB(coolpool_state, from_shiftreg) /* read from shiftreg function */
838   
873839   MCFG_CPU_ADD("dsp", TMS32026,XTAL_40MHz)
874840   MCFG_CPU_PROGRAM_MAP(coolpool_dsp_pgm_map)
875841   MCFG_CPU_IO_MAP(coolpool_dsp_io_map)
trunk/src/mame/drivers/midtunit.c
r32352r32353
573573INPUT_PORTS_END
574574
575575
576/*************************************
577 *
578 *  34010 configuration
579 *
580 *************************************/
581576
582static const tms340x0_config tms_config =
583{
584   FALSE,                          /* halt on reset */
585   "screen",                       /* the screen operated on */
586   PIXEL_CLOCK,                    /* pixel clock */
587   2,                              /* pixels per clock */
588   midtunit_scanline_update,       /* scanline updater (indexed16) */
589   NULL,                           /* scanline updater (rgb32) */
590   NULL,                           /* generate interrupt */
591   midtunit_to_shiftreg,           /* write to shiftreg function */
592   midtunit_from_shiftreg          /* read from shiftreg function */
593};
594
595
596
597577/*************************************
598578 *
599579 *  Machine drivers
r32352r32353
604584
605585   /* basic machine hardware */
606586   MCFG_CPU_ADD("maincpu", TMS34010, CPU_CLOCK)
607   MCFG_TMS340X0_CONFIG(tms_config)
608587   MCFG_CPU_PROGRAM_MAP(main_map)
588   MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
589   MCFG_TMS340X0_PIXEL_CLOCK(PIXEL_CLOCK) /* pixel clock */
590   MCFG_TMS340X0_PIXELS_PER_CLOCK(2) /* pixels per clock */   
591   MCFG_TMS340X0_SCANLINE_IND16_CB(midtunit_state, scanline_update)       /* scanline updater (indexed16) */
592   MCFG_TMS340X0_TO_SHIFTREG_CB(midtunit_state, to_shiftreg)           /* write to shiftreg function */
593   MCFG_TMS340X0_FROM_SHIFTREG_CB(midtunit_state, from_shiftreg)          /* read from shiftreg function */
609594
610595   MCFG_MACHINE_RESET_OVERRIDE(midtunit_state,midtunit)
611596   MCFG_NVRAM_ADD_0FILL("nvram")
trunk/src/mame/drivers/exterm.c
r32352r32353
393393INPUT_PORTS_END
394394
395395
396
397396/*************************************
398397 *
399 *  34010 configurations
400 *
401 *************************************/
402
403static const tms340x0_config master_config =
404{
405   FALSE,                      /* halt on reset */
406   "screen",                   /* the screen operated on */
407   40000000/8,                 /* pixel clock */
408   1,                          /* pixels per clock */
409   exterm_scanline_update,     /* scanline updater (indexed16) */
410   NULL,                       /* scanline updater (rgb32) */
411   NULL,                       /* generate interrupt */
412   exterm_to_shiftreg_master,  /* write to shiftreg function */
413   exterm_from_shiftreg_master /* read from shiftreg function */
414};
415
416static const tms340x0_config slave_config =
417{
418   TRUE,                       /* halt on reset */
419   "screen",                   /* the screen operated on */
420   40000000/8,                 /* pixel clock */
421   1,                          /* pixels per clock */
422   NULL,                       /* scanline updater (indexed16) */
423   NULL,                       /* scanline updater (rgb32) */
424   NULL,                       /* generate interrupt */
425   exterm_to_shiftreg_slave,   /* write to shiftreg function */
426   exterm_from_shiftreg_slave  /* read from shiftreg function */
427};
428
429
430
431/*************************************
432 *
433398 *  Machine drivers
434399 *
435400 *************************************/
r32352r32353
438403
439404   /* basic machine hardware */
440405   MCFG_CPU_ADD("maincpu", TMS34010, 40000000)
441   MCFG_TMS340X0_CONFIG(master_config)
442406   MCFG_CPU_PROGRAM_MAP(master_map)
407   MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
408   MCFG_TMS340X0_PIXEL_CLOCK(40000000/8) /* pixel clock */
409   MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
410   MCFG_TMS340X0_SCANLINE_IND16_CB(exterm_state, scanline_update)     /* scanline updater (indexed16) */
411   MCFG_TMS340X0_TO_SHIFTREG_CB(exterm_state, to_shiftreg_master)  /* write to shiftreg function */
412   MCFG_TMS340X0_FROM_SHIFTREG_CB(exterm_state, from_shiftreg_master) /* read from shiftreg function */
443413
444414   MCFG_CPU_ADD("slave", TMS34010, 40000000)
445   MCFG_TMS340X0_CONFIG(slave_config)
446415   MCFG_CPU_PROGRAM_MAP(slave_map)
416   MCFG_TMS340X0_HALT_ON_RESET(TRUE) /* halt on reset */
417   MCFG_TMS340X0_PIXEL_CLOCK(40000000/8) /* pixel clock */
418   MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
419   MCFG_TMS340X0_TO_SHIFTREG_CB(exterm_state, to_shiftreg_slave)   /* write to shiftreg function */
420   MCFG_TMS340X0_FROM_SHIFTREG_CB(exterm_state, from_shiftreg_slave)  /* read from shiftreg function */
447421
448422   MCFG_CPU_ADD("audiocpu", M6502, 2000000)
449423   MCFG_CPU_PROGRAM_MAP(sound_master_map)
trunk/src/mame/drivers/metalmx.c
r32352r32353
480480   COMBINE_DATA(m_gsp_vram + offset * 2);
481481}
482482
483static void tms_interrupt(device_t *device, int state)
483WRITE_LINE_MEMBER(metalmx_state::tms_interrupt)
484484{
485   metalmx_state *drvstate = device->machine().driver_data<metalmx_state>();
486   drvstate->m_maincpu->set_input_line(4, state ? HOLD_LINE : CLEAR_LINE);
485   m_maincpu->set_input_line(4, state ? HOLD_LINE : CLEAR_LINE);
487486}
488487
489488
r32352r32353
684683
685684/*************************************
686685 *
687 *  CPU configuration
688 *
689 *************************************/
690
691static const tms340x0_config gsp_config =
692{
693   TRUE,                   /* halt on reset */
694   "screen",               /* the screen operated on */
695   4000000,                /* pixel clock */
696   2,                      /* pixels per clock */
697   NULL,                   /* scanline callback (indexed16) */
698   NULL,                   /* scanline callback (rgb32) */
699   tms_interrupt,          /* generate interrupt */
700};
701
702/*************************************
703 *
704686 *  Machine driver
705687 *
706688 *************************************/
r32352r32353
715697   MCFG_CPU_DATA_MAP(adsp_data_map)
716698
717699   MCFG_CPU_ADD("gsp", TMS34020, 40000000)         /* Unverified */
718   MCFG_TMS340X0_CONFIG(gsp_config)
719700   MCFG_CPU_PROGRAM_MAP(gsp_map)
701   MCFG_TMS340X0_HALT_ON_RESET(TRUE) /* halt on reset */
702   MCFG_TMS340X0_PIXEL_CLOCK(4000000) /* pixel clock */
703   MCFG_TMS340X0_PIXELS_PER_CLOCK(2) /* pixels per clock */
704   MCFG_TMS340X0_OUTPUT_INT_CB(WRITELINE(metalmx_state, tms_interrupt))
720705
721706   MCFG_CPU_ADD("dsp32c_1", DSP32C, 40000000)      /* Unverified */
722707   MCFG_CPU_PROGRAM_MAP(dsp32c_1_map)
trunk/src/mame/drivers/skimaxx.c
r32352r32353
4545public:
4646   skimaxx_state(const machine_config &mconfig, device_type type, const char *tag)
4747      : driver_device(mconfig, type, tag),
48      m_blitter_regs(*this, "blitter_regs"),
49      m_fpga_ctrl(*this, "fpga_ctrl"),
50      m_fg_buffer(*this, "fg_buffer"),
5148      m_maincpu(*this, "maincpu"),
5249      m_subcpu(*this, "subcpu"),
53      m_tms(*this, "tms") { }
50      m_tms(*this, "tms"),
51      m_blitter_regs(*this, "blitter_regs"),
52      m_fpga_ctrl(*this, "fpga_ctrl"),
53      m_fg_buffer(*this, "fg_buffer") { }
5454
55   required_device<cpu_device> m_maincpu;
56   required_device<cpu_device> m_subcpu;
57   required_device<tms34010_device> m_tms;
58   
5559   required_shared_ptr<UINT32> m_blitter_regs;
5660   required_shared_ptr<UINT32> m_fpga_ctrl;
5761   required_shared_ptr<UINT16> m_fg_buffer;
62   
5863   UINT32 *m_bg_buffer;
5964   UINT32 *m_bg_buffer_front;
6065   UINT32 *m_bg_buffer_back;
r32352r32353
6469   UINT32 m_blitter_src_dx;
6570   UINT32 m_blitter_src_y;
6671   UINT32 m_blitter_src_dy;
72   
6773   DECLARE_WRITE32_MEMBER(skimaxx_blitter_w);
6874   DECLARE_READ32_MEMBER(skimaxx_blitter_r);
6975   DECLARE_WRITE32_MEMBER(skimaxx_fpga_ctrl_w);
r32352r32353
7278   DECLARE_WRITE32_MEMBER(skimaxx_unk1_w);
7379   DECLARE_WRITE32_MEMBER(skimaxx_sub_ctrl_w);
7480   DECLARE_READ32_MEMBER(skimaxx_analog_r);
81   DECLARE_WRITE_LINE_MEMBER(tms_irq);
82   
83   TMS340X0_TO_SHIFTREG_CB_MEMBER(to_shiftreg);
84   TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg);
85   TMS340X0_SCANLINE_IND16_CB_MEMBER(scanline_update);
86   
7587   virtual void machine_reset();
7688   virtual void video_start();
77   required_device<cpu_device> m_maincpu;
78   required_device<cpu_device> m_subcpu;
79   required_device<tms34010_device> m_tms;
8089};
8190
8291
r32352r32353
160169 *************************************/
161170
162171// TODO: Might not be used
163static void skimaxx_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
172TMS340X0_TO_SHIFTREG_CB_MEMBER(skimaxx_state::to_shiftreg)
164173{
165   skimaxx_state *state = space.machine().driver_data<skimaxx_state>();
166   memcpy(shiftreg, &state->m_fg_buffer[TOWORD(address)], 512 * sizeof(UINT16));
174   memcpy(shiftreg, &m_fg_buffer[TOWORD(address)], 512 * sizeof(UINT16));
167175}
168176
169static void skimaxx_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
177TMS340X0_FROM_SHIFTREG_CB_MEMBER(skimaxx_state::from_shiftreg)
170178{
171   skimaxx_state *state = space.machine().driver_data<skimaxx_state>();
172   memcpy(&state->m_fg_buffer[TOWORD(address)], shiftreg, 512 * sizeof(UINT16));
179   memcpy(&m_fg_buffer[TOWORD(address)], shiftreg, 512 * sizeof(UINT16));
173180}
174181
175182
r32352r32353
179186 *
180187 *************************************/
181188
182static void skimaxx_scanline_update(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params)
189TMS340X0_SCANLINE_IND16_CB_MEMBER(skimaxx_state::scanline_update)
183190{
184   skimaxx_state *state = screen.machine().driver_data<skimaxx_state>();
185191   // TODO: This isn't correct. I just hacked it together quickly so I could see something!
186192
187193   if (params->rowaddr >= 0x220)
188194   {
189195      UINT32 rowaddr = (params->rowaddr - 0x220);
190      UINT16 *fg = &state->m_fg_buffer[rowaddr << 8];
191      UINT32 *bg = &state->m_bg_buffer_front[rowaddr/2 * 1024/2];
196      UINT16 *fg = &m_fg_buffer[rowaddr << 8];
197      UINT32 *bg = &m_bg_buffer_front[rowaddr/2 * 1024/2];
192198      UINT16 *dest = &bitmap.pix16(scanline);
193199      //int coladdr = params->coladdr;
194200      int x;
r32352r32353
462468 *
463469 *************************************/
464470
465static void skimaxx_tms_irq(device_t *device, int state)
471WRITE_LINE_MEMBER(skimaxx_state::tms_irq)
466472{
467473   // TODO
468474}
469475
470static const tms340x0_config tms_config =
471{
472   FALSE,                     /* halt on reset */
473   "screen",                  /* the screen operated on */
474   50000000/8,                /* pixel clock */
475   2,                         /* pixels per clock */
476   skimaxx_scanline_update,   /* scanline updater (indexed16) */
477   NULL,                      /* scanline updater (rgb32) */
478   skimaxx_tms_irq,           /* generate interrupt */
479   skimaxx_to_shiftreg,       /* write to shiftreg function */
480   skimaxx_from_shiftreg      /* read from shiftreg function */
481};
482
483
484476/*************************************
485477 *
486478 *  Initialisation
r32352r32353
508500
509501   /* video hardware */
510502   MCFG_CPU_ADD("tms", TMS34010, XTAL_50MHz)
511   MCFG_TMS340X0_CONFIG(tms_config)
512503   MCFG_CPU_PROGRAM_MAP(tms_program_map)
504   MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
505   MCFG_TMS340X0_PIXEL_CLOCK(50000000/8) /* pixel clock */
506   MCFG_TMS340X0_PIXELS_PER_CLOCK(2) /* pixels per clock */
507   MCFG_TMS340X0_SCANLINE_IND16_CB(skimaxx_state, scanline_update)     /* scanline updater (indexed16) */
508   MCFG_TMS340X0_OUTPUT_INT_CB(WRITELINE(skimaxx_state, tms_irq))
509   MCFG_TMS340X0_TO_SHIFTREG_CB(skimaxx_state, to_shiftreg)  /* write to shiftreg function */
510   MCFG_TMS340X0_FROM_SHIFTREG_CB(skimaxx_state, from_shiftreg) /* read from shiftreg function */
513511
514512   MCFG_SCREEN_ADD("screen", RASTER)
515513//  MCFG_SCREEN_RAW_PARAMS(40000000/4, 156*4, 0, 100*4, 328, 0, 300) // TODO - Wrong but TMS overrides it anyway
trunk/src/mame/drivers/midzeus.c
r32352r32353
2828
2929#include "emu.h"
3030#include "cpu/tms32031/tms32031.h"
31#include "cpu/tms34010/tms34010.h"
3231#include "cpu/adsp2100/adsp2100.h"
3332#include "cpu/pic16c5x/pic16c5x.h"
3433#include "includes/midzeus.h"
trunk/src/mame/drivers/harddriv.c
r32352r32353
333333
334334/*************************************
335335 *
336 *  CPU configs
337 *
338 *************************************/
339
340/* used on the medium-resolution driver boards */
341static const tms340x0_config gsp_config_driver =
342{
343   TRUE,                           /* halt on reset */
344   "screen",                       /* the screen operated on */
345   4000000,                        /* pixel clock */
346   4,                              /* pixels per clock */
347   harddriv_scanline_driver,       /* scanline callback (indexed16) */
348   NULL,                           /* scanline callback (rgb32) */
349   hdgsp_irq_gen,                  /* generate interrupt */
350   hdgsp_write_to_shiftreg,        /* write to shiftreg function */
351   hdgsp_read_from_shiftreg        /* read from shiftreg function */
352};
353
354
355/* used on the low-resolution multisync boards for harddrivc, racedrivc, steeltal */
356static const tms340x0_config gsp_config_multisync =
357{
358   TRUE,                           /* halt on reset */
359   "screen",                       /* the screen operated on */
360   6000000,                        /* pixel clock */
361   2,                              /* pixels per clock */
362   harddriv_scanline_multisync,    /* scanline callback (indexed16) */
363   NULL,                           /* scanline callback (rgb32 */
364   hdgsp_irq_gen,                  /* generate interrupt */
365   hdgsp_write_to_shiftreg,        /* write to shiftreg function */
366   hdgsp_read_from_shiftreg        /* read from shiftreg function */
367};
368
369
370/* used on the low-resolution multisync board for stunrun */
371static const tms340x0_config gsp_config_multisync_stunrun =
372{
373   TRUE,                           /* halt on reset */
374   "screen",                       /* the screen operated on */
375   5000000,                        /* pixel clock */
376   2,                              /* pixels per clock */
377   harddriv_scanline_multisync,    /* scanline callback (indexed16) */
378   NULL,                           /* scanline callback (rgb32 */
379   hdgsp_irq_gen,                  /* generate interrupt */
380   hdgsp_write_to_shiftreg,        /* write to shiftreg function */
381   hdgsp_read_from_shiftreg        /* read from shiftreg function */
382};
383
384
385static const tms340x0_config msp_config =
386{
387   TRUE,                           /* halt on reset */
388   "screen",                       /* the screen operated on */
389   5000000,                        /* pixel clock */
390   2,                              /* pixels per clock */
391   NULL,                           /* scanline callback (indexed16) */
392   NULL,                           /* scanline callback (rgb32 */
393   hdmsp_irq_gen                   /* generate interrupt */
394};
395
396/*************************************
397 *
398336 *  Driver board memory maps
399337 *
400338 *************************************/
r32352r32353
12961234
12971235   MCFG_CPU_ADD("gsp", TMS34010, HARDDRIV_GSP_CLOCK)
12981236   MCFG_CPU_PROGRAM_MAP(driver_gsp_map)
1299   MCFG_TMS340X0_CONFIG(gsp_config_driver)
1237   MCFG_TMS340X0_HALT_ON_RESET(TRUE) /* halt on reset */
1238   MCFG_TMS340X0_PIXEL_CLOCK(4000000) /* pixel clock */
1239   MCFG_TMS340X0_PIXELS_PER_CLOCK(4) /* pixels per clock */
1240   MCFG_TMS340X0_SCANLINE_IND16_CB(harddriv_state, scanline_driver) /* scanline callback (indexed16) */
1241   MCFG_TMS340X0_OUTPUT_INT_CB(WRITELINE(harddriv_state, hdgsp_irq_gen))
1242   MCFG_TMS340X0_TO_SHIFTREG_CB(harddriv_state, hdgsp_write_to_shiftreg)
1243   MCFG_TMS340X0_FROM_SHIFTREG_CB(harddriv_state, hdgsp_read_from_shiftreg)
13001244
13011245   MCFG_QUANTUM_TIME(attotime::from_hz(30000))
13021246
r32352r32353
13281272   /* basic machine hardware */
13291273   MCFG_CPU_ADD("msp", TMS34010, XTAL_50MHz)
13301274   MCFG_CPU_PROGRAM_MAP(driver_msp_map)
1331   MCFG_TMS340X0_CONFIG(msp_config)
1275   MCFG_TMS340X0_HALT_ON_RESET(TRUE) /* halt on reset */
1276   MCFG_TMS340X0_PIXEL_CLOCK(5000000) /* pixel clock */
1277   MCFG_TMS340X0_PIXELS_PER_CLOCK(2) /* pixels per clock */
1278   MCFG_TMS340X0_OUTPUT_INT_CB(WRITELINE(harddriv_state, hdmsp_irq_gen))
13321279MACHINE_CONFIG_END
13331280
13341281
r32352r32353
13401287   MCFG_CPU_PROGRAM_MAP(multisync_68k_map)
13411288
13421289   MCFG_CPU_MODIFY("gsp")
1343   MCFG_TMS340X0_CONFIG(gsp_config_multisync)
13441290   MCFG_CPU_PROGRAM_MAP(multisync_gsp_map)
1291   MCFG_TMS340X0_PIXEL_CLOCK(6000000) /* pixel clock */
1292   MCFG_TMS340X0_PIXELS_PER_CLOCK(2) /* pixels per clock */
1293   MCFG_TMS340X0_SCANLINE_IND16_CB(harddriv_state, scanline_multisync) /* scanline callback (indexed16) */
13451294
13461295   /* video hardware */
13471296   MCFG_SCREEN_MODIFY("screen")
r32352r32353
13551304   /* basic machine hardware */
13561305   MCFG_CPU_ADD("msp", TMS34010, XTAL_50MHz)
13571306   MCFG_CPU_PROGRAM_MAP(driver_msp_map)
1358   MCFG_TMS340X0_CONFIG(msp_config)
1307   MCFG_TMS340X0_HALT_ON_RESET(TRUE) /* halt on reset */
1308   MCFG_TMS340X0_PIXEL_CLOCK(5000000) /* pixel clock */
1309   MCFG_TMS340X0_PIXELS_PER_CLOCK(2) /* pixels per clock */
1310   MCFG_TMS340X0_OUTPUT_INT_CB(WRITELINE(harddriv_state, hdmsp_irq_gen))
13591311MACHINE_CONFIG_END
13601312
13611313
r32352r32353
15301482
15311483   /* basic machine hardware */        /* multisync board without MSP */
15321484   MCFG_CPU_MODIFY("gsp")
1533   MCFG_TMS340X0_CONFIG(gsp_config_multisync_stunrun)
1485   MCFG_TMS340X0_PIXEL_CLOCK(5000000)  /* pixel clock */
15341486   MCFG_FRAGMENT_ADD( adsp )           /* ADSP board */
15351487
15361488   /* video hardware */
trunk/src/mame/drivers/midxunit.c
r32352r32353
232232INPUT_PORTS_END
233233
234234
235
236235/*************************************
237236 *
238 *  34010 configuration
239 *
240 *************************************/
241
242static const tms340x0_config tms_config =
243{
244   FALSE,                          /* halt on reset */
245   "screen",                       /* the screen operated on */
246   PIXEL_CLOCK,                    /* pixel clock */
247   1,                              /* pixels per clock */
248   midxunit_scanline_update,       /* scanline updater (indexed16) */
249   NULL,                           /* scanline updater (rgb32) */
250   NULL,                           /* generate interrupt */
251   midtunit_to_shiftreg,           /* write to shiftreg function */
252   midtunit_from_shiftreg          /* read from shiftreg function */
253};
254
255
256
257/*************************************
258 *
259237 *  Machine drivers
260238 *
261239 *************************************/
r32352r32353
264242
265243   /* basic machine hardware */
266244   MCFG_CPU_ADD("maincpu", TMS34020, 40000000)
267   MCFG_TMS340X0_CONFIG(tms_config)
268245   MCFG_CPU_PROGRAM_MAP(main_map)
246   MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
247   MCFG_TMS340X0_PIXEL_CLOCK(PIXEL_CLOCK) /* pixel clock */
248   MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */   
249   MCFG_TMS340X0_SCANLINE_IND16_CB(midxunit_state, scanline_update)       /* scanline updater (indexed16) */
250   MCFG_TMS340X0_TO_SHIFTREG_CB(midtunit_state, to_shiftreg)           /* write to shiftreg function */
251   MCFG_TMS340X0_FROM_SHIFTREG_CB(midtunit_state, from_shiftreg)          /* read from shiftreg function */
269252
270253   MCFG_MACHINE_RESET_OVERRIDE(midxunit_state,midxunit)
271254   MCFG_NVRAM_ADD_0FILL("nvram")
trunk/src/mame/drivers/potgoldu.c
r32352r32353
2727   potgold_state(const machine_config &mconfig, device_type type, const char *tag)
2828      : driver_device(mconfig, type, tag),
2929      m_maincpu(*this, "maincpu") { }
30   
31      required_device<cpu_device> m_maincpu;
32   
3033   virtual void machine_reset();
3134   virtual void video_start();
32   required_device<cpu_device> m_maincpu;
35   
36   TMS340X0_SCANLINE_RGB32_CB_MEMBER(scanline_update);
3337};
3438
3539
r32352r32353
4549{
4650}
4751
48static void scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params)
52TMS340X0_SCANLINE_RGB32_CB_MEMBER(potgold_state::scanline_update)
4953{
5054}
5155
r32352r32353
6468INPUT_PORTS_END
6569
6670
67static const tms340x0_config tms_config =
68{
69   FALSE,                          /* halt on reset */
70   "screen",                       /* the screen operated on */
71   VIDEO_CLOCK/2,                  /* pixel clock */
72   1,                              /* pixels per clock */
73   NULL,                           /* scanline callback (indexed16) */
74   scanline_update,                /* scanline callback (rgb32) */
75   NULL,                           /* generate interrupt */
76   NULL,                           /* write to shiftreg function */
77   NULL                            /* read from shiftreg function */
78};
79
80
8171static MACHINE_CONFIG_START( potgold, potgold_state )
8272
8373   /* basic machine hardware */
8474   MCFG_CPU_ADD("maincpu", TMS34010, XTAL_40MHz)
85   MCFG_TMS340X0_CONFIG(tms_config)
8675   MCFG_CPU_PROGRAM_MAP(potgold_map)
76   MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
77   MCFG_TMS340X0_PIXEL_CLOCK(VIDEO_CLOCK/2) /* pixel clock */
78   MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
79   MCFG_TMS340X0_SCANLINE_RGB32_CB(potgold_state, scanline_update)  /* scanline callback (rgb32) */
8780
88
89
9081   MCFG_SCREEN_ADD("screen", RASTER)
9182   MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK/2, 444, 0, 320, 233, 0, 200)
9283   MCFG_SCREEN_UPDATE_DEVICE("maincpu", tms34010_device, tms340x0_rgb32)
trunk/src/mame/drivers/skeetsht.c
r32352r32353
4646   DECLARE_READ8_MEMBER(hc11_porta_r);
4747   DECLARE_WRITE8_MEMBER(hc11_porta_w);
4848   DECLARE_WRITE8_MEMBER(ay8910_w);
49   DECLARE_WRITE_LINE_MEMBER(tms_irq);
50   TMS340X0_SCANLINE_RGB32_CB_MEMBER(scanline_update);
4951   virtual void machine_reset();
5052   virtual void video_start();
5153   required_device<cpu_device> m_68hc11;
r32352r32353
7577{
7678}
7779
78static void skeetsht_scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params)
80TMS340X0_SCANLINE_RGB32_CB_MEMBER(skeetsht_state::scanline_update)
7981{
80   skeetsht_state *state = screen.machine().driver_data<skeetsht_state>();
81   const rgb_t *const pens = state->m_tlc34076->get_pens();
82   UINT16 *vram = &state->m_tms_vram[(params->rowaddr << 8) & 0x3ff00];
82   const rgb_t *const pens = m_tlc34076->get_pens();
83   UINT16 *vram = &m_tms_vram[(params->rowaddr << 8) & 0x3ff00];
8384   UINT32 *dest = &bitmap.pix32(scanline);
8485   int coladdr = params->coladdr;
8586   int x;
r32352r32353
119120 *
120121 *************************************/
121122
122static void skeetsht_tms_irq(device_t *device, int state)
123WRITE_LINE_MEMBER(skeetsht_state::tms_irq)
123124{
124   skeetsht_state *drvstate = device->machine().driver_data<skeetsht_state>();
125   drvstate->m_68hc11->set_input_line(MC68HC11_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
125   m_68hc11->set_input_line(MC68HC11_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
126126}
127127
128128
r32352r32353
213213INPUT_PORTS_END
214214
215215
216/*************************************
217 *
218 *  TMS34010 configuration
219 *
220 *************************************/
221216
222static const tms340x0_config tms_config =
223{
224   TRUE,                       /* halt on reset */
225   "screen",                   /* the screen operated on */
226   48000000 / 8,               /* pixel clock */
227   1,                          /* pixels per clock */
228   NULL,                       /* scanline updater (indexed16) */
229   skeetsht_scanline_update,   /* scanline updater (rgb32) */
230   skeetsht_tms_irq,           /* generate interrupt */
231   NULL,                       /* write to shiftreg function */
232   NULL                        /* read from shiftreg function */
233};
234
235
236
237217/*************************************
238218 *
239219 *  Machine driver
r32352r32353
248228   MCFG_MC68HC11_CONFIG( 0, 0x100, 0x01 )  // And 512 bytes EEPROM? (68HC11A1)
249229
250230   MCFG_CPU_ADD("tms", TMS34010, 48000000)
251   MCFG_TMS340X0_CONFIG(tms_config)
252231   MCFG_CPU_PROGRAM_MAP(tms_program_map)
232   MCFG_TMS340X0_HALT_ON_RESET(TRUE) /* halt on reset */
233   MCFG_TMS340X0_PIXEL_CLOCK(48000000 / 8) /* pixel clock */
234   MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
235   MCFG_TMS340X0_SCANLINE_RGB32_CB(skeetsht_state, scanline_update)   /* scanline updater (rgb32) */
236   MCFG_TMS340X0_OUTPUT_INT_CB(WRITELINE(skeetsht_state, tms_irq))
253237
254
255238   MCFG_TLC34076_ADD("tlc34076", TLC34076_6_BIT)
256239
257240   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mame/drivers/xtheball.c
r32352r32353
2121public:
2222   xtheball_state(const machine_config &mconfig, device_type type, const char *tag)
2323      : driver_device(mconfig, type, tag),
24         m_maincpu(*this, "maincpu"),
2425         m_tlc34076(*this, "tlc34076"),
2526         m_vram_bg(*this, "vrabg"),
2627         m_vram_fg(*this, "vrafg"),
2728         m_analog_x(*this, "ANALOGX"),
28         m_analog_y(*this, "ANALOGY"),
29         m_maincpu(*this, "maincpu") { }
29         m_analog_y(*this, "ANALOGY") { }
3030
31   required_device<cpu_device> m_maincpu;
3132   required_device<tlc34076_device> m_tlc34076;
3233   required_shared_ptr<UINT16> m_vram_bg;
3334   required_shared_ptr<UINT16> m_vram_fg;
r32352r32353
3738   DECLARE_WRITE16_MEMBER(bit_controls_w);
3839   DECLARE_READ16_MEMBER(analogx_r);
3940   DECLARE_READ16_MEMBER(analogy_watchdog_r);
40   required_device<cpu_device> m_maincpu;
41   TMS340X0_TO_SHIFTREG_CB_MEMBER(to_shiftreg);
42   TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg);
43   TMS340X0_SCANLINE_RGB32_CB_MEMBER(scanline_update);
4144};
4245
4346
r32352r32353
4952 *
5053 *************************************/
5154
52static void xtheball_scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params)
55TMS340X0_SCANLINE_RGB32_CB_MEMBER(xtheball_state::scanline_update)
5356{
54   xtheball_state *state = screen.machine().driver_data<xtheball_state>();
55   UINT16 *srcbg = &state->m_vram_bg[(params->rowaddr << 8) & 0xff00];
57   UINT16 *srcbg = &m_vram_bg[(params->rowaddr << 8) & 0xff00];
5658   UINT32 *dest = &bitmap.pix32(scanline);
57   const rgb_t *pens = state->m_tlc34076->get_pens();
59   const rgb_t *pens = m_tlc34076->get_pens();
5860   int coladdr = params->coladdr;
5961   int x;
6062
6163   /* bit value 0x13 controls which foreground mode to use */
62   if (!state->m_bitvals[0x13])
64   if (!m_bitvals[0x13])
6365   {
6466      /* mode 0: foreground is the same as background */
65      UINT16 *srcfg = &state->m_vram_fg[(params->rowaddr << 8) & 0xff00];
67      UINT16 *srcfg = &m_vram_fg[(params->rowaddr << 8) & 0xff00];
6668
6769      for (x = params->heblnk; x < params->hsblnk; x += 2, coladdr++)
6870      {
r32352r32353
7779   {
7880      /* mode 1: foreground is half background resolution in */
7981      /* X and supports two pages */
80      UINT16 *srcfg = &state->m_vram_fg[(params->rowaddr << 7) & 0xff00];
82      UINT16 *srcfg = &m_vram_fg[(params->rowaddr << 7) & 0xff00];
8183
8284      for (x = params->heblnk; x < params->hsblnk; x += 2, coladdr++)
8385      {
r32352r32353
99101 *
100102 *************************************/
101103
102static void xtheball_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
104TMS340X0_TO_SHIFTREG_CB_MEMBER(xtheball_state::to_shiftreg)
103105{
104   xtheball_state *state = space.machine().driver_data<xtheball_state>();
105106   if (address >= 0x01000000 && address <= 0x010fffff)
106      memcpy(shiftreg, &state->m_vram_bg[TOWORD(address & 0xff000)], TOBYTE(0x1000));
107      memcpy(shiftreg, &m_vram_bg[TOWORD(address & 0xff000)], TOBYTE(0x1000));
107108   else if (address >= 0x02000000 && address <= 0x020fffff)
108      memcpy(shiftreg, &state->m_vram_fg[TOWORD(address & 0xff000)], TOBYTE(0x1000));
109      memcpy(shiftreg, &m_vram_fg[TOWORD(address & 0xff000)], TOBYTE(0x1000));
109110   else
110111      logerror("%s:xtheball_to_shiftreg(%08X)\n", space.machine().describe_context(), address);
111112}
112113
113114
114static void xtheball_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
115TMS340X0_FROM_SHIFTREG_CB_MEMBER(xtheball_state::from_shiftreg)
115116{
116   xtheball_state *state = space.machine().driver_data<xtheball_state>();
117117   if (address >= 0x01000000 && address <= 0x010fffff)
118      memcpy(&state->m_vram_bg[TOWORD(address & 0xff000)], shiftreg, TOBYTE(0x1000));
118      memcpy(&m_vram_bg[TOWORD(address & 0xff000)], shiftreg, TOBYTE(0x1000));
119119   else if (address >= 0x02000000 && address <= 0x020fffff)
120      memcpy(&state->m_vram_fg[TOWORD(address & 0xff000)], shiftreg, TOBYTE(0x1000));
120      memcpy(&m_vram_fg[TOWORD(address & 0xff000)], shiftreg, TOBYTE(0x1000));
121121   else
122122      logerror("%s:xtheball_from_shiftreg(%08X)\n", space.machine().describe_context(), address);
123123}
r32352r32353
315315INPUT_PORTS_END
316316
317317
318
319318/*************************************
320319 *
321 *  34010 configuration
322 *
323 *************************************/
324
325static const tms340x0_config tms_config =
326{
327   FALSE,                          /* halt on reset */
328   "screen",                       /* the screen operated on */
329   10000000,                       /* pixel clock */
330   1,                              /* pixels per clock */
331   NULL,                           /* scanline callback (indexed16) */
332   xtheball_scanline_update,       /* scanline callback (rgb32) */
333   NULL,                           /* generate interrupt */
334   xtheball_to_shiftreg,           /* write to shiftreg function */
335   xtheball_from_shiftreg          /* read from shiftreg function */
336};
337
338
339
340/*************************************
341 *
342320 *  Machine drivers
343321 *
344322 *************************************/
r32352r32353
346324static MACHINE_CONFIG_START( xtheball, xtheball_state )
347325
348326   MCFG_CPU_ADD("maincpu", TMS34010, 40000000)
349   MCFG_TMS340X0_CONFIG(tms_config)
350327   MCFG_CPU_PROGRAM_MAP(main_map)
328   MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
329   MCFG_TMS340X0_PIXEL_CLOCK(10000000) /* pixel clock */
330   MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */   
331   MCFG_TMS340X0_SCANLINE_RGB32_CB(xtheball_state, scanline_update)     /* scanline updater (rgb32) */
332   MCFG_TMS340X0_TO_SHIFTREG_CB(xtheball_state, to_shiftreg)  /* write to shiftreg function */
333   MCFG_TMS340X0_FROM_SHIFTREG_CB(xtheball_state, from_shiftreg) /* read from shiftreg function */
351334   MCFG_CPU_PERIODIC_INT_DRIVER(xtheball_state, irq1_line_hold,  15000)
352335
353336   MCFG_NVRAM_ADD_1FILL("nvram")
trunk/src/mame/machine/harddriv.c
r32352r32353
118118}
119119
120120
121void hdgsp_irq_gen(device_t *device, int irqstate)
121WRITE_LINE_MEMBER(harddriv_state::hdgsp_irq_gen)
122122{
123   harddriv_state *state = device->machine().driver_data<harddriv_state>();
124   state->m_gsp_irq_state = irqstate;
125   state->update_interrupts();
123   m_gsp_irq_state = state;
124   update_interrupts();
126125}
127126
128127
129void hdmsp_irq_gen(device_t *device, int irqstate)
128WRITE_LINE_MEMBER(harddriv_state::hdmsp_irq_gen)
130129{
131   harddriv_state *state = device->machine().driver_data<harddriv_state>();
132   state->m_msp_irq_state = irqstate;
133   state->update_interrupts();
130   m_msp_irq_state = state;
131   update_interrupts();
134132}
135133
136134
trunk/src/mame/machine/inder_vid.c
r32352r32353
3333ADDRESS_MAP_END
3434
3535
36static void megaphx_scanline(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params)
36TMS340X0_SCANLINE_RGB32_CB_MEMBER(inder_vid_device::scanline)
3737{
38   inder_vid_device *state = (inder_vid_device*)screen.machine().device("inder_vid");
39
40   UINT16 *vram = &state->m_vram[(params->rowaddr << 8) & 0x3ff00];
38   UINT16 *vram = &m_vram[(params->rowaddr << 8) & 0x3ff00];
4139   UINT32 *dest = &bitmap.pix32(scanline);
4240
43   const pen_t *paldata = state->m_palette->pens();
41   const pen_t *paldata = m_palette->pens();
4442
4543   int coladdr = params->coladdr;
4644   int x;
r32352r32353
5553}
5654
5755
58static void megaphx_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
56TMS340X0_TO_SHIFTREG_CB_MEMBER(inder_vid_device::to_shiftreg)
5957{
60   inder_vid_device *state = (inder_vid_device*)space.machine().device("inder_vid");
61
62   if (state->m_shiftfull == 0)
58   if (m_shiftfull == 0)
6359   {
6460      //printf("read to shift regs address %08x (%08x)\n", address, TOWORD(address) * 2);
6561
66      memcpy(shiftreg, &state->m_vram[TOWORD(address) & ~TOWORD(0x1fff)], TOBYTE(0x2000)); // & ~TOWORD(0x1fff) is needed for round 6
67      state->m_shiftfull = 1;
62      memcpy(shiftreg, &m_vram[TOWORD(address) & ~TOWORD(0x1fff)], TOBYTE(0x2000)); // & ~TOWORD(0x1fff) is needed for round 6
63      m_shiftfull = 1;
6864   }
6965}
7066
71static void megaphx_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
67TMS340X0_FROM_SHIFTREG_CB_MEMBER(inder_vid_device::from_shiftreg)
7268{
7369//  printf("write from shift regs address %08x (%08x)\n", address, TOWORD(address) * 2);
7470
75   inder_vid_device *state = (inder_vid_device*)space.machine().device("inder_vid");
71   memcpy(&m_vram[TOWORD(address) & ~TOWORD(0x1fff)], shiftreg, TOBYTE(0x2000));
7672
77   memcpy(&state->m_vram[TOWORD(address) & ~TOWORD(0x1fff)], shiftreg, TOBYTE(0x2000));
78
79   state->m_shiftfull = 0;
73   m_shiftfull = 0;
8074}
8175
82
83
84static void m68k_gen_int(device_t *device, int state)
76WRITE_LINE_MEMBER(inder_vid_device::m68k_gen_int)
8577{
86   cpu_device *maincpu = (cpu_device*)device->machine().device("maincpu");
78   cpu_device *maincpu = (cpu_device*)machine().device("maincpu");
8779   if (state) maincpu->set_input_line(4, ASSERT_LINE);
8880   else maincpu->set_input_line(4, CLEAR_LINE);
89
9081}
9182
9283
93static const tms340x0_config tms_config_megaphx =
94{
95   TRUE,                          /* halt on reset */
96   "inder_vid:inder_screen",                       /* the screen operated on */
97   XTAL_40MHz/12,                   /* pixel clock */
98   2,                              /* pixels per clock */
99   NULL,                           /* scanline callback (indexed16) */
100   megaphx_scanline,              /* scanline callback (rgb32) */
101   m68k_gen_int,                   /* generate interrupt */
102   megaphx_to_shiftreg,           /* write to shiftreg function */
103   megaphx_from_shiftreg          /* read from shiftreg function */
104};
105
106
10784static ADDRESS_MAP_START( ramdac_map, AS_0, 8, inder_vid_device )
10885   AM_RANGE(0x000, 0x3ff) AM_DEVREADWRITE("ramdac",ramdac_device,ramdac_pal_r,ramdac_rgb888_w)
10986ADDRESS_MAP_END
11087
11188static MACHINE_CONFIG_FRAGMENT( inder_vid )
11289   MCFG_CPU_ADD("tms", TMS34010, XTAL_40MHz)
113   MCFG_TMS340X0_CONFIG(tms_config_megaphx)
11490   MCFG_CPU_PROGRAM_MAP(megaphx_tms_map)
91   MCFG_TMS340X0_HALT_ON_RESET(TRUE) /* halt on reset */
92   MCFG_TMS340X0_PIXEL_CLOCK(XTAL_40MHz/12) /* pixel clock */
93   MCFG_TMS340X0_PIXELS_PER_CLOCK(2) /* pixels per clock */   
94   MCFG_TMS340X0_SCANLINE_RGB32_CB(inder_vid_device, scanline)     /* scanline updater (RGB32) */
95   MCFG_TMS340X0_OUTPUT_INT_CB(WRITELINE(inder_vid_device, m68k_gen_int))
96   MCFG_TMS340X0_TO_SHIFTREG_CB(inder_vid_device, to_shiftreg)  /* write to shiftreg function */
97   MCFG_TMS340X0_FROM_SHIFTREG_CB(inder_vid_device, from_shiftreg) /* read from shiftreg function */
11598
11699   MCFG_SCREEN_ADD("inder_screen", RASTER)
117100   MCFG_SCREEN_RAW_PARAMS(XTAL_40MHz/12, 424, 0, 338-1, 262, 0, 246-1)
trunk/src/mame/machine/inder_vid.h
r32352r32353
2929   required_shared_ptr<UINT16> m_vram;
3030   required_device<palette_device> m_palette;
3131   required_device<tms34010_device> m_tms;
32   
33   DECLARE_WRITE_LINE_MEMBER(m68k_gen_int);
3234
3335   int m_shiftfull; // this might be a driver specific hack for a TMS bug.
36   TMS340X0_TO_SHIFTREG_CB_MEMBER(to_shiftreg);
37   TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg);
38   TMS340X0_SCANLINE_RGB32_CB_MEMBER(scanline);
3439
3540protected:
3641   virtual machine_config_constructor device_mconfig_additions() const;
3742   virtual void device_start();
3843   virtual void device_reset();
39
40
41
44   
4245private:
43
44
4546};
4647
4748#endif
trunk/src/mame/machine/midtunit.c
r32352r32353
396396
397397
398398   /* default graphics functionality */
399   midtunit_gfx_rom_large = 0;
399   m_gfx_rom_large = 0;
400400}
401401
402402
r32352r32353
500500{
501501   /* common init */
502502   init_tunit_generic(SOUND_DCS);
503   midtunit_gfx_rom_large = 1;
503   m_gfx_rom_large = 1;
504504
505505   /* protection */
506506   m_maincpu->space(AS_PROGRAM).install_write_handler(0x00f20c60, 0x00f20c7f, write16_delegate(FUNC(midtunit_state::mk2_prot_w),this));
trunk/src/mame/includes/micro3d.h
r32352r32353
137137   DECLARE_READ8_MEMBER(duart_input_r);
138138   DECLARE_WRITE8_MEMBER(duart_output_w);
139139   DECLARE_WRITE_LINE_MEMBER(duart_txb);
140   DECLARE_WRITE_LINE_MEMBER(tms_interrupt);
141   TMS340X0_SCANLINE_IND16_CB_MEMBER(scanline_update);
140142
141143   required_device<cpu_device> m_maincpu;
142144   required_device<i8051_device> m_audiocpu;
r32352r32353
220222};
221223
222224extern const device_type MICRO3D;
223
224/*----------- defined in video/micro3d.c -----------*/
225void micro3d_tms_interrupt(device_t *device, int state);
226void micro3d_scanline_update(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params);
trunk/src/mame/includes/metalmx.h
r32352r32353
4949   DECLARE_WRITE32_MEMBER(timer_w);
5050   DECLARE_DRIVER_INIT(metalmx);
5151   DECLARE_WRITE8_MEMBER(cage_irq_callback);
52   DECLARE_WRITE_LINE_MEMBER(tms_interrupt);
5253   virtual void machine_reset();
5354   virtual void video_start();
5455   UINT32 screen_update_metalmx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
trunk/src/mame/includes/midyunit.h
r32352r32353
9999   DECLARE_CUSTOM_INPUT_MEMBER(narc_talkback_data_r);
100100   DECLARE_CUSTOM_INPUT_MEMBER(adpcm_irq_state_r);
101101   DECLARE_WRITE8_MEMBER(yawdim_oki_bank_w);
102   TMS340X0_TO_SHIFTREG_CB_MEMBER(to_shiftreg);
103   TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg);
104   TMS340X0_SCANLINE_IND16_CB_MEMBER(scanline_update);
102105   DECLARE_DRIVER_INIT(smashtv);
103106   DECLARE_DRIVER_INIT(strkforc);
104107   DECLARE_DRIVER_INIT(narc);
r32352r32353
129132protected:
130133   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
131134};
132
133/*----------- defined in video/midyunit.c -----------*/
134void midyunit_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
135void midyunit_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
136void midyunit_scanline_update(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params);
trunk/src/mame/includes/artmagic.h
r32352r32353
5858   DECLARE_READ16_MEMBER(unk_r);
5959   DECLARE_READ16_MEMBER(artmagic_blitter_r);
6060   DECLARE_WRITE16_MEMBER(artmagic_blitter_w);
61   DECLARE_WRITE_LINE_MEMBER(m68k_gen_int);
62   TMS340X0_TO_SHIFTREG_CB_MEMBER(to_shiftreg);
63   TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg);
64   TMS340X0_SCANLINE_RGB32_CB_MEMBER(scanline);
6165   DECLARE_CUSTOM_INPUT_MEMBER(prot_r);
6266   DECLARE_DRIVER_INIT(shtstar);
6367   DECLARE_DRIVER_INIT(cheesech);
r32352r32353
6973   void decrypt_cheesech();
7074   void decrypt_ultennis();
7175   void execute_blit();
76   void update_irq_state();
7277   inline UINT16 *address_to_vram(offs_t *address);
7378   
7479protected:
7580   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
7681};
77
78
79/*----------- defined in video/artmagic.c -----------*/
80void artmagic_to_shiftreg(address_space &space, offs_t address, UINT16 *data);
81void artmagic_from_shiftreg(address_space &space, offs_t address, UINT16 *data);
82void artmagic_scanline(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params);
trunk/src/mame/includes/coolpool.h
r32352r32353
6161   DECLARE_WRITE16_MEMBER(dsp_romaddr_w);
6262   DECLARE_READ16_MEMBER(coolpool_input_r);
6363   DECLARE_WRITE16_MEMBER(dsp_dac_w);
64   TMS340X0_TO_SHIFTREG_CB_MEMBER(to_shiftreg);
65   TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg);
66   TMS340X0_SCANLINE_RGB32_CB_MEMBER(amerdart_scanline);
67   TMS340X0_SCANLINE_RGB32_CB_MEMBER(coolpool_scanline);
6468   DECLARE_DRIVER_INIT(coolpool);
6569   DECLARE_DRIVER_INIT(amerdart);
6670   DECLARE_DRIVER_INIT(9ballsht);
trunk/src/mame/includes/midtunit.h
r32352r32353
6666   DECLARE_READ16_MEMBER(midxunit_paletteram_r);
6767   DECLARE_READ16_MEMBER(midtunit_dma_r);
6868   DECLARE_WRITE16_MEMBER(midtunit_dma_w);
69   TMS340X0_TO_SHIFTREG_CB_MEMBER(to_shiftreg);
70   TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg);
71   TMS340X0_SCANLINE_IND16_CB_MEMBER(scanline_update);
6972   DECLARE_DRIVER_INIT(mktunit);
7073   DECLARE_DRIVER_INIT(mkturbo);
7174   DECLARE_DRIVER_INIT(nbajamte);
r32352r32353
101104   const UINT8 *jdredd_prot_table;
102105   UINT8    jdredd_prot_index;
103106   UINT8    jdredd_prot_max;
107   
108   UINT8 m_gfx_rom_large;
104109
105110protected:
106111   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
107112};
108
109
110/*----------- defined in video/midtunit.c -----------*/
111extern UINT8 midtunit_gfx_rom_large;
112
113void midtunit_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
114void midtunit_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
115
116void midtunit_scanline_update(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params);
117void midxunit_scanline_update(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params);
trunk/src/mame/includes/jpmimpct.h
r32352r32353
106106   DECLARE_READ8_MEMBER(hopper_c_r);
107107   DECLARE_WRITE8_MEMBER(payen_a_w);
108108   DECLARE_WRITE8_MEMBER(display_c_w);
109
109   
110   DECLARE_WRITE_LINE_MEMBER(tms_irq);
111   TMS340X0_TO_SHIFTREG_CB_MEMBER(to_shiftreg);
112   TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg);
113   TMS340X0_SCANLINE_RGB32_CB_MEMBER(scanline_update);
114   
110115   DECLARE_MACHINE_START(jpmimpct);
111116   DECLARE_MACHINE_RESET(jpmimpct);
112117   DECLARE_VIDEO_START(jpmimpct);
r32352r32353
119124   optional_device<palette_device> m_palette;
120125   optional_device<tms34010_device> m_dsp;
121126};
122
123
124/*----------- defined in video/jpmimpct.c -----------*/
125void jpmimpct_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
126void jpmimpct_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
127void jpmimpct_scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params);
trunk/src/mame/includes/exterm.h
r32352r32353
4444   DECLARE_PALETTE_INIT(exterm);
4545   TIMER_CALLBACK_MEMBER(sound_delayed_w);
4646   TIMER_DEVICE_CALLBACK_MEMBER(master_sound_nmi_callback);
47   TMS340X0_SCANLINE_IND16_CB_MEMBER(scanline_update);
48   TMS340X0_TO_SHIFTREG_CB_MEMBER(to_shiftreg_master);
49   TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg_master);
50   TMS340X0_TO_SHIFTREG_CB_MEMBER(to_shiftreg_slave);
51   TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg_slave);
4752   required_device<cpu_device> m_maincpu;
4853   required_device<cpu_device> m_audiocpu;
4954   required_device<cpu_device> m_audioslave;
5055   required_device<tms34010_device> m_slave;
5156   required_device<dac_device> m_dac;
5257};
53
54/*----------- defined in video/exterm.c -----------*/
55void exterm_scanline_update(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params);
56
57void exterm_to_shiftreg_master(address_space &space, UINT32 address, UINT16* shiftreg);
58void exterm_from_shiftreg_master(address_space &space, UINT32 address, UINT16* shiftreg);
59void exterm_to_shiftreg_slave(address_space &space, UINT32 address, UINT16* shiftreg);
60void exterm_from_shiftreg_slave(address_space &space, UINT32 address, UINT16* shiftreg);
trunk/src/mame/includes/lethalj.h
r32352r32353
1919      m_maincpu(*this, "maincpu"),
2020      m_screen(*this, "screen") { }
2121
22   required_device<cpu_device> m_maincpu;
23   required_device<screen_device> m_screen;
2224   UINT16 m_blitter_data[8];
2325   UINT16 *m_screenram;
2426   UINT8 m_vispage;
r32352r32353
3941   DECLARE_DRIVER_INIT(cclownz);
4042   virtual void video_start();
4143   inline void get_crosshair_xy(int player, int *x, int *y);
42   required_device<cpu_device> m_maincpu;
43   required_device<screen_device> m_screen;
44   TMS340X0_SCANLINE_IND16_CB_MEMBER(scanline_update);
4445
4546protected:
4647   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
trunk/src/mame/includes/harddriv.h
r32352r32353
331331   DECLARE_WRITE16_MEMBER( hdgsp_io_w );
332332
333333   DECLARE_WRITE16_MEMBER( hdgsp_protection_w );
334   
335   DECLARE_WRITE_LINE_MEMBER( hdgsp_irq_gen );
336   DECLARE_WRITE_LINE_MEMBER( hdmsp_irq_gen );
334337
335338   /* ADSP board */
336339   DECLARE_READ16_MEMBER( hd68k_adsp_program_r );
r32352r32353
436439   DECLARE_READ32_MEMBER(hdds3xdsp_serial_rx_callback);
437440
438441   /*----------- defined in video/harddriv.c -----------*/
442   TMS340X0_TO_SHIFTREG_CB_MEMBER(hdgsp_write_to_shiftreg);
443   TMS340X0_FROM_SHIFTREG_CB_MEMBER(hdgsp_read_from_shiftreg);
444   
445   void update_palette_bank(int newbank);
446   
439447   DECLARE_READ16_MEMBER( hdgsp_control_lo_r );
440448   DECLARE_WRITE16_MEMBER( hdgsp_control_lo_w );
441449   DECLARE_READ16_MEMBER( hdgsp_control_hi_r );
r32352r32353
456464   /* DS III/IV board */
457465   TIMER_DEVICE_CALLBACK_MEMBER( ds3sdsp_internal_timer_callback );
458466   TIMER_DEVICE_CALLBACK_MEMBER( ds3xdsp_internal_timer_callback );
459
467   
468   TMS340X0_SCANLINE_IND16_CB_MEMBER(scanline_driver);
469   TMS340X0_SCANLINE_IND16_CB_MEMBER(scanline_multisync);
460470};
461
462
463/*----------- defined in machine/harddriv.c -----------*/
464
465/* Driver/Multisync board */
466void hdgsp_irq_gen(device_t *device, int state);
467void hdmsp_irq_gen(device_t *device, int state);
468
469
470
471/*----------- defined in video/harddriv.c -----------*/
472
473void hdgsp_write_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
474void hdgsp_read_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
475
476void harddriv_scanline_driver(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params);
477void harddriv_scanline_multisync(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params);
trunk/src/mame/includes/btoads.h
r32352r32353
6161   DECLARE_READ16_MEMBER( vram_fg_display_r );
6262   DECLARE_READ16_MEMBER( vram_fg_draw_r );
6363   void render_sprite_row(UINT16 *sprite_source, UINT32 address);
64   void to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
65   static void static_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg) { space.machine().driver_data<btoads_state>()->to_shiftreg(space, address, shiftreg); }
66   void from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
67   static void static_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg) { space.machine().driver_data<btoads_state>()->from_shiftreg(space, address, shiftreg); }
68   void scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params);
69   static void static_scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params) { screen.machine().driver_data<btoads_state>()->scanline_update(screen, bitmap, scanline, params); }
64   TMS340X0_TO_SHIFTREG_CB_MEMBER(to_shiftreg);
65   TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg);
66   TMS340X0_SCANLINE_RGB32_CB_MEMBER(scanline_update);
7067
7168protected:
7269   // device overrides
trunk/src/mame/includes/midxunit.h
r32352r32353
4545   DECLARE_MACHINE_RESET(midxunit);
4646   DECLARE_VIDEO_START(midxunit);
4747   void register_state_saving();
48   TMS340X0_SCANLINE_IND16_CB_MEMBER(scanline_update);
4849};
trunk/src/mame/video/btoads.c
r32352r32353
259259 *
260260 *************************************/
261261
262void btoads_state::to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
262TMS340X0_TO_SHIFTREG_CB_MEMBER(btoads_state::to_shiftreg)
263263{
264264   address &= ~0x40000000;
265265
r32352r32353
286286}
287287
288288
289void btoads_state::from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
289TMS340X0_FROM_SHIFTREG_CB_MEMBER(btoads_state::from_shiftreg)
290290{
291291   address &= ~0x40000000;
292292
r32352r32353
318318 *
319319 *************************************/
320320
321void btoads_state::scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params)
321TMS340X0_SCANLINE_RGB32_CB_MEMBER(btoads_state::scanline_update)
322322{
323323   UINT32 fulladdr = ((params->rowaddr << 16) | params->coladdr) >> 4;
324324   UINT16 *bg0_base = &m_vram_bg0[(fulladdr + (m_yscroll0 << 10)) & 0x3fc00];
trunk/src/mame/video/jpmimpct.c
r32352r32353
8686 *
8787 *************************************/
8888
89void jpmimpct_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
89TMS340X0_TO_SHIFTREG_CB_MEMBER(jpmimpct_state::to_shiftreg)
9090{
91   jpmimpct_state *state = space.machine().driver_data<jpmimpct_state>();
92   memcpy(shiftreg, &state->m_vram[TOWORD(address)], 512 * sizeof(UINT16));
91   memcpy(shiftreg, &m_vram[TOWORD(address)], 512 * sizeof(UINT16));
9392}
9493
95void jpmimpct_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
94TMS340X0_FROM_SHIFTREG_CB_MEMBER(jpmimpct_state::from_shiftreg)
9695{
97   jpmimpct_state *state = space.machine().driver_data<jpmimpct_state>();
98   memcpy(&state->m_vram[TOWORD(address)], shiftreg, 512 * sizeof(UINT16));
96   memcpy(&m_vram[TOWORD(address)], shiftreg, 512 * sizeof(UINT16));
9997}
10098
10199
r32352r32353
105103 *
106104 *************************************/
107105
108void jpmimpct_scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params)
106TMS340X0_SCANLINE_RGB32_CB_MEMBER(jpmimpct_state::scanline_update)
109107{
110   jpmimpct_state *state = screen.machine().driver_data<jpmimpct_state>();
111   UINT16 *vram = &state->m_vram[(params->rowaddr << 8) & 0x3ff00];
108   UINT16 *vram = &m_vram[(params->rowaddr << 8) & 0x3ff00];
112109   UINT32 *dest = &bitmap.pix32(scanline);
113110   int coladdr = params->coladdr;
114111   int x;
r32352r32353
116113   for (x = params->heblnk; x < params->hsblnk; x += 2)
117114   {
118115      UINT16 pixels = vram[coladdr++ & 0xff];
119      dest[x + 0] = state->m_palette->pen(pixels & 0xff);
120      dest[x + 1] = state->m_palette->pen(pixels >> 8);
116      dest[x + 0] = m_palette->pen(pixels & 0xff);
117      dest[x + 1] = m_palette->pen(pixels >> 8);
121118   }
122119}
123120
trunk/src/mame/video/lethalj.c
r32352r32353
178178 *
179179 *************************************/
180180
181void lethalj_scanline_update(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params)
181TMS340X0_SCANLINE_IND16_CB_MEMBER(lethalj_state::scanline_update)
182182{
183   lethalj_state *state = screen.machine().driver_data<lethalj_state>();
184   UINT16 *src = &state->m_screenram[(state->m_vispage << 17) | ((params->rowaddr << 9) & 0x3fe00)];
183   UINT16 *src = &m_screenram[(m_vispage << 17) | ((params->rowaddr << 9) & 0x3fe00)];
185184   UINT16 *dest = &bitmap.pix16(scanline);
186185   int coladdr = params->coladdr << 1;
187186   int x;
188187
189188   /* blank palette: fill with white */
190   if (state->m_blank_palette)
189   if (m_blank_palette)
191190   {
192191      for (x = params->heblnk; x < params->hsblnk; x++)
193192         dest[x] = 0x7fff;
194193      if (scanline == screen.visible_area().max_y)
195         state->m_blank_palette = 0;
194         m_blank_palette = 0;
196195      return;
197196   }
198197
trunk/src/mame/video/harddriv.c
r32352r32353
9797 *
9898 *************************************/
9999
100void hdgsp_write_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
100TMS340X0_TO_SHIFTREG_CB_MEMBER(harddriv_state::hdgsp_write_to_shiftreg)
101101{
102   harddriv_state *state = space.machine().driver_data<harddriv_state>();
103
104102   /* access to the 1bpp/2bpp area */
105103   if (address >= 0x02000000 && address <= 0x020fffff)
106104   {
107105      address -= 0x02000000;
108      address >>= state->m_gsp_multisync;
109      address &= state->m_vram_mask;
110      address &= ~((512*8 >> state->m_gsp_multisync) - 1);
111      state->m_gsp_shiftreg_source = &state->m_gsp_vram[address];
106      address >>= m_gsp_multisync;
107      address &= m_vram_mask;
108      address &= ~((512*8 >> m_gsp_multisync) - 1);
109      m_gsp_shiftreg_source = &m_gsp_vram[address];
112110   }
113111
114112   /* access to normal VRAM area */
r32352r32353
116114   {
117115      address -= 0xff800000;
118116      address /= 8;
119      address &= state->m_vram_mask;
117      address &= m_vram_mask;
120118      address &= ~511;
121      state->m_gsp_shiftreg_source = &state->m_gsp_vram[address];
119      m_gsp_shiftreg_source = &m_gsp_vram[address];
122120   }
123121   else
124122      logerror("Unknown shiftreg write %08X\n", address);
125123}
126124
127125
128void hdgsp_read_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
126TMS340X0_FROM_SHIFTREG_CB_MEMBER(harddriv_state::hdgsp_read_from_shiftreg)
129127{
130   harddriv_state *state = space.machine().driver_data<harddriv_state>();
131
132   if (!state->m_shiftreg_enable)
128   if (!m_shiftreg_enable)
133129      return;
134130
135131   /* access to the 1bpp/2bpp area */
136132   if (address >= 0x02000000 && address <= 0x020fffff)
137133   {
138134      address -= 0x02000000;
139      address >>= state->m_gsp_multisync;
140      address &= state->m_vram_mask;
141      address &= ~((512*8 >> state->m_gsp_multisync) - 1);
142      memmove(&state->m_gsp_vram[address], state->m_gsp_shiftreg_source, 512*8 >> state->m_gsp_multisync);
135      address >>= m_gsp_multisync;
136      address &= m_vram_mask;
137      address &= ~((512*8 >> m_gsp_multisync) - 1);
138      memmove(&m_gsp_vram[address], m_gsp_shiftreg_source, 512*8 >> m_gsp_multisync);
143139   }
144140
145141   /* access to normal VRAM area */
r32352r32353
147143   {
148144      address -= 0xff800000;
149145      address /= 8;
150      address &= state->m_vram_mask;
146      address &= m_vram_mask;
151147      address &= ~511;
152      memmove(&state->m_gsp_vram[address], state->m_gsp_shiftreg_source, 512);
148      memmove(&m_gsp_vram[address], m_gsp_shiftreg_source, 512);
153149   }
154150   else
155151      logerror("Unknown shiftreg read %08X\n", address);
r32352r32353
163159 *
164160 *************************************/
165161
166static void update_palette_bank(running_machine &machine, int newbank)
162void harddriv_state::update_palette_bank(int newbank)
167163{
168   harddriv_state *state = machine.driver_data<harddriv_state>();
169   machine.first_screen()->update_partial(machine.first_screen()->vpos());
170   state->m_gfx_palettebank = newbank;
164   m_screen->update_partial(m_screen->vpos());
165   m_gfx_palettebank = newbank;
171166}
172167
173168
r32352r32353
233228         break;
234229
235230      case 0x02:
236         update_palette_bank(space.machine(), (m_gfx_palettebank & ~1) | val);
231         update_palette_bank((m_gfx_palettebank & ~1) | val);
237232         break;
238233
239234      case 0x03:
240         update_palette_bank(space.machine(), (m_gfx_palettebank & ~2) | (val << 1));
235         update_palette_bank((m_gfx_palettebank & ~2) | (val << 1));
241236         break;
242237
243238      case 0x04:
244239         if (m_palette->entries() >= 256 * 8)
245            update_palette_bank(space.machine(), (m_gfx_palettebank & ~4) | (val << 2));
240            update_palette_bank((m_gfx_palettebank & ~4) | (val << 2));
246241         break;
247242
248243      case 0x07:
r32352r32353
410405}
411406
412407
413void harddriv_scanline_driver(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params)
408TMS340X0_SCANLINE_IND16_CB_MEMBER(harddriv_state::scanline_driver)
414409{
415   harddriv_state *state = screen.machine().driver_data<harddriv_state>();
416   UINT8 *vram_base = &state->m_gsp_vram[(params->rowaddr << 12) & state->m_vram_mask];
410   UINT8 *vram_base = &m_gsp_vram[(params->rowaddr << 12) & m_vram_mask];
417411   UINT16 *dest = &bitmap.pix16(scanline);
418   int coladdr = (params->yoffset << 9) + ((params->coladdr & 0xff) << 4) - 15 + (state->m_gfx_finescroll & 0x0f);
412   int coladdr = (params->yoffset << 9) + ((params->coladdr & 0xff) << 4) - 15 + (m_gfx_finescroll & 0x0f);
419413   int x;
420414
421415   for (x = params->heblnk; x < params->hsblnk; x++)
422      dest[x] = state->m_gfx_palettebank * 256 + vram_base[BYTE_XOR_LE(coladdr++ & 0xfff)];
416      dest[x] = m_gfx_palettebank * 256 + vram_base[BYTE_XOR_LE(coladdr++ & 0xfff)];
423417
424418   if (scanline == screen.visible_area().max_y)
425419      display_speedups();
426420}
427421
428422
429void harddriv_scanline_multisync(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params)
423TMS340X0_SCANLINE_IND16_CB_MEMBER(harddriv_state::scanline_multisync)
430424{
431   harddriv_state *state = screen.machine().driver_data<harddriv_state>();
432   UINT8 *vram_base = &state->m_gsp_vram[(params->rowaddr << 11) & state->m_vram_mask];
425   UINT8 *vram_base = &m_gsp_vram[(params->rowaddr << 11) & m_vram_mask];
433426   UINT16 *dest = &bitmap.pix16(scanline);
434   int coladdr = (params->yoffset << 9) + ((params->coladdr & 0xff) << 3) - 7 + (state->m_gfx_finescroll & 0x07);
427   int coladdr = (params->yoffset << 9) + ((params->coladdr & 0xff) << 3) - 7 + (m_gfx_finescroll & 0x07);
435428   int x;
436429
437430   for (x = params->heblnk; x < params->hsblnk; x++)
438      dest[x] = state->m_gfx_palettebank * 256 + vram_base[BYTE_XOR_LE(coladdr++ & 0x7ff)];
431      dest[x] = m_gfx_palettebank * 256 + vram_base[BYTE_XOR_LE(coladdr++ & 0x7ff)];
439432
440433   if (scanline == screen.visible_area().max_y)
441434      display_speedups();
trunk/src/mame/video/exterm.c
r32352r32353
3232 *
3333 *************************************/
3434
35void exterm_to_shiftreg_master(address_space &space, UINT32 address, UINT16 *shiftreg)
35TMS340X0_TO_SHIFTREG_CB_MEMBER(exterm_state::to_shiftreg_master)
3636{
37   exterm_state *state = space.machine().driver_data<exterm_state>();
38   memcpy(shiftreg, &state->m_master_videoram[TOWORD(address)], 256 * sizeof(UINT16));
37   memcpy(shiftreg, &m_master_videoram[TOWORD(address)], 256 * sizeof(UINT16));
3938}
4039
4140
42void exterm_from_shiftreg_master(address_space &space, UINT32 address, UINT16 *shiftreg)
41TMS340X0_FROM_SHIFTREG_CB_MEMBER(exterm_state::from_shiftreg_master)
4342{
44   exterm_state *state = space.machine().driver_data<exterm_state>();
45   memcpy(&state->m_master_videoram[TOWORD(address)], shiftreg, 256 * sizeof(UINT16));
43   memcpy(&m_master_videoram[TOWORD(address)], shiftreg, 256 * sizeof(UINT16));
4644}
4745
4846
49void exterm_to_shiftreg_slave(address_space &space, UINT32 address, UINT16 *shiftreg)
47TMS340X0_TO_SHIFTREG_CB_MEMBER(exterm_state::to_shiftreg_slave)
5048{
51   exterm_state *state = space.machine().driver_data<exterm_state>();
52   memcpy(shiftreg, &state->m_slave_videoram[TOWORD(address)], 256 * 2 * sizeof(UINT8));
49   memcpy(shiftreg, &m_slave_videoram[TOWORD(address)], 256 * 2 * sizeof(UINT8));
5350}
5451
5552
56void exterm_from_shiftreg_slave(address_space &space, UINT32 address, UINT16 *shiftreg)
53TMS340X0_FROM_SHIFTREG_CB_MEMBER(exterm_state::from_shiftreg_slave)
5754{
58   exterm_state *state = space.machine().driver_data<exterm_state>();
59   memcpy(&state->m_slave_videoram[TOWORD(address)], shiftreg, 256 * 2 * sizeof(UINT8));
55   memcpy(&m_slave_videoram[TOWORD(address)], shiftreg, 256 * 2 * sizeof(UINT8));
6056}
6157
6258
r32352r32353
6763 *
6864 *************************************/
6965
70void exterm_scanline_update(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params)
66TMS340X0_SCANLINE_IND16_CB_MEMBER(exterm_state::scanline_update)
7167{
72   exterm_state *state = screen.machine().driver_data<exterm_state>();
73   UINT16 *bgsrc = &state->m_master_videoram[(params->rowaddr << 8) & 0xff00];
68   UINT16 *bgsrc = &m_master_videoram[(params->rowaddr << 8) & 0xff00];
7469   UINT16 *fgsrc = NULL;
7570   UINT16 *dest = &bitmap.pix16(scanline);
7671   tms34010_display_params fgparams;
r32352r32353
7974   int x;
8075
8176   /* get parameters for the slave CPU */
82   state->m_slave->get_display_params(&fgparams);
77   m_slave->get_display_params(&fgparams);
8378
8479   /* compute info about the slave vram */
8580   if (fgparams.enabled && scanline >= fgparams.veblnk && scanline < fgparams.vsblnk && fgparams.heblnk < fgparams.hsblnk)
8681   {
87      fgsrc = &state->m_slave_videoram[((fgparams.rowaddr << 8) + (fgparams.yoffset << 7)) & 0xff80];
82      fgsrc = &m_slave_videoram[((fgparams.rowaddr << 8) + (fgparams.yoffset << 7)) & 0xff80];
8883      fgcoladdr = (fgparams.coladdr >> 1);
8984   }
9085
trunk/src/mame/video/midyunit.c
r32352r32353
171171 *
172172 *************************************/
173173
174void midyunit_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
174TMS340X0_TO_SHIFTREG_CB_MEMBER(midyunit_state::to_shiftreg)
175175{
176   midyunit_state *state = space.machine().driver_data<midyunit_state>();
177   memcpy(shiftreg, &state->m_local_videoram[address >> 3], 2 * 512 * sizeof(UINT16));
176   memcpy(shiftreg, &m_local_videoram[address >> 3], 2 * 512 * sizeof(UINT16));
178177}
179178
180179
181void midyunit_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
180TMS340X0_FROM_SHIFTREG_CB_MEMBER(midyunit_state::from_shiftreg)
182181{
183   midyunit_state *state = space.machine().driver_data<midyunit_state>();
184   memcpy(&state->m_local_videoram[address >> 3], shiftreg, 2 * 512 * sizeof(UINT16));
182   memcpy(&m_local_videoram[address >> 3], shiftreg, 2 * 512 * sizeof(UINT16));
185183}
186184
187185
r32352r32353
552550}
553551
554552
555void midyunit_scanline_update(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params)
553TMS340X0_SCANLINE_IND16_CB_MEMBER(midyunit_state::scanline_update)
556554{
557   midyunit_state *state = screen.machine().driver_data<midyunit_state>();
558   UINT16 *src = &state->m_local_videoram[(params->rowaddr << 9) & 0x3fe00];
555   UINT16 *src = &m_local_videoram[(params->rowaddr << 9) & 0x3fe00];
559556   UINT16 *dest = &bitmap.pix16(scanline);
560557   int coladdr = params->coladdr << 1;
561558   int x;
562559
563560   /* adjust the display address to account for ignored bits */
564561   for (x = params->heblnk; x < params->hsblnk; x++)
565      dest[x] = state->m_pen_map[src[coladdr++ & 0x1ff]];
562      dest[x] = m_pen_map[src[coladdr++ & 0x1ff]];
566563
567564   /* handle autoerase on the previous line */
568   state->autoerase_line(NULL, params->rowaddr - 1);
565   autoerase_line(NULL, params->rowaddr - 1);
569566
570567   /* if this is the last update of the screen, set a timer to clear out the final line */
571568   /* (since we update one behind) */
572569   if (scanline == screen.visible_area().max_y)
573      state->timer_set(screen.time_until_pos(scanline + 1), midyunit_state::TIMER_AUTOERASE_LINE, params->rowaddr);
570      timer_set(screen.time_until_pos(scanline + 1), midyunit_state::TIMER_AUTOERASE_LINE, params->rowaddr);
574571}
trunk/src/mame/video/artmagic.c
r32352r32353
5959 *
6060 *************************************/
6161
62void artmagic_to_shiftreg(address_space &space, offs_t address, UINT16 *data)
62TMS340X0_TO_SHIFTREG_CB_MEMBER(artmagic_state::to_shiftreg)
6363{
64   artmagic_state *state = space.machine().driver_data<artmagic_state>();
65   UINT16 *vram = state->address_to_vram(&address);
64   UINT16 *vram = address_to_vram(&address);
6665   if (vram)
67      memcpy(data, &vram[address], TOBYTE(0x2000));
66      memcpy(shiftreg, &vram[address], TOBYTE(0x2000));
6867}
6968
7069
71void artmagic_from_shiftreg(address_space &space, offs_t address, UINT16 *data)
70TMS340X0_FROM_SHIFTREG_CB_MEMBER(artmagic_state::from_shiftreg)
7271{
73   artmagic_state *state = space.machine().driver_data<artmagic_state>();
74   UINT16 *vram = state->address_to_vram(&address);
72   UINT16 *vram = address_to_vram(&address);
7573   if (vram)
76      memcpy(&vram[address], data, TOBYTE(0x2000));
74      memcpy(&vram[address], shiftreg, TOBYTE(0x2000));
7775}
7876
7977
r32352r32353
336334 *
337335 *************************************/
338336
339void artmagic_scanline(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params)
337TMS340X0_SCANLINE_RGB32_CB_MEMBER(artmagic_state::scanline)
340338{
341   artmagic_state *state = screen.machine().driver_data<artmagic_state>();
342339   offs_t offset = (params->rowaddr << 12) & 0x7ff000;
343   UINT16 *vram = state->address_to_vram(&offset);
340   UINT16 *vram = address_to_vram(&offset);
344341   UINT32 *dest = &bitmap.pix32(scanline);
345   const rgb_t *pens = state->m_tlc34076->get_pens();
342   const rgb_t *pens = m_tlc34076->get_pens();
346343   int coladdr = params->coladdr << 1;
347344   int x;
348345
trunk/src/mame/video/midtunit.c
r32352r32353
4141
4242
4343/* graphics-related variables */
44      UINT8   midtunit_gfx_rom_large;
4544static UINT16   midtunit_control;
4645
4746/* videoram-related variables */
r32352r32353
111110VIDEO_START_MEMBER(midwunit_state,midwunit)
112111{
113112   VIDEO_START_CALL_MEMBER(midtunit);
114   midtunit_gfx_rom_large = 1;
113   m_gfx_rom_large = 1;
115114}
116115
117116
118117VIDEO_START_MEMBER(midxunit_state,midxunit)
119118{
120119   VIDEO_START_CALL_MEMBER(midtunit);
121   midtunit_gfx_rom_large = 1;
120   m_gfx_rom_large = 1;
122121   videobank_select = 1;
123122}
124123
r32352r32353
224223 *
225224 *************************************/
226225
227void midtunit_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
226TMS340X0_TO_SHIFTREG_CB_MEMBER(midtunit_state::to_shiftreg)
228227{
229228   memcpy(shiftreg, &local_videoram[address >> 3], 2 * 512 * sizeof(UINT16));
230229}
231230
232231
233void midtunit_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
232TMS340X0_FROM_SHIFTREG_CB_MEMBER(midtunit_state::from_shiftreg)
234233{
235234   memcpy(&local_videoram[address >> 3], shiftreg, 2 * 512 * sizeof(UINT16));
236235}
r32352r32353
254253   COMBINE_DATA(&midtunit_control);
255254
256255   /* gfx bank select is bit 7 */
257   if (!(midtunit_control & 0x0080) || !midtunit_gfx_rom_large)
256   if (!(midtunit_control & 0x0080) || !m_gfx_rom_large)
258257      gfxbank_offset[0] = 0x000000;
259258   else
260259      gfxbank_offset[0] = 0x800000;
r32352r32353
745744      gfxoffset = 0;
746745
747746   /* determine the location */
748   if (!midtunit_gfx_rom_large && gfxoffset >= 0x2000000)
747   if (!m_gfx_rom_large && gfxoffset >= 0x2000000)
749748      gfxoffset -= 0x2000000;
750749   if (gfxoffset >= 0xf8000000)
751750      gfxoffset -= 0xf8000000;
r32352r32353
811810 *
812811 *************************************/
813812
814void midtunit_scanline_update(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params)
813TMS340X0_SCANLINE_IND16_CB_MEMBER(midtunit_state::scanline_update)
815814{
816815   UINT16 *src = &local_videoram[(params->rowaddr << 9) & 0x3fe00];
817816   UINT16 *dest = &bitmap.pix16(scanline);
r32352r32353
823822      dest[x] = src[coladdr++ & 0x1ff] & 0x7fff;
824823}
825824
826void midxunit_scanline_update(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params)
825TMS340X0_SCANLINE_IND16_CB_MEMBER(midxunit_state::scanline_update)
827826{
828827   UINT32 fulladdr = ((params->rowaddr << 16) | params->coladdr) >> 3;
829828   UINT16 *src = &local_videoram[fulladdr & 0x3fe00];
trunk/src/mame/video/micro3d.c
r32352r32353
6060 *
6161 *************************************/
6262
63void micro3d_scanline_update(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params)
63TMS340X0_SCANLINE_IND16_CB_MEMBER(micro3d_state::scanline_update)
6464{
65   micro3d_state *state = screen.machine().driver_data<micro3d_state>();
66
67   UINT16 *src = &state->m_micro3d_sprite_vram[(params->rowaddr << 8) & 0x7fe00];
65   UINT16 *src = &m_micro3d_sprite_vram[(params->rowaddr << 8) & 0x7fe00];
6866   UINT16 *dest = &bitmap.pix16(scanline);
6967   int coladdr = params->coladdr;
70   int sd_11_7 = (state->m_creg & 0x1f) << 7;
68   int sd_11_7 = (m_creg & 0x1f) << 7;
7169   int x;
7270
7371   UINT16 *frame_src;
7472
7573   scanline = MAX((scanline - params->veblnk), 0);
76   frame_src = state->m_frame_buffers[state->m_display_buffer] + (scanline << 10);
74   frame_src = m_frame_buffers[m_display_buffer] + (scanline << 10);
7775
7876   /* TODO: XFER3DK - X/Y offsets for 3D */
7977
r32352r32353
125123   m_xfer3dk = data;
126124}
127125
128void micro3d_tms_interrupt(device_t *device, int state)
126WRITE_LINE_MEMBER(micro3d_state::tms_interrupt)
129127{
130128//  mc68901_int_gen(device->machine(), GPIP4);
131129}
trunk/src/emu/cpu/tms34010/34010gfx.c
r32352r32353
215215
216216void tms340x0_device::shiftreg_w(address_space &space, offs_t offset,UINT16 data)
217217{
218   if (m_config->from_shiftreg)
219      (*m_config->from_shiftreg)(space, (UINT32)(offset << 3) & ~15, &m_shiftreg[0]);
218   if (!m_from_shiftreg_cb.isnull())
219      m_from_shiftreg_cb(space, (UINT32)(offset << 3) & ~15, &m_shiftreg[0]);
220220   else
221221      logerror("From ShiftReg function not set. PC = %08X\n", m_pc);
222222}
223223
224224UINT16 tms340x0_device::shiftreg_r(address_space &space, offs_t offset)
225225{
226   if (m_config->to_shiftreg)
227      (*m_config->to_shiftreg)(space, (UINT32)(offset << 3) & ~15, &m_shiftreg[0]);
226   if (!m_to_shiftreg_cb.isnull())
227      m_to_shiftreg_cb(space, (UINT32)(offset << 3) & ~15, &m_shiftreg[0]);
228228   else
229229      logerror("To ShiftReg function not set. PC = %08X\n", m_pc);
230230   return m_shiftreg[0];
trunk/src/emu/cpu/tms34010/tms34010.h
r32352r32353
188188};
189189
190190
191struct tms340x0_config
192{
193   UINT8   halt_on_reset;                      /* /HCS pin, which determines HALT state after reset */
194   const char *screen_tag;                     /* the screen operated on */
195   UINT32  pixclock;                           /* the pixel clock (0 means don't adjust screen size) */
196   int     pixperclock;                        /* pixels per clock */
197   void    (*scanline_callback_ind16)(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params);
198   void    (*scanline_callback_rgb32)(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params);
199   void    (*output_int)(device_t *device, int state);         /* output interrupt callback */
200   void    (*to_shiftreg)(address_space &space, offs_t, UINT16 *); /* shift register write */
201   void    (*from_shiftreg)(address_space &space, offs_t, UINT16 *);   /* shift register read */
202};
191#define MCFG_TMS340X0_HALT_ON_RESET(_value) \
192   tms340x0_device::set_halt_on_reset(*device, _value);
193   
194#define MCFG_TMS340X0_PIXEL_CLOCK(_value) \
195   tms340x0_device::set_pixel_clock(*device, _value);
196   
197#define MCFG_TMS340X0_PIXELS_PER_CLOCK(_value) \
198   tms340x0_device::set_pixels_per_clock(*device, _value);
199   
200typedef device_delegate<void (screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params)> scanline_ind16_cb_delegate;
203201
202#define TMS340X0_SCANLINE_IND16_CB_MEMBER(_name) void _name(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params)
203   
204#define MCFG_TMS340X0_SCANLINE_IND16_CB(_class, _method) \
205    tms340x0_device::set_scanline_ind16_callback(*device, scanline_ind16_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
206   
204207
205#define MCFG_TMS340X0_CONFIG(_config) \
206   tms340x0_device::set_tms340x0_config(*device, &_config);
208typedef device_delegate<void (screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params)> scanline_rgb32_cb_delegate;
207209
210#define TMS340X0_SCANLINE_RGB32_CB_MEMBER(_name) void _name(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params)
208211
209class tms340x0_device : public cpu_device
212#define MCFG_TMS340X0_SCANLINE_RGB32_CB(_class, _method) \
213    tms340x0_device::set_scanline_rgb32_callback(*device, scanline_rgb32_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
214
215   
216#define MCFG_TMS340X0_OUTPUT_INT_CB(_devcb) \
217   devcb = &tms340x0_device::set_output_int_callback(*device, DEVCB_##_devcb);
218
219
220typedef device_delegate<void (address_space &space, offs_t address, UINT16 *shiftreg)> to_shiftreg_cb_delegate;
221
222#define TMS340X0_TO_SHIFTREG_CB_MEMBER(_name) void _name(address_space &space, offs_t address, UINT16 *shiftreg)
223   
224#define MCFG_TMS340X0_TO_SHIFTREG_CB(_class, _method) \
225    tms340x0_device::set_to_shiftreg_callback(*device, to_shiftreg_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
226   
227
228typedef device_delegate<void (address_space &space, offs_t address, UINT16 *shiftreg)> from_shiftreg_cb_delegate;
229
230#define TMS340X0_FROM_SHIFTREG_CB_MEMBER(_name) void _name(address_space &space, offs_t address, UINT16 *shiftreg)
231
232#define MCFG_TMS340X0_FROM_SHIFTREG_CB(_class, _method) \
233    tms340x0_device::set_from_shiftreg_callback(*device, from_shiftreg_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
234
235   
236class tms340x0_device : public cpu_device,
237                  public device_video_interface         
210238{
211239public:
212240   // construction/destruction
213241   tms340x0_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname);
214242
215   static void set_tms340x0_config(device_t &device, const tms340x0_config *config) { downcast<tms340x0_device &>(device).m_config = config; }
243   static void set_halt_on_reset(device_t &device, bool reset_deferred) { downcast<tms340x0_device &>(device).m_reset_deferred = reset_deferred; }
244   static void set_pixel_clock(device_t &device, UINT32 pixclock) { downcast<tms340x0_device &>(device).m_pixclock = pixclock; }
245   static void set_pixels_per_clock(device_t &device, int pixperclock) { downcast<tms340x0_device &>(device).m_pixperclock = pixperclock; }
246   static void set_scanline_ind16_callback(device_t &device, scanline_ind16_cb_delegate callback) { downcast<tms340x0_device &>(device).m_scanline_ind16_cb = callback; }
247   static void set_scanline_rgb32_callback(device_t &device, scanline_rgb32_cb_delegate callback) { downcast<tms340x0_device &>(device).m_scanline_rgb32_cb = callback; }
248   template<class _Object> static devcb_base &set_output_int_callback(device_t &device, _Object object) { return downcast<tms340x0_device &>(device).m_output_int_cb.set_callback(object); }
249   static void set_to_shiftreg_callback(device_t &device, to_shiftreg_cb_delegate callback) { downcast<tms340x0_device &>(device).m_to_shiftreg_cb = callback; }
250   static void set_from_shiftreg_callback(device_t &device, from_shiftreg_cb_delegate callback) { downcast<tms340x0_device &>(device).m_from_shiftreg_cb = callback; }
216251
217252   void get_display_params(tms34010_display_params *params);
218253   void tms34010_state_postload();
r32352r32353
292327   INT32            m_gfxcycles;
293328   UINT8            m_pixelshift;
294329   UINT8            m_is_34020;
295   UINT8            m_reset_deferred;
330   bool            m_reset_deferred; /* /HCS pin, which determines HALT state after reset */
296331   UINT8            m_hblank_stable;
297332   UINT8            m_external_host_access;
298333   UINT8            m_executing;
299334   address_space *m_program;
300335   direct_read_data *m_direct;
301   const tms340x0_config *m_config;
302   screen_device *m_screen;
336   UINT32  m_pixclock;                           /* the pixel clock (0 means don't adjust screen size) */
337   int     m_pixperclock;                        /* pixels per clock */
303338   emu_timer *m_scantimer;
304339   int m_icount;
340   
341   scanline_ind16_cb_delegate m_scanline_ind16_cb;
342   scanline_rgb32_cb_delegate m_scanline_rgb32_cb;
343   devcb_write_line m_output_int_cb; /* output interrupt callback */
344   to_shiftreg_cb_delegate m_to_shiftreg_cb;  /* shift register write */
345   from_shiftreg_cb_delegate m_from_shiftreg_cb; /* shift register read */
305346
306347   struct XY
307348   {
trunk/src/emu/cpu/tms34010/tms34010.c
r32352r32353
3131    GLOBAL VARIABLES
3232***************************************************************************/
3333
34/* default configuration */
35static const tms340x0_config default_config =
36{
37   0
38};
39
40
4134tms340x0_device::tms340x0_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname)
4235   : cpu_device(mconfig, type, name, tag, owner, clock, shortname, __FILE__)
36   , device_video_interface(mconfig, *this)
4337   , m_program_config("program", ENDIANNESS_LITTLE, 16, 32, 3)
44   , m_config(&default_config)
38   , m_reset_deferred(FALSE)
39   , m_pixclock(0)
40   , m_pixperclock(0)     
41   , m_output_int_cb(*this)
4542{
4643}
4744
r32352r32353
271268/* Shift register read */
272269UINT32 tms340x0_device::read_pixel_shiftreg(offs_t offset)
273270{
274   if (m_config->to_shiftreg)
275      m_config->to_shiftreg(*m_program, offset, &m_shiftreg[0]);
271   if (!m_to_shiftreg_cb.isnull())
272      m_to_shiftreg_cb(*m_program, offset, &m_shiftreg[0]);
276273   else
277274      fatalerror("To ShiftReg function not set. PC = %08X\n", m_pc);
278275   return m_shiftreg[0];
r32352r32353
413410/* Shift register write */
414411void tms340x0_device::write_pixel_shiftreg(offs_t offset, UINT32 data)
415412{
416   if (m_config->from_shiftreg)
417      m_config->from_shiftreg(*m_program, offset, &m_shiftreg[0]);
413   if (!m_from_shiftreg_cb.isnull())
414      m_from_shiftreg_cb(*m_program, offset, &m_shiftreg[0]);
418415   else
419416      fatalerror("From ShiftReg function not set. PC = %08X\n", m_pc);
420417}
r32352r32353
572569
573570void tms340x0_device::device_start()
574571{
572   m_scanline_ind16_cb.bind_relative_to(*owner());
573   m_scanline_rgb32_cb.bind_relative_to(*owner());
574   m_output_int_cb.resolve();
575   m_to_shiftreg_cb.bind_relative_to(*owner());
576   m_from_shiftreg_cb.bind_relative_to(*owner());
577   
575578   m_external_host_access = FALSE;
576579
577580   m_program = &space(AS_PROGRAM);
578581   m_direct = &m_program->direct();
579   m_screen = downcast<screen_device *>(machine().device(m_config->screen_tag));
580582
581583   /* set up the state table */
582584   {
r32352r32353
646648
647649   /* HALT the CPU if requested, and remember to re-read the starting PC */
648650   /* the first time we are run */
649   m_reset_deferred = m_config->halt_on_reset;
650   if (m_config->halt_on_reset)
651   if (m_reset_deferred)
651652   {
652653      io_register_w(*m_program, REG_HSTCTLH, 0x8000, 0xffff);
653654   }
r32352r32353
883884   {
884885      /* only do this if we have an incoming pixel clock */
885886      /* also, only do it if the HEBLNK/HSBLNK values are stable */
886      if (master && (m_config->scanline_callback_ind16 != NULL || m_config->scanline_callback_rgb32 != NULL))
887      if (master && (!m_scanline_ind16_cb.isnull() || !m_scanline_rgb32_cb.isnull()))
887888      {
888889         int htotal = SMART_IOREG(HTOTAL);
889890         if (htotal > 0 && vtotal > 0)
890891         {
891            attoseconds_t refresh = HZ_TO_ATTOSECONDS(m_config->pixclock) * (htotal + 1) * (vtotal + 1);
892            int width = (htotal + 1) * m_config->pixperclock;
892            attoseconds_t refresh = HZ_TO_ATTOSECONDS(m_pixclock) * (htotal + 1) * (vtotal + 1);
893            int width = (htotal + 1) * m_pixperclock;
893894            int height = vtotal + 1;
894895            rectangle visarea;
895896
896897            /* extract the visible area */
897            visarea.min_x = SMART_IOREG(HEBLNK) * m_config->pixperclock;
898            visarea.max_x = SMART_IOREG(HSBLNK) * m_config->pixperclock - 1;
898            visarea.min_x = SMART_IOREG(HEBLNK) * m_pixperclock;
899            visarea.max_x = SMART_IOREG(HSBLNK) * m_pixperclock - 1;
899900            visarea.min_y = veblnk;
900901            visarea.max_y = vsblnk - 1;
901902
r32352r32353
927928   }
928929
929930   /* force a partial update within the visible area */
930   if (vcount >= current_visarea.min_y && vcount <= current_visarea.max_y && (m_config->scanline_callback_ind16 != NULL || m_config->scanline_callback_rgb32 != NULL))
931   if (vcount >= current_visarea.min_y && vcount <= current_visarea.max_y && (!m_scanline_ind16_cb.isnull() || !m_scanline_rgb32_cb.isnull()))
931932      m_screen->update_partial(vcount);
932933
933934   /* if we are in the visible area, increment DPYADR by DUDATE */
r32352r32353
974975   params->vcount = SMART_IOREG(VCOUNT);
975976   params->veblnk = SMART_IOREG(VEBLNK);
976977   params->vsblnk = SMART_IOREG(VSBLNK);
977   params->heblnk = SMART_IOREG(HEBLNK) * m_config->pixperclock;
978   params->hsblnk = SMART_IOREG(HSBLNK) * m_config->pixperclock;
978   params->heblnk = SMART_IOREG(HEBLNK) * m_pixperclock;
979   params->hsblnk = SMART_IOREG(HSBLNK) * m_pixperclock;
979980
980981   /* 34010 gets its address from DPYADR and DPYTAP */
981982   if (!m_is_34020)
r32352r32353
10131014   {
10141015      /* call through to the callback */
10151016      LOG(("  Update: scan=%3d ROW=%04X COL=%04X\n", cliprect.min_y, params.rowaddr, params.coladdr));
1016      (*m_config->scanline_callback_ind16)(screen, bitmap, cliprect.min_y, &params);
1017      m_scanline_ind16_cb(screen, bitmap, cliprect.min_y, &params);
10171018   }
10181019
10191020   /* otherwise, just blank the current scanline */
r32352r32353
10441045   {
10451046      /* call through to the callback */
10461047      LOG(("  Update: scan=%3d ROW=%04X COL=%04X\n", cliprect.min_y, params.rowaddr, params.coladdr));
1047      (*m_config->scanline_callback_rgb32)(screen, bitmap, cliprect.min_y, &params);
1048      m_scanline_rgb32_cb(screen, bitmap, cliprect.min_y, &params);
10481049   }
10491050
10501051   /* otherwise, just blank the current scanline */
r32352r32353
11551156            /* the TMS34010 can set output interrupt? */
11561157            if (!(oldreg & 0x0080) && (newreg & 0x0080))
11571158            {
1158               if (m_config->output_int)
1159                  (*m_config->output_int)(&space.device(), 1);
1159               if (!m_output_int_cb.isnull())
1160                  m_output_int_cb(1);
11601161            }
11611162            else if ((oldreg & 0x0080) && !(newreg & 0x0080))
11621163            {
1163               if (m_config->output_int)
1164                  (*m_config->output_int)(&space.device(), 0);
1164               if (!m_output_int_cb.isnull())
1165                  m_output_int_cb(0);
11651166            }
11661167
11671168            /* input interrupt? (should really be state-based, but the functions don't exist!) */
r32352r32353
13081309         /* the TMS34010 can set output interrupt? */
13091310         if (!(oldreg & 0x0080) && (newreg & 0x0080))
13101311         {
1311            if (m_config->output_int)
1312               (*m_config->output_int)(&space.device(), 1);
1312            if (!m_output_int_cb.isnull())
1313               m_output_int_cb(1);
13131314         }
13141315         else if ((oldreg & 0x0080) && !(newreg & 0x0080))
13151316         {
1316            if (m_config->output_int)
1317               (*m_config->output_int)(&space.device(), 0);
1317            if (!m_output_int_cb.isnull())
1318               m_output_int_cb(0);
13181319         }
13191320
13201321         /* input interrupt? (should really be state-based, but the functions don't exist!) */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team