mirror of
https://github.com/holub/mame
synced 2025-07-06 10:29:38 +03:00
witness the power of devcb3 to tear through boilerplate (in Taito C-Chip), also misc cleanup/MCFG_ reduction (nw)
This commit is contained in:
parent
e0912401ae
commit
2c7e42261a
@ -144,6 +144,19 @@ public:
|
||||
template <class Object> devcb_base &set_an5_func(Object &&cb) { return m_an5_func.set_callback(std::forward<Object>(cb)); }
|
||||
template <class Object> devcb_base &set_an6_func(Object &&cb) { return m_an6_func.set_callback(std::forward<Object>(cb)); }
|
||||
template <class Object> devcb_base &set_an7_func(Object &&cb) { return m_an7_func.set_callback(std::forward<Object>(cb)); }
|
||||
auto to_func() { return m_to_func.bind(); }
|
||||
auto co0_func() { return m_co0_func.bind(); }
|
||||
auto co1_func() { return m_co1_func.bind(); }
|
||||
auto txd_func() { return m_txd_func.bind(); }
|
||||
auto rxd_func() { return m_rxd_func.bind(); }
|
||||
auto an0_func() { return m_an0_func.bind(); }
|
||||
auto an1_func() { return m_an1_func.bind(); }
|
||||
auto an2_func() { return m_an2_func.bind(); }
|
||||
auto an3_func() { return m_an3_func.bind(); }
|
||||
auto an4_func() { return m_an4_func.bind(); }
|
||||
auto an5_func() { return m_an5_func.bind(); }
|
||||
auto an6_func() { return m_an6_func.bind(); }
|
||||
auto an7_func() { return m_an7_func.bind(); }
|
||||
|
||||
template <class Object> devcb_base &set_pa_in_cb(Object &&cb) { return m_pa_in_cb.set_callback(std::forward<Object>(cb)); }
|
||||
template <class Object> devcb_base &set_pb_in_cb(Object &&cb) { return m_pb_in_cb.set_callback(std::forward<Object>(cb)); }
|
||||
@ -155,8 +168,19 @@ public:
|
||||
template <class Object> devcb_base &set_pc_out_cb(Object &&cb) { return m_pc_out_cb.set_callback(std::forward<Object>(cb)); }
|
||||
template <class Object> devcb_base &set_pd_out_cb(Object &&cb) { return m_pd_out_cb.set_callback(std::forward<Object>(cb)); }
|
||||
template <class Object> devcb_base &set_pf_out_cb(Object &&cb) { return m_pf_out_cb.set_callback(std::forward<Object>(cb)); }
|
||||
auto pa_in_cb() { return m_pa_in_cb.bind(); }
|
||||
auto pb_in_cb() { return m_pb_in_cb.bind(); }
|
||||
auto pc_in_cb() { return m_pc_in_cb.bind(); }
|
||||
auto pd_in_cb() { return m_pd_in_cb.bind(); }
|
||||
auto pf_in_cb() { return m_pf_in_cb.bind(); }
|
||||
auto pa_out_cb() { return m_pa_out_cb.bind(); }
|
||||
auto pb_out_cb() { return m_pb_out_cb.bind(); }
|
||||
auto pc_out_cb() { return m_pc_out_cb.bind(); }
|
||||
auto pd_out_cb() { return m_pd_out_cb.bind(); }
|
||||
auto pf_out_cb() { return m_pf_out_cb.bind(); }
|
||||
|
||||
template <class Object> devcb_base &set_pt_in_cb(Object &&cb) { return m_pt_in_cb.set_callback(std::forward<Object>(cb)); }
|
||||
auto pt_in_cb() { return m_pt_in_cb.bind(); }
|
||||
|
||||
DECLARE_WRITE8_MEMBER(pa_w);
|
||||
DECLARE_WRITE8_MEMBER(pb_w);
|
||||
@ -164,10 +188,11 @@ public:
|
||||
DECLARE_WRITE8_MEMBER(pd_w);
|
||||
DECLARE_WRITE8_MEMBER(pf_w);
|
||||
|
||||
protected:
|
||||
void upd_internal_128_ram_map(address_map &map);
|
||||
void upd_internal_256_ram_map(address_map &map);
|
||||
void upd_internal_4096_rom_map(address_map &map);
|
||||
protected:
|
||||
|
||||
// flags
|
||||
enum
|
||||
{
|
||||
|
@ -1350,8 +1350,8 @@ MACHINE_CONFIG_START(arkanoid_state::arkanoid)
|
||||
MCFG_WATCHDOG_ADD("watchdog")
|
||||
MCFG_WATCHDOG_VBLANK_INIT("screen", 128); // 74LS393 at ic21, counts 128 vblanks before firing watchdog; z80 /RESET ls08 ic19 pin 9 input comes from ls04 ic20 pin 8, ls04 ic20 pin 9 input comes from ic21 ls393 pin 8, and ls393 is set to chain both 4 bit counters together
|
||||
|
||||
MCFG_DEVICE_ADD("mcu", ARKANOID_68705P5, XTAL(12'000'000)/4) /* verified on pcb */
|
||||
MCFG_ARKANOID_MCU_PORTB_R_CB(IOPORT("MUX"))
|
||||
ARKANOID_68705P5(config, m_mcuintf, 12_MHz_XTAL / 4); // verified on PCB
|
||||
m_mcuintf->portb_r_cb().set_ioport("MUX");
|
||||
|
||||
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) // 100 CPU slices per second to synchronize between the MCU and the main CPU
|
||||
|
||||
@ -1378,20 +1378,17 @@ MACHINE_CONFIG_START(arkanoid_state::arkanoid)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.66)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(arkanoid_state::p3mcu)
|
||||
void arkanoid_state::p3mcu(machine_config &config)
|
||||
{
|
||||
arkanoid(config);
|
||||
|
||||
/* unprotected MCU */
|
||||
MCFG_DEVICE_REPLACE("mcu", ARKANOID_68705P3, XTAL(12'000'000)/4)
|
||||
MCFG_ARKANOID_MCU_PORTB_R_CB(IOPORT("MUX"))
|
||||
MACHINE_CONFIG_END
|
||||
ARKANOID_68705P3(config.replace(), m_mcuintf, 12_MHz_XTAL / 4);
|
||||
m_mcuintf->portb_r_cb().set_ioport("MUX");
|
||||
}
|
||||
|
||||
MACHINE_CONFIG_START(arkanoid_state::p3mcuay)
|
||||
arkanoid(config);
|
||||
|
||||
/* unprotected MCU */
|
||||
MCFG_DEVICE_REPLACE("mcu", ARKANOID_68705P3, XTAL(12'000'000)/4)
|
||||
MCFG_ARKANOID_MCU_PORTB_R_CB(IOPORT("MUX"))
|
||||
p3mcu(config);
|
||||
|
||||
MCFG_DEVICE_REPLACE("aysnd", AY8910, XTAL(12'000'000)/4) // AY-3-8910A
|
||||
MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT)
|
||||
@ -1412,6 +1409,7 @@ MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(arkanoid_state::aysnd)
|
||||
bootleg(config);
|
||||
|
||||
MCFG_DEVICE_REPLACE("aysnd", AY8910, XTAL(12'000'000)/4)
|
||||
MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT)
|
||||
MCFG_AY8910_PORT_A_READ_CB(IOPORT("UNUSED"))
|
||||
|
@ -847,12 +847,12 @@ MACHINE_CONFIG_START(asuka_state::bonzeadv)
|
||||
MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(16'000'000)/4) /* sound CPU, also required for test mode */
|
||||
MCFG_DEVICE_PROGRAM_MAP(bonzeadv_z80_map)
|
||||
|
||||
MCFG_TAITO_CCHIP_ADD("cchip", XTAL(12'000'000)) /* 12MHz OSC near C-Chip */
|
||||
MCFG_CCHIP_IN_PORTA_CB(IOPORT("800007"))
|
||||
MCFG_CCHIP_IN_PORTB_CB(IOPORT("800009"))
|
||||
MCFG_CCHIP_IN_PORTC_CB(IOPORT("80000B"))
|
||||
MCFG_CCHIP_IN_PORTAD_CB(IOPORT("80000D"))
|
||||
MCFG_CCHIP_OUT_PORTB_CB(WRITE8(*this, asuka_state, counters_w))
|
||||
TAITO_CCHIP(config, m_cchip, 12_MHz_XTAL); // 12MHz OSC near C-Chip
|
||||
m_cchip->in_pa_callback().set_ioport("800007");
|
||||
m_cchip->in_pb_callback().set_ioport("800009");
|
||||
m_cchip->in_pc_callback().set_ioport("80000B");
|
||||
m_cchip->in_ad_callback().set_ioport("80000D");
|
||||
m_cchip->out_pb_callback().set(FUNC(asuka_state::counters_w));
|
||||
|
||||
MCFG_TIMER_DRIVER_ADD("cchip_irq_clear", asuka_state, cchip_irq_clear_cb)
|
||||
|
||||
|
@ -67,15 +67,15 @@ class macs_state : public driver_device
|
||||
{
|
||||
public:
|
||||
macs_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_cart_bank(0),
|
||||
m_ram2(*this, "ram2"),
|
||||
m_maincpu(*this,"maincpu"),
|
||||
m_cart1(*this, "slot_a"),
|
||||
m_cart2(*this, "slot_b"),
|
||||
m_rombank(*this, "rombank%u", 1),
|
||||
m_rambank(*this, "rambank%u", 1)
|
||||
{ }
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_cart_bank(0)
|
||||
, m_ram2(*this, "ram2")
|
||||
, m_maincpu(*this,"maincpu")
|
||||
, m_cart1(*this, "slot_a")
|
||||
, m_cart2(*this, "slot_b")
|
||||
, m_rombank(*this, "rombank%u", 1)
|
||||
, m_rambank(*this, "rambank%u", 1)
|
||||
{ }
|
||||
|
||||
void macs(machine_config &config);
|
||||
|
||||
@ -96,7 +96,7 @@ private:
|
||||
DECLARE_WRITE8_MEMBER(macs_output_w);
|
||||
DECLARE_MACHINE_RESET(macs);
|
||||
DECLARE_MACHINE_START(macs);
|
||||
ST0016_DMA_OFFS_CB(dma_offset);
|
||||
uint8_t dma_offset();
|
||||
|
||||
uint32_t screen_update_macs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
@ -494,31 +494,30 @@ uint32_t macs_state::screen_update_macs(screen_device &screen, bitmap_ind16 &bit
|
||||
}
|
||||
|
||||
|
||||
ST0016_DMA_OFFS_CB(macs_state::dma_offset)
|
||||
uint8_t macs_state::dma_offset()
|
||||
{
|
||||
return m_cart_bank;
|
||||
}
|
||||
|
||||
MACHINE_CONFIG_START(macs_state::macs)
|
||||
/* basic machine hardware */
|
||||
MCFG_DEVICE_ADD("maincpu",ST0016_CPU,8000000) /* 8 MHz ? */
|
||||
MCFG_DEVICE_PROGRAM_MAP(macs_mem)
|
||||
MCFG_DEVICE_IO_MAP(macs_io)
|
||||
MCFG_ST0016_DMA_OFFS_CB(macs_state, dma_offset)
|
||||
|
||||
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", macs_state, irq0_line_hold)
|
||||
ST0016_CPU(config, m_maincpu, 8000000); // 8 MHz ?
|
||||
m_maincpu->set_memory_map(&macs_state::macs_mem);
|
||||
m_maincpu->set_io_map(&macs_state::macs_io);
|
||||
m_maincpu->set_dma_offs_callback(FUNC(macs_state::dma_offset), this);
|
||||
|
||||
MCFG_MACHINE_START_OVERRIDE(macs_state, macs)
|
||||
MCFG_MACHINE_RESET_OVERRIDE(macs_state, macs)
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_REFRESH_RATE(60)
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MCFG_SCREEN_SIZE(128*8, 128*8)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0*8, 128*8-1, 0*8, 128*8-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(macs_state, screen_update_macs)
|
||||
MCFG_SCREEN_PALETTE("maincpu:palette")
|
||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
|
||||
screen.set_refresh_hz(60);
|
||||
screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
|
||||
screen.set_size(128*8, 128*8);
|
||||
screen.set_visarea(0*8, 128*8-1, 0*8, 128*8-1);
|
||||
screen.set_screen_update(FUNC(macs_state::screen_update_macs));
|
||||
screen.set_palette("maincpu:palette");
|
||||
screen.screen_vblank().set_inputline(m_maincpu, INPUT_LINE_IRQ0, HOLD_LINE); // FIXME: HOLD_LINE is bad juju
|
||||
|
||||
MCFG_GENERIC_CARTSLOT_ADD_WITH_DEFAULT("slot_a", generic_plain_slot, "macs_cart", "rom")
|
||||
MCFG_SET_IMAGE_LOADABLE(false)
|
||||
|
@ -70,8 +70,8 @@
|
||||
class mlanding_state : public driver_device
|
||||
{
|
||||
public:
|
||||
mlanding_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
mlanding_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_subcpu(*this, "subcpu"),
|
||||
m_dsp(*this, "dsp"),
|
||||
@ -959,7 +959,7 @@ MACHINE_CONFIG_START(mlanding_state::mlanding)
|
||||
|
||||
MCFG_QUANTUM_TIME(attotime::from_hz(600))
|
||||
|
||||
MCFG_TAITOIO_YOKE_ADD("yokectrl")
|
||||
TAITOIO_YOKE(config, m_yoke, 0);
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
|
@ -1017,7 +1017,7 @@ CUSTOM_INPUT_MEMBER(neogeo_base_state::get_memcard_status)
|
||||
{
|
||||
// D0 and D1 are memcard 1 and 2 presence indicators, D2 indicates memcard
|
||||
// write protect status (we are always write enabled)
|
||||
return (!m_memcard || (m_memcard->present() == -1)) ? 0x07 : 0x00;
|
||||
return (!m_memcard || !m_memcard->present()) ? 0x07 : 0x00;
|
||||
}
|
||||
|
||||
|
||||
@ -1027,7 +1027,7 @@ READ16_MEMBER(neogeo_base_state::memcard_r)
|
||||
|
||||
uint16_t ret;
|
||||
|
||||
if (m_memcard->present() != -1)
|
||||
if (m_memcard->present())
|
||||
ret = m_memcard->read(space, offset) | 0xff00;
|
||||
else
|
||||
ret = 0xffff;
|
||||
@ -1042,7 +1042,7 @@ WRITE16_MEMBER(neogeo_base_state::memcard_w)
|
||||
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
if (m_memcard->present() != -1)
|
||||
if (m_memcard->present())
|
||||
m_memcard->write(space, offset, data);
|
||||
}
|
||||
}
|
||||
@ -1990,7 +1990,7 @@ MACHINE_CONFIG_START(mvs_led_state::mv1)
|
||||
neogeo_arcade(config);
|
||||
neogeo_stereo(config);
|
||||
|
||||
MCFG_NEOGEO_MEMCARD_ADD("memcard")
|
||||
NG_MEMCARD(config, m_memcard, 0);
|
||||
|
||||
MCFG_NEOGEO_CONTROL_EDGE_CONNECTOR_ADD("edge", neogeo_arc_edge, "joy", false)
|
||||
|
||||
@ -2031,7 +2031,7 @@ MACHINE_CONFIG_START(mvs_led_el_state::mv2f)
|
||||
neogeo_arcade(config);
|
||||
neogeo_stereo(config);
|
||||
|
||||
MCFG_NEOGEO_MEMCARD_ADD("memcard")
|
||||
NG_MEMCARD(config, m_memcard, 0);
|
||||
|
||||
MCFG_NEOGEO_CONTROL_EDGE_CONNECTOR_ADD("edge", neogeo_arc_edge, "joy", false)
|
||||
|
||||
@ -2048,7 +2048,7 @@ MACHINE_CONFIG_START(mvs_led_el_state::mv4f)
|
||||
neogeo_arcade(config);
|
||||
neogeo_stereo(config);
|
||||
|
||||
MCFG_NEOGEO_MEMCARD_ADD("memcard")
|
||||
NG_MEMCARD(config, m_memcard, 0);
|
||||
|
||||
MCFG_NEOGEO_CONTROL_EDGE_CONNECTOR_ADD("edge", neogeo_arc_edge, "joy", false)
|
||||
|
||||
@ -2067,7 +2067,7 @@ MACHINE_CONFIG_START(mvs_led_el_state::mv6f)
|
||||
neogeo_arcade(config);
|
||||
neogeo_stereo(config);
|
||||
|
||||
MCFG_NEOGEO_MEMCARD_ADD("memcard")
|
||||
NG_MEMCARD(config, m_memcard, 0);
|
||||
|
||||
MCFG_NEOGEO_CONTROL_EDGE_CONNECTOR_ADD("edge", neogeo_arc_edge, "joy", false)
|
||||
|
||||
@ -2088,7 +2088,7 @@ MACHINE_CONFIG_START(mvs_led_state::mv1_fixed)
|
||||
neogeo_arcade(config);
|
||||
neogeo_stereo(config);
|
||||
|
||||
MCFG_NEOGEO_MEMCARD_ADD("memcard")
|
||||
NG_MEMCARD(config, m_memcard, 0);
|
||||
|
||||
MCFG_NEOGEO_CONTROL_EDGE_CONNECTOR_ADD("edge", neogeo_arc_edge, "joy", true)
|
||||
|
||||
@ -2133,7 +2133,7 @@ MACHINE_CONFIG_START(aes_state::aes)
|
||||
MCFG_DEVICE_MODIFY("maincpu")
|
||||
MCFG_DEVICE_PROGRAM_MAP(aes_main_map)
|
||||
|
||||
MCFG_NEOGEO_MEMCARD_ADD("memcard")
|
||||
NG_MEMCARD(config, m_memcard, 0);
|
||||
|
||||
MCFG_NEOGEO_CARTRIDGE_ADD("cslot1", neogeo_cart, nullptr)
|
||||
|
||||
|
@ -792,7 +792,7 @@ MACHINE_CONFIG_START(opwolf_state::opwolf)
|
||||
MCFG_DEVICE_ADD("audiocpu", Z80, SOUND_CPU_CLOCK ) /* 4 MHz */
|
||||
MCFG_DEVICE_PROGRAM_MAP(opwolf_sound_z80_map)
|
||||
|
||||
MCFG_TAITO_CCHIP_ADD("cchip", XTAL(12'000'000)) /* 12MHz measured on pin 20 */
|
||||
TAITO_CCHIP(config, m_cchip, 12_MHz_XTAL); /* 12MHz measured on pin 20 */
|
||||
|
||||
MCFG_QUANTUM_TIME(attotime::from_hz(600)) /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
|
||||
|
||||
|
@ -43,7 +43,7 @@ public:
|
||||
|
||||
void patapata(machine_config &config);
|
||||
|
||||
private:
|
||||
protected:
|
||||
DECLARE_WRITE16_MEMBER(bg_videoram_w);
|
||||
DECLARE_WRITE16_MEMBER(fg_videoram_w);
|
||||
DECLARE_WRITE8_MEMBER(flipscreen_w);
|
||||
@ -55,6 +55,7 @@ private:
|
||||
void main_map(address_map &map);
|
||||
virtual void video_start() override;
|
||||
|
||||
private:
|
||||
/* memory pointers */
|
||||
required_shared_ptr<uint16_t> m_bg_videoram;
|
||||
required_shared_ptr<uint16_t> m_fg_videoram;
|
||||
|
@ -28,9 +28,10 @@
|
||||
**************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "speaker.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
|
||||
#include "includes/konamigx.h" // TODO: WHY?
|
||||
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "machine/gen_latch.h"
|
||||
#include "machine/k053252.h"
|
||||
#include "machine/nvram.h"
|
||||
@ -43,22 +44,25 @@
|
||||
#include "video/k055555.h"
|
||||
#include "video/konami_helper.h"
|
||||
|
||||
#include "speaker.h"
|
||||
|
||||
|
||||
class piratesh_state : public driver_device
|
||||
{
|
||||
public:
|
||||
piratesh_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this,"maincpu"),
|
||||
m_k053250(*this, "k053250"),
|
||||
m_k053252(*this, "k053252"),
|
||||
m_k056832(*this, "k056832"),
|
||||
m_k055673(*this, "k055673"),
|
||||
m_k055555(*this, "k055555"),
|
||||
// m_k053246(*this, "k053246"),
|
||||
m_k054539(*this, "k054539"),
|
||||
m_tickets(*this, "ticket"),
|
||||
m_hopper(*this, "hopper"),
|
||||
m_spriteram(*this,"spriteram")
|
||||
piratesh_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this,"maincpu"),
|
||||
m_k053250(*this, "k053250"),
|
||||
m_k053252(*this, "k053252"),
|
||||
m_k056832(*this, "k056832"),
|
||||
m_k055673(*this, "k055673"),
|
||||
m_k055555(*this, "k055555"),
|
||||
//m_k053246(*this, "k053246"),
|
||||
m_k054539(*this, "k054539"),
|
||||
m_tickets(*this, "ticket"),
|
||||
m_hopper(*this, "hopper"),
|
||||
m_spriteram(*this,"spriteram")
|
||||
{ }
|
||||
|
||||
void piratesh(machine_config &config);
|
||||
@ -66,6 +70,11 @@ public:
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(helm_r);
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(battery_r);
|
||||
|
||||
protected:
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
|
||||
private:
|
||||
required_device<cpu_device> m_maincpu;
|
||||
|
||||
@ -104,9 +113,6 @@ private:
|
||||
DECLARE_READ16_MEMBER(k053247_martchmp_word_r);
|
||||
DECLARE_WRITE16_MEMBER(k053247_martchmp_word_w);
|
||||
|
||||
DECLARE_MACHINE_START(piratesh);
|
||||
DECLARE_MACHINE_RESET(piratesh);
|
||||
DECLARE_VIDEO_START(piratesh);
|
||||
uint32_t screen_update_piratesh(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(k054539_nmi_gen);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(piratesh_interrupt);
|
||||
@ -139,7 +145,7 @@ K056832_CB_MEMBER(piratesh_state::piratesh_tile_callback)
|
||||
// Color
|
||||
// Flags
|
||||
// if (*color != 0)
|
||||
// printf("%x %x %x\n", layer, *code, *color >> 2);
|
||||
// logerror("%x %x %x\n", layer, *code, *color >> 2);
|
||||
|
||||
*color = (m_layer_colorbase[layer] << 4) + ((*color >> 2));// & 0x0f);
|
||||
}
|
||||
@ -189,7 +195,7 @@ K055673_CB_MEMBER(piratesh_state::piratesh_sprite_callback)
|
||||
|
||||
|
||||
|
||||
VIDEO_START_MEMBER(piratesh_state, piratesh)
|
||||
void piratesh_state::video_start()
|
||||
{
|
||||
// TODO: These come from the 055555
|
||||
m_layer_colorbase[0] = 0;
|
||||
@ -347,7 +353,7 @@ WRITE16_MEMBER(piratesh_state::control1_w)
|
||||
// .... x... .... .... - Lamp? (active when waiting to start game)
|
||||
|
||||
if (data & ~0x0f00)
|
||||
printf("CTRL3: %x %x %x\n", offset, data, mem_mask);
|
||||
logerror("CTRL3: %x %x %x\n", offset, data, mem_mask);
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(piratesh_state::control2_w)
|
||||
@ -369,7 +375,7 @@ WRITE16_MEMBER(piratesh_state::control2_w)
|
||||
update_interrupts();
|
||||
|
||||
if (data & ~0xfbf0)
|
||||
printf("CTRL2: %x %x %x\n", offset, data, mem_mask);
|
||||
logerror("CTRL2: %x %x %x\n", offset, data, mem_mask);
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(piratesh_state::control3_w)
|
||||
@ -381,9 +387,9 @@ WRITE16_MEMBER(piratesh_state::control3_w)
|
||||
// .... ...x .... .... - Unknown (always 1?)
|
||||
|
||||
if ((data & ~0x0133) || (~data & 0x100))
|
||||
printf("CTRL1 W: %x %x %x\n", offset, data, mem_mask);
|
||||
logerror("CTRL1 W: %x %x %x\n", offset, data, mem_mask);
|
||||
|
||||
// printf("CTRL 1: %x\n", data & 0x0010);
|
||||
// logerror("CTRL 1: %x\n", data & 0x0010);
|
||||
m_tickets->motor_w(data & 0x0010 ? 1 : 0);
|
||||
m_hopper->motor_w(data & 0x0020 ? 1 : 0);
|
||||
|
||||
@ -559,7 +565,7 @@ INPUT_PORTS_END
|
||||
|
||||
/**********************************************************************************/
|
||||
|
||||
MACHINE_START_MEMBER(piratesh_state, piratesh)
|
||||
void piratesh_state::machine_start()
|
||||
{
|
||||
#if 0
|
||||
m_sound_ctrl = 2;
|
||||
@ -574,7 +580,7 @@ MACHINE_START_MEMBER(piratesh_state, piratesh)
|
||||
#endif
|
||||
}
|
||||
|
||||
MACHINE_RESET_MEMBER(piratesh_state,piratesh)
|
||||
void piratesh_state::machine_reset()
|
||||
{
|
||||
m_int_status = 0;
|
||||
|
||||
@ -603,9 +609,6 @@ MACHINE_CONFIG_START(piratesh_state::piratesh)
|
||||
MCFG_DEVICE_ADD("k053252", K053252, XTAL(32'000'000)/4)
|
||||
MCFG_K053252_OFFSETS(40, 16) // TODO
|
||||
|
||||
MCFG_MACHINE_START_OVERRIDE(piratesh_state, piratesh)
|
||||
MCFG_MACHINE_RESET_OVERRIDE(piratesh_state, piratesh)
|
||||
|
||||
MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH)
|
||||
MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH)
|
||||
|
||||
@ -647,8 +650,6 @@ MACHINE_CONFIG_START(piratesh_state::piratesh)
|
||||
MCFG_DEVICE_ADD("k054338", K054338, 0, "k055555")
|
||||
MCFG_K054338_ALPHAINV(1)
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(piratesh_state, piratesh)
|
||||
|
||||
/* sound hardware */
|
||||
SPEAKER(config, "lspeaker").front_left();
|
||||
SPEAKER(config, "rspeaker").front_right();
|
||||
|
@ -89,15 +89,16 @@ ROMS: All ROM labels say only "PROM" and a number.
|
||||
class pturn_state : public driver_device
|
||||
{
|
||||
public:
|
||||
pturn_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
pturn_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette"),
|
||||
m_soundlatch(*this, "soundlatch"),
|
||||
m_videoram(*this, "videoram"),
|
||||
m_spriteram(*this, "spriteram") { }
|
||||
m_spriteram(*this, "spriteram")
|
||||
{ }
|
||||
|
||||
void pturn(machine_config &config);
|
||||
|
||||
|
@ -663,12 +663,12 @@ MACHINE_CONFIG_START(rbisland_state::rbisland)
|
||||
MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(16'000'000)/4) /* verified on pcb */
|
||||
MCFG_DEVICE_PROGRAM_MAP(rbisland_sound_map)
|
||||
|
||||
MCFG_TAITO_CCHIP_ADD("cchip", XTAL(12'000'000)) /* 12MHz OSC next to C-Chip */
|
||||
MCFG_CCHIP_IN_PORTA_CB(IOPORT("800007"))
|
||||
MCFG_CCHIP_IN_PORTB_CB(IOPORT("800009"))
|
||||
MCFG_CCHIP_IN_PORTC_CB(IOPORT("80000B"))
|
||||
MCFG_CCHIP_IN_PORTAD_CB(IOPORT("80000D"))
|
||||
MCFG_CCHIP_OUT_PORTB_CB(WRITE8(*this, rbisland_state, counters_w))
|
||||
TAITO_CCHIP(config, m_cchip, 12_MHz_XTAL); // 12MHz OSC next to C-Chip
|
||||
m_cchip->in_pa_callback().set_ioport("800007");
|
||||
m_cchip->in_pb_callback().set_ioport("800009");
|
||||
m_cchip->in_pc_callback().set_ioport("80000B");
|
||||
m_cchip->in_ad_callback().set_ioport("80000D");
|
||||
m_cchip->out_pb_callback().set(FUNC(rbisland_state::counters_w));
|
||||
|
||||
MCFG_TIMER_DRIVER_ADD("cchip_irq_clear", rbisland_state, cchip_irq_clear_cb)
|
||||
|
||||
|
@ -2259,7 +2259,7 @@ MACHINE_CONFIG_START(segas32_state::device_add_mconfig)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.55)
|
||||
MCFG_DEVICE_ADDRESS_MAP(0, rf5c68_map)
|
||||
|
||||
MCFG_S32COMM_ADD("s32comm")
|
||||
S32COMM(config, m_s32comm, 0);
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
DEFINE_DEVICE_TYPE(SEGA_S32_REGULAR_DEVICE, segas32_regular_state, "segas32_pcb_regular", "Sega System 32 regular PCB")
|
||||
@ -2585,7 +2585,7 @@ MACHINE_CONFIG_START(sega_multi32_state::device_add_mconfig)
|
||||
MCFG_SOUND_ROUTE(1, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(0, "rspeaker", 1.0)
|
||||
|
||||
MCFG_S32COMM_ADD("s32comm")
|
||||
S32COMM(config, m_s32comm, 0);
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
|
@ -956,7 +956,7 @@ MACHINE_CONFIG_START(slapfght_state::tigerh)
|
||||
MCFG_DEVICE_PROGRAM_MAP(tigerh_sound_map)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(slapfght_state, sound_nmi, 360) // music speed, verified with pcb recording
|
||||
|
||||
MCFG_DEVICE_ADD("bmcu", TAITO68705_MCU_TIGER, XTAL(36'000'000)/12) // 3MHz
|
||||
TAITO68705_MCU_TIGER(config, m_bmcu, 36_MHz_XTAL/12); // 3MHz
|
||||
|
||||
MCFG_QUANTUM_PERFECT_CPU("maincpu")
|
||||
|
||||
@ -1028,8 +1028,8 @@ MACHINE_CONFIG_START(slapfght_state::slapfigh)
|
||||
MCFG_DEVICE_PROGRAM_MAP(tigerh_sound_map)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(slapfght_state, sound_nmi, 180)
|
||||
|
||||
MCFG_DEVICE_ADD("bmcu", TAITO68705_MCU, XTAL(36'000'000)/12) // 3MHz
|
||||
MCFG_TAITO_M68705_AUX_STROBE_CB(WRITE8(*this, slapfght_state, scroll_from_mcu_w))
|
||||
TAITO68705_MCU(config, m_bmcu, 36_MHz_XTAL/12); // 3MHz
|
||||
m_bmcu->aux_strobe_cb().set(FUNC(slapfght_state::scroll_from_mcu_w));
|
||||
|
||||
MCFG_QUANTUM_PERFECT_CPU("maincpu")
|
||||
|
||||
|
@ -2999,7 +2999,7 @@ MACHINE_CONFIG_START(taitof2_state::megab)
|
||||
MCFG_DEVICE_PROGRAM_MAP(megab_map)
|
||||
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", taitof2_state, megab_interrupt)
|
||||
|
||||
MCFG_TAITO_CCHIP_ADD("cchip", XTAL(24'000'000)/2) /* 12MHz */
|
||||
TAITO_CCHIP(config, m_cchip, 24_MHz_XTAL/2); // 12MHz
|
||||
// the ports don't appear to hook up to anything
|
||||
|
||||
MCFG_TIMER_DRIVER_ADD("cchip_irq_clear", taitof2_state, cchip_irq_clear_cb)
|
||||
|
@ -837,11 +837,11 @@ MACHINE_CONFIG_START(taitox_state::superman)
|
||||
MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(16'000'000)/4) /* verified on pcb */
|
||||
MCFG_DEVICE_PROGRAM_MAP(sound_map)
|
||||
|
||||
MCFG_TAITO_CCHIP_ADD("cchip", XTAL(16'000'000)/2) /* 8MHz measured on pin 20 */
|
||||
MCFG_CCHIP_IN_PORTA_CB(IOPORT("IN0"))
|
||||
MCFG_CCHIP_IN_PORTB_CB(IOPORT("IN1"))
|
||||
MCFG_CCHIP_IN_PORTAD_CB(IOPORT("IN2"))
|
||||
MCFG_CCHIP_OUT_PORTC_CB(WRITE8(*this, taitox_state, superman_counters_w))
|
||||
TAITO_CCHIP(config, m_cchip, 16_MHz_XTAL/2); // 8MHz measured on pin 20
|
||||
m_cchip->in_pa_callback().set_ioport("IN0");
|
||||
m_cchip->in_pb_callback().set_ioport("IN1");
|
||||
m_cchip->in_ad_callback().set_ioport("IN2");
|
||||
m_cchip->out_pc_callback().set(FUNC(taitox_state::superman_counters_w));
|
||||
|
||||
MCFG_TIMER_DRIVER_ADD("cchip_irq_clear", taitox_state, cchip_irq_clear_cb)
|
||||
|
||||
|
@ -728,7 +728,7 @@ MACHINE_CONFIG_START(taitoair_state::airsys)
|
||||
m_tc0220ioc->write_4_callback().set(FUNC(taitoair_state::coin_control_w));
|
||||
m_tc0220ioc->read_7_callback().set_ioport("IN2");
|
||||
|
||||
MCFG_TAITOIO_YOKE_ADD("yokectrl")
|
||||
TAITOIO_YOKE(config, m_yoke, 0);
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
|
@ -249,12 +249,12 @@ MACHINE_CONFIG_START(volfied_state::volfied)
|
||||
MCFG_DEVICE_ADD("audiocpu", Z80, SOUND_CPU_CLOCK) /* 4MHz sound CPU, required to run the game */
|
||||
MCFG_DEVICE_PROGRAM_MAP(z80_map)
|
||||
|
||||
MCFG_TAITO_CCHIP_ADD("cchip", XTAL(20'000'000)/2) /* 20MHz OSC next to C-Chip */
|
||||
MCFG_CCHIP_IN_PORTA_CB(IOPORT("F00007"))
|
||||
MCFG_CCHIP_IN_PORTB_CB(IOPORT("F00009"))
|
||||
MCFG_CCHIP_IN_PORTC_CB(IOPORT("F0000B"))
|
||||
MCFG_CCHIP_IN_PORTAD_CB(IOPORT("F0000D"))
|
||||
MCFG_CCHIP_OUT_PORTB_CB(WRITE8(*this, volfied_state, counters_w))
|
||||
TAITO_CCHIP(config, m_cchip, 20_MHz_XTAL/2); // 20MHz OSC next to C-Chip
|
||||
m_cchip->in_pa_callback().set_ioport("F00007");
|
||||
m_cchip->in_pb_callback().set_ioport("F00009");
|
||||
m_cchip->in_pc_callback().set_ioport("F0000B");
|
||||
m_cchip->in_ad_callback().set_ioport("F0000D");
|
||||
m_cchip->out_pb_callback().set(FUNC(volfied_state::counters_w));
|
||||
|
||||
MCFG_QUANTUM_TIME(attotime::from_hz(1200))
|
||||
|
||||
|
@ -23,8 +23,6 @@ enum {
|
||||
class arkanoid_state : public driver_device
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
arkanoid_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_videoram(*this, "videoram")
|
||||
|
@ -21,8 +21,8 @@
|
||||
class rbisland_state : public driver_device
|
||||
{
|
||||
public:
|
||||
rbisland_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
rbisland_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_spriteram(*this, "spriteram"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
|
@ -5,6 +5,10 @@
|
||||
Taito Air System
|
||||
|
||||
*************************************************************************/
|
||||
#ifndef MAME_INCLUDES_TAITOAIR_H
|
||||
#define MAME_INCLUDES_TAITOAIR_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "machine/taitoio.h"
|
||||
#include "machine/taitoio_yoke.h"
|
||||
@ -29,23 +33,23 @@ class taitoair_state : public driver_device
|
||||
{
|
||||
public:
|
||||
taitoair_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_m68000_mainram(*this, "m68000_mainram"),
|
||||
m_line_ram(*this, "line_ram"),
|
||||
m_dsp_ram(*this, "dsp_ram"),
|
||||
m_paletteram(*this, "paletteram"),
|
||||
m_gradram(*this, "gradram"),
|
||||
m_tc0430grw(*this, "tc0430grw"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_dsp(*this, "dsp"),
|
||||
m_tc0080vco(*this, "tc0080vco"),
|
||||
m_tc0220ioc(*this, "tc0220ioc"),
|
||||
m_yoke(*this, "yokectrl"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_screen(*this, "screen"),
|
||||
m_palette(*this, "palette")
|
||||
{ }
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_m68000_mainram(*this, "m68000_mainram")
|
||||
, m_line_ram(*this, "line_ram")
|
||||
, m_dsp_ram(*this, "dsp_ram")
|
||||
, m_paletteram(*this, "paletteram")
|
||||
, m_gradram(*this, "gradram")
|
||||
, m_tc0430grw(*this, "tc0430grw")
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_audiocpu(*this, "audiocpu")
|
||||
, m_dsp(*this, "dsp")
|
||||
, m_tc0080vco(*this, "tc0080vco")
|
||||
, m_tc0220ioc(*this, "tc0220ioc")
|
||||
, m_yoke(*this, "yokectrl")
|
||||
, m_gfxdecode(*this, "gfxdecode")
|
||||
, m_screen(*this, "screen")
|
||||
, m_palette(*this, "palette")
|
||||
{ }
|
||||
|
||||
void airsys(machine_config &config);
|
||||
|
||||
@ -145,3 +149,5 @@ private:
|
||||
void airsys_map(address_map &map);
|
||||
void sound_map(address_map &map);
|
||||
};
|
||||
|
||||
#endif // MAME_INCLUDES_TAITOAIR_H
|
||||
|
@ -18,8 +18,8 @@
|
||||
class volfied_state : public driver_device
|
||||
{
|
||||
public:
|
||||
volfied_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
volfied_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_cchip(*this, "cchip"),
|
||||
|
@ -13,21 +13,9 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// INTERFACE CONFIGURATION MACROS
|
||||
//**************************************************************************
|
||||
|
||||
#define MCFG_NEOGEO_MEMCARD_ADD(_tag) \
|
||||
MCFG_DEVICE_ADD(_tag, NG_MEMCARD, 0)
|
||||
|
||||
/***************************************************************************
|
||||
FUNCTION PROTOTYPES
|
||||
***************************************************************************/
|
||||
|
||||
// ======================> ng_memcard_device
|
||||
|
||||
class ng_memcard_device : public device_t,
|
||||
public device_image_interface
|
||||
class ng_memcard_device : public device_t, public device_image_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -35,6 +23,7 @@ public:
|
||||
|
||||
virtual iodevice_t image_type() const override { return IO_MEMCARD; }
|
||||
|
||||
// device_image_interface implementation
|
||||
virtual bool is_readable() const override { return true; }
|
||||
virtual bool is_writeable() const override { return true; }
|
||||
virtual bool is_creatable() const override { return true; }
|
||||
@ -46,14 +35,16 @@ public:
|
||||
virtual void call_unload() override;
|
||||
virtual image_init_result call_create(int format_type, util::option_resolution *format_options) override;
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
|
||||
// bus interface
|
||||
DECLARE_READ8_MEMBER(read);
|
||||
DECLARE_WRITE8_MEMBER(write);
|
||||
|
||||
/* returns the index of the current memory card, or -1 if none */
|
||||
int present() { return is_loaded() ? 0 : -1; }
|
||||
bool present() { return is_loaded(); }
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
uint8_t m_memcard_data[0x800];
|
||||
};
|
||||
|
@ -9,8 +9,6 @@
|
||||
|
||||
#include "osdcore.h"
|
||||
|
||||
#define MCFG_S32COMM_ADD(_tag ) \
|
||||
MCFG_DEVICE_ADD(_tag, S32COMM, 0)
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
|
@ -11,19 +11,15 @@
|
||||
#include "sound/st0016.h"
|
||||
#include "screen.h"
|
||||
|
||||
typedef device_delegate<uint8_t (void)> st0016_dma_offs_delegate;
|
||||
#define ST0016_DMA_OFFS_CB(name) uint8_t name(void)
|
||||
|
||||
#define MCFG_ST0016_DMA_OFFS_CB(_class, _method) \
|
||||
downcast<st0016_cpu_device &>(*device).set_dma_offs_callback(st0016_dma_offs_delegate(&_class::_method, #_class "::" #_method, this));
|
||||
|
||||
|
||||
class st0016_cpu_device : public z80_device, public device_gfx_interface
|
||||
{
|
||||
public:
|
||||
typedef device_delegate<uint8_t ()> dma_offs_delegate;
|
||||
|
||||
st0016_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t);
|
||||
|
||||
template <typename Object> void set_dma_offs_callback(Object &&callback) { m_dma_offs_cb = std::forward<Object>(callback); }
|
||||
template <typename... T> void set_dma_offs_callback(T &&... args) { m_dma_offs_cb = dma_offs_delegate(std::forward<T>(args)...); }
|
||||
|
||||
DECLARE_WRITE8_MEMBER(st0016_sprite_bank_w);
|
||||
DECLARE_WRITE8_MEMBER(st0016_palette_bank_w);
|
||||
@ -100,7 +96,7 @@ protected:
|
||||
|
||||
private:
|
||||
uint8_t m_dma_offset;
|
||||
st0016_dma_offs_delegate m_dma_offs_cb;
|
||||
dma_offs_delegate m_dma_offs_cb;
|
||||
uint32_t m_game_flag;
|
||||
|
||||
DECLARE_READ8_MEMBER(soundram_read);
|
||||
|
@ -17,8 +17,6 @@ DECLARE_DEVICE_TYPE(ARKANOID_68705P5, arkanoid_68705p5_device)
|
||||
class taito68705_mcu_device_base : public device_t
|
||||
{
|
||||
public:
|
||||
template <typename Obj> devcb_base &set_semaphore_cb(Obj &&cb) { return m_semaphore_cb.set_callback(std::forward<Obj>(cb)); }
|
||||
|
||||
// host interface
|
||||
DECLARE_READ8_MEMBER(data_r);
|
||||
DECLARE_WRITE8_MEMBER(data_w);
|
||||
@ -36,6 +34,8 @@ protected:
|
||||
device_t *owner,
|
||||
u32 clock);
|
||||
|
||||
auto semaphore_cb() { return m_semaphore_cb.bind(); }
|
||||
|
||||
// MCU callbacks
|
||||
DECLARE_WRITE8_MEMBER(mcu_pa_w);
|
||||
|
||||
@ -62,13 +62,10 @@ private:
|
||||
};
|
||||
|
||||
|
||||
#define MCFG_TAITO_M68705_AUX_STROBE_CB(cb) \
|
||||
downcast<taito68705_mcu_device &>(*device).set_aux_strobe_cb(DEVCB_##cb);
|
||||
|
||||
class taito68705_mcu_device : public taito68705_mcu_device_base
|
||||
{
|
||||
public:
|
||||
template <typename Obj> devcb_base &set_aux_strobe_cb(Obj &&cb) { return m_aux_strobe_cb.set_callback(std::forward<Obj>(cb)); }
|
||||
auto aux_strobe_cb() { return m_aux_strobe_cb.bind(); }
|
||||
|
||||
taito68705_mcu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
@ -97,16 +94,11 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
#define MCFG_ARKANOID_MCU_SEMAPHORE_CB(cb) \
|
||||
downcast<arkanoid_mcu_device_base &>(*device).set_semaphore_cb(DEVCB_##cb);
|
||||
|
||||
#define MCFG_ARKANOID_MCU_PORTB_R_CB(cb) \
|
||||
downcast<arkanoid_mcu_device_base &>(*device).set_portb_r_cb(DEVCB_##cb);
|
||||
|
||||
class arkanoid_mcu_device_base : public taito68705_mcu_device_base
|
||||
{
|
||||
public:
|
||||
template <typename Obj> devcb_base &set_portb_r_cb(Obj &&cb) { return m_portb_r_cb.set_callback(std::forward<Obj>(cb)); }
|
||||
using taito68705_mcu_device_base::semaphore_cb;
|
||||
auto portb_r_cb() { return m_portb_r_cb.bind(); }
|
||||
|
||||
protected:
|
||||
arkanoid_mcu_device_base(
|
||||
|
@ -99,10 +99,13 @@ This chip *ALWAYS* has a bypass capacitor (ceramic, 104, 0.10 uF) soldered on to
|
||||
#include "emu.h"
|
||||
#include "machine/taitocchip.h"
|
||||
|
||||
#include "cpu/upd7810/upd7811.h"
|
||||
|
||||
|
||||
DEFINE_DEVICE_TYPE(TAITO_CCHIP, taito_cchip_device, "cchip", "Taito TC0030CMD (C-Chip)")
|
||||
|
||||
taito_cchip_device::taito_cchip_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, TAITO_CCHIP, tag, owner, clock),
|
||||
taito_cchip_device::taito_cchip_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, TAITO_CCHIP, tag, owner, clock),
|
||||
m_upd7811(*this, "upd7811"),
|
||||
m_upd4464_bank(*this, "upd4464_bank"),
|
||||
m_upd4464_bank68(*this, "upd4464_bank68"),
|
||||
@ -157,7 +160,9 @@ WRITE8_MEMBER(taito_cchip_device::asic_w)
|
||||
m_upd4464_bank->set_bank(data & 0x7);
|
||||
}
|
||||
else
|
||||
m_asic_ram[offset&3] = data;
|
||||
{
|
||||
m_asic_ram[offset & 3] = data;
|
||||
}
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(taito_cchip_device::asic68_w)
|
||||
@ -169,159 +174,87 @@ WRITE8_MEMBER(taito_cchip_device::asic68_w)
|
||||
m_upd4464_bank68->set_bank(data & 0x7);
|
||||
}
|
||||
else
|
||||
m_asic_ram[offset&3] = data;
|
||||
{
|
||||
m_asic_ram[offset & 3] = data;
|
||||
}
|
||||
}
|
||||
|
||||
READ8_MEMBER(taito_cchip_device::mem_r)
|
||||
{
|
||||
offset &= 0x3ff;
|
||||
return m_upd4464_bank->read8(space,offset);
|
||||
return m_upd4464_bank->read8(space, offset & 0x03ff);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(taito_cchip_device::mem_w)
|
||||
{
|
||||
offset &= 0x3ff;
|
||||
return m_upd4464_bank->write8(space,offset,data);
|
||||
return m_upd4464_bank->write8(space, offset & 0x03ff, data);
|
||||
}
|
||||
|
||||
READ8_MEMBER(taito_cchip_device::mem68_r)
|
||||
{
|
||||
offset &= 0x3ff;
|
||||
return m_upd4464_bank68->read8(space,offset);
|
||||
return m_upd4464_bank68->read8(space, offset & 0x03ff);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(taito_cchip_device::mem68_w)
|
||||
{
|
||||
offset &= 0x3ff;
|
||||
return m_upd4464_bank68->write8(space,offset,data);
|
||||
return m_upd4464_bank68->write8(space, offset & 0x03ff, data);
|
||||
}
|
||||
|
||||
void taito_cchip_device::cchip_map(address_map &map)
|
||||
{
|
||||
//AM_RANGE(0x0000, 0x0fff) AM_ROM // internal ROM of uPD7811
|
||||
map(0x1000, 0x13ff).m("upd4464_bank", FUNC(address_map_bank_device::amap8));
|
||||
map(0x1000, 0x13ff).m(m_upd4464_bank, FUNC(address_map_bank_device::amap8));
|
||||
map(0x1400, 0x17ff).rw(FUNC(taito_cchip_device::asic_r), FUNC(taito_cchip_device::asic_w));
|
||||
map(0x2000, 0x3fff).rom().region("cchip_eprom", 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
WRITE8_MEMBER(taito_cchip_device::porta_w)
|
||||
void taito_cchip_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
m_out_pa_cb(data);
|
||||
}
|
||||
upd7811_device &upd(UPD7811(config, m_upd7811, DERIVED_CLOCK(1, 1)));
|
||||
upd.set_addrmap(AS_PROGRAM, &taito_cchip_device::cchip_map);
|
||||
upd.pa_in_cb().set([this] { return m_in_pa_cb(); });
|
||||
upd.pb_in_cb().set([this] { return m_in_pb_cb(); });
|
||||
upd.pc_in_cb().set([this] { return m_in_pc_cb(); });
|
||||
upd.pa_out_cb().set([this] (u8 data) { m_out_pa_cb(data); });
|
||||
upd.pb_out_cb().set([this] (u8 data) { m_out_pb_cb(data); });
|
||||
upd.pc_out_cb().set([this] (u8 data) { m_out_pc_cb(data); });
|
||||
upd.pf_out_cb().set([this] (u8 data) { logerror("%s port F written %.2x\n", machine().describe_context(), data); }); // internal? related to locking out the 68k?
|
||||
upd.an0_func().set([this] { return BIT(m_in_ad_cb(), 0); });
|
||||
upd.an1_func().set([this] { return BIT(m_in_ad_cb(), 1); });
|
||||
upd.an2_func().set([this] { return BIT(m_in_ad_cb(), 2); });
|
||||
upd.an3_func().set([this] { return BIT(m_in_ad_cb(), 3); });
|
||||
upd.an4_func().set([this] { return BIT(m_in_ad_cb(), 4); });
|
||||
upd.an5_func().set([this] { return BIT(m_in_ad_cb(), 5); });
|
||||
upd.an6_func().set([this] { return BIT(m_in_ad_cb(), 6); });
|
||||
upd.an7_func().set([this] { return BIT(m_in_ad_cb(), 7); });
|
||||
|
||||
WRITE8_MEMBER(taito_cchip_device::portb_w)
|
||||
{
|
||||
m_out_pb_cb(data);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(taito_cchip_device::portc_w)
|
||||
{
|
||||
m_out_pc_cb(data);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(taito_cchip_device::portf_w)
|
||||
{
|
||||
// internal? related to locking out the 68k?
|
||||
logerror("%s port F written %.2x\n", machine().describe_context(), data);
|
||||
}
|
||||
|
||||
READ8_MEMBER(taito_cchip_device::porta_r)
|
||||
{
|
||||
return m_in_pa_cb();
|
||||
}
|
||||
|
||||
READ8_MEMBER(taito_cchip_device::portb_r)
|
||||
{
|
||||
return m_in_pb_cb();
|
||||
}
|
||||
|
||||
READ8_MEMBER(taito_cchip_device::portc_r)
|
||||
{
|
||||
return m_in_pc_cb();
|
||||
}
|
||||
|
||||
|
||||
READ_LINE_MEMBER( taito_cchip_device::an0_r )
|
||||
{
|
||||
return BIT(m_in_ad_cb(), 0);
|
||||
}
|
||||
|
||||
READ_LINE_MEMBER( taito_cchip_device::an1_r )
|
||||
{
|
||||
return BIT(m_in_ad_cb(), 1);
|
||||
}
|
||||
|
||||
READ_LINE_MEMBER( taito_cchip_device::an2_r )
|
||||
{
|
||||
return BIT(m_in_ad_cb(), 2);
|
||||
}
|
||||
|
||||
|
||||
READ_LINE_MEMBER( taito_cchip_device::an3_r )
|
||||
{
|
||||
return BIT(m_in_ad_cb(), 3);
|
||||
}
|
||||
|
||||
READ_LINE_MEMBER( taito_cchip_device::an4_r )
|
||||
{
|
||||
return BIT(m_in_ad_cb(), 4);
|
||||
}
|
||||
|
||||
READ_LINE_MEMBER( taito_cchip_device::an5_r )
|
||||
{
|
||||
return BIT(m_in_ad_cb(), 5);
|
||||
}
|
||||
|
||||
READ_LINE_MEMBER( taito_cchip_device::an6_r )
|
||||
{
|
||||
return BIT(m_in_ad_cb(), 6);
|
||||
}
|
||||
|
||||
READ_LINE_MEMBER( taito_cchip_device::an7_r )
|
||||
{
|
||||
return BIT(m_in_ad_cb(), 7);
|
||||
}
|
||||
|
||||
|
||||
|
||||
MACHINE_CONFIG_START(taito_cchip_device::device_add_mconfig)
|
||||
MCFG_DEVICE_ADD("upd7811", UPD7811, DERIVED_CLOCK(1,1))
|
||||
MCFG_DEVICE_PROGRAM_MAP(cchip_map)
|
||||
MCFG_UPD7810_PORTA_READ_CB(READ8(*this, taito_cchip_device, porta_r))
|
||||
MCFG_UPD7810_PORTB_READ_CB(READ8(*this, taito_cchip_device, portb_r))
|
||||
MCFG_UPD7810_PORTC_READ_CB(READ8(*this, taito_cchip_device, portc_r))
|
||||
MCFG_UPD7810_PORTA_WRITE_CB(WRITE8(*this, taito_cchip_device, porta_w))
|
||||
MCFG_UPD7810_PORTB_WRITE_CB(WRITE8(*this, taito_cchip_device, portb_w))
|
||||
MCFG_UPD7810_PORTC_WRITE_CB(WRITE8(*this, taito_cchip_device, portc_w))
|
||||
MCFG_UPD7810_PORTF_WRITE_CB(WRITE8(*this, taito_cchip_device, portf_w))
|
||||
MCFG_UPD7810_AN0(READLINE(*this, taito_cchip_device, an0_r))
|
||||
MCFG_UPD7810_AN1(READLINE(*this, taito_cchip_device, an1_r))
|
||||
MCFG_UPD7810_AN2(READLINE(*this, taito_cchip_device, an2_r))
|
||||
MCFG_UPD7810_AN3(READLINE(*this, taito_cchip_device, an3_r))
|
||||
MCFG_UPD7810_AN4(READLINE(*this, taito_cchip_device, an4_r))
|
||||
MCFG_UPD7810_AN5(READLINE(*this, taito_cchip_device, an5_r))
|
||||
MCFG_UPD7810_AN6(READLINE(*this, taito_cchip_device, an6_r))
|
||||
MCFG_UPD7810_AN7(READLINE(*this, taito_cchip_device, an7_r))
|
||||
|
||||
MCFG_DEVICE_ADD("upd4464_bank", ADDRESS_MAP_BANK, 0)
|
||||
MCFG_DEVICE_PROGRAM_MAP(cchip_ram_bank)
|
||||
MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_LITTLE)
|
||||
MCFG_ADDRESS_MAP_BANK_DATA_WIDTH(8)
|
||||
MCFG_ADDRESS_MAP_BANK_ADDR_WIDTH(13)
|
||||
MCFG_ADDRESS_MAP_BANK_STRIDE(0x400)
|
||||
ADDRESS_MAP_BANK(config, m_upd4464_bank, 0);
|
||||
m_upd4464_bank->set_map(&taito_cchip_device::cchip_ram_bank);
|
||||
m_upd4464_bank->set_endianness(ENDIANNESS_LITTLE);
|
||||
m_upd4464_bank->set_data_width(8);
|
||||
m_upd4464_bank->set_addr_width(13);
|
||||
m_upd4464_bank->set_stride(0x400);
|
||||
|
||||
// the 68k has a different view into the banked memory?
|
||||
MCFG_DEVICE_ADD("upd4464_bank68", ADDRESS_MAP_BANK, 0)
|
||||
MCFG_DEVICE_PROGRAM_MAP(cchip_ram_bank68)
|
||||
MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_LITTLE)
|
||||
MCFG_ADDRESS_MAP_BANK_DATA_WIDTH(8)
|
||||
MCFG_ADDRESS_MAP_BANK_ADDR_WIDTH(13)
|
||||
MCFG_ADDRESS_MAP_BANK_STRIDE(0x400)
|
||||
MACHINE_CONFIG_END
|
||||
ADDRESS_MAP_BANK(config, m_upd4464_bank68, 0);
|
||||
m_upd4464_bank68->set_map(&taito_cchip_device::cchip_ram_bank68);
|
||||
m_upd4464_bank68->set_endianness(ENDIANNESS_LITTLE);
|
||||
m_upd4464_bank68->set_data_width(8);
|
||||
m_upd4464_bank68->set_addr_width(13);
|
||||
m_upd4464_bank68->set_stride(0x400);
|
||||
}
|
||||
|
||||
void taito_cchip_device::device_resolve_objects()
|
||||
{
|
||||
m_in_pa_cb.resolve_safe(0);
|
||||
m_in_pb_cb.resolve_safe(0);
|
||||
m_in_pc_cb.resolve_safe(0);
|
||||
m_in_ad_cb.resolve_safe(0);
|
||||
m_out_pa_cb.resolve_safe();
|
||||
m_out_pb_cb.resolve_safe();
|
||||
m_out_pc_cb.resolve_safe();
|
||||
}
|
||||
|
||||
void taito_cchip_device::device_start()
|
||||
{
|
||||
@ -330,14 +263,6 @@ void taito_cchip_device::device_start()
|
||||
|
||||
save_item(NAME(m_asic_ram));
|
||||
m_asic_ram[0] = m_asic_ram[1] = m_asic_ram[2] = m_asic_ram[3] = 0;
|
||||
|
||||
m_in_pa_cb.resolve_safe(0);
|
||||
m_in_pb_cb.resolve_safe(0);
|
||||
m_in_pc_cb.resolve_safe(0);
|
||||
m_in_ad_cb.resolve_safe(0);
|
||||
m_out_pa_cb.resolve_safe();
|
||||
m_out_pb_cb.resolve_safe();
|
||||
m_out_pc_cb.resolve_safe();
|
||||
}
|
||||
|
||||
void taito_cchip_device::device_reset()
|
||||
|
@ -1,40 +1,14 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Haywood, Jonathan Gevaryahu
|
||||
|
||||
#ifndef MAME_MACHINE_TAITOCCHIP_H
|
||||
#define MAME_MACHINE_TAITOCCHIP_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cpu/upd7810/upd7811.h"
|
||||
#include "machine/bankdev.h"
|
||||
|
||||
DECLARE_DEVICE_TYPE(TAITO_CCHIP, taito_cchip_device)
|
||||
|
||||
#define MCFG_TAITO_CCHIP_ADD(_tag, _clock) \
|
||||
MCFG_DEVICE_ADD(_tag, TAITO_CCHIP, _clock)
|
||||
|
||||
#define MCFG_CCHIP_IN_PORTA_CB(_devcb) \
|
||||
downcast<taito_cchip_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
|
||||
|
||||
#define MCFG_CCHIP_IN_PORTB_CB(_devcb) \
|
||||
downcast<taito_cchip_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
|
||||
|
||||
#define MCFG_CCHIP_IN_PORTC_CB(_devcb) \
|
||||
downcast<taito_cchip_device &>(*device).set_in_pc_callback(DEVCB_##_devcb);
|
||||
|
||||
#define MCFG_CCHIP_IN_PORTAD_CB(_devcb) \
|
||||
downcast<taito_cchip_device &>(*device).set_in_ad_callback(DEVCB_##_devcb);
|
||||
|
||||
#define MCFG_CCHIP_OUT_PORTA_CB(_devcb) \
|
||||
downcast<taito_cchip_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
|
||||
|
||||
#define MCFG_CCHIP_OUT_PORTB_CB(_devcb) \
|
||||
downcast<taito_cchip_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
|
||||
|
||||
#define MCFG_CCHIP_OUT_PORTC_CB(_devcb) \
|
||||
downcast<taito_cchip_device &>(*device).set_out_pc_callback(DEVCB_##_devcb);
|
||||
|
||||
|
||||
class taito_cchip_device : public device_t
|
||||
{
|
||||
@ -42,14 +16,13 @@ public:
|
||||
// construction/destruction
|
||||
taito_cchip_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
template <class Object> devcb_base &set_in_pa_callback(Object &&cb) { return m_in_pa_cb.set_callback(std::forward<Object>(cb)); }
|
||||
template <class Object> devcb_base &set_in_pb_callback(Object &&cb) { return m_in_pb_cb.set_callback(std::forward<Object>(cb)); }
|
||||
template <class Object> devcb_base &set_in_pc_callback(Object &&cb) { return m_in_pc_cb.set_callback(std::forward<Object>(cb)); }
|
||||
template <class Object> devcb_base &set_in_ad_callback(Object &&cb) { return m_in_ad_cb.set_callback(std::forward<Object>(cb)); }
|
||||
template <class Object> devcb_base &set_out_pa_callback(Object &&cb) { return m_out_pa_cb.set_callback(std::forward<Object>(cb)); }
|
||||
template <class Object> devcb_base &set_out_pb_callback(Object &&cb) { return m_out_pb_cb.set_callback(std::forward<Object>(cb)); }
|
||||
template <class Object> devcb_base &set_out_pc_callback(Object &&cb) { return m_out_pc_cb.set_callback(std::forward<Object>(cb)); }
|
||||
|
||||
auto in_pa_callback() { return m_in_pa_cb.bind(); }
|
||||
auto in_pb_callback() { return m_in_pb_cb.bind(); }
|
||||
auto in_pc_callback() { return m_in_pc_cb.bind(); }
|
||||
auto in_ad_callback() { return m_in_ad_cb.bind(); }
|
||||
auto out_pa_callback() { return m_out_pa_cb.bind(); }
|
||||
auto out_pb_callback() { return m_out_pb_cb.bind(); }
|
||||
auto out_pc_callback() { return m_out_pc_cb.bind(); }
|
||||
|
||||
// can be accessed externally
|
||||
DECLARE_READ8_MEMBER(asic_r);
|
||||
@ -62,33 +35,15 @@ public:
|
||||
DECLARE_READ8_MEMBER(mem68_r);
|
||||
DECLARE_WRITE8_MEMBER(mem68_w);
|
||||
|
||||
void ext_interrupt(int state);
|
||||
|
||||
protected:
|
||||
void cchip_map(address_map &map);
|
||||
void cchip_ram_bank(address_map &map);
|
||||
void cchip_ram_bank68(address_map &map);
|
||||
|
||||
DECLARE_READ8_MEMBER(porta_r);
|
||||
DECLARE_READ8_MEMBER(portb_r);
|
||||
DECLARE_READ8_MEMBER(portc_r);
|
||||
|
||||
DECLARE_WRITE8_MEMBER(porta_w);
|
||||
DECLARE_WRITE8_MEMBER(portb_w);
|
||||
DECLARE_WRITE8_MEMBER(portc_w);
|
||||
DECLARE_WRITE8_MEMBER(portf_w);
|
||||
|
||||
DECLARE_READ_LINE_MEMBER(an0_r);
|
||||
DECLARE_READ_LINE_MEMBER(an1_r);
|
||||
DECLARE_READ_LINE_MEMBER(an2_r);
|
||||
DECLARE_READ_LINE_MEMBER(an3_r);
|
||||
DECLARE_READ_LINE_MEMBER(an4_r);
|
||||
DECLARE_READ_LINE_MEMBER(an5_r);
|
||||
DECLARE_READ_LINE_MEMBER(an6_r);
|
||||
DECLARE_READ_LINE_MEMBER(an7_r);
|
||||
|
||||
void ext_interrupt(int state);
|
||||
|
||||
protected:
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_resolve_objects() override;
|
||||
virtual void device_start() override;
|
||||
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||
virtual void device_reset() override;
|
||||
@ -110,4 +65,4 @@ private:
|
||||
devcb_write8 m_out_pc_cb;
|
||||
};
|
||||
|
||||
#endif // MAME_MACHINE_CCHIP_DEV_H
|
||||
#endif // MAME_MACHINE_TAITOCCHIP_H
|
||||
|
@ -11,21 +11,10 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// INTERFACE CONFIGURATION MACROS
|
||||
//**************************************************************************
|
||||
|
||||
#define MCFG_TAITOIO_YOKE_ADD(_tag) \
|
||||
MCFG_DEVICE_ADD(_tag, TAITOIO_YOKE, 0)
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> namcoio_gearbox_device
|
||||
|
||||
class taitoio_yoke_device : public device_t
|
||||
{
|
||||
public:
|
||||
@ -44,10 +33,9 @@ public:
|
||||
DECLARE_READ_LINE_MEMBER( handle_up_r );
|
||||
DECLARE_READ_LINE_MEMBER( handle_down_r );
|
||||
|
||||
|
||||
protected:
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
// virtual void device_validity_check(validity_checker &valid) const;
|
||||
virtual void device_start() override;
|
||||
@ -58,12 +46,4 @@ protected:
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(TAITOIO_YOKE, taitoio_yoke_device)
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// GLOBAL VARIABLES
|
||||
//**************************************************************************
|
||||
|
||||
|
||||
|
||||
#endif // MAME_MACHINE_TAITO_YOKE_H
|
||||
|
Loading…
Reference in New Issue
Block a user