n64, pc1251, model2, midyunit, konamigx, k054338: Remove machine().device lookups, nw

This commit is contained in:
mooglyguy 2018-05-28 20:14:49 +02:00
parent ce5cf7ae2c
commit 349cb3cd64
35 changed files with 156 additions and 143 deletions

View File

@ -49,6 +49,9 @@ public:
DECLARE_WRITE8_MEMBER(cvsd_clock_set_w); DECLARE_WRITE8_MEMBER(cvsd_clock_set_w);
void williams_cvsd_map(address_map &map); void williams_cvsd_map(address_map &map);
mc6809e_device *get_cpu() { return m_cpu; }
protected: protected:
// device-level overrides // device-level overrides
virtual void device_add_mconfig(machine_config &config) override; virtual void device_add_mconfig(machine_config &config) override;
@ -98,6 +101,9 @@ public:
void williams_narc_master_map(address_map &map); void williams_narc_master_map(address_map &map);
void williams_narc_slave_map(address_map &map); void williams_narc_slave_map(address_map &map);
mc6809e_device *get_cpu() { return m_cpu0; }
protected: protected:
// device-level overrides // device-level overrides
virtual void device_add_mconfig(machine_config &config) override; virtual void device_add_mconfig(machine_config &config) override;

View File

@ -286,7 +286,7 @@ MACHINE_CONFIG_START(asterix_state::asterix)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(asterix_state, tile_callback) MCFG_K056832_CB(asterix_state, tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 1, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 1)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
MCFG_DEVICE_ADD("k053244", K053244, 0) MCFG_DEVICE_ADD("k053244", K053244, 0)

View File

@ -468,7 +468,7 @@ MACHINE_CONFIG_START(bishi_state::bishi)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(bishi_state, tile_callback) MCFG_K056832_CB(bishi_state, tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 1, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 1, 0)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
MCFG_DEVICE_ADD("k054338", K054338, 0) MCFG_DEVICE_ADD("k054338", K054338, 0)
@ -491,7 +491,7 @@ MACHINE_CONFIG_START(bishi_state::dobouchn)
// TODO: change accordingly (ASCII charset definitely not 8bpp, 5bpp perhaps?) // TODO: change accordingly (ASCII charset definitely not 8bpp, 5bpp perhaps?)
MCFG_DEVICE_MODIFY("k056832") MCFG_DEVICE_MODIFY("k056832")
// MCFG_K056832_CB(bishi_state, dobouchn_tile_callback) // MCFG_K056832_CB(bishi_state, dobouchn_tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 1, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 1, 0)
MACHINE_CONFIG_END MACHINE_CONFIG_END
// ROM definitions // ROM definitions

View File

@ -356,7 +356,7 @@ MACHINE_CONFIG_START(dbz_state::dbz)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(dbz_state, tile_callback) MCFG_K056832_CB(dbz_state, tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 1, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 1)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
MCFG_DEVICE_ADD("k053246", K053246, 0) MCFG_DEVICE_ADD("k053246", K053246, 0)

View File

@ -1405,7 +1405,7 @@ MACHINE_CONFIG_START(djmain_state::djmainj)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(djmain_state, tile_callback) MCFG_K056832_CB(djmain_state, tile_callback)
MCFG_K056832_CONFIG("gfx2", K056832_BPP_4dj, 1, 1, "none") MCFG_K056832_CONFIG("gfx2", K056832_BPP_4dj, 1, 1)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
MCFG_K055555_ADD("k055555") MCFG_K055555_ADD("k055555")

View File

@ -316,7 +316,7 @@ MACHINE_CONFIG_START(giclassic_state::giclassic)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(giclassic_state, tile_callback) MCFG_K056832_CB(giclassic_state, tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_4PIRATESH, 1, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_4PIRATESH, 1, 0)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -342,7 +342,7 @@ MACHINE_CONFIG_START(giclassicsvr_state::giclassvr)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(giclassicsvr_state, tile_callback) MCFG_K056832_CB(giclassicsvr_state, tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_4PIRATESH, 0, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_4PIRATESH, 0, 0)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
MCFG_DEVICE_ADD("k055673", K055673, 0) MCFG_DEVICE_ADD("k055673", K055673, 0)

View File

