trunk/src/mame/drivers/midtunit.c
| r243172 | r243173 | |
| 43 | 43 | AM_RANGE(0x01000000, 0x013fffff) AM_RAM |
| 44 | 44 | AM_RANGE(0x01400000, 0x0141ffff) AM_READWRITE(midtunit_cmos_r, midtunit_cmos_w) AM_SHARE("nvram") |
| 45 | 45 | 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") |
| 47 | 50 | AM_RANGE(0x01800000, 0x0187ffff) AM_RAM_WRITE(midtunit_paletteram_w) AM_SHARE("paletteram") |
| 48 | 51 | AM_RANGE(0x01a80000, 0x01a800ff) AM_READWRITE(midtunit_dma_r, midtunit_dma_w) |
| 49 | 52 | AM_RANGE(0x01b00000, 0x01b0001f) AM_WRITE(midtunit_control_w) |
trunk/src/mame/drivers/stadhero.c
| r243172 | r243173 | |
| 30 | 30 | |
| 31 | 31 | /******************************************************************************/ |
| 32 | 32 | |
| 33 | | READ16_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 | | |
| 51 | 33 | WRITE16_MEMBER(stadhero_state::stadhero_control_w) |
| 52 | 34 | { |
| 53 | 35 | switch (offset<<1) |
| r243172 | r243173 | |
| 73 | 55 | AM_RANGE(0x240000, 0x240007) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control_0_w) /* text layer */ |
| 74 | 56 | AM_RANGE(0x240010, 0x240017) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control_1_w) |
| 75 | 57 | 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) |
| 77 | 62 | AM_RANGE(0x310000, 0x3107ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 78 | 63 | AM_RANGE(0xff8000, 0xffbfff) AM_RAM /* Main ram */ |
| 79 | 64 | AM_RANGE(0xffc000, 0xffc7ff) AM_MIRROR(0x000800) AM_RAM AM_SHARE("spriteram") |
| r243172 | r243173 | |
| 210 | 195 | |
| 211 | 196 | /******************************************************************************/ |
| 212 | 197 | |
| 213 | | WRITE_LINE_MEMBER(stadhero_state::irqhandler) |
| 214 | | { |
| 215 | | m_audiocpu->set_input_line(0, state); |
| 216 | | } |
| 217 | | |
| 218 | | /******************************************************************************/ |
| 219 | | |
| 220 | 198 | static MACHINE_CONFIG_START( stadhero, stadhero_state ) |
| 221 | 199 | |
| 222 | 200 | /* basic machine hardware */ |
| r243172 | r243173 | |
| 260 | 238 | MCFG_SOUND_ROUTE(3, "mono", 0.40) |
| 261 | 239 | |
| 262 | 240 | 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)) |
| 264 | 242 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 265 | 243 | |
| 266 | 244 | MCFG_OKIM6295_ADD("oki", XTAL_1_056MHz, OKIM6295_PIN7_HIGH) |
trunk/src/mame/includes/midtunit.h
| r243172 | r243173 | |
| 24 | 24 | m_adpcm_sound(*this, "adpcm") , |
| 25 | 25 | m_generic_paletteram_16(*this, "paletteram"), |
| 26 | 26 | m_nvram(*this, "nvram"), |
| 27 | | m_gfxrom(*this, "gfxrom"), |
| 28 | | m_ports(*this, tunit_ports) { } |
| 27 | m_gfxrom(*this, "gfxrom") { } |
| 29 | 28 | |
| 30 | 29 | required_device<cpu_device> m_maincpu; |
| 31 | 30 | required_device<palette_device> m_palette; |
| r243172 | r243173 | |
| 38 | 37 | |
| 39 | 38 | required_memory_region m_gfxrom; |
| 40 | 39 | |
| 41 | | required_ioport_array<4> m_ports; |
| 42 | | DECLARE_IOPORT_ARRAY(tunit_ports); |
| 43 | | |
| 44 | 40 | DECLARE_WRITE16_MEMBER(midtunit_cmos_enable_w); |
| 45 | 41 | DECLARE_WRITE16_MEMBER(midtunit_cmos_w); |
| 46 | 42 | DECLARE_READ16_MEMBER(midtunit_cmos_r); |
trunk/src/mame/includes/stadhero.h
| r243172 | r243173 | |
| 12 | 12 | m_spritegen(*this, "spritegen"), |
| 13 | 13 | m_gfxdecode(*this, "gfxdecode"), |
| 14 | 14 | 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") { } |
| 19 | 16 | |
| 20 | 17 | required_device<cpu_device> m_maincpu; |
| 21 | 18 | required_device<cpu_device> m_audiocpu; |
| r243172 | r243173 | |
| 25 | 22 | |
| 26 | 23 | required_shared_ptr<UINT16> m_spriteram; |
| 27 | 24 | required_shared_ptr<UINT16> m_pf1_data; |
| 28 | | |
| 29 | | required_ioport m_inputs; |
| 30 | | required_ioport m_coin; |
| 31 | | required_ioport m_dsw; |
| 32 | 25 | |
| 33 | 26 | tilemap_t *m_pf1_tilemap; |
| 34 | 27 | |
| 35 | | DECLARE_READ16_MEMBER(stadhero_control_r); |
| 36 | 28 | DECLARE_WRITE16_MEMBER(stadhero_control_w); |
| 37 | 29 | DECLARE_WRITE16_MEMBER(stadhero_pf1_data_w); |
| 38 | | DECLARE_WRITE_LINE_MEMBER(irqhandler); |
| 39 | 30 | |
| 40 | 31 | virtual void video_start(); |
| 41 | 32 | |
trunk/src/mame/machine/midtunit.c
| r243172 | r243173 | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | |
| 76 | | |
| 77 | 76 | /************************************* |
| 78 | 77 | * |
| 79 | | * Generic input ports |
| 80 | | * |
| 81 | | *************************************/ |
| 82 | | |
| 83 | | IOPORT_ARRAY_MEMBER(midtunit_state::tunit_ports) { "IN0", "IN1", "IN2", "DSW" }; |
| 84 | | |
| 85 | | READ16_MEMBER(midtunit_state::midtunit_input_r) |
| 86 | | { |
| 87 | | return m_ports[offset]->read(); |
| 88 | | } |
| 89 | | |
| 90 | | |
| 91 | | |
| 92 | | /************************************* |
| 93 | | * |
| 94 | 78 | * Mortal Kombat (T-unit) protection |
| 95 | 79 | * |
| 96 | 80 | *************************************/ |