diff options
-rw-r--r-- | src/emu/screen.cpp | 9 | ||||
-rw-r--r-- | src/emu/screen.h | 11 | ||||
-rw-r--r-- | src/mame/drivers/c128.cpp | 21 | ||||
-rw-r--r-- | src/mame/drivers/c64.cpp | 30 | ||||
-rw-r--r-- | src/mame/drivers/cbm2.cpp | 18 | ||||
-rw-r--r-- | src/mame/drivers/dccons.cpp | 36 | ||||
-rw-r--r-- | src/mame/drivers/mac.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/naomi.cpp | 85 | ||||
-rw-r--r-- | src/mame/drivers/osborne1.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/sapi1.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/svision.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/twinkle.cpp | 1 | ||||
-rw-r--r-- | src/mame/machine/dc-ctrl.h | 9 | ||||
-rw-r--r-- | src/mame/machine/jvs13551.h | 8 | ||||
-rw-r--r-- | src/mame/machine/mie.h | 9 | ||||
-rw-r--r-- | src/mame/machine/segacrp2_device.cpp | 545 | ||||
-rw-r--r-- | src/mame/machine/segacrp2_device.h | 3 |
17 files changed, 353 insertions, 440 deletions
diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp index 835e12995f5..db6f7c91ad4 100644 --- a/src/emu/screen.cpp +++ b/src/emu/screen.cpp @@ -546,7 +546,7 @@ screen_device::screen_device(const machine_config &mconfig, const char *tag, dev , m_scanline_cb(*this) , m_palette(*this, finder_base::DUMMY_TAG) , m_video_attributes(0) - , m_svg_region(tag) + , m_svg_region(*this, DEVICE_SELF) , m_container(nullptr) , m_width(100) , m_height(100) @@ -717,10 +717,9 @@ void screen_device::device_start() if (m_type == SCREEN_TYPE_SVG) { - memory_region *reg = owner()->memregion(m_svg_region); - if (!reg) - fatalerror("%s: SVG region \"%s\" does not exist\n", tag(), m_svg_region); - m_svg = std::make_unique<svg_renderer>(reg); + if (!m_svg_region) + fatalerror("%s: SVG region \"%s\" does not exist\n", tag(), m_svg_region.finder_tag()); + m_svg = std::make_unique<svg_renderer>(m_svg_region); machine().output().set_notifier(nullptr, svg_renderer::output_notifier, m_svg.get()); // don't do this - SVG units are arbitrary and interpreting them as pixels causes bad things to happen diff --git a/src/emu/screen.h b/src/emu/screen.h index 87eed6a2738..6754d66f071 100644 --- a/src/emu/screen.h +++ b/src/emu/screen.h @@ -368,10 +368,11 @@ public: auto screen_vblank() { return m_screen_vblank.bind(); } auto scanline() { m_video_attributes |= VIDEO_UPDATE_SCANLINE; return m_scanline_cb.bind(); } - template<typename T> void set_palette(T &&tag) { m_palette.set_tag(std::forward<T>(tag)); } - void set_video_attributes(u32 flags) { m_video_attributes = flags; } - void set_color(rgb_t color) { m_color = color; } - void set_svg_region(const char *region) { m_svg_region = region; } // default region is device tag + template <typename T> screen_device &set_palette(T &&tag) { m_palette.set_tag(std::forward<T>(tag)); return *this; } + screen_device &set_no_palette() { m_palette.set_tag(finder_base::DUMMY_TAG); return *this; } + screen_device &set_video_attributes(u32 flags) { m_video_attributes = flags; return *this; } + screen_device &set_color(rgb_t color) { m_color = color; return *this; } + template <typename T> screen_device &set_svg_region(T &&tag) { m_svg_region.set_tag(std::forward<T>(tag)); return *this; } // default region is device tag // information getters render_container &container() const { assert(m_container != nullptr); return *m_container; } @@ -468,7 +469,7 @@ private: devcb_write32 m_scanline_cb; // screen scanline callback optional_device<device_palette_interface> m_palette; // our palette u32 m_video_attributes; // flags describing the video system - const char * m_svg_region; // the region in which the svg data is in + optional_memory_region m_svg_region; // the region in which the svg data is in // internal state render_container * m_container; // pointer to our container diff --git a/src/mame/drivers/c128.cpp b/src/mame/drivers/c128.cpp index ca6efdebb87..a0571df460e 100644 --- a/src/mame/drivers/c128.cpp +++ b/src/mame/drivers/c128.cpp @@ -1758,20 +1758,13 @@ void c128_state::ntsc(machine_config &config) QUICKLOAD(config, "quickload", "p00,prg", CBM_QUICKLOAD_DELAY).set_load_callback(FUNC(c128_state::quickload_c128), this); // software list - SOFTWARE_LIST(config, "cart_list_vic10").set_original("vic10"); - SOFTWARE_LIST(config, "cart_list_c64").set_original("c64_cart"); - SOFTWARE_LIST(config, "cart_list").set_original("c128_cart"); - SOFTWARE_LIST(config, "cass_list_c64").set_original("c64_cass"); - SOFTWARE_LIST(config, "flop_list_c64").set_original("c64_flop"); - SOFTWARE_LIST(config, "flop_list").set_original("c128_flop"); - SOFTWARE_LIST(config, "from_list").set_original("c128_rom"); - subdevice<software_list_device>("cart_list_vic10")->set_filter("NTSC"); - subdevice<software_list_device>("cart_list_c64")->set_filter("NTSC"); - subdevice<software_list_device>("cart_list")->set_filter("NTSC"); - subdevice<software_list_device>("cass_list_c64")->set_filter("NTSC"); - subdevice<software_list_device>("flop_list_c64")->set_filter("NTSC"); - subdevice<software_list_device>("flop_list")->set_filter("NTSC"); - subdevice<software_list_device>("from_list")->set_filter("NTSC"); + SOFTWARE_LIST(config, "cart_list_vic10").set_original("vic10").set_filter("NTSC"); + SOFTWARE_LIST(config, "cart_list_c64").set_original("c64_cart").set_filter("NTSC"); + SOFTWARE_LIST(config, "cart_list").set_original("c128_cart").set_filter("NTSC"); + SOFTWARE_LIST(config, "cass_list_c64").set_original("c64_cass").set_filter("NTSC"); + SOFTWARE_LIST(config, "flop_list_c64").set_original("c64_flop").set_filter("NTSC"); + SOFTWARE_LIST(config, "flop_list").set_original("c128_flop").set_filter("NTSC"); + SOFTWARE_LIST(config, "from_list").set_original("c128_rom").set_filter("NTSC"); // function ROM GENERIC_SOCKET(config, "from", generic_plain_slot, "c128_rom", "bin,rom"); diff --git a/src/mame/drivers/c64.cpp b/src/mame/drivers/c64.cpp index 2a0f112d48f..0906d5ffa13 100644 --- a/src/mame/drivers/c64.cpp +++ b/src/mame/drivers/c64.cpp @@ -1539,14 +1539,10 @@ void c64_state::ntsc(machine_config &config) QUICKLOAD(config, "quickload", "p00,prg,t64", CBM_QUICKLOAD_DELAY).set_load_callback(FUNC(c64_state::quickload_c64), this); // software list - SOFTWARE_LIST(config, "cart_list_vic10").set_original("vic10"); - SOFTWARE_LIST(config, "cart_list_c64").set_original("c64_cart"); - SOFTWARE_LIST(config, "cass_list").set_original("c64_cass"); - SOFTWARE_LIST(config, "flop_list").set_original("c64_flop"); - subdevice<software_list_device>("cart_list_vic10")->set_filter("NTSC"); - subdevice<software_list_device>("cart_list_c64")->set_filter("NTSC"); - subdevice<software_list_device>("cass_list")->set_filter("NTSC"); - subdevice<software_list_device>("flop_list")->set_filter("NTSC"); + SOFTWARE_LIST(config, "cart_list_vic10").set_original("vic10").set_filter("NTSC"); + SOFTWARE_LIST(config, "cart_list_c64").set_original("c64_cart").set_filter("NTSC"); + SOFTWARE_LIST(config, "cass_list").set_original("c64_cass").set_filter("NTSC"); + SOFTWARE_LIST(config, "flop_list").set_original("c64_flop").set_filter("NTSC"); // internal ram RAM(config, RAM_TAG).set_default_size("64K"); @@ -1715,14 +1711,10 @@ void c64_state::pal(machine_config &config) QUICKLOAD(config, "quickload", "p00,prg,t64", CBM_QUICKLOAD_DELAY).set_load_callback(FUNC(c64_state::quickload_c64), this); // software list - SOFTWARE_LIST(config, "cart_list_vic10").set_original("vic10"); - SOFTWARE_LIST(config, "cart_list_c64").set_original("c64_cart"); - SOFTWARE_LIST(config, "cass_list").set_original("c64_cass"); - SOFTWARE_LIST(config, "flop_list").set_original("c64_flop"); - subdevice<software_list_device>("cart_list_vic10")->set_filter("PAL"); - subdevice<software_list_device>("cart_list_c64")->set_filter("PAL"); - subdevice<software_list_device>("cass_list")->set_filter("PAL"); - subdevice<software_list_device>("flop_list")->set_filter("PAL"); + SOFTWARE_LIST(config, "cart_list_vic10").set_original("vic10").set_filter("PAL"); + SOFTWARE_LIST(config, "cart_list_c64").set_original("c64_cart").set_filter("PAL"); + SOFTWARE_LIST(config, "cass_list").set_original("c64_cass").set_filter("PAL"); + SOFTWARE_LIST(config, "flop_list").set_original("c64_flop").set_filter("PAL"); // internal ram RAM(config, RAM_TAG).set_default_size("64K"); @@ -1865,10 +1857,8 @@ void c64gs_state::pal_gs(machine_config &config) QUICKLOAD(config, "quickload", "p00,prg,t64", CBM_QUICKLOAD_DELAY).set_load_callback(FUNC(c64_state::quickload_c64), this); // software list - SOFTWARE_LIST(config, "cart_list_vic10").set_original("vic10"); - SOFTWARE_LIST(config, "cart_list_c64").set_original("c64_cart"); - subdevice<software_list_device>("cart_list_vic10")->set_filter("PAL"); - subdevice<software_list_device>("cart_list_c64")->set_filter("PAL"); + SOFTWARE_LIST(config, "cart_list_vic10").set_original("vic10").set_filter("PAL"); + SOFTWARE_LIST(config, "cart_list_c64").set_original("c64_cart").set_filter("PAL"); // internal ram RAM(config, RAM_TAG).set_default_size("64K"); diff --git a/src/mame/drivers/cbm2.cpp b/src/mame/drivers/cbm2.cpp index badd0e6cad2..8fef6b51a6e 100644 --- a/src/mame/drivers/cbm2.cpp +++ b/src/mame/drivers/cbm2.cpp @@ -2367,10 +2367,8 @@ void p500_state::p500_ntsc(machine_config &config) _128k(config); // software list - SOFTWARE_LIST(config, "cart_list").set_original("cbm2_cart"); - SOFTWARE_LIST(config, "flop_list").set_original("p500_flop"); - subdevice<software_list_device>("cart_list")->set_filter("NTSC"); - subdevice<software_list_device>("flop_list")->set_filter("NTSC"); + SOFTWARE_LIST(config, "cart_list").set_original("cbm2_cart").set_filter("NTSC"); + SOFTWARE_LIST(config, "flop_list").set_original("p500_flop").set_filter("NTSC"); } @@ -2500,10 +2498,8 @@ void p500_state::p500_pal(machine_config &config) _128k(config); // software list - SOFTWARE_LIST(config, "cart_list").set_original("cbm2_cart"); - SOFTWARE_LIST(config, "flop_list").set_original("p500_flop"); - subdevice<software_list_device>("cart_list")->set_filter("PAL"); - subdevice<software_list_device>("flop_list")->set_filter("PAL"); + SOFTWARE_LIST(config, "cart_list").set_original("cbm2_cart").set_filter("PAL"); + SOFTWARE_LIST(config, "flop_list").set_original("p500_flop").set_filter("PAL"); } @@ -2629,10 +2625,8 @@ void cbm2_state::cbm2lp_ntsc(machine_config &config) QUICKLOAD(config, "quickload", "p00,prg,t64", CBM_QUICKLOAD_DELAY).set_load_callback(FUNC(cbm2_state::quickload_cbmb), this); // software list - SOFTWARE_LIST(config, "cart_list").set_original("cbm2_cart"); - SOFTWARE_LIST(config, "flop_list").set_original("cbm2_flop"); - subdevice<software_list_device>("cart_list")->set_filter("NTSC"); - subdevice<software_list_device>("flop_list")->set_filter("NTSC"); + SOFTWARE_LIST(config, "cart_list").set_original("cbm2_cart").set_filter("NTSC"); + SOFTWARE_LIST(config, "flop_list").set_original("cbm2_flop").set_filter("NTSC"); } diff --git a/src/mame/drivers/dccons.cpp b/src/mame/drivers/dccons.cpp index bc4a4d9d014..3178e75574a 100644 --- a/src/mame/drivers/dccons.cpp +++ b/src/mame/drivers/dccons.cpp @@ -628,41 +628,13 @@ void dc_cons_state::dc(machine_config &config) MAPLE_DC(config, m_maple, 0, m_maincpu); m_maple->irq_callback().set(FUNC(dc_state::maple_irq)); dc_controller_device &dcctrl0(DC_CONTROLLER(config, "dcctrl0", 0, m_maple, 0)); - dcctrl0.set_port_tag<0>("P1:0"); - dcctrl0.set_port_tag<1>("P1:1"); - dcctrl0.set_port_tag<2>("P1:A0"); - dcctrl0.set_port_tag<3>("P1:A1"); - dcctrl0.set_port_tag<4>("P1:A2"); - dcctrl0.set_port_tag<5>("P1:A3"); - dcctrl0.set_port_tag<6>("P1:A4"); - dcctrl0.set_port_tag<7>("P1:A5"); + dcctrl0.set_port_tags("P1:0", "P1:1", "P1:A0", "P1:A1", "P1:A2", "P1:A3", "P1:A4", "P1:A5"); dc_controller_device &dcctrl1(DC_CONTROLLER(config, "dcctrl1", 0, m_maple, 1)); - dcctrl1.set_port_tag<0>("P2:0"); - dcctrl1.set_port_tag<1>("P2:1"); - dcctrl1.set_port_tag<2>("P2:A0"); - dcctrl1.set_port_tag<3>("P2:A1"); - dcctrl1.set_port_tag<4>("P2:A2"); - dcctrl1.set_port_tag<5>("P2:A3"); - dcctrl1.set_port_tag<6>("P2:A4"); - dcctrl1.set_port_tag<7>("P2:A5"); + dcctrl1.set_port_tags("P2:0", "P2:1", "P2:A0", "P2:A1", "P2:A2", "P2:A3", "P2:A4", "P2:A5"); dc_controller_device &dcctrl2(DC_CONTROLLER(config, "dcctrl2", 0, m_maple, 2)); - dcctrl2.set_port_tag<0>("P3:0"); - dcctrl2.set_port_tag<1>("P3:1"); - dcctrl2.set_port_tag<2>("P3:A0"); - dcctrl2.set_port_tag<3>("P3:A1"); - dcctrl2.set_port_tag<4>("P3:A2"); - dcctrl2.set_port_tag<5>("P3:A3"); - dcctrl2.set_port_tag<6>("P3:A4"); - dcctrl2.set_port_tag<7>("P3:A5"); + dcctrl2.set_port_tags("P3:0", "P3:1", "P3:A0", "P3:A1", "P3:A2", "P3:A3", "P3:A4", "P3:A5"); dc_controller_device &dcctrl3(DC_CONTROLLER(config, "dcctrl3", 0, m_maple, 3)); - dcctrl3.set_port_tag<0>("P4:0"); - dcctrl3.set_port_tag<1>("P4:1"); - dcctrl3.set_port_tag<2>("P4:A0"); - dcctrl3.set_port_tag<3>("P4:A1"); - dcctrl3.set_port_tag<4>("P4:A2"); - dcctrl3.set_port_tag<5>("P4:A3"); - dcctrl3.set_port_tag<6>("P4:A4"); - dcctrl3.set_port_tag<7>("P4:A5"); + dcctrl3.set_port_tags("P4:0", "P4:1", "P4:A0", "P4:A1", "P4:A2", "P4:A3", "P4:A4", "P4:A5"); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/drivers/mac.cpp b/src/mame/drivers/mac.cpp index ca03f0e3605..018bc8d8290 100644 --- a/src/mame/drivers/mac.cpp +++ b/src/mame/drivers/mac.cpp @@ -1509,7 +1509,7 @@ void mac_state::macpb180c(machine_config &config) m_screen->set_size(800, 525); m_screen->set_visarea(0, 640-1, 0, 480-1); m_screen->set_screen_update(FUNC(mac_state::screen_update_macpbwd)); - m_screen->set_palette(finder_base::DUMMY_TAG); + m_screen->set_no_palette(); } void mac_state::macpd210(machine_config &config) diff --git a/src/mame/drivers/naomi.cpp b/src/mame/drivers/naomi.cpp index e97ed70a585..c02ab98b089 100644 --- a/src/mame/drivers/naomi.cpp +++ b/src/mame/drivers/naomi.cpp @@ -2989,18 +2989,7 @@ void naomi_state::naomi_base(machine_config &config) MIE_JVS(config, "mie", 16000000); sega_837_13551_device &sega837(SEGA_837_13551(config, "837_13551", 0, "mie")); - sega837.set_port_tag<0>("TILT"); - sega837.set_port_tag<1>("P1"); - sega837.set_port_tag<2>("P2"); - sega837.set_port_tag<3>("A0"); - sega837.set_port_tag<4>("A1"); - sega837.set_port_tag<5>("A2"); - sega837.set_port_tag<6>("A3"); - sega837.set_port_tag<7>("A4"); - sega837.set_port_tag<8>("A5"); - sega837.set_port_tag<9>("A6"); - sega837.set_port_tag<10>("A7"); - sega837.set_port_tag<11>("OUTPUT"); + sega837.set_port_tags("TILT", "P1", "P2", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "OUTPUT"); EEPROM_93C46_8BIT(config, "mie_eeprom"); @@ -3073,23 +3062,9 @@ void naomi_state::naomim2_kb(machine_config &config) { naomim2(config); dc_keyboard_device &dcctrl0(DC_KEYBOARD(config, "dcctrl0", 0, m_maple, 1)); - dcctrl0.set_port_tag<0>("P1.M"); - dcctrl0.set_port_tag<1>("P1.LD"); - dcctrl0.set_port_tag<2>("P1.KC1"); - dcctrl0.set_port_tag<3>("P1.KC2"); - dcctrl0.set_port_tag<4>("P1.KC3"); - dcctrl0.set_port_tag<5>("P1.KC4"); - dcctrl0.set_port_tag<6>("P1.KC5"); - dcctrl0.set_port_tag<7>("P1.KC6"); + dcctrl0.set_port_tags("P1.M", "P1.LD", "P1.KC1", "P1.KC2", "P1.KC3", "P1.KC4", "P1.KC5", "P1.KC6"); dc_keyboard_device &dcctrl1(DC_KEYBOARD(config, "dcctrl1", 0, m_maple, 2)); - dcctrl1.set_port_tag<0>("P2.M"); - dcctrl1.set_port_tag<1>("P2.LD"); - dcctrl1.set_port_tag<2>("P2.KC1"); - dcctrl1.set_port_tag<3>("P2.KC2"); - dcctrl1.set_port_tag<4>("P2.KC3"); - dcctrl1.set_port_tag<5>("P2.KC4"); - dcctrl1.set_port_tag<6>("P2.KC5"); - dcctrl1.set_port_tag<7>("P2.KC6"); + dcctrl1.set_port_tags("P2.M", "P2.LD", "P2.KC1", "P2.KC2", "P2.KC3", "P2.KC4", "P2.KC5", "P2.KC6"); } /* @@ -3100,23 +3075,9 @@ void naomi_state::naomigd_kb(machine_config &config) { naomigd(config); dc_keyboard_device &dcctrl0(DC_KEYBOARD(config, "dcctrl0", 0, m_maple, 1)); - dcctrl0.set_port_tag<0>("P1.M"); - dcctrl0.set_port_tag<1>("P1.LD"); - dcctrl0.set_port_tag<2>("P1.KC1"); - dcctrl0.set_port_tag<3>("P1.KC2"); - dcctrl0.set_port_tag<4>("P1.KC3"); - dcctrl0.set_port_tag<5>("P1.KC4"); - dcctrl0.set_port_tag<6>("P1.KC5"); - dcctrl0.set_port_tag<7>("P1.KC6"); + dcctrl0.set_port_tags("P1.M", "P1.LD", "P1.KC1", "P1.KC2", "P1.KC3", "P1.KC4", "P1.KC5", "P1.KC6"); dc_keyboard_device &dcctrl1(DC_KEYBOARD(config, "dcctrl1", 0, m_maple, 2)); - dcctrl1.set_port_tag<0>("P2.M"); - dcctrl1.set_port_tag<1>("P2.LD"); - dcctrl1.set_port_tag<2>("P2.KC1"); - dcctrl1.set_port_tag<3>("P2.KC2"); - dcctrl1.set_port_tag<4>("P2.KC3"); - dcctrl1.set_port_tag<5>("P2.KC4"); - dcctrl1.set_port_tag<6>("P2.KC5"); - dcctrl1.set_port_tag<7>("P2.KC6"); + dcctrl1.set_port_tags("P2.M", "P2.LD", "P2.KC1", "P2.KC2", "P2.KC3", "P2.KC4", "P2.KC5", "P2.KC6"); } /* @@ -3196,47 +3157,19 @@ void atomiswave_state::aw1c(machine_config &config) { aw_base(config); dc_controller_device &dcctrl0(DC_CONTROLLER(config, "dcctrl0", 0, m_maple, 0)); - dcctrl0.set_port_tag<0>("P1.0"); - dcctrl0.set_port_tag<1>("P1.1"); - dcctrl0.set_port_tag<2>("P1.A0"); - dcctrl0.set_port_tag<3>("P1.A1"); - dcctrl0.set_port_tag<4>("P1.A2"); - dcctrl0.set_port_tag<5>("P1.A3"); - dcctrl0.set_port_tag<6>("P1.A4"); - dcctrl0.set_port_tag<7>("P1.A5"); + dcctrl0.set_port_tags("P1.0", "P1.1", "P1.A0", "P1.A1", "P1.A2", "P1.A3", "P1.A4", "P1.A5"); // TODO: isn't it supposed to be just one controller? dc_controller_device &dcctrl1(DC_CONTROLLER(config, "dcctrl1", 0, m_maple, 1)); - dcctrl1.set_port_tag<0>("P2.0"); - dcctrl1.set_port_tag<1>("P2.1"); - dcctrl1.set_port_tag<2>("P2.A0"); - dcctrl1.set_port_tag<3>("P2.A1"); - dcctrl1.set_port_tag<4>("P2.A2"); - dcctrl1.set_port_tag<5>("P2.A3"); - dcctrl1.set_port_tag<6>("P2.A4"); - dcctrl1.set_port_tag<7>("P2.A5"); + dcctrl1.set_port_tags("P2.0", "P2.1", "P2.A0", "P2.A1", "P2.A2", "P2.A3", "P2.A4", "P2.A5"); } void atomiswave_state::aw2c(machine_config &config) { aw_base(config); dc_controller_device &dcctrl0(DC_CONTROLLER(config, "dcctrl0", 0, m_maple, 0)); - dcctrl0.set_port_tag<0>("P1.0"); - dcctrl0.set_port_tag<1>("P1.1"); - dcctrl0.set_port_tag<2>("P1.A0"); - dcctrl0.set_port_tag<3>("P1.A1"); - dcctrl0.set_port_tag<4>("P1.A2"); - dcctrl0.set_port_tag<5>("P1.A3"); - dcctrl0.set_port_tag<6>("P1.A4"); - dcctrl0.set_port_tag<7>("P1.A5"); + dcctrl0.set_port_tags("P1.0", "P1.1", "P1.A0", "P1.A1", "P1.A2", "P1.A3", "P1.A4", "P1.A5"); dc_controller_device &dcctrl1(DC_CONTROLLER(config, "dcctrl1", 0, m_maple, 1)); - dcctrl1.set_port_tag<0>("P2.0"); - dcctrl1.set_port_tag<1>("P2.1"); - dcctrl1.set_port_tag<2>("P2.A0"); - dcctrl1.set_port_tag<3>("P2.A1"); - dcctrl1.set_port_tag<4>("P2.A2"); - dcctrl1.set_port_tag<5>("P2.A3"); - dcctrl1.set_port_tag<6>("P2.A4"); - dcctrl1.set_port_tag<7>("P2.A5"); + dcctrl1.set_port_tags("P2.0", "P2.1", "P2.A0", "P2.A1", "P2.A2", "P2.A3", "P2.A4", "P2.A5"); } #define ROM_LOAD16_WORD_SWAP_BIOS(bios,name,offset,length,hash) \ diff --git a/src/mame/drivers/osborne1.cpp b/src/mame/drivers/osborne1.cpp index 21d1f6ea938..a2befac49e2 100644 --- a/src/mame/drivers/osborne1.cpp +++ b/src/mame/drivers/osborne1.cpp @@ -349,7 +349,7 @@ void osborne1nv_state::osborne1nv(machine_config &config) osborne1(config); m_maincpu->set_addrmap(AS_IO, &osborne1nv_state::osborne1nv_io); - m_screen->set_palette(finder_base::DUMMY_TAG); + m_screen->set_no_palette(); m_screen->set_screen_update("crtc", FUNC(mc6845_device::screen_update)); sy6545_1_device &crtc(SY6545_1(config, "crtc", XTAL(12'288'000)/8)); diff --git a/src/mame/drivers/sapi1.cpp b/src/mame/drivers/sapi1.cpp index 930d03bed0f..67865dabc03 100644 --- a/src/mame/drivers/sapi1.cpp +++ b/src/mame/drivers/sapi1.cpp @@ -849,7 +849,7 @@ void sapi_state::sapi3b(machine_config &config) crtc.set_update_row_callback(FUNC(sapi_state::crtc_update_row), this); subdevice<screen_device>("screen")->set_screen_update("crtc", FUNC(mc6845_device::screen_update)); - subdevice<screen_device>("screen")->set_palette(finder_base::DUMMY_TAG); + subdevice<screen_device>("screen")->set_no_palette(); } static DEVICE_INPUT_DEFAULTS_START( terminal ) diff --git a/src/mame/drivers/svision.cpp b/src/mame/drivers/svision.cpp index d16f7fef2f2..306cb19d494 100644 --- a/src/mame/drivers/svision.cpp +++ b/src/mame/drivers/svision.cpp @@ -558,7 +558,7 @@ void svision_state::tvlinkp(machine_config &config) svisionp(config); m_maincpu->set_addrmap(AS_PROGRAM, address_map_constructor(&std::remove_pointer_t<decltype(this)>::tvlink_mem, tag(), this)); - m_screen->set_palette(finder_base::DUMMY_TAG); + m_screen->set_no_palette(); m_screen->set_screen_update(FUNC(svision_state::screen_update_tvlink)); MCFG_MACHINE_RESET_OVERRIDE(svision_state, tvlink) diff --git a/src/mame/drivers/twinkle.cpp b/src/mame/drivers/twinkle.cpp index 8dc21b1df3d..de2f40da541 100644 --- a/src/mame/drivers/twinkle.cpp +++ b/src/mame/drivers/twinkle.cpp @@ -1077,7 +1077,6 @@ void twinkle_state::cdrom_config(device_t *device) { device->subdevice<cdda_device>("cdda")->add_route(0, "^^speakerleft", 1.0); device->subdevice<cdda_device>("cdda")->add_route(1, "^^speakerright", 1.0); - device = device->subdevice("cdda"); } void twinkle_state::twinkle(machine_config &config) diff --git a/src/mame/machine/dc-ctrl.h b/src/mame/machine/dc-ctrl.h index bc22a757111..4d29af1da97 100644 --- a/src/mame/machine/dc-ctrl.h +++ b/src/mame/machine/dc-ctrl.h @@ -16,6 +16,13 @@ public: template <uint8_t Which, typename T> void set_port_tag(T &&port_tag) { port[Which].set_tag(std::forward<T>(port_tag)); } + template <uint8_t First = 0U, typename T, typename... U> + void set_port_tags(T &&first_tag, U &&... other_tags) + { + set_port_tag<First>(std::forward<T>(first_tag)); + set_port_tags<First + 1>(std::forward<U>(other_tags)...); + } + // TODO: we probably don't need these setters void set_model(const char *new_id) { model = new_id; } void set_license(const char *new_license) { license = new_license; } @@ -24,6 +31,8 @@ public: void maple_w(const uint32_t *data, uint32_t in_size) override; protected: + template <uint8_t First> void set_port_tags() { } + // device-level overrides virtual void device_start() override; diff --git a/src/mame/machine/jvs13551.h b/src/mame/machine/jvs13551.h index 193877cdb16..ca04f387476 100644 --- a/src/mame/machine/jvs13551.h +++ b/src/mame/machine/jvs13551.h @@ -24,6 +24,12 @@ public: template <uint8_t Which, typename T> void set_port_tag(T &&port_tag) { port[Which].set_tag(std::forward<T>(port_tag)); } + template <uint8_t First = 0U, typename T, typename... U> + void set_port_tags(T &&first_tag, U &&... other_tags) + { + set_port_tag<First>(std::forward<T>(first_tag)); + set_port_tags<First + 1>(std::forward<U>(other_tags)...); + } virtual const tiny_rom_entry *device_rom_region() const override; @@ -32,6 +38,8 @@ public: void inc_coin(int coin); protected: + template <uint8_t First> void set_port_tags() { } + // device-level overrides virtual void device_start() override; virtual void device_reset() override; diff --git a/src/mame/machine/mie.h b/src/mame/machine/mie.h index 9d7df4d4dd2..c5c08440705 100644 --- a/src/mame/machine/mie.h +++ b/src/mame/machine/mie.h @@ -32,6 +32,12 @@ public: template <uint8_t Which, typename T> void set_gpio_name(T &&gpio_port_tag) { gpio_port[Which].set_tag(std::forward<T>(gpio_port_tag)); } + template <uint8_t First = 0U, typename T, typename... U> + void set_gpio_names(T &&first_tag, U &&... other_tags) + { + set_gpio_name<First>(std::forward<T>(first_tag)); + set_gpio_names<First + 1>(std::forward<U>(other_tags)...); + } DECLARE_READ8_MEMBER(control_r); DECLARE_WRITE8_MEMBER(control_w); @@ -70,7 +76,10 @@ public: void mie_map(address_map &map); void mie_port(address_map &map); + protected: + template <uint8_t First> void set_gpio_names() { } + // device-level overrides virtual void device_start() override; virtual void device_reset() override; diff --git a/src/mame/machine/segacrp2_device.cpp b/src/mame/machine/segacrp2_device.cpp index 8fd7b4f5729..1a2676bd631 100644 --- a/src/mame/machine/segacrp2_device.cpp +++ b/src/mame/machine/segacrp2_device.cpp @@ -48,43 +48,37 @@ #include "emu.h" #include "segacrp2_device.h" -static void decode(uint8_t *rom, uint8_t *decrypted, - const uint8_t xor_table[128],const int swap_table[128]) -{ - static const uint8_t swaptable[24][4] = - { - { 6,4,2,0 }, { 4,6,2,0 }, { 2,4,6,0 }, { 0,4,2,6 }, - { 6,2,4,0 }, { 6,0,2,4 }, { 6,4,0,2 }, { 2,6,4,0 }, - { 4,2,6,0 }, { 4,6,0,2 }, { 6,0,4,2 }, { 0,6,4,2 }, - { 4,0,6,2 }, { 0,4,6,2 }, { 6,2,0,4 }, { 2,6,0,4 }, - { 0,6,2,4 }, { 2,0,6,4 }, { 0,2,6,4 }, { 4,2,0,6 }, - { 2,4,0,6 }, { 4,0,2,6 }, { 2,0,4,6 }, { 0,2,4,6 }, - }; - - for (int A = 0x0000;A < 0x8000;A++) +static void decode(uint8_t *rom, uint8_t *decrypted, const uint8_t xor_table[128], const int swap_table[128]) +{ + static const uint8_t swaptable[24][4] = { + { 6,4,2,0 }, { 4,6,2,0 }, { 2,4,6,0 }, { 0,4,2,6 }, + { 6,2,4,0 }, { 6,0,2,4 }, { 6,4,0,2 }, { 2,6,4,0 }, + { 4,2,6,0 }, { 4,6,0,2 }, { 6,0,4,2 }, { 0,6,4,2 }, + { 4,0,6,2 }, { 0,4,6,2 }, { 6,2,0,4 }, { 2,6,0,4 }, + { 0,6,2,4 }, { 2,0,6,4 }, { 0,2,6,4 }, { 4,2,0,6 }, + { 2,4,0,6 }, { 4,0,2,6 }, { 2,0,4,6 }, { 0,2,4,6 } }; + + for (int a = 0x0000; a < 0x8000; a++) { - int row; - uint8_t src; const uint8_t *tbl; + const uint8_t src = rom[a]; - src = rom[A]; + // pick the translation table from bits 0, 3, 6, 9, 12 and 14 of the address + const int row = bitswap<6>(a, 14, 12, 9, 6, 3, 0); - /* pick the translation table from bits 0, 3, 6, 9, 12 and 14 of the address */ - row = (A & 1) + (((A >> 3) & 1) << 1) + (((A >> 6) & 1) << 2) - + (((A >> 9) & 1) << 3) + (((A >> 12) & 1) << 4) + (((A >> 14) & 1) << 5); + // decode the opcodes + tbl = swaptable[swap_table[2 * row]]; + decrypted[a] = bitswap<8>(src, 7, tbl[0], 5, tbl[1], 3, tbl[2], 1, tbl[3]) ^ xor_table[2 * row]; - /* decode the opcodes */ - tbl = swaptable[swap_table[2*row]]; - decrypted[A] = bitswap<8>(src,7,tbl[0],5,tbl[1],3,tbl[2],1,tbl[3]) ^ xor_table[2*row]; - - /* decode the data */ - tbl = swaptable[swap_table[2*row+1]]; - rom[A] = bitswap<8>(src,7,tbl[0],5,tbl[1],3,tbl[2],1,tbl[3]) ^ xor_table[2*row+1]; + // decode the data + tbl = swaptable[swap_table[2 * row + 1]]; + rom[a] = bitswap<8>(src, 7, tbl[0], 5, tbl[1], 3, tbl[2], 1, tbl[3]) ^ xor_table[2 * row + 1]; } } + DEFINE_DEVICE_TYPE(NEC_315_5136, nec_315_5136_device, "nec_315_5136", "Nec 315-5136") DEFINE_DEVICE_TYPE(SEGA_315_5179, sega_315_5179_device, "sega_315_5179", "Sega 315-5179") DEFINE_DEVICE_TYPE(SEGA_315_5178, sega_315_5178_device, "sega_315_5178", "Sega 315-5178") @@ -98,263 +92,265 @@ DEFINE_DEVICE_TYPE(SEGA_317_0006, sega_317_0006_device, "sega_317_0006", "Sega 3 DEFINE_DEVICE_TYPE(SEGA_317_0007, sega_317_0007_device, "sega_317_0007", "Sega 317-0007") +segacrp2_z80_device::segacrp2_z80_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : + z80_device(mconfig, type, tag, owner, clock), + m_decrypted(*this, finder_base::DUMMY_TAG) +{ +} -segacrp2_z80_device::segacrp2_z80_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : z80_device(mconfig, type, tag, owner, clock) -, m_decrypted(*this, finder_base::DUMMY_TAG) {} -void segacrp2_z80_device::device_start() { z80_device::device_start(); decrypt(); } -void segacrp2_z80_device::device_reset() { z80_device::device_reset(); } -void segacrp2_z80_device::decrypt() { } +void segacrp2_z80_device::device_start() +{ + z80_device::device_start(); + decrypt(); +} -nec_315_5136_device::nec_315_5136_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, NEC_315_5136, tag, owner, clock) {} +nec_315_5136_device::nec_315_5136_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + segacrp2_z80_device(mconfig, NEC_315_5136, tag, owner, clock) +{ +} void nec_315_5136_device::decrypt() { // 315-5136 - static const uint8_t xor_table[128] = - { - 0x00,0x40, 0x10,0x50, 0x04,0x44, 0x14,0x54, 0x01,0x41, 0x11,0x51, 0x05,0x45, 0x15,0x55, - 0x00,0x40, 0x10,0x50, 0x04,0x44, 0x14,0x54, 0x01,0x41, 0x11,0x51, 0x05,0x45, 0x15,0x55, - 0x00,0x40, 0x10,0x50, 0x04,0x44, 0x14,0x54, 0x01,0x41, 0x11,0x51, 0x05,0x45, 0x15,0x55, - 0x00,0x40, 0x10,0x50, 0x04,0x44, 0x14,0x54, 0x01,0x41, 0x11,0x51, 0x05,0x45, 0x15,0x55, - - 0x50,0x10, 0x44,0x04, 0x54,0x14, 0x41,0x01, 0x51,0x11, 0x45,0x05, 0x55,0x15, 0x40,0x00, - 0x50,0x10, 0x44,0x04, 0x54,0x14, 0x41,0x01, 0x51,0x11, 0x45,0x05, 0x55,0x15, 0x40,0x00, - 0x50,0x10, 0x44,0x04, 0x54,0x14, 0x41,0x01, 0x51,0x11, 0x45,0x05, 0x55,0x15, 0x40,0x00, - 0x50,0x10, 0x44,0x04, 0x54,0x14, 0x41,0x01, 0x51,0x11, 0x45,0x05, 0x55,0x15, 0x40,0x00 - }; - - static const int swap_table[128] = - { - 0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14, - 0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14, - 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15, - 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15, - 0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16, - 0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16, - 0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17, - 0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02, - 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, - 0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03, - 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, - 0x03,0x03,0x03,0x03,0x03,0x03,0x04,0x04 - }; + static const uint8_t xor_table[128] = { + 0x00,0x40, 0x10,0x50, 0x04,0x44, 0x14,0x54, 0x01,0x41, 0x11,0x51, 0x05,0x45, 0x15,0x55, + 0x00,0x40, 0x10,0x50, 0x04,0x44, 0x14,0x54, 0x01,0x41, 0x11,0x51, 0x05,0x45, 0x15,0x55, + 0x00,0x40, 0x10,0x50, 0x04,0x44, 0x14,0x54, 0x01,0x41, 0x11,0x51, 0x05,0x45, 0x15,0x55, + 0x00,0x40, 0x10,0x50, 0x04,0x44, 0x14,0x54, 0x01,0x41, 0x11,0x51, 0x05,0x45, 0x15,0x55, + + 0x50,0x10, 0x44,0x04, 0x54,0x14, 0x41,0x01, 0x51,0x11, 0x45,0x05, 0x55,0x15, 0x40,0x00, + 0x50,0x10, 0x44,0x04, 0x54,0x14, 0x41,0x01, 0x51,0x11, 0x45,0x05, 0x55,0x15, 0x40,0x00, + 0x50,0x10, 0x44,0x04, 0x54,0x14, 0x41,0x01, 0x51,0x11, 0x45,0x05, 0x55,0x15, 0x40,0x00, + 0x50,0x10, 0x44,0x04, 0x54,0x14, 0x41,0x01, 0x51,0x11, 0x45,0x05, 0x55,0x15, 0x40,0x00 }; + + static const int swap_table[128] = { + 0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14, + 0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14, + 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15, + 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15, + 0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16, + 0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16, + 0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17, + 0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02, + 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, + 0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03, + 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, + 0x03,0x03,0x03,0x03,0x03,0x03,0x04,0x04 }; decode(memregion(tag())->base(), m_decrypted, xor_table, swap_table); } -sega_315_5177_device::sega_315_5177_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, SEGA_315_5177, tag, owner, clock) {} + +sega_315_5177_device::sega_315_5177_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + segacrp2_z80_device(mconfig, SEGA_315_5177, tag, owner, clock) +{ +} void sega_315_5177_device::decrypt() { // 315-5177 - static const uint8_t xor_table[128] = - { - 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41, - 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40, - 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41, - 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40, - 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41, - 0x05,0x55,0x50,0x14, - - 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41, - 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40, - 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41, - 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40, - 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41, - 0x05,0x55,0x50,0x14, - }; - - static const int swap_table[128] = - { - 0,0,0,0, - 1,1,1,1,1, - 2,2,2,2,2, - 3,3,3,3, - 4,4,4,4,4, - 5,5,5,5,5, - 6,6,6,6,6, - 7,7,7,7,7, - 8,8,8,8, - 9,9,9,9,9, - 10,10,10,10,10, - 11,11,11,11,11, - 12,12,12,12,12, - 13,13, - - 8,8,8,8, - 9,9,9,9,9, - 10,10,10,10,10, - 11,11,11,11, - 12,12,12,12,12, - 13,13,13,13,13, - 14,14,14,14,14, - 15,15,15,15,15, - 16,16,16,16, - 17,17,17,17,17, - 18,18,18,18,18, - 19,19,19,19,19, - 20,20,20,20,20, - 21,21, - }; + static const uint8_t xor_table[128] = { + 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41, + 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40, + 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41, + 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40, + 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41, + 0x05,0x55,0x50,0x14, + + 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41, + 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40, + 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41, + 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40, + 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41, + 0x05,0x55,0x50,0x14 }; + + static const int swap_table[128] = { + 0,0,0,0, + 1,1,1,1,1, + 2,2,2,2,2, + 3,3,3,3, + 4,4,4,4,4, + 5,5,5,5,5, + 6,6,6,6,6, + 7,7,7,7,7, + 8,8,8,8, + 9,9,9,9,9, + 10,10,10,10,10, + 11,11,11,11,11, + 12,12,12,12,12, + 13,13, + + 8,8,8,8, + 9,9,9,9,9, + 10,10,10,10,10, + 11,11,11,11, + 12,12,12,12,12, + 13,13,13,13,13, + 14,14,14,14,14, + 15,15,15,15,15, + 16,16,16,16, + 17,17,17,17,17, + 18,18,18,18,18, + 19,19,19,19,19, + 20,20,20,20,20, + 21,21 }; decode(memregion(tag())->base(), m_decrypted, xor_table, swap_table); } -sega_315_5176_device::sega_315_5176_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, SEGA_315_5176, tag, owner, clock) {} +sega_315_5176_device::sega_315_5176_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + segacrp2_z80_device(mconfig, SEGA_315_5176, tag, owner, clock) +{ +} void sega_315_5176_device::decrypt() { - static const uint8_t xor_table[128] = - { - 0x44, 0x01, 0x51, 0x15, 0x40, 0x04, 0x54, 0x11, 0x45, 0x00, 0x50, 0x14, - 0x41, 0x05, 0x55, 0x10, 0x44, 0x01, 0x51, 0x15, 0x40, 0x04, 0x54, 0x11, - 0x45, 0x00, 0x50, 0x14, 0x41, 0x05, 0x55, 0x10, 0x44, 0x01, 0x51, 0x15, - 0x40, 0x04, 0x54, 0x11, 0x45, 0x00, 0x50, 0x14, 0x41, 0x05, 0x55, 0x10, - 0x44, 0x01, 0x51, 0x15, 0x40, 0x04, 0x54, 0x11, 0x45, 0x00, 0x50, 0x14, - 0x41, 0x05, 0x55, 0x10, - - 0x44, 0x01, 0x51, 0x15, 0x40, 0x04, 0x54, 0x11, 0x45, 0x00, 0x50, 0x14, - 0x41, 0x05, 0x55, 0x10, 0x44, 0x01, 0x51, 0x15, 0x40, 0x04, 0x54, 0x11, - 0x45, 0x00, 0x50, 0x14, 0x41, 0x05, 0x55, 0x10, 0x44, 0x01, 0x51, 0x15, - 0x40, 0x04, 0x54, 0x11, 0x45, 0x00, 0x50, 0x14, 0x41, 0x05, 0x55, 0x10, - 0x44, 0x01, 0x51, 0x15, 0x40, 0x04, 0x54, 0x11, 0x45, 0x00, 0x50, 0x14, - 0x41, 0x05, 0x55, 0x10, - }; - - static const int swap_table[128] = - { - 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, - 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a, - 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, - - 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, - 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, - 0x0c, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0e, - 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x0f, - 0x0f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x12, 0x12, 0x12, 0x12, - 0x12, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x14, - }; + static const uint8_t xor_table[128] = { + 0x44, 0x01, 0x51, 0x15, 0x40, 0x04, 0x54, 0x11, 0x45, 0x00, 0x50, 0x14, + 0x41, 0x05, 0x55, 0x10, 0x44, 0x01, 0x51, 0x15, 0x40, 0x04, 0x54, 0x11, + 0x45, 0x00, 0x50, 0x14, 0x41, 0x05, 0x55, 0x10, 0x44, 0x01, 0x51, 0x15, + 0x40, 0x04, 0x54, 0x11, 0x45, 0x00, 0x50, 0x14, 0x41, 0x05, 0x55, 0x10, + 0x44, 0x01, 0x51, 0x15, 0x40, 0x04, 0x54, 0x11, 0x45, 0x00, 0x50, 0x14, + 0x41, 0x05, 0x55, 0x10, + + 0x44, 0x01, 0x51, 0x15, 0x40, 0x04, 0x54, 0x11, 0x45, 0x00, 0x50, 0x14, + 0x41, 0x05, 0x55, 0x10, 0x44, 0x01, 0x51, 0x15, 0x40, 0x04, 0x54, 0x11, + 0x45, 0x00, 0x50, 0x14, 0x41, 0x05, 0x55, 0x10, 0x44, 0x01, 0x51, 0x15, + 0x40, 0x04, 0x54, 0x11, 0x45, 0x00, 0x50, 0x14, 0x41, 0x05, 0x55, 0x10, + 0x44, 0x01, 0x51, 0x15, 0x40, 0x04, 0x54, 0x11, 0x45, 0x00, 0x50, 0x14, + 0x41, 0x05, 0x55, 0x10 }; + + static const int swap_table[128] = { + 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, + 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a, + 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, + + 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, + 0x09, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, + 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, + 0x0c, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0e, + 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x0f, + 0x0f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x12, 0x12, 0x12, 0x12, + 0x12, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x14 }; decode(memregion(tag())->base(), m_decrypted, xor_table, swap_table); } -sega_315_5162_device::sega_315_5162_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, SEGA_315_5162, tag, owner, clock) {} +sega_315_5162_device::sega_315_5162_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + segacrp2_z80_device(mconfig, SEGA_315_5162, tag, owner, clock) +{ +} + void sega_315_5162_device::decrypt() { // 315-5162 - static const uint8_t xor_table[128] = - { - 0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55, - 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55, - 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55, - 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55, - 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55, - 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55, - 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55, - 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55, - 0x00, - }; - - static const int swap_table[128] = - { - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, - 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, - 12, - }; + static const uint8_t xor_table[128] = { + 0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55, + 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55, + 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55, + 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55, + 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55, + 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55, + 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55, + 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55, + 0x00 }; + + static const int swap_table[128] = { + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, + 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, + 12 }; decode(memregion(tag())->base(), m_decrypted, xor_table, swap_table); } +sega_315_5178_device::sega_315_5178_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + segacrp2_z80_device(mconfig, SEGA_315_5178, tag, owner, clock) +{ +} -sega_315_5178_device::sega_315_5178_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, SEGA_315_5178, tag, owner, clock) {} void sega_315_5178_device::decrypt() { // 315-5178 - static const uint8_t xor_table[128] = - { - 0x00,0x55,0x45,0x05,0x11,0x41,0x01,0x14,0x44,0x50,0x10, - 0x00,0x55,0x15,0x05,0x51,0x41,0x01,0x14,0x44,0x04,0x10, - 0x40,0x55,0x15,0x05,0x51,0x11, - 0x01,0x54,0x44,0x04,0x10,0x40,0x00,0x15,0x45,0x51,0x11, - 0x01,0x54,0x14,0x04,0x50,0x40,0x00,0x15,0x45,0x05,0x11, - 0x41,0x54,0x14,0x04,0x50,0x10, - 0x00,0x55,0x45,0x05,0x11,0x41,0x01,0x14, - - 0x00,0x55,0x45,0x05,0x11,0x41,0x01,0x14,0x44,0x50,0x10, - 0x00,0x55,0x15,0x05,0x51,0x41,0x01,0x14,0x44,0x04,0x10, - 0x40,0x55,0x15,0x05,0x51,0x11, - 0x01,0x54,0x44,0x04,0x10,0x40,0x00,0x15,0x45,0x51,0x11, - 0x01,0x54,0x14,0x04,0x50,0x40,0x00,0x15,0x45,0x05,0x11, - 0x41,0x54,0x14,0x04,0x50,0x10, - 0x00,0x55,0x45,0x05,0x11,0x41,0x01,0x14, - }; - - static const int swap_table[128] = - { - 2, - 3, 5, 7, 1, 3, 5, 7, 1, 3, 5, 7, - 0, 2, 4, 6, 0, 2, 4, 6, 0, 2, 4, - 5, 7, 1, 3, 5, 7, 1, 3, 5, 7, 1, 3, - 4, 6, 0, 2, 4, 6, 0, 2, 4, 6, - 8, - 1, 3, 5, 7, 1, 3, 5, 7, 1, 3, 5, - 6, 0, 2, 4, 6, 0, 2, - - 10, - 11,13,15, 9,11,13,15, 9,11,13,15, - 8,10,12,14, 8,10,12,14, 8,10,12, - 13,15, 9,11,13,15, 9,11,13,15, 9,11, - 12,14, 8,10,12,14, 8,10,12,14, - 16, - 9,11,13,15, 9,11,13,15, 9,11,13, - 14, 8,10,12,14, 8,10, - }; + static const uint8_t xor_table[128] = { + 0x00,0x55,0x45,0x05,0x11,0x41,0x01,0x14,0x44,0x50,0x10, + 0x00,0x55,0x15,0x05,0x51,0x41,0x01,0x14,0x44,0x04,0x10, + 0x40,0x55,0x15,0x05,0x51,0x11, + 0x01,0x54,0x44,0x04,0x10,0x40,0x00,0x15,0x45,0x51,0x11, + 0x01,0x54,0x14,0x04,0x50,0x40,0x00,0x15,0x45,0x05,0x11, + 0x41,0x54,0x14,0x04,0x50,0x10, + 0x00,0x55,0x45,0x05,0x11,0x41,0x01,0x14, + + 0x00,0x55,0x45,0x05,0x11,0x41,0x01,0x14,0x44,0x50,0x10, + 0x00,0x55,0x15,0x05,0x51,0x41,0x01,0x14,0x44,0x04,0x10, + 0x40,0x55,0x15,0x05,0x51,0x11, + 0x01,0x54,0x44,0x04,0x10,0x40,0x00,0x15,0x45,0x51,0x11, + 0x01,0x54,0x14,0x04,0x50,0x40,0x00,0x15,0x45,0x05,0x11, + 0x41,0x54,0x14,0x04,0x50,0x10, + 0x00,0x55,0x45,0x05,0x11,0x41,0x01,0x14 }; + + static const int swap_table[128] = { + 2, + 3, 5, 7, 1, 3, 5, 7, 1, 3, 5, 7, + 0, 2, 4, 6, 0, 2, 4, 6, 0, 2, 4, + 5, 7, 1, 3, 5, 7, 1, 3, 5, 7, 1, 3, + 4, 6, 0, 2, 4, 6, 0, 2, 4, 6, + 8, + 1, 3, 5, 7, 1, 3, 5, 7, 1, 3, 5, + 6, 0, 2, 4, 6, 0, 2, + + 10, + 11,13,15, 9,11,13,15, 9,11,13,15, + 8,10,12,14, 8,10,12,14, 8,10,12, + 13,15, 9,11,13,15, 9,11,13,15, 9,11, + 12,14, 8,10,12,14, 8,10,12,14, + 16, + 9,11,13,15, 9,11,13,15, 9,11,13, + 14, 8,10,12,14, 8,10 }; decode(memregion(tag())->base(), m_decrypted, xor_table, swap_table); } +sega_315_5179_device::sega_315_5179_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + segacrp2_z80_device(mconfig, SEGA_315_5179, tag, owner, clock) +{ +} -sega_315_5179_device::sega_315_5179_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, SEGA_315_5179, tag, owner, clock) {} void sega_315_5179_device::decrypt() { // 315-5179 - static const uint8_t xor_table[128] = - { - 0x00,0x45,0x41,0x14,0x10,0x55,0x51,0x01,0x04,0x40,0x45,0x11,0x14,0x50, - 0x00,0x05,0x41,0x44,0x10,0x15,0x51,0x54,0x04, - 0x00,0x45,0x41,0x14,0x10,0x55,0x05,0x01,0x44,0x40,0x15,0x11,0x54,0x50, - 0x00,0x05,0x41,0x44,0x10,0x15,0x51,0x01,0x04, - 0x40,0x45,0x11,0x14,0x50,0x55,0x05,0x01,0x44,0x40,0x15,0x11,0x54,0x04, - 0x00,0x45,0x41,0x14,0x50, - 0x00,0x05,0x41,0x44,0x10,0x15,0x51,0x54,0x04, - 0x00,0x45,0x41,0x14,0x50,0x55,0x05,0x01,0x44,0x40,0x15,0x11,0x54,0x50, - 0x00,0x05,0x41,0x44,0x10,0x55,0x51,0x01,0x04, - 0x40,0x45,0x11,0x14,0x50,0x55,0x05,0x01,0x44,0x40,0x15,0x51,0x54,0x04, - 0x00,0x45,0x41,0x14,0x10,0x55,0x51,0x01,0x04, - 0x40,0x45,0x11,0x54,0x50,0x00,0x05,0x41, - }; - - static const int swap_table[128] = - { + static const uint8_t xor_table[128] = { + 0x00,0x45,0x41,0x14,0x10,0x55,0x51,0x01,0x04,0x40,0x45,0x11,0x14,0x50, + 0x00,0x05,0x41,0x44,0x10,0x15,0x51,0x54,0x04, + 0x00,0x45,0x41,0x14,0x10,0x55,0x05,0x01,0x44,0x40,0x15,0x11,0x54,0x50, + 0x00,0x05,0x41,0x44,0x10,0x15,0x51,0x01,0x04, + 0x40,0x45,0x11,0x14,0x50,0x55,0x05,0x01,0x44,0x40,0x15,0x11,0x54,0x04, + 0x00,0x45,0x41,0x14,0x50, + 0x00,0x05,0x41,0x44,0x10,0x15,0x51,0x54,0x04, + 0x00,0x45,0x41,0x14,0x50,0x55,0x05,0x01,0x44,0x40,0x15,0x11,0x54,0x50, + 0x00,0x05,0x41,0x44,0x10,0x55,0x51,0x01,0x04, + 0x40,0x45,0x11,0x14,0x50,0x55,0x05,0x01,0x44,0x40,0x15,0x51,0x54,0x04, + 0x00,0x45,0x41,0x14,0x10,0x55,0x51,0x01,0x04, + 0x40,0x45,0x11,0x54,0x50,0x00,0x05,0x41 }; + + static const int swap_table[128] = { 8, 9,11,13,15, 0, 2, 4, 6, 8, 9,11,13,15, 1, 2, 4, 6, 8, 9,11,13,15, 1, 2, 4, 6, @@ -370,8 +366,7 @@ void sega_315_5179_device::decrypt() 7, 1, 2, 4, 6, 0, 2, 3, 5, 7, 1, 3, 4, 6, 0, 2, 3, 5, 7, 1, 3, 4, 6, 0, 2, 4, 5, - 7, - }; + 7 }; decode(memregion(tag())->base(), m_decrypted, xor_table, swap_table); } @@ -386,58 +381,70 @@ void sega_315_5179_device::decrypt() static void sega_decode_317(uint8_t *rom, uint8_t *decrypted, int shift) { - static const uint8_t xor_table[128+3] = - { - 0x04,0x54,0x44,0x14,0x15,0x15,0x51,0x41,0x41,0x14,0x10,0x50,0x15,0x55,0x54,0x05, - 0x04,0x41,0x51,0x01,0x05,0x10,0x55,0x51,0x05,0x05,0x54,0x11,0x45,0x05,0x04,0x14, - 0x10,0x55,0x01,0x41,0x51,0x05,0x55,0x04,0x45,0x41,0x55,0x14,0x45,0x10,0x04,0x45, - 0x55,0x50,0x40,0x00,0x11,0x45,0x15,0x00,0x01,0x00,0x40,0x00,0x01,0x45,0x11,0x00, - 0x45,0x00,0x44,0x54,0x40,0x04,0x05,0x15,0x15,0x10,0x15,0x04,0x01,0x05,0x50,0x11, - 0x00,0x44,0x44,0x04,0x04,0x01,0x50,0x05,0x51,0x00,0x45,0x44,0x50,0x15,0x54,0x40, - 0x41,0x45,0x40,0x10,0x14,0x15,0x40,0x51,0x50,0x50,0x45,0x00,0x10,0x15,0x05,0x51, - 0x50,0x44,0x01,0x15,0x40,0x04,0x01,0x44,0x50,0x44,0x50,0x50,0x50,0x10,0x44,0x04, - 0x40,0x04,0x10, - }; - - static const int swap_table[128+3] = - { - 7, 7,12, 1,18,11, 8,23,21,17, 0,23,22, 0,21,15, - 13,19,21,20,20,12,13,10,20, 0,14,18, 6,18, 3, 5, - 5,20,20,13, 8, 0,20,18, 4,14, 8, 5,17, 6,22,10, - 0,21, 0, 1, 6,11,17, 9,17, 3, 9,21, 0, 4,16, 1, - 13,17,21, 5, 3, 7, 2,16,18,13, 6,19,11,23, 3,20, - 3, 2,18,10,18,23,19,23, 3,15, 0,10, 5,12, 0, 0, - 11,22, 8,14, 8, 6, 1,15, 7,11, 2,17,10,15, 8,21, - 10, 0, 2, 6, 1, 1, 3, 1,12,18,16, 5, 0,15,17,15, - 10,20, 1, - }; + static const uint8_t xor_table[128 + 3] = { + 0x04,0x54,0x44,0x14,0x15,0x15,0x51,0x41,0x41,0x14,0x10,0x50,0x15,0x55,0x54,0x05, + 0x04,0x41,0x51,0x01,0x05,0x10,0x55,0x51,0x05,0x05,0x54,0x11,0x45,0x05,0x04,0x14, + 0x10,0x55,0x01,0x41,0x51,0x05,0x55,0x04,0x45,0x41,0x55,0x14,0x45,0x10,0x04,0x45, + 0x55,0x50,0x40,0x00,0x11,0x45,0x15,0x00,0x01,0x00,0x40,0x00,0x01,0x45,0x11,0x00, + 0x45,0x00,0x44,0x54,0x40,0x04,0x05,0x15,0x15,0x10,0x15,0x04,0x01,0x05,0x50,0x11, + 0x00,0x44,0x44,0x04,0x04,0x01,0x50,0x05,0x51,0x00,0x45,0x44,0x50,0x15,0x54,0x40, + 0x41,0x45,0x40,0x10,0x14,0x15,0x40,0x51,0x50,0x50,0x45,0x00,0x10,0x15,0x05,0x51, + 0x50,0x44,0x01,0x15,0x40,0x04,0x01,0x44,0x50,0x44,0x50,0x50,0x50,0x10,0x44,0x04, + 0x40,0x04,0x10 }; + + static const int swap_table[128 + 3] = { + 7, 7,12, 1,18,11, 8,23,21,17, 0,23,22, 0,21,15, + 13,19,21,20,20,12,13,10,20, 0,14,18, 6,18, 3, 5, + 5,20,20,13, 8, 0,20,18, 4,14, 8, 5,17, 6,22,10, + 0,21, 0, 1, 6,11,17, 9,17, 3, 9,21, 0, 4,16, 1, + 13,17,21, 5, 3, 7, 2,16,18,13, 6,19,11,23, 3,20, + 3, 2,18,10,18,23,19,23, 3,15, 0,10, 5,12, 0, 0, + 11,22, 8,14, 8, 6, 1,15, 7,11, 2,17,10,15, 8,21, + 10, 0, 2, 6, 1, 1, 3, 1,12,18,16, 5, 0,15,17,15, + 10,20, 1 }; decode(rom, decrypted, xor_table + shift, swap_table + shift); } -sega_317_0004_device::sega_317_0004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, SEGA_317_0004, tag, owner, clock) {} +sega_317_0004_device::sega_317_0004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + segacrp2_z80_device(mconfig, SEGA_317_0004, tag, owner, clock) +{ +} + void sega_317_0004_device::decrypt() { // 317-0004 sega_decode_317(memregion(tag())->base(), m_decrypted, 0); } +sega_317_0005_device::sega_317_0005_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + segacrp2_z80_device(mconfig, SEGA_317_0005, tag, owner, clock) +{ +} -sega_317_0005_device::sega_317_0005_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, SEGA_317_0005, tag, owner, clock) {} void sega_317_0005_device::decrypt() { // 317-0005 sega_decode_317(memregion(tag())->base(), m_decrypted, 1); } -sega_317_0006_device::sega_317_0006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, SEGA_317_0006, tag, owner, clock) {} +sega_317_0006_device::sega_317_0006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + segacrp2_z80_device(mconfig, SEGA_317_0006, tag, owner, clock) +{ +} + void sega_317_0006_device::decrypt() { // 317-0006 sega_decode_317(memregion(tag())->base(), m_decrypted, 2); } -sega_317_0007_device::sega_317_0007_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, SEGA_317_0007, tag, owner, clock) {} + +sega_317_0007_device::sega_317_0007_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + segacrp2_z80_device(mconfig, SEGA_317_0007, tag, owner, clock) +{ +} + void sega_317_0007_device::decrypt() { // 317-0006 sega_decode_317(memregion(tag())->base(), m_decrypted, 3); diff --git a/src/mame/machine/segacrp2_device.h b/src/mame/machine/segacrp2_device.h index 4fe3875f511..a64f3fa5fe0 100644 --- a/src/mame/machine/segacrp2_device.h +++ b/src/mame/machine/segacrp2_device.h @@ -18,8 +18,7 @@ protected: segacrp2_z80_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); virtual void device_start() override; - virtual void device_reset() override; - virtual void decrypt(); + virtual void decrypt() = 0; required_shared_ptr<uint8_t> m_decrypted; }; |