@ -319,7 +319,7 @@ MACHINE_CONFIG_START(gijoe_state::gijoe)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(gijoe_state, tile_callback) MCFG_K056832_CB(gijoe_state, tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
MCFG_DEVICE_ADD("k053246", K053246, 0) MCFG_DEVICE_ADD("k053246", K053246, 0)

View File

@ -1655,14 +1655,13 @@ MACHINE_CONFIG_START(konamigx_state::konamigx)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(konamigx_state, type2_tile_callback) MCFG_K056832_CB(konamigx_state, type2_tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 0, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 0, 0)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
MCFG_K055555_ADD("k055555") MCFG_K055555_ADD("k055555")
MCFG_DEVICE_ADD("k054338", K054338, 0) MCFG_DEVICE_ADD("k054338", K054338, 0, "k055555")
MCFG_K054338_MIXER("k055555") MCFG_VIDEO_SET_SCREEN("screen")
MCFG_K054338_SET_SCREEN("screen")
MCFG_K054338_ALPHAINV(1) MCFG_K054338_ALPHAINV(1)
MCFG_DEVICE_ADD("k055673", K055673, 0) MCFG_DEVICE_ADD("k055673", K055673, 0)
@ -1703,7 +1702,7 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(konamigx_state::konamigx_bios) MACHINE_CONFIG_START(konamigx_state::konamigx_bios)
konamigx(config); konamigx(config);
MCFG_DEVICE_MODIFY("k056832") MCFG_DEVICE_MODIFY("k056832")
MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 0, 0, "k055555") MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 0, 0)
MACHINE_CONFIG_END MACHINE_CONFIG_END
MACHINE_CONFIG_START(konamigx_state::gokuparo) MACHINE_CONFIG_START(konamigx_state::gokuparo)
@ -1724,7 +1723,7 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(konamigx_state::tbyahhoo) MACHINE_CONFIG_START(konamigx_state::tbyahhoo)
konamigx(config); konamigx(config);
MCFG_DEVICE_MODIFY("k056832") MCFG_DEVICE_MODIFY("k056832")
MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 0, 0, "k055555") MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 0, 0)
MACHINE_CONFIG_END MACHINE_CONFIG_END
MACHINE_CONFIG_START(konamigx_state::dragoonj) MACHINE_CONFIG_START(konamigx_state::dragoonj)
@ -1736,7 +1735,7 @@ MACHINE_CONFIG_START(konamigx_state::dragoonj)
MCFG_K053252_OFFSETS(24+16, 16) MCFG_K053252_OFFSETS(24+16, 16)
MCFG_DEVICE_MODIFY("k056832") MCFG_DEVICE_MODIFY("k056832")
MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 1, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 1, 0)
MCFG_DEVICE_MODIFY("k055673") MCFG_DEVICE_MODIFY("k055673")
MCFG_K055673_CB(konamigx_state, dragoonj_sprite_callback) MCFG_K055673_CB(konamigx_state, dragoonj_sprite_callback)
@ -1749,7 +1748,7 @@ MACHINE_CONFIG_START(konamigx_state::le2)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", konamigx_state, konamigx_type2_scanline, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", konamigx_state, konamigx_type2_scanline, "screen", 0, 1)
MCFG_DEVICE_MODIFY("k056832") MCFG_DEVICE_MODIFY("k056832")
MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 1, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 1, 0)
MCFG_DEVICE_MODIFY("k055673") MCFG_DEVICE_MODIFY("k055673")
MCFG_K055673_CB(konamigx_state, le2_sprite_callback) MCFG_K055673_CB(konamigx_state, le2_sprite_callback)
@ -1761,7 +1760,7 @@ MACHINE_CONFIG_START(konamigx_state::konamigx_6bpp)
MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_6bpp) MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_6bpp)
MCFG_DEVICE_MODIFY("k056832") MCFG_DEVICE_MODIFY("k056832")
MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 0, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 0, 0)
MCFG_DEVICE_MODIFY("k055673") MCFG_DEVICE_MODIFY("k055673")
MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -46, -23) MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -46, -23)
@ -1770,7 +1769,7 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(konamigx_state::salmndr2) MACHINE_CONFIG_START(konamigx_state::salmndr2)
konamigx(config); konamigx(config);
MCFG_DEVICE_MODIFY("k056832") MCFG_DEVICE_MODIFY("k056832")
MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 1, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 1, 0)
MCFG_DEVICE_MODIFY("k055673") MCFG_DEVICE_MODIFY("k055673")
MCFG_K055673_CB(konamigx_state, salmndr2_sprite_callback) MCFG_K055673_CB(konamigx_state, salmndr2_sprite_callback)
@ -1809,7 +1808,7 @@ MACHINE_CONFIG_START(konamigx_state::racinfrc)
MCFG_K053252_OFFSETS(24-8+16, 0) MCFG_K053252_OFFSETS(24-8+16, 0)
MCFG_DEVICE_MODIFY("k056832") MCFG_DEVICE_MODIFY("k056832")
MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 0, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 0, 0)
MCFG_DEVICE_MODIFY("k055673") MCFG_DEVICE_MODIFY("k055673")
MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -53, -23) MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -53, -23)
@ -1838,7 +1837,7 @@ MACHINE_CONFIG_START(konamigx_state::gxtype3)
MCFG_K053252_SET_SLAVE_SCREEN("screen2") MCFG_K053252_SET_SLAVE_SCREEN("screen2")
MCFG_DEVICE_MODIFY("k056832") MCFG_DEVICE_MODIFY("k056832")
MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 0, 2, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 0, 2)
MCFG_DEVICE_MODIFY("k055673") MCFG_DEVICE_MODIFY("k055673")
MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -132, -23) MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -132, -23)
@ -1898,7 +1897,7 @@ MACHINE_CONFIG_START(konamigx_state::gxtype4)
MCFG_DEVICE_MODIFY("k056832") MCFG_DEVICE_MODIFY("k056832")
MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 0, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 0, 0)
MCFG_DEVICE_MODIFY("k055673") MCFG_DEVICE_MODIFY("k055673")
MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -79, -24) // -23 looks better in intro MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -79, -24) // -23 looks better in intro
@ -1923,7 +1922,7 @@ MACHINE_CONFIG_START(konamigx_state::gxtype4_vsn)
MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type4_vsn) MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type4_vsn)
MCFG_DEVICE_MODIFY("k056832") MCFG_DEVICE_MODIFY("k056832")
MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 0, 2, "none") // set djmain_hack to 2 to kill layer association or half the tilemaps vanish on screen 0 MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 0, 2) // set djmain_hack to 2 to kill layer association or half the tilemaps vanish on screen 0
MCFG_DEVICE_MODIFY("k055673") MCFG_DEVICE_MODIFY("k055673")
MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -132, -23) MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -132, -23)
@ -1947,7 +1946,7 @@ MACHINE_CONFIG_START(konamigx_state::winspike)
MCFG_DEVICE_MODIFY("k056832") MCFG_DEVICE_MODIFY("k056832")
MCFG_K056832_CB(konamigx_state, alpha_tile_callback) MCFG_K056832_CB(konamigx_state, alpha_tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 0, 2, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 0, 2)
MCFG_DEVICE_MODIFY("k055673") MCFG_DEVICE_MODIFY("k055673")
MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_LE2, -53, -23) MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_LE2, -53, -23)

View File

