Previous 15994 Revisions Next

r15765 Monday 6th August, 2012 at 08:09:39 UTC by Miodrag Milanović
Sync with MAME r17158 (no whatsnew)
[src/emu]gamedrv.h ui.c
[src/emu/drivers]emudummy.c
[src/mame/drivers]cobra.c deco_ld.c dwarfd.c esh.c gpworld.c intrscti.c invqix.c istellar.c lgp.c megasys1.c megatech.c segald.c segaxbd.c superdq.c tickee.c timetrv.c
[src/mame/video]amiga.c

src/mame/video/amiga.c
r15764r15765
999999 *
10001000 *************************************/
10011001
1002/* TODO: alg.c requires that this uses RGB32 */
10021003SCREEN_UPDATE_IND16( amiga )
10031004{
10041005   int y;
src/mame/drivers/segaxbd.c
r15764r15765
11311131   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)   
11321132   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)   
11331133   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)   
1134   PORT_BIT( 0xf0, 0xf0 ^ 0x40, IPT_POSITIONAL ) PORT_PLAYER(2) PORT_POSITIONS(8) PORT_REMAP_TABLE(lastsurv_position_table) PORT_WRAPS PORT_SENSITIVITY(1) PORT_KEYDELTA(1) PORT_CENTERDELTA(0) PORT_CODE_DEC(KEYCODE_Q) PORT_CODE_INC(KEYCODE_W)
1134   PORT_BIT( 0xf0, 0xf0 ^ 0x40, IPT_POSITIONAL ) PORT_PLAYER(2) PORT_POSITIONS(8) PORT_REMAP_TABLE(lastsurv_position_table) PORT_WRAPS PORT_SENSITIVITY(1) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_CODE_DEC(KEYCODE_Q) PORT_CODE_INC(KEYCODE_W)
11351135
11361136   PORT_START("MUX1")
11371137   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)   
11381138   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
11391139   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)   
11401140   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)   
1141   PORT_BIT( 0xf0, 0xf0 ^ 0x40, IPT_POSITIONAL ) PORT_PLAYER(1) PORT_POSITIONS(8) PORT_REMAP_TABLE(lastsurv_position_table) PORT_WRAPS PORT_SENSITIVITY(1) PORT_KEYDELTA(1) PORT_CENTERDELTA(0) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X)
1141   PORT_BIT( 0xf0, 0xf0 ^ 0x40, IPT_POSITIONAL ) PORT_PLAYER(1) PORT_POSITIONS(8) PORT_REMAP_TABLE(lastsurv_position_table) PORT_WRAPS PORT_SENSITIVITY(1) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X)
11421142
11431143   PORT_START("MUX2")
11441144   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
r15764r15765
15341534MACHINE_CONFIG_END
15351535
15361536
1537static MACHINE_CONFIG_DERIVED( lastsurv_fd1094, xboard_fd1094 )
1538
1539   /* basic machine hardware */
1540   // TODO: network board
1541
1542   /* sound hardware - ym2151 stereo is reversed */
1543   MCFG_SOUND_MODIFY("ymsnd")
1544   MCFG_SOUND_ROUTES_RESET()
1545   MCFG_SOUND_ROUTE(0, "rspeaker", 0.43)
1546   MCFG_SOUND_ROUTE(1, "lspeaker", 0.43)
1547MACHINE_CONFIG_END
1548
1549
15371550static MACHINE_CONFIG_DERIVED( smgp_fd1094, xboard_fd1094 )
15381551
15391552   /* basic machine hardware */
r15764r15765
32773290GAME( 1987, aburner,  aburner2, xboard,        aburner, segaxbd_state,  aburner2,       ROT0,   "Sega", "After Burner (Japan)", 0 )
32783291GAME( 1987, thndrbld, 0,        xboard_fd1094, thndrbld, segaxbd_state, generic_xboard, ROT0,   "Sega", "Thunder Blade (upright, FD1094 317-0056)", 0 )
32793292GAME( 1987, thndrbld1,thndrbld, xboard,        thndrbd1, segaxbd_state, generic_xboard, ROT0,   "Sega", "Thunder Blade (deluxe/standing, unprotected)", 0 )
3280GAME( 1989, lastsurv, 0,        xboard_fd1094, lastsurv, segaxbd_state, lastsurv,       ROT0,   "Sega", "Last Survivor (FD1094 317-0083)", 0 )
3293GAME( 1989, lastsurv, 0,        lastsurv_fd1094, lastsurv, segaxbd_state, lastsurv,       ROT0,   "Sega", "Last Survivor (Japan, FD1094 317-0083)", 0 )
32813294GAME( 1989, loffire,  0,        xboard_fd1094, loffire, segaxbd_state,  loffire,        ROT0,   "Sega", "Line of Fire / Bakudan Yarou (World, FD1094 317-0136)", 0 )
32823295GAME( 1989, loffireu, loffire,  xboard_fd1094, loffire, segaxbd_state,  loffire,        ROT0,   "Sega", "Line of Fire / Bakudan Yarou (US, FD1094 317-0135)", 0 )
32833296GAME( 1989, loffirej, loffire,  xboard_fd1094, loffire, segaxbd_state,  loffire,        ROT0,   "Sega", "Line of Fire / Bakudan Yarou (Japan, FD1094 317-0134)", 0 )
src/mame/drivers/superdq.c
r15764r15765
6363   state->m_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
6464}
6565
66static SCREEN_UPDATE_IND16( superdq )
66static SCREEN_UPDATE_RGB32( superdq )
6767{
6868   superdq_state *state = screen.machine().driver_data<superdq_state>();
6969
src/mame/drivers/megatech.c
r15764r15765
12321232
12331233
12341234/* nn */ /* nn is part of the instruction rom name, should there be a game for each number? */
1235/* -- */ CONS( 1989, megatech, 0, 0,     megatech_slot, megatech, mt_slot, "Sega",                  "Mega-Tech", GAME_IS_BIOS_ROOT )
1235/* -- */ CONS( 1989, megatech, 0, 0,     megatech_slot, megatech, mtech_state, mt_slot, "Sega",                  "Mega-Tech", GAME_IS_BIOS_ROOT )
12361236/* 01 */ GAME( 1988, mt_beast, megatech, megatech, megatech, mtech_state, mt_crt, ROT0, "Sega",                  "Altered Beast (Mega-Tech)", GAME_NOT_WORKING )
12371237/* 02 */ GAME( 1988, mt_shar2, megatech, megatech, megatech, mtech_state, mt_crt, ROT0, "Sega",                  "Space Harrier II (Mega-Tech)", GAME_NOT_WORKING )
12381238/* 03 */ GAME( 1988, mt_stbld, megatech, megatech, megatech, mtech_state, mt_crt, ROT0, "Sega",                  "Super Thunder Blade (Mega-Tech)", GAME_NOT_WORKING )
src/mame/drivers/dwarfd.c
r15764r15765
780780{
781781}
782782
783static void drawCrt( running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect )
783static void drawCrt( running_machine &machine, bitmap_rgb32 &bitmap,const rectangle &cliprect )
784784{
785785   dwarfd_state *state = machine.driver_data<dwarfd_state>();
786786   int x, y;
r15764r15765
841841}
842842
843843
844static SCREEN_UPDATE_IND16( dwarfd )
844static SCREEN_UPDATE_RGB32( dwarfd )
845845{
846846   bitmap.fill(get_black_pen(screen.machine()), cliprect);
847847   drawCrt(screen.machine(), bitmap, cliprect);
src/mame/drivers/esh.c
r15764r15765
5454
5555
5656/* VIDEO GOODS */
57static SCREEN_UPDATE_IND16( esh )
57static SCREEN_UPDATE_RGB32( esh )
5858{
5959   esh_state *state = screen.machine().driver_data<esh_state>();
6060   int charx, chary;
r15764r15765
263263static const gfx_layout esh_gfx_layout =
264264{
265265   8,8,
266   0x1000/8,
266   RGN_FRAC(1,3),
267267   3,
268   { 0, 0x1000*8, 0x2000*8 },
268   { RGN_FRAC(0,3), RGN_FRAC(1,3), RGN_FRAC(2,3) },
269269   { 0,1,2,3,4,5,6,7 },
270270   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
271271   8*8
272272};
273273
274274static GFXDECODE_START( esh )
275   GFXDECODE_ENTRY("gfx1", 0, esh_gfx_layout, 0x0, 0x100)
275   GFXDECODE_ENTRY("gfx1", 0, esh_gfx_layout, 0x0, 0x20)
276276GFXDECODE_END
277277
278278static TIMER_CALLBACK( irq_stop )
src/mame/drivers/segald.c
r15764r15765
5959};
6060
6161/* VIDEO GOODS */
62static void astron_draw_characters(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect)
62static void astron_draw_characters(running_machine &machine, bitmap_rgb32 &bitmap,const rectangle &cliprect)
6363{
6464   segald_state *state = machine.driver_data<segald_state>();
6565   UINT8 characterX, characterY;
r15764r15765
7575   }
7676}
7777
78static void astron_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
78static void astron_draw_sprites(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect)
7979{
8080   /* Heisted from Daphne */
8181   const UINT8 SPR_Y_TOP     = 0;
r15764r15765
104104}
105105
106106
107static SCREEN_UPDATE_IND16( astron )
107static SCREEN_UPDATE_RGB32( astron )
108108{
109109   bitmap.fill(0, cliprect);
110110
src/mame/drivers/tickee.c
r15764r15765
1515
1616    Known bugs:
1717        * (Tickee) gun sometimes misfires
18        * Mouse Attack dips and inputs need fixing
1918        * Mallet Madness ticket dispenser isn't working
2019
2120***************************************************************************/
r15764r15765
587586
588587static INPUT_PORTS_START( mouseatk )
589588   PORT_START("DSW")
590   PORT_DIPNAME( 0x03, 0x01, "Game Time/Diff" )
591   PORT_DIPSETTING(    0x03, "Very Fast/Very Easy" )
592   PORT_DIPSETTING(    0x02, "Fast/Easy" )
593   PORT_DIPSETTING(    0x01, "Average/Hard" )
594   PORT_DIPSETTING(    0x00, "Slow/Very Hard" )
595   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ))
596   PORT_DIPSETTING(    0x04, DEF_STR( Off ))
597   PORT_DIPSETTING(    0x00, DEF_STR( On ))
598   PORT_DIPNAME( 0x08, 0x00, "Last Box Tickets" )
599   PORT_DIPSETTING(    0x00, "1" )
600   PORT_DIPSETTING(    0x08, "25" )
601   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Unknown ))
602   PORT_DIPSETTING(    0x30, "0" )
603   PORT_DIPSETTING(    0x20, "1" )
604   PORT_DIPSETTING(    0x10, "2" )
605   PORT_DIPSETTING(    0x00, "3" )
606   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ))
607   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ))
608   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ))
609   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ))
610   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ))
589   PORT_DIPNAME( 0x03, 0x03, "Number of Extra Cheese" )   PORT_DIPLOCATION("SW1:8,7")
590   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
591   PORT_DIPSETTING(    0x01, "1 Extra Cheese" )
592   PORT_DIPSETTING(    0x02, "2 Extra Cheese" )
593   PORT_DIPSETTING(    0x03, "3 Extra Cheese" )
594   PORT_DIPNAME( 0x0c, 0x0c, "Number of Mice & Cheese" )   PORT_DIPLOCATION("SW1:6,5")
595   PORT_DIPSETTING(    0x00, "4 Mice - 5 Cheese" )
596   PORT_DIPSETTING(    0x04, "5 Mice - 6 Cheese" )
597   PORT_DIPSETTING(    0x08, "6 Mice - 7 Cheese" )
598   PORT_DIPSETTING(    0x0c, "7 Mice - 8 Cheese" )
599   PORT_DIPNAME( 0x10, 0x10, "Bonus Ticket Game" )      PORT_DIPLOCATION("SW1:4")
600   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
601   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
602   PORT_DIPNAME( 0x20, 0x20, "Ticket Payout" )      PORT_DIPLOCATION("SW1:3")
603   PORT_DIPSETTING(    0x20, DEF_STR( Normal ) )
604   PORT_DIPSETTING(    0x00, "Double" )
605   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )      PORT_DIPLOCATION("SW1:2,1")
606   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
607   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
608   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
609   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )
611610
612611   PORT_START("IN0")
613612   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
src/mame/drivers/cobra.c
r15764r15765
154154
155155   Gfx:
156156   -
157   Fails on memcheck_teximage(), memcheck_framebuf(), drawcheck()
157   Fails on drawcheck()
158158   0x3806dc():   Waits for [0x7f7ffc] to change (in main)
159159
160160
r15764r15765
170170      0xa0 0xa4 0xa8 0xac
171171      0xb0 0xb4 0xb8 0xbc
172172
173      0x00114:      High word: framebuffer pitch?   Low word: framebuffer pixel size?
174      0x00118:      High word: FB pixel read X pos,   Low word: FB pixel read Y pos
175      0x0011c:      Same as above?
176
177      0x40018:      Set to 0x0001040a by mode_stipple()
178      0x400d0:      Set to 0x80000000 by mode_stipple()
179      0x40114:      Set to 0x00080000 by mode_scissor()
180      0x40138:      Set to 0x88800000 by mode_viewclip()
173181      0x40160:      Some viewport register? (high word: 192, low word: 150)
174182      0x40164:      Some viewport register? (high word: 352, low word: 275)
175183      0x40170:      Some viewport register? (high word: 160, low word: 125)
176184      0x40174:      Some viewport register? (high word: 320, low word: 250)
185      0x40198:      Set to 0x80800000 by mode_alphatest()
186      0x4019c:      Set to 0x88000000 by mode_fog()
187      0x80020:      Set to 0x00020000 by mode_depthtest()
177188      0xc0c00..fff:   Texture RAM readback
178189      0xc3020:      Start address for texram writes?
179190      0xc3028:      Reads address from texram?
r15764r15765
203214class cobra_renderer : public poly_manager<float, cobra_polydata, 6, 10000>
204215{
205216public:
206   cobra_renderer(running_machine &machine, bitmap_rgb32 *fb)
217   cobra_renderer(running_machine &machine)
207218      : poly_manager<float, cobra_polydata, 6, 10000>(machine)
208219   {
209      m_fb = fb;
220      m_texture_ram = auto_alloc_array(machine, UINT32, 0x100000);
210221
211      m_texture_ram = auto_alloc_array(machine, UINT32, 0x1000000);
222      m_framebuffer = auto_bitmap_rgb32_alloc(machine, 1024, 1024);
223      m_backbuffer = auto_bitmap_rgb32_alloc(machine, 1024, 1024);
224      m_overlay = auto_bitmap_rgb32_alloc(machine, 1024, 1024);
225      m_zbuffer = auto_bitmap_ind32_alloc(machine, 1024, 1024);
226      m_stencil = auto_bitmap_ind32_alloc(machine, 1024, 1024);
212227
213228      // TODO: these are probably set by some 3D registers
214229      m_texture_width = 128;
215230      m_texture_height = 8;
231
232      m_gfx_regmask = auto_alloc_array(machine, UINT32, 0x100);
233      for (int i=0; i < 0x100; i++)
234      {
235         UINT32 mask = 0;
236         if (i & 0x01) mask |= 0x0000000f;
237         if (i & 0x02) mask |= 0x000000f0;
238         if (i & 0x04) mask |= 0x00000f00;
239         if (i & 0x08) mask |= 0x0000f000;
240         if (i & 0x10) mask |= 0x000f0000;
241         if (i & 0x20) mask |= 0x00f00000;
242         if (i & 0x40) mask |= 0x0f000000;
243         if (i & 0x80) mask |= 0xf0000000;
244
245         m_gfx_regmask[i] = mask;
246      }
216247   }
217248
218249   void render_texture_scan(INT32 scanline, const extent_t &extent, const cobra_polydata &extradata, int threadid);
r15764r15765
224255   void gfx_reset(running_machine &machine);
225256   void gfx_fifo_exec(running_machine &machine);
226257   UINT32 gfx_read_gram(UINT32 address);
227   void gfx_write_gram(UINT32 address, UINT32 data);
258   void gfx_write_gram(UINT32 address, UINT32 mask, UINT32 data);
228259
260   void display(bitmap_rgb32 *bitmap, const rectangle &cliprect);
261
229262private:
230   bitmap_rgb32 *m_fb;
263   bitmap_rgb32 *m_framebuffer;
264   bitmap_rgb32 *m_backbuffer;
265   bitmap_rgb32 *m_overlay;
266   bitmap_ind32 *m_zbuffer;
267   bitmap_ind32 *m_stencil;
231268
232269   UINT32 *m_texture_ram;
233270   int m_texture_width;
234271   int m_texture_height;
235272
236273   UINT32 *m_gfx_gram;
274   UINT32 *m_gfx_regmask;
237275};
238276
239277class cobra_fifo
r15764r15765
340378   UINT32 *m_comram[2];
341379   int m_comram_page;
342380
343   bitmap_rgb32 *m_framebuffer;
344
345381   int m_main_debug_state;
346382   int m_main_debug_state_wc;
347383   int m_sub_debug_state;
r15764r15765
372408void cobra_renderer::render_color_scan(INT32 scanline, const extent_t &extent, const cobra_polydata &extradata, int threadid)
373409{
374410   /*
375   UINT32 *fb = &m_fb->pix32(scanline);
411   UINT32 *fb = &m_framebuffer->pix32(scanline);
376412
377413   UINT32 color = 0xffff0000; // TODO
378414
r15764r15765
389425   float v = extent.param[1].start;
390426   float du = extent.param[0].dpdx;
391427   float dv = extent.param[1].dpdx;
392   UINT32 *fb = &m_fb->pix32(scanline);
428   UINT32 *fb = &m_framebuffer->pix32(scanline);
393429
394430   for (int x = extent.startx; x < extent.stopx; x++)
395431   {
r15764r15765
429465   if (x >= visarea.min_x && x <= visarea.max_x &&
430466      y >= visarea.min_y && y <= visarea.max_y)
431467   {
432      UINT32 *fb = &m_fb->pix32(y);
468      UINT32 *fb = &m_framebuffer->pix32(y);
433469      fb[x] = color;
434470   }
435471}
r15764r15765
457493      {
458494         int y = y1 + (dy * (float)(x - x1) / (float)(dx));
459495
460         UINT32 *fb = &m_fb->pix32(y);
496         UINT32 *fb = &m_framebuffer->pix32(y);
461497         fb[x] = color;
462498
463499         x++;
r15764r15765
470506      {
471507         int x = x1 + (dx * (float)(y - y1) / (float)(dy));
472508
473         UINT32 *fb = &m_fb->pix32(y);
509         UINT32 *fb = &m_framebuffer->pix32(y);
474510         fb[x] = color;
475511
476512         y++;
r15764r15765
488524
489525   machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(cobra_video_exit), &machine));
490526
491   cobra->m_framebuffer = auto_bitmap_rgb32_alloc(machine, 512, 384);
492
493   cobra->m_renderer = auto_alloc(machine, cobra_renderer(machine, cobra->m_framebuffer));
527   cobra->m_renderer = auto_alloc(machine, cobra_renderer(machine));
494528   cobra->m_renderer->gfx_init(machine);
495529}
496530
r15764r15765
498532{
499533   cobra_state *cobra = screen.machine().driver_data<cobra_state>();
500534
501   copybitmap_trans(bitmap, *cobra->m_framebuffer, 0, 0, 0, 0, cliprect, 0);
535   cobra->m_renderer->display(&bitmap, cliprect);
502536   return 0;
503537}
504538
r15764r15765
13861420#define RE_STATUS_IDLE         0
13871421#define RE_STATUS_COMMAND      1
13881422
1423void cobra_renderer::display(bitmap_rgb32 *bitmap, const rectangle &cliprect)
1424{
1425   copybitmap_trans(*bitmap, *m_framebuffer, 0, 0, 0, 0, cliprect, 0);
1426}
1427
13891428void cobra_renderer::gfx_init(running_machine &machine)
13901429{
13911430   cobra_state *cobra = machine.driver_data<cobra_state>();
r15764r15765
14331472   return m_gfx_gram[address/4];
14341473}
14351474
1436void cobra_renderer::gfx_write_gram(UINT32 address, UINT32 data)
1475void cobra_renderer::gfx_write_gram(UINT32 address, UINT32 mask, UINT32 data)
14371476{
14381477   if (address & 3)
14391478   {
r15764r15765
14451484   {
14461485   }
14471486
1448   m_gfx_gram[address/4] = data;
1487   m_gfx_gram[address/4] &= ~mask;
1488   m_gfx_gram[address/4] |= data & mask;
14491489}
14501490
14511491void cobra_renderer::gfx_fifo_exec(running_machine &machine)
r15764r15765
18761916
18771917         case 0xe8:
18781918         {
1879            // Write into a pixelbuffer?
1919            // Write into a pixelbuffer
18801920
18811921            int num = w2;
18821922            int i;
1883            //int c=0;
18841923
18851924            if (fifo_in->current_num() < num)
18861925            {
r15764r15765
18881927               return;
18891928            }
18901929
1891            if (num > 0)
1892            {
1893               printf("gfxfifo_exec: unhandled %08X %08X\n", w1, w2);
1894            }
1930            if (num & 3)
1931               fatalerror("gfxfifo_exec: e8 with num %d\n", num);
18951932
1896            for (i=0; i < num; i++)
1933            int x = (m_gfx_gram[0x118/4] >> 16) & 0xffff;
1934            int y = m_gfx_gram[0x118/4] & 0xffff;
1935
1936            for (i=0; i < num; i+=4)
18971937            {
1898               UINT64 param;
1899               fifo_in->pop(NULL, &param);
1938               UINT32 *buffer;
1939               switch (m_gfx_gram[0x80104/4])
1940               {
1941                  case 0x800000:      buffer = &m_framebuffer->pix32(y); break;
1942                  case 0x200000:      buffer = &m_backbuffer->pix32(y); break;
1943                  case 0x0e0000:      buffer = &m_overlay->pix32(y); break;
1944                  case 0x000800:      buffer = &m_zbuffer->pix32(y); break;
1945                  case 0x000200:      buffer = &m_stencil->pix32(y); break;
1946                 
1947                  default:
1948                  {
1949                     fatalerror("gfxfifo_exec: fb write to buffer %08X!\n", m_gfx_gram[0x80100/4]);
1950                  }
1951               }
19001952
1901               /*
1902                    if (c == 0)
1903                        printf("       ");
1904                    printf("%08X ", (UINT32)(param));
1953               UINT64 param[4];
1954               param[0] = param[1] = param[2] = param[3] = 0;
1955               fifo_in->pop(NULL, &param[0]);
1956               fifo_in->pop(NULL, &param[1]);
1957               fifo_in->pop(NULL, &param[2]);
1958               fifo_in->pop(NULL, &param[3]);
19051959
1906                    c++;
1960               buffer[x+0] = (UINT32)(param[0]);
1961               buffer[x+1] = (UINT32)(param[1]);
1962               buffer[x+2] = (UINT32)(param[2]);
1963               buffer[x+3] = (UINT32)(param[3]);
19071964
1908                    if (c == 8)
1909                    {
1910                        printf("\n");
1911                        c = 0;
1912                    }*/
1965               //printf("gfx: fb write %d, %d: %08X %08X %08X %08X\n", x, y, (UINT32)(param[0]), (UINT32)(param[1]), (UINT32)(param[2]), (UINT32)(param[3]));
1966
1967               y++;
19131968            }
1914            //printf("\n");
19151969
19161970            cobra->m_gfx_re_status = RE_STATUS_IDLE;
19171971            break;
r15764r15765
19191973
19201974         case 0xe9:
19211975         {
1922            // Read a specified pixel position from a pixelbuffer?
1976            // Read a specified pixel position from a pixelbuffer
19231977
1924         //  printf("gfxfifo_exec: unhandled %08X %08X\n", w1, w2);
1978//            printf("GFX: FB read X: %d, Y: %d\n", (UINT16)(m_gfx_gram[0x118/4] >> 16), (UINT16)(m_gfx_gram[0x118/4]));
19251979
1926            /*{
1927                    int y = (gfx_gram[0x11c] << 8) | (gfx_gram[0x11d]);
1928                    int x = (gfx_gram[0x11e] << 8) | (gfx_gram[0x11f]);
1929                    printf("GFX: E9 on X: %d, Y: %d\n", x, y);
1930                }*/
1980            int x = (m_gfx_gram[0x118/4] >> 16) & 0xffff;
1981            int y = m_gfx_gram[0x118/4] & 0xffff;
19311982
1932            fifo_out->push(NULL, 0);
1933            fifo_out->push(NULL, 0);
1934            fifo_out->push(NULL, 0);
1935            fifo_out->push(NULL, 0);
1983            UINT32 *buffer;
1984            switch (m_gfx_gram[0x80104/4])
1985            {
1986               case 0x800000:      buffer = &m_framebuffer->pix32(y); break;
1987               case 0x200000:      buffer = &m_backbuffer->pix32(y); break;
1988               case 0x0e0000:      buffer = &m_overlay->pix32(y); break;
1989               case 0x000800:      buffer = &m_zbuffer->pix32(y); break;
1990               case 0x000200:      buffer = &m_stencil->pix32(y); break;
1991                 
1992               default:
1993               {
1994                  fatalerror("gfxfifo_exec: fb read from buffer %08X!\n", m_gfx_gram[0x80100/4]);
1995               }
1996            }
19361997
1998            fifo_out->push(NULL, buffer[x+0]);
1999            fifo_out->push(NULL, buffer[x+1]);
2000            fifo_out->push(NULL, buffer[x+2]);
2001            fifo_out->push(NULL, buffer[x+3]);
2002
19372003            cobra->m_gfx_re_status = RE_STATUS_IDLE;
19382004            break;
19392005         }
r15764r15765
19962062            //                     0xa40000FF 0x00000001
19972063
19982064            int reg = (w1 >> 8) & 0xfffff;
2065            UINT32 mask = m_gfx_regmask[w1 & 0xff];
19992066
2000            gfx_write_gram(reg, w2);
2067            gfx_write_gram(reg, mask, w2);
20012068
20022069            if (reg != 0x118 && reg != 0x114 && reg != 0x11c)
20032070            {
2004               printf("gfxfifo_exec: ram write %05X: %08X (%f)\n", reg, w2, u2f(w2));
2071               printf("gfxfifo_exec: ram write %05X (mask %08X): %08X (%f)\n", reg, mask, w2, u2f(w2));
20052072            }
20062073
20072074            cobra->m_gfx_re_status = RE_STATUS_IDLE;
r15764r15765
20312098               UINT64 value = 0;
20322099               fifo_in->pop(NULL, &value);
20332100
2034               gfx_write_gram(reg + (i*4), value);
2101               gfx_write_gram(reg + (i*4), 0xffffffff, value);
20352102            }
20362103
20372104            cobra->m_gfx_re_status = RE_STATUS_IDLE;
r15764r15765
20992166
21002167            cobra->m_gfx_unk_status |= 0x400;
21012168
2102            printf("gfxfifo_exec: tex_ints %d words left\n", num-cobra->m_gfx_re_word_count);
2169            if (cobra->m_gfx_re_word_count == 0)
2170               printf("gfxfifo_exec: tex_ints %d words left\n", num - cobra->m_gfx_re_word_count);
21032171
21042172            for (int i=0; i < num_left; i++)
21052173            {
src/mame/drivers/intrscti.c
r15764r15765
2020public:
2121   intrscti_state(const machine_config &mconfig, device_type type, const char *tag)
2222      : driver_device(mconfig, type, tag) ,
23      m_ram(*this, "ram"){ }
23      m_vram(*this, "vram"){ }
2424
25   required_shared_ptr<UINT8> m_ram;
26   DECLARE_READ8_MEMBER(unk_r);
25   required_shared_ptr<UINT8> m_vram;
26//   DECLARE_READ8_MEMBER(unk_r);
2727};
2828
29static VIDEO_START(intrscti)
30{
31}
2932
33static SCREEN_UPDATE_IND16(intrscti)
34{
35   intrscti_state *state = screen.machine().driver_data<intrscti_state>();
36   int y,x;
37   int count;
38
39   bitmap.fill(get_black_pen(screen.machine()), cliprect);
40
41   count = 0;
42   for (y=0;y<32;y++)
43   {
44      for (x=0;x<32;x++)
45      {
46         int dat;
47         dat = state->m_vram[count];
48         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],dat/*+0x100*/,0,0,0,x*8,y*8,0);
49         count++;
50      }
51   }
52
53   count = 0x400;
54   for (y=0;y<32;y++)
55   {
56      for (x=0;x<32;x++)
57      {
58         int dat;
59         dat = state->m_vram[count];
60         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],dat+0x100,0,0,0,x*8,y*8,0);
61         count++;
62      }
63   }
64
65   return 0;
66}
67
68#if 0
3069READ8_MEMBER(intrscti_state::unk_r)
3170{
3271   return machine().rand();
3372}
73#endif
3474
3575static ADDRESS_MAP_START( intrscti_map, AS_PROGRAM, 8, intrscti_state )
3676   AM_RANGE(0x0000, 0x1fff) AM_ROM
3777   AM_RANGE(0x6000, 0x67ff) AM_RAM
38   AM_RANGE(0x7000, 0x77ff) AM_RAM AM_SHARE("ram") // video ram
78   AM_RANGE(0x7000, 0x77ff) AM_RAM AM_SHARE("vram")
3979   AM_RANGE(0x8000, 0x8fff) AM_ROM
4080ADDRESS_MAP_END
4181
4282static ADDRESS_MAP_START( readport, AS_IO, 8, intrscti_state )
4383   ADDRESS_MAP_GLOBAL_MASK(0xff)
44   AM_RANGE(0x00, 0x00) AM_READ(unk_r )
45   AM_RANGE(0x01, 0x01) AM_READ(unk_r )
84   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
85   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
4686ADDRESS_MAP_END
4787
4888
4989static INPUT_PORTS_START( intrscti )
90   PORT_START("IN0")
91   PORT_DIPNAME( 0x01, 0x01, "DSWA" )
92   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
93   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
94   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
95   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
96   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
97   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
98   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
99   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
100   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
101   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
102   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
103   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
104   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
105   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
106   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
107   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
108   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
109   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
110   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
111   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
112   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
113   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
114   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
115
116   PORT_START("IN1")
117   PORT_DIPNAME( 0x01, 0x01, "DSWA" )
118   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
119   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
120   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
121   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
122   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
123   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
124   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
125   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
126   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
127   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
128   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
129   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
130   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
131   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
132   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
133   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
134   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
135   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
136   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
137   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
138   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
139   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
140   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
50141INPUT_PORTS_END
51142
52143static const gfx_layout tiles8x8_layout =
r15764r15765
64155   GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 16 )
65156GFXDECODE_END
66157
67static VIDEO_START(intrscti)
68{
69}
70158
71static SCREEN_UPDATE_IND16(intrscti)
72{
73   intrscti_state *state = screen.machine().driver_data<intrscti_state>();
74   int y,x;
75   int count;
76
77   bitmap.fill(get_black_pen(screen.machine()), cliprect);
78
79   count = 0;
80   for (y=0;y<64;y++)
81   {
82      for (x=0;x<32;x++)
83      {
84         int dat;
85         dat = state->m_ram[count];
86         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],dat/*+0x100*/,0,0,0,x*8,y*8,0);
87         count++;
88      }
89   }
90
91
92   return 0;
93}
94
95159static MACHINE_CONFIG_START( intrscti, intrscti_state )
96160   /* basic machine hardware */
97161   MCFG_CPU_ADD("maincpu", Z80,4000000)       /* ? MHz */
r15764r15765
103167   MCFG_SCREEN_ADD("screen", RASTER)
104168   MCFG_SCREEN_REFRESH_RATE(60)
105169   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
106   MCFG_SCREEN_SIZE(256, 512)
107   MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 512-1)
170   MCFG_SCREEN_SIZE(256, 256)
171   MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
108172   MCFG_SCREEN_UPDATE_STATIC(intrscti)
109173
110174   MCFG_GFXDECODE(intrscti)
r15764r15765
131195
132196static DRIVER_INIT( intrscti )
133197{
198   intrscti_state *state = machine.driver_data<intrscti_state>();
134199   UINT8 *cpu = machine.root_device().memregion( "maincpu" )->base();
135200   int i;
136   for (i=0x8000;i<0x8fff;i++)
201   for (i=0;i<0x1000;i++)
202      cpu[i+0x8000]=0xc9; // ret
203
204   /*
205   0x8208 -> string copy
206   */
207
208   /* one of the protection sub-routines does this */
209   for (i=0;i<0x400;i++)
137210   {
138      cpu[i]=0xc9; // ret
211      state->m_vram[i+0x000] = 0x0e;
212      state->m_vram[i+0x400] = 0xff;
139213   }
140214}
141215
142GAME( 19??, intrscti,  0,    intrscti, intrscti, intrscti_state, intrscti, ROT0, "<unknown>", "Intersecti", GAME_IS_SKELETON )
216GAME( 19??, intrscti,  0,    intrscti, intrscti, intrscti_state, intrscti, ROT0, "<unknown>", "Intersecti", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_NO_SOUND )
src/mame/drivers/lgp.c
r15764r15765
9393
9494
9595/* VIDEO GOODS */
96static SCREEN_UPDATE_IND16( lgp )
96static SCREEN_UPDATE_RGB32( lgp )
9797{
9898   lgp_state *state = screen.machine().driver_data<lgp_state>();
9999   int charx, chary;
src/mame/drivers/timetrv.c
r15764r15765
5050
5151}
5252
53static SCREEN_UPDATE_IND16( timetrv )
53static SCREEN_UPDATE_RGB32( timetrv )
5454{
5555   timetrv_state *state = screen.machine().driver_data<timetrv_state>();
5656   popmessage("%s%s",reinterpret_cast<char *>(state->m_led_vram_lo.target()),reinterpret_cast<char *>(state->m_led_vram_hi.target()));
src/mame/drivers/deco_ld.c
r15764r15765
55preliminary driver by Angelo Salese
66
77TODO:
8- laserdisc hook-ups;
9- video emulation is bare bones;
10- i/os
8- laserdisc hook-up and 6850 comms;
9- "RAM TEST ERROR 5J" in Bega's Battle and Cobra Command
10- "SOUND TEST READ ERROR"
11- color offset number origin is unknown;
12- Bega's Battle VBLANK hack (ld/framework fault most likely)
13- CPU clocks
14- dip-switches
15- clean-ups
1116
1217***************************************************************************
1318
r15764r15765
112117public:
113118   deco_ld_state(const machine_config &mconfig, device_type type, const char *tag)
114119      : driver_device(mconfig, type, tag),
115        m_laserdisc(*this, "laserdisc") ,
116      m_videoram(*this, "videoram"){ }
120        m_maincpu(*this, "maincpu"),
121        m_audiocpu(*this, "audiocpu"),
122        m_laserdisc(*this, "laserdisc"),
123        m_vram0(*this, "vram0"),
124        m_attr0(*this, "attr0"),
125        m_vram1(*this, "vram1"),
126        m_attr1(*this, "attr1")
127        { }
117128
129   required_device<cpu_device> m_maincpu;
130   optional_device<cpu_device> m_audiocpu;
118131   required_device<pioneer_ldv1000_device> m_laserdisc;
119   required_shared_ptr<UINT8> m_videoram;
120   UINT8 m_vram_bank;
132   required_shared_ptr<UINT8> m_vram0;
133   required_shared_ptr<UINT8> m_attr0;
134   required_shared_ptr<UINT8> m_vram1;
135   required_shared_ptr<UINT8> m_attr1;
136
121137   UINT8 m_laserdisc_data;
122138   int m_nmimask;
123139   DECLARE_WRITE8_MEMBER(rblaster_sound_w);
124   DECLARE_WRITE8_MEMBER(rblaster_vram_bank_w);
125140   DECLARE_READ8_MEMBER(laserdisc_r);
126141   DECLARE_WRITE8_MEMBER(laserdisc_w);
127   DECLARE_READ8_MEMBER(test_r);
142   DECLARE_READ8_MEMBER(sound_status_r);
128143   DECLARE_WRITE8_MEMBER(nmimask_w);
144   DECLARE_WRITE8_MEMBER(decold_sound_cmd_w);
145   DECLARE_WRITE8_MEMBER(decold_palette_w);
146   DECLARE_CUSTOM_INPUT_MEMBER(begas_vblank_r);
147   DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
129148};
130149
150static void draw_sprites(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT8 *spriteram, UINT16 tile_bank )
151{
152   const gfx_element *gfx = machine.gfx[1];
153   int i,spr_offs,x,y,col,fx,fy;
131154
155   /*
156   [+0] ---- -x-- flip X
157   [+0] ---- --x- flip Y
158   [+0] ---- ---x enable this sprite
159   [+1] tile number
160   [+2] y coord
161   [+3] x coord
162   */
132163
133static SCREEN_UPDATE_IND16( rblaster )
164   for(i=0;i<0x20;i+=4)
165   {
166      if(!spriteram[i+0] & 1)
167         continue;
168
169      spr_offs = spriteram[i+1]|tile_bank;
170      x = spriteram[i+3];
171      y = spriteram[i+2];
172      col = 6; /* TODO */
173      fx = (spriteram[i+0] & 0x04) ? 1 : 0;
174      fy = (spriteram[i+0] & 0x02) ? 1 : 0;
175
176      drawgfx_transpen(bitmap,cliprect,gfx,spr_offs,col,fx,fy,x,y,0);
177   }
178
179   for(i=0x3e0;i<0x400;i+=4)
180   {
181      if(!spriteram[i+0] & 1)
182         continue;
183
184      spr_offs = spriteram[i+1]|tile_bank;
185      x = spriteram[i+3];
186      y = spriteram[i+2];
187      col = 6; /* TODO */
188      fx = (spriteram[i+0] & 0x04) ? 1 : 0;
189      fy = (spriteram[i+0] & 0x02) ? 1 : 0;
190
191      drawgfx_transpen(bitmap,cliprect,gfx,spr_offs,col,fx,fy,x,y,0);
192   }
193}
194
195static SCREEN_UPDATE_RGB32( rblaster )
134196{
135197   deco_ld_state *state = screen.machine().driver_data<deco_ld_state>();
136   UINT8 *videoram = state->m_videoram;
137198   const gfx_element *gfx = screen.machine().gfx[0];
138   int count = 0x0000;
139
140199   int y,x;
141200
201   bitmap.fill(0, cliprect);
202
203   draw_sprites(screen.machine(), bitmap,cliprect,state->m_vram1,0x000);
204   draw_sprites(screen.machine(), bitmap,cliprect,state->m_vram0,0x100);
205
142206   for (y=0;y<32;y++)
143207   {
144208      for (x=0;x<32;x++)
145209      {
146         int tile = videoram[count];
147         int colour = (state->m_vram_bank & 0x7);
148         drawgfx_opaque(bitmap,cliprect,gfx,tile,colour,0,0,x*8,y*8);
210         int attr = state->m_attr0[x+y*32];
211         int tile = state->m_vram0[x+y*32] | ((attr & 3) << 8);
212         int colour = (6 & 0x7); /* TODO */
149213
150         count++;
214         drawgfx_transpen(bitmap,cliprect,gfx,tile|0x400,colour,0,0,x*8,y*8,0);
151215      }
152216   }
153217
218   for (y=0;y<32;y++)
219   {
220      for (x=0;x<32;x++)
221      {
222         int attr = state->m_attr1[x+y*32];
223         int tile = state->m_vram1[x+y*32] | ((attr & 3) << 8);
224         int colour = (6 & 0x7); /* TODO */
225
226         drawgfx_transpen(bitmap,cliprect,gfx,tile,colour,0,0,x*8,y*8,0);
227      }
228   }
229
154230   return 0;
155231}
156232
157#if 0
158WRITE8_MEMBER(deco_ld_state::rblaster_sound_w)
159{
160   soundlatch_byte_w(space,0,data);
161   device_set_input_line(machine().cpu[1], 0, HOLD_LINE);
162}
163#endif
164233
165WRITE8_MEMBER(deco_ld_state::rblaster_vram_bank_w)
166{
167   m_vram_bank = data;
168}
169234
170235READ8_MEMBER(deco_ld_state::laserdisc_r)
171236{
r15764r15765
180245   m_laserdisc_data = data;
181246}
182247
183READ8_MEMBER(deco_ld_state::test_r)
248
249WRITE8_MEMBER(deco_ld_state::decold_sound_cmd_w)
184250{
185   return machine().rand();
251   soundlatch_byte_w(space, 0, data);
252   device_set_input_line(m_audiocpu, 0, HOLD_LINE);
186253}
187254
188static ADDRESS_MAP_START( begas_map, AS_PROGRAM, 8, deco_ld_state )
189   AM_RANGE(0x0000, 0x0fff) AM_RAM
190//  AM_RANGE(0x1000, 0x1007) AM_NOP
191   AM_RANGE(0x1000, 0x1000) AM_READ(test_r)
192   AM_RANGE(0x1001, 0x1001) AM_READ(test_r)
193   AM_RANGE(0x1002, 0x1002) AM_READ(test_r)
194   AM_RANGE(0x1003, 0x1003) AM_READ(test_r)
195   AM_RANGE(0x1001, 0x1001) AM_WRITENOP //???
196//  AM_RANGE(0x1003, 0x1003) AM_READ_PORT("IN0")
197   AM_RANGE(0x1003, 0x1003) AM_WRITE(rblaster_vram_bank_w) //might be 1001
198   AM_RANGE(0x1006, 0x1006) AM_NOP //ld status / command
199   AM_RANGE(0x1007, 0x1007) AM_READWRITE(laserdisc_r,laserdisc_w) // ld data
200   AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(paletteram_RRRGGGBB_byte_w) AM_SHARE("paletteram")
201   AM_RANGE(0x2000, 0x27ff) AM_RAM
202   AM_RANGE(0x2800, 0x2fff) AM_RAM AM_SHARE("videoram")
203   AM_RANGE(0x3000, 0x3fff) AM_RAM
204   AM_RANGE(0x4000, 0xffff) AM_ROM
205ADDRESS_MAP_END
255/* same as Burger Time HW */
256WRITE8_MEMBER(deco_ld_state::decold_palette_w)
257{
258   paletteram_BBGGGRRR_byte_w(space, offset, ~data);
259}
206260
207static ADDRESS_MAP_START( cobra_map, AS_PROGRAM, 8, deco_ld_state )
208   AM_RANGE(0x0000, 0x0fff) AM_RAM
209   AM_RANGE(0x1000, 0x1000) AM_READ_PORT("IN1")
210   AM_RANGE(0x1001, 0x1001) AM_READ(test_r)//_PORT("IN2")
211   AM_RANGE(0x1002, 0x1002) AM_READ(test_r)//_PORT("IN3")
212   AM_RANGE(0x1003, 0x1003) AM_READ(test_r)//AM_READ_PORT("IN0")
213//  AM_RANGE(0x1004, 0x1004) AM_READ(test_r)//_PORT("IN4")
214//  AM_RANGE(0x1005, 0x1005) AM_READ(test_r)//_PORT("IN5")
215   AM_RANGE(0x1004, 0x1004) AM_WRITE(rblaster_vram_bank_w) //might be 1001
216   AM_RANGE(0x1006, 0x1006) AM_NOP //ld status / command
217   AM_RANGE(0x1007, 0x1007) AM_READWRITE(laserdisc_r,laserdisc_w) // ld data
218   AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(paletteram_RRRGGGBB_byte_w) AM_SHARE("paletteram")
219   AM_RANGE(0x2000, 0x2fff) AM_RAM
220   AM_RANGE(0x3000, 0x37ff) AM_RAM //vram attr?
221   AM_RANGE(0x3800, 0x3fff) AM_RAM AM_SHARE("videoram")
222   AM_RANGE(0x4000, 0xffff) AM_ROM
223ADDRESS_MAP_END
261/* unknown, but certainly related to audiocpu somehow */
262READ8_MEMBER(deco_ld_state::sound_status_r)
263{
264   return 0xff ^ 0x40;
265}
224266
225
226267static ADDRESS_MAP_START( rblaster_map, AS_PROGRAM, 8, deco_ld_state )
227268   AM_RANGE(0x0000, 0x0fff) AM_RAM
228//  AM_RANGE(0x1000, 0x1007) AM_NOP
229   AM_RANGE(0x1001, 0x1001) AM_WRITENOP //???
230   AM_RANGE(0x1003, 0x1003) AM_READ_PORT("IN0")
231   AM_RANGE(0x1003, 0x1003) AM_WRITE(rblaster_vram_bank_w) //might be 1001
232   AM_RANGE(0x1006, 0x1006) AM_NOP //ld status / command
233   AM_RANGE(0x1007, 0x1007) AM_READWRITE(laserdisc_r,laserdisc_w) // ld data
234   AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(paletteram_RRRGGGBB_byte_w) AM_SHARE("paletteram")
235   AM_RANGE(0x2800, 0x2fff) AM_RAM AM_SHARE("videoram")
236   AM_RANGE(0x3000, 0x3fff) AM_RAM
237   AM_RANGE(0xc000, 0xffff) AM_ROM
269   AM_RANGE(0x1000, 0x1000) AM_READ_PORT("IN0") AM_WRITENOP // (w) coin lockout
270   AM_RANGE(0x1001, 0x1001) AM_READ_PORT("DSW1")
271   AM_RANGE(0x1002, 0x1002) AM_READ_PORT("DSW2")
272   AM_RANGE(0x1003, 0x1003) AM_READ_PORT("IN1")
273   AM_RANGE(0x1004, 0x1004) AM_READ(soundlatch2_byte_r) AM_WRITE(decold_sound_cmd_w)
274   AM_RANGE(0x1005, 0x1005) AM_READ(sound_status_r)
275   AM_RANGE(0x1006, 0x1006) AM_NOP // 6850 status
276   AM_RANGE(0x1007, 0x1007) AM_READWRITE(laserdisc_r,laserdisc_w) // 6850 data
277   AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(decold_palette_w) AM_SHARE("paletteram")
278   AM_RANGE(0x2000, 0x27ff) AM_RAM
279   AM_RANGE(0x2800, 0x2bff) AM_RAM AM_SHARE("vram0")
280   AM_RANGE(0x2c00, 0x2fff) AM_RAM AM_SHARE("attr0")
281   AM_RANGE(0x3000, 0x37ff) AM_RAM
282   AM_RANGE(0x3800, 0x3bff) AM_RAM AM_SHARE("vram1")
283   AM_RANGE(0x3c00, 0x3fff) AM_RAM AM_SHARE("attr1")
284   AM_RANGE(0x4000, 0xffff) AM_ROM
238285ADDRESS_MAP_END
239286
287
240288/* sound arrangement is pratically identical to Zero Target. */
241289
242290#ifdef UNUSED_FUNCTION
r15764r15765
259307   AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
260308   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
261309   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
262   AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
310   AM_RANGE(0xa000, 0xa000) AM_READWRITE(soundlatch_byte_r,soundlatch2_byte_w)
263311   AM_RANGE(0xe000, 0xffff) AM_ROM
264312ADDRESS_MAP_END
265313
266static INPUT_PORTS_START( cobra )
314CUSTOM_INPUT_MEMBER( deco_ld_state::begas_vblank_r )
315{
316   return machine().primary_screen->vpos() >= 240*2;
317}
318
319INPUT_CHANGED_MEMBER(deco_ld_state::coin_inserted)
320{
321   device_set_input_line(m_maincpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
322}
323
324static INPUT_PORTS_START( begas )
267325   PORT_START("IN0")
268   PORT_DIPNAME( 0x01, 0x00, "SYS0" )
269   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
270   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
271   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
272   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
273   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
274   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
275   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
276   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
277   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
278   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
279   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
280   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
281   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
282   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
283   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
284   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
285   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
286   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
287   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
288   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
289   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
326   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
327   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
328   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
329   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
330   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
331   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
332   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
333   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_TILT )
290334
291335   PORT_START("IN1")
292   PORT_DIPNAME( 0x01, 0x00, "SYS1" )
293   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
294   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
295   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
296   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
297   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
298   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
299   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
300   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
301   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
302   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
303   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
304   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
305   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
306   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
307   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
308   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
309   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
310   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
311   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
312   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
313   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
314   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
315   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
336   PORT_DIPNAME( 0x01, 0x01, "DSWA" )
337   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
338   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
339   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
340   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
341   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
342   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
343   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
344   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
345   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
346   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
347   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
348   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
349   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
350   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
351   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
352   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
353   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
354   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
355   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
356   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
357   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL )  PORT_CUSTOM_MEMBER(DEVICE_SELF,deco_ld_state,begas_vblank_r, NULL) // TODO: IPT_VBLANK doesn't seem to work fine?
316358
317   PORT_START("IN2")
318   PORT_DIPNAME( 0x01, 0x00, "SYS2" )
319   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
320   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
321   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
322   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
323   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
324   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
325   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
326   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
327   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
328   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
329   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
330   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
331   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
332   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
333   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
334   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
335   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
336   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
337   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
338   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
339   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
340   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
341   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
359   PORT_START("DSW1")
360   PORT_DIPNAME( 0x01, 0x01, "DSWA" )
361   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
362   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
363   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
364   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
365   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
366   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
367   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
368   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
369   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
370   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
371   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
372   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
373   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
374   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, deco_ld_state,coin_inserted, 0)
375   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, deco_ld_state,coin_inserted, 0)
342376
343   PORT_START("IN3")
344   PORT_DIPNAME( 0x01, 0x00, "SYS3" )
345   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
346   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
347   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
348   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
349   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
350   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
351   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
352   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
353   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
354   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
355   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
356   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
357   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
358   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
359   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
360   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
361   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
362   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
363   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
364   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
365   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
366   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
367   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
377   PORT_START("DSW2")
378   PORT_DIPNAME( 0x01, 0x01, "DSWA" )
379   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
380   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
381   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
382   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
383   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
384   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
385   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
386   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
387   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
388   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
389   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
390   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
391   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
392   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
393   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
394   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
395   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
396   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
397   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
398   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
399   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Service_Mode ) )
400   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
401   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
402INPUT_PORTS_END
368403
369   PORT_START("IN4")
370   PORT_DIPNAME( 0x01, 0x00, "SYS4" )
371   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
372   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
373   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
374   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
375   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
376   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
377   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
378   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
379   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
380   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
381   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
382   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
383   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
384   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
385   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
386   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
387   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
388   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
389   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
390   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
391   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
392   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
393   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
394404
395   PORT_START("IN5")
396   PORT_DIPNAME( 0x01, 0x00, "SYS5" )
397   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
398   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
399   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
400   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
401   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
402   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
403   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
404   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
405   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
406   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
407   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
408   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
409   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
410   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
411   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
412   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
413   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
414   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
415   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
416   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
417   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
418   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
419   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
405static INPUT_PORTS_START( cobra )
406   PORT_INCLUDE( begas )
407
408   PORT_MODIFY("IN1")
409   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
410
411   /* TODO: dips */
420412INPUT_PORTS_END
421413
422414static INPUT_PORTS_START( rblaster )
423   PORT_START("IN0")
424   PORT_DIPNAME( 0x01, 0x00, "SYS0" )
425   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
426   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
427   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
428   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
429   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
430   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
431   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
432   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
433   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
434   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
435   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
436   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
437   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
438   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
439   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
440   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
441   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
442   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
443   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
444   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
415   PORT_INCLUDE( begas )
416
417   PORT_MODIFY("IN1")
445418   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
446419
447   PORT_START("IN1")
448   PORT_DIPNAME( 0x01, 0x00, "SYS1" )
449   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
450   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
451   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
452   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
453   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
454   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
455   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
456   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
457   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
458   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
459   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
460   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
461   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
462   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
463   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
464   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
465   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
466   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
467   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
468   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
469   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
470   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
471   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
472
473   PORT_START("IN2")
474   PORT_DIPNAME( 0x01, 0x00, "SYS2" )
475   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
476   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
477   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
478   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
479   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
480   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
481   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
482   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
483   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
484   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
485   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
486   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
487   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
488   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
489   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
490   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
491   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
492   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
493   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
494   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
495   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
496   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
497   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
420   /* TODO: dips */
498421INPUT_PORTS_END
499422
500423static const gfx_layout charlayout =
r15764r15765
502425   8,8,
503426   RGN_FRAC(1,3),
504427   3,
505   { RGN_FRAC(0,3),RGN_FRAC(1,3),RGN_FRAC(2,3) },
428   { RGN_FRAC(2,3),RGN_FRAC(1,3),RGN_FRAC(0,3) },
506429   { 7, 6, 5, 4, 3, 2, 1, 0 },
507430   { 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 },
508431   8*8
509432};
510433
434
435static const gfx_layout spritelayout =
436{
437   16,16,
438   RGN_FRAC(1,3),
439   3,
440   { RGN_FRAC(2,3),RGN_FRAC(1,3),RGN_FRAC(0,3) },
441   { 7, 6, 5, 4, 3, 2, 1, 0, 16*8+7, 16*8+6, 16*8+5, 16*8+4, 16*8+3, 16*8+2, 16*8+1, 16*8+0 },
442   { 15*8, 14*8, 13*8, 12*8, 11*8, 10*8, 9*8, 8*8,
443         7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 },
444   16*16
445};
446
511447static GFXDECODE_START( rblaster )
512448   GFXDECODE_ENTRY( "gfx1", 0, charlayout,     0, 8 )
449   GFXDECODE_ENTRY( "gfx1", 0, spritelayout,     0, 8 )
513450GFXDECODE_END
514451
515452static MACHINE_START( rblaster )
r15764r15765
521458   /* basic machine hardware */
522459   MCFG_CPU_ADD("maincpu",M6502,8000000/2)
523460   MCFG_CPU_PROGRAM_MAP(rblaster_map)
524//  MCFG_CPU_VBLANK_INT("screen",irq0_line_hold)
525   MCFG_CPU_VBLANK_INT("screen",nmi_line_pulse)
461   MCFG_CPU_VBLANK_INT("screen",irq0_line_hold)
526462
527463   MCFG_CPU_ADD("audiocpu",M6502,8000000/2)
528464   MCFG_CPU_PROGRAM_MAP(rblaster_sound_map)
529//  MCFG_CPU_VBLANK_INT("screen",irq0_line_hold) //test
530465   MCFG_CPU_PERIODIC_INT(sound_interrupt, 640)
531466
467//   MCFG_QUANTUM_TIME(attotime::from_hz(6000))
468
532469   MCFG_LASERDISC_LDV1000_ADD("laserdisc") //Sony LDP-1000A, is it truly compatible with the Pioneer?
533470   MCFG_LASERDISC_OVERLAY_STATIC(256, 256, rblaster)
471   MCFG_LASERDISC_OVERLAY_CLIP(0, 256-1, 8, 240-1)
534472
535473   /* video hardware */
536474   MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", "laserdisc")
r15764r15765
539477   MCFG_MACHINE_START(rblaster)
540478
541479   /* sound hardware */
480   /* TODO: mixing */
542481   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
543482   MCFG_SOUND_ADD("ay1", AY8910, 1500000)
544   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
483   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25)
484   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25)
545485
546486   MCFG_SOUND_ADD("ay2", AY8910, 1500000)
547   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
487   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25)
488   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25)
548489
549490   MCFG_SOUND_MODIFY("laserdisc")
550491   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
551492   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
552493MACHINE_CONFIG_END
553494
554static MACHINE_CONFIG_DERIVED( begas, rblaster )
555   MCFG_CPU_MODIFY("maincpu")
556   MCFG_CPU_PROGRAM_MAP(begas_map)
557MACHINE_CONFIG_END
558
559static MACHINE_CONFIG_DERIVED( cobra, rblaster )
560   MCFG_CPU_MODIFY("maincpu")
561   MCFG_CPU_PROGRAM_MAP(cobra_map)
562
563   MCFG_DEVICE_REMOVE("audiocpu")
564MACHINE_CONFIG_END
565
566495/***************************************************************************
567496
568497  Game driver(s)
r15764r15765
575504   ROM_LOAD( "an04-3",   0x6000, 0x2000, CRC(935b2b0a) SHA1(e7c09960607569bd88e9af396aa70661f4352efb) )
576505   ROM_LOAD( "an03-3",   0x8000, 0x2000, CRC(79438d80) SHA1(e641336f23c6b84d84313ef3e94871ac9aa8b612) )
577506   ROM_LOAD( "an02-3",   0xa000, 0x2000, CRC(98ce4ca0) SHA1(e7db66b1f0f06b0a21e7450962ba70f460a24847) )
578   ROM_LOAD( "an01",     0xc000, 0x2000, CRC(15f8921d) SHA1(32f945bee8f30e5896da38ac6184a11c0a8194bb) ) //ok?
507   ROM_LOAD( "an01",     0xc000, 0x2000, CRC(15f8921d) SHA1(32f945bee8f30e5896da38ac6184a11c0a8194bb) )
579508   ROM_LOAD( "an00-3",   0xe000, 0x2000, CRC(124a3a36) SHA1(e2f7110196cb46fcda429c613388285b46ec1a9e) )
580509
581510   ROM_REGION( 0x10000, "audiocpu", 0 )
582511   ROM_LOAD( "an06",   0xe000, 0x2000, CRC(cbbcd730) SHA1(2f2e78fcf2eba71044bec60d27d8756d9b5af551) )
583512
584   ROM_REGION( 0xc000, "gfx1", ROMREGION_INVERT )
513   ROM_REGION( 0xc000, "gfx1", 0 )
585514   ROM_LOAD( "an0a",   0x0000, 0x2000, CRC(e429305d) SHA1(9a05ab7916235d028b6b05270703516581825660) )
586515   ROM_LOAD( "an0b",   0x4000, 0x2000, CRC(09e4b780) SHA1(0735420b8529017e507feecf8f74fecd80fbf7d5) )
587516   ROM_LOAD( "an0c",   0x8000, 0x2000, CRC(0c127207) SHA1(b8372b2fa20ffe5ac278f558c07fd761c86e514b) )
r15764r15765
618547   ROM_REGION( 0x10000, "audiocpu", 0 )
619548   ROM_LOAD( "an06",   0xe000, 0x2000, CRC(cbbcd730) SHA1(2f2e78fcf2eba71044bec60d27d8756d9b5af551) )
620549
621   ROM_REGION( 0xc000, "gfx1", ROMREGION_INVERT )
550   ROM_REGION( 0xc000, "gfx1", 0 )
622551   ROM_LOAD( "an0a",   0x0000, 0x2000, CRC(e429305d) SHA1(9a05ab7916235d028b6b05270703516581825660) )
623552   ROM_LOAD( "an0b",   0x4000, 0x2000, CRC(09e4b780) SHA1(0735420b8529017e507feecf8f74fecd80fbf7d5) )
624553   ROM_LOAD( "an0c",   0x8000, 0x2000, CRC(0c127207) SHA1(b8372b2fa20ffe5ac278f558c07fd761c86e514b) )
r15764r15765
651580   ROM_REGION( 0x10000, "audiocpu", 0 )
652581   ROM_LOAD( "02.bin",   0xe000, 0x2000, CRC(6c20335d) SHA1(b28e80f112553af8e3fba9ebbfc10d1f56396ac1) )
653582
654   ROM_REGION( 0xc000, "gfx1", ROMREGION_INVERT )
583   ROM_REGION( 0xc000, "gfx1", 0 )
655584   ROM_LOAD( "03.bin",   0x0000, 0x2000, CRC(d1ff5ffb) SHA1(29df207e225e3b0477d5566d256198310d6ae526) )
656585   ROM_LOAD( "06.bin",   0x2000, 0x2000, CRC(d1ff5ffb) SHA1(29df207e225e3b0477d5566d256198310d6ae526) )
657586   ROM_LOAD( "04.bin",   0x4000, 0x2000, CRC(da2c84d9) SHA1(3452b0e2a45fa771e226c3a3668afbf3ceb0ec11) )
r15764r15765
671600   ROM_LOAD( "au00-2",   0xe000, 0x2000, CRC(6c0f1f16) SHA1(ed05d3eaa24e84b1dfb4e1eb5f69b23e4a1494ba) )
672601   ROM_COPY( "maincpu",  0x8000, 0x4000, 0x4000 )
673602
674   ROM_REGION( 0xc000, "gfx1", ROMREGION_INVERT )
603   ROM_REGION( 0x10000, "audiocpu", 0 )
604   ROM_LOAD( "au06",   0xe000, 0x2000, CRC(ccc94eb0) SHA1(354a933ddc6a1e1118c2bf176faaab5d01fc92d3) )
605
606   ROM_REGION( 0xc000, "gfx1", 0 )
675607   ROM_LOAD( "au0a",   0x0000, 0x2000, CRC(6aaedcf3) SHA1(52dc913eecf8a159784d500217cffd7a6d8eb45c) )
676608   ROM_LOAD( "au0b",   0x4000, 0x2000, CRC(92247877) SHA1(f9bb0c20212ab13caabfb5beb9b6afc807bc9555) )
677609   ROM_LOAD( "au0c",   0x8000, 0x2000, CRC(d00a2762) SHA1(84d4329b39b9fd30682b7efa5cb2744934c5ee5c) )
r15764r15765
684616   DISK_IMAGE_READONLY( "cobra", 0, SHA1(8390498294aca97a5d1769032e7b115d1a42f5d3) )
685617ROM_END
686618
687GAME( 1983, begas,  0,       begas,  cobra, deco_ld_state,  0, ROT0,    "Data East", "Bega's Battle (Revision 3)", GAME_NOT_WORKING )
688GAME( 1983, begas1, begas,   rblaster,  cobra, deco_ld_state,  0, ROT0, "Data East", "Bega's Battle (Revision 1)", GAME_NOT_WORKING )
689GAME( 1984, cobra,  0,       cobra,     cobra, deco_ld_state,  0, ROT0, "Data East", "Cobra Command (Data East LD)", GAME_NOT_WORKING )
619GAME( 1983, begas,  0,       rblaster,  begas,    deco_ld_state,  0, ROT0, "Data East", "Bega's Battle (Revision 3)", GAME_NOT_WORKING )
620GAME( 1983, begas1, begas,   rblaster,  begas,    deco_ld_state,  0, ROT0, "Data East", "Bega's Battle (Revision 1)", GAME_NOT_WORKING )
621GAME( 1984, cobra,  0,       rblaster,  cobra,    deco_ld_state,  0, ROT0, "Data East", "Cobra Command (Data East LD)", GAME_NOT_WORKING )
690622// Thunder Storm (Cobra Command Japanese version)
691623GAME( 1985, rblaster,  0,    rblaster,  rblaster, deco_ld_state,  0, ROT0, "Data East", "Road Blaster (Data East LD)", GAME_NOT_WORKING )
src/mame/drivers/istellar.c
r15764r15765
33Driver by Andrew Gardner with help from Daphne Source
44
55Notes:
6    Holding down the TEST switch (T) while hitting reset will bring up the Self Test.
7    Hit T twice more for color and monitor calibration.
6    Holding down the TEST switch while hitting reset will bring up the Self Test.
7    Hit TEST switch again for color and monitor calibration.
88    This is somewhat strange hardware : More z80's than necessary
99                                        3 bpp sprites
1010                                        6-pin dip switches with odd handling
r15764r15765
5858
5959
6060/* VIDEO GOODS */
61static SCREEN_UPDATE_IND16( istellar )
61static SCREEN_UPDATE_RGB32( istellar )
6262{
6363   istellar_state *state = screen.machine().driver_data<istellar_state>();
64   int charx, chary;
64   int x, y;
6565
6666   /* clear */
6767   bitmap.fill(0, cliprect);
6868
69   /* DEBUG */
70   /*
71    for (charx = 0; charx < 0x400; charx ++)
72    {
73        printf ("%x ", state->m_sprite_ram[charx]) ;
74    }
75    printf("\n\n\n");
76    */
77
7869   /* Draw tiles */
79   for (charx = 0; charx < 32; charx++)
70   for (y = 0; y < 32; y++)
8071   {
81      for (chary = 0; chary < 32; chary++)
72      for (x = 0; x < 32; x++)
8273      {
83         int current_screen_character = (chary*32) + charx;
74         int tile = state->m_tile_ram[x+y*32];
75         int attr = state->m_tile_control_ram[x+y*32];
8476
85         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0],
86               state->m_tile_ram[current_screen_character],
87               (state->m_tile_control_ram[current_screen_character] & 0x0f),
88               0, 0, charx*8, chary*8, 0);
77         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0],tile,attr & 0x0f,0, 0, x*8, y*8, 0);
8978      }
9079   }
9180
r15764r15765
256245   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:!5")      /* Maybe SERVICE? */
257246   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
258247   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
259   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "TEST" ) PORT_CODE( KEYCODE_T )
248   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_HIGH )
260249   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
261250   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
262251   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
r15764r15765
277266   const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
278267   int i;
279268
280   /* Oddly enough, the top 4 bits of each byte is 0 */
281269   for (i = 0; i < machine.total_colors(); i++)
282270   {
283271      int r,g,b;
r15764r15765
308296
309297      palette_set_color(machine,i,MAKE_RGB(r,g,b));
310298   }
311
312   /* make color 0 transparent */
313   palette_set_color(machine, 0, MAKE_ARGB(0,0,0,0));
314299}
315300
316301static const gfx_layout istellar_gfx_layout =
317302{
318303   8,8,
319   0x2000/8,
304   RGN_FRAC(1,3),
320305   3,
321   { 0, 0x2000*8, 0x4000*8 },
306   { RGN_FRAC(0,3), RGN_FRAC(1,3), RGN_FRAC(2,3) },
322307   { 0,1,2,3,4,5,6,7 },
323308   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
324309   8*8
325310};
326311
327312static GFXDECODE_START( istellar )
328   GFXDECODE_ENTRY( "gfx1", 0, istellar_gfx_layout, 0x0, 0x100 )
313   GFXDECODE_ENTRY( "gfx1", 0, istellar_gfx_layout, 0x0, 0x20 )
329314GFXDECODE_END
330315
331316static INTERRUPT_GEN( vblank_callback_istellar )
332317{
333318   /* Interrupt presumably comes from VBlank */
334   device_set_input_line(device, 0, ASSERT_LINE);
319   device_set_input_line(device, 0, HOLD_LINE);
335320
336321   /* Interrupt presumably comes from the LDP's status strobe */
337322   cputag_set_input_line(device->machine(), "sub", 0, ASSERT_LINE);
r15764r15765
417402{
418403   istellar_state *state = machine.driver_data<istellar_state>();
419404   state->m_z80_2_nmi_enable = 0;
405
406   #if 0
407   {
408      UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
409
410      ROM[0x4465] = 0x00;
411      ROM[0x4466] = 0x00;
412      ROM[0x4478] = 0x00;
413      ROM[0x4479] = 0x00;
414      ROM[0x43b4] = 0x00;
415      ROM[0x43b5] = 0x00;
416      ROM[0x4409] = 0x20;
417      ROM[0x46de] = 0x00;
418      ROM[0x46df] = 0x00;
419   }
420   #endif
420421}
421422
422423/*    YEAR  NAME    PARENT   MACHINE  INPUT    INIT    MONITOR  COMPANY          FULLNAME                       FLAGS) */
src/mame/drivers/invqix.c
r15764r15765
6262The other has the secondary label 351100210 with a serial number labeled:
6363 S/N: SIURxxxx (xxxx=number of PCB)
6464 SPACE INVADERS U/R
65
65
6666    Memory map:
6767    000000-1fffff: program ROM
68    200000-20ffff: VRAM?
69    400000-400001: ??? (M5296 Watchdog??)
70    600000-61ffff: work RAM?
68    200000-20ffff: Work RAM
69    400000-400003: OKIM9810
70    600000-61ffff: VRAM
71    620000-620005: video registers
7172 
7273    I/O map:
73    port 2 bit 6: FPGA chip select
74    port 1: player 2 inputs
75 
76    port 2 bit 3: must be "1" to avoid SERVICE ERROR
77   port 2 bit 6: FPGA chip select
7478    port 2 bit 7: FPGA clock in
75
79
7680    port 3 bit 0: FPGA status (1 for ready)
7781    port 3 bit 1: FPGA download successful (1 if OK, 0 if failed)
7882    port 3 bit 2: EEPROM chip select
r15764r15765
8084    port 3 bit 4: EEPROM data to EEPROM
8185    port 3 bit 5: EEPROM data from EEPROM
8286 
87    port 4: player 1 inputs
88 
8389    port 6 bit 3: FPGA data bit in
84 
85    port G bit 0: framebuffer bank select?  toggled each frame
86 
90
91    port G bit 0: watchdog (toggled each frame)
92
8793    IRQ0 and IRQ1 are valid.  Mainline explicitly waits on IRQ1, but IRQ0 does a ton of processing.
8894    No other IRQ vectors are valid.
89
95
9096    main loop at 117ea:
9197    117ea: jsr WaitForIRQ1
9298    117ee: jsr ToggleBit0OfPortG
9399    117f2: jsr 11306
94100    117f6: jsr 1918
95101    117fa: bra 117ea
96
102
97103***************************************************************************/
98104
99105#include "emu.h"
r15764r15765
107113   invqix_state(const machine_config &mconfig, device_type type, const char *tag)
108114      : driver_device(mconfig, type, tag),
109115      m_maincpu(*this, "maincpu"),
110      m_eeprom(*this, "eeprom")
116      m_eeprom(*this, "eeprom"),
117      m_vram(*this, "vram")
111118   { }
112119
113120   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
114121
115   DECLARE_READ8_MEMBER(port1_r);
116   DECLARE_READ8_MEMBER(port2_r);
117   DECLARE_WRITE8_MEMBER(port2_w);
118122   DECLARE_READ8_MEMBER(port3_r);
119123   DECLARE_WRITE8_MEMBER(port3_w);
124   DECLARE_READ8_MEMBER(port5_r);
125   DECLARE_WRITE8_MEMBER(port5_w);
120126   DECLARE_READ8_MEMBER(port6_r);
121127   DECLARE_WRITE8_MEMBER(port6_w);
122128   DECLARE_READ8_MEMBER(porta_r);
129   DECLARE_READ8_MEMBER(portg_r);
123130
131    DECLARE_WRITE16_MEMBER(vctl_w);
132
124133protected:
125
126134   // devices
127135   required_device<cpu_device> m_maincpu;
128136   required_device<eeprom_device> m_eeprom;
137   required_shared_ptr<UINT16> m_vram;
129138
130139   // driver_device overrides
131140   virtual void video_start();
141
142private:
143    UINT16 m_vctl;      // 0000 for normal, 0001 for flip, 0100 when going to change (blank?)
132144};
133145
134146
r15764r15765
138150
139151UINT32 invqix_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
140152{
141   return 0;
142}
153   int x,y;
143154
144READ8_MEMBER(invqix_state::port1_r)
145{
146   return 0xff;
147}
155    // this means freeze or blank or something
156    if (m_vctl == 0x100)
157    {
158        return 0;
159    }
148160
149READ8_MEMBER(invqix_state::port2_r)
150{
151   return 1;
152}
161    if (m_vctl == 0x0000)
162    {
163        for(y=0;y<256;y++)
164        {
165            for(x=0;x<256;x++)
166            {
167                UINT8 r,g,b;
168                int pen_data;
153169
154WRITE8_MEMBER(invqix_state::port2_w)
155{
170                pen_data = (m_vram[(x+y*256)]);
171                b = (pen_data & 0x001f);
172                g = (pen_data & 0x03e0) >> 5;
173                r = (pen_data & 0x7c00) >> 10;
174                r = (r << 3) | (r & 0x7);
175                g = (g << 3) | (g & 0x7);
176                b = (b << 3) | (b & 0x7);
156177
178                if(cliprect.contains(x, y))
179                    bitmap.pix32(y, x) = r << 16 | g << 8 | b;
180            }
181        }
182    }
183    else if (m_vctl == 0x0001)  // flip
184    {
185        for(y=0;y<256;y++)
186        {
187            for(x=0;x<256;x++)
188            {
189                UINT8 r,g,b;
190                int pen_data;
191
192                pen_data = (m_vram[(256-x)+((256-y)*256)]);
193                b = (pen_data & 0x001f);
194                g = (pen_data & 0x03e0) >> 5;
195                r = (pen_data & 0x7c00) >> 10;
196                r = (r << 3) | (r & 0x7);
197                g = (g << 3) | (g & 0x7);
198                b = (b << 3) | (b & 0x7);
199
200                if(cliprect.contains(x, y))
201                    bitmap.pix32(y, x) = r << 16 | g << 8 | b;
202            }
203        }
204    }
205    else
206    {
207        logerror("invqix: Unhandled vctl %04x\n", m_vctl);
208    }
209
210   return 0;
157211}
158212
159213READ8_MEMBER(invqix_state::port3_r)
r15764r15765
168222   m_eeprom->set_clock_line((data >> 3) & 1);
169223}
170224
225READ8_MEMBER(invqix_state::port5_r)
226{
227   return 0;
228}
229
230WRITE8_MEMBER(invqix_state::port5_w)
231{
232}
233
171234READ8_MEMBER(invqix_state::port6_r)
172235{
173236   return 0;
r15764r15765
175238
176239WRITE8_MEMBER(invqix_state::port6_w)
177240{
178
179241}
180242
181243READ8_MEMBER(invqix_state::porta_r)
182244{
183   return 0xff;
245   return 0xf0;
184246}
185247
186static ADDRESS_MAP_START(invqix_prg_map, AS_PROGRAM, 32, invqix_state)
248READ8_MEMBER(invqix_state::portg_r)
249{
250   return 0;
251}
252
253WRITE16_MEMBER(invqix_state::vctl_w)
254{
255    m_vctl = data;
256}
257
258static ADDRESS_MAP_START(invqix_prg_map, AS_PROGRAM, 16, invqix_state)
187259   AM_RANGE(0x000000, 0x1fffff) AM_ROM AM_REGION("program", 0)
188   AM_RANGE(0x200000, 0x20ffff) AM_RAM
189   AM_RANGE(0x600000, 0x61ffff) AM_RAM
260   AM_RANGE(0x200000, 0x21ffff) AM_RAM
261   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("oki", okim9810_device, write_TMP_register, 0x00ff)
262   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("oki", okim9810_device, write, 0xff00)
263   AM_RANGE(0x400002, 0x400003) AM_DEVREAD8("oki", okim9810_device, read, 0xff00)
264   AM_RANGE(0x600000, 0x61ffff) AM_RAM AM_SHARE("vram")
265    AM_RANGE(0x620004, 0x620005) AM_WRITE(vctl_w)
190266ADDRESS_MAP_END
191267
192268static ADDRESS_MAP_START(invqix_io_map, AS_IO, 8, invqix_state)
193   AM_RANGE(H8_PORT_1, H8_PORT_1) AM_READ(port1_r)
194   AM_RANGE(H8_PORT_2, H8_PORT_2) AM_READWRITE(port2_r, port2_w)
269   AM_RANGE(H8_PORT_1, H8_PORT_1) AM_READ_PORT("P1")
270   AM_RANGE(H8_PORT_2, H8_PORT_2) AM_READ_PORT("SYSTEM") AM_WRITENOP
195271   AM_RANGE(H8_PORT_3, H8_PORT_3) AM_READWRITE(port3_r, port3_w)
196   AM_RANGE(H8_PORT_6, H8_PORT_6) AM_READWRITE(port6_r, port6_w)
272   AM_RANGE(H8_PORT_4, H8_PORT_4) AM_READ_PORT("P4")
273   AM_RANGE(H8_PORT_5, H8_PORT_5) AM_READWRITE(port5_r, port5_w)
274   AM_RANGE(H8_PORT_6, H8_PORT_6) AM_READWRITE(port6_r, port6_w)
197275   AM_RANGE(H8_PORT_A, H8_PORT_A) AM_READ(porta_r)
198   AM_RANGE(H8_PORT_G, H8_PORT_G) AM_NOP
276   AM_RANGE(H8_PORT_G, H8_PORT_G) AM_READ(portg_r) AM_WRITENOP
199277ADDRESS_MAP_END
200278
201279static INPUT_PORTS_START( invqix )
280   PORT_START("SYSTEM")
281   PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW )
282   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_COIN1 )   // coin 1
283   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_START1 ) PORT_NAME("Left 1 player start")   // start A-1 ("left start" - picks Space Invaders)
284   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_SERVICE1 ) // service
285   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_COIN2 )   // coin 2
286   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_START3 ) PORT_NAME("Left 2 players start")   // start A-2
287   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNUSED )
288   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNUSED )
289
290   PORT_START("P1")
291   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
292   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
293   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
294   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
295   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
296   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
297   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START4 )   PORT_NAME("Right 2 players start") // start B-2
298   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
299   
300   PORT_START("P4")
301   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
302   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
303   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
304   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
305   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
306   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
307   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )   PORT_NAME("Right 1 player start")   // start B-1
308   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNUSED )
202309INPUT_PORTS_END
203310
204311static MACHINE_CONFIG_START( invqix, invqix_state )
r15764r15765
206313   MCFG_CPU_PROGRAM_MAP(invqix_prg_map)
207314   MCFG_CPU_IO_MAP(invqix_io_map)
208315   MCFG_CPU_VBLANK_INT("screen", irq1_line_hold)
209   MCFG_CPU_PERIODIC_INT(irq0_line_hold, 60)   
316   MCFG_CPU_PERIODIC_INT(irq0_line_hold, 60)
210317
211318   /* video hardware */
212319   MCFG_SCREEN_ADD("screen", RASTER)
213320   MCFG_SCREEN_REFRESH_RATE(60)
214321   MCFG_SCREEN_UPDATE_DRIVER(invqix_state, screen_update)
215322   MCFG_SCREEN_SIZE(640, 480)
216   MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 479)
323   MCFG_SCREEN_VISIBLE_AREA(0, 256, 0, 240)
217324
218325   MCFG_PALETTE_LENGTH(65536)
219326
r15764r15765
229336
230337ROM_START( invqix )
231338   ROM_REGION(0x200000, "program", 0)
232   ROM_LOAD( "f34-02.ic2",   0x000000, 0x200000, CRC(035ace40) SHA1(e61f180024102c7a136b1c7f974c71e5dc698a1e) )
339   ROM_LOAD( "f34-02.ic2",   0x000000, 0x200000, CRC(035ace40) SHA1(e61f180024102c7a136b1c7f974c71e5dc698a1e) )
233340
234341   ROM_REGION(0x1000000, "oki", 0)
235   ROM_LOAD( "f34-01.ic13",  0x000000, 0x200000, CRC(7b055722) SHA1(8152bf04a58de15aefc4244e40733275e21818e1) )
342   ROM_LOAD( "f34-01.ic13",  0x000000, 0x200000, CRC(7b055722) SHA1(8152bf04a58de15aefc4244e40733275e21818e1) )
236343
237344   ROM_REGION(0x80, "eeprom", 0)
238   ROM_LOAD16_WORD_SWAP( "93c46.ic6", 0x000000, 0x000080, CRC(564b744e) SHA1(4d9ea7dc253797c513258d07a936dfb63d8ed18c) )
345   ROM_LOAD16_WORD_SWAP( "93c46.ic6", 0x000000, 0x000080, CRC(564b744e) SHA1(4d9ea7dc253797c513258d07a936dfb63d8ed18c) )
239346ROM_END
240347
241GAME(2003, invqix, 0, invqix, invqix, invqix_state, 0, ROT0, "Namco/Taito", "Space Invaders / Qix Silver Anniversary Edition (Ver. 2.03)", GAME_NOT_WORKING )
348GAME(2003, invqix, 0, invqix, invqix, invqix_state, 0, ROT270, "Namco/Taito", "Space Invaders / Qix Silver Anniversary Edition (Ver. 2.03)", GAME_IMPERFECT_GRAPHICS)
src/mame/drivers/gpworld.c
r15764r15765
8080
8181
8282/* VIDEO GOODS */
83static void gpworld_draw_tiles(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect)
83static void gpworld_draw_tiles(running_machine &machine, bitmap_rgb32 &bitmap,const rectangle &cliprect)
8484{
8585   gpworld_state *state = machine.driver_data<gpworld_state>();
8686   UINT8 characterX, characterY;
r15764r15765
9898   }
9999}
100100
101INLINE void draw_pixel(bitmap_ind16 &bitmap,const rectangle &cliprect,int x,int y,int color,int flip)
101INLINE void draw_pixel(running_machine &machine, bitmap_rgb32 &bitmap,const rectangle &cliprect,int x,int y,int color,int flip)
102102{
103103   if (flip)
104104   {
r15764r15765
107107   }
108108
109109   if (cliprect.contains(x, y))
110      bitmap.pix16(y, x) = color;
110      bitmap.pix32(y, x) = machine.pens[color];
111111}
112112
113static void gpworld_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
113static void gpworld_draw_sprites(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect)
114114{
115115   gpworld_state *state = machine.driver_data<gpworld_state>();
116116   const int SPR_Y_TOP     = 0;
r15764r15765
198198               }
199199
200200               /* Daphne says "don't draw the pixel if it's black". */
201               draw_pixel(bitmap,cliprect,x+0,y,palette_get_color(machine, pixel1 + (sprite_color*0x10 + 0x200)),flip);
202               draw_pixel(bitmap,cliprect,x+1,y,palette_get_color(machine, pixel2 + (sprite_color*0x10 + 0x200)),flip);
203               draw_pixel(bitmap,cliprect,x+2,y,palette_get_color(machine, pixel3 + (sprite_color*0x10 + 0x200)),flip);
204               draw_pixel(bitmap,cliprect,x+3,y,palette_get_color(machine, pixel4 + (sprite_color*0x10 + 0x200)),flip);
201               draw_pixel(machine, bitmap,cliprect,x+0,y,palette_get_color(machine, pixel1 + (sprite_color*0x10 + 0x200)),flip);
202               draw_pixel(machine, bitmap,cliprect,x+1,y,palette_get_color(machine, pixel2 + (sprite_color*0x10 + 0x200)),flip);
203               draw_pixel(machine, bitmap,cliprect,x+2,y,palette_get_color(machine, pixel3 + (sprite_color*0x10 + 0x200)),flip);
204               draw_pixel(machine, bitmap,cliprect,x+3,y,palette_get_color(machine, pixel4 + (sprite_color*0x10 + 0x200)),flip);
205205
206206               x += 4;
207207
r15764r15765
221221}
222222
223223
224static SCREEN_UPDATE_IND16( gpworld )
224static SCREEN_UPDATE_RGB32( gpworld )
225225{
226226   bitmap.fill(0, cliprect);
227227
r15764r15765
297297static ADDRESS_MAP_START( mainmem, AS_PROGRAM, 8, gpworld_state )
298298   AM_RANGE(0x0000,0xbfff) AM_ROM
299299   AM_RANGE(0xc000,0xc7ff) AM_RAM AM_SHARE("sprite_ram")
300   AM_RANGE(0xc800,0xcfff) AM_WRITE(palette_write) AM_SHARE("palette_ram")   /* The memory test reads at 0xc800 */
300   AM_RANGE(0xc800,0xcfff) AM_RAM_WRITE(palette_write) AM_SHARE("palette_ram")   /* The memory test reads at 0xc800 */
301301   AM_RANGE(0xd000,0xd7ff) AM_RAM AM_SHARE("tile_ram")
302302   AM_RANGE(0xd800,0xd800) AM_READWRITE(ldp_read,ldp_write)
303303/*  AM_RANGE(0xd801,0xd801) AM_READ_LEGACY(???) */
src/mame/drivers/megasys1.c
r15764r15765
36813681static DRIVER_INIT( 64street )
36823682{
36833683   megasys1_state *state = machine.driver_data<megasys1_state>();
3684//  UINT16 *RAM = (UINT16 *) state->memregion("maincpu")->base();
3685//  RAM[0x006b8/2] = 0x6004;        // d8001 test
3686//  RAM[0x10EDE/2] = 0x6012;        // watchdog
3684//  UINT16 *ROM = (UINT16 *) state->memregion("maincpu")->base();
3685//  ROM[0x006b8/2] = 0x6004;        // d8001 test
3686//  ROM[0x10EDE/2] = 0x6012;        // watchdog
36873687
36883688   state->m_ip_select_values[0] = 0x57;
36893689   state->m_ip_select_values[1] = 0x53;
r15764r15765
38673867
38683868static DRIVER_INIT( iganinju )
38693869{
3870   //UINT16 *RAM;
3870   //UINT16 *ROM;
38713871
38723872   phantasm_rom_decode(machine, "maincpu");
38733873
3874   //RAM  = (UINT16 *) machine.root_device().memregion("maincpu")->base();
3874   //ROM  = (UINT16 *) machine.root_device().memregion("maincpu")->base();
38753875   megasys1_state *state = machine.driver_data<megasys1_state>();
38763876   machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x00000, 0x3ffff, read16_delegate(FUNC(megasys1_state::iganinju_mcu_hs_r),state));
38773877   machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x2f000, 0x2f009, write16_delegate(FUNC(megasys1_state::iganinju_mcu_hs_w),state));
38783878
3879   //RAM[0x00006e/2] = 0x0420; // the only game that does
3879   //ROM[0x00006e/2] = 0x0420; // the only game that does
38803880                        // not like lev 3 interrupts
38813881}
38823882
r15764r15765
38953895
38963896static DRIVER_INIT( jitsupro )
38973897{
3898   //UINT16 *RAM  = (UINT16 *) machine.root_device().memregion("maincpu")->base();
3898   //UINT16 *ROM  = (UINT16 *) machine.root_device().memregion("maincpu")->base();
38993899
39003900   astyanax_rom_decode(machine, "maincpu");      // Code
39013901
src/emu/gamedrv.h
r15764r15765
7171const UINT32 GAME_TYPE_CONSOLE            = 0x00080000;   // console system
7272const UINT32 GAME_TYPE_COMPUTER            = 0x00100000;   // any kind of computer including home computers, minis, calcs,...
7373const UINT32 GAME_TYPE_OTHER            = 0x00200000;   // any other emulated system that doesn't fit above (ex. clock, satelite receiver,...)
74const UINT32 GAME_IMPERFECT_KEYBOARD      = 0x00400000;   // keyboard is known to be wrong
7475
7576// useful combinations of flags
7677const UINT32 GAME_IS_SKELETON            = GAME_NO_SOUND | GAME_NOT_WORKING; // mask for skelly games
src/emu/ui.c
r15764r15765
303303            if (show_warnings && warnings_string(machine, messagebox_text).len() > 0)
304304            {
305305               ui_set_handler(handler_messagebox_ok, 0);
306               if (machine.system().flags & (GAME_WRONG_COLORS | GAME_IMPERFECT_COLORS | GAME_REQUIRES_ARTWORK | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NO_SOUND))
306               if (machine.system().flags & (GAME_WRONG_COLORS | GAME_IMPERFECT_COLORS | GAME_REQUIRES_ARTWORK | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_IMPERFECT_KEYBOARD | GAME_NO_SOUND))
307307                  messagebox_backcolor = UI_YELLOW_COLOR;
308308               if (machine.system().flags & (GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_MECHANICAL))
309309                  messagebox_backcolor = UI_RED_COLOR;
r15764r15765
903903                  GAME_NO_SOUND |  \
904904                  GAME_IMPERFECT_SOUND |  \
905905                  GAME_IMPERFECT_GRAPHICS | \
906                  GAME_IMPERFECT_KEYBOARD | \
906907                  GAME_NO_COCKTAIL)
907908
908909   string.reset();
r15764r15765
935936         string.cat(" have not been correctly dumped.\n");
936937      }
937938      /* add one line per warning flag */
938      if (machine.ioport().has_keyboard())
939      if (machine.system().flags & GAME_IMPERFECT_KEYBOARD)
939940         string.cat("The keyboard emulation may not be 100% accurate.\n");
940941      if (machine.system().flags & GAME_IMPERFECT_COLORS)
941942         string.cat("The colors aren't 100% accurate.\n");
src/emu/drivers/emudummy.c
r15764r15765
6262ROM_END
6363
6464
65GAME( 1900, __dummy, 0, __dummy, 0, 0, ROT0, "(none)", "Dummy", GAME_NO_SOUND )
65GAME( 1900, __dummy, 0, __dummy, 0, driver_device, 0, ROT0, "(none)", "Dummy", GAME_NO_SOUND )
6666
6767

Previous 15994 Revisions Next


© 1998-2018 The MESS Team