Previous 15994 Revisions Next

r13477 Monday 5th December, 2011 at 11:56:42 UTC by Miodrag Milanović
Sync with MAME r14643 (no whatsnew)
[src]version.c
[src/emu]diexec.c diexec.h emu.mak schedule.c schedule.h softlist.c
[src/emu/cpu/i386]i386ops.h pentops.c x87ops.c
[src/emu/machine]generic.c generic.h v3021.c v3021.h
[src/emu/video]h63484.c ramdac.c* ramdac.h*
[src/lib/formats]ap2_dsk.c
[src/mame]mame.lst
[src/mame/drivers]20pacgal.c alpha68k.c artmagic.c astrocorp.c battlera.c beezer.c big10.c blitz68k.c brkthru.c calchase.c cclimber.c cesclass.c champbas.c chihiro.c chsuper.c cps1.c cps2.c crbaloon.c dynax.c gal3.c galaga.c galpani3.c gaplus.c gng.c hng64.c ikki.c kyugo.c lasso.c lwings.c m63.c mappy.c mitchell.c namcos22.c pacland.c pacman.c pangofun.c pcat_dyn.c polepos.c qdrmfgp.c rallyx.c retofinv.c rltennis.c saturn.c seicross.c sfbonus.c skykid.c ssrj.c toypop.c trackfld.c warpwarp.c yiear.c
[src/mame/etc]template_device.c* template_device.h* template_driver.c*
[src/mame/includes]20pacgal.h alpha68k.h battlera.h beezer.h bombjack.h brkthru.h champbas.h crbaloon.h gaelco3d.h galaga.h gaplus.h hng64.h ikki.h lasso.h mappy.h mitchell.h namcos22.h pacland.h polepos.h rallyx.h retofinv.h rltennis.h seicross.h skykid.h ssrj.h toypop.h trackfld.h warpwarp.h yiear.h
[src/mame/machine]md_cart.c
[src/mame/video]battlera.c beezer.c cps1.c gaelco3d.c hng64.c lasso.c rltennis.c segas32.c ssrj.c

