Previous 199869 Revisions Next

r34661 Tuesday 27th January, 2015 at 15:55:57 UTC by Alex W. Jackson
Remove more trampolines (nw)
[src/mame/drivers]midtunit.c stadhero.c
[src/mame/includes]midtunit.h stadhero.h
[src/mame/machine]midtunit.c

trunk/src/mame/drivers/midtunit.c
r243172r243173
4343   AM_RANGE(0x01000000, 0x013fffff) AM_RAM
4444   AM_RANGE(0x01400000, 0x0141ffff) AM_READWRITE(midtunit_cmos_r, midtunit_cmos_w) AM_SHARE("nvram")
4545   AM_RANGE(0x01480000, 0x014fffff) AM_WRITE(midtunit_cmos_enable_w)
46   AM_RANGE(0x01600000, 0x0160003f) AM_READ(midtunit_input_r)
46   AM_RANGE(0x01600000, 0x0160000f) AM_READ_PORT("IN0")
47   AM_RANGE(0x01600010, 0x0160001f) AM_READ_PORT("IN1")
48   AM_RANGE(0x01600020, 0x0160002f) AM_READ_PORT("IN2")
49   AM_RANGE(0x01600030, 0x0160003f) AM_READ_PORT("DSW")
4750   AM_RANGE(0x01800000, 0x0187ffff) AM_RAM_WRITE(midtunit_paletteram_w) AM_SHARE("paletteram")
4851   AM_RANGE(0x01a80000, 0x01a800ff) AM_READWRITE(midtunit_dma_r, midtunit_dma_w)
4952   AM_RANGE(0x01b00000, 0x01b0001f) AM_WRITE(midtunit_control_w)
trunk/src/mame/drivers/stadhero.c
r243172r243173
3030
3131/******************************************************************************/
3232
33READ16_MEMBER(stadhero_state::stadhero_control_r)
34{
35   switch (offset<<1)
36   {
37      case 0:
38         return m_inputs->read();
39
40      case 2:
41         return m_coin->read();
42
43      case 4:
44         return m_dsw->read();
45   }
46
47   logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n",space.device().safe_pc(),0x30c000+offset);
48   return ~0;
49}
50
5133WRITE16_MEMBER(stadhero_state::stadhero_control_w)
5234{
5335   switch (offset<<1)
r243172r243173
7355   AM_RANGE(0x240000, 0x240007) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control_0_w)                          /* text layer */
7456   AM_RANGE(0x240010, 0x240017) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control_1_w)
7557   AM_RANGE(0x260000, 0x261fff) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_data_r, pf_data_w)
76   AM_RANGE(0x30c000, 0x30c00b) AM_READWRITE(stadhero_control_r, stadhero_control_w)
58   AM_RANGE(0x30c000, 0x30c001) AM_READ_PORT("INPUTS")
59   AM_RANGE(0x30c002, 0x30c003) AM_READ_PORT("COIN")
60   AM_RANGE(0x30c004, 0x30c005) AM_READ_PORT("DSW")
61   AM_RANGE(0x30c000, 0x30c00b) AM_WRITE(stadhero_control_w)
7762   AM_RANGE(0x310000, 0x3107ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
7863   AM_RANGE(0xff8000, 0xffbfff) AM_RAM /* Main ram */
7964   AM_RANGE(0xffc000, 0xffc7ff) AM_MIRROR(0x000800) AM_RAM AM_SHARE("spriteram")
r243172r243173
210195
211196/******************************************************************************/
212197
213WRITE_LINE_MEMBER(stadhero_state::irqhandler)
214{
215   m_audiocpu->set_input_line(0, state);
216}
217
218/******************************************************************************/
219
220198static MACHINE_CONFIG_START( stadhero, stadhero_state )
221199
222200   /* basic machine hardware */
r243172r243173
260238   MCFG_SOUND_ROUTE(3, "mono", 0.40)
261239
262240   MCFG_SOUND_ADD("ym2", YM3812, XTAL_24MHz/8)
263   MCFG_YM3812_IRQ_HANDLER(WRITELINE(stadhero_state, irqhandler))
241   MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", M6502_IRQ_LINE))
264242   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
265243
266244   MCFG_OKIM6295_ADD("oki", XTAL_1_056MHz, OKIM6295_PIN7_HIGH)
trunk/src/mame/includes/midtunit.h
r243172r243173
2424      m_adpcm_sound(*this, "adpcm") ,
2525      m_generic_paletteram_16(*this, "paletteram"),
2626      m_nvram(*this, "nvram"),
27      m_gfxrom(*this, "gfxrom"),
28      m_ports(*this, tunit_ports) { }
27      m_gfxrom(*this, "gfxrom") { }
2928
3029   required_device<cpu_device> m_maincpu;
3130   required_device<palette_device> m_palette;
r243172r243173
3837
3938   required_memory_region m_gfxrom;
4039
41   required_ioport_array<4> m_ports;
42   DECLARE_IOPORT_ARRAY(tunit_ports);
43
4440   DECLARE_WRITE16_MEMBER(midtunit_cmos_enable_w);
4541   DECLARE_WRITE16_MEMBER(midtunit_cmos_w);
4642   DECLARE_READ16_MEMBER(midtunit_cmos_r);
trunk/src/mame/includes/stadhero.h
r243172r243173
1212      m_spritegen(*this, "spritegen"),
1313      m_gfxdecode(*this, "gfxdecode"),
1414      m_spriteram(*this, "spriteram"),
15      m_pf1_data(*this, "pf1_data"),
16      m_inputs(*this, "INPUTS"),
17      m_coin(*this, "COIN"),
18      m_dsw(*this, "DSW") { }
15      m_pf1_data(*this, "pf1_data") { }
1916
2017   required_device<cpu_device> m_maincpu;
2118   required_device<cpu_device> m_audiocpu;
r243172r243173
2522   
2623   required_shared_ptr<UINT16> m_spriteram;
2724   required_shared_ptr<UINT16> m_pf1_data;
28   
29   required_ioport m_inputs;
30   required_ioport m_coin;
31   required_ioport m_dsw;
3225
3326   tilemap_t *m_pf1_tilemap;
3427   
35   DECLARE_READ16_MEMBER(stadhero_control_r);
3628   DECLARE_WRITE16_MEMBER(stadhero_control_w);
3729   DECLARE_WRITE16_MEMBER(stadhero_pf1_data_w);
38   DECLARE_WRITE_LINE_MEMBER(irqhandler);
3930   
4031   virtual void video_start();
4132   
trunk/src/mame/machine/midtunit.c
r243172r243173
7373}
7474
7575
76
7776/*************************************
7877 *
79 *  Generic input ports
80 *
81 *************************************/
82
83IOPORT_ARRAY_MEMBER(midtunit_state::tunit_ports) { "IN0", "IN1", "IN2", "DSW" };
84
85READ16_MEMBER(midtunit_state::midtunit_input_r)
86{
87   return m_ports[offset]->read();
88}
89
90
91
92/*************************************
93 *
9478 *  Mortal Kombat (T-unit) protection
9579 *
9680 *************************************/


Previous 199869 Revisions Next


© 1997-2024 The MAME Team