@ -401,7 +401,7 @@ MACHINE_CONFIG_START(konmedal_state::tsukande)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(konmedal_state, tile_callback) MCFG_K056832_CB(konmedal_state, tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
/* sound hardware */ /* sound hardware */
@ -435,7 +435,7 @@ MACHINE_CONFIG_START(konmedal_state::ddboy)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(konmedal_state, tile_callback) MCFG_K056832_CB(konmedal_state, tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
/* sound hardware */ /* sound hardware */

View File

@ -313,7 +313,7 @@ MACHINE_CONFIG_START(konmedal68k_state::kzaurus)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(konmedal68k_state, tile_callback) MCFG_K056832_CB(konmedal68k_state, tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_4dj, 1, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_4dj, 1, 0)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
MCFG_K055555_ADD("k055555") MCFG_K055555_ADD("k055555")

View File

@ -523,7 +523,7 @@ MACHINE_CONFIG_START(lethal_state::lethalen)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(lethal_state, tile_callback) MCFG_K056832_CB(lethal_state, tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_8LE, 1, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_8LE, 1, 0)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
MCFG_DEVICE_ADD("k053244", K053244, 0) MCFG_DEVICE_ADD("k053244", K053244, 0)

View File

@ -535,7 +535,7 @@ MACHINE_CONFIG_START(moo_state::moo)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(moo_state, tile_callback) MCFG_K056832_CB(moo_state, tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
MCFG_K053251_ADD("k053251") MCFG_K053251_ADD("k053251")
@ -592,7 +592,7 @@ MACHINE_CONFIG_START(moo_state::moobl)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(moo_state, tile_callback) MCFG_K056832_CB(moo_state, tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
MCFG_K053251_ADD("k053251") MCFG_K053251_ADD("k053251")

View File

@ -977,7 +977,7 @@ MACHINE_CONFIG_START(mystwarr_state::mystwarr)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(mystwarr_state, mystwarr_tile_callback) MCFG_K056832_CB(mystwarr_state, mystwarr_tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 0, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 0, 0)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
MCFG_K055555_ADD("k055555") MCFG_K055555_ADD("k055555")
@ -987,9 +987,8 @@ MACHINE_CONFIG_START(mystwarr_state::mystwarr)
MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -48, -24) MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -48, -24)
MCFG_K055673_PALETTE("palette") MCFG_K055673_PALETTE("palette")
MCFG_DEVICE_ADD("k054338", K054338, 0) MCFG_DEVICE_ADD("k054338", K054338, 0, "k055555")
MCFG_K054338_ALPHAINV(1) MCFG_K054338_ALPHAINV(1)
MCFG_K054338_MIXER("k055555")
MCFG_VIDEO_START_OVERRIDE(mystwarr_state, mystwarr) MCFG_VIDEO_START_OVERRIDE(mystwarr_state, mystwarr)

View File

@ -40,6 +40,7 @@ public:
m_vram(*this, "vram"), m_vram(*this, "vram"),
m_gfxdecode(*this, "gfxdecode"), m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"), m_screen(*this, "screen"),
m_ramdac(*this, "ramdac"),
m_palette(*this, "palette") { } m_palette(*this, "palette") { }
required_shared_ptr<uint32_t> m_main_ram; required_shared_ptr<uint32_t> m_main_ram;
@ -48,6 +49,7 @@ public:
required_shared_ptr<uint32_t> m_vram; required_shared_ptr<uint32_t> m_vram;
required_device<gfxdecode_device> m_gfxdecode; required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen; required_device<screen_device> m_screen;
required_device<ramdac_device> m_ramdac;
required_device<palette_device> m_palette; required_device<palette_device> m_palette;
uint8_t m_pal[768]; uint8_t m_pal[768];
@ -342,8 +344,6 @@ WRITE32_MEMBER(pinball2k_state::memory_ctrl_w)
// printf("memory_ctrl_w %08X, %08X, %08X\n", data, offset*4, mem_mask); // printf("memory_ctrl_w %08X, %08X, %08X\n", data, offset*4, mem_mask);
if (offset == 0x20/4) if (offset == 0x20/4)
{ {
ramdac_device *ramdac = machine().device<ramdac_device>("ramdac");
if((m_disp_ctrl_reg[DC_GENERAL_CFG] & 0x00e00000) == 0x00400000) if((m_disp_ctrl_reg[DC_GENERAL_CFG] & 0x00e00000) == 0x00400000)
{ {
// guess: crtc params? // guess: crtc params?
@ -352,7 +352,7 @@ WRITE32_MEMBER(pinball2k_state::memory_ctrl_w)
else if((m_disp_ctrl_reg[DC_GENERAL_CFG] & 0x00f00000) == 0x00000000) else if((m_disp_ctrl_reg[DC_GENERAL_CFG] & 0x00f00000) == 0x00000000)
{ {
m_pal_index = data; m_pal_index = data;
ramdac->index_w( space, 0, data ); m_ramdac->index_w( space, 0, data );
} }
else if((m_disp_ctrl_reg[DC_GENERAL_CFG] & 0x00f00000) == 0x00100000) else if((m_disp_ctrl_reg[DC_GENERAL_CFG] & 0x00f00000) == 0x00100000)
{ {
@ -362,7 +362,7 @@ WRITE32_MEMBER(pinball2k_state::memory_ctrl_w)
{ {
m_pal_index = 0; m_pal_index = 0;
} }
ramdac->pal_w( space, 0, data ); m_ramdac->pal_w( space, 0, data );
} }
} }
else else

View File

@ -29,19 +29,19 @@
#include "emu.h" #include "emu.h"
#include "speaker.h" #include "speaker.h"
#include "video/k053250_ps.h"
#include "machine/nvram.h"
#include "machine/timer.h"
#include "cpu/m68000/m68000.h" #include "cpu/m68000/m68000.h"
#include "sound/k054539.h"
#include "includes/konamigx.h" // TODO: WHY? #include "includes/konamigx.h" // TODO: WHY?
#include "video/konami_helper.h"
#include "machine/ticket.h"
#include "machine/gen_latch.h" #include "machine/gen_latch.h"
#include "machine/k053252.h" #include "machine/k053252.h"
#include "video/k055555.h" #include "machine/nvram.h"
#include "video/k054000.h" #include "machine/ticket.h"
#include "machine/timer.h"
#include "sound/k054539.h"
#include "video/k053246_k053247_k055673.h" #include "video/k053246_k053247_k055673.h"
#include "video/k053250_ps.h"
#include "video/k054000.h"
#include "video/k055555.h"
#include "video/konami_helper.h"
class piratesh_state : public driver_device class piratesh_state : public driver_device
{ {
@ -56,6 +56,8 @@ public:
m_k055555(*this, "k055555"), m_k055555(*this, "k055555"),
// m_k053246(*this, "k053246"), // m_k053246(*this, "k053246"),
m_k054539(*this, "k054539"), m_k054539(*this, "k054539"),
m_tickets(*this, "ticket"),
m_hopper(*this, "hopper"),
m_spriteram(*this,"spriteram") m_spriteram(*this,"spriteram")
{ } { }
@ -69,6 +71,9 @@ public:
required_device<k054539_device> m_k054539; required_device<k054539_device> m_k054539;
// required_device<k053247_device> m_k053246; // required_device<k053247_device> m_k053246;
required_device<ticket_dispenser_device> m_tickets;
required_device<ticket_dispenser_device> m_hopper;
optional_shared_ptr<uint16_t> m_spriteram; optional_shared_ptr<uint16_t> m_spriteram;
int m_layer_colorbase[6]; int m_layer_colorbase[6];
@ -376,8 +381,8 @@ WRITE16_MEMBER(piratesh_state::control3_w)
printf("CTRL1 W: %x %x %x\n", offset, data, mem_mask); printf("CTRL1 W: %x %x %x\n", offset, data, mem_mask);
// printf("CTRL 1: %x\n", data & 0x0010); // printf("CTRL 1: %x\n", data & 0x0010);
machine().device<ticket_dispenser_device>("ticket")->motor_w(data & 0x0010 ? 1 : 0); m_tickets->motor_w(data & 0x0010 ? 1 : 0);
machine().device<ticket_dispenser_device>("hopper")->motor_w(data & 0x0020 ? 1 : 0); m_hopper->motor_w(data & 0x0020 ? 1 : 0);
m_control = data; m_control = data;
} }
@ -618,7 +623,7 @@ MACHINE_CONFIG_START(piratesh_state::piratesh)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(piratesh_state, piratesh_tile_callback) MCFG_K056832_CB(piratesh_state, piratesh_tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_4PIRATESH, 1, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_4PIRATESH, 1, 0)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
MCFG_K055555_ADD("k055555") MCFG_K055555_ADD("k055555")
@ -636,9 +641,8 @@ MACHINE_CONFIG_START(piratesh_state::piratesh)
//MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -48+1, 23) //MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -48+1, 23)
//MCFG_K053246_PALETTE("palette") //MCFG_K053246_PALETTE("palette")
MCFG_DEVICE_ADD("k054338", K054338, 0) MCFG_DEVICE_ADD("k054338", K054338, 0, "k055555")
MCFG_K054338_ALPHAINV(1) MCFG_K054338_ALPHAINV(1)
MCFG_K054338_MIXER("k055555")
MCFG_VIDEO_START_OVERRIDE(piratesh_state, piratesh) MCFG_VIDEO_START_OVERRIDE(piratesh_state, piratesh)

View File

@ -552,7 +552,7 @@ MACHINE_CONFIG_START(qdrmfgp_state::qdrmfgp)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(qdrmfgp_state, qdrmfgp_tile_callback) MCFG_K056832_CB(qdrmfgp_state, qdrmfgp_tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_4dj, 1, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_4dj, 1, 0)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
MCFG_DEVICE_ADD("k053252", K053252, XTAL(32'000'000)/4) MCFG_DEVICE_ADD("k053252", K053252, XTAL(32'000'000)/4)
@ -598,7 +598,7 @@ MACHINE_CONFIG_START(qdrmfgp_state::qdrmfgp2)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(qdrmfgp_state, qdrmfgp2_tile_callback) MCFG_K056832_CB(qdrmfgp_state, qdrmfgp2_tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_4dj, 1, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_4dj, 1, 0)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
MCFG_DEVICE_ADD("k053252", K053252, XTAL(32'000'000)/4) MCFG_DEVICE_ADD("k053252", K053252, XTAL(32'000'000)/4)

View File

@ -679,7 +679,7 @@ MACHINE_CONFIG_START(kongambl_state::kongambl)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(kongambl_state, tile_callback) MCFG_K056832_CB(kongambl_state, tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_8TASMAN, 0, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_8TASMAN, 0, 0)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "lspeaker").front_left();

View File

@ -501,7 +501,7 @@ MACHINE_CONFIG_START(xexex_state::xexex)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(xexex_state, tile_callback) MCFG_K056832_CB(xexex_state, tile_callback)
MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0, "none") MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
MCFG_DEVICE_ADD("k053246", K053246, 0) MCFG_DEVICE_ADD("k053246", K053246, 0)

View File

@ -806,7 +806,7 @@ MACHINE_CONFIG_START(zr107_state::zr107)
MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_DEVICE_ADD("k056832", K056832, 0)
MCFG_K056832_CB(zr107_state, tile_callback) MCFG_K056832_CB(zr107_state, tile_callback)
MCFG_K056832_CONFIG("gfx2", K056832_BPP_8, 1, 0, "none") MCFG_K056832_CONFIG("gfx2", K056832_BPP_8, 1, 0)
MCFG_K056832_PALETTE("palette") MCFG_K056832_PALETTE("palette")
MCFG_DEVICE_ADD("k001005", K001005, 0, "k001006_1") MCFG_DEVICE_ADD("k001005", K001005, 0, "k001006_1")

View File

@ -3,17 +3,18 @@
#ifndef MAME_INCLUDES_KONAMIGX_H #ifndef MAME_INCLUDES_KONAMIGX_H
#define MAME_INCLUDES_KONAMIGX_H #define MAME_INCLUDES_KONAMIGX_H
#include "sound/k056800.h"
#include "sound/k054539.h"
#include "cpu/tms57002/tms57002.h" #include "cpu/tms57002/tms57002.h"
#include "machine/adc083x.h" #include "machine/adc083x.h"
#include "machine/k053252.h" #include "machine/k053252.h"
#include "machine/timer.h" #include "machine/timer.h"
#include "video/k054156_k054157_k056832.h" #include "sound/k056800.h"
#include "sound/k054539.h"
#include "video/k053246_k053247_k055673.h" #include "video/k053246_k053247_k055673.h"
#include "video/k055555.h" #include "video/k053250.h"
#include "video/k054338.h"
#include "video/k053936.h" #include "video/k053936.h"
#include "video/k054156_k054157_k056832.h"
#include "video/k054338.h"
#include "video/k055555.h"
#include "screen.h" #include "screen.h"
class konamigx_state : public driver_device class konamigx_state : public driver_device
@ -32,6 +33,8 @@ public:
, m_k056800(*this, "k056800") , m_k056800(*this, "k056800")
, m_k054539_1(*this, "k054539_1") , m_k054539_1(*this, "k054539_1")
, m_k054539_2(*this, "k054539_2") , m_k054539_2(*this, "k054539_2")
, m_k053250_1(*this, "k053250_1")
, m_k053250_2(*this, "k053250_2")
, m_gfxdecode(*this, "gfxdecode") , m_gfxdecode(*this, "gfxdecode")
, m_screen(*this, "screen") , m_screen(*this, "screen")
, m_palette(*this, "palette") , m_palette(*this, "palette")
@ -198,6 +201,8 @@ protected:
optional_device<k056800_device> m_k056800; optional_device<k056800_device> m_k056800;
optional_device<k054539_device> m_k054539_1; optional_device<k054539_device> m_k054539_1;
optional_device<k054539_device> m_k054539_2; optional_device<k054539_device> m_k054539_2;
optional_device<k053250_device> m_k053250_1;
optional_device<k053250_device> m_k053250_2;
optional_device<gfxdecode_device> m_gfxdecode; optional_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen; required_device<screen_device> m_screen;
required_device<palette_device> m_palette; required_device<palette_device> m_palette;

View File

@ -55,6 +55,7 @@ public:
, m_adpcm_sound(*this, "adpcm") , m_adpcm_sound(*this, "adpcm")
, m_soundlatch(*this, "soundlatch") , m_soundlatch(*this, "soundlatch")
, m_term2_adc(*this, "adc") , m_term2_adc(*this, "adc")
, m_nvram(*this, "nvram")
, m_generic_paletteram_16(*this, "paletteram") , m_generic_paletteram_16(*this, "paletteram")
, m_gfx_rom(*this, "gfx_rom", 16) , m_gfx_rom(*this, "gfx_rom", 16)
, m_mainram(*this, "mainram") , m_mainram(*this, "mainram")
@ -72,6 +73,7 @@ public:
optional_device<williams_adpcm_sound_device> m_adpcm_sound; optional_device<williams_adpcm_sound_device> m_adpcm_sound;
optional_device<generic_latch_8_device> m_soundlatch; optional_device<generic_latch_8_device> m_soundlatch;
optional_device<adc0844_device> m_term2_adc; optional_device<adc0844_device> m_term2_adc;
required_device<nvram_device> m_nvram;
required_shared_ptr<uint16_t> m_generic_paletteram_16; required_shared_ptr<uint16_t> m_generic_paletteram_16;
optional_shared_ptr<uint8_t> m_gfx_rom; optional_shared_ptr<uint8_t> m_gfx_rom;

View File

@ -1,21 +1,22 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders:R. Belmont, Olivier Galibert, ElSemi, Angelo Salese // copyright-holders:R. Belmont, Olivier Galibert, ElSemi, Angelo Salese
#include "video/poly.h"
#include "audio/dsbz80.h" #include "audio/dsbz80.h"
#include "audio/segam1audio.h" #include "audio/segam1audio.h"
#include "machine/eepromser.h"
#include "machine/i8251.h"
#include "cpu/i960/i960.h" #include "cpu/i960/i960.h"
#include "cpu/mb86233/mb86233.h" #include "cpu/mb86233/mb86233.h"
#include "cpu/sharc/sharc.h" #include "cpu/sharc/sharc.h"
#include "cpu/mb86235/mb86235.h" #include "cpu/mb86235/mb86235.h"
#include "machine/bankdev.h"
#include "machine/gen_fifo.h"
#include "sound/scsp.h"
#include "machine/315-5881_crypt.h" #include "machine/315-5881_crypt.h"
#include "machine/315-5838_317-0229_comp.h" #include "machine/315-5838_317-0229_comp.h"
#include "machine/bankdev.h"
#include "machine/eepromser.h"
#include "machine/gen_fifo.h"
#include "machine/i8251.h"
#include "machine/m2comm.h" #include "machine/m2comm.h"
#include "machine/timer.h" #include "machine/timer.h"
#include "sound/scsp.h"
#include "video/segaic24.h"
#include "video/poly.h"
#include "screen.h" #include "screen.h"
class model2_renderer; class model2_renderer;
@ -43,6 +44,7 @@ public:
m_copro_fifo_out(*this, "copro_fifo_out"), m_copro_fifo_out(*this, "copro_fifo_out"),
m_drivecpu(*this, "drivecpu"), m_drivecpu(*this, "drivecpu"),
m_eeprom(*this, "eeprom"), m_eeprom(*this, "eeprom"),
m_tiles(*this, "tile"),
m_screen(*this, "screen"), m_screen(*this, "screen"),
m_palette(*this, "palette"), m_palette(*this, "palette"),
m_scsp(*this, "scsp"), m_scsp(*this, "scsp"),
@ -100,6 +102,7 @@ protected:
required_device<generic_fifo_u32_device> m_copro_fifo_out; required_device<generic_fifo_u32_device> m_copro_fifo_out;
optional_device<cpu_device> m_drivecpu; optional_device<cpu_device> m_drivecpu;
optional_device<eeprom_serial_93cxx_device> m_eeprom; optional_device<eeprom_serial_93cxx_device> m_eeprom;
required_device<segas24_tile_device> m_tiles;
required_device<screen_device> m_screen; required_device<screen_device> m_screen;
required_device<palette_device> m_palette; required_device<palette_device> m_palette;
optional_device<scsp_device> m_scsp; optional_device<scsp_device> m_scsp;

View File

@ -174,8 +174,8 @@ protected:
private: private:
n64_state* m_n64; n64_state* m_n64;
address_space *m_mem_map; address_space *m_mem_map;
mips3_device *m_vr4300; required_device<mips3_device> m_vr4300;
rsp_device *m_rsp; required_device<rsp_device> m_rsp;
uint32_t *m_rdram; uint32_t *m_rdram;
uint32_t *m_sram; uint32_t *m_sram;
@ -200,7 +200,7 @@ private:
void ai_fifo_pop(); void ai_fifo_pop();
bool ai_delayed_carry; bool ai_delayed_carry;
dmadac_sound_device *ai_dac[2]; required_device_array<dmadac_sound_device, 2> ai_dac;
uint32_t ai_dram_addr; uint32_t ai_dram_addr;
uint32_t ai_len; uint32_t ai_len;
uint32_t ai_control; uint32_t ai_control;

View File

@ -30,7 +30,9 @@ public:
: pocketc_state(mconfig, type, tag), : pocketc_state(mconfig, type, tag),
m_maincpu(*this, "maincpu"), m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"), m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { } m_palette(*this, "palette"),
m_cpu_nvram(*this, "cpu_nvram"),
m_ram_nvram(*this, "ram_nvram") { }
uint8_t m_outa; uint8_t m_outa;
uint8_t m_outb; uint8_t m_outb;
@ -65,8 +67,12 @@ public:
void pc1255_mem(address_map &map); void pc1255_mem(address_map &map);
void pc1260_mem(address_map &map); void pc1260_mem(address_map &map);
void pc1261_mem(address_map &map); void pc1261_mem(address_map &map);
protected: protected:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
required_device<nvram_device> m_cpu_nvram;
required_device<nvram_device> m_ram_nvram;
}; };
#endif // MAME_INCLUDES_PC1251_H #endif // MAME_INCLUDES_PC1251_H