src/mame/mame.lst
r13476r13477
27842784area88r         //  8/1989 (c) 1989 (Japan)
27852785ffight         // 12/1989 (c) 1989 (World)
27862786ffightu         // 12/1989 (c) 1989 (USA)
2787ffightu1      // 12/1989 (c) 1989 (USA) (4 eprom instead of mask rom)
2787ffightu1      // 12/1989 (c) 1989 (USA)
27882788ffightua      // 12/01/1990 (c) 1989 (USA)
27892789ffightub      // 13/06/1990 (c) 1989 (USA)
27902790ffightj         // 12/1989 (c) 1989 (Japan)
r13476r13477
29102910qtono2j         // 23/01/1995 (c) 1995 (Japan)
29112911pang3         // 01/06/1995 (c) 1995 Mitchell (Euro) not listed on Capcom's site
29122912pang3r1         // 11/05/1995 (c) 1995 Mitchell (Euro) not listed on Capcom's site
2913pang3n         // 11/05/1995 (c) 1995 Mitchell (Euro) not listed on Capcom's site
29142913pang3j         // 11/05/1995 (c) 1995 Mitchell (Japan) not listed on Capcom's site
2914pang3b         // bootleg
29152915megaman         // 06/10/1995 (c) 1995 (USA)
29162916megamana      // 06/10/1995 (c) 1995 (Asia)
29172917rockmanj      // 22/09/1995 (c) 1995 (Japan)
src/mame/machine/md_cart.c
r13476r13477
15581558   /* is this a SMD file? */
15591559   if (genesis_is_SMD(&rawROM[0x2200], (unsigned)length))
15601560   {
1561//      printf("SMD!\n");
1561//      printf("SMD!\n");
15621562      tmpROMnew = ROM;
15631563      tmpROM = ROM + 0x2000 + 512;
15641564
r13476r13477
15901590   else if ((rawROM[0x2080] == 'E') && (rawROM[0x2081] == 'A') &&
15911591          (rawROM[0x2082] == 'M' || rawROM[0x2082] == 'G'))
15921592   {
1593//      printf("MD!\n");
1593//      printf("MD!\n");
15941594      tmpROMnew = global_alloc_array(unsigned char, length);
15951595      secondhalf = &tmpROMnew[length >> 1];
15961596
src/mame/includes/mitchell.h
r13476r13477
1111public:
1212   mitchell_state(const machine_config &mconfig, device_type type, const char *tag)
1313      : driver_device(mconfig, type, tag),
14        m_maincpu(*this, "maincpu"),
1415        m_audiocpu(*this, "audiocpu"),
1516        m_oki(*this, "oki") { }
1617
r13476r13477
3839   int        m_keymatrix;
3940
4041   /* devices */
42   required_device<cpu_device> m_maincpu;
4143   optional_device<cpu_device> m_audiocpu;
4244   optional_device<okim6295_device> m_oki;
4345   UINT8 *m_nvram;
4446   size_t m_nvram_size;
47   UINT8 m_irq_source;
4548};
4649
4750
src/mame/includes/yiear.h
r13476r13477
2626PALETTE_INIT( yiear );
2727VIDEO_START( yiear );
2828SCREEN_UPDATE( yiear );
29
30READ8_DEVICE_HANDLER( yiear_speech_r );
31WRITE8_DEVICE_HANDLER( yiear_VLM5030_control_w );
src/mame/includes/gaplus.h
r13476r13477
1919   UINT8 m_starfield_control[4];
2020   int m_total_stars;
2121   struct star m_stars[MAX_STARS];
22   UINT8 m_main_irq_mask;
23   UINT8 m_sub_irq_mask;
24   UINT8 m_sub2_irq_mask;
2225};
2326
2427
src/mame/includes/trackfld.h
r13476r13477
2929   int       m_sprites_gfx_banked;
3030
3131   UINT8    m_irq_mask;
32   UINT8    m_yieartf_nmi_mask;
3233};
3334
3435
src/mame/includes/beezer.h
r13476r13477
99   UINT8 *m_videoram;
1010   int m_pbus;
1111   int m_banklatch;
12   int m_scanline;
12
13   device_t *m_maincpu;
1314};
1415
1516
r13476r13477
3334
3435/*----------- defined in video/beezer.c -----------*/
3536
36INTERRUPT_GEN( beezer_interrupt );
37TIMER_DEVICE_CALLBACK( beezer_interrupt );
3738SCREEN_UPDATE( beezer );
3839WRITE8_HANDLER( beezer_map_w );
3940READ8_HANDLER( beezer_line_r );
src/mame/includes/20pacgal.h
r13476r13477
3535
3636   /* 25pacman and 20pacgal store the sprite palette at a different address, this is a hardware difference and confirmed NOT to be a register */
3737   UINT8 m_sprite_pal_base;
38
39   UINT8 m_irq_mask;
3840};
3941
4042
src/mame/includes/seicross.h
r13476r13477
1717   UINT8 *m_colorram;
1818   tilemap_t *m_bg_tilemap;
1919   UINT8 *m_row_scroll;
20
21   UINT8 m_irq_mask;
2022};
2123
2224
src/mame/includes/polepos.h
r13476r13477
3232   tilemap_t *m_tx_tilemap;
3333   int m_chacl;
3434   UINT16 m_scroll;
35   UINT8 m_main_irq_mask;
36   UINT8 m_sub_irq_mask;
3537};
3638
3739
src/mame/includes/gaelco3d.h
r13476r13477
2222
2323class gaelco3d_state;
2424
25class gaelco3d_renderer : public poly_manager<float, gaelco3d_object_data, 0, 2000>
25class gaelco3d_renderer : public poly_manager<float, gaelco3d_object_data, 1, 2000>
2626{
2727public:
2828   gaelco3d_renderer(gaelco3d_state &state);
src/mame/includes/ikki.h
r13476r13477
88{
99public:
1010   ikki_state(const machine_config &mconfig, device_type type, const char *tag)
11      : driver_device(mconfig, type, tag) { }
11      : driver_device(mconfig, type, tag),
12      m_maincpu(*this, "maincpu")
13      { }
1214
1315   /* memory pointers */
1416   UINT8 *    m_videoram;
r13476r13477
2123   bitmap_t   *m_sprite_bitmap;
2224   UINT8      m_flipscreen;
2325   int        m_punch_through_pen;
26   UINT8      m_irq_source;
27
28   required_device<cpu_device> m_maincpu;
2429};
2530
2631
src/mame/includes/crbaloon.h
r13476r13477
2121   UINT16 m_collision_address;
2222   UINT8 m_collision_address_clear;
2323   tilemap_t *m_bg_tilemap;
24   UINT8 m_irq_mask;
2425};
2526
2627
src/mame/includes/alpha68k.h
r13476r13477
4040
4141   /* devices */
4242   device_t *m_audiocpu;
43   UINT8       m_sound_nmi_mask;
44   UINT8       m_sound_pa_latch;
4345};
4446
4547/* game_id - used to deal with a few game specific situations */
src/mame/includes/namcos22.h
r13476r13477
5454   int m_mRenderBufSize;
5555   UINT16 m_mRenderBufData[MAX_RENDER_CMD_SEQ];
5656   UINT32 m_mSys22PortBits;
57   int m_mFrameCount;
5857   int m_irq_state;
5958   int m_mDspUploadState;
6059   int m_mUploadDestIdx;
src/mame/includes/warpwarp.h
r13476r13477
1717   int m_ball_sizey;
1818   int m_handle_joystick;
1919   tilemap_t *m_bg_tilemap;
20   UINT8 m_irq_mask;
2021};
2122
2223
src/mame/includes/bombjack.h
r13476r13477
1414   UINT8 *      m_videoram;
1515   UINT8 *      m_colorram;
1616   UINT8 *      m_spriteram;
17//  UINT8 *      m_paletteram;  // currently this uses generic palette handling
17//  UINT8 *     m_paletteram;  // currently this uses generic palette handling
1818   size_t      m_spriteram_size;
1919
2020   /* video-related */
src/mame/includes/rallyx.h
r13476r13477
3434   /* devices */
3535   cpu_device *m_maincpu;
3636   device_t *m_samples;
37
38   UINT8    m_main_irq_mask;
3739};
3840
3941
src/mame/includes/battlera.h
r13476r13477
22{
33public:
44   battlera_state(const machine_config &mconfig, device_type type, const char *tag)
5      : driver_device(mconfig, type, tag) { }
5      : driver_device(mconfig, type, tag),
6      m_maincpu(*this, "maincpu")
7      { }
68
79   int m_control_port_select;
810   int m_msm5205next;
r13476r13477
2325   int m_bb_enable;
2426   int m_bldwolf_vblank;
2527   UINT8 m_blank_tile[32];
28
29   required_device<cpu_device> m_maincpu;
2630};
2731
2832
r13476r13477
3034
3135SCREEN_UPDATE( battlera );
3236VIDEO_START( battlera );
33INTERRUPT_GEN( battlera_interrupt );
37TIMER_DEVICE_CALLBACK( battlera_irq );
3438
3539READ8_HANDLER( HuC6270_register_r );
3640WRITE8_HANDLER( HuC6270_register_w );
src/mame/includes/galaga.h
r13476r13477
2828   UINT8 *m_videoram;
2929   tilemap_t *m_fg_tilemap;
3030   tilemap_t *m_bg_tilemap;
31
32   UINT8 m_main_irq_mask;
33   UINT8 m_sub_irq_mask;
34   UINT8 m_sub2_nmi_mask;
3135};
3236
3337class xevious_state : public galaga_state
src/mame/includes/lasso.h
r13476r13477
5353SCREEN_UPDATE( lasso );
5454SCREEN_UPDATE( chameleo );
5555SCREEN_UPDATE( wwjgtin );
56SCREEN_UPDATE( pinbo );
src/mame/includes/pacland.h
r13476r13477
1515   UINT32 *m_transmask[3];
1616   UINT16 m_scroll0;
1717   UINT16 m_scroll1;
18   UINT8 m_main_irq_mask;
19   UINT8 m_mcu_irq_mask;
1820};
1921
2022
src/mame/includes/ssrj.h
r13476r13477
1313   UINT8 *m_vram3;
1414   UINT8 *m_vram4;
1515   UINT8 *m_scrollram;
16   UINT8 *m_buffer_spriteram;
1617};
1718
1819
r13476r13477
2425
2526VIDEO_START( ssrj );
2627SCREEN_UPDATE( ssrj );
28SCREEN_EOF( ssrj );
2729PALETTE_INIT( ssrj );
src/mame/includes/retofinv.h
r13476r13477
2525   int m_bg_bank;
2626   tilemap_t *m_bg_tilemap;
2727   tilemap_t *m_fg_tilemap;
28
29   UINT8 m_main_irq_mask;
30   UINT8 m_sub_irq_mask;
2831};
2932
3033
src/mame/includes/toypop.h
r13476r13477
1313   int m_bitmapflip;
1414   int m_palettebank;
1515   int m_interrupt_enable_68k;
16   UINT8 m_main_irq_mask;
17   UINT8 m_sound_irq_mask;
1618};
1719
1820
src/mame/includes/mappy.h
r13476r13477
1111
1212   UINT8 m_scroll;
1313   int m_mux;
14
15   UINT8 m_main_irq_mask;
16   UINT8 m_sub_irq_mask;
17   UINT8 m_sub2_irq_mask;
1418};
1519
1620
src/mame/includes/rltennis.h
r13476r13477
1414
1515   UINT16 m_blitter[RLT_NUM_BLITTER_REGS];
1616
17   UINT8 *m_palette;
18   INT32 m_palpos_r;
19   INT32 m_palpos_w;
20
2117   INT32 m_data760000;
2218   INT32 m_data740000;
2319   INT32 m_dac_counter;
r13476r13477
4541
4642
4743WRITE16_HANDLER( rlt_blitter_w );
48WRITE16_HANDLER( rlt_ramdac_address_wm_w );
49WRITE16_HANDLER( rlt_ramdac_address_rm_w );
50WRITE16_HANDLER( rlt_ramdac_data_w );
51READ16_HANDLER( rlt_ramdac_data_r );
5244VIDEO_START( rltennis );
5345SCREEN_UPDATE( rltennis );
5446
src/mame/includes/skykid.h
r13476r13477
1313   UINT8 m_priority;
1414   UINT16 m_scroll_x;
1515   UINT16 m_scroll_y;
16   UINT8 m_main_irq_mask;
17   UINT8 m_mcu_irq_mask;
1618};
1719
1820
src/mame/includes/hng64.h
r13476r13477
77{
88public:
99   hng64_state(const machine_config &mconfig, device_type type, const char *tag)
10      : driver_device(mconfig, type, tag) { }
10      : driver_device(mconfig, type, tag),
11      m_maincpu(*this, "maincpu")
12      { }
1113
1214   int m_mcu_type;
1315   UINT32 *m_mainram;
r13476r13477
9496   float m_lightStrength;
9597   float m_lightVector[3];
9698
99   required_device<cpu_device> m_maincpu;
100
97101};
98102
99103
r13476r13477
104108
105109VIDEO_START( hng64 );
106110SCREEN_UPDATE( hng64 );
111SCREEN_EOF( hng64 );
src/mame/includes/champbas.h
r13476r13477
3232   device_t *m_maincpu;
3333   device_t *m_audiocpu;
3434   device_t *m_mcu;
35
36   UINT8          m_irq_mask;
3537};
3638
3739
src/mame/includes/brkthru.h
r13476r13477
2929   /* devices */
3030   device_t *m_maincpu;
3131   device_t *m_audiocpu;
32
33   UINT8   m_nmi_mask;
3234};
3335
3436
src/mame/video/beezer.c
r13476r13477
44#include "includes/beezer.h"
55
66
7INTERRUPT_GEN( beezer_interrupt )
7TIMER_DEVICE_CALLBACK( beezer_interrupt )
88{
9   beezer_state *state = device->machine().driver_data<beezer_state>();
10   via6522_device *via_0 = device->machine().device<via6522_device>("via6522_0");
9   int scanline = param;
10//  beezer_state *state = timer.machine().driver_data<beezer_state>();
11   via6522_device *via_0 = timer.machine().device<via6522_device>("via6522_0");
1112
12   state->m_scanline = (state->m_scanline + 1) % 0x80;
13   via_0->write_ca2((state->m_scanline & 0x10) ? 1 : 0);
14   if ((state->m_scanline & 0x78) == 0x78)
15      device_set_input_line(device, M6809_FIRQ_LINE, ASSERT_LINE);
13   via_0->write_ca2((scanline & 0x20) ? 1 : 0);
14   #if 0
15   if (scanline == 240) // actually unused by the game! (points to a tight loop)
16      device_set_input_line(state->m_maincpu, M6809_FIRQ_LINE, ASSERT_LINE);
1617   else
17      device_set_input_line(device, M6809_FIRQ_LINE, CLEAR_LINE);
18      device_set_input_line(state->m_maincpu, M6809_FIRQ_LINE, CLEAR_LINE);
19   #endif
1820}
1921
2022SCREEN_UPDATE( beezer )
r13476r13477
2325   UINT8 *videoram = state->m_videoram;
2426   int x,y;
2527
26   for (y = cliprect->min_y; y <= cliprect->max_y; y+=2)
27      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
28   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
29      for (x = cliprect->min_x; x <= cliprect->max_x; x+=2)
2830      {
29         *BITMAP_ADDR16(bitmap, y+1, x) = videoram[0x80*y+x] & 0x0f;
30         *BITMAP_ADDR16(bitmap, y,   x) = videoram[0x80*y+x] >> 4;
31         *BITMAP_ADDR16(bitmap, y,   x+1) = videoram[0x80*x+y] & 0x0f;
32         *BITMAP_ADDR16(bitmap, y,   x+0) = videoram[0x80*x+y] >> 4;
3133      }
3234
3335   return 0;
r13476r13477
6870
6971READ8_HANDLER( beezer_line_r )
7072{
71   beezer_state *state = space->machine().driver_data<beezer_state>();
72   return (state->m_scanline & 0xfe) << 1;
73   return space->machine().primary_screen->vpos();
74//  Note: was (state->m_scanline & 0xfe) << 1; with scanline % 128
7375}
7476
src/mame/video/cps1.c
r13476r13477
166166
167167Quiz Tonosama no Yabou 2: Zenkoku-ban (Japan 950123)     1995  90629B-3   ?                IOB1  92631C-6     CPS-B-21  DL-0921-10014  C632    IOC1
168168
169Pang! 3 (Euro 950511, not encrypted)                     1995  94916-10   CP1B1F,CP1B8K,CP1B9KA  92631C-6     CPS-B-21  DL-0921-10014  C632    IOC1
170Pang! 3 (Euro 950511)                                          94916-10   CP1B1F,CP1B8K,CP1B9KA  92631C-6     CPS-B-21  DL-0921-10014  C632    IOC1
169Pang! 3 (Euro 950511)                                    1995  94916-10   CP1B1F,CP1B8K,CP1B9K   92631C-6     CPS-B-21  DL-0921-10014  C632    IOC1
171170Pang! 3 (Euro 950601)                                          94916-10   CP1B1F,CP1B8K,CP1B9KA  92631C-6     CPS-B-21  DL-0921-10014  C632    IOC1
172Pang! 3: Kaitou Tachi no Karei na Gogo (Japan 950511)          94916-10   CP1B1F,CP1B8K,CP1B9KA  92631C-6     CPS-B-21  DL-0921-10014  C632    IOC1
171Pang! 3: Kaitou Tachi no Karei na Gogo (Japan 950511)          94916-10   CP1B1F,CP1B8K,CP1B9K   92631C-6     CPS-B-21  DL-0921-10014  C632    IOC1
173172
174173Mega Man: The Power Battle (CPS1, USA 951006)            1995  91635B-2   RCM63B   BPRG1   IOB1  92631C-6     CPS-B-21  DL-0921-10014  C632    IOC1
175174Mega Man: The Power Battle (CPS1, Asia 951006)                 91634B-2   RCM63B   BPRG1   IOB1  92631C-6     CPS-B-21  DL-0921-10014  C632    IOC1
r13476r13477
14161415   {"rockmanj",    CPS_B_21_DEF, mapper_RCM63B },
14171416   {"pnickj",      CPS_B_21_DEF, mapper_PKB10B },
14181417   {"pang3",       CPS_B_21_DEF, mapper_pang3 },   /* EEPROM port is among the CPS registers (handled by DRIVER_INIT) */   // should use one of these three CP1B1F,CP1B8K,CP1B9KA still not dumped
1419   {"pang3r1",     CPS_B_21_DEF, mapper_pang3 },   /* EEPROM port is among the CPS registers (handled by DRIVER_INIT) */   // should use one of these three CP1B1F,CP1B8K,CP1B9KA still not dumped
1420   {"pang3n",      CPS_B_21_DEF, mapper_pang3 },   /* EEPROM port is among the CPS registers (handled by DRIVER_INIT) */   // should use one of these three CP1B1F,CP1B8K,CP1B9KA still not dumped
1421   {"pang3j",      CPS_B_21_DEF, mapper_pang3 },   /* EEPROM port is among the CPS registers (handled by DRIVER_INIT) */   // should use one of these three CP1B1F,CP1B8K,CP1B9KA still not dumped
1418   {"pang3r1",     CPS_B_21_DEF, mapper_pang3 },   /* EEPROM port is among the CPS registers (handled by DRIVER_INIT) */   // should use one of these three CP1B1F,CP1B8K,CP1B9K
1419   {"pang3j",      CPS_B_21_DEF, mapper_pang3 },   /* EEPROM port is among the CPS registers (handled by DRIVER_INIT) */   // should use one of these three CP1B1F,CP1B8K,CP1B9K
1420   {"pang3b",      CPS_B_21_DEF, mapper_pang3 },   /* EEPROM port is among the CPS registers (handled by DRIVER_INIT) */   // should use one of these three CP1B1F,CP1B8K,CP1B9K
14221421
14231422   {"sfach",    CPS_B_21_DEF, mapper_sfzch },
14241423   {"sfzbch",   CPS_B_21_DEF, mapper_sfzch },
src/mame/video/gaelco3d.c
r13476r13477
2525
2626
2727gaelco3d_renderer::gaelco3d_renderer(gaelco3d_state &state)
28   : poly_manager<float, gaelco3d_object_data, 0, 2000>(state.machine()),
28   : poly_manager<float, gaelco3d_object_data, 1, 2000>(state.machine()),
2929     m_state(state),
3030     m_screenbits(machine().primary_screen->alloc_compatible_bitmap()),
3131     m_zbuffer(auto_bitmap_alloc(state.machine(), state.machine().primary_screen->width(), state.machine().primary_screen->height(), BITMAP_FORMAT_INDEXED16)),
src/mame/video/battlera.c
r13476r13477
88*******************************************************************************/
99
1010#include "emu.h"
11#include "deprecat.h"
1211#include "cpu/h6280/h6280.h"
1312#include "includes/battlera.h"
1413
r13476r13477
370369
371370/******************************************************************************/
372371
373INTERRUPT_GEN( battlera_interrupt )
372TIMER_DEVICE_CALLBACK( battlera_irq )
374373{
375   battlera_state *state = device->machine().driver_data<battlera_state>();
376   state->m_current_scanline=255-cpu_getiloops(device); /* 8 lines clipped at top */
374   battlera_state *state = timer.machine().driver_data<battlera_state>();
375   state->m_current_scanline = param; /* 8 lines clipped at top */
377376
378377   /* If raster interrupt occurs, refresh screen _up_ to this point */
379378   if (state->m_rcr_enable && (state->m_current_scanline+56)==state->m_HuC6270_registers[6]) {
380      device->machine().primary_screen->update_partial(state->m_current_scanline);
381      device_set_input_line(device, 0, HOLD_LINE); /* RCR interrupt */
379      timer.machine().primary_screen->update_partial(state->m_current_scanline);
380      device_set_input_line(state->m_maincpu, 0, HOLD_LINE); /* RCR interrupt */
382381   }
383382
384383   /* Start of vblank */
385384   else if (state->m_current_scanline==240) {
386385      state->m_bldwolf_vblank=1;
387      device->machine().primary_screen->update_partial(240);
386      timer.machine().primary_screen->update_partial(240);
388387      if (state->m_irq_enable)
389         device_set_input_line(device, 0, HOLD_LINE); /* VBL */
388         device_set_input_line(state->m_maincpu, 0, HOLD_LINE); /* VBL */
390389   }
391390
392391   /* End of vblank */
src/mame/video/lasso.c
r13476r13477
190190
191191   /* create tilemap */
192192   state->m_bg_tilemap = tilemap_create(machine, pinbo_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
193
194   tilemap_set_transparent_pen(state->m_bg_tilemap, 0);
193195}
194196
195197
r13476r13477
410412
411413   return 0;
412414}
413
414
415SCREEN_UPDATE( pinbo )
416{
417   lasso_state *state = screen->machine().driver_data<lasso_state>();
418   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
419   draw_sprites(screen->machine(), bitmap, cliprect, 0);
420
421   return 0;
422}
src/mame/video/ssrj.c
r13476r13477
2020      0,
2121      code&0x3ff,
2222      (code>>12)&0x3,
23     ((code & 0x8000) ? TILE_FLIPX:0) |( (code & 0x4000) ? TILE_FLIPY:0)   );
23     ((code & 0x8000) ? TILE_FLIPY:0) |( (code & 0x4000) ? TILE_FLIPX:0)   );
2424}
2525
2626/* tilemap 2 */
r13476r13477
4242      0,
4343      code&0x3ff,
4444      ((code>>12)&0x3)+4,
45     ((code & 0x8000) ? TILE_FLIPX:0) |( (code & 0x4000) ? TILE_FLIPY:0)   );
45     ((code & 0x8000) ? TILE_FLIPY:0) |( (code & 0x4000) ? TILE_FLIPX:0)   );
4646}
4747
4848/* tilemap 4 */
r13476r13477
6464      0,
6565      code&0x3ff,
6666      ((code>>12)&0x3)+12,
67     ((code & 0x8000) ? TILE_FLIPX:0) |( (code & 0x4000) ? TILE_FLIPY:0)   );
67     ((code & 0x8000) ? TILE_FLIPY:0) |( (code & 0x4000) ? TILE_FLIPX:0)   );
6868}
6969
7070
r13476r13477
226226{
227227   ssrj_state *state = machine.driver_data<ssrj_state>();
228228
229   state->m_tilemap1 = tilemap_create(machine, get_tile_info1, tilemap_scan_rows, 8, 8, 32, 32);
230   state->m_tilemap2 = tilemap_create(machine, get_tile_info2, tilemap_scan_rows, 8, 8, 32, 32);
231   state->m_tilemap4 = tilemap_create(machine, get_tile_info4, tilemap_scan_rows, 8, 8, 32, 32);
229   state->m_tilemap1 = tilemap_create(machine, get_tile_info1, tilemap_scan_cols, 8, 8, 32, 32);
230   state->m_tilemap2 = tilemap_create(machine, get_tile_info2, tilemap_scan_cols, 8, 8, 32, 32);
231   state->m_tilemap4 = tilemap_create(machine, get_tile_info4, tilemap_scan_cols, 8, 8, 32, 32);
232232   tilemap_set_transparent_pen(state->m_tilemap2, 0);
233233   tilemap_set_transparent_pen(state->m_tilemap4, 0);
234
235   state->m_buffer_spriteram = auto_alloc_array(machine, UINT8, 0x0800);
234236}
235237
236238
r13476r13477
241243
242244   for(i=0;i<6;i++)
243245   {
244      x = state->m_scrollram[0x80+20*i];
245      y = state->m_scrollram[0x80+20*i+2];
246      if (!state->m_scrollram[0x80+20*i+3])
247         for(k=0;k<5;k++,y+=8)
246      y = state->m_buffer_spriteram[0x80+20*i];
247      x = state->m_buffer_spriteram[0x80+20*i+2];
248      if (!state->m_buffer_spriteram[0x80+20*i+3])
249      {
250
251         for(k=0;k<5;k++,x+=8)
252         {
248253            for(j=0;j<0x20;j++)
249254            {
250255               int code;
r13476r13477
255260                  cliprect,machine.gfx[0],
256261                  code&1023,
257262                  ((code>>12)&0x3)+8,
263                  code&0x4000,
258264                  code&0x8000,
259                  code&0x4000,
260                  (247-(x+(j<<3)))&0xff,
261                  y,
265                  x,
266                  (247-(y+(j<<3)))&0xff,
262267                  0);
263268            }
269         }
270      }
264271   }
265272}
266273
r13476r13477
277284{
278285   ssrj_state *state = screen->machine().driver_data<ssrj_state>();
279286
280   tilemap_set_scrolly(state->m_tilemap1, 0, 0xff-state->m_scrollram[2] );
281   tilemap_set_scrollx(state->m_tilemap1, 0, state->m_scrollram[0] );
287   tilemap_set_scrollx(state->m_tilemap1, 0, 0xff-state->m_scrollram[2] );
288   tilemap_set_scrolly(state->m_tilemap1, 0, state->m_scrollram[0] );
282289   tilemap_draw(bitmap, cliprect, state->m_tilemap1, 0, 0);
283290   draw_objects(screen->machine(), bitmap, cliprect);
284291   tilemap_draw(bitmap, cliprect, state->m_tilemap2, 0, 0);
r13476r13477
287294   return 0;
288295}
289296
297SCREEN_EOF( ssrj )
298{
299   ssrj_state *state = screen->machine().driver_data<ssrj_state>();
290300
301   memcpy(state->m_buffer_spriteram, state->m_scrollram, 0x800);
302}
src/mame/video/rltennis.c
r13476r13477
221221   }
222222}
223223
224WRITE16_HANDLER(rlt_ramdac_address_wm_w )
225{
226   rltennis_state *state = space->machine().driver_data<rltennis_state>();
227   state->m_palpos_w = data*3;
228}
229
230WRITE16_HANDLER(rlt_ramdac_address_rm_w )
231{
232   rltennis_state *state = space->machine().driver_data<rltennis_state>();
233   state->m_palpos_r = data*3;
234}
235
236WRITE16_HANDLER( rlt_ramdac_data_w )
237{
238   rltennis_state *state = space->machine().driver_data<rltennis_state>();
239   int color=state->m_palpos_w/3;
240   state->m_palette[state->m_palpos_w] = data & 0xff;
241   ++state->m_palpos_w;
242
243   state->m_palpos_w %=256*3;
244
245   {
246      int r = state->m_palette[color*3];
247      int g = state->m_palette[color*3+1];
248      int b = state->m_palette[color*3+2];
249      palette_set_color(space->machine(), color, MAKE_RGB(r,g,b));
250   }
251}
252
253READ16_HANDLER( rlt_ramdac_data_r )
254{
255   rltennis_state *state = space->machine().driver_data<rltennis_state>();
256   int data=state->m_palette[state->m_palpos_r];
257   ++state->m_palpos_r;
258   state->m_palpos_r %=256*3;
259   return data;
260}
261
262224VIDEO_START( rltennis )
263225{
264226   rltennis_state *state = machine.driver_data<rltennis_state>();
src/mame/video/segas32.c
r13476r13477
18821882
18831883   g_profiler.start(PROFILER_USER2);
18841884
1885   logerror("----\n");
1885//  logerror("----\n");
18861886
18871887   /* compute the outer clip */
18881888   outerclip.min_x = outerclip.min_y = 0;
src/mame/video/hng64.c
r13476r13477
15441544   hng64_drawtilemap(screen->machine(),bitmap,cliprect, 1);
15451545   hng64_drawtilemap(screen->machine(),bitmap,cliprect, 0);
15461546
1547   draw_sprites(screen->machine(), bitmap,cliprect);
1548
15491547   // 3d really shouldn't be last, but you don't see some cool stuff right now if it's put before sprites.
15501548   {
15511549      int x, y;
r13476r13477
15661564         }
15671565      }
15681566      //printf("NEW FRAME!\n");   /* Debug - ajg */
1569      clear3d(screen->machine());
15701567   }
15711568
1569   draw_sprites(screen->machine(), bitmap,cliprect);
1570
15721571   if(0)
15731572      transition_control(screen->machine(), bitmap, cliprect);
15741573
r13476r13477
16541653   return 0;
16551654}
16561655
1656SCREEN_EOF( hng64 )
1657{
1658   clear3d(screen->machine());
1659}
1660
16571661VIDEO_START( hng64 )
16581662{
16591663   hng64_state *state = machine.driver_data<hng64_state>();
src/mame/etc/template_device.h
r0r13477
1/***************************************************************************
2
3Template for skeleton device
4
5***************************************************************************/
6
7#pragma once
8
9#ifndef __xxxDEV_H__
10#define __xxxDEV_H__
11
12
13
14//**************************************************************************
15//  INTERFACE CONFIGURATION MACROS
16//**************************************************************************
17
18#define MCFG_XXX_ADD(_tag,_freq) \
19   MCFG_DEVICE_ADD(_tag, xxx, _freq) \
20
21
22//**************************************************************************
23//  TYPE DEFINITIONS
24//**************************************************************************
25
26// ======================> v3021_device
27
28class xxx_device :   public device_t
29{
30public:
31   // construction/destruction
32   xxx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
33
34   // I/O operations
35   DECLARE_WRITE8_MEMBER( write );
36   DECLARE_READ8_MEMBER( read );
37
38protected:
39   // device-level overrides
40   virtual bool device_validity_check(emu_options &options, const game_driver &driver) const;
41   virtual void device_start();
42   virtual void device_reset();
43};
44
45
46// device type definition
47extern const device_type xxx;
48
49
50
51//**************************************************************************
52//  GLOBAL VARIABLES
53//**************************************************************************
54
55
56
57#endif
src/mame/etc/template_driver.c
r0r13477
1/***************************************************************************
2
3Template for skeleton drivers
4
5***************************************************************************/
6
7#include "emu.h"
8#include "cpu/z80/z80.h"
9//#include "sound/ay8910.h"
10
11#define MAIN_CLOCK XTAL_8MHz
12
13class xxx_state : public driver_device
14{
15public:
16   xxx_state(const machine_config &mconfig, device_type type, const char *tag)
17      : driver_device(mconfig, type, tag) { }
18};
19
20static VIDEO_START( xxx )
21{
22
23}
24
25static SCREEN_UPDATE( xxx )
26{
27   return 0;
28}
29
30static ADDRESS_MAP_START( xxx_map, AS_PROGRAM, 8 )
31   AM_RANGE(0x0000, 0x7fff) AM_ROM
32ADDRESS_MAP_END
33
34static ADDRESS_MAP_START( xxx_io, AS_IO, 8 )
35//  ADDRESS_MAP_GLOBAL_MASK(0xff)
36ADDRESS_MAP_END
37
38static INPUT_PORTS_START( xxx )
39INPUT_PORTS_END
40
41static const gfx_layout charlayout =
42{
43   8,8,
44   RGN_FRAC(1,1),
45   1,
46   { RGN_FRAC(0,1) },
47   { 0, 1, 2, 3, 4, 5, 6, 7 },
48   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
49   8*8
50};
51
52static GFXDECODE_START( xxx )
53   GFXDECODE_ENTRY( "gfx1", 0, charlayout,     0, 1 )
54GFXDECODE_END
55
56static MACHINE_START( xxx )
57{
58//  xxx_state *state = machine.driver_data<xxx_state>();
59
60}
61
62static MACHINE_RESET( xxx )
63{
64
65}
66
67static PALETTE_INIT( xxx )
68{
69}
70
71static MACHINE_CONFIG_START( xxx, xxx_state )
72
73   /* basic machine hardware */
74   MCFG_CPU_ADD("maincpu",Z80,MAIN_CLOCK/2)
75   MCFG_CPU_PROGRAM_MAP(xxx_map)
76   MCFG_CPU_IO_MAP(xxx_io)
77
78   MCFG_MACHINE_START(xxx)
79   MCFG_MACHINE_RESET(xxx)
80
81   /* video hardware */
82   MCFG_SCREEN_ADD("screen", RASTER)
83   MCFG_SCREEN_REFRESH_RATE(60)
84   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
85   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
86   MCFG_SCREEN_SIZE(32*8, 32*8)
87   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
88   MCFG_SCREEN_UPDATE(xxx)
89
90   MCFG_GFXDECODE(xxx)
91
92   MCFG_PALETTE_INIT(xxx)
93   MCFG_PALETTE_LENGTH(8)
94
95   MCFG_VIDEO_START(xxx)
96
97   /* sound hardware */
98   MCFG_SPEAKER_STANDARD_MONO("mono")
99//  MCFG_SOUND_ADD("aysnd", AY8910, MAIN_CLOCK/4)
100//  MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
101MACHINE_CONFIG_END
102
103
104/***************************************************************************
105
106  Game driver(s)
107
108***************************************************************************/
109
110ROM_START( xxx )
111   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
112   ROM_REGION( 0x10000, "gfx1", ROMREGION_ERASE00 )
113ROM_END
114
115GAME( 198?, xxx,  0,   xxx,  xxx,  0,       ROT0, "<template_manufacturer>",      "<template_gamename>", GAME_NOT_WORKING | GAME_NO_SOUND )
src/mame/etc/template_device.c
r0r13477
1/***************************************************************************
2
3Template for skeleton device
4
5***************************************************************************/
6
7#include "emu.h"
8#include "machine/xxx.h"
9
10
11
12//**************************************************************************
13//  GLOBAL VARIABLES
14//**************************************************************************
15
16// device type definition
17const device_type xxx = &device_creator<xxx_device>;
18
19
20//**************************************************************************
21//  LIVE DEVICE
22//**************************************************************************
23
24//-------------------------------------------------
25//  xxx_device - constructor
26//-------------------------------------------------
27
28xxx_device::xxx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
29   : device_t(mconfig, xxx, "xxx", tag, owner, clock)
30{
31
32}
33
34
35//-------------------------------------------------
36//  device_validity_check - perform validity checks
37//  on this device
38//-------------------------------------------------
39
40bool xxx_device::device_validity_check(emu_options &options, const game_driver &driver) const
41{
42   bool error = false;
43   return error;
44}
45
46//-------------------------------------------------
47//  device_start - device-specific startup
48//-------------------------------------------------
49
50void xxx_device::device_start()
51{
52
53}
54
55
56//-------------------------------------------------
57//  device_reset - device-specific reset
58//-------------------------------------------------
59
60void xxx_device::device_reset()
61{
62}
63
64
65//**************************************************************************
66//  READ/WRITE HANDLERS
67//**************************************************************************
68
69READ8_MEMBER( xxx_device::read )
70{
71   return 0;
72}
73
74WRITE8_MEMBER( xxx_device::write )
75{
76}
src/mame/drivers/mitchell.c
r13476r13477
6868
6969#include "emu.h"
7070#include "cpu/z80/z80.h"
71#include "deprecat.h"
7271#include "machine/eeprom.h"
7372#include "includes/cps1.h"   // needed for decoding functions only
7473#include "includes/mitchell.h"
r13476r13477
113112
114113static READ8_HANDLER( pang_port5_r )
115114{
116   int bit = space->machine().device<eeprom_device>("eeprom")->read_bit() << 7;
115   mitchell_state *state = space->machine().driver_data<mitchell_state>();
117116
118117   /* bits 0 and (sometimes) 3 are checked in the interrupt handler.
119118        bit 3 is checked before updating the palette so it really seems to be vblank.
r13476r13477
121120        Many games require two interrupts per frame and for these bits to toggle,
122121        otherwise music doesn't work.
123122    */
124   if (cpu_getiloops(&space->device()) & 1)
125      bit |= 0x01;
126123
127   return (input_port_read(space->machine(), "SYS0") & 0x7e) | bit;
124   return (input_port_read(space->machine(), "SYS0") & 0xfe) | (state->m_irq_source & 1);
128125}
129126
130127static WRITE8_DEVICE_HANDLER( eeprom_cs_w )
r13476r13477
434431   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
435432   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
436433   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
437   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* data from EEPROM */
434   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
438435
439436   PORT_START("IN0")
440437   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
r13476r13477
684681   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
685682   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
686683   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
687   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* data from EEPROM */
684   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
688685
689686   PORT_START("IN0")
690687   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
r13476r13477
732729   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
733730   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
734731   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
735   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* data from EEPROM (spang) */
732   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
736733
737734   PORT_START("IN0")
738735   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
r13476r13477
848845   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
849846   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
850847   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
851   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* data from EEPROM */
848   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
852849
853850   PORT_START("IN0")
854851   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE )   /* same as the service mode farther down */
r13476r13477
888885   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
889886   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
890887   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
891   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* data from EEPROM */
888   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
892889
893890   PORT_START("IN0")
894891   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
r13476r13477
930927   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
931928   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
932929   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
933   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* data from EEPROM */
930   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
934931
935932   PORT_START("IN0")
936933   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
r13476r13477
10871084   state->save_item(NAME(state->m_keymatrix));
10881085   state->save_item(NAME(state->m_dir));
10891086   state->save_item(NAME(state->m_dial));
1087   state->save_item(NAME(state->m_irq_source));
10901088//  state_save_register_global(machine, init_eeprom_count);
10911089}
10921090
r13476r13477
11041102   state->m_keymatrix = 0;
11051103}
11061104
1105static TIMER_DEVICE_CALLBACK( mitchell_irq )
1106{
1107   mitchell_state *state = timer.machine().driver_data<mitchell_state>();
1108   int scanline = param;
1109
1110   if(scanline == 248 || scanline == 0)
1111   {
1112      device_set_input_line(state->m_maincpu,0,HOLD_LINE);
1113
1114      state->m_irq_source = (scanline == 248);
1115   }
1116}
1117
11071118static MACHINE_CONFIG_START( mgakuen, mitchell_state )
11081119
11091120   /* basic machine hardware */
11101121   MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz/2) /* probably same clock as the other mitchell hardware games */
11111122   MCFG_CPU_PROGRAM_MAP(mgakuen_map)
11121123   MCFG_CPU_IO_MAP(mitchell_io_map)
1113   MCFG_CPU_VBLANK_INT_HACK(irq0_line_hold,2)   /* ??? one extra irq seems to be needed for music (see input5_r) */
1124   MCFG_TIMER_ADD_SCANLINE("scantimer", mitchell_irq, "screen", 0, 1)   /* ??? one extra irq seems to be needed for music (see input5_r) */
11141125
11151126   MCFG_MACHINE_START(mitchell)
11161127   MCFG_MACHINE_RESET(mitchell)
r13476r13477
11481159   MCFG_CPU_ADD("maincpu",Z80, XTAL_16MHz/2) /* verified on pcb */
11491160   MCFG_CPU_PROGRAM_MAP(mitchell_map)
11501161   MCFG_CPU_IO_MAP(mitchell_io_map)
1151   MCFG_CPU_VBLANK_INT_HACK(irq0_line_hold,2)   /* ??? one extra irq seems to be needed for music (see input5_r) */
1162   MCFG_TIMER_ADD_SCANLINE("scantimer", mitchell_irq, "screen", 0, 1)   /* ??? one extra irq seems to be needed for music (see input5_r) */
11521163
11531164   MCFG_MACHINE_START(mitchell)
11541165   MCFG_MACHINE_RESET(mitchell)
r13476r13477
12831294   MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz/2) /* verified on pcb */
12841295   MCFG_CPU_PROGRAM_MAP(mitchell_map)
12851296   MCFG_CPU_IO_MAP(mitchell_io_map)
1286   MCFG_CPU_VBLANK_INT_HACK(irq0_line_hold,2)   /* ??? one extra irq seems to be needed for music (see input5_r) */
1297   MCFG_TIMER_ADD_SCANLINE("scantimer", mitchell_irq, "screen", 0, 1)   /* ??? one extra irq seems to be needed for music (see input5_r) */
12871298
12881299   MCFG_NVRAM_HANDLER(mitchell)
12891300   MCFG_EEPROM_ADD("eeprom", eeprom_intf)
r13476r13477
13361347   MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/2) /* verified on pcb */
13371348   MCFG_CPU_PROGRAM_MAP(mitchell_map)
13381349   MCFG_CPU_IO_MAP(mitchell_io_map)
1339   MCFG_CPU_VBLANK_INT_HACK(irq0_line_hold,2)   /* ??? one extra irq seems to be needed for music (see input5_r) */
1350   MCFG_TIMER_ADD_SCANLINE("scantimer", mitchell_irq, "screen", 0, 1)   /* ??? one extra irq seems to be needed for music (see input5_r) */
13401351
13411352   MCFG_NVRAM_HANDLER(mitchell)
13421353   MCFG_EEPROM_ADD("eeprom", eeprom_intf)
src/mame/drivers/yiear.c
r13476r13477
9494#include "includes/yiear.h"
9595
9696
97static READ8_DEVICE_HANDLER( yiear_speech_r )
97READ8_DEVICE_HANDLER( yiear_speech_r )
9898{
9999   if (vlm5030_bsy(device))
100100      return 1;
r13476r13477
102102      return 0;
103103}
104104
105static WRITE8_DEVICE_HANDLER( yiear_VLM5030_control_w )
105WRITE8_DEVICE_HANDLER( yiear_VLM5030_control_w )
106106{
107107   /* bit 0 is latch direction */
108108   vlm5030_st(device, (data >> 1) & 1);
src/mame/drivers/gaplus.c
r13476r13477
172172
173173static WRITE8_HANDLER( gaplus_irq_1_ctrl_w )
174174{
175   gaplus_state *state = space->machine().driver_data<gaplus_state>();
175176   int bit = !BIT(offset, 11);
176   cpu_interrupt_enable(space->machine().device("maincpu"), bit);
177   state->m_main_irq_mask = bit & 1;
177178   if (!bit)
178179      cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
179180}
180181
181static WRITE8_HANDLER( gaplus_irq_3_ctrl_w )
182static WRITE8_HANDLER( gaplus_irq_2_ctrl_w )
182183{
183   int bit = !BIT(offset, 13);
184   cpu_interrupt_enable(space->machine().device("sub2"), bit);
184   gaplus_state *state = space->machine().driver_data<gaplus_state>();
185   int bit = offset & 1;
186   state->m_sub_irq_mask = bit & 1;
185187   if (!bit)
186      cputag_set_input_line(space->machine(), "sub2", 0, CLEAR_LINE);
188      cputag_set_input_line(space->machine(), "sub", 0, CLEAR_LINE);
187189}
188190
189static WRITE8_HANDLER( gaplus_irq_2_ctrl_w )
191static WRITE8_HANDLER( gaplus_irq_3_ctrl_w )
190192{
191   int bit = offset & 1;
192   cpu_interrupt_enable(space->machine().device("sub"), bit);
193   gaplus_state *state = space->machine().driver_data<gaplus_state>();
194   int bit = !BIT(offset, 13);
195   state->m_sub2_irq_mask = bit & 1;
193196   if (!bit)
194      cputag_set_input_line(space->machine(), "sub", 0, CLEAR_LINE);
197      cputag_set_input_line(space->machine(), "sub2", 0, CLEAR_LINE);
195198}
196199
197200static WRITE8_HANDLER( gaplus_sreset_w )
r13476r13477
231234
232235static MACHINE_RESET( gaplus )
233236{
237   gaplus_state *state = machine.driver_data<gaplus_state>();
234238   /* on reset, VINTON is reset, while the other flags don't seem to be affected */
235   cpu_interrupt_enable(machine.device("sub"), 0);
239   state->m_sub_irq_mask = 0;
236240   cputag_set_input_line(machine, "sub", 0, CLEAR_LINE);
237241}
238242
r13476r13477
252256   }
253257}
254258
255static INTERRUPT_GEN( gaplus_interrupt_1 )
259static INTERRUPT_GEN( gaplus_vblank_main_irq )
256260{
261   gaplus_state *state = device->machine().driver_data<gaplus_state>();
262
257263   device_t *io58xx = device->machine().device("58xx");
258264   device_t *io56xx = device->machine().device("56xx");
259265
260   irq0_line_assert(device);   // this also checks if irq is enabled - IMPORTANT!
261                        // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
266   if(state->m_main_irq_mask)
267      cputag_set_input_line(device->machine(), "maincpu", 0, ASSERT_LINE);
262268
263269   if (!namcoio_read_reset_line(io58xx))      /* give the cpu a tiny bit of time to write the command before processing it */
264270      device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run));
265271
266272   if (!namcoio_read_reset_line(io56xx))      /* give the cpu a tiny bit of time to write the command before processing it */
267273      device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run), 1);
274}
268275
276static INTERRUPT_GEN( gaplus_vblank_sub_irq )
277{
278   gaplus_state *state = device->machine().driver_data<gaplus_state>();
279
280   if(state->m_sub_irq_mask)
281      cputag_set_input_line(device->machine(), "sub", 0, ASSERT_LINE);
269282}
270283
284static INTERRUPT_GEN( gaplus_vblank_sub2_irq )
285{
286   gaplus_state *state = device->machine().driver_data<gaplus_state>();
271287
288   if(state->m_sub2_irq_mask)
289      cputag_set_input_line(device->machine(), "sub2", 0, ASSERT_LINE);
290}
291
292
272293static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM, 8 )
273294   AM_RANGE(0x0000, 0x07ff) AM_READWRITE(gaplus_videoram_r, gaplus_videoram_w) AM_BASE_MEMBER(gaplus_state, m_videoram)      /* tilemap RAM (shared with CPU #2) */
274295   AM_RANGE(0x0800, 0x1fff) AM_READWRITE(gaplus_spriteram_r, gaplus_spriteram_w) AM_BASE_MEMBER(gaplus_state, m_spriteram)   /* shared RAM with CPU #2 (includes sprite RAM) */
r13476r13477
545566   /* basic machine hardware */
546567   MCFG_CPU_ADD("maincpu", M6809,   24576000/16)   /* 1.536 MHz */
547568   MCFG_CPU_PROGRAM_MAP(cpu1_map)
548   MCFG_CPU_VBLANK_INT("screen", gaplus_interrupt_1)
569   MCFG_CPU_VBLANK_INT("screen", gaplus_vblank_main_irq)
549570
550571   MCFG_CPU_ADD("sub", M6809,   24576000/16)   /* 1.536 MHz */
551572   MCFG_CPU_PROGRAM_MAP(cpu2_map)
552   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
573   MCFG_CPU_VBLANK_INT("screen", gaplus_vblank_sub_irq)
553574
554575   MCFG_CPU_ADD("sub2", M6809, 24576000/16)   /* 1.536 MHz */
555576   MCFG_CPU_PROGRAM_MAP(cpu3_map)
556   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
577   MCFG_CPU_VBLANK_INT("screen", gaplus_vblank_sub2_irq)
557578
558579   MCFG_QUANTUM_TIME(attotime::from_hz(6000))   /* a high value to ensure proper synchronization of the CPUs */
559580   MCFG_MACHINE_RESET(gaplus)
src/mame/drivers/galpani3.c
r13476r13477
946946};
947947
948948static MACHINE_CONFIG_START( galpani3, galpani3_state )
949   MCFG_CPU_ADD("maincpu", M68000, 16000000)    // ? (from which clock?)
949   MCFG_CPU_ADD("maincpu", M68000, XTAL_28_63636MHz/2)   // Confirmed from PCB
950950   MCFG_CPU_PROGRAM_MAP(galpani3_map)
951951   MCFG_CPU_VBLANK_INT_HACK(galpani3_vblank, 3)
952952
r13476r13477
969969   /* sound hardware */
970970   MCFG_SPEAKER_STANDARD_MONO("mono")
971971
972   MCFG_SOUND_ADD("ymz", YMZ280B, 28636400 / 2)
972   MCFG_SOUND_ADD("ymz", YMZ280B, XTAL_33_333MHz / 2)   // Confirmed from PCB
973973   MCFG_SOUND_CONFIG(ymz280b_intf)
974974   MCFG_SOUND_ROUTE(0, "mono", 1.0)
975975   MCFG_SOUND_ROUTE(1, "mono", 1.0)
src/mame/drivers/lwings.c
r13476r13477
9898      device_set_input_line_and_vector(device, 0, HOLD_LINE, 0xd7); /* RST 10h */
9999}
100100
101static INTERRUPT_GEN( avengers_interrupt )
102{
103   lwings_state *state = device->machine().driver_data<lwings_state>();
101104
105   if(state->m_nmi_mask)
106      device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
107}
108
109
102110static WRITE8_HANDLER( avengers_protection_w )
103111{
104112   lwings_state *state = space->machine().driver_data<lwings_state>();
r13476r13477
857865
858866   MCFG_CPU_MODIFY("maincpu") //AT: (avengers37b16gre)
859867   MCFG_CPU_PROGRAM_MAP(avengers_map)
860   MCFG_CPU_VBLANK_INT("screen", nmi_line_pulse) // RST 38h triggered by software
868   MCFG_CPU_VBLANK_INT("screen", avengers_interrupt) // RST 38h triggered by software
861869
862870   MCFG_CPU_MODIFY("adpcm")
863871   MCFG_CPU_IO_MAP(avengers_adpcm_io_map)
src/mame/drivers/cclimber.c
r13476r13477
256256      memory_set_bank(space->machine(), "bank1", state->m_toprollr_rombank);
257257}
258258
259
260static TIMER_CALLBACK( disable_interrupts )
261{
262   cpu_interrupt_enable(machine.device("maincpu"), 0);
263}
264
265
266259static MACHINE_RESET( cclimber )
267260{
268261   cclimber_state *state = machine.driver_data<cclimber_state>();
269   /* Disable interrupts, River Patrol / Silver Land needs this */
270262
271   /* we must do this on a timer in order to have it take effect */
272   /* otherwise, the reset process will override our changes */
273   machine.scheduler().synchronize(FUNC(disable_interrupts));
263   /* Disable interrupts, River Patrol / Silver Land needs this otherwise returns bad RAM on POST */
264   state->m_nmi_mask = 0;
274265
275266   state->m_toprollr_rombank = 0;
276267}
src/mame/drivers/cesclass.c
r13476r13477
22
33    CES Classic wall games
44
5   driver by Angelo Salese
6
7   Notes:
8   - to play Home Run Classic you have to select a pitcher shot and keep pressed the
9     wall strobe. When you release the strobe, batter does the swing.
10
11   TODO:
12   - custom layout for dual LCDs
13   - artwork and lamps position needed to make progresses
14    - U43 and U44 bad in Trap Shoot Classic
15    - games are incredibly sluggish by now
16    - irq sources are unknown
17    - sound doesn't play most samples
18    - Trap Shoot Classic runs on a single LCD, needs mods
19
520*/
621
722#define ADDRESS_MAP_MODERN
823
924#include "emu.h"
1025#include "cpu/m68000/m68000.h"
26#include "sound/okim6295.h"
27#include "rendlay.h"
28#include "machine/nvram.h"
1129
1230class cesclassic_state : public driver_device
1331{
1432public:
1533   cesclassic_state(const machine_config &mconfig, device_type type, const char *tag)
1634   : driver_device(mconfig, type, tag),
17   m_maincpu(*this, "maincpu")
35   m_maincpu(*this, "maincpu"),
36   m_oki(*this, "oki")
1837   { }
1938
20   DECLARE_READ16_MEMBER(_60000_r);
39   DECLARE_WRITE16_MEMBER(irq2_ack_w);
40   DECLARE_WRITE16_MEMBER(irq3_ack_w);
41   DECLARE_WRITE16_MEMBER(lamps_w);
42   DECLARE_WRITE16_MEMBER(outputs_w);
2143
44   UINT16 *m_vram;
45
2246protected:
2347
2448   // devices
2549   required_device<cpu_device> m_maincpu;
50   required_device<okim6295_device> m_oki;
2651
2752   // driver_device overrides
2853   virtual void video_start();
2954   virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect);
55
3056};
3157
3258
r13476r13477
3662
3763bool cesclassic_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
3864{
65   int x,y,xi;
66
67   bitmap_fill(&bitmap,&cliprect,get_black_pen(machine()));
68
69   {
70      for(y=0;y<64;y++)
71      {
72         for(x=0;x<16;x++)
73         {
74            for(xi=0;xi<16;xi++)
75            {
76               UINT8 color;
77
78               color = (((m_vram[x+y*16+0x400])>>(15-xi)) & 1);
79               color |= (((m_vram[x+y*16])>>(15-xi)) & 1)<<1;
80
81               if((x*16+xi)<256 && ((y)+0)<256)
82                  *BITMAP_ADDR32(&bitmap, y, x*16+xi) = machine().pens[color];
83            }
84         }
85      }
86   }
87
3988   return 0;
4089}
4190
42READ16_MEMBER( cesclassic_state::_60000_r )
91WRITE16_MEMBER( cesclassic_state::irq2_ack_w )
4392{
44   return 0x100 | 0x200;
93   device_set_input_line(m_maincpu, 2, CLEAR_LINE);
4594}
4695
96WRITE16_MEMBER( cesclassic_state::irq3_ack_w )
97{
98   device_set_input_line(m_maincpu, 3, CLEAR_LINE);
99}
100
101WRITE16_MEMBER( cesclassic_state::lamps_w )
102{
103   //popmessage("%04x",data);
104}
105
106WRITE16_MEMBER( cesclassic_state::outputs_w )
107{
108   /*
109   -x-- ---- OKI bankswitch
110   --x- ---- probably screen enable
111   ---- --x- coin counter
112   */
113   m_oki->set_bank_base((data & 0x40) ? 0x40000 : 0);
114   coin_counter_w(machine(), 0, data & 2);
115   if(data & ~0x62)
116   logerror("Output: %02x\n",data);
117}
118
47119static ADDRESS_MAP_START( cesclassic_map, AS_PROGRAM, 16, cesclassic_state )
48120   AM_RANGE(0x000000, 0x0fffff) AM_ROM
49   AM_RANGE(0x400000, 0x40ffff) AM_RAM
50   AM_RANGE(0x600000, 0x600001) AM_READ(_60000_r)
51   AM_RANGE(0x640040, 0x640041) AM_WRITENOP
52   AM_RANGE(0x904000, 0x904001) AM_WRITENOP
121   AM_RANGE(0x400000, 0x40cfff) AM_RAM
122   AM_RANGE(0x40d000, 0x40ffff) AM_RAM AM_BASE(m_vram)
123   AM_RANGE(0x410000, 0x410001) AM_READ_PORT("VBLANK") //probably m68681 lies there instead
124   AM_RANGE(0x410004, 0x410005) AM_WRITE(irq3_ack_w)
125   AM_RANGE(0x410006, 0x410007) AM_WRITE(irq2_ack_w)
126   AM_RANGE(0x480000, 0x481fff) AM_RAM AM_SHARE("nvram") //8k according to schematics (games doesn't use that much tho)
127   AM_RANGE(0x600000, 0x600001) AM_READ_PORT("SYSTEM")
128   AM_RANGE(0x610000, 0x610001) AM_WRITE(outputs_w)
129//   AM_RANGE(0x640000, 0x640001) AM_WRITENOP
130   AM_RANGE(0x640040, 0x640041) AM_WRITE(lamps_w)
131   AM_RANGE(0x670000, 0x670001) AM_READ_PORT("DSW")
132   AM_RANGE(0x70ff00, 0x70ff01) AM_WRITENOP // writes 0xffff at irq 3 end of service, watchdog?
133   AM_RANGE(0x900000, 0x900001) AM_DEVREAD8("oki", okim6295_device, read,0x00ff) // unsure about this ...
134   AM_RANGE(0x900100, 0x900101) AM_DEVWRITE8("oki", okim6295_device, write,0x00ff)
135//  AM_RANGE(0x904000, 0x904001) AM_WRITENOP //some kind of serial
53136ADDRESS_MAP_END
54137
55138static INPUT_PORTS_START( cesclassic )
139   PORT_START("SYSTEM")
140   PORT_DIPNAME( 0x0001, 0x0001, "SYSTEM" )
141   PORT_DIPSETTING(    0x0001, DEF_STR( Off ) )
142   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
143   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
144   PORT_DIPSETTING(    0x0002, DEF_STR( Off ) )
145   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
146   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
147   PORT_DIPSETTING(    0x0004, DEF_STR( Off ) )
148   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
149   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
150   PORT_DIPSETTING(    0x0008, DEF_STR( Off ) )
151   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
152   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
153   PORT_DIPSETTING(    0x0010, DEF_STR( Off ) )
154   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
155   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
156   PORT_DIPSETTING(    0x0020, DEF_STR( Off ) )
157   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
158   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
159   PORT_DIPSETTING(    0x0040, DEF_STR( Off ) )
160   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
161   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
162   PORT_DIPSETTING(    0x0080, DEF_STR( Off ) )
163   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
164   PORT_DIPNAME( 0x0100, 0x0100, "SYSTEM" ) // hangs system at POST if active
165   PORT_DIPSETTING(    0x0100, DEF_STR( Off ) )
166   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
167   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
168   PORT_DIPSETTING(    0x0200, DEF_STR( Off ) )
169   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
170   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
171   PORT_DIPSETTING(    0x0400, DEF_STR( Off ) )
172   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
173   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
174   PORT_DIPSETTING(    0x0800, DEF_STR( Off ) )
175   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
176   PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_COIN1 )
177   PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_SERVICE )
178   PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_SERVICE1 )
179   PORT_BIT(0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) // hit strobe
180
181   PORT_START("DSW")
182   PORT_DIPNAME( 0x0001, 0x0001, "DSW" )
183   PORT_DIPSETTING(    0x0001, DEF_STR( Off ) )
184   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
185   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
186   PORT_DIPSETTING(    0x0002, DEF_STR( Off ) )
187   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
188   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
189   PORT_DIPSETTING(    0x0004, DEF_STR( Off ) )
190   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
191   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
192   PORT_DIPSETTING(    0x0008, DEF_STR( Off ) )
193   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
194   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
195   PORT_DIPSETTING(    0x0010, DEF_STR( Off ) )
196   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
197   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
198   PORT_DIPSETTING(    0x0020, DEF_STR( Off ) )
199   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
200   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
201   PORT_DIPSETTING(    0x0040, DEF_STR( Off ) )
202   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
203   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
204   PORT_DIPSETTING(    0x0080, DEF_STR( Off ) )
205   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
206   PORT_DIPNAME( 0x0100, 0x0100, "SYSTEM" )
207   PORT_DIPSETTING(    0x0100, DEF_STR( Off ) )
208   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
209   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
210   PORT_DIPSETTING(    0x0200, DEF_STR( Off ) )
211   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
212   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
213   PORT_DIPSETTING(    0x0400, DEF_STR( Off ) )
214   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
215   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
216   PORT_DIPSETTING(    0x0800, DEF_STR( Off ) )
217   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
218   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
219   PORT_DIPSETTING(    0x1000, DEF_STR( Off ) )
220   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
221   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
222   PORT_DIPSETTING(    0x2000, DEF_STR( Off ) )
223   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
224   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
225   PORT_DIPSETTING(    0x4000, DEF_STR( Off ) )
226   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
227   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) // LCD test
228   PORT_DIPSETTING(    0x8000, DEF_STR( Off ) )
229   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
230
231   PORT_START("VBLANK")
232   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
56233INPUT_PORTS_END
57234
235static PALETTE_INIT( cesclassic )
236{
237   int i;
238
239   for (i = 0; i < 4; i++)
240      palette_set_color_rgb(machine, i, pal2bit(i), 0, 0);
241}
242
58243static MACHINE_CONFIG_START( cesclassic, cesclassic_state )
59244
60245   MCFG_CPU_ADD("maincpu", M68000, 24000000/2 )
61246   MCFG_CPU_PROGRAM_MAP(cesclassic_map)
247   MCFG_CPU_VBLANK_INT("l_lcd", irq2_line_assert)  // TODO: unknown sources
248   MCFG_CPU_PERIODIC_INT(irq3_line_assert,60*8)
62249
250   MCFG_NVRAM_ADD_0FILL("nvram")
251
63252   /* video hardware */
64   MCFG_SCREEN_ADD("screen", RASTER)
253   MCFG_SCREEN_ADD("l_lcd", LCD)
65254   MCFG_SCREEN_REFRESH_RATE(60)
66   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
67   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
68   MCFG_SCREEN_SIZE(32*8, 32*8)
69   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
255   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
256   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
257   MCFG_SCREEN_SIZE(8*16*2, 8*8+3*8)
258   MCFG_SCREEN_VISIBLE_AREA(0*8, 8*16*2-1, 0*8, 8*8-1)
259   MCFG_DEFAULT_LAYOUT( layout_lcd )
70260
71   MCFG_PALETTE_LENGTH(16)
261   MCFG_PALETTE_LENGTH(4)
262   MCFG_PALETTE_INIT(cesclassic)
263
264   MCFG_SPEAKER_STANDARD_MONO("mono")
265   MCFG_OKIM6295_ADD("oki", 24000000/16, OKIM6295_PIN7_LOW)
266   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
72267MACHINE_CONFIG_END
73268
74269
r13476r13477
92287
93288ROM_START(tsclass)
94289   ROM_REGION( 0x100000, "maincpu", 0 )
95   ROM_LOAD("tsclassic-v100-u43u44.bin", 0x000000, 0x100000, CRC(a820ec9a) SHA1(84e38c7e54bb9e80142ed4e7763c9e36df560f42) )
290   ROM_LOAD("tsclassic-v100-u43u44.bin", 0x000000, 0x100000, BAD_DUMP CRC(a820ec9a) SHA1(84e38c7e54bb9e80142ed4e7763c9e36df560f42) )
96291
97292   ROM_REGION( 0x80000, "oki", 0 )
98293   ROM_LOAD( "tsclassic-v100-u28.bin", 0x00000, 0x80000, CRC(5bf53ca3) SHA1(5767391175fa9488ba0fb17a16de6d5013712a01) )
99294ROM_END
100295
101296
102GAME(1996, hrclass, 0, cesclassic, cesclassic, 0, ROT0, "Creative Electronics And Software", "Home Run Classic", GAME_NOT_WORKING | GAME_NO_SOUND )
103GAME(1996, ccclass, 0, cesclassic, cesclassic, 0, ROT0, "Creative Electronics And Software", "Country Club Classic", GAME_NOT_WORKING | GAME_NO_SOUND )
104GAME(1996, tsclass, 0, cesclassic, cesclassic, 0, ROT0, "Creative Electronics And Software", "Trap Shoot Classic", GAME_NOT_WORKING | GAME_NO_SOUND )
297GAME(1997, hrclass, 0, cesclassic, cesclassic, 0, ROT0, "Creative Electronics And Software", "Home Run Classic (v1.21 12-feb-1997)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND )
298GAME(1997, ccclass, 0, cesclassic, cesclassic, 0, ROT0, "Creative Electronics And Software", "Country Club Classic (v1.10 03-apr-1997)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND )
299GAME(1997, tsclass, 0, cesclassic, cesclassic, 0, ROT0, "Creative Electronics And Software", "Trap Shoot Classic (v1.0 21-mar-1997)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND )
src/mame/drivers/beezer.c
r13476r13477
44
55  Written by Mathis Rosenhauer
66
7  TODO:
8  - what's really wrong with the sound? Any reference available?
9
710*/
811
912#include "emu.h"
10#include "deprecat.h"
1113#include "machine/6522via.h"
1214#include "cpu/m6809/m6809.h"
1315#include "sound/dac.h"
r13476r13477
2325static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8 )
2426   AM_RANGE(0x0000, 0x07ff) AM_RAM // RAM at 0D
2527   AM_RANGE(0x0800, 0x0fff) AM_RAM // optional RAM at 2D (can be rom here instead)
26   AM_RANGE(0x1000, 0x1007) AM_MIRROR(0x07F8) AM_DEVREADWRITE("custom", beezer_sh6840_r, beezer_sh6840_w)
27   AM_RANGE(0x1800, 0x180F) AM_MIRROR(0x07F0) AM_DEVREADWRITE_MODERN("via6522_1", via6522_device, read, write)
28   AM_RANGE(0x8000, 0x8003) AM_MIRROR(0x1FFC) AM_DEVWRITE("custom", beezer_sfxctrl_w)
28   AM_RANGE(0x1000, 0x1007) AM_MIRROR(0x07f8) AM_DEVREADWRITE("custom", beezer_sh6840_r, beezer_sh6840_w)
29   AM_RANGE(0x1800, 0x180F) AM_MIRROR(0x07f0) AM_DEVREADWRITE_MODERN("via6522_1", via6522_device, read, write)
30   AM_RANGE(0x8000, 0x8003) AM_MIRROR(0x1ffc) AM_DEVWRITE("custom", beezer_sfxctrl_w)
2931   //AM_RANGE(0xa000, 0xbfff) AM_ROM // ROM at 2D (can be ram here instead), unpopulated
3032   //AM_RANGE(0xc000, 0xdfff) AM_ROM // ROM at 4D, unpopulated
3133   AM_RANGE(0xe000, 0xffff) AM_ROM // ROM at 6D
r13476r13477
7577   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
7678INPUT_PORTS_END
7779
80static MACHINE_START(beezer)
81{
82   beezer_state *state = machine.driver_data<beezer_state>();
83
84   state->m_maincpu = machine.device("maincpu");
85}
86
7887static MACHINE_CONFIG_START( beezer, beezer_state )
7988
8089   /* basic machine hardware */
8190   MCFG_CPU_ADD("maincpu", M6809, 1000000)        /* 1 MHz */
8291   MCFG_CPU_PROGRAM_MAP(main_map)
83   MCFG_CPU_VBLANK_INT_HACK(beezer_interrupt,128)
92   MCFG_TIMER_ADD_SCANLINE("scantimer", beezer_interrupt, "screen", 0, 1)
8493
8594   MCFG_CPU_ADD("audiocpu", M6809, 1000000)        /* 1 MHz */
8695   MCFG_CPU_PROGRAM_MAP(sound_map)
r13476r13477
9099   MCFG_SCREEN_REFRESH_RATE(60)
91100   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
92101   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
93   MCFG_SCREEN_SIZE(256, 384)
94   MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 16, 303)
102   MCFG_SCREEN_SIZE(384, 256)
103   MCFG_SCREEN_VISIBLE_AREA(16, 304-1, 0, 240-1) // 288 x 240, correct?
95104   MCFG_SCREEN_UPDATE(beezer)
96105
97106   MCFG_PALETTE_LENGTH(16)
98107
108   MCFG_MACHINE_START(beezer)
109
99110   /* sound hardware */
100111   MCFG_SPEAKER_STANDARD_MONO("mono")
101112
r13476r13477
159170   ROM_LOAD( "e1.cpu", 0x100, 0x0100, CRC(3c775c5e) SHA1(ac86f45938c0c9d5fec1245bf86718442baf445b) )
160171ROM_END
161172
162GAME( 1982, beezer,  0,      beezer, beezer, beezer, ORIENTATION_FLIP_X, "Tong Electronic", "Beezer (set 1)", GAME_IMPERFECT_SOUND )
163GAME( 1982, beezer1, beezer, beezer, beezer, beezer, ORIENTATION_FLIP_X, "Tong Electronic", "Beezer (set 2)", GAME_IMPERFECT_SOUND )
173GAME( 1982, beezer,  0,      beezer, beezer, beezer, ROT90, "Tong Electronic", "Beezer (set 1)", GAME_IMPERFECT_SOUND )
174GAME( 1982, beezer1, beezer, beezer, beezer, beezer, ROT90, "Tong Electronic", "Beezer (set 2)", GAME_IMPERFECT_SOUND )
src/mame/drivers/big10.c
r13476r13477
6161#include "sound/ay8910.h"
6262#include "video/v9938.h"
6363#include "machine/nvram.h"
64#include "deprecat.h"
6564
6665
6766class big10_state : public driver_device
r13476r13477
8685   cputag_set_input_line (machine, "maincpu", 0, (i ? ASSERT_LINE : CLEAR_LINE));
8786}
8887
89static INTERRUPT_GEN( big10_interrupt )
88static TIMER_DEVICE_CALLBACK( big10_interrupt )
9089{
91   v9938_interrupt(device->machine(), 0);
90   v9938_interrupt(timer.machine(), 0);
9291}
9392
9493
r13476r13477
256255   MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6)   /* guess */
257256   MCFG_CPU_PROGRAM_MAP(main_map)
258257   MCFG_CPU_IO_MAP(main_io)
259   MCFG_CPU_VBLANK_INT_HACK(big10_interrupt, 262)
258   MCFG_TIMER_ADD_SCANLINE("scantimer", big10_interrupt, "screen", 0, 1)
260259
261260   MCFG_MACHINE_RESET(big10)
262261
src/mame/drivers/chsuper.c
r13476r13477
11/*******************************************************************************************
22
3Champion Super (c) 1999 <unknown>
4
5driver by Angelo Salese & David Haywood
6
37Notes:
48-To init chsuper3, just soft-reset and keep pressed both service keys (9 & 0)
59
r13476r13477
1014
1115*******************************************************************************************/
1216
17#define ADDRESS_MAP_MODERN
18
1319#include "emu.h"
1420#include "cpu/z180/z180.h"
1521#include "sound/dac.h"
1622#include "machine/nvram.h"
23#include "video/ramdac.h"
1724
18
1925class chsuper_state : public driver_device
2026{
2127public:
2228   chsuper_state(const machine_config &mconfig, device_type type, const char *tag)
23      : driver_device(mconfig, type, tag) { }
29      : driver_device(mconfig, type, tag),
30        m_maincpu(*this, "maincpu") { }
2431
32   DECLARE_WRITE8_MEMBER(chsuper_vram_w);
33   DECLARE_READ8_MEMBER(ff_r);
34
2535   int m_tilexor;
26   struct { int r,g,b,offs,offs_internal; } m_pal;
36   UINT8 *m_vram;
37
38   required_device<z180_device> m_maincpu;
39
40protected:
41   // driver_device overrides
42   //virtual void machine_start();
43   //virtual void machine_reset();
44
45   virtual void video_start();
46   virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect);
2747};
2848
2949
3050
31static VIDEO_START(chsuper)
51void chsuper_state::video_start()
3252{
53   m_vram = auto_alloc_array_clear(machine(), UINT8, 1 << 13);
3354}
3455
35static SCREEN_UPDATE(chsuper)
56bool chsuper_state::screen_update( screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect )
3657{
37   //chsuper_state *state = screen->machine().driver_data<chsuper_state>();
38   const gfx_element *gfx = screen->machine().gfx[0];
39   UINT8 *vram = screen->machine().region("vram")->base();
58   const gfx_element *gfx = machine().gfx[0];
4059   int count = 0x0000;
4160   int y,x;
4261
r13476r13477
4463   {
4564      for (x=0;x<128;x++)
4665      {
47         int tile = ((vram[count+1]<<8) | vram[count]) & 0xffff;
66         int tile = ((m_vram[count+1]<<8) | m_vram[count]) & 0xffff;
4867
49         //tile ^=state->m_tilexor;
50
51         drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*4,y*8);
68         drawgfx_opaque(&bitmap,&cliprect,gfx,tile,0,0,0,x*4,y*8);
5269         count+=2;
5370      }
5471   }
r13476r13477
5673   return 0;
5774}
5875
59static WRITE8_HANDLER( paletteram_io_w )
76READ8_MEMBER( chsuper_state::ff_r )
6077{
61   chsuper_state *state = space->machine().driver_data<chsuper_state>();
62   switch(offset)
63   {
64      case 0:
65         state->m_pal.offs = data;
66         break;
67      case 2:
68         state->m_pal.offs_internal = 0;
69         break;
70      case 1:
71         switch(state->m_pal.offs_internal)
72         {
73            case 0:
74               state->m_pal.r = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
75               state->m_pal.offs_internal++;
76               break;
77            case 1:
78               state->m_pal.g = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
79               state->m_pal.offs_internal++;
80               break;
81            case 2:
82               state->m_pal.b = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
83               palette_set_color(space->machine(), state->m_pal.offs, MAKE_RGB(state->m_pal.r, state->m_pal.g, state->m_pal.b));
84               state->m_pal.offs_internal = 0;
85               state->m_pal.offs++;
86               break;
87         }
88
89         break;
90   }
91}
92
93static READ8_HANDLER( ff_r )
94{
9578   return 0xff;
9679}
9780
98static WRITE8_HANDLER( chsuper_vram_w )
81WRITE8_MEMBER( chsuper_state::chsuper_vram_w )
9982{
100   UINT8 *vram = space->machine().region("vram")->base();
101
102   vram[offset] = data;
83   m_vram[offset] = data;
10384}
10485
105static ADDRESS_MAP_START( chsuper_prg_map, AS_PROGRAM, 8 )
86static ADDRESS_MAP_START( chsuper_prg_map, AS_PROGRAM, 8, chsuper_state )
10687   AM_RANGE(0x00000, 0x0efff) AM_ROM
10788   AM_RANGE(0x00000, 0x01fff) AM_WRITE( chsuper_vram_w )
10889   AM_RANGE(0x0f000, 0x0ffff) AM_RAM AM_REGION("maincpu", 0xf000)
r13476r13477
11192
11293//  AM_RANGE(0xaff8, 0xaff8) AM_DEVWRITE_MODERN("oki", okim6295_device, write)
11394
114static ADDRESS_MAP_START( chsuper_portmap, AS_IO, 8 )
95static ADDRESS_MAP_START( chsuper_portmap, AS_IO, 8, chsuper_state )
11596   AM_RANGE( 0x0000, 0x003f ) AM_RAM // Z180 internal regs
11697   AM_RANGE( 0x00e8, 0x00e8 ) AM_READ_PORT("IN0")
11798   AM_RANGE( 0x00e9, 0x00e9 ) AM_READ_PORT("IN1")
11899   AM_RANGE( 0x00ea, 0x00ea ) AM_READ_PORT("DSW0")
119100   AM_RANGE( 0x00ed, 0x00ef ) AM_WRITENOP //lamps
120   AM_RANGE( 0x00fc, 0x00fe ) AM_WRITE( paletteram_io_w )
101   AM_RANGE( 0x00fc, 0x00fc ) AM_DEVWRITE("ramdac", ramdac_device, index_w)
102   AM_RANGE( 0x00fd, 0x00fd ) AM_DEVWRITE("ramdac", ramdac_device, pal_w)
103   AM_RANGE( 0x00fe, 0x00fe ) AM_DEVWRITE("ramdac", ramdac_device, mask_w)
121104   AM_RANGE( 0x8300, 0x8300 ) AM_READ( ff_r ) //probably data for the dac
122   AM_RANGE( 0xff20, 0xff3f ) AM_DEVWRITE("dac", dac_w) // unk writes
105   AM_RANGE( 0xff20, 0xff3f ) AM_DEVWRITE_LEGACY("dac", dac_w) // unk writes
123106ADDRESS_MAP_END
124107
125108static INPUT_PORTS_START( chsuper )
r13476r13477
201184   GFXDECODE_ENTRY( "gfx1", 0x00000, charlayout,   0, 1 )
202185GFXDECODE_END
203186
187static ADDRESS_MAP_START( ramdac_map, AS_0, 8, chsuper_state )
188   AM_RANGE(0x000, 0x3ff) AM_DEVREADWRITE("ramdac",ramdac_device,ramdac_pal_r,ramdac_rgb666_w)
189ADDRESS_MAP_END
190
191static RAMDAC_INTERFACE( ramdac_intf )
192{
193   0
194};
195
204196static MACHINE_CONFIG_START( chsuper, chsuper_state )
205197
206198   /* basic machine hardware */
r13476r13477
216208   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
217209   MCFG_SCREEN_SIZE(64*8, 64*8)
218210   MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 0, 30*8-1)
219   MCFG_SCREEN_UPDATE(chsuper)
220211
221212   MCFG_NVRAM_ADD_0FILL("nvram")
222213
223214   MCFG_GFXDECODE(chsuper)
224215   MCFG_PALETTE_LENGTH(0x100)
225216
226   MCFG_VIDEO_START(chsuper)
217   MCFG_RAMDAC_ADD("ramdac", ramdac_intf, ramdac_map)
227218
228219   /* sound hardware */
229220   MCFG_SPEAKER_STANDARD_MONO("mono")
r13476r13477
244235   ROM_LOAD( "a.bin",  0x00000, 0x80000, CRC(ace8b591) SHA1(e9ba5efebdc9b655056ed8b2621f062f50e0528f) )
245236   ROM_LOAD( "b.bin",  0x80000, 0x80000, CRC(5f58c722) SHA1(d339ae27af010b058eae9084fba85fb2fbed3952) )
246237
247   ROM_REGION( 0x10000, "vram", ROMREGION_ERASE00 )
248
249238   ROM_REGION( 0x80000, "adpcm", 0 )
250239   ROM_COPY( "maincpu", 0x10000, 0x00000, 0x70000 )
251240ROM_END
r13476r13477
258247   ROM_LOAD( "chsuper2-a.bin",  0x00000, 0x80000, CRC(7caa8ebe) SHA1(440306a208ec8afd570b15f05b5dc542acc98510) )
259248   ROM_LOAD( "chsuper2-b.bin",  0x80000, 0x80000, CRC(7bb463d7) SHA1(fb3842ba53e545fa47574c91df7281a9cb417395) )
260249
261   ROM_REGION( 0x10000, "vram", ROMREGION_ERASE00 )
262
263250   ROM_REGION( 0x80000, "adpcm", 0 )
264251   ROM_COPY( "maincpu", 0x10000, 0x00000, 0x70000 )
265252ROM_END
r13476r13477
268255   ROM_REGION( 0x80000, "maincpu", 0 ) // code + samples
269256   ROM_LOAD( "3.ic11", 0x00000, 0x80000, CRC(46aa2ce7) SHA1(036d67a26c890c4dc26599bfcd2c67f12e30fb52) )
270257
271   ROM_REGION( 0x010000, "vram", ROMREGION_ERASE00 )
272
273258   ROM_REGION( 0x100000, "gfx1", 0 )
274259   ROM_LOAD( "1.ic18", 0x00000, 0x80000, CRC(8e202eaa) SHA1(156b498873111e5890c00d447201ba4bcbe6e633) )
275260   ROM_LOAD( "2.ic19", 0x80000, 0x80000, CRC(dc0790b0) SHA1(4550f85e609338635a3987f7832517ed1d6388d4) )
r13476r13477
299284   }
300285
301286   memcpy(rom,buffer,0x100000);
302
303   state->m_tilexor = 0x0000;
304287}
305288
306289static DRIVER_INIT( chsuper3 )
r13476r13477
324307   }
325308
326309   memcpy(rom,buffer,0x100000);
327
328   state->m_tilexor = 0x0000;
329310}
330311
331312static DRIVER_INIT( chmpnum )
r13476r13477
353334   }
354335
355336   memcpy(rom,buffer,0x100000);
356
357   state->m_tilexor = 0x0000;
358337}
359338
360339
src/mame/drivers/cps2.c
r13476r13477
593593
594594#include "emu.h"
595595#include "cpu/z80/z80.h"
596#include "deprecat.h"
597596#include "machine/eeprom.h"
598597#include "cpu/m68000/m68000.h"
599598#include "sound/qsound.h"
r13476r13477
622621 *
623622 *************************************/
624623
625static INTERRUPT_GEN( cps2_interrupt )
624static TIMER_DEVICE_CALLBACK( cps2_interrupt )
626625{
627   cps_state *state = device->machine().driver_data<cps_state>();
626   cps_state *state = timer.machine().driver_data<cps_state>();
628627
629628   /* 2 is vblank, 4 is some sort of scanline interrupt, 6 is both at the same time. */
630629   if (state->m_scancount >= 258)
r13476r13477
646645   if (state->m_scanline1 == state->m_scancount || (state->m_scanline1 < state->m_scancount && !state->m_scancalls))
647646   {
648647      state->m_cps_b_regs[0x10/2] = 0;
649      device_set_input_line(device, 4, HOLD_LINE);
650      cps2_set_sprite_priorities(device->machine());
651      device->machine().primary_screen->update_partial(16 - 10 + state->m_scancount);   /* visarea.min_y - [first visible line?] + scancount */
648      device_set_input_line(state->m_maincpu, 4, HOLD_LINE);
649      cps2_set_sprite_priorities(timer.machine());
650      timer.machine().primary_screen->update_partial(16 - 10 + state->m_scancount);   /* visarea.min_y - [first visible line?] + scancount */
652651      state->m_scancalls++;
653652//          popmessage("IRQ4 scancounter = %04i", state->m_scancount);
654653   }
r13476r13477
657656   if(state->m_scanline2 == state->m_scancount || (state->m_scanline2 < state->m_scancount && !state->m_scancalls))
658657   {
659658      state->m_cps_b_regs[0x12 / 2] = 0;
660      device_set_input_line(device, 4, HOLD_LINE);
661      cps2_set_sprite_priorities(device->machine());
662      device->machine().primary_screen->update_partial(16 - 10 + state->m_scancount);   /* visarea.min_y - [first visible line?] + scancount */
659      device_set_input_line(state->m_maincpu, 4, HOLD_LINE);
660      cps2_set_sprite_priorities(timer.machine());
661      timer.machine().primary_screen->update_partial(16 - 10 + state->m_scancount);   /* visarea.min_y - [first visible line?] + scancount */
663662      state->m_scancalls++;
664663//          popmessage("IRQ4 scancounter = %04i",scancount);
665664   }
r13476r13477
668667   {
669668      state->m_cps_b_regs[0x10 / 2] = state->m_scanline1;
670669      state->m_cps_b_regs[0x12 / 2] = state->m_scanline2;
671      device_set_input_line(device, 2, HOLD_LINE);
670      device_set_input_line(state->m_maincpu, 2, HOLD_LINE);
672671      if(state->m_scancalls)
673672      {
674         cps2_set_sprite_priorities(device->machine());
675         device->machine().primary_screen->update_partial(256);
673         cps2_set_sprite_priorities(timer.machine());
674         timer.machine().primary_screen->update_partial(256);
676675      }
677      cps2_objram_latch(device->machine());
676      cps2_objram_latch(timer.machine());
678677   }
679678   //popmessage("Raster calls = %i", state->m_scancalls);
680679}
r13476r13477
12181217   /* basic machine hardware */
12191218   MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz)
12201219   MCFG_CPU_PROGRAM_MAP(cps2_map)
1221   MCFG_CPU_VBLANK_INT_HACK(cps2_interrupt,259)   // 262  /* ??? interrupts per frame */
1220   MCFG_TIMER_ADD_SCANLINE("scantimer", cps2_interrupt, "screen", 0, 1)
12221221
12231222   MCFG_CPU_ADD("audiocpu", Z80, 8000000)
12241223   MCFG_CPU_PROGRAM_MAP(qsound_sub_map)
src/mame/drivers/ikki.c
r13476r13477
1313
1414#include "emu.h"
1515#include "cpu/z80/z80.h"
16#include "deprecat.h"
1716#include "sound/sn76496.h"
1817#include "includes/ikki.h"
1918
r13476r13477
2625
2726static READ8_HANDLER( ikki_e000_r )
2827{
28   ikki_state *state = space->machine().driver_data<ikki_state>();
29
2930/* bit1: interrupt type?, bit0: CPU2 busack? */
3031
31   if (cpu_getiloops(&space->device()) == 0)
32      return 0;
33   return 2;
32   return (state->m_irq_source << 1);
3433}
3534
3635static WRITE8_HANDLER( ikki_coin_counters )
r13476r13477
174173static const gfx_layout charlayout =
175174{
176175   8,8,    /* 8*8 characters */
177   2048,   /* 2048 characters */
176   RGN_FRAC(1,3),   /* 2048 characters */
178177   3,      /* 3 bits per pixel */
179   {0,16384*8,16384*8*2},
178   {RGN_FRAC(0,3),RGN_FRAC(1,3),RGN_FRAC(2,3)},
180179   {7,6,5,4,3,2,1,0},
181180   {8*0, 8*1, 8*2, 8*3, 8*4, 8*5, 8*6, 8*7},
182181   8*8
r13476r13477
185184static const gfx_layout spritelayout =
186185{
187186   16,32,  /* 16*32 characters */
188   256,    /* 256 characters */
187   RGN_FRAC(1,3),    /* 256 characters */
189188   3,      /* 3 bits per pixel */
190   {16384*8*2,16384*8,0},
189   {RGN_FRAC(0,3),RGN_FRAC(1,3),RGN_FRAC(2,3)},
191190   {7,6,5,4,3,2,1,0,
192191      8*16+7,8*16+6,8*16+5,8*16+4,8*16+3,8*16+2,8*16+1,8*16+0},
193192   {8*0, 8*1, 8*2, 8*3, 8*4, 8*5, 8*6, 8*7,
r13476r13477
215214
216215   state->save_item(NAME(state->m_flipscreen));
217216   state->save_item(NAME(state->m_punch_through_pen));
217   state->save_item(NAME(state->m_irq_source));
218218}
219219
220220static MACHINE_RESET( ikki )
r13476r13477
224224   state->m_flipscreen = 0;
225225}
226226
227static TIMER_DEVICE_CALLBACK( ikki_irq )
228{
229   ikki_state *state = timer.machine().driver_data<ikki_state>();
230   int scanline = param;
231
232   if(scanline == 240 || scanline == 0)
233   {
234      device_set_input_line(state->m_maincpu,0,HOLD_LINE);
235
236      state->m_irq_source = (scanline != 240);
237   }
238}
239
227240static MACHINE_CONFIG_START( ikki, ikki_state )
228241
229242   /* basic machine hardware */
230243   MCFG_CPU_ADD("maincpu", Z80,8000000/2) /* 4.000MHz */
231244   MCFG_CPU_PROGRAM_MAP(ikki_cpu1)
232   MCFG_CPU_VBLANK_INT_HACK(irq0_line_hold,2)
245   MCFG_TIMER_ADD_SCANLINE("scantimer", ikki_irq, "screen", 0, 1)
233246
234247   MCFG_CPU_ADD("sub", Z80,8000000/2) /* 4.000MHz */
235248   MCFG_CPU_PROGRAM_MAP(ikki_cpu2)
236   MCFG_CPU_VBLANK_INT_HACK(irq0_line_hold,2)
249   MCFG_CPU_PERIODIC_INT(irq0_line_hold,2*60)
237250
238   MCFG_QUANTUM_TIME(attotime::from_hz(600))
251   MCFG_QUANTUM_PERFECT_CPU("maincpu")
239252
240253   MCFG_MACHINE_START(ikki)
241254   MCFG_MACHINE_RESET(ikki)
r13476r13477
245258   MCFG_SCREEN_REFRESH_RATE(60)
246259   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
247260   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
248   MCFG_SCREEN_SIZE(32*8, 32*8)
261   MCFG_SCREEN_SIZE(32*8, 32*8+3*8)
249262   MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
250263   MCFG_SCREEN_UPDATE(ikki)
251264
r13476r13477
284297   ROM_LOAD( "tvg17_5",  0x0000,  0x2000, CRC(22bdb40e) SHA1(265801ad660a5a3fc5bb187fa92dbe6098b390f5) )
285298
286299   ROM_REGION( 0xc000, "gfx1", 0 ) /* sprite */
287   ROM_LOAD( "tvg17_6",  0x0000,  0x4000, CRC(dc8aa269) SHA1(fd8b5c2bead52e1e136d4df4c26f136d8992d9be) )
300   ROM_LOAD( "tvg17_8",  0x0000,  0x4000, CRC(45c9087a) SHA1(9db82fc194096588fde5048e922a654e2ad12c23) )
288301   ROM_LOAD( "tvg17_7",  0x4000,  0x4000, CRC(0e9efeba) SHA1(d922c4276a988b78b9a2a3ca632136e64a80d995) )
289   ROM_LOAD( "tvg17_8",  0x8000,  0x4000, CRC(45c9087a) SHA1(9db82fc194096588fde5048e922a654e2ad12c23) )
302   ROM_LOAD( "tvg17_6",  0x8000,  0x4000, CRC(dc8aa269) SHA1(fd8b5c2bead52e1e136d4df4c26f136d8992d9be) )
290303
291304   ROM_REGION( 0xc000, "gfx2", 0 ) /* bg */
305   ROM_LOAD( "tvg17_11", 0x0000,  0x4000, CRC(35012775) SHA1(c90386660755c85fb9f020f8161805dd02a16271) )
306   ROM_LOAD( "tvg17_10", 0x4000,  0x4000, CRC(2e510b4e) SHA1(c0ff4515e66ab4959b597a4d930cbbcc31c53cda) )
292307   ROM_LOAD( "tvg17_9",  0x8000,  0x4000, CRC(c594f3c5) SHA1(6fe19d9ccbe6934a210eb2cab441cd0ba83cbcf4) )
293   ROM_LOAD( "tvg17_10", 0x4000,  0x4000, CRC(2e510b4e) SHA1(c0ff4515e66ab4959b597a4d930cbbcc31c53cda) )
294   ROM_LOAD( "tvg17_11", 0x0000,  0x4000, CRC(35012775) SHA1(c90386660755c85fb9f020f8161805dd02a16271) )
295308
296309   ROM_REGION( 0x0700, "proms", 0 ) /* color PROMs */
297310   ROM_LOAD( "prom17_3", 0x0000,  0x0100, CRC(dbcd3bec) SHA1(1baeec277b16c82b67e10da9d4c84cf383ef4a82) ) /* R */
r13476r13477
317330   ROM_LOAD( "tvg-5.30",  0x0000, 0x2000, CRC(22bdb40e) SHA1(265801ad660a5a3fc5bb187fa92dbe6098b390f5) )
318331
319332   ROM_REGION( 0xc000, "gfx1", 0 ) /* sprite */
320   ROM_LOAD( "tvg-6.104", 0x0000, 0x4000, CRC(dc8aa269) SHA1(fd8b5c2bead52e1e136d4df4c26f136d8992d9be) )
333   ROM_LOAD( "tvg-8.102", 0x0000, 0x4000, CRC(45c9087a) SHA1(9db82fc194096588fde5048e922a654e2ad12c23) )
321334   ROM_LOAD( "tvg-7.103", 0x4000, 0x4000, CRC(0e9efeba) SHA1(d922c4276a988b78b9a2a3ca632136e64a80d995) )
322   ROM_LOAD( "tvg-8.102", 0x8000, 0x4000, CRC(45c9087a) SHA1(9db82fc194096588fde5048e922a654e2ad12c23) )
335   ROM_LOAD( "tvg-6.104", 0x8000, 0x4000, CRC(dc8aa269) SHA1(fd8b5c2bead52e1e136d4df4c26f136d8992d9be) )
323336
324337   ROM_REGION( 0xc000, "gfx2", 0 ) /* bg */
338   ROM_LOAD( "tvg17_11", 0x0000,  0x4000, CRC(35012775) SHA1(c90386660755c85fb9f020f8161805dd02a16271) )
339   ROM_LOAD( "tvg17_10", 0x4000,  0x4000, CRC(2e510b4e) SHA1(c0ff4515e66ab4959b597a4d930cbbcc31c53cda) )
325340   ROM_LOAD( "tvg17_9",  0x8000,  0x4000, CRC(c594f3c5) SHA1(6fe19d9ccbe6934a210eb2cab441cd0ba83cbcf4) )
326   ROM_LOAD( "tvg17_10", 0x4000,  0x4000, CRC(2e510b4e) SHA1(c0ff4515e66ab4959b597a4d930cbbcc31c53cda) )
327   ROM_LOAD( "tvg17_11", 0x0000,  0x4000, CRC(35012775) SHA1(c90386660755c85fb9f020f8161805dd02a16271) )
328341
329342   ROM_REGION( 0x0700, "proms", 0 ) /* color PROMs */
330343   ROM_LOAD( "prom17_3", 0x0000,  0x0100, CRC(dbcd3bec) SHA1(1baeec277b16c82b67e10da9d4c84cf383ef4a82) ) /* R */
src/mame/drivers/crbaloon.c
r13476r13477
158158
159159static WRITE8_HANDLER( port_sound_w )
160160{
161   crbaloon_state *state = space->machine().driver_data<crbaloon_state>();
161162   device_t *discrete = space->machine().device("discrete");
162163   device_t *sn = space->machine().device("snsnd");
163164
164165   /* D0 - interrupt enable - also goes to PC3259 as /HTCTRL */
165   cpu_interrupt_enable(space->machine().device("maincpu"), (data & 0x01) ? TRUE : FALSE);
166   state->m_irq_mask = data & 0x01;
166167   crbaloon_set_clear_collision_address(space->machine(), (data & 0x01) ? TRUE : FALSE);
167168
168169   /* D1 - SOUND STOP */
r13476r13477
357358 *
358359 *************************************/
359360
361static INTERRUPT_GEN( vblank_irq )
362{
363   crbaloon_state *state = device->machine().driver_data<crbaloon_state>();
364
365   if(state->m_irq_mask)
366      device_set_input_line(device, 0, HOLD_LINE);
367}
368
369
360370static MACHINE_CONFIG_START( crbaloon, crbaloon_state )
361371
362372   /* basic machine hardware */
363373   MCFG_CPU_ADD("maincpu", Z80, CRBALOON_MASTER_XTAL / 3)
364374   MCFG_CPU_PROGRAM_MAP(main_map)
365375   MCFG_CPU_IO_MAP(main_io_map)
366   MCFG_CPU_VBLANK_INT("screen", irq0_line_hold)
376   MCFG_CPU_VBLANK_INT("screen", vblank_irq)
367377
368378   MCFG_MACHINE_RESET(crballoon)
369379
src/mame/drivers/gal3.c
r13476r13477
267267   }
268268}
269269
270/* shared RAM memory handlers */
271270
272static READ32_HANDLER( shareram0_r )
273{
274   gal3_state *state = space->machine().driver_data<gal3_state>();
275   return state->m_mpSharedRAM0[offset];
276}
277
278static WRITE32_HANDLER( shareram0_w )
279{
280   gal3_state *state = space->machine().driver_data<gal3_state>();
281   COMBINE_DATA( &state->m_mpSharedRAM0[offset] );
282}
283
284#if 0
285static READ32_HANDLER( shareram1_r )
286{
287   gal3_state *state = space->machine().driver_data<gal3_state>();
288   return state->m_mpSharedRAM1[offset];
289}
290
291static WRITE32_HANDLER( shareram1_w )
292{
293   gal3_state *state = space->machine().driver_data<gal3_state>();
294   COMBINE_DATA( &state->m_mpSharedRAM1[offset] );
295}
296#endif
297
298271/***************************************************************************************/
299272
300273static READ32_HANDLER( led_mst_r )
r13476r13477
376349   state->m_rsoSharedRAM[offset+1] = v&0xffff;
377350}
378351
352
379353static ADDRESS_MAP_START( cpu_mst_map, AS_PROGRAM, 32 )
380354   AM_RANGE(0x00000000, 0x001fffff) AM_ROM
381355   AM_RANGE(0x20000000, 0x20001fff) AM_RAM AM_BASE_MEMBER(gal3_state, m_nvmem) AM_SIZE_MEMBER(gal3_state, m_nvmem_size)   //NVRAM
r13476r13477
384358   AM_RANGE(0x44800000, 0x44800003) AM_READ(led_mst_r) AM_WRITE(led_mst_w)   //LEDs
385359   AM_RANGE(0x48000000, 0x48000003) AM_READNOP   //irq1 v-blank ack
386360   AM_RANGE(0x4c000000, 0x4c000003) AM_READNOP   //irq3 ack
387   AM_RANGE(0x60000000, 0x60007fff) AM_READ(shareram0_r) AM_WRITE(shareram0_w) AM_BASE_MEMBER(gal3_state, m_mpSharedRAM0)   //CRAM
388   AM_RANGE(0x60010000, 0x60017fff) AM_READ(shareram0_r) AM_WRITE(shareram0_w)   //Mirror
361   AM_RANGE(0x60000000, 0x60007fff) AM_RAM AM_SHARE("share1")   //CRAM
362   AM_RANGE(0x60010000, 0x60017fff) AM_RAM AM_SHARE("share1")   //Mirror
389363   AM_RANGE(0x80000000, 0x8007ffff) AM_RAM   //512K Local RAM
390364/// AM_RANGE(0xc0000000, 0xc000000b) AM_WRITENOP    //upload?
391365   AM_RANGE(0xc000000c, 0xc000000f) AM_READNOP   //irq2 ack
r13476r13477
401375   AM_RANGE(0x48000000, 0x48000003) AM_READNOP   //irq1 ack
402376/// AM_RANGE(0x50000000, 0x50000003) AM_READ() AM_WRITE()
403377/// AM_RANGE(0x54000000, 0x54000003) AM_READ() AM_WRITE()
404   AM_RANGE(0x60000000, 0x60007fff) AM_READ(shareram0_r) AM_WRITE(shareram0_w)
405   AM_RANGE(0x60010000, 0x60017fff) AM_READ(shareram0_r) AM_WRITE(shareram0_w)
378   AM_RANGE(0x60000000, 0x60007fff) AM_RAM AM_SHARE("share1")
379   AM_RANGE(0x60010000, 0x60017fff) AM_RAM AM_SHARE("share1")
406380   AM_RANGE(0x80000000, 0x8007ffff) AM_RAM   //512K Local RAM
407381
408382   AM_RANGE(0xf1200000, 0xf120ffff) AM_RAM   //DSP RAM
src/mame/drivers/chihiro.c
r13476r13477
371371#include "debug/debugcpu.h"
372372
373373#define LOG_PCI
374#define LOG_OHCI
374375
375376static struct {
376377   device_t   *pic8259_1;
r13476r13477
649650
650651static READ32_HANDLER( geforce_r )
651652{
652static int x;
653static int x,ret;
653654
655   ret=0;
654656   if (offset == 0x1804f6) {
655657      x = x ^ 0x08080808;
656      return x;
658      ret=x;
657659   }
658   return 0;
660   logerror("NV_2A: read at %08X mask %08X value %08X\n",0xfd000000+offset*4,mem_mask,ret);
661   return ret;
659662}
660663
661664static WRITE32_HANDLER( geforce_w )
662665{
666   logerror("NV_2A: write at %08X mask %08X value %08X\n",0xfd000000+offset*4,mem_mask,data);
663667}
664668
665static UINT32 dummy_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask)
669static UINT32 geforce_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask)
666670{
667671#ifdef LOG_PCI
668   logerror("  bus:0 function:%d register:%d mask:%08X\n",function,reg,mem_mask);
672   logerror("  bus:1 function:%d register:%d mask:%08X\n",function,reg,mem_mask);
669673#endif
670674   return 0;
671675}
672676
673static void dummy_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask)
677static void geforce_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask)
674678{
675679#ifdef LOG_PCI
676   logerror("  bus:0 function:%d register:%d data:%08X mask:%08X\n",function,reg,data,mem_mask);
680   logerror("  bus:1 function:%d register:%d data:%08X mask:%08X\n",function,reg,data,mem_mask);
677681#endif
678682}
679683
680static UINT32 geforce_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask)
684/*
685 * ohci usb controller placeholder
686 */
687
688static const char *const usbregnames[]={
689   "HcRevision",
690   "HcControl",
691   "HcCommandStatus",
692   "HcInterruptStatus",
693   "HcInterruptEnable",
694   "HcInterruptDisable",
695   "HcHCCA",
696   "HcPeriodCurrentED",
697   "HcControlHeadED",
698   "HcControlCurrentED",
699   "HcBulkHeadED",
700   "HcBulkCurrentED",
701   "HcDoneHead",
702   "HcFmInterval",
703   "HcFmRemaining",
704   "HcFmNumber",
705   "HcPeriodicStart",
706   "HcLSThreshold",
707   "HcRhDescriptorA",
708   "HcRhDescriptorB",
709   "HcRhStatus",
710   "HcRhPortStatus[1]"
711};
712
713static READ32_HANDLER( usbctrl_r )
681714{
715   if (offset == 0) { /* hack needed until usb (and jvs) is implemented */
716      chihiro_devices.pic8259_1->machine().firstcpu->space(0)->write_byte(0x6a79f,0x01);
717      chihiro_devices.pic8259_1->machine().firstcpu->space(0)->write_byte(0x6a7a0,0x00);
718   }
719#ifdef LOG_OHCI
720   if (offset >= 0x54/4)
721      logerror("usb controller 0 register HcRhPortStatus[%d] read\n",(offset-0x54/4)+1);
722   else
723      logerror("usb controller 0 register %s read\n",usbregnames[offset]);
724#endif
725   return 0;
726}
727
728static WRITE32_HANDLER( usbctrl_w )
729{
730#ifdef LOG_OHCI
731   if (offset >= 0x54/4)
732      logerror("usb controller 0 register HcRhPortStatus[%d] write %08X\n",(offset-0x54/4)+1,data);
733   else
734      logerror("usb controller 0 register %s write %08X\n",usbregnames[offset],data);
735#endif
736}
737
738/*
739 * dummy for non connected devices
740 */
741
742static UINT32 dummy_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask)
743{
682744#ifdef LOG_PCI
683   logerror("  bus:1 function:%d register:%d mask:%08X\n",function,reg,mem_mask);
745   logerror("  bus:0 function:%d register:%d mask:%08X\n",function,reg,mem_mask);
684746#endif
685747   return 0;
686748}
687749
688static void geforce_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask)
750static void dummy_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask)
689751{
690752#ifdef LOG_PCI
691   logerror("  bus:1 function:%d register:%d data:%08X mask:%08X\n",function,reg,data,mem_mask);
753   logerror("  bus:0 function:%d register:%d data:%08X mask:%08X\n",function,reg,data,mem_mask);
692754#endif
693755}
694756
r13476r13477
895957   return 0;
896958}
897959
898static int eeprom_buffer[256];
960// let's try to fake the missing eeprom
961static int dummyeeprom[256]={0x94,0x18,0x10,0x59,0x83,0x58,0x15,0xDA,0xDF,0xCC,0x1D,0x78,0x20,0x8A,0x61,0xB8,0x08,0xB4,0xD6,0xA8,
962   0x9E,0x77,0x9C,0xEB,0xEA,0xF8,0x93,0x6E,0x3E,0xD6,0x9C,0x49,0x6B,0xB5,0x6E,0xAB,0x6D,0xBC,0xB8,0x80,0x68,0x9D,0xAA,0xCD,0x0B,0x83,
963   0x17,0xEC,0x2E,0xCE,0x35,0xA8,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x61,0x62,0x63,0xAA,0xBB,0xCC,0xDD,0xEE,0xFF,0x00,0x00,
964   0x4F,0x6E,0x6C,0x69,0x6E,0x65,0x6B,0x65,0x79,0x69,0x6E,0x76,0x61,0x6C,0x69,0x64,0x00,0x03,0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,
965   0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
899966
900967int smbus_eeprom(int command,int rw,int data)
901968{
902   if (rw == 1) { // 8003b744,3b744=0x90 0x90
969   if (command >= 112)
970      return 0;
971   if (rw == 1) { // if reading
972      // 8003b744,3b744=0x90 0x90
903973      // hack to avoid hanging if eeprom contents are not correct
904974      // this would need dumping the serial eeprom on the xbox board
905975      if (command == 0) {
r13476r13477
908978         chihiro_devices.pic8259_1->machine().firstcpu->space(0)->write_byte(0x3b766,0xc9);
909979         chihiro_devices.pic8259_1->machine().firstcpu->space(0)->write_byte(0x3b767,0xc3);
910980      }
911      data = eeprom_buffer[command]+eeprom_buffer[command+1]*256;
981      data = dummyeeprom[command]+dummyeeprom[command+1]*256;
912982      logerror("eeprom: %d %d %d\n",command,rw,data);
913983      return data;
914984   }
915985   logerror("eeprom: %d %d %d\n",command,rw,data);
916   eeprom_buffer[command]=data;
986   dummyeeprom[command]=data;
917987   return 0;
918988}
919989
r13476r13477
9981068static ADDRESS_MAP_START( xbox_map, AS_PROGRAM, 32 )
9991069   AM_RANGE(0x00000000, 0x07ffffff) AM_RAM
10001070   AM_RANGE(0xfd000000, 0xfdffffff) AM_READWRITE(geforce_r, geforce_w)
1071   AM_RANGE(0xfed00000, 0xfed003ff) AM_READWRITE(usbctrl_r, usbctrl_w)
10011072   AM_RANGE(0xff000000, 0xffffffff) AM_ROM AM_REGION("bios", 0) AM_MIRROR(0x00f80000)
10021073ADDRESS_MAP_END
10031074
src/mame/drivers/warpwarp.c
r13476r13477
290290         coin_counter_w(space->machine(), 0,data & 1);
291291         break;
292292      case 6:
293         state->m_ball_on = data & 1;
294         cpu_interrupt_enable(space->machine().device("maincpu"), data & 1);
293         state->m_ball_on = state->m_irq_mask = data & 1;
295294         if (~data & 1)
296295            cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
297296         break;
r13476r13477
715714   GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0, 256 )
716715GFXDECODE_END
717716
717static INTERRUPT_GEN( vblank_irq )
718{
719   warpwarp_state *state = device->machine().driver_data<warpwarp_state>();
718720
721   if(state->m_irq_mask)
722      device_set_input_line(device, 0, HOLD_LINE);
723}
719724
725
720726static MACHINE_CONFIG_START( geebee, warpwarp_state )
721727
722728   /* basic machine hardware */
723729   MCFG_CPU_ADD("maincpu", I8080, MASTER_CLOCK/9) /* verified on pcb */
724730   MCFG_CPU_PROGRAM_MAP(geebee_map)
725731   MCFG_CPU_IO_MAP(geebee_port_map)
726   MCFG_CPU_VBLANK_INT("screen", irq0_line_hold)
732   MCFG_CPU_VBLANK_INT("screen", vblank_irq)
727733
728734   /* video hardware */
729735   MCFG_SCREEN_ADD("screen", RASTER)
src/mame/drivers/gng.c
r13476r13477
325325      int i;
326326
327327      /* TODO: PCB reference clearly shows that the POST has random/filled data on the paletteram.
328                For now let's fill everything with white colors until we have better info about it */
328                 For now let's fill everything with white colors until we have better info about it */
329329      for(i=0;i<0x100;i+=4)
330330      {
331331         machine.generic.paletteram.u8[i] = machine.generic.paletteram2.u8[i] = 0x00;
src/mame/drivers/rallyx.c
r13476r13477
235235         break;
236236
237237      case 0x01:   /* INT ON */
238         cpu_interrupt_enable(state->m_maincpu, bit);
238         state->m_main_irq_mask = bit;
239239         if (!bit)
240240            device_set_input_line(state->m_maincpu, 0, CLEAR_LINE);
241241         break;
r13476r13477
281281         break;
282282
283283      case 0x01:   /* INTST */
284         cpu_interrupt_enable(state->m_maincpu, bit);
284         state->m_main_irq_mask = bit;
285285         break;
286286
287287      case 0x02:   /* MUT */
r13476r13477
894894   state->m_stars_enable = 0;
895895}
896896
897static INTERRUPT_GEN( rallyx_vblank_irq )
898{
899   rallyx_state *state = device->machine().driver_data<rallyx_state>();
900
901   if(state->m_main_irq_mask)
902      device_set_input_line(device, 0, ASSERT_LINE);
903}
904
905static INTERRUPT_GEN( jungler_vblank_irq )
906{
907   rallyx_state *state = device->machine().driver_data<rallyx_state>();
908
909   if(state->m_main_irq_mask)
910      device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
911}
912
897913static MACHINE_CONFIG_START( rallyx, rallyx_state )
898914
899915   /* basic machine hardware */
900916   MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6)   /* 3.072 MHz */
901917   MCFG_CPU_PROGRAM_MAP(rallyx_map)
902918   MCFG_CPU_IO_MAP(io_map)
903   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
919   MCFG_CPU_VBLANK_INT("screen", rallyx_vblank_irq)
904920
905921   MCFG_MACHINE_START(rallyx)
906922   MCFG_MACHINE_RESET(rallyx)
r13476r13477
940956   /* basic machine hardware */
941957   MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6)   /* 3.072 MHz */
942958   MCFG_CPU_PROGRAM_MAP(jungler_map)
943   MCFG_CPU_VBLANK_INT("screen", nmi_line_pulse)
959   MCFG_CPU_VBLANK_INT("screen", jungler_vblank_irq)
944960
945961   MCFG_MACHINE_START(rallyx)
946962   MCFG_MACHINE_RESET(rallyx)
src/mame/drivers/battlera.c
r13476r13477
1313    Twice as much VRAM.
1414
1515    Todo:
16    - Convert this driver to use proper PC-Engine video.
1617    - Priority is wrong for the submarine at the end of level 1.
1718    - There seems to be a bug with a stuck note from the YM2203 FM channel
1819      at the start of scene 3 and near the ending when your characters are
r13476r13477
2122**********************************************************************/
2223
2324#include "emu.h"
24#include "deprecat.h"
2525#include "cpu/h6280/h6280.h"
2626#include "sound/2203intf.h"
2727#include "sound/msm5205.h"
r13476r13477
236236   MCFG_CPU_ADD("maincpu", H6280,21477200/3)
237237   MCFG_CPU_PROGRAM_MAP(battlera_map)
238238   MCFG_CPU_IO_MAP(battlera_portmap)
239   MCFG_CPU_VBLANK_INT_HACK(battlera_interrupt,256) /* 8 prelines, 232 lines, 16 vblank? */
239   MCFG_TIMER_ADD_SCANLINE("scantimer", battlera_irq, "screen", 0, 1) /* 8 prelines, 232 lines, 16 vblank? */
240240
241241   MCFG_CPU_ADD("audiocpu", H6280,21477200/3)
242242   MCFG_CPU_PROGRAM_MAP(sound_map)
src/mame/drivers/m63.c
r13476r13477
803803   /* basic machine hardware */
804804   MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/4)     /* 3 MHz */
805805   MCFG_CPU_PROGRAM_MAP(fghtbskt_map)
806   MCFG_CPU_VBLANK_INT("screen", nmi_line_pulse)
806   MCFG_CPU_VBLANK_INT("screen", vblank_irq)
807807
808808   MCFG_CPU_ADD("soundcpu", I8039,XTAL_12MHz/4)   /* ????? */
809809   MCFG_CPU_PROGRAM_MAP(i8039_map)
src/mame/drivers/toypop.c
r13476r13477
5454
5555static READ8_HANDLER( toypop_main_interrupt_enable_r )
5656{
57   cpu_interrupt_enable(space->machine().device("maincpu"), 1);
57   toypop_state *state = space->machine().driver_data<toypop_state>();
58
59   state->m_main_irq_mask = 1;
5860   return 0;
5961}
6062
6163static WRITE8_HANDLER( toypop_main_interrupt_enable_w )
6264{
63   cpu_interrupt_enable(space->machine().device("maincpu"), 1);
65   toypop_state *state = space->machine().driver_data<toypop_state>();
66   state->m_main_irq_mask = 1;
6467   cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
6568}
6669
6770static WRITE8_HANDLER( toypop_main_interrupt_disable_w )
6871{
69   cpu_interrupt_enable(space->machine().device("maincpu"), 0);
72   toypop_state *state = space->machine().driver_data<toypop_state>();
73   state->m_main_irq_mask = 0;
7074}
7175
7276static WRITE8_HANDLER( toypop_sound_interrupt_enable_acknowledge_w )
7377{
74   cpu_interrupt_enable(space->machine().device("audiocpu"), 1);
78   toypop_state *state = space->machine().driver_data<toypop_state>();
79   state->m_sound_irq_mask = 1;
7580   cputag_set_input_line(space->machine(), "audiocpu", 0, CLEAR_LINE);
7681}
7782
7883static WRITE8_HANDLER( toypop_sound_interrupt_disable_w )
7984{
80   cpu_interrupt_enable(space->machine().device("audiocpu"), 0);
85   toypop_state *state = space->machine().driver_data<toypop_state>();
86   state->m_sound_irq_mask = 0;
8187}
8288
8389static TIMER_CALLBACK( namcoio_run )
r13476r13477
100106   }
101107}
102108
103static INTERRUPT_GEN( toypop_main_interrupt )
109static INTERRUPT_GEN( toypop_main_vblank_irq )
104110{
111   toypop_state *state = device->machine().driver_data<toypop_state>();
105112   device_t *namcoio_0 = device->machine().device("58xx");
106113   device_t *namcoio_1 = device->machine().device("56xx_1");
107114   device_t *namcoio_2 = device->machine().device("56xx_2");
108115
109   irq0_line_assert(device);   // this also checks if irq is enabled - IMPORTANT!
110                        // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
116   if(state->m_main_irq_mask)
117      device_set_input_line(device, 0, ASSERT_LINE);
111118
112119   if (!namcoio_read_reset_line(namcoio_0))      /* give the cpu a tiny bit of time to write the command before processing it */
113120      device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run));
r13476r13477
120127
121128}
122129
130static INTERRUPT_GEN( toypop_sound_timer_irq )
131{
132   toypop_state *state = device->machine().driver_data<toypop_state>();
133
134   if(state->m_sound_irq_mask)
135      device_set_input_line(device, 0, ASSERT_LINE);
136}
137
123138static WRITE8_HANDLER( toypop_sound_clear_w )
124139{
125140   cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
r13476r13477
140155   cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, ASSERT_LINE);
141156}
142157
143static TIMER_CALLBACK( disable_interrupts )
158static MACHINE_RESET( toypop )
144159{
145160   toypop_state *state = machine.driver_data<toypop_state>();
146   cpu_interrupt_enable(machine.device("maincpu"), 0);
161
162   state->m_main_irq_mask = 0;
147163   cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
148   cpu_interrupt_enable(machine.device("audiocpu"), 0);
164
165   state->m_sound_irq_mask = 0;
149166   cputag_set_input_line(machine, "audiocpu", 0, CLEAR_LINE);
167
150168   state->m_interrupt_enable_68k = 0;
151169}
152170
153static MACHINE_RESET( toypop )
154{
155   /* we must do this on a timer in order to have it take effect */
156   /* otherwise, the reset process will override our changes */
157   machine.scheduler().synchronize(FUNC(disable_interrupts));
158}
159
160171static INTERRUPT_GEN( toypop_m68000_interrupt )
161172{
162173   toypop_state *state = device->machine().driver_data<toypop_state>();
r13476r13477
548559   /* basic machine hardware */
549560   MCFG_CPU_ADD("maincpu", M6809, 1536000)   /* 1.536 MHz (measured on Libble Rabble board) */
550561   MCFG_CPU_PROGRAM_MAP(liblrabl_map)
551   MCFG_CPU_VBLANK_INT("screen", toypop_main_interrupt)
562   MCFG_CPU_VBLANK_INT("screen", toypop_main_vblank_irq)
552563
553564   MCFG_CPU_ADD("audiocpu", M6809, 1536000)
554565   MCFG_CPU_PROGRAM_MAP(sound_map)
555   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
566   MCFG_CPU_VBLANK_INT("screen", toypop_sound_timer_irq)
556567
557568   MCFG_CPU_ADD("sub", M68000, 6144000)   /* 6.144 MHz (measured on Libble Rabble board) */
558569   MCFG_CPU_PROGRAM_MAP(m68k_map)
src/mame/drivers/rltennis.c
r13476r13477
6363#include "cpu/m68000/m68000.h"
6464#include "machine/nvram.h"
6565#include "sound/dac.h"
66#include "video/ramdac.h"
6667
6768#define   RLT_REFRESH_RATE   60
6869#define RLT_TIMER_FREQ     (RLT_REFRESH_RATE*256)
r13476r13477
9293   AM_RANGE(0x100000, 0x10ffff) AM_RAM AM_SHARE("nvram")
9394   AM_RANGE(0x200000, 0x20ffff) AM_RAM
9495   AM_RANGE(0x700000, 0x70000f) AM_WRITE(rlt_blitter_w)
95   AM_RANGE(0x720000, 0x720001) AM_WRITE(rlt_ramdac_address_wm_w)
96   AM_RANGE(0x720002, 0x720003) AM_READWRITE(rlt_ramdac_data_r, rlt_ramdac_data_w)
97   AM_RANGE(0x720006, 0x720007) AM_WRITE(rlt_ramdac_address_rm_w)
96   AM_RANGE(0x720000, 0x720001) AM_DEVWRITE8_MODERN("ramdac",ramdac_device,index_w,0x00ff)
97   AM_RANGE(0x720002, 0x720003) AM_DEVREADWRITE8_MODERN("ramdac",ramdac_device,pal_r,pal_w,0x00ff)
98   AM_RANGE(0x720006, 0x720007) AM_DEVWRITE8_MODERN("ramdac",ramdac_device,index_r_w,0x00ff)
9899   AM_RANGE(0x740000, 0x740001) AM_WRITE(rlt_snd1_w)
99100   AM_RANGE(0x760000, 0x760001) AM_WRITE(rlt_snd2_w)
100101   AM_RANGE(0x780000, 0x780001) AM_WRITENOP   /* sound control, unknown, usually = 0x0044 */
r13476r13477
162163   rltennis_state *state = machine.driver_data<rltennis_state>();
163164   state->m_maincpu = machine.device( "maincpu");
164165   state->m_screen = machine.device(  "screen");
165   state->m_palette = auto_alloc_array(machine, UINT8, 256*3 );
166166   state->m_dac_1 = machine.device("dac1");
167167   state->m_dac_2 = machine.device("dac2");
168168   state->m_samples_1 = machine.region("samples1")->base();
r13476r13477
177177   state->m_timer->adjust(attotime::from_hz(RLT_TIMER_FREQ));
178178}
179179
180static ADDRESS_MAP_START( ramdac_map, AS_0, 8 )
181   AM_RANGE(0x000, 0x3ff) AM_DEVREADWRITE_MODERN("ramdac",ramdac_device,ramdac_pal_r,ramdac_rgb888_w)
182ADDRESS_MAP_END
183
184static RAMDAC_INTERFACE( ramdac_intf )
185{
186   1
187};
188
180189static MACHINE_CONFIG_START( rltennis, rltennis_state )
181190
182191   MCFG_CPU_ADD("maincpu", M68000, RLT_XTAL/2) /* 68000P8  ??? */
r13476r13477
197206   MCFG_NVRAM_ADD_0FILL("nvram")
198207
199208   MCFG_VIDEO_START( rltennis )
209   MCFG_RAMDAC_ADD("ramdac", ramdac_intf, ramdac_map)
200210
201211   MCFG_SPEAKER_STANDARD_MONO("mono")
202212
src/mame/drivers/skykid.c
r13476r13477
7676
7777static WRITE8_HANDLER( skykid_irq_1_ctrl_w )
7878{
79   skykid_state *state = space->machine().driver_data<skykid_state>();
7980   int bit = !BIT(offset,11);
80   cpu_interrupt_enable(space->machine().device("maincpu"), bit);
81   state->m_main_irq_mask = bit;
8182   if (!bit)
8283      cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
8384}
8485
8586static WRITE8_HANDLER( skykid_irq_2_ctrl_w )
8687{
88   skykid_state *state = space->machine().driver_data<skykid_state>();
8789   int bit = !BIT(offset,13);
88   cpu_interrupt_enable(space->machine().device("mcu"), bit);
90   state->m_mcu_irq_mask = bit;
8991   if (!bit)
9092      cputag_set_input_line(space->machine(), "mcu", 0, CLEAR_LINE);
9193}
r13476r13477
425427   0               /* stereo */
426428};
427429
430static INTERRUPT_GEN( main_vblank_irq )
431{
432   skykid_state *state = device->machine().driver_data<skykid_state>();
428433
434   if(state->m_main_irq_mask)
435      device_set_input_line(device, 0, ASSERT_LINE);
436}
429437
438
439static INTERRUPT_GEN( mcu_vblank_irq )
440{
441   skykid_state *state = device->machine().driver_data<skykid_state>();
442
443   if(state->m_mcu_irq_mask)
444      device_set_input_line(device, 0, ASSERT_LINE);
445}
446
447
430448static MACHINE_CONFIG_START( skykid, skykid_state )
431449
432450   /* basic machine hardware */
433451   MCFG_CPU_ADD("maincpu", M6809,49152000/32)
434452   MCFG_CPU_PROGRAM_MAP(skykid_map)
435   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
453   MCFG_CPU_VBLANK_INT("screen", main_vblank_irq)
436454
437455   MCFG_CPU_ADD("mcu", HD63701,49152000/8)   /* or compatible 6808 with extra instructions */
438456   MCFG_CPU_PROGRAM_MAP(mcu_map)
439457   MCFG_CPU_IO_MAP(mcu_port_map)
440   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
458   MCFG_CPU_VBLANK_INT("screen", mcu_vblank_irq)
441459
442460   MCFG_QUANTUM_TIME(attotime::from_hz(6000))   /* we need heavy synch */
443461
src/mame/drivers/brkthru.c
r13476r13477
6868static WRITE8_HANDLER( brkthru_1803_w )
6969{
7070   brkthru_state *state = space->machine().driver_data<brkthru_state>();
71
7172   /* bit 0 = NMI enable */
72   cpu_interrupt_enable(state->m_maincpu, ~data & 1);
73   state->m_nmi_mask = ~data & 1;
7374
7475   /* bit 1 = ? maybe IRQ acknowledge */
7576}
77
7678static WRITE8_HANDLER( darwin_0803_w )
7779{
7880   brkthru_state *state = space->machine().driver_data<brkthru_state>();
7981   /* bit 0 = NMI enable */
80   /*cpu_interrupt_enable(state->m_audiocpu, ~data & 1);*/
82   state->m_nmi_mask = data & 1;
8183   logerror("0803 %02X\n",data);
82   cpu_interrupt_enable(state->m_maincpu, data & 1);
84
8385   /* bit 1 = ? maybe IRQ acknowledge */
8486}
8587
r13476r13477
384386   state->m_flipscreen = 0;
385387}
386388
389static INTERRUPT_GEN( vblank_irq )
390{
391   brkthru_state *state = device->machine().driver_data<brkthru_state>();
392
393   if(state->m_nmi_mask)
394      device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
395}
396
387397static MACHINE_CONFIG_START( brkthru, brkthru_state )
388398
389399   /* basic machine hardware */
390400   MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/8)        /* 1.5 MHz ? */
391401   MCFG_CPU_PROGRAM_MAP(brkthru_map)
392   MCFG_CPU_VBLANK_INT("screen", nmi_line_pulse)
402   MCFG_CPU_VBLANK_INT("screen", vblank_irq)
393403
394404   MCFG_CPU_ADD("audiocpu", M6809, MASTER_CLOCK/8)      /* 1.5 MHz ? */
395405   MCFG_CPU_PROGRAM_MAP(sound_map)
r13476r13477
430440   /* basic machine hardware */
431441   MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/8)        /* 1.5 MHz ? */
432442   MCFG_CPU_PROGRAM_MAP(darwin_map)
433   MCFG_CPU_VBLANK_INT("screen", nmi_line_pulse)
443   MCFG_CPU_VBLANK_INT("screen", vblank_irq)
434444
435445   MCFG_CPU_ADD("audiocpu", M6809, MASTER_CLOCK/8)      /* 1.5 MHz ? */
436446   MCFG_CPU_PROGRAM_MAP(sound_map)
src/mame/drivers/astrocorp.c
r13476r13477
3030*************************************************************************************************************/
3131
3232#include "emu.h"
33#include "deprecat.h"
3433#include "cpu/m68000/m68000.h"
3534#include "machine/eeprom.h"
3635#include "machine/ticket.h"
r13476r13477
499498MACHINE_CONFIG_END
500499
501500
502static INTERRUPT_GEN( skilldrp_irq )
501static TIMER_DEVICE_CALLBACK( skilldrp_scanline )
503502{
504   switch (cpu_getiloops(device))
505   {
506      case 0:   device_set_input_line(device, 4, HOLD_LINE);   break;   // sprites, sound, i/o
507      case 1:   device_set_input_line(device, 2, HOLD_LINE);   break;   // palette
508   }
503   int scanline = param;
504
505   if(scanline == 240) // vblank-out irq. controls sprites, sound, i/o
506      cputag_set_input_line(timer.machine(), "maincpu", 4, HOLD_LINE);
507
508   if(scanline == 0) // vblank-in? controls palette
509      cputag_set_input_line(timer.machine(), "maincpu", 2, HOLD_LINE);
509510}
510511
511512static MACHINE_CONFIG_START( skilldrp, astrocorp_state )
r13476r13477
513514   /* basic machine hardware */
514515   MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz / 2)   // JX-1689F1028N GRX586.V5
515516   MCFG_CPU_PROGRAM_MAP(skilldrp_map)
516   MCFG_CPU_VBLANK_INT_HACK(skilldrp_irq, 2)
517   MCFG_TIMER_ADD_SCANLINE("scantimer", skilldrp_scanline, "screen", 0, 1)
517518
518519   MCFG_NVRAM_ADD_0FILL("nvram")
519520   MCFG_EEPROM_93C46_ADD("eeprom")
src/mame/drivers/sfbonus.c
r13476r13477
270270#include "emu.h"
271271#include "cpu/z80/z80.h"
272272#include "sound/okim6295.h"
273#include "video/ramdac.h"
273274
274275#include "pirpok2.lh"
275276
r13476r13477
300301   UINT8* m_3000_regs;
301302   UINT8* m_2801_regs;
302303   UINT8* m_2c01_regs;
303   struct { int r,g,b,offs,offs_internal; } m_pal;
304304};
305305
306306
r13476r13477
10581058}
10591059
10601060
1061static WRITE8_HANDLER( paletteram_io_w )
1062{
1063   sfbonus_state *state = space->machine().driver_data<sfbonus_state>();
1064   switch(offset)
1065   {
1066      case 0:
1067         state->m_pal.offs = data;
1068         break;
1069      case 2:
1070         state->m_pal.offs_internal = 0;
1071         break;
1072      case 1:
1073         switch(state->m_pal.offs_internal)
1074         {
1075            case 0:
1076               state->m_pal.r = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
1077               state->m_pal.offs_internal++;
1078               break;
1079            case 1:
1080               state->m_pal.g = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
1081               state->m_pal.offs_internal++;
1082               break;
1083            case 2:
1084               state->m_pal.b = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
1085               palette_set_color(space->machine(), state->m_pal.offs, MAKE_RGB(state->m_pal.r, state->m_pal.g, state->m_pal.b));
1086               state->m_pal.offs_internal = 0;
1087               state->m_pal.offs++;
1088               break;
1089         }
10901061
1091         break;
1092   }
1093}
1094
1095
1096
10971062static ADDRESS_MAP_START( sfbonus_map, AS_PROGRAM, 8 )
10981063   AM_RANGE(0x0000, 0xefff) AM_ROMBANK("bank1") AM_WRITE(sfbonus_videoram_w)
10991064   AM_RANGE(0xf000, 0xffff) AM_RAM AM_BASE_MEMBER(sfbonus_state, m_nvram) AM_SIZE_MEMBER(sfbonus_state, m_nvram_size)
r13476r13477
11821147
11831148   AM_RANGE(0x0800, 0x0800) AM_DEVREADWRITE_MODERN("oki", okim6295_device, read, write)
11841149
1185   AM_RANGE(0x0c00, 0x0c03) AM_WRITE( paletteram_io_w )
1150   AM_RANGE(0x0c00, 0x0c00) AM_DEVWRITE_MODERN("ramdac", ramdac_device, index_w)
1151   AM_RANGE(0x0c01, 0x0c01) AM_DEVWRITE_MODERN("ramdac", ramdac_device, pal_w)
1152   AM_RANGE(0x0c02, 0x0c02) AM_DEVWRITE_MODERN("ramdac", ramdac_device, mask_w)
11861153
11871154   AM_RANGE(0x1800, 0x1807) AM_WRITE(sfbonus_1800_w) AM_BASE_MEMBER(sfbonus_state, m_1800_regs) // lamps and coin counters
11881155
r13476r13477
12671234   }
12681235}
12691236
1237static ADDRESS_MAP_START( ramdac_map, AS_0, 8 )
1238   AM_RANGE(0x000, 0x3ff) AM_DEVREADWRITE_MODERN("ramdac",ramdac_device,ramdac_pal_r,ramdac_rgb666_w)
1239ADDRESS_MAP_END
12701240
1241static RAMDAC_INTERFACE( ramdac_intf )
1242{
1243   0
1244};
1245
1246
12711247static MACHINE_CONFIG_START( sfbonus, sfbonus_state )
12721248   MCFG_CPU_ADD("maincpu", Z80, 6000000) // custom packaged z80 CPU ?? Mhz
12731249   MCFG_CPU_PROGRAM_MAP(sfbonus_map)
r13476r13477
12791255
12801256   MCFG_NVRAM_HANDLER(sfbonus)
12811257
1282
12831258   MCFG_GFXDECODE(sfbonus)
12841259
12851260   MCFG_SCREEN_ADD("screen", RASTER)
r13476r13477
12921267
12931268   MCFG_PALETTE_LENGTH(0x100*2) // *2 for priority workaraound / custom drawing
12941269
1270   MCFG_RAMDAC_ADD("ramdac", ramdac_intf, ramdac_map)
1271
12951272   MCFG_VIDEO_START(sfbonus)
12961273
12971274   /* Parrot 3 seems fine at 1 Mhz, but Double Challenge isn't? */
src/mame/drivers/artmagic.c
r13476r13477
10361036    2x 27c1001 eproms
10371037    2x mk48t08b-15 timekeeper RAM
10381038
1039- common adp i/o board (see adp.c ) with MC68681 an YM2149F
1039- common adp i/o board (see adp.c ) with MC68681 and YM2149F
10401040
10411041- lamp board with triacs
10421042
src/mame/drivers/dynax.c
r13476r13477
766766
767767static WRITE8_HANDLER( yarunara_rombank_w )
768768{
769   dynax_state *state = space->machine().driver_data<dynax_state>();
770   memory_set_bank(space->machine(), "bank1", data);
769       dynax_state *state = space->machine().driver_data<dynax_state>();
770       int bank_n = (space->machine().region("maincpu")->bytes() - 0x10000) / 0x8000;
771771
772   state->m_hnoridur_bank = data;
772       //logerror("%04x: rom bank = %02x\n", cpu_get_pc(&space->device()), data);
773       if (data < bank_n)
774               memory_set_bank(space->machine(), "bank1", data);
775       else
776               logerror("rom_bank = %02x (larger than the maximum bank %02x)\n",data, bank_n);
777       state->m_hnoridur_bank = data;
773778}
774779
775780static WRITE8_HANDLER( yarunara_flipscreen_w )
src/mame/drivers/calchase.c
r13476r13477
9696#include "machine/8042kbdc.h"
9797#include "machine/pckeybrd.h"
9898#include "machine/idectrl.h"
99#include "video/pc_vga.h"
99100
100101
101102class calchase_state : public driver_device
r13476r13477
105106      : driver_device(mconfig, type, tag) { }
106107
107108   UINT32 *m_bios_ram;
108   UINT32 *m_vga_vram;
109109   int m_dma_channel;
110110   UINT8 m_dma_offset[2][4];
111111   UINT8 m_at_pages[0x10];
r13476r13477
122122
123123static void ide_interrupt(device_t *device, int state);
124124
125
126static VIDEO_START(calchase)
127{
128}
129
130static SCREEN_UPDATE(calchase)
131{
132   calchase_state *state = screen->machine().driver_data<calchase_state>();
133   int x,y,count,i;
134
135   bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
136
137   count = (0);
138
139   for(y=0;y<256;y++)
140   {
141      for(x=0;x<320;x+=32)
142      {
143         for (i=0;i<32;i++)
144         {
145            UINT32 color;
146
147            color = (state->m_vga_vram[count])>>(32-i) & 0x1;
148
149            if((x+i)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
150               *BITMAP_ADDR32(bitmap, y, x+(32-i)) = screen->machine().pens[color];
151
152         }
153
154         count++;
155      }
156   }
157
158   return 0;
159}
160
161125static READ8_DEVICE_HANDLER(at_dma8237_2_r)
162126{
163127   return i8237_r(device, offset / 2);
r13476r13477
474438
475439static ADDRESS_MAP_START( calchase_map, AS_PROGRAM, 32 )
476440   AM_RANGE(0x00000000, 0x0009ffff) AM_RAM
477   AM_RANGE(0x000a0000, 0x000bffff) AM_RAM AM_BASE_MEMBER(calchase_state, m_vga_vram)
441   AM_RANGE(0x000a0000, 0x000bffff) AM_RAM // VGA vram
478442   AM_RANGE(0x000c0000, 0x000c7fff) AM_RAM AM_REGION("video_bios", 0)
479443   AM_RANGE(0x000e0000, 0x000effff) AM_RAM
480444   AM_RANGE(0x000f0000, 0x000fffff) AM_ROMBANK("bank1")
r13476r13477
500464   AM_RANGE(0x0080, 0x009f) AM_READWRITE(at_page32_r,            at_page32_w)
501465   AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8("pic8259_2", pic8259_r, pic8259_w, 0xffffffff)
502466   AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE("dma8237_2", at32_dma8237_2_r, at32_dma8237_2_w)
503   AM_RANGE(0x00e8, 0x00eb) AM_NOP
504467   AM_RANGE(0x01f0, 0x01f7) AM_DEVREADWRITE("ide", ide_r, ide_w)
505   AM_RANGE(0x0300, 0x03af) AM_NOP
506   AM_RANGE(0x03b0, 0x03df) AM_NOP
507468   AM_RANGE(0x0278, 0x027b) AM_WRITENOP//AM_WRITE(pnp_config_w)
508469   AM_RANGE(0x03f0, 0x03ff) AM_DEVREADWRITE("ide", fdc_r, fdc_w)
509470   AM_RANGE(0x0a78, 0x0a7b) AM_WRITENOP//AM_WRITE(pnp_data_w)
510471   AM_RANGE(0x0cf8, 0x0cff) AM_DEVREADWRITE("pcibus", pci_32le_r,   pci_32le_w)
511   AM_RANGE(0x43c0, 0x43cf) AM_RAM AM_SHARE("share1")
512   AM_RANGE(0x83c0, 0x83cf) AM_RAM AM_SHARE("share1")
472//  AM_RANGE(0x43c0, 0x43cf) AM_RAM AM_SHARE("share1")
473//  AM_RANGE(0x83c0, 0x83cf) AM_RAM AM_SHARE("share1")
513474ADDRESS_MAP_END
514475
515476
r13476r13477
703664   MCFG_PALETTE_LENGTH(0x200)
704665   MCFG_GFXDECODE( CGA )
705666
706   MCFG_SCREEN_ADD("screen", RASTER)
707   MCFG_SCREEN_REFRESH_RATE(60)
708   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
709   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
710   MCFG_SCREEN_SIZE(64*8, 32*8)
711   MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1)
712   MCFG_SCREEN_UPDATE(calchase)
667   MCFG_FRAGMENT_ADD( pcvideo_vga )
713668
714   MCFG_VIDEO_START(calchase)
669   MCFG_SCREEN_MODIFY("screen")
670   MCFG_SCREEN_REFRESH_RATE(60)
671   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
715672MACHINE_CONFIG_END
716673
674static const struct pc_vga_interface vga_interface =
675{
676   NULL,
677   NULL,
678   NULL,
679   AS_IO,
680   0x0000
681};
682
717683static DRIVER_INIT( calchase )
718684{
719685   calchase_state *state = machine.driver_data<calchase_state>();
r13476r13477
724690   intel82439tx_init(machine);
725691
726692   kbdc8042_init(machine, &at8042);
693   pc_vga_init(machine, &vga_interface, NULL);
727694}
728695
729696
src/mame/drivers/trackfld.c
r13476r13477
191191#include "includes/trackfld.h"
192192#include "includes/konamipt.h"
193193#include "machine/nvram.h"
194#include "includes/yiear.h"
194195
195196#define MASTER_CLOCK          XTAL_18_432MHz
196197#define SOUND_CLOCK           XTAL_14_31818MHz
r13476r13477
251252   AM_RANGE(0x6000, 0xffff) AM_ROM
252253ADDRESS_MAP_END
253254
255static WRITE8_HANDLER( yieartf_nmi_mask_w )
256{
257   trackfld_state *state = space->machine().driver_data<trackfld_state>();
254258
259   state->m_yieartf_nmi_mask = data & 1;
260}
261
262
255263static ADDRESS_MAP_START( yieartf_map, AS_PROGRAM, 8 )
264   AM_RANGE(0x0000, 0x0000) AM_DEVREAD("vlm", yiear_speech_r) AM_WRITE(konami_SN76496_latch_w)
265   AM_RANGE(0x0001, 0x0001) AM_DEVWRITE("snsnd", konami_SN76496_w)
266   AM_RANGE(0x0002, 0x0002) AM_DEVWRITE("vlm", yiear_VLM5030_control_w)
267   AM_RANGE(0x0003, 0x0003) AM_DEVWRITE("vlm", vlm5030_data_w)
256268   AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x007f) AM_WRITE(watchdog_reset_w)      /* AFE */
257269   AM_RANGE(0x1080, 0x1080) AM_MIRROR(0x0078) AM_WRITE(trackfld_flipscreen_w)   /* FLIP */
258270   AM_RANGE(0x1081, 0x1081) AM_MIRROR(0x0078) AM_WRITE(konami_sh_irqtrigger_w)   /* 26 */ /* cause interrupt on audio CPU */
259   AM_RANGE(0x1082, 0x1082) AM_MIRROR(0x0078) AM_WRITENOP                  /* 25 */
271   AM_RANGE(0x1082, 0x1082) AM_MIRROR(0x0078) AM_WRITE(yieartf_nmi_mask_w)      /* 25 */
260272   AM_RANGE(0x1083, 0x1084) AM_MIRROR(0x0078) AM_WRITE(coin_w)               /* 24, 23 */
261273   AM_RANGE(0x1085, 0x1085) AM_MIRROR(0x0078) AM_WRITENOP                  /* CN3.2 */
262274   AM_RANGE(0x1086, 0x1086) AM_MIRROR(0x0078) AM_WRITENOP                  /* CN3.4 */
r13476r13477
945957MACHINE_CONFIG_END
946958
947959
960static INTERRUPT_GEN( yieartf_timer_irq )
961{
962   trackfld_state *state = device->machine().driver_data<trackfld_state>();
963
964   if (state->m_yieartf_nmi_mask)
965      device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
966}
967
948968static MACHINE_CONFIG_START( yieartf, trackfld_state )
949969
950970   /* basic machine hardware */
951971   MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/6/2)   /* a guess for now */
952972   MCFG_CPU_PROGRAM_MAP(yieartf_map)
953973   MCFG_CPU_VBLANK_INT("screen", vblank_irq)
974   MCFG_CPU_PERIODIC_INT(yieartf_timer_irq,480)
954975
955976//  z80 isn't used
956977//  MCFG_CPU_ADD("audiocpu", Z80, SOUND_CLOCK/4)
r13476r13477
9831004   MCFG_SOUND_ADD("dac", DAC, 0)
9841005   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
9851006
986   MCFG_SOUND_ADD("snsnd", SN76496, SOUND_CLOCK/8)
1007   MCFG_SOUND_ADD("snsnd", SN76496, MASTER_CLOCK/6/2)
9871008   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
9881009
9891010   MCFG_SOUND_ADD("vlm", VLM5030, VLM_CLOCK)
r13476r13477
15031524GAME( 1983, hyprolym,  trackfld, trackfld, trackfld, trackfld, ROT0,  "Konami", "Hyper Olympic", GAME_SUPPORTS_SAVE )
15041525GAME( 1983, hyprolymb, trackfld, hyprolyb, trackfld, trackfld, ROT0,  "bootleg", "Hyper Olympic (bootleg)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
15051526GAME( 1996, atlantol,  trackfld, atlantol, atlantol, atlantol, ROT0,  "bootleg", "Atlant Olimpic", GAME_SUPPORTS_SAVE )
1527GAME( 1982, trackfldnz,trackfld, trackfld, trackfld, trackfld, ROT0,  "bootleg? (Goldberg Enterprizes Inc.)", "Track & Field (NZ bootleg?)", GAME_NOT_WORKING)
15061528GAME( 1988, mastkin,   0,        mastkin,  mastkin,  mastkin,  ROT0,  "Du Tech", "The Masters of Kin", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
1507GAME( 1982, trackfldnz,trackfld, trackfld, trackfld, trackfld, ROT0,  "bootleg? (Goldberg Enterprizes Inc.)", "Track & Field (NZ bootleg?)", GAME_NOT_WORKING)
15081529GAME( 1985, wizzquiz,  0,        wizzquiz, wizzquiz, wizzquiz, ROT0,  "Zilec-Zenitone (Konami license)", "Wizz Quiz (Konami version)", GAME_SUPPORTS_SAVE )
15091530GAME( 1985, wizzquiza, wizzquiz, wizzquiz, wizzquiz, wizzquiz, ROT0,  "Zilec-Zenitone", "Wizz Quiz (version 4)", GAME_SUPPORTS_SAVE )
15101531GAME( 1987, reaktor,   0,        reaktor,  reaktor,  0,        ROT90, "Zilec", "Reaktor (Track & Field conversion)", GAME_SUPPORTS_SAVE )
1511GAME( 1985, yieartf,   yiear,    yieartf,  yieartf, 0,        ROT0,  "Konami", "Yie Ar Kung-Fu (GX361 conversion)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) // the conversion looks of bootleg quality, but the code is clearly a very different revision to either original hardware set...
1532GAME( 1985, yieartf,   yiear,    yieartf,  yieartf, 0,        ROT0,  "Konami", "Yie Ar Kung-Fu (GX361 conversion)", GAME_SUPPORTS_SAVE ) // the conversion looks of bootleg quality, but the code is clearly a very different revision to either original hardware set...
src/mame/drivers/pcat_dyn.c
r13476r13477
1212
1313TODO:
1414- Returns CMOS checksum error, can't enter into BIOS setup screens to set that up ... it's certainly a MESS-to-MAME
15  conversion bug or a keyboard device issue, since it works fine in MESS.
15  conversion bug or a keyboard device issue, since it works fine in MESS. (Update: it's the keyboard device)
1616
17keyboard trick;
18- Set 0x41c to zero then set the scancode accordingly:
19- bp f1699 ah = 0x3b
20- bp f53b9 al = scancode
21- bp f08d9 ah = scancode
22
230x48 is up 0x4d is down 0x50 is right 0x4b is left
240x3c/0x3d is pageup/pagedown
250x01 is esc
260x0d is enter
27
1728********************************************************************************************************************/
1829
1930#include "emu.h"
src/mame/drivers/20pacgal.c
r13476r13477
7777static WRITE8_HANDLER( irqack_w )
7878{
7979   _20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
80   int bit = data & 1;
8180
82   cpu_interrupt_enable(state->m_maincpu, bit);
81   state->m_irq_mask = data & 1;
8382
84   if (!bit)
83   if (!state->m_irq_mask)
8584      device_set_input_line(state->m_maincpu, 0, CLEAR_LINE);
8685}
8786
r13476r13477
343342   state->m_game_selected = 0;
344343}
345344
345static INTERRUPT_GEN( vblank_irq )
346{
347   _20pacgal_state *state = device->machine().driver_data<_20pacgal_state>();
348
349   if(state->m_irq_mask)
350      device_set_input_line(device, 0, HOLD_LINE); // TODO: assert breaks the inputs in 25pacman test mode
351}
352
346353static MACHINE_CONFIG_START( 20pacgal, _20pacgal_state )
347354
348355   /* basic machine hardware */
349356   MCFG_CPU_ADD("maincpu", Z180, MAIN_CPU_CLOCK)
350357   MCFG_CPU_PROGRAM_MAP(20pacgal_map)
351358   MCFG_CPU_IO_MAP(20pacgal_io_map)
352   MCFG_CPU_VBLANK_INT("screen", irq0_line_hold) // assert breaks the inputs in 25pacman test mode
359   MCFG_CPU_VBLANK_INT("screen", vblank_irq)
353360
354361   MCFG_MACHINE_START(20pacgal)
355362   MCFG_MACHINE_RESET(20pacgal)
src/mame/drivers/seicross.c
r13476r13477
9494
9595   //logerror("PC %04x: 8910 port B = %02x\n", cpu_get_pc(&space->device()), data);
9696   /* bit 0 is IRQ enable */
97   cpu_interrupt_enable(device->machine().device("maincpu"), data & 1);
97   state->m_irq_mask = data & 1;
9898
9999   /* bit 1 flips screen */
100100
r13476r13477
390390   DEVCB_HANDLER(friskyt_portB_w)
391391};
392392
393static INTERRUPT_GEN( vblank_irq )
394{
395   seicross_state *state = device->machine().driver_data<seicross_state>();
393396
397   if(state->m_irq_mask)
398      device_set_input_line(device, 0, HOLD_LINE);
399
400}
401
402
394403static MACHINE_CONFIG_START( nvram, seicross_state )
395404
396405   /* basic machine hardware */
397406   MCFG_CPU_ADD("maincpu", Z80, 3072000)   /* 3.072 MHz? */
398407   MCFG_CPU_PROGRAM_MAP(main_map)
399408   MCFG_CPU_IO_MAP(main_portmap)
400   MCFG_CPU_VBLANK_INT("screen", irq0_line_hold)
409   MCFG_CPU_VBLANK_INT("screen", vblank_irq)
401410
402411   MCFG_CPU_ADD("mcu", NSC8105, 6000000)   /* ??? */
403412   MCFG_CPU_PROGRAM_MAP(mcu_nvram_map)
src/mame/drivers/polepos.c
r13476r13477
294294   switch (offset)
295295   {
296296      case 0x00:   /* IRQON */
297         cpu_interrupt_enable(space->machine().device("maincpu"), bit);
297         state->m_main_irq_mask = bit;
298298         if (!bit)
299299            cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
300300         break;
301301
302302      case 0x01:   /* IOSEL */
303//polepos_mcu_enable_w(offset,data);
303//          polepos_mcu_enable_w(offset,data);
304304         break;
305305
306306      case 0x02:   /* CLSON */
r13476r13477
336336
337337static WRITE16_HANDLER( polepos_z8002_nvi_enable_w )
338338{
339   polepos_state *state = space->machine().driver_data<polepos_state>();
339340   data &= 1;
340341
341   cpu_interrupt_enable(&space->device(),data);
342   state->m_sub_irq_mask = data;
342343   if (!data)
343344      device_set_input_line(&space->device(), 0, CLEAR_LINE);
344345}
r13476r13477
454455
455456static TIMER_DEVICE_CALLBACK( polepos_scanline )
456457{
458   polepos_state *state = timer.machine().driver_data<polepos_state>();
457459   int scanline = param;
458   running_machine &machine = timer.machine();
459460
460   // irq0_line_assert() checks if irq is enabled - IMPORTANT!
461   // so don't replace with cputag_set_input_line()
461   if (((scanline == 64) || (scanline == 192)) && state->m_main_irq_mask)   // 64V
462      cputag_set_input_line(timer.machine(), "maincpu", 0, ASSERT_LINE);
462463
463   if ((scanline == 64) || (scanline == 192))   // 64V
464      irq0_line_assert(machine.device("maincpu"));
465
466   if (scanline == 240)   // VBLANK
464   if (scanline == 240 && state->m_sub_irq_mask)   // VBLANK
467465   {
468      irq0_line_assert(machine.device("sub"));
469      irq0_line_assert(machine.device("sub2"));
466      cputag_set_input_line(timer.machine(), "sub", 0, ASSERT_LINE);
467      cputag_set_input_line(timer.machine(), "sub2", 0, ASSERT_LINE);
470468   }
471469}
472470
src/mame/drivers/qdrmfgp.c
r13476r13477
99Other(GQ460):Konami 053252,054156,056832,054539
1010Other(GE557):Konami 056832,058141,058143
1111
12TODO:
13- enabling irq acks breaks both games, why?
1214
1315--
1416driver by Eisuke Watanabe
r13476r13477
281283      case 1:
282284         /* trigger V-blank interrupt */
283285         if (state->m_control & 0x0004)
284            device_set_input_line(device, 3, ASSERT_LINE);
286            device_set_input_line(device, 3, HOLD_LINE);
285287         break;
286288   }
287289}
r13476r13477
304306{
305307   qdrmfgp_state *state = machine.driver_data<qdrmfgp_state>();
306308   if (state->m_control & 0x0004)
307      cputag_set_input_line(machine, "maincpu", 3, ASSERT_LINE);
309      cputag_set_input_line(machine, "maincpu", 3, HOLD_LINE);
308310}
309311
310312static INTERRUPT_GEN(qdrmfgp2_interrupt)
r13476r13477
312314   qdrmfgp_state *state = device->machine().driver_data<qdrmfgp_state>();
313315   /* trigger V-blank interrupt */
314316   if (state->m_control & 0x0008)
315      device_set_input_line(device, 4, ASSERT_LINE);
317      device_set_input_line(device, 4, HOLD_LINE);
316318}
317319
318320static void gp2_ide_interrupt(device_t *device, int state)
r13476r13477
614616
615617static WRITE_LINE_DEVICE_HANDLER( qdrmfgp_irq3_ack_w )
616618{
617   cputag_set_input_line(device->machine(), "maincpu", M68K_IRQ_3, CLEAR_LINE);
619//  cputag_set_input_line(device->machine(), "maincpu", M68K_IRQ_3, CLEAR_LINE);
618620}
619621
620622static WRITE_LINE_DEVICE_HANDLER( qdrmfgp_irq4_ack_w )
621623{
622   cputag_set_input_line(device->machine(), "maincpu", M68K_IRQ_4, CLEAR_LINE);
624//  cputag_set_input_line(device->machine(), "maincpu", M68K_IRQ_4, CLEAR_LINE);
623625}
624626
625627static const k053252_interface qdrmfgp_k053252_intf =
src/mame/drivers/cps1.c
r13476r13477
27452745INPUT_PORTS_END
27462746
27472747/* Needs further checking */
2748static INPUT_PORTS_START( pang3n )
2748static INPUT_PORTS_START( pang3b )
27492749   PORT_INCLUDE( pang3 )
27502750
27512751   PORT_MODIFY("DSWC")
r13476r13477
34113411
34123412/* B-Board 88621B-2 */
34133413/* This set comes from a USA board with the same pcb layout of the parent forgottn, but uses one more surface mounted ROM
3414   named LW-13 and located @ 10D instead of LW_25.10C, LW_26.10E, LW_27.11C, LW_28.11E EPROMs.
3415   Note that ROMs are labeled left to right, top to bottom, instead of top to bottom, left to right as usual. */
3414   named LW-13 and located @ 10D instead of LW_25.10C, LW_26.10E, LW_27.11C, LW_28.11E EPROMs. */
3415/* Note that ROMs are labeled left to right, top to bottom, instead of top to bottom, left to right as usual. */
34163416ROM_START( forgottnu )
34173417   ROM_REGION( CODE_SIZE, "maincpu", 0 )
34183418   ROM_LOAD16_BYTE( "lw11c.12f",      0x00000, 0x20000, CRC(e62742b6) SHA1(39dd3bdd405a8217d8816567d4f2014fc77f5ce8) )
r13476r13477
45474547ROM_END
45484548
45494549/* B-Board 89624B-3 */
4550/* Note that this set is equivalent to ffightu, but the 4Mbit MASK ROM FF-32M located @ 8H is replaced by 4 1Mbit EPROMs */
4550/* Note that this set is equivalent to ffightu, but the 4Mbit MASK ROM FF-32M located @ 8H is replaced by 4 1Mbit EPROMs. */
45514551ROM_START( ffightu1 )
45524552   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
45534553   ROM_LOAD16_BYTE( "ff_36.11f",  0x00000, 0x20000, CRC(f9a5ce83) SHA1(0756ae576a1f6d5b8b22f8630dca40ef38567ea6) )   // in "30" socket
r13476r13477
68766876ROM_END
68776877
68786878/* B-Board 89625B-1 */
6879/* Note that this set is equivalent to kodj, but each 4Mbit EPROM is replaced by 4 1Mbit EPROMs */
6879/* Note that this set is equivalent to kodj, but each 4Mbit EPROM is replaced by 4 1Mbit EPROMs. */
68806880ROM_START( kodja )
68816881   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
68826882   ROM_LOAD16_BYTE( "kdj_36a.12f", 0x00000, 0x20000, CRC(ebc788ad) SHA1(f4a297e409fcdbb2c15a13b39a16e4a83e7e060b) )   // == kdj_30a.11e
r13476r13477
73437343ROM_END
73447344
73457345/* B-Board 89625B-1 */
7346/* Note that this set is equivalent to knightsj, but each 4Mbit EPROM is replaced by 4 1Mbit EPROMs */
7346/* Note that this set is equivalent to knightsj, but each 4Mbit EPROM is replaced by 4 1Mbit EPROMs. */
73477347ROM_START( knightsja )
73487348   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
73497349   ROM_LOAD16_BYTE( "krj_36.12f", 0x00000, 0x20000, CRC(ad3d1a8e) SHA1(327f9e818f1500836fc549afeffbb2a3c5aafe8c) )   // == kr_23j.8f
r13476r13477
86548654   ROM_LOAD( "ioc1.ic1",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
86558655
86568656   ROM_REGION( 0x0200, "dboardplds", 0 )
8657   ROM_LOAD( "d7l1.7l",      0x0000, 0x0117, NO_DUMP )
8658   ROM_LOAD( "d8l1.8l",      0x0000, 0x0117, NO_DUMP )
8657   ROM_LOAD( "d7l1.7l",      0x0000, 0x0117, CRC(27b7410d) SHA1(06d0cba0226850f100ff1f539bd7d5db0f90c730) )
8658   ROM_LOAD( "d8l1.8l",      0x0000, 0x0117, CRC(539fc7da) SHA1(cad5c91629c6247e49ccbbcbfe6b08229eafae07) )
86598659   ROM_LOAD( "d9k1.9k",      0x0000, 0x0117, NO_DUMP )
8660   ROM_LOAD( "d10f1.10f",    0x0000, 0x0117, NO_DUMP )
8660   ROM_LOAD( "d10f1.10f",    0x0000, 0x0117, CRC(6619c494) SHA1(3aef656c07182a2186f810f30e0d854dd5bd8d18) )
86618661ROM_END
86628662
86638663/* FIXME B-Board uncertain but should be 91634B from the program ROM names */
r13476r13477
89398939   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
89408940
89418941   ROM_REGION( 0x0200, "bboardplds", 0 )
8942   ROM_LOAD( "cd63b.1a",     0x0000, 0x0117, NO_DUMP )
8942   ROM_LOAD( "cd63b.1a",     0x0000, 0x0117, CRC(ef72e902) SHA1(82fea3f63869c245d0dce2809085208fe719b57a) )
89438943   ROM_LOAD( "iob1.12d",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
89448944   ROM_LOAD( "bprg1.11d",    0x0000, 0x0117, CRC(31793da7) SHA1(400fa7ac517421c978c1ee7773c30b9ed0c5d3f3) )
89458945
r13476r13477
89478947   ROM_LOAD( "ioc1.ic1",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
89488948
89498949   ROM_REGION( 0x0200, "dboardplds", 0 )
8950   ROM_LOAD( "d7l1.7l",      0x0000, 0x0117, NO_DUMP )
8951   ROM_LOAD( "d8l1.8l",      0x0000, 0x0117, NO_DUMP )
8952   ROM_LOAD( "d9k2.9k",      0x0000, 0x0117, NO_DUMP )
8953   ROM_LOAD( "d10f1.10f",    0x0000, 0x0117, NO_DUMP )
8950   ROM_LOAD( "d7l1.7l",      0x0000, 0x0117, CRC(27b7410d) SHA1(06d0cba0226850f100ff1f539bd7d5db0f90c730) )
8951   ROM_LOAD( "d8l1.8l",      0x0000, 0x0117, CRC(539fc7da) SHA1(cad5c91629c6247e49ccbbcbfe6b08229eafae07) )
8952   ROM_LOAD( "d9k2.9k",      0x0000, 0x0117, CRC(cd85a156) SHA1(a88f8939c5d93e65d7bcc0eb3ee5b6f4f1114e3a) )
8953   ROM_LOAD( "d10f1.10f",    0x0000, 0x0117, CRC(6619c494) SHA1(3aef656c07182a2186f810f30e0d854dd5bd8d18) )
89548954ROM_END
89558955
89568956/* B-Board 91635B-2 */
r13476r13477
89878987   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
89888988
89898989   ROM_REGION( 0x0200, "bboardplds", 0 )
8990   ROM_LOAD( "cd63b.1a",     0x0000, 0x0117, NO_DUMP )
8990   ROM_LOAD( "cd63b.1a",     0x0000, 0x0117, CRC(ef72e902) SHA1(82fea3f63869c245d0dce2809085208fe719b57a) )
89918991   ROM_LOAD( "iob1.12d",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
89928992   ROM_LOAD( "bprg1.11d",    0x0000, 0x0117, CRC(31793da7) SHA1(400fa7ac517421c978c1ee7773c30b9ed0c5d3f3) )
89938993
r13476r13477
89958995   ROM_LOAD( "ioc1.ic1",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
89968996
89978997   ROM_REGION( 0x0200, "dboardplds", 0 )
8998   ROM_LOAD( "d7l1.7l",      0x0000, 0x0117, NO_DUMP )
8999   ROM_LOAD( "d8l1.8l",      0x0000, 0x0117, NO_DUMP )
9000   ROM_LOAD( "d9k2.9k",      0x0000, 0x0117, NO_DUMP )
9001   ROM_LOAD( "d10f1.10f",    0x0000, 0x0117, NO_DUMP )
8998   ROM_LOAD( "d7l1.7l",      0x0000, 0x0117, CRC(27b7410d) SHA1(06d0cba0226850f100ff1f539bd7d5db0f90c730) )
8999   ROM_LOAD( "d8l1.8l",      0x0000, 0x0117, CRC(539fc7da) SHA1(cad5c91629c6247e49ccbbcbfe6b08229eafae07) )
9000   ROM_LOAD( "d9k2.9k",      0x0000, 0x0117, CRC(cd85a156) SHA1(a88f8939c5d93e65d7bcc0eb3ee5b6f4f1114e3a) )
9001   ROM_LOAD( "d10f1.10f",    0x0000, 0x0117, CRC(6619c494) SHA1(3aef656c07182a2186f810f30e0d854dd5bd8d18) )
90029002ROM_END
90039003
90049004/* FIXME B-Board uncertain but should be 91634B from the program ROM names */
r13476r13477
90359035   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
90369036
90379037   ROM_REGION( 0x0200, "bboardplds", 0 )
9038   ROM_LOAD( "cd63b.1a",     0x0000, 0x0117, NO_DUMP )
9038   ROM_LOAD( "cd63b.1a",     0x0000, 0x0117, CRC(ef72e902) SHA1(82fea3f63869c245d0dce2809085208fe719b57a) )
90399039   ROM_LOAD( "iob1.12d",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
90409040   ROM_LOAD( "bprg1.11d",    0x0000, 0x0117, CRC(31793da7) SHA1(400fa7ac517421c978c1ee7773c30b9ed0c5d3f3) )
90419041
r13476r13477
92259225   ROM_LOAD( "ioc1.ic1",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
92269226
92279227   ROM_REGION( 0x0200, "dboardplds", 0 )
9228   ROM_LOAD( "d7l1.7l",      0x0000, 0x0117, NO_DUMP )
9229   ROM_LOAD( "d8l1.8l",      0x0000, 0x0117, NO_DUMP )
9230   ROM_LOAD( "d9k2.9k",      0x0000, 0x0117, NO_DUMP )
9231   ROM_LOAD( "d10f1.10f",    0x0000, 0x0117, NO_DUMP )
9228   ROM_LOAD( "d7l1.7l",      0x0000, 0x0117, CRC(27b7410d) SHA1(06d0cba0226850f100ff1f539bd7d5db0f90c730) )
9229   ROM_LOAD( "d8l1.8l",      0x0000, 0x0117, CRC(539fc7da) SHA1(cad5c91629c6247e49ccbbcbfe6b08229eafae07) )
9230   ROM_LOAD( "d9k2.9k",      0x0000, 0x0117, CRC(cd85a156) SHA1(a88f8939c5d93e65d7bcc0eb3ee5b6f4f1114e3a) )
9231   ROM_LOAD( "d10f1.10f",    0x0000, 0x0117, CRC(6619c494) SHA1(3aef656c07182a2186f810f30e0d854dd5bd8d18) )
92329232ROM_END
92339233
92349234/* B-Board 91635B-2 */
r13476r13477
92799279   ROM_LOAD( "ioc1.ic1",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
92809280
92819281   ROM_REGION( 0x0200, "dboardplds", 0 )
9282   ROM_LOAD( "d7l1.7l",      0x0000, 0x0117, NO_DUMP )
9283   ROM_LOAD( "d8l1.8l",      0x0000, 0x0117, NO_DUMP )
9284   ROM_LOAD( "d9k2.9k",      0x0000, 0x0117, NO_DUMP )
9285   ROM_LOAD( "d10f1.10f",    0x0000, 0x0117, NO_DUMP )
9282   ROM_LOAD( "d7l1.7l",      0x0000, 0x0117, CRC(27b7410d) SHA1(06d0cba0226850f100ff1f539bd7d5db0f90c730) )
9283   ROM_LOAD( "d8l1.8l",      0x0000, 0x0117, CRC(539fc7da) SHA1(cad5c91629c6247e49ccbbcbfe6b08229eafae07) )
9284   ROM_LOAD( "d9k2.9k",      0x0000, 0x0117, CRC(cd85a156) SHA1(a88f8939c5d93e65d7bcc0eb3ee5b6f4f1114e3a) )
9285   ROM_LOAD( "d10f1.10f",    0x0000, 0x0117, CRC(6619c494) SHA1(3aef656c07182a2186f810f30e0d854dd5bd8d18) )
92869286ROM_END
92879287
92889288/* FIXME B-Board uncertain but should be 91634B from the program ROM names */
r13476r13477
95429542   ROM_LOAD( "ioc1.ic1",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
95439543
95449544   ROM_REGION( 0x0200, "dboardplds", 0 )
9545   ROM_LOAD( "d7l1.7l",      0x0000, 0x0117, NO_DUMP )
9546   ROM_LOAD( "d8l1.8l",      0x0000, 0x0117, NO_DUMP )
9547   ROM_LOAD( "d9k2.9k",      0x0000, 0x0117, NO_DUMP )
9548   ROM_LOAD( "d10f1.10f",    0x0000, 0x0117, NO_DUMP )
9545   ROM_LOAD( "d7l1.7l",      0x0000, 0x0117, CRC(27b7410d) SHA1(06d0cba0226850f100ff1f539bd7d5db0f90c730) )
9546   ROM_LOAD( "d8l1.8l",      0x0000, 0x0117, CRC(539fc7da) SHA1(cad5c91629c6247e49ccbbcbfe6b08229eafae07) )
9547   ROM_LOAD( "d9k2.9k",      0x0000, 0x0117, CRC(cd85a156) SHA1(a88f8939c5d93e65d7bcc0eb3ee5b6f4f1114e3a) )
9548   ROM_LOAD( "d10f1.10f",    0x0000, 0x0117, CRC(6619c494) SHA1(3aef656c07182a2186f810f30e0d854dd5bd8d18) )
95499549ROM_END
95509550
95519551/* B-Board 91635B-2 */
r13476r13477
96059605   ROM_LOAD( "ioc1.ic1",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
96069606
96079607   ROM_REGION( 0x0200, "dboardplds", 0 )
9608   ROM_LOAD( "d7l1.7l",      0x0000, 0x0117, NO_DUMP )
9609   ROM_LOAD( "d8l1.8l",      0x0000, 0x0117, NO_DUMP )
9610   ROM_LOAD( "d9k2.9k",      0x0000, 0x0117, NO_DUMP )
9611   ROM_LOAD( "d10f1.10f",    0x0000, 0x0117, NO_DUMP )
9608   ROM_LOAD( "d7l1.7l",      0x0000, 0x0117, CRC(27b7410d) SHA1(06d0cba0226850f100ff1f539bd7d5db0f90c730) )
9609   ROM_LOAD( "d8l1.8l",      0x0000, 0x0117, CRC(539fc7da) SHA1(cad5c91629c6247e49ccbbcbfe6b08229eafae07) )
9610   ROM_LOAD( "d9k2.9k",      0x0000, 0x0117, CRC(cd85a156) SHA1(a88f8939c5d93e65d7bcc0eb3ee5b6f4f1114e3a) )
9611   ROM_LOAD( "d10f1.10f",    0x0000, 0x0117, CRC(6619c494) SHA1(3aef656c07182a2186f810f30e0d854dd5bd8d18) )
96129612ROM_END
96139613
96149614/* FIXME B-Board uncertain but should be 91634B from the program ROM names */
r13476r13477
98889888   ROM_CONTINUE(            0x000006, 0x100000 )
98899889
98909890   ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
9891   ROM_LOAD( "pa3_11.11f",  0x00000, 0x08000, CRC(90a08c46) SHA1(7544adab2d7e052e0d21c920bff7841d9d718345) )
9891   ROM_LOAD( "pa3_11.11f",  0x00000, 0x08000, CRC(cb1423a2) SHA1(3191bf5d340168647881738cb2aed09b1d86146e) )
9892   ROM_IGNORE( 0x18000 )
98929893
98939894   ROM_REGION( 0x40000, "oki", 0 )   /* Samples */
98949895   ROM_LOAD( "pa3_05.10d",  0x00000, 0x20000, CRC(73a10d5d) SHA1(999465e4fbc35a34746d2db61ad49f61403d5af7) )
r13476r13477
99029903   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
99039904
99049905   ROM_REGION( 0x0200, "bboardplds", 0 )
9905   ROM_LOAD( "cp1b1f.1f",    0x0000, 0x0117, NO_DUMP )
9906   ROM_LOAD( "cp1b8k.8k",    0x0000, 0x0117, NO_DUMP )
9906   ROM_LOAD( "cp1b1f.1f",    0x0000, 0x0117, CRC(3979b8e3) SHA1(07c9819d68b4d93bc37b96bd15d689ce54fe034e) )
9907   ROM_LOAD( "cp1b8k.8k",    0x0000, 0x0117, CRC(8a52ea7a) SHA1(47a59abc54a83292cfd6faa2d293c8f948c7ea03) )
99079908   ROM_LOAD( "cp1b9ka.9k",   0x0000, 0x0117, NO_DUMP )
99089909
99099910   ROM_REGION( 0x0200, "cboardplds", 0 )
r13476r13477
99119912   ROM_LOAD( "c632.ic1",     0x0000, 0x0117, CRC(0fbd9270) SHA1(d7e737b20c44d41e29ca94be56114b31934dde81) )
99129913ROM_END
99139914
9915/* B-Board 94916-10 */
99149916ROM_START( pang3r1 )
99159917   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
99169918   ROM_LOAD16_WORD_SWAP( "pa3e_17.11l", 0x00000, 0x80000, CRC(d7041d32) SHA1(b021f3defe7fc58030ba907125c713f987724187) )
r13476r13477
99239925   ROM_CONTINUE(            0x000006, 0x100000 )
99249926
99259927   ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
9926   ROM_LOAD( "pa3_11.bin",  0x00000, 0x08000, CRC(cb1423a2) SHA1(3191bf5d340168647881738cb2aed09b1d86146e) )
9928   ROM_LOAD( "pa3_11.11f",  0x00000, 0x08000, CRC(cb1423a2) SHA1(3191bf5d340168647881738cb2aed09b1d86146e) )
99279929   ROM_IGNORE( 0x18000 )
99289930
99299931   ROM_REGION( 0x40000, "oki", 0 )   /* Samples */
r13476r13477
99389940   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
99399941
99409942   ROM_REGION( 0x0200, "bboardplds", 0 )
9941   ROM_LOAD( "cp1b1f.1f",    0x0000, 0x0117, NO_DUMP )
9942   ROM_LOAD( "cp1b8k.8k",    0x0000, 0x0117, NO_DUMP )
9943   ROM_LOAD( "cp1b9ka.9k",   0x0000, 0x0117, NO_DUMP )
9943   ROM_LOAD( "cp1b1f.1f",    0x0000, 0x0117, CRC(3979b8e3) SHA1(07c9819d68b4d93bc37b96bd15d689ce54fe034e) )
9944   ROM_LOAD( "cp1b8k.8k",    0x0000, 0x0117, CRC(8a52ea7a) SHA1(47a59abc54a83292cfd6faa2d293c8f948c7ea03) )
9945   ROM_LOAD( "cp1b9k.9k",    0x0000, 0x0117, CRC(a754bdc3) SHA1(9267b24cbddee4858b219468cc92f9df8f5fd0ef) )
99449946
99459947   ROM_REGION( 0x0200, "cboardplds", 0 )
99469948   ROM_LOAD( "ioc1.ic7",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
r13476r13477
99489950ROM_END
99499951
99509952/* B-Board 94916-10 */
9951ROM_START( pang3n ) /* this set isn't encrypted, is it actually an original? */
9953ROM_START( pang3j )
99529954   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
9953   ROM_LOAD16_WORD_SWAP( "pa3w_17.11l", 0x00000, 0x80000, CRC(12138234) SHA1(956a2c847a3cfb94007d1a636167fd2bb9f826ec) )   // should be pa3e_17.11l
9954   ROM_LOAD16_WORD_SWAP( "pa3w_16.10l", 0x80000, 0x80000, CRC(d1ba585c) SHA1(c6d04441fe97abf0a72b23c917777a7b58e94a85) )   // should be pa3e_16.10l
9955   ROM_LOAD16_WORD_SWAP( "pa3j_17.11l", 0x00000, 0x80000, CRC(21f6e51f) SHA1(b447e05261f59b3b2e89bbc0f606d7136b29cb56) )
9956   ROM_LOAD16_WORD_SWAP( "pa3j_16.10l", 0x80000, 0x80000, CRC(ca1d7897) SHA1(46aa9232e81a838f3eff1e9b992492a264914fd5) )
99559957
99569958   ROM_REGION( 0x400000, "gfx", 0 )
99579959   ROMX_LOAD( "pa3-01m.2c", 0x000000, 0x100000, CRC(068a152c) SHA1(fa491874068924c39bcc7de93dfda3b27f5d9613) , ROM_GROUPWORD | ROM_SKIP(6) )
r13476r13477
99609962   ROM_CONTINUE(            0x000006, 0x100000 )
99619963
99629964   ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
9963   ROM_LOAD( "pa3_11.11f",  0x00000, 0x08000, CRC(90a08c46) SHA1(7544adab2d7e052e0d21c920bff7841d9d718345) )
9965   ROM_LOAD( "pa3_11.11f",  0x00000, 0x08000, CRC(cb1423a2) SHA1(3191bf5d340168647881738cb2aed09b1d86146e) )
9966   ROM_IGNORE( 0x18000 )
99649967
99659968   ROM_REGION( 0x40000, "oki", 0 )   /* Samples */
99669969   ROM_LOAD( "pa3_05.10d",  0x00000, 0x20000, CRC(73a10d5d) SHA1(999465e4fbc35a34746d2db61ad49f61403d5af7) )
r13476r13477
99749977   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
99759978
99769979   ROM_REGION( 0x0200, "bboardplds", 0 )
9977   ROM_LOAD( "cp1b1f.1f",    0x0000, 0x0117, NO_DUMP )
9978   ROM_LOAD( "cp1b8k.8k",    0x0000, 0x0117, NO_DUMP )
9979   ROM_LOAD( "cp1b9ka.9k",   0x0000, 0x0117, NO_DUMP )
9980   ROM_LOAD( "cp1b1f.1f",    0x0000, 0x0117, CRC(3979b8e3) SHA1(07c9819d68b4d93bc37b96bd15d689ce54fe034e) )
9981   ROM_LOAD( "cp1b8k.8k",    0x0000, 0x0117, CRC(8a52ea7a) SHA1(47a59abc54a83292cfd6faa2d293c8f948c7ea03) )
9982   ROM_LOAD( "cp1b9k.9k",    0x0000, 0x0117, CRC(a754bdc3) SHA1(9267b24cbddee4858b219468cc92f9df8f5fd0ef) )
99809983
99819984   ROM_REGION( 0x0200, "cboardplds", 0 )
99829985   ROM_LOAD( "ioc1.ic7",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
r13476r13477
99849987ROM_END
99859988
99869989/* B-Board 94916-10 */
9987ROM_START( pang3j )
9990/* This set comes from a not encrypted bootleg that uses a very well reproduced Mitchell 94916-10 B-Board surmounted by an
9991   original Capcom 92631C-6 C-Board. Mitchell mark has been erased, original 32 pin EPROM PA3_11.11F resized and replaced by
9992   one with 28 pin while the protection chip MACH215 mounted on the B-Board has been replaced by a 22 pin PAL. */
9993ROM_START( pang3b )
99889994   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
9989   ROM_LOAD16_WORD_SWAP( "pa3j_17.11l", 0x00000, 0x80000, CRC(21f6e51f) SHA1(b447e05261f59b3b2e89bbc0f606d7136b29cb56) )
9990   ROM_LOAD16_WORD_SWAP( "pa3j_16.10l", 0x80000, 0x80000, CRC(ca1d7897) SHA1(46aa9232e81a838f3eff1e9b992492a264914fd5) )
9995   ROM_LOAD16_WORD_SWAP( "pa3w_17.11l", 0x00000, 0x80000, CRC(12138234) SHA1(956a2c847a3cfb94007d1a636167fd2bb9f826ec) )
9996   ROM_LOAD16_WORD_SWAP( "pa3w_16.10l", 0x80000, 0x80000, CRC(d1ba585c) SHA1(c6d04441fe97abf0a72b23c917777a7b58e94a85) )
99919997
99929998   ROM_REGION( 0x400000, "gfx", 0 )
99939999   ROMX_LOAD( "pa3-01m.2c", 0x000000, 0x100000, CRC(068a152c) SHA1(fa491874068924c39bcc7de93dfda3b27f5d9613) , ROM_GROUPWORD | ROM_SKIP(6) )
r13476r13477
999610002   ROM_CONTINUE(            0x000006, 0x100000 )
999710003
999810004   ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
9999   ROM_LOAD( "pa3_11.11f",  0x00000, 0x08000, CRC(90a08c46) SHA1(7544adab2d7e052e0d21c920bff7841d9d718345) )
10005   ROM_LOAD( "pa3_11.11",  0x00000, 0x08000, CRC(90a08c46) SHA1(7544adab2d7e052e0d21c920bff7841d9d718345) )   // == pa3_11.11f but different size, resized by bootlegger
1000010006
1000110007   ROM_REGION( 0x40000, "oki", 0 )   /* Samples */
1000210008   ROM_LOAD( "pa3_05.10d",  0x00000, 0x20000, CRC(73a10d5d) SHA1(999465e4fbc35a34746d2db61ad49f61403d5af7) )
r13476r13477
1001010016   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
1001110017
1001210018   ROM_REGION( 0x0200, "bboardplds", 0 )
10013   ROM_LOAD( "cp1b1f.1f",    0x0000, 0x0117, NO_DUMP )
10014   ROM_LOAD( "cp1b8k.8k",    0x0000, 0x0117, NO_DUMP )
10015   ROM_LOAD( "cp1b9ka.9k",   0x0000, 0x0117, NO_DUMP )
10019   ROM_LOAD( "cp1b1f.1f",    0x0000, 0x0117, CRC(3979b8e3) SHA1(07c9819d68b4d93bc37b96bd15d689ce54fe034e) )
10020   ROM_LOAD( "cp1b8k.8k",    0x0000, 0x0117, CRC(8a52ea7a) SHA1(47a59abc54a83292cfd6faa2d293c8f948c7ea03) )
10021   ROM_LOAD( "cp1b9k.9k",    0x0000, 0x0117, CRC(a754bdc3) SHA1(9267b24cbddee4858b219468cc92f9df8f5fd0ef) )
1001610022
1001710023   ROM_REGION( 0x0200, "cboardplds", 0 )
1001810024   ROM_LOAD( "ioc1.ic7",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
r13476r13477
1002010026ROM_END
1002110027
1002210028/* B-Board 91635B-2 */
10023/* Note that this USA set seems to be the only one where GFX are stored into EPROMs instead of the usual MASK ROMs */
10029/* Note that this USA set seems to be the only one where GFX are stored into EPROMs instead of the usual MASK ROMs. */
1002410030ROM_START( megaman )
1002510031   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
1002610032   ROM_LOAD16_WORD_SWAP( "rcmu_23b.8f", 0x000000, 0x80000, CRC(1cd33c7a) SHA1(687fb3b6d660d7350447193f1911c47972e7a020) )
r13476r13477
1037910385   DRIVER_INIT_CALL(cps1);
1038010386}
1038110387
10382static DRIVER_INIT( pang3n )
10388static DRIVER_INIT( pang3b )
1038310389{
1038410390   /* Pang 3 is the only non-QSound game to have an EEPROM. */
1038510391   /* It is mapped in the CPS-B address range so probably is on the C-board. */
r13476r13477
1040910415      rom[A/2] = dst;
1041010416   }
1041110417
10412   DRIVER_INIT_CALL(pang3n);
10418   DRIVER_INIT_CALL(pang3b);
1041310419}
1041410420
1041510421static READ16_HANDLER( sf2mdt_r )
r13476r13477
1060610612
1060710613GAME( 1995, pang3,       0,        pang3,      pang3,      pang3,    ROT0,  "Mitchell", "Pang! 3 (Euro 950601)", GAME_SUPPORTS_SAVE )
1060810614GAME( 1995, pang3r1,     pang3,    pang3,      pang3,      pang3,    ROT0,  "Mitchell", "Pang! 3 (Euro 950511)", GAME_SUPPORTS_SAVE )
10609GAME( 1995, pang3n,      pang3,    pang3,      pang3n,     pang3n,   ROT0,  "Mitchell", "Pang! 3 (Euro 950511, not encrypted)", GAME_SUPPORTS_SAVE )
10610GAME( 1995, pang3j,      pang3,    pang3,      pang3n,     pang3,    ROT0,  "Mitchell", "Pang! 3: Kaitou Tachi no Karei na Gogo (Japan 950511)", GAME_SUPPORTS_SAVE )
10615GAME( 1995, pang3j,      pang3,    pang3,      pang3,      pang3,    ROT0,  "Mitchell", "Pang! 3: Kaitou Tachi no Karei na Gogo (Japan 950511)", GAME_SUPPORTS_SAVE )
10616GAME( 1995, pang3b,      pang3,    pang3,      pang3b,     pang3b,   ROT0,  "Mitchell", "Pang! 3 (bootleg)", GAME_SUPPORTS_SAVE )   // 950511 - based on Euro version
1061110617
1061210618/*  Home 'CPS Changer' Unit - For MESS */
1061310619CONS( 1995, sfzch,    0,        0,   cps1_10MHz, sfzch,    cps1,        "Capcom", "CPS Changer - Street Fighter Zero (Japan 951020)", 0 )
src/mame/drivers/kyugo.c
r13476r13477
473473   kyugo_state *state = machine.driver_data<kyugo_state>();
474474   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
475475   // must start with interrupts and sub CPU disabled
476   cpu_interrupt_enable(machine.device("maincpu"), 0);
476   state->m_nmi_mask = 0;
477477   kyugo_sub_cpu_control_w(space, 0, 0);
478478
479479   state->m_scroll_x_lo = 0;
src/mame/drivers/blitz68k.c
r13476r13477
2525- ilpag, steaser: some minor issues with the blitter emulation;
2626- ilpag: sound uses a MP7524 8-bit DAC (bottom right, by the edge connector -PJB),  but the MCU controls the sound writes?
2727- steaser: sound uses an OkiM6295 (controlled by the sub MCU), check if it can be simulated;
28- deucesw2: colour cycling effect on attract mode is ugly (background should be blue, it's instead a MAME-esque
29  palette), protection?
2830
2931*****************************************************************************************************************/
3032
3133#include "emu.h"
32#include "deprecat.h"
3334#include "cpu/m68000/m68000.h"
3435#include "video/mc6845.h"
3536#include "sound/dac.h"
3637#include "sound/saa1099.h"
3738#include "machine/nvram.h"
39#include "video/ramdac.h"
3840
3941class blitz68k_state : public driver_device
4042{
r13476r13477
4648   optional_shared_ptr<UINT16>   m_nvram;
4749   UINT8 *m_blit_buffer;
4850   UINT16 *m_frame_buffer;
49   struct { int r,g,b,offs,offs_internal; } m_pal;
50   struct { UINT8 r, g, b, offs, offs_internal, ram[256*3]; } m_btpal;
5151   UINT16 *m_blit_romaddr;
5252   UINT16 *m_blit_attr1_ram;
5353   UINT16 *m_blit_dst_ram_loword;
r13476r13477
135135
136136/*************************************************************************************************************
137137
138    Palette
139
140*************************************************************************************************************/
141
142static WRITE16_HANDLER( paletteram_io_w )
143{
144   blitz68k_state *state = space->machine().driver_data<blitz68k_state>();
145   int pal_data;
146
147   switch(offset*2)
148   {
149      case 0:
150         state->m_pal.offs = (data & 0xff00) >> 8;
151         break;
152      case 4:
153         state->m_pal.offs_internal = 0;
154         break;
155      case 2:
156         switch(state->m_pal.offs_internal)
157         {
158            case 0:
159               pal_data = (data & 0xff00) >> 8;
160               state->m_pal.r = ((pal_data & 0x3f) << 2) | ((pal_data & 0x30) >> 4);
161               state->m_pal.offs_internal++;
162               break;
163            case 1:
164               pal_data = (data & 0xff00) >> 8;
165               state->m_pal.g = ((pal_data & 0x3f) << 2) | ((pal_data & 0x30) >> 4);
166               state->m_pal.offs_internal++;
167               break;
168            case 2:
169               pal_data = (data & 0xff00) >> 8;
170               state->m_pal.b = ((pal_data & 0x3f) << 2) | ((pal_data & 0x30) >> 4);
171               palette_set_color(space->machine(), state->m_pal.offs, MAKE_RGB(state->m_pal.r, state->m_pal.g, state->m_pal.b));
172               state->m_pal.offs_internal = 0;
173               state->m_pal.offs++;
174               break;
175         }
176
177         break;
178   }
179}
180
181/*************************************************************************************************************
182
183    Palette (Bt476 RAMDAC)
184    To do: merge with above, implement as a device
185
186*************************************************************************************************************/
187
188
189static WRITE8_HANDLER( paletteram_bt476_w )
190{
191   blitz68k_state *state = space->machine().driver_data<blitz68k_state>();
192   switch(offset)
193   {
194      case 0:
195         state->m_btpal.offs = data;
196         state->m_btpal.offs_internal = 0;
197         break;
198      case 2:
199         state->m_btpal.offs = data;
200         state->m_btpal.offs_internal = 0;
201         break;
202      case 1:
203         data &= 0x3f;
204         state->m_btpal.ram[state->m_btpal.offs * 3 + state->m_btpal.offs_internal] = data;
205         switch(state->m_btpal.offs_internal)
206         {
207            case 0:
208               state->m_btpal.r = data << 2;
209               state->m_btpal.offs_internal++;
210               break;
211            case 1:
212               state->m_btpal.g = data << 2;
213               state->m_btpal.offs_internal++;
214               break;
215            case 2:
216               state->m_btpal.b = data << 2;
217               palette_set_color(space->machine(), state->m_btpal.offs, MAKE_RGB(state->m_btpal.r, state->m_btpal.g, state->m_btpal.b));
218               state->m_btpal.offs_internal = 0;
219               state->m_btpal.offs++;
220               break;
221         }
222         break;
223   }
224}
225
226static READ8_HANDLER( paletteram_bt476_r )
227{
228   blitz68k_state *state = space->machine().driver_data<blitz68k_state>();
229   UINT8 ret = 0xff;
230
231   switch(offset)
232   {
233      case 0:
234         ret = state->m_btpal.offs;
235         break;
236
237      case 1:
238         ret = state->m_btpal.ram[state->m_btpal.offs * 3 + state->m_btpal.offs_internal];
239         state->m_btpal.offs_internal++;
240         if (state->m_btpal.offs_internal >= 3)
241         {
242            state->m_btpal.offs_internal = 0;
243            state->m_btpal.offs++;
244         }
245         break;
246   }
247
248   return ret;
249}
250
251/*************************************************************************************************************
252
253138    Blitter (ilpag, steaser)
254139
255140    To do:
r13476r13477
601486//  AM_RANGE(0x800000, 0x800001) AM_READ(test_r)
602487//  AM_RANGE(0x880000, 0x880001) AM_READ(test_r)
603488
604   AM_RANGE(0x900000, 0x900005) AM_WRITE( paletteram_io_w ) //RAMDAC
489   AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, index_w, 0xff00 )
490   AM_RANGE(0x900002, 0x900003) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, pal_w, 0xff00 )
491   AM_RANGE(0x900004, 0x900005) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, mask_w, 0xff00 )
605492   AM_RANGE(0x980000, 0x98000f) AM_RAM AM_BASE_MEMBER(blitz68k_state, m_blit_transpen) //video registers for the blitter write
606493   AM_RANGE(0x990000, 0x990007) AM_RAM AM_BASE_MEMBER(blitz68k_state, m_blit_vregs) //pens
607494   AM_RANGE(0x998000, 0x998001) AM_RAM AM_BASE_MEMBER(blitz68k_state, m_blit_romaddr)
r13476r13477
628515   AM_RANGE(0x880000, 0x880001) AM_READ(test_r)
629516//  AM_RANGE(0x8c0000, 0x8c0001) AM_WRITE(sound_write_w)
630517
631   AM_RANGE(0x900000, 0x900005) AM_WRITE( paletteram_io_w ) //RAMDAC
518   AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, index_w, 0xff00 )
519   AM_RANGE(0x900002, 0x900003) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, pal_w, 0xff00 )
520   AM_RANGE(0x900004, 0x900005) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, mask_w, 0xff00 )
632521   AM_RANGE(0x940000, 0x940001) AM_WRITENOP //? Seems a dword write for some read, written consecutively
633522   AM_RANGE(0x980000, 0x98000f) AM_RAM AM_BASE_MEMBER(blitz68k_state, m_blit_transpen)//probably transparency pens
634523   AM_RANGE(0x990000, 0x990005) AM_RAM AM_BASE_MEMBER(blitz68k_state, m_blit_vregs)
r13476r13477
690579   AM_RANGE(0x000000, 0x03ffff) AM_ROM
691580   AM_RANGE(0x100000, 0x10ffff) AM_RAM
692581
693   AM_RANGE(0x220002, 0x220003) AM_READ8 ( paletteram_bt476_r, 0xff00 ) // RAMDAC
582   AM_RANGE(0x220000, 0x220001) AM_DEVREAD8_MODERN("ramdac",ramdac_device, index_r, 0xff00 )
583   AM_RANGE(0x220002, 0x220003) AM_DEVREAD8_MODERN("ramdac",ramdac_device, pal_r, 0xff00 )
694584
695585   AM_RANGE(0x240000, 0x240001) AM_WRITE8(blit_addr0_w, 0xff00)
696586   AM_RANGE(0x240002, 0x240003) AM_WRITE8(blit_addr1_w, 0xff00)
r13476r13477
722612   AM_RANGE(0x2e000c, 0x2e000d) AM_WRITE8(blit_flag6_w, 0xff00)
723613   AM_RANGE(0x2e000e, 0x2e000f) AM_WRITE8(blit_flag7_w, 0xff00)
724614
725   AM_RANGE(0x300000, 0x300007) AM_WRITE8( paletteram_bt476_w, 0xff00 ) // RAMDAC
615   AM_RANGE(0x300000, 0x300001) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, index_w, 0xff00 )
616   AM_RANGE(0x300002, 0x300003) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, pal_w, 0xff00 )
617   AM_RANGE(0x300004, 0x300005) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, mask_w, 0xff00 )
726618
727619   AM_RANGE(0x400000, 0x400001) AM_READ8(bankrob_mcu_status_write_r, 0x00ff)
728620   AM_RANGE(0x400002, 0x400003) AM_READ8(bankrob_mcu_status_read_r,  0x00ff)
r13476r13477
778670   AM_RANGE(0x880000, 0x880001) AM_WRITE8(bankroba_mcu2_r, 0x00ff)   // lev 3
779671   AM_RANGE(0x8c0000, 0x8c0001) AM_WRITE8(bankroba_mcu2_w, 0x00ff)
780672
781   AM_RANGE(0x900000, 0x900007) AM_WRITE8( paletteram_bt476_w, 0xff00 ) // RAMDAC
673   AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, index_w, 0xff00 )
674   AM_RANGE(0x900002, 0x900003) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, pal_w, 0xff00 )
675   AM_RANGE(0x900004, 0x900005) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, mask_w, 0xff00 )
782676
783677//  AM_RANGE(0x940000, 0x940001) AM_WRITE   // lev 6
784678
r13476r13477
805699
806700   AM_RANGE(0x9b8000, 0x9b8001) AM_WRITE8(blit_draw_w, 0x00ff)
807701
808   AM_RANGE(0x9c0002, 0x9c0003) AM_READ8 ( paletteram_bt476_r, 0xff00 ) // RAMDAC
702   AM_RANGE(0x9c0000, 0x9c0001) AM_DEVREAD8_MODERN("ramdac",ramdac_device, index_r, 0xff00 )
703   AM_RANGE(0x9c0002, 0x9c0003) AM_DEVREAD8_MODERN("ramdac",ramdac_device, pal_r, 0xff00 )
809704
810705   AM_RANGE(0x9d0000, 0x9d0001) AM_READ8(bankroba_mcu1_status_write_r, 0xff00)
811706
r13476r13477
924819   AM_RANGE(0x874000, 0x874001) AM_READ_PORT("IN2")
925820   AM_RANGE(0x876000, 0x876001) AM_READ_PORT("DSW")
926821
927   AM_RANGE(0x880000, 0x880003) AM_WRITE8( paletteram_bt476_w, 0xffff ) // RAMDAC
928   AM_RANGE(0x880000, 0x880001) AM_READ8 ( paletteram_bt476_r, 0xffff ) // ""
822   AM_RANGE(0x880000, 0x880001) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, index_w, 0xff00 )
823   AM_RANGE(0x880000, 0x880001) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, pal_w, 0x00ff )
824   AM_RANGE(0x880002, 0x880003) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, mask_w, 0xff00 )
825   AM_RANGE(0x880000, 0x880001) AM_DEVREAD8_MODERN("ramdac",ramdac_device, index_r, 0xff00 )
826   AM_RANGE(0x880000, 0x880001) AM_DEVREAD8_MODERN("ramdac",ramdac_device, pal_r, 0x00ff )
929827
930828   AM_RANGE(0x8a0000, 0x8a0007) AM_WRITE8(blit_hwyxa_draw_w, 0xffff)
931829
r13476r13477
1015913
1016914   AM_RANGE(0x800000, 0x800007) AM_WRITE8(blit_hwyxa_draw_w, 0xffff)
1017915
1018   AM_RANGE(0x812000, 0x812001) AM_READ8 ( paletteram_bt476_r, 0xffff ) // RAMDAC
916   AM_RANGE(0x812000, 0x812001) AM_DEVREAD8_MODERN("ramdac",ramdac_device, index_r, 0xff00 )
917   AM_RANGE(0x812000, 0x812001) AM_DEVREAD8_MODERN("ramdac",ramdac_device, pal_r, 0x00ff )
1019918
1020919   AM_RANGE(0x830000, 0x830001) AM_READ( deucesw2_mcu_r )
1021920
r13476r13477
1026925
1027926   AM_RANGE(0x880000, 0x880007) AM_WRITE8(blit_hwyxa_draw_w, 0xffff)
1028927
1029   AM_RANGE(0x890000, 0x890003) AM_WRITE8( paletteram_bt476_w, 0xffff ) // RAMDAC
928   AM_RANGE(0x890000, 0x890001) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, index_w, 0xff00 )
929   AM_RANGE(0x890000, 0x890001) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, pal_w, 0x00ff )
930   AM_RANGE(0x890002, 0x890003) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, mask_w, 0xff00 )
1030931
1031932   AM_RANGE(0x894000, 0x894003) AM_WRITE8(blit_pens_w, 0xffff)
1032933
r13476r13477
1084985   AM_RANGE(0x000000, 0x03ffff) AM_ROM
1085986   AM_RANGE(0x100000, 0x10ffff) AM_RAM
1086987
1087   AM_RANGE(0x220002, 0x220003) AM_READ8 ( paletteram_bt476_r, 0xff00 ) // RAMDAC
988   AM_RANGE(0x220002, 0x220003) AM_DEVREAD8_MODERN("ramdac",ramdac_device, index_r, 0xff00 )
989   AM_RANGE(0x220002, 0x220003) AM_DEVREAD8_MODERN("ramdac",ramdac_device, pal_r, 0x00ff )
1088990
1089991   AM_RANGE(0x240000, 0x240001) AM_WRITE8(blit_addr0_w, 0xff00)
1090992   AM_RANGE(0x240002, 0x240003) AM_WRITE8(blit_addr1_w, 0xff00)
r13476r13477
11191021   AM_RANGE(0x2e000c, 0x2e000d) AM_WRITE8(blit_flag6_w, 0xff00)
11201022   AM_RANGE(0x2e000e, 0x2e000f) AM_WRITE8(blit_flag7_w, 0xff00)
11211023
1122   AM_RANGE(0x300000, 0x300007) AM_WRITE8( paletteram_bt476_w, 0xff00 ) // RAMDAC
1024   AM_RANGE(0x300000, 0x300001) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, index_w, 0xff00 )
1025   AM_RANGE(0x300002, 0x300003) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, pal_w, 0xff00 )
1026   AM_RANGE(0x300004, 0x300005) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, mask_w, 0xff00 )
11231027
11241028   AM_RANGE(0x400000, 0x400001) AM_READ8(dualgame_mcu_status_write_r, 0x00ff)
11251029   AM_RANGE(0x400002, 0x400003) AM_READ8(dualgame_mcu_status_read_r,  0x00ff)
r13476r13477
11861090   AM_RANGE(0x200000, 0x20ffff) AM_RAM
11871091   AM_RANGE(0x400000, 0x41ffff) AM_RAM
11881092
1189   AM_RANGE(0x800000, 0x800003) AM_WRITE8( paletteram_bt476_w, 0xffff ) // RAMDAC
1190   AM_RANGE(0x840000, 0x840003) AM_WRITE8( paletteram_bt476_w, 0xffff ) // RAMDAC
1191   AM_RANGE(0x840000, 0x840001) AM_READ8 ( paletteram_bt476_r, 0xffff ) // ""
1093   AM_RANGE(0x800000, 0x800001) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, index_w, 0xff00 )
1094   AM_RANGE(0x800000, 0x800001) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, pal_w, 0x00ff )
1095   AM_RANGE(0x800002, 0x800003) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, mask_w, 0xff00 )
1096   AM_RANGE(0x840000, 0x840001) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, index_w, 0xff00 )
1097   AM_RANGE(0x840000, 0x840001) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, pal_w, 0x00ff )
1098   AM_RANGE(0x840002, 0x840003) AM_DEVWRITE8_MODERN("ramdac",ramdac_device, mask_w, 0xff00 )
1099   AM_RANGE(0x840000, 0x840001) AM_DEVREAD8_MODERN("ramdac",ramdac_device, index_r, 0xff00 )
1100   AM_RANGE(0x840000, 0x840001) AM_DEVREAD8_MODERN("ramdac",ramdac_device, pal_r, 0x00ff )
11921101
1102
11931103   AM_RANGE(0x8c0000, 0x8c0003) AM_WRITE8( blit_pens_w, 0xffff )
11941104
11951105   AM_RANGE(0x940000, 0x940001) AM_READ( hermit_mcu_r )
r13476r13477
16861596   crtc_addr            /* update address callback */
16871597};
16881598
1599static ADDRESS_MAP_START( ramdac_map, AS_0, 8 )
1600   AM_RANGE(0x000, 0x3ff) AM_DEVREADWRITE_MODERN("ramdac",ramdac_device,ramdac_pal_r,ramdac_rgb666_w)
1601ADDRESS_MAP_END
1602
1603static RAMDAC_INTERFACE( ramdac_intf )
1604{
1605   0
1606};
1607
16891608static MACHINE_CONFIG_START( ilpag, blitz68k_state )
16901609   MCFG_CPU_ADD("maincpu", M68000, 11059200 )   // ?
16911610   MCFG_CPU_PROGRAM_MAP(ilpag_map)
r13476r13477
17051624
17061625   MCFG_VIDEO_START(blitz68k)
17071626
1627   MCFG_RAMDAC_ADD("ramdac", ramdac_intf, ramdac_map)
1628
17081629   MCFG_SPEAKER_STANDARD_MONO("mono")
17091630   MCFG_SOUND_ADD("dac", DAC, 0)
17101631   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
r13476r13477
17481669   state->m_nvram[0x8ac/2] = input_port_read(timer.machine(), "HOLD4_HOLD5") & 0xffff;
17491670}
17501671
1751/* TODO: remove this hack.*/
1752static INTERRUPT_GEN( steaser_irq )
1753{
1754   int num=cpu_getiloops(device)+3;
1755   device_set_input_line(device, num, HOLD_LINE);
1756}
17571672
17581673static MACHINE_CONFIG_DERIVED( steaser, ilpag )
17591674   MCFG_CPU_MODIFY("maincpu")
17601675   MCFG_CPU_PROGRAM_MAP(steaser_map)
1761   MCFG_CPU_VBLANK_INT_HACK(steaser_irq,4)
1676   MCFG_CPU_VBLANK_INT("screen",irq5_line_hold) //3, 4 & 6 used, mcu comms?
17621677
17631678   MCFG_TIMER_ADD_PERIODIC("coinsim", steaser_mcu_sim, attotime::from_hz(10000)) // not real, but for simulating the MCU
17641679MACHINE_CONFIG_END
r13476r13477
17841699   MCFG_PALETTE_LENGTH(0x100)
17851700
17861701   MCFG_VIDEO_START(blitz68k)
1702   MCFG_RAMDAC_ADD("ramdac", ramdac_intf, ramdac_map)
17871703
17881704   MCFG_SPEAKER_STANDARD_MONO("mono")
17891705   MCFG_SOUND_ADD("dac", DAC, 0)
r13476r13477
18161732   MCFG_PALETTE_LENGTH(0x100)
18171733
18181734   MCFG_VIDEO_START(blitz68k)
1735   MCFG_RAMDAC_ADD("ramdac", ramdac_intf, ramdac_map)
18191736
18201737   MCFG_SPEAKER_STANDARD_MONO("mono")
18211738   MCFG_SOUND_ADD("dac", DAC, 0)
r13476r13477
18461763   MCFG_PALETTE_LENGTH(0x100)
18471764
18481765   MCFG_VIDEO_START(blitz68k_addr_factor1)
1766   MCFG_RAMDAC_ADD("ramdac", ramdac_intf, ramdac_map)
18491767
18501768   MCFG_SPEAKER_STANDARD_MONO("mono")
18511769   MCFG_SOUND_ADD("dac", DAC, 0)
r13476r13477
18751793   MCFG_PALETTE_LENGTH(0x100)
18761794
18771795   MCFG_VIDEO_START(blitz68k)
1796   MCFG_RAMDAC_ADD("ramdac", ramdac_intf, ramdac_map)
18781797
18791798   MCFG_SPEAKER_STANDARD_MONO("mono")
18801799   MCFG_SOUND_ADD("dac", DAC, 0)
r13476r13477
19061825   MCFG_PALETTE_LENGTH(0x100)
19071826
19081827   MCFG_VIDEO_START(blitz68k)
1828   MCFG_RAMDAC_ADD("ramdac", ramdac_intf, ramdac_map)
19091829
19101830   MCFG_SPEAKER_STANDARD_MONO("mono")
19111831   MCFG_SOUND_ADD("dac", DAC, 0)
r13476r13477
19351855   MCFG_PALETTE_LENGTH(0x100)
19361856
19371857   MCFG_VIDEO_START(blitz68k)
1858   MCFG_RAMDAC_ADD("ramdac", ramdac_intf, ramdac_map)
19381859
19391860   MCFG_SPEAKER_STANDARD_MONO("mono")
19401861   MCFG_SOUND_ADD("dac", DAC, 0)
r13476r13477
19671888   MCFG_MC6845_ADD("crtc", H46505, XTAL_11_0592MHz/4, mc6845_intf_irq3)
19681889
19691890   MCFG_PALETTE_LENGTH(0x100)
1891   MCFG_RAMDAC_ADD("ramdac", ramdac_intf, ramdac_map)
19701892
19711893   MCFG_SPEAKER_STANDARD_MONO("mono")
19721894   MCFG_SOUND_ADD("saa", SAA1099, XTAL_8MHz/2)
r13476r13477
26222544*************************************************************************************************************/
26232545
26242546ROM_START( poker52 )
2625   ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code + gfx
2547   ROM_REGION( 0x40000, "maincpu", ROMREGION_ERASE00 ) // 68000 code + gfx
26262548   ROM_LOAD16_BYTE( "unknown_label.u25", 0x00000, 0x20000, CRC(63e0dd69) SHA1(970e6363ade714a2b9a844c5683ab1365193457a) )
26272549   ROM_LOAD16_BYTE( "unknown_label.u24", 0x00001, 0x20000, NO_DUMP )
26282550
src/mame/drivers/alpha68k.c
r13476r13477
2020    Super Champion Baseball (V board?)       SNK/Alpha/Romstar/Sega 1989
2121    The Next Space          A8004-1 PIC      SNK 1989
2222
23TODO:
24- Super Stingray MCU irq controls timer speed, needs the MCU to be hooked up.
25- Super Champion Baseball "ball speed" protection
26- Fix sound CPU crashes properly on Alpha 68k II / V HW games (nested NMIs)
27
2328General notes:
2429
2530    All II & V games are 68000, z80 plus a custom Alpha microcontroller,
r13476r13477
190195
191196#include "emu.h"
192197#include "cpu/m68000/m68000.h"
193#include "deprecat.h"
194198#include "cpu/z80/z80.h"
195199#include "sound/ay8910.h"
196200#include "sound/dac.h"
r13476r13477
18301834   DEVCB_MEMORY_HANDLER("audiocpu", PROGRAM, soundlatch_r)
18311835};
18321836
1837static WRITE8_HANDLER( porta_w )
1838{
1839   alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
1840
1841   if(data == 0xff)
1842      return; // skip
1843
1844   /* guess */
1845   if(data == 0 && state->m_sound_pa_latch) // 1 -> 0 transition = enables NMI
1846      state->m_sound_nmi_mask = 1;
1847
1848   if(data && state->m_sound_pa_latch == 0) // 0 -> 1 transition = disables NMI
1849      state->m_sound_nmi_mask = 0;
1850
1851   state->m_sound_pa_latch = data & 1;
1852}
1853
18331854static const ym2203_interface ym2203_config =
18341855{
18351856   {
18361857      AY8910_LEGACY_OUTPUT,
18371858      AY8910_DEFAULT_LOADS,
1838      DEVCB_MEMORY_HANDLER("audiocpu", PROGRAM, soundlatch_r)
1839   }
1859      DEVCB_MEMORY_HANDLER("audiocpu", PROGRAM, soundlatch_r),
1860      DEVCB_NULL,
1861      DEVCB_MEMORY_HANDLER("audiocpu", PROGRAM, porta_w),
1862      DEVCB_NULL
1863   },
1864   NULL
18401865};
18411866
18421867static void YM3812_irq( device_t *device, int param )
r13476r13477
18501875   YM3812_irq
18511876};
18521877
1853static INTERRUPT_GEN( alpha68k_interrupt )
1854{
1855   if (cpu_getiloops(device) == 0)
1856      device_set_input_line(device, 1, HOLD_LINE);
1857   else
1858      device_set_input_line(device, 2, HOLD_LINE);
1859}
1860//ZT
18611878
18621879/******************************************************************************/
18631880
r13476r13477
19501967   /* basic machine hardware */
19511968   MCFG_CPU_ADD("maincpu", M68000, 6000000) /* 24MHz/4? */
19521969   MCFG_CPU_PROGRAM_MAP(kyros_map)
1953   MCFG_CPU_VBLANK_INT_HACK(alpha68k_interrupt,2)
1970   MCFG_CPU_VBLANK_INT("screen",irq1_line_hold)
1971   MCFG_CPU_PERIODIC_INT(irq2_line_hold,60) // MCU irq
19541972
19551973   MCFG_CPU_ADD("audiocpu", Z80, 3579545)
19561974   MCFG_CPU_PROGRAM_MAP(sstingry_sound_map)
19571975   MCFG_CPU_IO_MAP(kyros_sound_portmap)
1958//AT
1959   MCFG_CPU_VBLANK_INT_HACK(irq0_line_hold, 2)
1976   MCFG_CPU_PERIODIC_INT(irq0_line_hold, 2*60)
19601977   MCFG_CPU_PERIODIC_INT(nmi_line_pulse, 4000)
1961//ZT
19621978
19631979   MCFG_MACHINE_START(common)
19641980   MCFG_MACHINE_RESET(common)
r13476r13477
19741990
19751991   MCFG_GFXDECODE(sstingry)
19761992   MCFG_PALETTE_LENGTH(256 + 1)
1977//AT
19781993   MCFG_PALETTE_INIT(kyros)
1979//ZT
19801994
19811995   /* sound hardware */
1982//AT
19831996   MCFG_SPEAKER_STANDARD_MONO("mono")
19841997
19851998   MCFG_SOUND_ADD("ym1", YM2203, 3000000)
r13476r13477
19932006
19942007   MCFG_SOUND_ADD("dac", DAC, 0)
19952008   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
1996//ZT
19972009MACHINE_CONFIG_END
19982010
19992011static MACHINE_CONFIG_START( kyros, alpha68k_state )
r13476r13477
20012013   /* basic machine hardware */
20022014   MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz/4)   /* Verified on bootleg PCB */
20032015   MCFG_CPU_PROGRAM_MAP(kyros_map)
2004   MCFG_CPU_VBLANK_INT_HACK(alpha68k_interrupt,2)
2016   MCFG_CPU_VBLANK_INT("screen",irq1_line_hold)
2017   MCFG_CPU_PERIODIC_INT(irq2_line_hold,60) // MCU irq
20052018
20062019   MCFG_CPU_ADD("audiocpu", Z80, XTAL_24MHz/6)   /* Verified on bootleg PCB */
20072020   MCFG_CPU_PROGRAM_MAP(kyros_sound_map)
20082021   MCFG_CPU_IO_MAP(kyros_sound_portmap)
2009//AT
2010   MCFG_CPU_VBLANK_INT_HACK(irq0_line_hold, 2)
2022   MCFG_CPU_PERIODIC_INT(irq0_line_hold, 2*60)
20112023   MCFG_CPU_PERIODIC_INT(nmi_line_pulse, 4000)
2012//ZT
20132024
20142025   MCFG_MACHINE_START(common)
20152026   MCFG_MACHINE_RESET(common)
r13476r13477
20292040   MCFG_PALETTE_INIT(kyros)
20302041
20312042   /* sound hardware */
2032//AT
20332043   MCFG_SPEAKER_STANDARD_MONO("mono")
20342044
20352045   MCFG_SOUND_ADD("ym1", YM2203, XTAL_24MHz/12)   /* Verified on bootleg PCB */
r13476r13477
20432053
20442054   MCFG_SOUND_ADD("dac", DAC, 0)
20452055   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
2046//ZT
20472056MACHINE_CONFIG_END
20482057
20492058static MACHINE_CONFIG_START( jongbou, alpha68k_state )
r13476r13477
20512060   /* basic machine hardware */
20522061   MCFG_CPU_ADD("maincpu", M68000, 8000000)
20532062   MCFG_CPU_PROGRAM_MAP(kyros_map)
2054   MCFG_CPU_VBLANK_INT_HACK(alpha68k_interrupt,17) // must be at least 4 for the controls to be smooth
2063   MCFG_CPU_VBLANK_INT("screen",irq1_line_hold)
2064   MCFG_CPU_PERIODIC_INT(irq2_line_hold,60*16) // MCU irq
20552065
20562066   MCFG_CPU_ADD("audiocpu", Z80, 4000000)
20572067   MCFG_CPU_PROGRAM_MAP(jongbou_sound_map)
20582068   MCFG_CPU_IO_MAP(jongbou_sound_portmap)
2059   MCFG_CPU_VBLANK_INT_HACK(irq0_line_hold, 160) // guess, controls sound speed
2069   MCFG_CPU_PERIODIC_INT(irq0_line_hold, 160*60)
20602070
20612071   MCFG_MACHINE_START(common)
20622072   MCFG_MACHINE_RESET(common)
r13476r13477
21072117
21082118   MCFG_GFXDECODE(paddle)
21092119
2110//AT
21112120   MCFG_PALETTE_LENGTH(1024)
21122121   MCFG_PALETTE_INIT(paddlem)
2113//ZT
21142122
21152123   /* sound hardware */
21162124   MCFG_SPEAKER_STANDARD_MONO("mono")
r13476r13477
21202128   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
21212129MACHINE_CONFIG_END
21222130
2131static INTERRUPT_GEN( alpha68k_sound_nmi )
2132{
2133   alpha68k_state *state = device->machine().driver_data<alpha68k_state>();
2134
2135   if(state->m_sound_nmi_mask)
2136      device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
2137}
2138
21232139static MACHINE_CONFIG_START( alpha68k_II, alpha68k_state )
21242140
21252141   /* basic machine hardware */
r13476r13477
21272143   MCFG_CPU_PROGRAM_MAP(alpha68k_II_map)
21282144   MCFG_CPU_VBLANK_INT("screen", irq3_line_hold)/* VBL */
21292145
2130   MCFG_CPU_ADD("audiocpu", Z80, /*3579545*/3579545*2) /* Unlikely but needed to stop nested NMI's */
2146   MCFG_CPU_ADD("audiocpu", Z80, 3579545*2) /* Unlikely but needed to stop nested NMI's */
21312147   MCFG_CPU_PROGRAM_MAP(sound_map)
21322148   MCFG_CPU_IO_MAP(sound_portmap)
2133   MCFG_CPU_PERIODIC_INT(nmi_line_pulse, 7500) //AT
2149   MCFG_CPU_PERIODIC_INT(alpha68k_sound_nmi, 7500)
21342150
21352151   MCFG_MACHINE_START(alpha68k_II)
21362152   MCFG_MACHINE_RESET(alpha68k_II)
r13476r13477
21652181
21662182static MACHINE_CONFIG_DERIVED( btlfieldb, alpha68k_II )
21672183   MCFG_CPU_MODIFY("maincpu")
2168   MCFG_CPU_VBLANK_INT_HACK(alpha68k_interrupt,2)
2184   MCFG_CPU_VBLANK_INT("screen",irq1_line_hold)
2185   MCFG_CPU_PERIODIC_INT(irq2_line_hold,60*4) // MCU irq
21692186MACHINE_CONFIG_END
21702187
2171//AT
21722188static MACHINE_CONFIG_START( alpha68k_II_gm, alpha68k_state )
21732189
21742190   /* basic machine hardware */
21752191   MCFG_CPU_ADD("maincpu", M68000, 8000000)
21762192   MCFG_CPU_PROGRAM_MAP(alpha68k_II_map)
2177   MCFG_CPU_VBLANK_INT_HACK(alpha68k_interrupt, 4)
2193   MCFG_CPU_VBLANK_INT("screen",irq1_line_hold)
2194   MCFG_CPU_PERIODIC_INT(irq2_line_hold,60*3) // MCU irq
21782195
2179   MCFG_CPU_ADD("audiocpu", Z80, 4000000*2)
2196   MCFG_CPU_ADD("audiocpu", Z80, 4000000*2) // TODO: fix this
21802197   MCFG_CPU_PROGRAM_MAP(sound_map)
21812198   MCFG_CPU_IO_MAP(sound_portmap)
2182   MCFG_CPU_PERIODIC_INT(nmi_line_pulse, 7500)
2199   MCFG_CPU_PERIODIC_INT(alpha68k_sound_nmi, 7500)
21832200
21842201   MCFG_MACHINE_START(alpha68k_II)
21852202   MCFG_MACHINE_RESET(alpha68k_II)
r13476r13477
22232240   MCFG_CPU_ADD("audiocpu", Z80, /*3579545*/3579545*2) /* Unlikely but needed to stop nested NMI's */
22242241   MCFG_CPU_PROGRAM_MAP(sound_map)
22252242   MCFG_CPU_IO_MAP(sound_portmap)
2226   MCFG_CPU_PERIODIC_INT(nmi_line_pulse, 8500) //AT
2243   MCFG_CPU_PERIODIC_INT(alpha68k_sound_nmi, 8500)
22272244
22282245   MCFG_MACHINE_START(alpha68k_V)
22292246   MCFG_MACHINE_RESET(alpha68k_V)
r13476r13477
22662283   MCFG_CPU_ADD("audiocpu", Z80, /*3579545*/3579545*2) /* Unlikely but needed to stop nested NMI's */
22672284   MCFG_CPU_PROGRAM_MAP(sound_map)
22682285   MCFG_CPU_IO_MAP(sound_portmap)
2269   MCFG_CPU_PERIODIC_INT(nmi_line_pulse, 8500) //AT
2286   MCFG_CPU_PERIODIC_INT(alpha68k_sound_nmi, 8500)
22702287
22712288   MCFG_MACHINE_START(alpha68k_V)
22722289   MCFG_MACHINE_RESET(alpha68k_V)
r13476r13477
23492366   ROM_LOAD( "ss_01.rom",       0x0000,  0x4000, CRC(fef09a92) SHA1(77b6aded1eed1bd5e6ffb25b56b62b10b7b9a304) )
23502367   ROM_LOAD( "ss_02.rom",       0x4000,  0x4000, CRC(ab4e8c01) SHA1(d96e7f97945fff48fb7b4661fdb575ac7ff77445) )
23512368
2352   ROM_REGION( 0x0400, "cpu2", 0 )     /* 8748 MCU code */
2369   ROM_REGION( 0x0400, "mcu", 0 )     /* 8748 MCU code */
23532370   ROM_LOAD( "d8748.bin",       0x0000, 0x0400, CRC(7fcbfc30) SHA1(6d087a3d44e475b6c8260a5134952097f26459b7) )
23542371
23552372   ROM_REGION( 0x60000, "gfx1", 0 )
r13476r13477
24852502   ROM_LOAD( "2s.1f",      0x00000, 0x4000, CRC(800ceb27) SHA1(4daa1b8adcad7a90cfd5d20704a7c431673c4995) )
24862503   ROM_LOAD( "1s.1d",      0x04000, 0x8000, CRC(87d3e719) SHA1(4b8b1b600c7c1de3a77030001e7e6f0ff118f294) )
24872504
2505   ROM_REGION( 0x1000, "mcu", 0 ) // these comes from original set
2506   ROM_LOAD( "kyros_68705u3.bin",    0x0000, 0x1000, BAD_DUMP CRC(c20880b7) SHA1(b041c36cbc4f348d74e0548df5cb14727f2d353b) ) // this one is from a bootleg PCB, program code *might* be compatible.
2507   ROM_LOAD( "kyros_mcu.bin",    0x0000, 0x0800,  BAD_DUMP CRC(3a902a19) SHA1(af1be8894c899b27b1106663ffaf2ab43fa1cdaa) ) // original MCU? (HD6805U1)
2508
24882509   ROM_REGION( 0x60000, "gfx1", 0 )
24892510   ROM_LOAD( "8.9r",   0x00000, 0x8000, CRC(d8203284) SHA1(7dede410239be6b674644fa76c91dd01837f841f) )
24902511   ROM_LOAD( "11.12m", 0x08000, 0x8000, CRC(a2f9738c) SHA1(31be81274bf70674bf0c32fcddbacf0f58d8f897) )
r13476r13477
25182539   ROM_REGION( 0x10000, "audiocpu", 0 )
25192540   ROM_LOAD( "p7.i1", 0x00000, 0x8000, CRC(88d74794) SHA1(98dbbb4d88c1e96a0e251e39ef43b02bd68e0bba) )
25202541
2542   ROM_REGION( 0x10000, "mcu", 0 )
2543   ROM_LOAD( "alpha.mcu", 0x000, 0x1000, NO_DUMP )
2544
25212545   ROM_REGION( 0x30000, "gfx1", 0 )
25222546   ROM_LOAD( "p6.l15", 0x00000, 0x10000, CRC(1facee65) SHA1(6c98338c616e53106960063d0d31483131b492b0) )
25232547   ROM_LOAD( "p5.k15", 0x10000, 0x10000, CRC(db0ad6bb) SHA1(c2ce0e78a4be9314f4f14ea87f521a79bab3697c) )
r13476r13477
25442568   ROM_REGION( 0x10000, "audiocpu", 0 )   /* Sound CPU */
25452569   ROM_LOAD( "padlem.18c", 0x000000, 0x10000, CRC(9269778d) SHA1(bdc9100827f2e018db943d9f7d81b7936c155bf0) )
25462570
2571   ROM_REGION( 0x10000, "mcu", 0 )
2572   ROM_LOAD( "alpha.mcu", 0x000, 0x1000, NO_DUMP )
2573
25472574   ROM_REGION( 0x80000, "gfx1", 0 )
25482575   ROM_LOAD( "padlem.16m",      0x00000, 0x10000, CRC(0984fb4d) SHA1(6bc529db93fad277f286e4a380812c40c7f42301) )
25492576   ROM_LOAD( "padlem.16n",      0x10000, 0x10000, CRC(4249e047) SHA1(9f35b316b5de65f8b1878fca283c9d534bb8ae25) )
r13476r13477
25782605   ROM_LOAD( "bf.8",            0x30000,  0x10000, CRC(8a43497b) SHA1(c64519b2aced8b072efdd1a6286f082094a50e61) )
25792606   ROM_LOAD( "bf.9",            0x50000,  0x10000, CRC(1408416f) SHA1(d7a32de156791f923635d7fdddc8db97f66bfb2a) )
25802607
2608   ROM_REGION( 0x10000, "mcu", 0 )
2609   ROM_LOAD( "alpha.mcu", 0x000, 0x1000, NO_DUMP )
2610
25812611   ROM_REGION( 0x010000, "gfx1", 0 )  /* chars */
25822612   ROM_LOAD( "bf.5",            0x00000,  0x08000, CRC(3cec2f55) SHA1(e4fca0c8193680385c7dd4d6c599492c9e0dd4af) )
25832613   ROM_LOAD( "bf.6",            0x08000,  0x08000, CRC(086a364d) SHA1(b008d4b351ada4240dd6c82c45405a2489e36019) )
r13476r13477
26102640   ROM_LOAD( "bf.8",            0x30000,  0x10000, CRC(8a43497b) SHA1(c64519b2aced8b072efdd1a6286f082094a50e61) )
26112641   ROM_LOAD( "bf.9",            0x50000,  0x10000, CRC(1408416f) SHA1(d7a32de156791f923635d7fdddc8db97f66bfb2a) )
26122642
2643   ROM_REGION( 0x10000, "mcu", 0 )
2644   ROM_LOAD( "alpha.mcu", 0x000, 0x1000, NO_DUMP )
2645
26132646   ROM_REGION( 0x010000, "gfx1", 0 )  /* chars */
26142647   ROM_LOAD( "bf.5",            0x00000,  0x08000, CRC(3cec2f55) SHA1(e4fca0c8193680385c7dd4d6c599492c9e0dd4af) )
26152648   ROM_LOAD( "bf.6",            0x08000,  0x08000, CRC(086a364d) SHA1(b008d4b351ada4240dd6c82c45405a2489e36019) )
r13476r13477
26742707   ROM_LOAD( "bf.8",            0x30000,  0x10000, CRC(8a43497b) SHA1(c64519b2aced8b072efdd1a6286f082094a50e61) )
26752708   ROM_LOAD( "bf.9",            0x50000,  0x10000, CRC(1408416f) SHA1(d7a32de156791f923635d7fdddc8db97f66bfb2a) )
26762709
2710   ROM_REGION( 0x10000, "mcu", 0 )
2711   ROM_LOAD( "alpha.mcu", 0x000, 0x1000, NO_DUMP )
2712
26772713   ROM_REGION( 0x010000, "gfx1", 0 )  /* chars */
26782714   ROM_LOAD( "bfv1_05.bin",     0x00000,  0x08000, CRC(be269dbf) SHA1(3240badbf65e076cc1f7caaec1081df9a4371d47) )
26792715   ROM_LOAD( "bfv1_06.bin",     0x08000,  0x08000, CRC(022b9de9) SHA1(5a736a4cfe05e7681c78ab816dfe04074fe0293d) )
r13476r13477
27222758   ROM_LOAD( "ss.8",            0x30000, 0x10000, CRC(e5cf7b37) SHA1(770ee80a1cc0f877486c6b47812db2b1118651d9) )
27232759   ROM_LOAD( "ss.9",            0x50000, 0x10000, CRC(76124ca2) SHA1(5b87178ab663cd8aa67670f0c14c9cbb8616b04d) )
27242760
2761   ROM_REGION( 0x10000, "mcu", 0 )
2762   ROM_LOAD( "alpha.mcu", 0x000, 0x1000, NO_DUMP )
2763
27252764   ROM_REGION( 0x010000, "gfx1", 0 )  /* chars */
27262765   ROM_LOAD( "ss.5",            0x00000, 0x08000, CRC(928ba287) SHA1(c415c5b84b83ee0e5e0aa60eb33132145fcd7487) )
27272766   ROM_LOAD( "ss.6",            0x08000, 0x08000, CRC(93b30b55) SHA1(51cacc48f4a298131852d41da80126bda5988920) )
r13476r13477
27682807   ROM_CONTINUE(               0x10000,  0x78000 )
27692808#endif
27702809
2810   ROM_REGION( 0x10000, "mcu", 0 )
2811   ROM_LOAD( "alpha.mcu", 0x000, 0x1000, NO_DUMP )
2812
27712813   ROM_REGION( 0x80000, "audiocpu", 0 ) // banking is slightly different from other Alpha68kII games
27722814   ROM_LOAD( "38.bin",          0x00000,  0x08000, BAD_DUMP CRC(4bf251b8) SHA1(d69a6607e92dbe8081c7c66b6853f02d578ef73f) ) // we use the bootleg set instead
27732815   ROM_CONTINUE(                0x18000,  0x08000 )
r13476r13477
28012843   ROM_LOAD( "40.bin",          0x30000,  0x10000, BAD_DUMP CRC(8dafc4e8) SHA1(7d4898557ad638ab8461060bc7ae406d7d24c5a4) )
28022844   ROM_LOAD( "1.bin",           0x40000,  0x10000, BAD_DUMP CRC(1e78062c) SHA1(821c037edf32eb8b03e5c487d3bab0622337e80b) )
28032845
2846   ROM_REGION( 0x10000, "mcu", 0 )
2847   ROM_LOAD( "alpha.mcu", 0x000, 0x1000, NO_DUMP )
2848
28042849   ROM_REGION( 0x010000, "gfx1", 0 )  /* chars */
28052850   ROM_LOAD( "gm.5",           0x000000, 0x08000, CRC(667f33f1) SHA1(6d05603b49927f09c9bb34e787b003eceaaf7062) )
28062851   ROM_LOAD( "gm.6",           0x008000, 0x08000, CRC(56020b13) SHA1(17e176a9c82ed0d6cb5c4014034ce4e16b8ef4fb) )
r13476r13477
28592904   ROM_LOAD( "sa.5",           0x50000,  0x10000, CRC(11cdb868) SHA1(6cd9c7952b4789e819272cbe0623f3e6f607b7eb) )
28602905   ROM_LOAD( "sa.6",           0x70000,  0x08000, CRC(237d93fd) SHA1(4c65169e4ce6a9be229410bbfd9b823060a829d7) )
28612906
2907   ROM_REGION( 0x10000, "mcu", 0 )
2908   ROM_LOAD( "alpha.mcu", 0x000, 0x1000, NO_DUMP )
2909
28622910   ROM_REGION( 0x020000, "gfx1", 0 )  /* chars */
28632911   ROM_LOAD( "sa.7",           0x000000, 0x08000, CRC(ea26e9c5) SHA1(13cb5a5955c813cd48f98f62f045a4cbc61806a1) )
28642912
r13476r13477
28812929   ROM_LOAD( "sa.5",           0x50000,  0x10000, CRC(11cdb868) SHA1(6cd9c7952b4789e819272cbe0623f3e6f607b7eb) )
28822930   ROM_LOAD( "sa.6",           0x70000,  0x08000, CRC(237d93fd) SHA1(4c65169e4ce6a9be229410bbfd9b823060a829d7) )
28832931
2932   ROM_REGION( 0x10000, "mcu", 0 )
2933   ROM_LOAD( "alpha.mcu", 0x000, 0x1000, NO_DUMP )
2934
28842935   ROM_REGION( 0x020000, "gfx1", 0 )  /* chars */
28852936   ROM_LOAD( "sa.7",           0x000000, 0x08000, CRC(ea26e9c5) SHA1(13cb5a5955c813cd48f98f62f045a4cbc61806a1) )
28862937
r13476r13477
29032954   ROM_LOAD( "sa.5",           0x50000,  0x10000, CRC(11cdb868) SHA1(6cd9c7952b4789e819272cbe0623f3e6f607b7eb) )
29042955   ROM_LOAD( "sa.6",           0x70000,  0x08000, CRC(237d93fd) SHA1(4c65169e4ce6a9be229410bbfd9b823060a829d7) )
29052956
2957   ROM_REGION( 0x10000, "mcu", 0 )
2958   ROM_LOAD( "alpha.mcu", 0x000, 0x1000, NO_DUMP )
2959
29062960   ROM_REGION( 0x020000, "gfx1", 0 )  /* chars */
29072961   ROM_LOAD( "sa.7",           0x000000, 0x08000, CRC(ea26e9c5) SHA1(13cb5a5955c813cd48f98f62f045a4cbc61806a1) )
29082962
r13476r13477
29292983   ROM_LOAD( "gw-10.13f",      0x50000, 0x10000, CRC(eb305d42) SHA1(93910cf60c1b8a87969888d8693c7d6782f1e799) )
29302984   ROM_LOAD( "gw-9.15f",       0x70000, 0x10000, CRC(84e5c946) SHA1(0b071d15b664a9c529713b1b896bdb5ebfa16c25) )
29312985
2986   ROM_REGION( 0x10000, "mcu", 0 )
2987   ROM_LOAD( "alpha.mcu", 0x000, 0x1000, NO_DUMP )
2988
29322989   ROM_REGION( 0x020000, "gfx1", 0 )  /* chars */
29332990   ROM_LOAD( "gw-13.4l",     0x000000, 0x10000, CRC(b75bf1d0) SHA1(c22c0049274c45701be0a7be2afc0517620a3a10) )
29342991
r13476r13477
30053062   ROM_LOAD( "u10",            0x50000, 0x10000, CRC(636978ae) SHA1(5d8093bc43192c89e230af318609222a69866b6e) )
30063063   ROM_LOAD( "u9",             0x70000, 0x10000, CRC(9136745e) SHA1(d7a2bfeac69ab2dbd4565a5bd1abb1f3f1199b42) )
30073064
3065   ROM_REGION( 0x10000, "mcu", 0 )
3066   ROM_LOAD( "alpha.mcu", 0x000, 0x1000, NO_DUMP )
3067
30083068   ROM_REGION( 0x020000, "gfx1", 0 )  /* chars */
30093069   ROM_LOAD( "gwb_ic.m19",     0x000000, 0x10000, CRC(b75bf1d0) SHA1(c22c0049274c45701be0a7be2afc0517620a3a10) )
30103070
r13476r13477
30313091   ROM_LOAD( "snksb5.bin",      0x50000, 0x10000, CRC(f45ee36f) SHA1(cdfdf696e9fcd2827ab1dd6adc2a45085911333d) )
30323092   ROM_LOAD( "snksb6.bin",      0x70000, 0x10000, CRC(651c9472) SHA1(bcff6679e22143cd6816c441c5a67b4956ee7ee0) )
30333093
3094   ROM_REGION( 0x10000, "mcu", 0 )
3095   ROM_LOAD( "alpha.mcu", 0x000, 0x1000, NO_DUMP )
3096
30343097   ROM_REGION( 0x020000, "gfx1", 0 )  /* chars */
30353098   ROM_LOAD( "snksb7.bin",      0x000000, 0x10000, CRC(8f3c2e25) SHA1(a5b3880f3079cce607678fd4ea5971560ce9ed8d) )
30363099
r13476r13477
32673330
32683331/******************************************************************************/
32693332
3270GAME( 1986, sstingry,  0,        sstingry,       sstingry, sstingry, ROT90, "Alpha Denshi Co.",                                  "Super Stingray", GAME_SUPPORTS_SAVE )
3333GAME( 1986, sstingry,  0,        sstingry,       sstingry, sstingry, ROT90, "Alpha Denshi Co.",                                  "Super Stingray (Japan)", GAME_SUPPORTS_SAVE | GAME_UNEMULATED_PROTECTION )
32713334
32723335GAME( 1987, kyros,     0,        kyros,          kyros,    kyros,    ROT90, "Alpha Denshi Co. (World Games Inc. license)",       "Kyros", GAME_SUPPORTS_SAVE )
32733336GAME( 1986, kyrosj,    kyros,    kyros,          kyros,    kyros,    ROT90, "Alpha Denshi Co.",                                  "Kyros No Yakata (Japan)", GAME_SUPPORTS_SAVE )
src/mame/drivers/namcos22.c
r13476r13477
11361136
11371137#include "emu.h"
11381138#include "cpu/m68000/m68000.h"
1139#include "deprecat.h"
11401139#include "includes/namcos22.h"
11411140#include "cpu/tms32025/tms32025.h"
11421141#include "cpu/m37710/m37710.h"
r13476r13477
11441143
11451144#define SS22_MASTER_CLOCK   (XTAL_49_152MHz)   /* info from Guru */
11461145
1146/* TODO: NOT measured! */
1147#define PIXEL_CLOCK         ((SS22_MASTER_CLOCK*2)/4) // x 2 is due of the interlaced screen ...
1148
1149#define HTOTAL            (428*2)
1150#define HBEND            (0)
1151#define HBSTART            (320*2)
1152
1153#define VTOTAL            (262*2)
1154#define VBEND            (0)
1155#define VBSTART            (240*2)
1156
1157
11471158#define MCU_SPEEDUP       1               /* mcu idle skipping */
1148#define DSP_SERIAL_SPEEDUP   1               /* lower DSP serial I/O period */
11491159
11501160/**
11511161 * helper function used to read a byte from a chunk of 32 bit memory
r13476r13477
16731683   COMBINE_DATA( &state->m_mpMasterExternalRAM[offset] );
16741684}
16751685
1676#if DSP_SERIAL_SPEEDUP
1677#define SERIAL_IO_PERIOD 256
1678#else
1679#define SERIAL_IO_PERIOD 1
1680#endif
1681
16821686static WRITE16_HANDLER( slave_serial_io_w )
16831687{
16841688   namcos22_state *state = space->machine().driver_data<namcos22_state>();
r13476r13477
16941698   return state->m_mSerialDataSlaveToMasterCurrent;
16951699}
16961700
1697static INTERRUPT_GEN( dsp_serial_pulse1 )
1701static TIMER_DEVICE_CALLBACK( dsp_master_serial_irq )
16981702{
1699   namcos22_state *state = device->machine().driver_data<namcos22_state>();
1703   namcos22_state *state = timer.machine().driver_data<namcos22_state>();
1704   int scanline = param;
1705
17001706   if( state->m_mbEnableDspIrqs )
17011707   {
17021708      state->m_mSerialDataSlaveToMasterCurrent = state->m_mSerialDataSlaveToMasterNext;
17031709
1704      if( cpu_getiloops(device) == 0 )
1710      if(scanline == 480)
1711         cputag_set_input_line(timer.machine(), "master", TMS32025_INT0, HOLD_LINE);
1712      else if((scanline % 2) == 0)
17051713      {
1706         cputag_set_input_line(device->machine(), "master", TMS32025_INT0, HOLD_LINE);
1714         cputag_set_input_line(timer.machine(), "master", TMS32025_RINT, HOLD_LINE);
1715         cputag_set_input_line(timer.machine(), "master", TMS32025_XINT, HOLD_LINE);
17071716      }
1708      cputag_set_input_line(device->machine(), "master", TMS32025_RINT, HOLD_LINE);
1709      cputag_set_input_line(device->machine(), "master", TMS32025_XINT, HOLD_LINE);
1710      cputag_set_input_line(device->machine(), "slave", TMS32025_RINT, HOLD_LINE);
1711      cputag_set_input_line(device->machine(), "slave", TMS32025_XINT, HOLD_LINE);
17121717   }
17131718}
17141719
1720static TIMER_DEVICE_CALLBACK( dsp_slave_serial_irq )
1721{
1722   namcos22_state *state = timer.machine().driver_data<namcos22_state>();
1723   int scanline = param;
1724
1725   if( state->m_mbEnableDspIrqs )
1726   {
1727      if((scanline % 2) == 0)
1728      {
1729         cputag_set_input_line(timer.machine(), "slave", TMS32025_RINT, HOLD_LINE);
1730         cputag_set_input_line(timer.machine(), "slave", TMS32025_XINT, HOLD_LINE);
1731      }
1732   }
1733}
1734
17151735static WRITE16_HANDLER( dsp_unk_porta_w )
17161736{
17171737}
r13476r13477
21842204{
21852205   namcos22_state *state = device->machine().driver_data<namcos22_state>();
21862206
2187   state->m_mFrameCount++;
2188
21892207   if (nthbyte(state->m_system_controller, 0x00) & 7)
21902208   {
21912209      // vblank irq
r13476r13477
29432961   AM_RANGE(M37710_PORT4, M37710_PORT4) AM_READ( mcu_port4_s22_r )
29442962ADDRESS_MAP_END
29452963
2946static INTERRUPT_GEN( mcu_interrupt )
2964static TIMER_DEVICE_CALLBACK( mcu_irq )
29472965{
2948   if (cpu_getiloops(device) == 0)
2949   {
2950      device_set_input_line(device, M37710_LINE_IRQ0, HOLD_LINE);
2951   }
2952   else if (cpu_getiloops(device) == 1)
2953   {
2954      device_set_input_line(device, M37710_LINE_IRQ2, HOLD_LINE);
2955   }
2956   else
2957   {
2958      device_set_input_line(device, M37710_LINE_ADC, HOLD_LINE);
2959   }
2966   //namcos22_state *state = timer.machine().driver_data<namcos22_state>();
2967   int scanline = param;
2968
2969   /* TODO: real sources of these */
2970   if(scanline == 480)
2971      cputag_set_input_line(timer.machine(), "mcu", M37710_LINE_IRQ0, HOLD_LINE);
2972   else if(scanline == 500)
2973      cputag_set_input_line(timer.machine(), "mcu", M37710_LINE_ADC, HOLD_LINE);
2974   else if(scanline == 0)
2975      cputag_set_input_line(timer.machine(), "mcu", M37710_LINE_IRQ2, HOLD_LINE);
29602976}
29612977
29622978static MACHINE_RESET(namcos22)
r13476r13477
29732989   MCFG_CPU_PROGRAM_MAP(master_dsp_program)
29742990   MCFG_CPU_DATA_MAP(master_dsp_data)
29752991   MCFG_CPU_IO_MAP(master_dsp_io)
2976   MCFG_CPU_VBLANK_INT_HACK(dsp_serial_pulse1,SERIAL_IO_PERIOD)
2992   MCFG_TIMER_ADD_SCANLINE("master_st", dsp_master_serial_irq, "screen", 0, 1)
29772993
29782994   MCFG_CPU_ADD("slave", TMS32025,SS22_MASTER_CLOCK)
29792995   MCFG_CPU_PROGRAM_MAP(slave_dsp_program)
29802996   MCFG_CPU_DATA_MAP(slave_dsp_data)
29812997   MCFG_CPU_IO_MAP(slave_dsp_io)
2998   MCFG_TIMER_ADD_SCANLINE("slave_st", dsp_slave_serial_irq, "screen", 0, 1)
29822999
29833000   MCFG_CPU_ADD("mcu", M37710, SS22_MASTER_CLOCK/3)
29843001   MCFG_CPU_PROGRAM_MAP(mcu_program)
29853002   MCFG_CPU_IO_MAP( mcu_io)
2986   MCFG_CPU_VBLANK_INT_HACK(mcu_interrupt, 3)
3003   MCFG_TIMER_ADD_SCANLINE("mcu_st", mcu_irq, "screen", 0, 1)
29873004
29883005   MCFG_QUANTUM_TIME(attotime::from_hz(6000))
29893006//  MCFG_QUANTUM_PERFECT_CPU("maincpu")
r13476r13477
29913008
29923009   MCFG_NVRAM_HANDLER(namcos22)
29933010   MCFG_SCREEN_ADD("screen", RASTER)
2994   MCFG_SCREEN_REFRESH_RATE(60)
2995   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
3011   MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
29963012   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
2997   MCFG_SCREEN_SIZE(640,480)
2998   MCFG_SCREEN_VISIBLE_AREA(0,640-1,0,480-1)
29993013   MCFG_SCREEN_UPDATE(namcos22s)
30003014
30013015   MCFG_PALETTE_LENGTH(NAMCOS22_PALETTE_SIZE)
r13476r13477
32283242   MCFG_CPU_PROGRAM_MAP(master_dsp_program)
32293243   MCFG_CPU_DATA_MAP(master_dsp_data)
32303244   MCFG_CPU_IO_MAP(master_dsp_io)
3231   MCFG_CPU_VBLANK_INT_HACK(dsp_serial_pulse1,SERIAL_IO_PERIOD)
3245   MCFG_TIMER_ADD_SCANLINE("master_st", dsp_master_serial_irq, "screen", 0, 1)
32323246
32333247   MCFG_CPU_ADD("slave", TMS32025,SS22_MASTER_CLOCK) /* ? */
32343248   MCFG_CPU_PROGRAM_MAP(slave_dsp_program)
32353249   MCFG_CPU_DATA_MAP(slave_dsp_data)
32363250   MCFG_CPU_IO_MAP(slave_dsp_io)
3251   MCFG_TIMER_ADD_SCANLINE("slave_st", dsp_slave_serial_irq, "screen", 0, 1)
32373252
32383253   MCFG_CPU_ADD("mcu", M37702, SS22_MASTER_CLOCK/3)   // C74 on the CPU board has no periodic interrupts, it runs entirely off Timer A0
32393254   MCFG_CPU_PROGRAM_MAP( mcu_s22_program)
r13476r13477
32433258
32443259   MCFG_NVRAM_HANDLER(namcos22)
32453260   MCFG_SCREEN_ADD("screen", RASTER)
3246   MCFG_SCREEN_REFRESH_RATE(60)
3247   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
3261   MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
32483262   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
3249   MCFG_SCREEN_SIZE(640,480)
3250   MCFG_SCREEN_VISIBLE_AREA(0,640-1,0,480-1)
32513263   MCFG_SCREEN_UPDATE(namcos22)
32523264
32533265   MCFG_PALETTE_LENGTH(NAMCOS22_PALETTE_SIZE)
src/mame/drivers/pangofun.c
r13476r13477
113113   AM_RANGE(0x000a0000, 0x000bffff) AM_RAM
114114   AM_RANGE(0x000c0000, 0x000c7fff) AM_ROM AM_REGION("video_bios", 0)
115115   AM_RANGE(0x000f0000, 0x000fffff) AM_ROM AM_REGION("bios", 0 )
116   AM_RANGE(0x00100000, 0x001fffff) AM_RAM
116   AM_RANGE(0x00100000, 0x00ffffff) AM_NOP
117   AM_RANGE(0x01000000, 0xfffeffff) AM_NOP
117118   AM_RANGE(0xffff0000, 0xffffffff) AM_ROM AM_REGION("bios", 0 )
118119ADDRESS_MAP_END
119120
r13476r13477
199200
200201static MACHINE_CONFIG_START( pangofun, pangofun_state )
201202   /* basic machine hardware */
202   MCFG_CPU_ADD("maincpu", I486, 40000000 )   /* I486 ?? Mhz */
203   MCFG_CPU_ADD("maincpu", I486, 25000000 )   /* I486 ?? Mhz (25 according to POST) */
203204   MCFG_CPU_PROGRAM_MAP(pcat_map)
204205   MCFG_CPU_IO_MAP(pcat_io)
205206
src/mame/drivers/galaga.c
r13476r13477
737737static WRITE8_HANDLER( bosco_latch_w )
738738{
739739   galaga_state *state = space->machine().driver_data<galaga_state>();
740   int bit = data & 1;
741740
742741   switch (offset)
743742   {
744743      case 0x00:   /* IRQ1 */
745         cpu_interrupt_enable(space->machine().device("maincpu"), bit);
746         if (!bit)
744         state->m_main_irq_mask = data & 1;
745         if (!state->m_main_irq_mask)
747746            cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
748747         break;
749748
750749      case 0x01:   /* IRQ2 */
751         cpu_interrupt_enable(space->machine().device("sub"), bit);
752         if (!bit)
750         state->m_sub_irq_mask = data & 1;
751         if (!state->m_sub_irq_mask)
753752            cputag_set_input_line(space->machine(), "sub", 0, CLEAR_LINE);
754753         break;
755754
756755      case 0x02:   /* NMION */
757         cpu_interrupt_enable(space->machine().device("sub2"), !bit);
756         state->m_sub2_nmi_mask = !(data & 1);
758757         break;
759758
760759      case 0x03:   /* RESET */
761         cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
762         cputag_set_input_line(space->machine(), "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
760         cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
761         cputag_set_input_line(space->machine(), "sub2", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
763762         break;
764763
765764      case 0x04:   /* n.c. */
766765         break;
767766
768767      case 0x05:   /* MOD 0 (xevious: n.c.) */
769         state->m_custom_mod = (state->m_custom_mod & ~0x01) | (bit << 0);
768         state->m_custom_mod = (state->m_custom_mod & ~0x01) | ((data & 1) << 0);
770769         break;
771770
772771      case 0x06:   /* MOD 1 (xevious: n.c.) */
773         state->m_custom_mod = (state->m_custom_mod & ~0x02) | (bit << 1);
772         state->m_custom_mod = (state->m_custom_mod & ~0x02) | ((data & 1) << 1);
774773         break;
775774
776775      case 0x07:   /* MOD 2 (xevious: n.c.) */
777         state->m_custom_mod = (state->m_custom_mod & ~0x04) | (bit << 2);
776         state->m_custom_mod = (state->m_custom_mod & ~0x04) | ((data & 1) << 2);
778777         break;
779778   }
780779}
r13476r13477
865864   galaga_state *state = machine.driver_data<galaga_state>();
866865   int scanline = param;
867866
868   nmi_line_pulse(machine.device("sub2"));
867   if(state->m_sub2_nmi_mask)
868      nmi_line_pulse(machine.device("sub2"));
869869
870870   scanline = scanline + 128;
871871   if (scanline >= 272)
r13476r13477
16371637};
16381638
16391639
1640static INTERRUPT_GEN( main_vblank_irq )
1641{
1642   galaga_state *state = device->machine().driver_data<galaga_state>();
16401643
1644   if(state->m_main_irq_mask)
1645      device_set_input_line(device, 0, ASSERT_LINE);
1646}
1647
1648static INTERRUPT_GEN( sub_vblank_irq )
1649{
1650   galaga_state *state = device->machine().driver_data<galaga_state>();
1651
1652   if(state->m_sub_irq_mask)
1653      device_set_input_line(device, 0, ASSERT_LINE);
1654}
1655
16411656static MACHINE_CONFIG_START( bosco, bosco_state )
16421657
16431658   /* basic machine hardware */
16441659   MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6)   /* 3.072 MHz */
16451660   MCFG_CPU_PROGRAM_MAP(bosco_map)
1646   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
1661   MCFG_CPU_VBLANK_INT("screen", main_vblank_irq)
16471662
16481663   MCFG_CPU_ADD("sub", Z80, MASTER_CLOCK/6)   /* 3.072 MHz */
16491664   MCFG_CPU_PROGRAM_MAP(bosco_map)
1650   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
1665   MCFG_CPU_VBLANK_INT("screen", sub_vblank_irq)
16511666
16521667   MCFG_CPU_ADD("sub2", Z80, MASTER_CLOCK/6)   /* 3.072 MHz */
16531668   MCFG_CPU_PROGRAM_MAP(bosco_map)
src/mame/drivers/lasso.c
r13476r13477
44
55        driver by Phil Stroffolino, Nicola Salmoria, Luca Elia
66
7---------------------------------------------------------------------------
8Year + Game                 By              CPUs        Sound Chips
9---------------------------------------------------------------------------
7--------------------------------------------------------------------------------------
8Year + Game                 By              CPUs        Sound Chips         Misc Info
9--------------------------------------------------------------------------------------
101082  Lasso                   SNK             3 x 6502    2 x SN76489
111183  Chameleon               Jaleco          2 x 6502    2 x SN76489
121284  Wai Wai Jockey Gate-In! Jaleco/Casio    2 x 6502    2 x SN76489 + DAC
1384  Pinbo                   Jaleco          6502 + Z80  2 x AY-8910
14---------------------------------------------------------------------------
1384  Pinbo                   Jaleco          6502 + Z80  2 x AY-8910         6502 @ 18MHz/24, Z80 @ 18MHz/6, AY @ 18MHz/12
14--------------------------------------------------------------------------------------
1515
1616Notes:
1717
18- unknown CPU speeds (affect game timing), currently using same as the
19  Rock-Ola games of the same area.  Lot of similarities between these
20  hardware.  The music ends at the perfect time with this clock speed
18- unknown CPU speeds unless noted above (affect game timing), currently using
19  same as the Rock-Ola games of the same area.  Lot of similarities between
20  these hardware.  The music ends at the perfect time with this clock speed
2121- Lasso: fire button auto-repeats on high score entry screen (real behavior?)
2222
2323***************************************************************************
r13476r13477
181181   AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(lasso_colorram_w) AM_BASE_MEMBER(lasso_state, m_colorram)
182182   AM_RANGE(0x1000, 0x10ff) AM_RAM AM_BASE_SIZE_MEMBER(lasso_state, m_spriteram, m_spriteram_size)
183183   AM_RANGE(0x1800, 0x1800) AM_WRITE(pinbo_sound_command_w)
184   AM_RANGE(0x1801, 0x1801) AM_WRITEONLY AM_BASE_MEMBER(lasso_state, m_back_color)
184185   AM_RANGE(0x1802, 0x1802) AM_WRITE(pinbo_video_control_w)
185186   AM_RANGE(0x1804, 0x1804) AM_READ_PORT("1804")
186187   AM_RANGE(0x1805, 0x1805) AM_READ_PORT("1805")
r13476r13477
591592static MACHINE_CONFIG_DERIVED( pinbo, base )
592593
593594   /* basic machine hardware */
594   MCFG_CPU_MODIFY("maincpu")
595   MCFG_CPU_REPLACE("maincpu", M6502, XTAL_18MHz/24)
595596   MCFG_CPU_PROGRAM_MAP(pinbo_main_map)
597   MCFG_CPU_VBLANK_INT("screen", irq0_line_hold)
596598
597   MCFG_CPU_REPLACE("audiocpu", Z80, 3000000)
599   MCFG_CPU_REPLACE("audiocpu", Z80, XTAL_18MHz/6)
598600   MCFG_CPU_PROGRAM_MAP(pinbo_audio_map)
599601   MCFG_CPU_IO_MAP(pinbo_audio_io_map)
600602
601603   /* video hardware */
602604   MCFG_GFXDECODE(pinbo)
603605   MCFG_PALETTE_LENGTH(256)
604
605606   MCFG_PALETTE_INIT(RRRR_GGGG_BBBB)
606607   MCFG_VIDEO_START(pinbo)
607608   MCFG_SCREEN_MODIFY("screen")
608   MCFG_SCREEN_UPDATE(pinbo)
609   MCFG_SCREEN_UPDATE(chameleo)
609610
610611   /* sound hardware */
611612   MCFG_DEVICE_REMOVE("sn76489.1")
612613   MCFG_DEVICE_REMOVE("sn76489.2")
613614
614   MCFG_SOUND_ADD("ay1", AY8910, 1250000)
615   MCFG_SOUND_ADD("ay1", AY8910, XTAL_18MHz/12)
615616   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.55)
616617
617   MCFG_SOUND_ADD("ay2", AY8910, 1250000)
618   MCFG_SOUND_ADD("ay2", AY8910, XTAL_18MHz/12)
618619   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.55)
619620MACHINE_CONFIG_END
620621
src/mame/drivers/pacland.c
r13476r13477
219219
220220static WRITE8_HANDLER( pacland_irq_1_ctrl_w )
221221{
222   pacland_state *state = space->machine().driver_data<pacland_state>();
222223   int bit = !BIT(offset, 11);
223   cpu_interrupt_enable(space->machine().device("maincpu"), bit);
224   state->m_main_irq_mask = bit;
224225   if (!bit)
225226      cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
226227}
227228
228229static WRITE8_HANDLER( pacland_irq_2_ctrl_w )
229230{
231   pacland_state *state = space->machine().driver_data<pacland_state>();
230232   int bit = !BIT(offset, 13);
231   cpu_interrupt_enable(space->machine().device("mcu"), bit);
233   state->m_mcu_irq_mask = bit;
232234   if (!bit)
233235      cputag_set_input_line(space->machine(), "mcu", 0, CLEAR_LINE);
234236}
r13476r13477
396398   0      /* stereo */
397399};
398400
401static INTERRUPT_GEN( main_vblank_irq )
402{
403   pacland_state *state = device->machine().driver_data<pacland_state>();
399404
405   if(state->m_main_irq_mask)
406      cputag_set_input_line(device->machine(), "maincpu", 0, ASSERT_LINE);
407}
400408
409static INTERRUPT_GEN( mcu_vblank_irq )
410{
411   pacland_state *state = device->machine().driver_data<pacland_state>();
412
413   if(state->m_mcu_irq_mask)
414      cputag_set_input_line(device->machine(), "mcu", 0, ASSERT_LINE);
415}
416
401417static MACHINE_CONFIG_START( pacland, pacland_state )
402418
403419   /* basic machine hardware */
404420   MCFG_CPU_ADD("maincpu", M6809, 49152000/32)   /* 1.536 MHz */
405421   MCFG_CPU_PROGRAM_MAP(main_map)
406   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
422   MCFG_CPU_VBLANK_INT("screen", main_vblank_irq)
407423
408424   MCFG_CPU_ADD("mcu", HD63701, 49152000/8)   /* 1.536 MHz? */
409425   MCFG_CPU_PROGRAM_MAP(mcu_map)
410426   MCFG_CPU_IO_MAP(mcu_port_map)
411   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
427   MCFG_CPU_VBLANK_INT("screen", mcu_vblank_irq)
412428
413429   MCFG_QUANTUM_TIME(attotime::from_hz(6000))   /* we need heavy synching between the MCU and the CPU */
414430
src/mame/drivers/ssrj.c
r13476r13477
66 TODO:
77 - colors (missing proms?)
88 - dips
9 - proper video hw emulation
109 - controls (is there START button ?)
10 - when a car sprite goes outside of the screen it gets stuck for a split frame on top of screen
1111
1212HW info :
1313
r13476r13477
121121   RGN_FRAC(1,3),   /* 1024 characters */
122122   3,   /* 3 bits per pixel */
123123   { 0, RGN_FRAC(2,3), RGN_FRAC(1,3) },   /* the bitplanes are separated */
124   { 0, 1, 2, 3, 4, 5, 6, 7 },
124125   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
125   { 0, 1, 2, 3, 4, 5, 6, 7 },
126126   8*8   /* every char takes 8 consecutive bytes */
127127};
128128
r13476r13477
153153   MCFG_SCREEN_REFRESH_RATE(60)
154154   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
155155   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
156   MCFG_SCREEN_SIZE(32*8, 32*8)
157   MCFG_SCREEN_VISIBLE_AREA(2*8, 30*8-1, 3*8, 32*8-1)
156   MCFG_SCREEN_SIZE(40*8, 32*8)
157   MCFG_SCREEN_VISIBLE_AREA(0*8, 34*8-1, 1*8, 31*8-1) // unknown res
158158   MCFG_SCREEN_UPDATE(ssrj)
159   MCFG_SCREEN_EOF(ssrj)
159160
160161   MCFG_GFXDECODE(ssrj)
161162   MCFG_PALETTE_LENGTH(128)
162163   MCFG_PALETTE_INIT(ssrj)
163164
164165   MCFG_VIDEO_START(ssrj)
165//  MCFG_ASPECT_RATIO(3,4)
166166
167167   MCFG_MACHINE_RESET(ssrj)
168168
r13476r13477
195195
196196ROM_END
197197
198GAME( 1985, ssrj,  0,       ssrj,  ssrj,  0, ORIENTATION_FLIP_X, "Taito Corporation", "Super Speed Race Junior (Japan)",GAME_WRONG_COLORS|GAME_IMPERFECT_GRAPHICS )
198GAME( 1985, ssrj,  0,       ssrj,  ssrj,  0, ROT90, "Taito Corporation", "Super Speed Race Junior (Japan)",GAME_WRONG_COLORS|GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/retofinv.c
r13476r13477
7373
7474static WRITE8_HANDLER( irq0_ack_w )
7575{
76   int bit = data & 1;
77
78   cpu_interrupt_enable(space->machine().device("maincpu"), bit);
79   if (!bit)
76   retofinv_state *state = space->machine().driver_data<retofinv_state>();
77   state->m_main_irq_mask = data & 1;
78   if (!state->m_main_irq_mask)
8079      cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
8180}
8281
8382static WRITE8_HANDLER( irq1_ack_w )
8483{
85   int bit = data & 1;
86
87   cpu_interrupt_enable(space->machine().device("sub"), bit);
88   if (!bit)
84   retofinv_state *state = space->machine().driver_data<retofinv_state>();
85   state->m_sub_irq_mask = data & 1;
86   if (!state->m_sub_irq_mask)
8987      cputag_set_input_line(space->machine(), "sub", 0, CLEAR_LINE);
9088}
9189
r13476r13477
334332   GFXDECODE_ENTRY( "gfx3", 0, bglayout,     64*16+256*2,  64 )
335333GFXDECODE_END
336334
335static INTERRUPT_GEN( main_vblank_irq )
336{
337   retofinv_state *state = device->machine().driver_data<retofinv_state>();
337338
339   if(state->m_main_irq_mask)
340      device_set_input_line(device, 0, ASSERT_LINE);
341}
338342
343static INTERRUPT_GEN( sub_vblank_irq )
344{
345   retofinv_state *state = device->machine().driver_data<retofinv_state>();
346
347   if(state->m_sub_irq_mask)
348      device_set_input_line(device, 0, ASSERT_LINE);
349}
350
339351static MACHINE_CONFIG_START( retofinv, retofinv_state )
340352
341353   /* basic machine hardware */
342354   MCFG_CPU_ADD("maincpu", Z80, 18432000/6)   /* 3.072 MHz? */
343355   MCFG_CPU_PROGRAM_MAP(main_map)
344   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
356   MCFG_CPU_VBLANK_INT("screen", main_vblank_irq)
345357
346358   MCFG_CPU_ADD("sub", Z80, 18432000/6)   /* 3.072 MHz? */
347359   MCFG_CPU_PROGRAM_MAP(sub_map)
348   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
360   MCFG_CPU_VBLANK_INT("screen", sub_vblank_irq)
349361
350362   MCFG_CPU_ADD("audiocpu", Z80, 18432000/6)   /* 3.072 MHz? */
351363   MCFG_CPU_PROGRAM_MAP(sound_map)
src/mame/drivers/mappy.c
r13476r13477
579579
580580static WRITE8_HANDLER( superpac_latch_w )
581581{
582   mappy_state *state = space->machine().driver_data<mappy_state>();
582583   device_t *namcoio_1 = space->machine().device("namcoio_1");
583584   device_t *namcoio_2 = space->machine().device("namcoio_2");
584585   int bit = offset & 1;
r13476r13477
586587   switch (offset & 0x0e)
587588   {
588589      case 0x00:   /* INT ON 2 */
589         cpu_interrupt_enable(space->machine().device("sub"), bit);
590         state->m_sub_irq_mask = bit;
590591         if (!bit)
591592            cputag_set_input_line(space->machine(), "sub", 0, CLEAR_LINE);
592593         break;
593594
594595      case 0x02:   /* INT ON */
595         cpu_interrupt_enable(space->machine().device("maincpu"), bit);
596         state->m_main_irq_mask = bit;
596597         if (!bit)
597598            cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
598599         break;
r13476r13477
623624
624625static WRITE8_HANDLER( phozon_latch_w )
625626{
627   mappy_state *state = space->machine().driver_data<mappy_state>();
626628   device_t *namcoio_1 = space->machine().device("namcoio_1");
627629   device_t *namcoio_2 = space->machine().device("namcoio_2");
628630   int bit = offset & 1;
r13476r13477
630632   switch (offset & 0x0e)
631633   {
632634      case 0x00:
633         cpu_interrupt_enable(space->machine().device("sub"), bit);
635         state->m_sub_irq_mask = bit;
634636         if (!bit)
635637            cputag_set_input_line(space->machine(), "sub", 0, CLEAR_LINE);
636638         break;
637639
638640      case 0x02:
639         cpu_interrupt_enable(space->machine().device("maincpu"), bit);
641         state->m_main_irq_mask = bit;
640642         if (!bit)
641643            cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
642644         break;
643645
644646      case 0x04:
645         cpu_interrupt_enable(space->machine().device("sub2"), bit);
647         state->m_sub2_irq_mask = bit;
646648         if (!bit)
647649            cputag_set_input_line(space->machine(), "sub2", 0, CLEAR_LINE);
648650         break;
r13476r13477
671673
672674static WRITE8_HANDLER( mappy_latch_w )
673675{
676   mappy_state *state = space->machine().driver_data<mappy_state>();
674677   device_t *namcoio_1 = space->machine().device("namcoio_1");
675678   device_t *namcoio_2 = space->machine().device("namcoio_2");
676679   int bit = offset & 1;
r13476r13477
678681   switch (offset & 0x0e)
679682   {
680683      case 0x00:   /* INT ON 2 */
681         cpu_interrupt_enable(space->machine().device("sub"), bit);
684         state->m_sub_irq_mask = bit;
682685         if (!bit)
683686            cputag_set_input_line(space->machine(), "sub", 0, CLEAR_LINE);
684687         break;
685688
686689      case 0x02:   /* INT ON */
687         cpu_interrupt_enable(space->machine().device("maincpu"), bit);
690         state->m_main_irq_mask = bit;
688691         if (!bit)
689692            cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
690693         break;
r13476r13477
763766   }
764767}
765768
766static INTERRUPT_GEN( superpac_interrupt_1 )
769static INTERRUPT_GEN( superpac_main_vblank_irq )
767770{
771   mappy_state *state = device->machine().driver_data<mappy_state>();
768772   device_t *namcoio_1 = device->machine().device("namcoio_1");
769773   device_t *namcoio_2 = device->machine().device("namcoio_2");
770774
771   irq0_line_assert(device);   // this also checks if irq is enabled - IMPORTANT!
772                  // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
775   if (state->m_main_irq_mask)
776      cputag_set_input_line(device->machine(), "maincpu", 0, ASSERT_LINE);
773777
774778   if (!namcoio_read_reset_line(namcoio_1))      /* give the cpu a tiny bit of time to write the command before processing it */
775779      device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(superpac_io_run));
r13476r13477
794798   }
795799}
796800
797static INTERRUPT_GEN( pacnpal_interrupt_1 )
801static INTERRUPT_GEN( pacnpal_main_vblank_irq )
798802{
803   mappy_state *state = device->machine().driver_data<mappy_state>();
799804   device_t *namcoio_1 = device->machine().device("namcoio_1");
800805   device_t *namcoio_2 = device->machine().device("namcoio_2");
801806
802   irq0_line_assert(device);   // this also checks if irq is enabled - IMPORTANT!
803                  // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
807   if (state->m_main_irq_mask)
808      cputag_set_input_line(device->machine(), "maincpu", 0, ASSERT_LINE);
804809
805810   if (!namcoio_read_reset_line(namcoio_1))      /* give the cpu a tiny bit of time to write the command before processing it */
806811      device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(pacnpal_io_run));
r13476r13477
825830   }
826831}
827832
828static INTERRUPT_GEN( phozon_interrupt_1 )
833static INTERRUPT_GEN( phozon_main_vblank_irq )
829834{
835   mappy_state *state = device->machine().driver_data<mappy_state>();
830836   device_t *namcoio_1 = device->machine().device("namcoio_1");
831837   device_t *namcoio_2 = device->machine().device("namcoio_2");
832838
833   irq0_line_assert(device);   // this also checks if irq is enabled - IMPORTANT!
834                  // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
839   if (state->m_main_irq_mask)
840      cputag_set_input_line(device->machine(), "maincpu", 0, ASSERT_LINE);
835841
836842   if (!namcoio_read_reset_line(namcoio_1))      /* give the cpu a tiny bit of time to write the command before processing it */
837843      device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(phozon_io_run));
r13476r13477
856862   }
857863}
858864
859static INTERRUPT_GEN( mappy_interrupt_1 )
865static INTERRUPT_GEN( mappy_main_vblank_irq )
860866{
867   mappy_state *state = device->machine().driver_data<mappy_state>();
861868   device_t *namcoio_1 = device->machine().device("namcoio_1");
862869   device_t *namcoio_2 = device->machine().device("namcoio_2");
863870
864   irq0_line_assert(device);   // this also checks if irq is enabled - IMPORTANT!
865                  // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
871   if(state->m_main_irq_mask)
872      cputag_set_input_line(device->machine(), "maincpu", 0, ASSERT_LINE);
866873
867874   if (!namcoio_read_reset_line(namcoio_1))      /* give the cpu a tiny bit of time to write the command before processing it */
868875      device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(mappy_io_run));
r13476r13477
871878      device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(mappy_io_run), 1);
872879}
873880
881static INTERRUPT_GEN( sub_vblank_irq )
882{
883   mappy_state *state = device->machine().driver_data<mappy_state>();
874884
885   if(state->m_sub_irq_mask)
886      cputag_set_input_line(device->machine(), "sub", 0, ASSERT_LINE);
887}
888
889static INTERRUPT_GEN( sub2_vblank_irq )
890{
891   mappy_state *state = device->machine().driver_data<mappy_state>();
892
893   if(state->m_sub2_irq_mask)
894      cputag_set_input_line(device->machine(), "sub2", 0, ASSERT_LINE);
895}
896
875897static ADDRESS_MAP_START( superpac_cpu1_map, AS_PROGRAM, 8 )
876898   AM_RANGE(0x0000, 0x07ff) AM_RAM_WRITE(superpac_videoram_w) AM_BASE_MEMBER(mappy_state,m_videoram)   /* video RAM */
877899   AM_RANGE(0x0800, 0x1fff) AM_RAM AM_BASE_MEMBER(mappy_state,m_spriteram)      /* work RAM with embedded sprite RAM */
r13476r13477
16071629   /* basic machine hardware */
16081630   MCFG_CPU_ADD("maincpu", M6809, PIXEL_CLOCK/4)   /* 1.536 MHz */
16091631   MCFG_CPU_PROGRAM_MAP(superpac_cpu1_map)
1610   MCFG_CPU_VBLANK_INT("screen", superpac_interrupt_1)   // also update the custom I/O chips
1632   MCFG_CPU_VBLANK_INT("screen", superpac_main_vblank_irq)   // also update the custom I/O chips
16111633
16121634   MCFG_CPU_ADD("sub", M6809, PIXEL_CLOCK/4)   /* 1.536 MHz */
16131635   MCFG_CPU_PROGRAM_MAP(superpac_cpu2_map)
1614   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
1636   MCFG_CPU_VBLANK_INT("screen", sub_vblank_irq)
16151637
16161638   MCFG_WATCHDOG_VBLANK_INIT(8)
16171639   MCFG_QUANTUM_TIME(attotime::from_hz(6000))    /* 100 CPU slices per frame - an high value to ensure proper */
r13476r13477
16451667
16461668   /* basic machine hardware */
16471669   MCFG_CPU_MODIFY("maincpu")
1648   MCFG_CPU_VBLANK_INT("screen", pacnpal_interrupt_1)   // also update the custom I/O chips
1670   MCFG_CPU_VBLANK_INT("screen", pacnpal_main_vblank_irq)   // also update the custom I/O chips
16491671
16501672   MCFG_DEVICE_REMOVE("namcoio_1")
16511673   MCFG_DEVICE_REMOVE("namcoio_2")
r13476r13477
16581680
16591681   /* basic machine hardware */
16601682   MCFG_CPU_MODIFY("maincpu")
1661   MCFG_CPU_VBLANK_INT("screen", phozon_interrupt_1)   // also update the custom I/O chips
1683   MCFG_CPU_VBLANK_INT("screen", phozon_main_vblank_irq)   // also update the custom I/O chips
16621684
16631685   MCFG_DEVICE_REMOVE("namcoio_1")
16641686   MCFG_DEVICE_REMOVE("namcoio_2")
r13476r13477
16761698   /* basic machine hardware */
16771699   MCFG_CPU_ADD("maincpu", M6809,   PIXEL_CLOCK/4)   /* MAIN CPU */
16781700   MCFG_CPU_PROGRAM_MAP(phozon_cpu1_map)
1679   MCFG_CPU_VBLANK_INT("screen", phozon_interrupt_1)   // also update the custom I/O chips
1701   MCFG_CPU_VBLANK_INT("screen", phozon_main_vblank_irq)   // also update the custom I/O chips
16801702
16811703   MCFG_CPU_ADD("sub", M6809,   PIXEL_CLOCK/4)   /* SOUND CPU */
16821704   MCFG_CPU_PROGRAM_MAP(phozon_cpu2_map)
1683   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
1705   MCFG_CPU_VBLANK_INT("screen", sub_vblank_irq)
16841706
16851707   MCFG_CPU_ADD("sub2", M6809,   PIXEL_CLOCK/4)   /* SUB CPU */
16861708   MCFG_CPU_PROGRAM_MAP(phozon_cpu3_map)
1687   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
1709   MCFG_CPU_VBLANK_INT("screen", sub2_vblank_irq)
16881710
16891711   MCFG_WATCHDOG_VBLANK_INIT(8)
16901712   MCFG_QUANTUM_TIME(attotime::from_hz(6000))    /* 100 CPU slices per frame - an high value to ensure proper */
r13476r13477
17201742   /* basic machine hardware */
17211743   MCFG_CPU_ADD("maincpu", M6809, PIXEL_CLOCK/4)   /* 1.536 MHz */
17221744   MCFG_CPU_PROGRAM_MAP(mappy_cpu1_map)
1723   MCFG_CPU_VBLANK_INT("screen", mappy_interrupt_1)   // also update the custom I/O chips
1745   MCFG_CPU_VBLANK_INT("screen", mappy_main_vblank_irq)   // also update the custom I/O chips
17241746
17251747   MCFG_CPU_ADD("sub", M6809, PIXEL_CLOCK/4)   /* 1.536 MHz */
17261748   MCFG_CPU_PROGRAM_MAP(mappy_cpu2_map)
1727   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
1749   MCFG_CPU_VBLANK_INT("screen", sub_vblank_irq)
17281750
17291751   MCFG_WATCHDOG_VBLANK_INIT(8)
17301752   MCFG_QUANTUM_TIME(attotime::from_hz(6000))    /* 100 CPU slices per frame - an high value to ensure proper */
r13476r13477
17581780
17591781   /* basic machine hardware */
17601782   MCFG_CPU_MODIFY("maincpu")
1761   MCFG_CPU_VBLANK_INT("screen", phozon_interrupt_1)   // also update the custom I/O chips
1783   MCFG_CPU_VBLANK_INT("screen", phozon_main_vblank_irq)   // also update the custom I/O chips
17621784
17631785   MCFG_WATCHDOG_VBLANK_INIT(0)
17641786
r13476r13477
17721794
17731795   /* basic machine hardware */
17741796   MCFG_CPU_MODIFY("maincpu")
1775   MCFG_CPU_VBLANK_INT("screen", phozon_interrupt_1)   // also update the custom I/O chips
1797   MCFG_CPU_VBLANK_INT("screen", phozon_main_vblank_irq)   // also update the custom I/O chips
17761798
17771799   MCFG_DEVICE_REMOVE("namcoio_1")
17781800   MCFG_DEVICE_REMOVE("namcoio_2")
r13476r13477
17881810
17891811   /* basic machine hardware */
17901812   MCFG_CPU_MODIFY("maincpu")
1791   MCFG_CPU_VBLANK_INT("screen", superpac_interrupt_1)   // also update the custom I/O chips
1813   MCFG_CPU_VBLANK_INT("screen", superpac_main_vblank_irq)   // also update the custom I/O chips
17921814
17931815   MCFG_DEVICE_REMOVE("namcoio_1")
17941816   MCFG_DEVICE_REMOVE("namcoio_2")
src/mame/drivers/hng64.c
r13476r13477
448448#include "machine/nvram.h"
449449#include "includes/hng64.h"
450450
451/* TODO: NOT measured! */
452#define PIXEL_CLOCK         ((MASTER_CLOCK*2)/4) // x 2 is due of the interlaced screen ...
451453
454#define HTOTAL            (0x200+0x100)
455#define HBEND            (0)
456#define HBSTART            (0x200)
452457
458#define VTOTAL            (264*2)
459#define VBEND            (0)
460#define VBSTART            (224*2)
453461
462
454463#ifdef UNUSED_FUNCTION
455464WRITE32_HANDLER( trap_write )
456465{
r13476r13477
931940      visarea.max_x = min_x + max_x - 1;
932941      visarea.min_y = min_y;
933942      visarea.max_y = min_y + max_y - 1;
934      space->machine().primary_screen->configure(0x200, 0x1c0, visarea, space->machine().primary_screen->frame_period().attoseconds );
943      space->machine().primary_screen->configure(HTOTAL, VTOTAL, visarea, space->machine().primary_screen->frame_period().attoseconds );
935944   }
936945}
937946
r13476r13477
16321641   16384            /* data cache size */
16331642};
16341643
1635static TIMER_CALLBACK( irq_stop )
1636{
1637   cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
1638}
16391644
1640static INTERRUPT_GEN( irq_start )
1645static TIMER_DEVICE_CALLBACK( hng64_irq )
16411646{
1642   hng64_state *state = device->machine().driver_data<hng64_state>();
1647   hng64_state *state = timer.machine().driver_data<hng64_state>();
1648   int scanline = param;
1649   int irq_fired,irq_type;
16431650
1644   logerror("HNG64 interrupt level %x\n", cpu_getiloops(device));
1651   irq_fired = irq_type = 0;
16451652
16461653   /* there are more, the sources are unknown at the moment */
1647   switch (cpu_getiloops(device))
1654   switch(scanline)
16481655   {
1649      case 0x00: state->m_interrupt_level_request = 0;
1650      break;
1651      case 0x01: state->m_interrupt_level_request = 1;
1652      break;
1653      case 0x02: state->m_interrupt_level_request = 2;
1654      break;
1655      case 0x03:
1656      if (state->m_mcu_type == RACING_MCU)
1657         state->m_interrupt_level_request = 11; //network irq
1658      else
1659         return;
1660      break;
1656      case 224*2:   state->m_interrupt_level_request = 0; irq_fired = 1; irq_type = 1; break;
1657      case 0*2: state->m_interrupt_level_request = 1; irq_fired = 1; irq_type = 1; break;
1658      case 64*2: state->m_interrupt_level_request = 2; irq_fired = 1; irq_type = 1; break;
1659      case 128*2:  state->m_interrupt_level_request = 11; irq_fired = 1; irq_type = 1; break;
1660      case (0+1)*2:
1661      case (224+1)*2:
1662      case (64+1)*2:
1663      case (128+1)*2:
1664         irq_fired = 1; irq_type = 0; break;
16611665   }
16621666
1663   device_set_input_line(device, 0, ASSERT_LINE);
1664   device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(irq_stop));
1667   if(irq_fired)
1668      device_set_input_line(state->m_maincpu, 0, (irq_type) ? ASSERT_LINE : CLEAR_LINE);
16651669}
16661670
16671671
r13476r13477
17211725   MCFG_CPU_ADD("maincpu", VR4300BE, MASTER_CLOCK)    // actually R4300
17221726   MCFG_CPU_CONFIG(vr4300_config)
17231727   MCFG_CPU_PROGRAM_MAP(hng_map)
1724   MCFG_CPU_VBLANK_INT_HACK(irq_start,4)
1728   MCFG_TIMER_ADD_SCANLINE("scantimer", hng64_irq, "screen", 0, 1)
17251729
17261730   MCFG_CPU_ADD("audiocpu", V33, 8000000)            // v53, 16? mhz!
17271731   MCFG_CPU_PROGRAM_MAP(hng_sound_map)
r13476r13477
17371741   MCFG_MACHINE_RESET(hyperneo)
17381742
17391743   MCFG_SCREEN_ADD("screen", RASTER)
1740   MCFG_SCREEN_REFRESH_RATE(60)
1741   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) //not accurate
1744   MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
17421745   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
1743   MCFG_SCREEN_SIZE(1024, 1024)
1744   MCFG_SCREEN_VISIBLE_AREA(0, 0x200-1, 0, 0x1c0-1)
17451746   MCFG_SCREEN_UPDATE(hng64)
17461747
17471748   MCFG_PALETTE_LENGTH(0x1000)
17481749
17491750   MCFG_VIDEO_START(hng64)
1751   MCFG_SCREEN_EOF(hng64)
17501752MACHINE_CONFIG_END
17511753
17521754
src/mame/drivers/saturn.c
r13476r13477
24632463   ROMX_LOAD("sega1003.bin", 0x00000000, 0x00080000, CRC(b3c63c25) SHA1(7b23b53d62de0f29a23e423d0fe751dfb469c2fa), ROM_BIOS(2))
24642464   ROM_SYSTEM_BIOS(2, "100", "Japan v1.00 (940921)")
24652465   ROMX_LOAD("sega_100.bin", 0x00000000, 0x00080000, CRC(2aba43c2) SHA1(2b8cb4f87580683eb4d760e4ed210813d667f0a2), ROM_BIOS(3))
2466//   ROM_CART_LOAD("cart", 0x080000, 0x400000, ROM_NOMIRROR | ROM_OPTIONAL)
2466//  ROM_CART_LOAD("cart", 0x080000, 0x400000, ROM_NOMIRROR | ROM_OPTIONAL)
24672467   ROM_REGION( 0x080000, "slave", 0 ) /* SH2 code */
24682468   ROM_COPY( "maincpu",0,0,0x080000)
24692469ROM_END
r13476r13477
24762476   ROMX_LOAD("mpr-17933.bin", 0x00000000, 0x00080000, CRC(4afcf0fa) SHA1(faa8ea183a6d7bbe5d4e03bb1332519800d3fbc3), ROM_BIOS(1))
24772477   ROM_SYSTEM_BIOS(1, "100a", "Overseas v1.00a (941115)")
24782478   ROMX_LOAD("sega_100a.bin", 0x00000000, 0x00080000, CRC(f90f0089) SHA1(3bb41feb82838ab9a35601ac666de5aacfd17a58), ROM_BIOS(2))
2479//   ROM_CART_LOAD("cart", 0x080000, 0x400000, ROM_NOMIRROR | ROM_OPTIONAL)
2479//  ROM_CART_LOAD("cart", 0x080000, 0x400000, ROM_NOMIRROR | ROM_OPTIONAL)
24802480   ROM_REGION( 0x080000, "slave", 0 ) /* SH2 code */
24812481   ROM_COPY( "maincpu",0,0,0x080000)
24822482ROM_END
r13476r13477
24882488   ROMX_LOAD("mpr-17933.bin", 0x00000000, 0x00080000, CRC(4afcf0fa) SHA1(faa8ea183a6d7bbe5d4e03bb1332519800d3fbc3), ROM_BIOS(1))
24892489   ROM_SYSTEM_BIOS(1, "100a", "Overseas v1.00a (941115)")
24902490   ROMX_LOAD("sega_100a.bin", 0x00000000, 0x00080000, CRC(f90f0089) SHA1(3bb41feb82838ab9a35601ac666de5aacfd17a58), ROM_BIOS(2))
2491//   ROM_CART_LOAD("cart", 0x080000, 0x400000, ROM_NOMIRROR | ROM_OPTIONAL)
2491//  ROM_CART_LOAD("cart", 0x080000, 0x400000, ROM_NOMIRROR | ROM_OPTIONAL)
24922492   ROM_REGION( 0x080000, "slave", 0 ) /* SH2 code */
24932493   ROM_COPY( "maincpu",0,0,0x080000)
24942494ROM_END
r13476r13477
24962496ROM_START(vsaturn)
24972497   ROM_REGION( 0x480000, "maincpu", ROMREGION_ERASEFF ) /* SH2 code */
24982498   ROM_LOAD("vsaturn.bin", 0x00000000, 0x00080000, CRC(e4d61811) SHA1(4154e11959f3d5639b11d7902b3a393a99fb5776))
2499//   ROM_CART_LOAD("cart", 0x080000, 0x400000, ROM_NOMIRROR | ROM_OPTIONAL)
2499//  ROM_CART_LOAD("cart", 0x080000, 0x400000, ROM_NOMIRROR | ROM_OPTIONAL)
25002500   ROM_REGION( 0x080000, "slave", 0 ) /* SH2 code */
25012501   ROM_COPY( "maincpu",0,0,0x080000)
25022502ROM_END
r13476r13477
25042504ROM_START(hisaturn)
25052505   ROM_REGION( 0x480000, "maincpu", ROMREGION_ERASEFF ) /* SH2 code */
25062506   ROM_LOAD("hisaturn.bin", 0x00000000, 0x00080000, CRC(721e1b60) SHA1(49d8493008fa715ca0c94d99817a5439d6f2c796))
2507//   ROM_CART_LOAD("cart", 0x080000, 0x400000, ROM_NOMIRROR | ROM_OPTIONAL)
2507//  ROM_CART_LOAD("cart", 0x080000, 0x400000, ROM_NOMIRROR | ROM_OPTIONAL)
25082508   ROM_REGION( 0x080000, "slave", 0 ) /* SH2 code */
25092509   ROM_COPY( "maincpu",0,0,0x080000)
25102510ROM_END
src/mame/drivers/champbas.c
r13476r13477
127127static WRITE8_HANDLER( irq_enable_w )
128128{
129129   champbas_state *state = space->machine().driver_data<champbas_state>();
130   int bit = data & 1;
131130
132   cpu_interrupt_enable(state->m_maincpu, bit);
133   if (!bit)
131   state->m_irq_mask = data & 1;
132
133   if (!state->m_irq_mask)
134134      device_set_input_line(state->m_maincpu, 0, CLEAR_LINE);
135135}
136136
r13476r13477
596596   state->m_gfx_bank = 0;   // talbot has only 1 bank
597597}
598598
599static INTERRUPT_GEN( vblank_irq )
600{
601   champbas_state *state = device->machine().driver_data<champbas_state>();
599602
603   if(state->m_irq_mask)
604      device_set_input_line(device, 0, ASSERT_LINE);
605}
606
607
600608static MACHINE_CONFIG_START( talbot, champbas_state )
601609
602610   /* basic machine hardware */
603611   MCFG_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/6)
604612   MCFG_CPU_PROGRAM_MAP(talbot_map)
605   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
613   MCFG_CPU_VBLANK_INT("screen", vblank_irq)
606614
607615   /* MCU */
608616   MCFG_CPU_ADD(CPUTAG_MCU, ALPHA8201, XTAL_18_432MHz/6/8)
r13476r13477
639647   /* main cpu */
640648   MCFG_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/6)
641649   MCFG_CPU_PROGRAM_MAP(champbas_main_map)
642   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
650   MCFG_CPU_VBLANK_INT("screen", vblank_irq)
643651
644652   MCFG_CPU_ADD("sub", Z80, XTAL_18_432MHz/6)
645653   MCFG_CPU_PROGRAM_MAP(champbas_sub_map)
r13476r13477
691699   /* basic machine hardware */
692700   MCFG_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/6 )
693701   MCFG_CPU_PROGRAM_MAP(exctsccr_main_map)
694   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
702   MCFG_CPU_VBLANK_INT("screen", vblank_irq)
695703
696704   MCFG_CPU_ADD("audiocpu", Z80, XTAL_14_31818MHz/4 )
697705   MCFG_CPU_PROGRAM_MAP(exctsccr_sub_map)
r13476r13477
749757   /* basic machine hardware */
750758   MCFG_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/6)
751759   MCFG_CPU_PROGRAM_MAP(exctsccrb_main_map)
752   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
760   MCFG_CPU_VBLANK_INT("screen", vblank_irq)
753761
754762   MCFG_CPU_ADD("sub", Z80, XTAL_18_432MHz/6)
755763   MCFG_CPU_PROGRAM_MAP(champbas_sub_map)
src/mame/drivers/pacman.c
r13476r13477
917917//  AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0xa000) AM_READ(pacman_read_nop) AM_WRITENOP
918918   AM_RANGE(0x4c00, 0x4fef) AM_MIRROR(0xa000) AM_RAM
919919   AM_RANGE(0x4ff0, 0x4fff) AM_MIRROR(0xa000) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
920    AM_RANGE(0x5001, 0x5001) AM_MIRROR(0xaf38) AM_WRITE(irq_mask_w)
921//    AM_RANGE(0x5001, 0x5001) AM_MIRROR(0xaf38) AM_DEVWRITE("namco", pacman_sound_enable_w)
920   AM_RANGE(0x5001, 0x5001) AM_MIRROR(0xaf38) AM_WRITE(irq_mask_w)
921//  AM_RANGE(0x5001, 0x5001) AM_MIRROR(0xaf38) AM_DEVWRITE("namco", pacman_sound_enable_w)
922922//  AM_RANGE(0x5002, 0x5002) AM_MIRROR(0xaf38) AM_WRITENOP
923923   AM_RANGE(0x5003, 0x5003) AM_MIRROR(0xaf38) AM_WRITE(pacman_flipscreen_w)
924924//  AM_RANGE(0x5004, 0x5005) AM_MIRROR(0xaf38) AM_WRITENOP // AM_WRITE(pacman_leds_w)
src/emu/cpu/i386/i386ops.h
r13476r13477
348348   { 0xAB,      OP_2BYTE|OP_I386,         I386OP(bts_rm16_r16),         I386OP(bts_rm32_r32),      },
349349   { 0xAC,      OP_2BYTE|OP_I386,         I386OP(shrd16_i8),            I386OP(shrd32_i8),         },
350350   { 0xAD,      OP_2BYTE|OP_I386,         I386OP(shrd16_cl),            I386OP(shrd32_cl),         },
351   { 0xAE,      OP_2BYTE|OP_I386,         I386OP(invalid),            I386OP(invalid),         },
351   { 0xAE,      OP_2BYTE|OP_PENTIUM,      PENTIUMOP(sse_group0fae),      PENTIUMOP(sse_group0fae),   },
352352   { 0xAF,      OP_2BYTE|OP_I386,         I386OP(imul_r16_rm16),         I386OP(imul_r32_rm32),      },
353353   { 0xB0,      OP_2BYTE|OP_I486,         I486OP(cmpxchg_rm8_r8),         I486OP(cmpxchg_rm8_r8),      },
354354   { 0xB1,      OP_2BYTE|OP_I486,         I486OP(cmpxchg_rm16_r16),      I486OP(cmpxchg_rm32_r32),   },
src/emu/cpu/i386/pentops.c
r13476r13477
5050   }
5151}
5252
53static void PENTIUMOP(sse_group0fae)(i386_state *cpustate)   // Opcode 0x0f ae
54{
55   UINT8 modm = FETCH(cpustate);
56   if( modm == 0xf8 ) {
57      CYCLES(cpustate,1); // sfence instruction
58   } else {
59      fatalerror("pentium: bad/unsupported 0f ae opcode");
60   }
61}
5362
src/emu/cpu/i386/x87ops.c
r13476r13477
3030#define FPU_EXCEPTION_DENORMAL_OP   0x0002
3131#define FPU_EXCEPTION_INVALID_OP   0x0001
3232
33
34/* return the 32 bit representation of value seen as a single precision floating point number */
35INLINE UINT32 FPU_SINGLE_INT32(X87_REG value)
36{
37   float fs=(float)value.f;
38   UINT32 v;
39
40   v=*((UINT32 *)(&fs));
41   return v;
42}
43
3344INLINE void FPU_PUSH(i386_state *cpustate, X87_REG value)
3445{
3546   cpustate->fpu_top--;
r13476r13477
90101
91102      switch ((modrm >> 3) & 0x7)
92103      {
104         case 3:         // FSTP
105         {
106            // st(0) -> ea
107            WRITE32(cpustate,ea,FPU_SINGLE_INT32(ST(0)));
108            FPU_POP(cpustate);
109            CYCLES(cpustate,1);      // TODO
110            break;
111         }
112
93113         case 5:         // FLDCW
94114         {
95115            cpustate->fpu_control_word = READ16(cpustate,ea);
r13476r13477
176196
177197   if (modrm < 0xc0)
178198   {
179      fatalerror("I386: FPU Op DB %02X at %08X", modrm, cpustate->pc-2);
199      UINT32 ea = GetEA(cpustate,modrm);
200
201      switch ((modrm >> 3) & 0x7)
202      {
203         case 0:      // FILD
204         {
205            X87_REG t;
206
207            t.f=(INT32)READ32(cpustate,ea);
208            FPU_PUSH(cpustate,t);
209            CYCLES(cpustate,1);      // TODO
210            break;
211         }
212
213         default:
214            fatalerror("I386: FPU Op DB %02X at %08X", modrm, cpustate->pc-2);
215      }
180216   }
181217   else
182218   {
src/emu/video/h63484.c
r13476r13477
44
55    TODO:
66    - 8-bit support for FIFO, parameters and command values
7    - convert to C++
87    - execution cycles;
98
109***************************************************************************/
src/emu/video/ramdac.c
r0r13477
1/***************************************************************************
2
3    Generic Palette RAMDAC device
4
5    Written by Angelo Salese
6
7    TODO:
8    - masking register
9
10***************************************************************************/
11
12#include "emu.h"
13#include "video/ramdac.h"
14
15// default address map
16static ADDRESS_MAP_START( ramdac_palram, AS_0, 8 )
17   AM_RANGE(0x000, 0x0ff) AM_RAM // R bank
18   AM_RANGE(0x100, 0x1ff) AM_RAM // G bank
19   AM_RANGE(0x200, 0x2ff) AM_RAM // B bank
20   AM_RANGE(0x300, 0x3ff) AM_NOP
21ADDRESS_MAP_END
22
23//**************************************************************************
24//  GLOBAL VARIABLES
25//**************************************************************************
26
27// device type definition
28const device_type RAMDAC = &device_creator<ramdac_device>;
29
30
31//**************************************************************************
32//  LIVE DEVICE
33//**************************************************************************
34
35//-------------------------------------------------
36//  ramdac_device - constructor
37//-------------------------------------------------
38
39ramdac_device::ramdac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
40   : device_t(mconfig, RAMDAC, "ramdac", tag, owner, clock),
41     device_memory_interface(mconfig, *this),
42      m_space_config("videoram", ENDIANNESS_LITTLE, 8, 10, 0, NULL, *ADDRESS_MAP_NAME(ramdac_palram))
43{
44
45}
46
47//-------------------------------------------------
48//  memory_space_config - return a description of
49//  any address spaces owned by this device
50//-------------------------------------------------
51
52const address_space_config *ramdac_device::memory_space_config(address_spacenum spacenum) const
53{
54   return (spacenum == AS_0) ? &m_space_config : NULL;
55}
56
57//-------------------------------------------------
58//  readbyte - read a byte at the given address
59//-------------------------------------------------
60
61inline UINT8 ramdac_device::readbyte(offs_t address)
62{
63   return space()->read_byte(address);
64}
65
66
67//-------------------------------------------------
68//  writebyte - write a byte at the given address
69//-------------------------------------------------
70
71inline void ramdac_device::writebyte(offs_t address, UINT8 data)
72{
73   space()->write_byte(address, data);
74}
75
76//-------------------------------------------------
77//  device_config_complete - perform any
78//  operations now that the configuration is
79//  complete
80//-------------------------------------------------
81
82void ramdac_device::device_config_complete()
83{
84   // inherit a copy of the static data
85   const ramdac_interface *intf = reinterpret_cast<const ramdac_interface *>(static_config());
86   if (intf != NULL)
87      *static_cast<ramdac_interface *>(this) = *intf;
88
89   // or initialize to defaults if none provided
90   else
91   {
92      // ...
93   }
94}
95
96
97//-------------------------------------------------
98//  device_validity_check - perform validity checks
99//  on this device
100//-------------------------------------------------
101
102bool ramdac_device::device_validity_check(emu_options &options, const game_driver &driver) const
103{
104   bool error = false;
105   return error;
106}
107
108//-------------------------------------------------
109//  device_start - device-specific startup
110//-------------------------------------------------
111
112void ramdac_device::device_start()
113{
114   m_palram = auto_alloc_array_clear(machine(), UINT8, 1 << 10);
115
116}
117
118
119//-------------------------------------------------
120//  device_reset - device-specific reset
121//-------------------------------------------------
122
123void ramdac_device::device_reset()
124{
125   m_pal_index[0] = 0;
126   m_int_index[0] = 0;
127   m_pal_index[1] = 0;
128   m_int_index[1] = 0;
129   m_pal_mask = 0xff;
130}
131
132
133//**************************************************************************
134//  READ/WRITE HANDLERS
135//  [0] = W register, [1] = R register
136//**************************************************************************
137
138inline void ramdac_device::reg_increment(UINT8 inc_type)
139{
140   m_int_index[inc_type]++;
141   if(m_int_index[inc_type] == 3)
142   {
143      m_int_index[inc_type] = 0;
144      m_pal_index[inc_type]++;
145   }
146}
147
148READ8_MEMBER( ramdac_device::index_r )
149{
150   return m_pal_index[0];
151}
152
153WRITE8_MEMBER( ramdac_device::index_w )
154{
155   m_pal_index[0] = data;
156   m_int_index[0] = 0;
157}
158
159WRITE8_MEMBER( ramdac_device::index_r_w )
160{
161   m_pal_index[1] = data;
162   m_int_index[1] = 0;
163}
164
165READ8_MEMBER( ramdac_device::pal_r )
166{
167   UINT8 res;
168   res = readbyte(m_pal_index[m_split_read_reg] | (m_int_index[m_split_read_reg] << 8));
169   reg_increment(m_split_read_reg);
170   return res;
171}
172
173WRITE8_MEMBER( ramdac_device::pal_w )
174{
175   writebyte(m_pal_index[0] | (m_int_index[0] << 8),data);
176   reg_increment(0);
177}
178
179WRITE8_MEMBER( ramdac_device::mask_w )
180{
181   m_pal_mask = data;
182}
183
184
185//**************************************************************************
186//  Generic bank read/write handlers
187//**************************************************************************
188
189READ8_MEMBER( ramdac_device::ramdac_pal_r )
190{
191   return m_palram[offset];
192}
193
194WRITE8_MEMBER( ramdac_device::ramdac_rgb666_w )
195{
196   UINT16 pal_offs;
197
198   m_palram[offset] = data & 0x3f;
199   pal_offs = (offset & 0xff);
200
201   palette_set_color_rgb(machine(),offset&0xff,pal6bit(m_palram[pal_offs|0x000]),pal6bit(m_palram[pal_offs|0x100]),pal6bit(m_palram[pal_offs|0x200]));
202}
203
204WRITE8_MEMBER( ramdac_device::ramdac_rgb888_w )
205{
206   UINT16 pal_offs;
207
208   m_palram[offset] = data;
209   pal_offs = (offset & 0xff);
210
211   palette_set_color_rgb(machine(),offset&0xff,m_palram[pal_offs|0x000],m_palram[pal_offs|0x100],m_palram[pal_offs|0x200]);
212}
213
src/emu/video/ramdac.h
r0r13477
1/***************************************************************************
2
3    Generic Palette RAMDAC device
4
5***************************************************************************/
6
7#pragma once
8
9#ifndef __ramdacDEV_H__
10#define __ramdacDEV_H__
11
12#include "emu.h"
13
14
15//**************************************************************************
16//  INTERFACE CONFIGURATION MACROS
17//**************************************************************************
18
19#define MCFG_RAMDAC_ADD(_tag,_config,_map) \
20   MCFG_DEVICE_ADD(_tag, RAMDAC, 0) \
21   MCFG_DEVICE_CONFIG(_config) \
22   MCFG_DEVICE_ADDRESS_MAP(AS_0, _map)
23
24#define RAMDAC_INTERFACE(name) \
25   const ramdac_interface (name) =
26
27// ======================> ramdac_interface
28
29struct ramdac_interface
30{
31   UINT8 m_split_read_reg; // read register index is separated, seen in rltennis
32};
33
34//**************************************************************************
35//  TYPE DEFINITIONS
36//**************************************************************************
37
38// ======================> ramdac_device
39
40class ramdac_device :   public device_t,
41                  public device_memory_interface,
42                  public ramdac_interface
43{
44public:
45   // construction/destruction
46   ramdac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
47
48   // I/O operations
49   DECLARE_READ8_MEMBER( index_r );
50   DECLARE_READ8_MEMBER( pal_r );
51   DECLARE_WRITE8_MEMBER( index_w );
52   DECLARE_WRITE8_MEMBER( index_r_w );
53   DECLARE_WRITE8_MEMBER( pal_w );
54   DECLARE_WRITE8_MEMBER( mask_w );
55
56   DECLARE_READ8_MEMBER( ramdac_pal_r );
57   DECLARE_WRITE8_MEMBER( ramdac_rgb666_w );
58   DECLARE_WRITE8_MEMBER( ramdac_rgb888_w );
59
60   virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
61
62protected:
63   // device-level overrides
64   virtual bool device_validity_check(emu_options &options, const game_driver &driver) const;
65   virtual void device_start();
66   virtual void device_reset();
67   virtual void device_config_complete();
68   inline UINT8 readbyte(offs_t address);
69   inline void writebyte(offs_t address, UINT8 data);
70   inline void reg_increment(UINT8 inc_type);
71
72private:
73   UINT8 m_pal_index[2];
74   UINT8 m_pal_mask;
75   UINT8 m_int_index[2];
76   UINT8 *m_palram;
77
78   const address_space_config      m_space_config;
79};
80
81
82// device type definition
83extern const device_type RAMDAC;
84
85
86
87//**************************************************************************
88//  GLOBAL VARIABLES
89//**************************************************************************
90
91
92
93#endif
src/emu/schedule.c
r13476r13477
341341   m_executing_device(NULL),
342342   m_execute_list(NULL),
343343   m_basetime(attotime::zero),
344//   m_cothread(co_active()),
344//  m_cothread(co_active()),
345345   m_timer_list(NULL),
346346   m_timer_allocator(machine.respool()),
347347   m_callback_timer(NULL),
src/emu/schedule.h
r13476r13477
165165   void abort_timeslice();
166166   void trigger(int trigid, attotime after = attotime::zero);
167167   void boost_interleave(attotime timeslice_time, attotime boost_duration);
168//   void make_active() { m_cothread.make_active(); }
168//  void make_active() { m_cothread.make_active(); }
169169
170170   // timers, specified by callback/name
171171   emu_timer *timer_alloc(timer_expired_delegate callback, void *ptr = NULL);
r13476r13477
210210   device_execute_interface *   m_executing_device;         // pointer to currently executing device
211211   device_execute_interface *   m_execute_list;            // list of devices to be executed
212212   attotime               m_basetime;               // global basetime; everything moves forward from here
213//   cothread               m_cothread;               // core scheduler thread
213//  cothread                    m_cothread;                 // core scheduler thread
214214
215215   // list of active timers
216216   emu_timer *               m_timer_list;            // head of the active list
src/emu/softlist.c
r13476r13477
385385               else if ( !strcmp( attributes[0], "supported" ) )
386386               {
387387                  supported = attributes[1];
388               }
388               }
389389               else
390390                  unknown_attribute(swlist, attributes[0]);
391391            }
r13476r13477
538538
539539               else if ( !strcmp( attributes[0], "interface" ) )
540540                  str_interface = attributes[1];
541                 
542               else
543                  unknown_attribute(swlist, attributes[0]);               
541
542               else
543                  unknown_attribute(swlist, attributes[0]);
544544            }
545545
546546            if ( str_name && str_interface )
r13476r13477
593593
594594               else if ( !strcmp( attributes[0], "size") )
595595                  str_size = attributes[1];
596               
597               else
598                  unknown_attribute(swlist, attributes[0]);               
596
597               else
598                  unknown_attribute(swlist, attributes[0]);
599599            }
600600            if ( str_name && str_size )
601601            {
r13476r13477
629629               if ( !strcmp( attributes[0], "name" ) )
630630                  str_name = attributes[1];
631631               else
632                  unknown_attribute(swlist, attributes[0]);           
632                  unknown_attribute(swlist, attributes[0]);
633633            }
634634            if ( str_name )
635635            {
r13476r13477
665665
666666               else if ( !strcmp( attributes[0], "value" ) )
667667                  str_feature_value = attributes[1];
668               
668
669669               else
670                  unknown_attribute(swlist, attributes[0]);                           
670                  unknown_attribute(swlist, attributes[0]);
671671            }
672672
673673            /* Prepare for adding feature to feature list */
r13476r13477
733733               else if ( !strcmp( attributes[0], "status" ) )
734734                  str_status = attributes[1];
735735               else if ( !strcmp( attributes[0], "loadflag" ) )
736                  str_loadflag = attributes[1];                 
736                  str_loadflag = attributes[1];
737737               else
738                  unknown_attribute(swlist, attributes[0]);                           
738                  unknown_attribute(swlist, attributes[0]);
739739            }
740740            if ( swlist->softinfo )
741741            {
r13476r13477
822822                  parse_error(&swlist->state, "%s: Incomplete rom definition (line %lu)\n",
823823                     swlist->file->filename(),XML_GetCurrentLineNumber(swlist->state.parser));
824824               }
825            }
825            }
826826         }
827827         else
828828         if (!strcmp(tagname, "disk"))
r13476r13477
843843               else if ( !strcmp( attributes[0], "writeable" ) )
844844                  str_writeable = attributes[1];
845845               else
846                  unknown_attribute(swlist, attributes[0]);                           
846                  unknown_attribute(swlist, attributes[0]);
847847            }
848848            if ( swlist->softinfo )
849849            {
r13476r13477
870870         }
871871         else if (!strcmp(tagname, "dipvalue"))
872872         {
873         }         
873         }
874874         else
875875            unknown_tag(swlist, tagname);
876876         break;
r13476r13477
18111811                  {
18121812                     lists[list_count++] = swlist->list_name[i];
18131813                     software_list_parse( list, &validate_error_proc, NULL );
1814                     
1814
18151815                     for (software_info *swinfo = software_list_find(list, "*", NULL); swinfo != NULL; swinfo = software_list_find(list, "*", swinfo))
18161816                     {
18171817                        const char *s;
r13476r13477
19481948                     }
19491949                  }
19501950                  software_list_close(list);
1951               }               
1951               }
19521952            }
19531953         }
19541954      }
src/emu/emu.mak
r13476r13477
278278   $(EMUVIDEO)/pc_vga.o      \
279279   $(EMUVIDEO)/poly.o      \
280280   $(EMUVIDEO)/psx.o      \
281   $(EMUVIDEO)/ramdac.o      \
281282   $(EMUVIDEO)/resnet.o      \
282283   $(EMUVIDEO)/rgbutil.o      \
283284   $(EMUVIDEO)/s2636.o      \
src/emu/machine/generic.c
r13476r13477
586586
587587
588588/*-------------------------------------------------
589    clear_all_lines - sets the state of all input
590    lines and the NMI line to clear
591-------------------------------------------------*/
592
593static TIMER_CALLBACK( clear_all_lines )
594{
595   cpu_device *cpudevice = reinterpret_cast<cpu_device *>(ptr);
596
597   // clear NMI
598   cpudevice->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
599
600   // clear all other inputs
601   int inputcount = cpudevice->input_lines();
602   for (int line = 0; line < inputcount; line++)
603      cpudevice->set_input_line(line, CLEAR_LINE);
604}
605
606
607/*-------------------------------------------------
608589    irq_pulse_clear - clear a "pulsed" IRQ line
609590-------------------------------------------------*/
610591
r13476r13477
650631}
651632
652633
653/*-------------------------------------------------
654    cpu_interrupt_enable - controls the enable/
655    disable value for global interrupts
656-------------------------------------------------*/
657634
658void cpu_interrupt_enable(device_t *device, int enabled)
659{
660   cpu_device *cpudevice = downcast<cpu_device *>(device);
661
662   generic_machine_private *state = device->machine().generic_machine_data;
663   int index;
664   for (index = 0; index < ARRAY_LENGTH(state->interrupt_device); index++)
665      if (state->interrupt_device[index] == device)
666         break;
667   assert_always(index < ARRAY_LENGTH(state->interrupt_enable), "cpu_interrupt_enable() called for invalid CPU!");
668
669   /* set the new state */
670   if (index < ARRAY_LENGTH(state->interrupt_enable))
671      state->interrupt_enable[index] = enabled;
672
673   /* make sure there are no queued interrupts */
674   if (enabled == 0)
675      device->machine().scheduler().synchronize(FUNC(clear_all_lines), 0, (void *)cpudevice);
676}
677
678
679
680635/***************************************************************************
681636    INTERRUPT GENERATION CALLBACK HELPERS
682637***************************************************************************/
src/emu/machine/generic.h
r13476r13477
108108
109109void generic_pulse_irq_line(device_t *device, int irqline);
110110void generic_pulse_irq_line_and_vector(device_t *device, int irqline, int vector);
111void cpu_interrupt_enable(device_t *device, int enabled);
112111
113112
114113
src/emu/machine/v3021.c
r13476r13477
2828//**************************************************************************
2929
3030//-------------------------------------------------
31//  rtc9701_device - constructor
31//  v3021_device - constructor
3232//-------------------------------------------------
3333
3434v3021_device::v3021_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
src/emu/machine/v3021.h
r13476r13477
1010
1111#pragma once
1212
13#ifndef __rtc9701DEV_H__
14#define __rtc9701DEV_H__
13#ifndef __v3021DEV_H__
14#define __v3021DEV_H__
1515
1616
1717
src/emu/diexec.c
r13476r13477
7373
7474device_execute_interface::device_execute_interface(const machine_config &mconfig, device_t &device)
7575   : device_interface(device),
76//     m_cothread(cothread_entry_delegate(FUNC(device_execute_interface::run_thread_wrapper), this)),
76//    m_cothread(cothread_entry_delegate(FUNC(device_execute_interface::run_thread_wrapper), this)),
7777     m_disabled(false),
7878     m_vblank_interrupt(NULL),
7979     m_vblank_interrupts_per_frame(0),
r13476r13477
380380/*
381381void device_execute_interface::run_thread_wrapper()
382382{
383   // loop infinitely
384   device_scheduler &scheduler = device().machine().scheduler();
385   while (1)
383    // loop infinitely
384    device_scheduler &scheduler = device().machine().scheduler();
385    while (1)
386386    {
387       // call the classic run function, then swap back to the scheduler's thread
388       execute_run();
387        // call the classic run function, then swap back to the scheduler's thread
388        execute_run();
389389        scheduler.make_active();
390390    }
391391}
src/emu/diexec.h
r13476r13477
205205
206206   // required operation overrides
207207//#if USE_COTHREADS
208//   void run() { m_cothread.make_active(); }
208//  void run() { m_cothread.make_active(); }
209209//#else
210210   void run() { execute_run(); }
211211//#endif
r13476r13477
272272   };
273273
274274   // internal state
275//   cothread            m_cothread;               // thread used for execution
275//  cothread                m_cothread;                 // thread used for execution
276276
277277   // configuration
278278   bool               m_disabled;               // disabled from executing?
src/lib/formats/ap2_dsk.c
r13476r13477
139139
140140   if (size == expected_size)
141141      *vote = 100;
142   else if (abs(size - expected_size) < 8)
142   else if ((size > expected_size) && ((size - expected_size) < 8))
143143      *vote = 90;      /* tolerate images with up to eight fewer/extra bytes (bug #638) */
144   else if ((size < expected_size) && ((expected_size - size) < 8))
145      *vote = 90;      /* tolerate images with up to eight fewer/extra bytes (bug #638) */
144146   else
145147      *vote = 0;
146148   return FLOPPY_ERROR_SUCCESS;
src/version.c
r13476r13477
3838***************************************************************************/
3939
4040extern const char build_version[];
41const char build_version[] = "0.144u1 ("__DATE__")";
41const char build_version[] = "0.144u2 ("__DATE__")";

Previous 15994 Revisions Next


© 1998-2018 The MESS Team