View File

@ -236,11 +236,10 @@ void midyunit_state::init_generic(int bpp, int sound, int prot_start, int prot_e
{ {
offs_t gfx_chunk = m_gfx_rom.bytes() / 4; offs_t gfx_chunk = m_gfx_rom.bytes() / 4;
uint8_t d1, d2, d3, d4, d5, d6; uint8_t d1, d2, d3, d4, d5, d6;
uint8_t *base;
int i; int i;
/* load graphics ROMs */ /* load graphics ROMs */
base = memregion("gfx1")->base(); uint8_t *base = memregion("gfx1")->base();
switch (bpp) switch (bpp)
{ {
case 4: case 4:
@ -287,20 +286,20 @@ void midyunit_state::init_generic(int bpp, int sound, int prot_start, int prot_e
switch (sound) switch (sound)
{ {
case SOUND_CVSD_SMALL: case SOUND_CVSD_SMALL:
machine().device("cvsd:cpu")->memory().space(AS_PROGRAM).install_write_handler(prot_start, prot_end, write8_delegate(FUNC(midyunit_state::cvsd_protection_w), this)); m_cvsd_sound->get_cpu()->space(AS_PROGRAM).install_write_handler(prot_start, prot_end, write8_delegate(FUNC(midyunit_state::cvsd_protection_w), this));
m_cvsd_protection_base = memregion("cvsd:cpu")->base() + 0x10000 + (prot_start - 0x8000); m_cvsd_protection_base = memregion("cvsd:cpu")->base() + 0x10000 + (prot_start - 0x8000);
break; break;
case SOUND_CVSD: case SOUND_CVSD:
machine().device("cvsd:cpu")->memory().space(AS_PROGRAM).install_ram(prot_start, prot_end); m_cvsd_sound->get_cpu()->space(AS_PROGRAM).install_ram(prot_start, prot_end);
break; break;
case SOUND_ADPCM: case SOUND_ADPCM:
machine().device("adpcm:cpu")->memory().space(AS_PROGRAM).install_ram(prot_start, prot_end); m_adpcm_sound->get_cpu()->space(AS_PROGRAM).install_ram(prot_start, prot_end);
break; break;
case SOUND_NARC: case SOUND_NARC:
machine().device("narcsnd:cpu0")->memory().space(AS_PROGRAM).install_ram(prot_start, prot_end); m_narc_sound->get_cpu()->space(AS_PROGRAM).install_ram(prot_start, prot_end);
break; break;
case SOUND_YAWDIM: case SOUND_YAWDIM:

View File

@ -19,6 +19,9 @@ n64_periphs::n64_periphs(const machine_config &mconfig, const char *tag, device_
, dd_present(false) , dd_present(false)
, disk_present(false) , disk_present(false)
, cart_present(false) , cart_present(false)
, m_vr4300(*this, ":maincpu")
, m_rsp(*this, ":rsp")
, ai_dac(*this, "dac%u", 1U)
{ {
for (int32_t i = 0; i < 256; i++) for (int32_t i = 0; i < 256; i++)
{ {
@ -123,8 +126,6 @@ void n64_periphs::device_reset()
{ {
uint32_t *cart = (uint32_t*)machine().root_device().memregion("user2")->base(); uint32_t *cart = (uint32_t*)machine().root_device().memregion("user2")->base();
m_vr4300 = machine().device<mips3_device>("maincpu");
m_rsp = machine().device<rsp_device>("rsp");
m_mem_map = &m_vr4300->space(AS_PROGRAM); m_mem_map = &m_vr4300->space(AS_PROGRAM);
m_rdram = m_n64->rdram(); m_rdram = m_n64->rdram();
@ -158,8 +159,6 @@ void n64_periphs::device_reset()
vi_xscale = 0; vi_xscale = 0;
vi_yscale = 0; vi_yscale = 0;
ai_dac[0] = machine().device<dmadac_sound_device>("dac1");
ai_dac[1] = machine().device<dmadac_sound_device>("dac2");
ai_timer->adjust(attotime::never); ai_timer->adjust(attotime::never);
memset(ai_fifo, 0, sizeof(ai_fifo)); memset(ai_fifo, 0, sizeof(ai_fifo));
ai_fifo_wpos = 0; ai_fifo_wpos = 0;
@ -1271,7 +1270,8 @@ void n64_periphs::ai_dma()
//osd_printf_debug("DACDMA: %x for %x bytes\n", current->address, current->length); //osd_printf_debug("DACDMA: %x for %x bytes\n", current->address, current->length);
dmadac_transfer(&ai_dac[0], 2, 1, 2, current->length/4, ram); ai_dac[0]->transfer(0, 1, 2, current->length/4, ram);
ai_dac[1]->transfer(1, 1, 2, current->length/4, ram);
ai_status |= 0x40000000; ai_status |= 0x40000000;
@ -1287,7 +1287,7 @@ void n64_periphs::ai_dma()
TIMER_CALLBACK_MEMBER(n64_periphs::ai_timer_callback) TIMER_CALLBACK_MEMBER(n64_periphs::ai_timer_callback)
{ {
machine().device<n64_periphs>("rcp")->ai_timer_tick(); ai_timer_tick();
} }
void n64_periphs::ai_timer_tick() void n64_periphs::ai_timer_tick()
@ -1365,10 +1365,17 @@ WRITE32_MEMBER( n64_periphs::ai_reg_w )
break; break;
case 0x10/4: // AI_DACRATE_REG case 0x10/4: // AI_DACRATE_REG
{
ai_dacrate = data & 0x3fff; ai_dacrate = data & 0x3fff;
dmadac_set_frequency(&ai_dac[0], 2, (double)DACRATE_NTSC / (double)(ai_dacrate+1)); const double frequency = (double)DACRATE_NTSC / (double)(ai_dacrate+1);
dmadac_enable(&ai_dac[0], 2, 1);
ai_dac[0]->set_frequency(frequency);
ai_dac[0]->enable(1);
ai_dac[1]->set_frequency(frequency);
ai_dac[1]->enable(1);
break; break;
}
case 0x14/4: // AI_BITRATE_REG case 0x14/4: // AI_BITRATE_REG
ai_bitrate = data & 0xf; ai_bitrate = data & 0xf;
@ -2085,7 +2092,7 @@ void n64_periphs::handle_pif()
TIMER_CALLBACK_MEMBER(n64_periphs::si_dma_callback) TIMER_CALLBACK_MEMBER(n64_periphs::si_dma_callback)
{ {
machine().device<n64_periphs>("rcp")->si_dma_tick(); si_dma_tick();
} }
void n64_periphs::si_dma_tick() void n64_periphs::si_dma_tick()
@ -2712,12 +2719,10 @@ WRITE32_MEMBER( n64_periphs::pif_ram_w )
void n64_state::n64_machine_stop() void n64_state::n64_machine_stop()
{ {
n64_periphs *periphs = machine().device<n64_periphs>("rcp"); if (m_rcp_periphs->m_nvram_image == nullptr)
if( periphs->m_nvram_image == nullptr )
return; return;
device_image_interface *image = dynamic_cast<device_image_interface *>(periphs->m_nvram_image); device_image_interface *image = dynamic_cast<device_image_interface *>(m_rcp_periphs->m_nvram_image);
uint8_t data[0x30800]; uint8_t data[0x30800];
if (m_sram == nullptr) if (m_sram == nullptr)
@ -2728,9 +2733,9 @@ void n64_state::n64_machine_stop()
{ {
memcpy(data, m_sram, 0x20000); memcpy(data, m_sram, 0x20000);
} }
memcpy(data + 0x20000, periphs->m_save_data.eeprom, 0x800); memcpy(data + 0x20000, m_rcp_periphs->m_save_data.eeprom, 0x800);
memcpy(data + 0x20800, periphs->m_save_data.mempak[0], 0x8000); memcpy(data + 0x20800, m_rcp_periphs->m_save_data.mempak[0], 0x8000);
memcpy(data + 0x28800, periphs->m_save_data.mempak[1], 0x8000); memcpy(data + 0x28800, m_rcp_periphs->m_save_data.mempak[1], 0x8000);
image->battery_save(data, 0x30800); image->battery_save(data, 0x30800);
} }
@ -2741,11 +2746,10 @@ void n64_state::machine_start()
/* configure fast RAM regions */ /* configure fast RAM regions */
//m_vr4300->add_fastram(0x00000000, 0x007fffff, false, m_rdram); //m_vr4300->add_fastram(0x00000000, 0x007fffff, false, m_rdram);
rsp_device *rsp = machine().device<rsp_device>("rsp"); m_rsp->rspdrc_set_options(RSPDRC_STRICT_VERIFY);
rsp->rspdrc_set_options(RSPDRC_STRICT_VERIFY); m_rsp->rspdrc_flush_drc_cache();
rsp->rspdrc_flush_drc_cache(); m_rsp->rsp_add_dmem(m_rsp_dmem);
rsp->rsp_add_dmem(m_rsp_dmem); m_rsp->rsp_add_imem(m_rsp_imem);
rsp->rsp_add_imem(m_rsp_imem);
/* add a hook for battery save */ /* add a hook for battery save */
machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(&n64_state::n64_machine_stop,this)); machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(&n64_state::n64_machine_stop,this));

View File

@ -185,7 +185,7 @@ WRITE8_MEMBER(nes_state::fc_in0_w)
void nes_state::init_famicom() void nes_state::init_famicom()
{ {
// setup alt input handlers for additional FC input devices // setup alt input handlers for additional FC input devices
address_space &space = machine().device<cpu_device>("maincpu")->space(AS_PROGRAM); address_space &space = m_maincpu->space(AS_PROGRAM);
space.install_read_handler(0x4016, 0x4016, read8_delegate(FUNC(nes_state::fc_in0_r), this)); space.install_read_handler(0x4016, 0x4016, read8_delegate(FUNC(nes_state::fc_in0_r), this));
space.install_write_handler(0x4016, 0x4016, write8_delegate(FUNC(nes_state::fc_in0_w), this)); space.install_write_handler(0x4016, 0x4016, write8_delegate(FUNC(nes_state::fc_in0_w), this));
space.install_read_handler(0x4017, 0x4017, read8_delegate(FUNC(nes_state::fc_in1_r), this)); space.install_read_handler(0x4017, 0x4017, read8_delegate(FUNC(nes_state::fc_in1_r), this));

View File

@ -92,8 +92,8 @@ void pc1251_state::machine_start()
uint8_t *ram = memregion("maincpu")->base() + 0x8000; uint8_t *ram = memregion("maincpu")->base() + 0x8000;
uint8_t *cpu = m_maincpu->internal_ram(); uint8_t *cpu = m_maincpu->internal_ram();
machine().device<nvram_device>("cpu_nvram")->set_base(cpu, 96); m_cpu_nvram->set_base(cpu, 96);
machine().device<nvram_device>("ram_nvram")->set_base(ram, 0x4800); m_ram_nvram->set_base(ram, 0x4800);
} }
MACHINE_START_MEMBER(pc1251_state,pc1260 ) MACHINE_START_MEMBER(pc1251_state,pc1260 )
@ -101,8 +101,8 @@ MACHINE_START_MEMBER(pc1251_state,pc1260 )
uint8_t *ram = memregion("maincpu")->base() + 0x4000; uint8_t *ram = memregion("maincpu")->base() + 0x4000;
uint8_t *cpu = m_maincpu->internal_ram(); uint8_t *cpu = m_maincpu->internal_ram();
machine().device<nvram_device>("cpu_nvram")->set_base(cpu, 96); m_cpu_nvram->set_base(cpu, 96);
machine().device<nvram_device>("ram_nvram")->set_base(ram, 0x2800); m_ram_nvram->set_base(ram, 0x2800);
} }
void pc1251_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) void pc1251_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)

View File

@ -168,8 +168,6 @@ ones. The other 7 words are ignored. Global scrollx is ignored.
#include "k054156_k054157_k056832.h" #include "k054156_k054157_k056832.h"
#include "konami_helper.h" #include "konami_helper.h"
#include "video/k055555.h" // still needs k055555_get_palette_index
#define VERBOSE 0 #define VERBOSE 0
#include "logmacro.h" #include "logmacro.h"
@ -200,7 +198,6 @@ k056832_device::k056832_device(const machine_config &mconfig, const char *tag, d
m_bpp(-1), m_bpp(-1),
m_big(0), m_big(0),
m_djmain_hack(0), m_djmain_hack(0),
m_k055555_tag(nullptr),
//m_layer_assoc_with_page[K056832_PAGE_COUNT], //m_layer_assoc_with_page[K056832_PAGE_COUNT],
//m_layer_offs[8][2], //m_layer_offs[8][2],
//m_lsram_page[8][2], //m_lsram_page[8][2],
@ -224,7 +221,7 @@ k056832_device::k056832_device(const machine_config &mconfig, const char *tag, d
m_use_ext_linescroll(0), m_use_ext_linescroll(0),
m_uses_tile_banks(0), m_uses_tile_banks(0),
m_cur_tile_bank(0), m_cur_tile_bank(0),
m_k055555(nullptr) m_k055555(*this, finder_base::DUMMY_TAG)
{ {
} }
@ -344,9 +341,6 @@ void k056832_device::device_start()
memset(m_regs, 0x00, sizeof(m_regs) ); memset(m_regs, 0x00, sizeof(m_regs) );
memset(m_regsb, 0x00, sizeof(m_regsb) ); memset(m_regsb, 0x00, sizeof(m_regsb) );
if (m_k055555_tag)
m_k055555 = machine().device<k055555_device>(m_k055555_tag);
/* TODO: understand which elements MUST be init here (to keep correct layer /* TODO: understand which elements MUST be init here (to keep correct layer
associations) and which ones can can be init at RESET, if any */ associations) and which ones can can be init at RESET, if any */

View File

@ -5,6 +5,7 @@
#pragma once #pragma once
#include "video/k055555.h" // still needs k055555_get_palette_index
typedef device_delegate<void (int layer, int *code, int *color, int *flags)> k056832_cb_delegate; typedef device_delegate<void (int layer, int *code, int *color, int *flags)> k056832_cb_delegate;
#define K056832_CB_MEMBER(_name) void _name(int layer, int *code, int *color, int *flags) #define K056832_CB_MEMBER(_name) void _name(int layer, int *code, int *color, int *flags)
@ -12,8 +13,8 @@ typedef device_delegate<void (int layer, int *code, int *color, int *flags)> k05
#define MCFG_K056832_CB(_class, _method) \ #define MCFG_K056832_CB(_class, _method) \
downcast<k056832_device &>(*device).set_k056832_callback(k056832_cb_delegate(&_class::_method, #_class "::" #_method, this)); downcast<k056832_device &>(*device).set_k056832_callback(k056832_cb_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_K056832_CONFIG(_gfx_reg, _bpp, _big, _djmain_hack, _k055555) \ #define MCFG_K056832_CONFIG(_gfx_reg, _bpp, _big, _djmain_hack) \
downcast<k056832_device &>(*device).set_config(_gfx_reg, _bpp, _big, _djmain_hack, _k055555); downcast<k056832_device &>(*device).set_config(_gfx_reg, _bpp, _big, _djmain_hack);
#define K056832_PAGE_COUNT 16 #define K056832_PAGE_COUNT 16
@ -37,16 +38,21 @@ class k055555_device;
class k056832_device : public device_t, public device_gfx_interface class k056832_device : public device_t, public device_gfx_interface
{ {
public: public:
template <typename T> k056832_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&mixer_tag)
: k056832_device(mconfig, tag, owner, clock)
{
m_k055555.set_tag(std::forward<T>(mixer_tag));
}
k056832_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); k056832_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
void set_k056832_callback(k056832_cb_delegate callback) { m_k056832_cb = callback; } void set_k056832_callback(k056832_cb_delegate callback) { m_k056832_cb = callback; }
void set_config(const char *gfx_reg, int bpp, int big, int djmain_hack, const char *k055555) void set_config(const char *gfx_reg, int bpp, int big, int djmain_hack)
{ {
m_rombase.set_tag(gfx_reg); m_rombase.set_tag(gfx_reg);
m_bpp = bpp; m_bpp = bpp;
m_big = big; m_big = big;
m_djmain_hack = djmain_hack; m_djmain_hack = djmain_hack;
m_k055555_tag = k055555;
} }
void SetExtLinescroll(); /* Lethal Enforcers */ void SetExtLinescroll(); /* Lethal Enforcers */
@ -135,9 +141,6 @@ private:
int m_big; int m_big;
int m_djmain_hack; int m_djmain_hack;
const char *m_k055555_tag; // tbyahhoo uses the k056832 together with a k055555
// ROM readback involves reading 2 halves of a word // ROM readback involves reading 2 halves of a word
// from the same location in a row. Reading the // from the same location in a row. Reading the
// RAM window resets this state so you get the first half. // RAM window resets this state so you get the first half.
@ -167,10 +170,7 @@ private:
int m_use_ext_linescroll; int m_use_ext_linescroll;
int m_uses_tile_banks, m_cur_tile_bank; int m_uses_tile_banks, m_cur_tile_bank;
optional_device<k055555_device> m_k055555; /* used to choose colorbase */
k055555_device *m_k055555; /* used to choose colorbase */
void get_tile_info( tile_data &tileinfo, int tile_index, int pageIndex ); void get_tile_info( tile_data &tileinfo, int tile_index, int pageIndex );

View File

@ -24,7 +24,7 @@ k054338_device::k054338_device(const machine_config &mconfig, const char *tag, d
: device_t(mconfig, K054338, tag, owner, clock), : device_t(mconfig, K054338, tag, owner, clock),
device_video_interface(mconfig, *this), device_video_interface(mconfig, *this),
m_alpha_inv(0), m_alpha_inv(0),
m_k055555_tag(nullptr) m_k055555(*this, finder_base::DUMMY_TAG)
{ {
memset(&m_regs, 0, sizeof(m_regs)); memset(&m_regs, 0, sizeof(m_regs));
memset(&m_shd_rgb, 0, sizeof(m_shd_rgb)); memset(&m_shd_rgb, 0, sizeof(m_shd_rgb));
@ -36,8 +36,6 @@ k054338_device::k054338_device(const machine_config &mconfig, const char *tag, d
void k054338_device::device_start() void k054338_device::device_start()
{ {
m_k055555 = m_k055555_tag ? machine().device<k055555_device>(m_k055555_tag) : nullptr;
save_item(NAME(m_regs)); save_item(NAME(m_regs));
save_item(NAME(m_shd_rgb)); save_item(NAME(m_shd_rgb));
} }

View File

@ -26,10 +26,15 @@ class k054338_device : public device_t,
public device_video_interface public device_video_interface
{ {
public: public:
template <typename T> k054338_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&mixer_tag)
: k054338_device(mconfig, tag, owner, clock)
{
m_k055555.set_tag(std::forward<T>(mixer_tag));
}
k054338_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); k054338_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration // configuration
void set_mixer_tag(const char *tag) { m_k055555_tag = tag; }
void set_alpha_invert(int alpha_inv) { m_alpha_inv = alpha_inv; } void set_alpha_invert(int alpha_inv) { m_alpha_inv = alpha_inv; }
DECLARE_WRITE16_MEMBER( word_w ); // "CLCT" registers DECLARE_WRITE16_MEMBER( word_w ); // "CLCT" registers
@ -55,20 +60,13 @@ private:
uint16_t m_regs[32]; uint16_t m_regs[32];
int m_shd_rgb[9]; int m_shd_rgb[9];
int m_alpha_inv; int m_alpha_inv;
const char *m_k055555_tag;
k055555_device *m_k055555; /* used to fill BG color */ optional_device<k055555_device> m_k055555; /* used to fill BG color */
}; };
DECLARE_DEVICE_TYPE(K054338, k054338_device) DECLARE_DEVICE_TYPE(K054338, k054338_device)
#define MCFG_K054338_MIXER(_tag) \
downcast<k054338_device &>(*device).set_mixer_tag(_tag);
#define MCFG_K054338_ALPHAINV(_alphainv) \ #define MCFG_K054338_ALPHAINV(_alphainv) \
downcast<k054338_device &>(*device).set_alpha_invert(_alphainv); downcast<k054338_device &>(*device).set_alpha_invert(_alphainv);
#define MCFG_K054338_SET_SCREEN MCFG_VIDEO_SET_SCREEN
#endif // MAME_VIDEO_K054338_H #endif // MAME_VIDEO_K054338_H

View File

@ -735,7 +735,7 @@ void konamigx_state::gx_draw_basic_extended_tilemaps_1(screen_device &screen, bi
} }
else else
{ {
machine().device<k053250_device>("k053250_1")->draw(bitmap, cliprect, m_vcblk[4]<<l, 0, screen.priority(), 0); m_k053250_1->draw(bitmap, cliprect, m_vcblk[4]<<l, 0, screen.priority(), 0);
} }
} }
} }
@ -804,7 +804,7 @@ void konamigx_state::gx_draw_basic_extended_tilemaps_2(screen_device &screen, bi
} }
} }
else else
machine().device<k053250_device>("k053250_2")->draw(bitmap, cliprect, m_vcblk[5]<<l, 0, screen.priority(), 0); m_k053250_2->draw(bitmap, cliprect, m_vcblk[5]<<l, 0, screen.priority(), 0);
} }
} }

View File

@ -46,7 +46,7 @@ VIDEO_START_MEMBER(midyunit_state,common)
m_local_videoram = make_unique_clear<uint16_t[]>(0x80000/2); m_local_videoram = make_unique_clear<uint16_t[]>(0x80000/2);
m_pen_map = std::make_unique<pen_t[]>(65536); m_pen_map = std::make_unique<pen_t[]>(65536);
machine().device<nvram_device>("nvram")->set_base(m_cmos_ram.get(), 0x2000 * 4); m_nvram->set_base(m_cmos_ram.get(), 0x2000 * 4);
m_dma_timer = timer_alloc(TIMER_DMA); m_dma_timer = timer_alloc(TIMER_DMA);
m_autoerase_line_timer = timer_alloc(TIMER_AUTOERASE_LINE); m_autoerase_line_timer = timer_alloc(TIMER_AUTOERASE_LINE);

View File

@ -87,8 +87,8 @@
to display more detail when a texture is real close to the viewer. This is currently unemulated. to display more detail when a texture is real close to the viewer. This is currently unemulated.
*********************************************************************************************************************************/ *********************************************************************************************************************************/
#include "emu.h" #include "emu.h"
#include "video/segaic24.h"
#include "includes/model2.h" #include "includes/model2.h"
#include <cmath> #include <cmath>
@ -2651,15 +2651,11 @@ void model2_state::video_start()
uint32_t model2_state::screen_update_model2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) uint32_t model2_state::screen_update_model2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{ {
//logerror("--- frame ---\n"); //logerror("--- frame ---\n");
int layer;
bitmap.fill(m_palette->pen(0), cliprect); bitmap.fill(m_palette->pen(0), cliprect);
m_sys24_bitmap.fill(0, cliprect); m_sys24_bitmap.fill(0, cliprect);
segas24_tile_device *tile = machine().device<segas24_tile_device>("tile"); for(int layer = 3; layer >= 0; layer--)
m_tiles->draw(screen, m_sys24_bitmap, cliprect, layer<<1, 0, 0);
for(layer=3;layer>=0;layer--)
tile->draw(screen, m_sys24_bitmap, cliprect, layer<<1, 0, 0);
copybitmap_trans(bitmap, m_sys24_bitmap, 0, 0, 0, 0, cliprect, 0); copybitmap_trans(bitmap, m_sys24_bitmap, 0, 0, 0, 0, cliprect, 0);
@ -2680,8 +2676,8 @@ uint32_t model2_state::screen_update_model2(screen_device &screen, bitmap_rgb32
m_sys24_bitmap.fill(0, cliprect); m_sys24_bitmap.fill(0, cliprect);
for(layer=3;layer>=0;layer--) for (int layer = 3; layer >= 0; layer--)
tile->draw(screen, m_sys24_bitmap, cliprect, (layer<<1) | 1, 0, 0); m_tiles->draw(screen, m_sys24_bitmap, cliprect, (layer<<1) | 1, 0, 0);
copybitmap_trans(bitmap, m_sys24_bitmap, 0, 0, 0, 0, cliprect, 0); copybitmap_trans(bitmap, m_sys24_bitmap, 0, 0, 0, 0, cliprect, 0);