From 60714508334845bb4044144d0ff074d2f1463cb2 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 27 Dec 2020 13:15:02 +1100 Subject: Fix linking the virutal subtarget. --- scripts/target/mame/virtual.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/target/mame/virtual.lua b/scripts/target/mame/virtual.lua index 90d458bf0d7..2d1c866d51a 100644 --- a/scripts/target/mame/virtual.lua +++ b/scripts/target/mame/virtual.lua @@ -13,13 +13,14 @@ -- specify available CPU cores -------------------------------------------------- -CPUS["M6502"] = true +CPUS["DSP16"] = true -- for qsound CPUS["H6280"] = true +CPUS["KS0164"] = true +CPUS["M6502"] = true CPUS["M680X0"] = true CPUS["MCS48"] = true CPUS["SH"] = true CPUS["Z80"] = true -CPUS["DSP16"] = true -- for qsound -------------------------------------------------- -- specify available sound cores; some of these are @@ -37,6 +38,7 @@ SOUNDS["IREMGA20"] = true SOUNDS["K051649"] = true SOUNDS["K053260"] = true SOUNDS["K054539"] = true +SOUNDS["KS0164"] = true SOUNDS["MULTIPCM"] = true SOUNDS["NES_APU"] = true SOUNDS["OKIM6258"] = true @@ -83,6 +85,7 @@ MACHINES["Z80DAISY"] = true -------------------------------------------------- -- specify available bus cores -------------------------------------------------- +BUSES["MIDI"] = true -------------------------------------------------- -- cgit v1.2.3 From 4586e514f71321e750334f1e08e8cec3c5787aeb Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Mon, 28 Dec 2020 12:40:22 +0100 Subject: views: Remove the lambdas, seems to make the compiler usage resources less catastrophic --- src/emu/emumem.h | 2 - src/emu/emumem_mview.cpp | 150 ++++++++++++++++++++++++----------------------- 2 files changed, 78 insertions(+), 74 deletions(-) diff --git a/src/emu/emumem.h b/src/emu/emumem.h index e16e5e20858..662db2ad77d 100644 --- a/src/emu/emumem.h +++ b/src/emu/emumem.h @@ -1859,8 +1859,6 @@ private: address_space * m_space; handler_entry * m_handler_read; handler_entry * m_handler_write; - std::function m_select_a; - std::function m_select_u; int m_cur_id; int m_cur_slot; std::string m_context; diff --git a/src/emu/emumem_mview.cpp b/src/emu/emumem_mview.cpp index ac5474a925c..e8248d7727e 100644 --- a/src/emu/emumem_mview.cpp +++ b/src/emu/emumem_mview.cpp @@ -587,7 +587,8 @@ template void memory_v } // Force the slot to exist, in case the map is empty - m_view.m_select_u(m_id); + r()->select_u(m_id); + w()->select_u(m_id); // install the handlers, using the original, unadjusted memory map for(const address_map_entry &entry : map->m_entrylist) { @@ -615,14 +616,15 @@ void memory_view::register_state() { m_device.machine().save().save_item(&m_device, "view", m_name.c_str(), 0, NAME(m_cur_slot)); m_device.machine().save().save_item(&m_device, "view", m_name.c_str(), 0, NAME(m_cur_id)); - m_device.machine().save().register_postload(save_prepost_delegate(NAME([this]() { m_select_a(m_cur_id); }))); + m_device.machine().save().register_postload(save_prepost_delegate(NAME([this]() { m_handler_read->select_a(m_cur_id); m_handler_write->select_a(m_cur_id); }))); } void memory_view::disable() { m_cur_slot = -1; m_cur_id = -1; - m_select_a(-1); + m_handler_read->select_a(-1); + m_handler_write->select_a(-1); } void memory_view::select(int slot) @@ -633,7 +635,8 @@ void memory_view::select(int slot) m_cur_slot = slot; m_cur_id = i->second; - m_select_a(m_cur_id); + m_handler_read->select_a(m_cur_id); + m_handler_write->select_a(m_cur_id); } int memory_view::id_to_slot(int id) const @@ -655,78 +658,73 @@ void memory_view::initialize_from_address_map(offs_t addrstart, offs_t addrend, } namespace { - template void h_make_1(address_space &space, memory_view &view, handler_entry *&r, handler_entry *&w, std::function &sa, std::function &su) { - auto rx = new handler_entry_read_dispatch (&space, view); - auto wx = new handler_entry_write_dispatch(&space, view); - r = rx; - w = wx; - - sa = [rx, wx](int s) { rx->select_a(s); wx->select_a(s); }; - su = [rx, wx](int s) { rx->select_u(s); wx->select_u(s); }; + template void h_make_1(address_space &space, memory_view &view, handler_entry *&r, handler_entry *&w) { + r = new handler_entry_read_dispatch (&space, view); + w = new handler_entry_write_dispatch(&space, view); } - template void h_make_2(int HighBits, address_space &space, memory_view &view, handler_entry *&r, handler_entry *&w, std::function &sa, std::function &su) { + template void h_make_2(int HighBits, address_space &space, memory_view &view, handler_entry *&r, handler_entry *&w) { switch(HighBits) { - case 0: h_make_1(space, view, r, w, sa, su); break; - case 1: h_make_1(space, view, r, w, sa, su); break; - case 2: h_make_1(space, view, r, w, sa, su); break; - case 3: h_make_1(space, view, r, w, sa, su); break; - case 4: h_make_1< 4, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 5: h_make_1< 5, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 6: h_make_1< 6, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 7: h_make_1< 7, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 8: h_make_1< 8, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 9: h_make_1< 9, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 10: h_make_1<10, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 11: h_make_1<11, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 12: h_make_1<12, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 13: h_make_1<13, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 14: h_make_1<14, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 15: h_make_1<15, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 16: h_make_1<16, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 17: h_make_1<17, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 18: h_make_1<18, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 19: h_make_1<19, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 20: h_make_1<20, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 21: h_make_1<21, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 22: h_make_1<22, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 23: h_make_1<23, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 24: h_make_1<24, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 25: h_make_1<25, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 26: h_make_1<26, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 27: h_make_1<27, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 28: h_make_1<28, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 29: h_make_1<29, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 30: h_make_1<20, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 31: h_make_1<31, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; - case 32: h_make_1<32, Width, AddrShift, Endian>(space, view, r, w, sa, su); break; + case 0: h_make_1(space, view, r, w); break; + case 1: h_make_1(space, view, r, w); break; + case 2: h_make_1(space, view, r, w); break; + case 3: h_make_1(space, view, r, w); break; + case 4: h_make_1< 4, Width, AddrShift, Endian>(space, view, r, w); break; + case 5: h_make_1< 5, Width, AddrShift, Endian>(space, view, r, w); break; + case 6: h_make_1< 6, Width, AddrShift, Endian>(space, view, r, w); break; + case 7: h_make_1< 7, Width, AddrShift, Endian>(space, view, r, w); break; + case 8: h_make_1< 8, Width, AddrShift, Endian>(space, view, r, w); break; + case 9: h_make_1< 9, Width, AddrShift, Endian>(space, view, r, w); break; + case 10: h_make_1<10, Width, AddrShift, Endian>(space, view, r, w); break; + case 11: h_make_1<11, Width, AddrShift, Endian>(space, view, r, w); break; + case 12: h_make_1<12, Width, AddrShift, Endian>(space, view, r, w); break; + case 13: h_make_1<13, Width, AddrShift, Endian>(space, view, r, w); break; + case 14: h_make_1<14, Width, AddrShift, Endian>(space, view, r, w); break; + case 15: h_make_1<15, Width, AddrShift, Endian>(space, view, r, w); break; + case 16: h_make_1<16, Width, AddrShift, Endian>(space, view, r, w); break; + case 17: h_make_1<17, Width, AddrShift, Endian>(space, view, r, w); break; + case 18: h_make_1<18, Width, AddrShift, Endian>(space, view, r, w); break; + case 19: h_make_1<19, Width, AddrShift, Endian>(space, view, r, w); break; + case 20: h_make_1<20, Width, AddrShift, Endian>(space, view, r, w); break; + case 21: h_make_1<21, Width, AddrShift, Endian>(space, view, r, w); break; + case 22: h_make_1<22, Width, AddrShift, Endian>(space, view, r, w); break; + case 23: h_make_1<23, Width, AddrShift, Endian>(space, view, r, w); break; + case 24: h_make_1<24, Width, AddrShift, Endian>(space, view, r, w); break; + case 25: h_make_1<25, Width, AddrShift, Endian>(space, view, r, w); break; + case 26: h_make_1<26, Width, AddrShift, Endian>(space, view, r, w); break; + case 27: h_make_1<27, Width, AddrShift, Endian>(space, view, r, w); break; + case 28: h_make_1<28, Width, AddrShift, Endian>(space, view, r, w); break; + case 29: h_make_1<29, Width, AddrShift, Endian>(space, view, r, w); break; + case 30: h_make_1<20, Width, AddrShift, Endian>(space, view, r, w); break; + case 31: h_make_1<31, Width, AddrShift, Endian>(space, view, r, w); break; + case 32: h_make_1<32, Width, AddrShift, Endian>(space, view, r, w); break; default: abort(); } } - template void h_make_3(int HighBits, endianness_t Endian, address_space &space, memory_view &view, handler_entry *&r, handler_entry *&w, std::function &sa, std::function &su) { + template void h_make_3(int HighBits, endianness_t Endian, address_space &space, memory_view &view, handler_entry *&r, handler_entry *&w) { switch(Endian) { - case ENDIANNESS_LITTLE: h_make_2(HighBits, space, view, r, w, sa, su); break; - case ENDIANNESS_BIG: h_make_2 (HighBits, space, view, r, w, sa, su); break; + case ENDIANNESS_LITTLE: h_make_2(HighBits, space, view, r, w); break; + case ENDIANNESS_BIG: h_make_2 (HighBits, space, view, r, w); break; default: abort(); } } - void h_make(int HighBits, int Width, int AddrShift, endianness_t Endian, address_space &space, memory_view &view, handler_entry *&r, handler_entry *&w, std::function &sa, std::function &su) { + void h_make(int HighBits, int Width, int AddrShift, endianness_t Endian, address_space &space, memory_view &view, handler_entry *&r, handler_entry *&w) { switch (Width | (AddrShift + 4)) { - case 8|(4+1): h_make_3<0, 1>(HighBits, Endian, space, view, r, w, sa, su); break; - case 8|(4-0): h_make_3<0, 0>(HighBits, Endian, space, view, r, w, sa, su); break; - case 16|(4+3): h_make_3<1, 3>(HighBits, Endian, space, view, r, w, sa, su); break; - case 16|(4-0): h_make_3<1, 0>(HighBits, Endian, space, view, r, w, sa, su); break; - case 16|(4-1): h_make_3<1, -1>(HighBits, Endian, space, view, r, w, sa, su); break; - case 32|(4+3): h_make_3<2, 3>(HighBits, Endian, space, view, r, w, sa, su); break; - case 32|(4-0): h_make_3<2, 0>(HighBits, Endian, space, view, r, w, sa, su); break; - case 32|(4-1): h_make_3<2, -1>(HighBits, Endian, space, view, r, w, sa, su); break; - case 32|(4-2): h_make_3<2, -2>(HighBits, Endian, space, view, r, w, sa, su); break; - case 64|(4-0): h_make_3<3, 0>(HighBits, Endian, space, view, r, w, sa, su); break; - case 64|(4-1): h_make_3<3, -1>(HighBits, Endian, space, view, r, w, sa, su); break; - case 64|(4-2): h_make_3<3, -2>(HighBits, Endian, space, view, r, w, sa, su); break; - case 64|(4-3): h_make_3<3, -3>(HighBits, Endian, space, view, r, w, sa, su); break; + case 8|(4+1): h_make_3<0, 1>(HighBits, Endian, space, view, r, w); break; + case 8|(4-0): h_make_3<0, 0>(HighBits, Endian, space, view, r, w); break; + case 16|(4+3): h_make_3<1, 3>(HighBits, Endian, space, view, r, w); break; + case 16|(4-0): h_make_3<1, 0>(HighBits, Endian, space, view, r, w); break; + case 16|(4-1): h_make_3<1, -1>(HighBits, Endian, space, view, r, w); break; + case 32|(4+3): h_make_3<2, 3>(HighBits, Endian, space, view, r, w); break; + case 32|(4-0): h_make_3<2, 0>(HighBits, Endian, space, view, r, w); break; + case 32|(4-1): h_make_3<2, -1>(HighBits, Endian, space, view, r, w); break; + case 32|(4-2): h_make_3<2, -2>(HighBits, Endian, space, view, r, w); break; + case 64|(4-0): h_make_3<3, 0>(HighBits, Endian, space, view, r, w); break; + case 64|(4-1): h_make_3<3, -1>(HighBits, Endian, space, view, r, w); break; + case 64|(4-2): h_make_3<3, -2>(HighBits, Endian, space, view, r, w); break; + case 64|(4-3): h_make_3<3, -3>(HighBits, Endian, space, view, r, w); break; default: abort(); } } @@ -757,7 +755,7 @@ std::pair memory_view::make_handlers(address_s break; } - h_make(awidth, m_config->data_width(), m_config->addr_shift(), m_config->endianness(), space, *this, m_handler_read, m_handler_write, m_select_a, m_select_u); + h_make(awidth, m_config->data_width(), m_config->addr_shift(), m_config->endianness(), space, *this, m_handler_read, m_handler_write); } return std::make_pair(m_handler_read, m_handler_write); @@ -802,7 +800,8 @@ template void memory_v offs_t nstart, nend, nmask, nmirror; check_range_optimize_mirror("install_ram_generic", addrstart, addrend, addrmirror, nstart, nend, nmask, nmirror); - m_view.m_select_u(m_id); + r()->select_u(m_id); + w()->select_u(m_id); // map for read if (readorwrite == read_or_write::READ || readorwrite == read_or_write::READWRITE) @@ -834,7 +833,8 @@ template void memory_v offs_t nstart, nend, nmask, nmirror; check_range_optimize_mirror("unmap_generic", addrstart, addrend, addrmirror, nstart, nend, nmask, nmirror); - m_view.m_select_u(m_id); + r()->select_u(m_id); + w()->select_u(m_id); // read space if (readorwrite == read_or_write::READ || readorwrite == read_or_write::READWRITE) { @@ -858,7 +858,8 @@ template void memory_v offs_t nstart, nend, nmask, nmirror; check_range_optimize_mirror("install_view", addrstart, addrend, addrmirror, nstart, nend, nmask, nmirror); - m_view.m_select_u(m_id); + r()->select_u(m_id); + w()->select_u(m_id); auto handlers = view.make_handlers(*m_view.m_space, addrstart, addrend); r()->populate(nstart, nend, nmirror, static_cast *>(handlers.first)); @@ -873,7 +874,8 @@ template memory_passth if (!mph) mph = m_view.m_space->make_mph(); - m_view.m_select_u(m_id); + r()->select_u(m_id); + w()->select_u(m_id); auto handler = new handler_entry_read_tap(m_view.m_space, *mph, name, tap); r()->populate_passthrough(nstart, nend, nmirror, handler); @@ -891,7 +893,8 @@ template memory_passth if (!mph) mph = m_view.m_space->make_mph(); - m_view.m_select_u(m_id); + r()->select_u(m_id); + w()->select_u(m_id); auto handler = new handler_entry_write_tap(m_view.m_space, *mph, name, tap); w()->populate_passthrough(nstart, nend, nmirror, handler); @@ -909,7 +912,8 @@ template memory_passth if (!mph) mph = m_view.m_space->make_mph(); - m_view.m_select_u(m_id); + r()->select_u(m_id); + w()->select_u(m_id); auto rhandler = new handler_entry_read_tap (m_view.m_space, *mph, name, tapr); r() ->populate_passthrough(nstart, nend, nmirror, rhandler); @@ -942,7 +946,8 @@ template void memory_v offs_t nstart, nend, nmask, nmirror; check_range_optimize_mirror("install_readwrite_port", addrstart, addrend, addrmirror, nstart, nend, nmask, nmirror); - m_view.m_select_u(m_id); + r()->select_u(m_id); + w()->select_u(m_id); // read handler if (rtag != "") @@ -981,7 +986,8 @@ template void memory_v offs_t nstart, nend, nmask, nmirror; check_range_optimize_mirror("install_bank_generic", addrstart, addrend, addrmirror, nstart, nend, nmask, nmirror); - m_view.m_select_u(m_id); + r()->select_u(m_id); + w()->select_u(m_id); // map the read bank if (rbank != nullptr) -- cgit v1.2.3 From 057969e8c239d811397bc6dbcd19ede1a731526d Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Mon, 28 Dec 2020 14:25:18 +0100 Subject: views: pre-inline h_make_1, reduces the memory a little more --- src/emu/emumem_mview.cpp | 105 ++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 55 deletions(-) diff --git a/src/emu/emumem_mview.cpp b/src/emu/emumem_mview.cpp index e8248d7727e..653a37bcf1a 100644 --- a/src/emu/emumem_mview.cpp +++ b/src/emu/emumem_mview.cpp @@ -658,73 +658,68 @@ void memory_view::initialize_from_address_map(offs_t addrstart, offs_t addrend, } namespace { - template void h_make_1(address_space &space, memory_view &view, handler_entry *&r, handler_entry *&w) { - r = new handler_entry_read_dispatch (&space, view); - w = new handler_entry_write_dispatch(&space, view); - } - - template void h_make_2(int HighBits, address_space &space, memory_view &view, handler_entry *&r, handler_entry *&w) { + template void h_make_1(int HighBits, address_space &space, memory_view &view, handler_entry *&r, handler_entry *&w) { switch(HighBits) { - case 0: h_make_1(space, view, r, w); break; - case 1: h_make_1(space, view, r, w); break; - case 2: h_make_1(space, view, r, w); break; - case 3: h_make_1(space, view, r, w); break; - case 4: h_make_1< 4, Width, AddrShift, Endian>(space, view, r, w); break; - case 5: h_make_1< 5, Width, AddrShift, Endian>(space, view, r, w); break; - case 6: h_make_1< 6, Width, AddrShift, Endian>(space, view, r, w); break; - case 7: h_make_1< 7, Width, AddrShift, Endian>(space, view, r, w); break; - case 8: h_make_1< 8, Width, AddrShift, Endian>(space, view, r, w); break; - case 9: h_make_1< 9, Width, AddrShift, Endian>(space, view, r, w); break; - case 10: h_make_1<10, Width, AddrShift, Endian>(space, view, r, w); break; - case 11: h_make_1<11, Width, AddrShift, Endian>(space, view, r, w); break; - case 12: h_make_1<12, Width, AddrShift, Endian>(space, view, r, w); break; - case 13: h_make_1<13, Width, AddrShift, Endian>(space, view, r, w); break; - case 14: h_make_1<14, Width, AddrShift, Endian>(space, view, r, w); break; - case 15: h_make_1<15, Width, AddrShift, Endian>(space, view, r, w); break; - case 16: h_make_1<16, Width, AddrShift, Endian>(space, view, r, w); break; - case 17: h_make_1<17, Width, AddrShift, Endian>(space, view, r, w); break; - case 18: h_make_1<18, Width, AddrShift, Endian>(space, view, r, w); break; - case 19: h_make_1<19, Width, AddrShift, Endian>(space, view, r, w); break; - case 20: h_make_1<20, Width, AddrShift, Endian>(space, view, r, w); break; - case 21: h_make_1<21, Width, AddrShift, Endian>(space, view, r, w); break; - case 22: h_make_1<22, Width, AddrShift, Endian>(space, view, r, w); break; - case 23: h_make_1<23, Width, AddrShift, Endian>(space, view, r, w); break; - case 24: h_make_1<24, Width, AddrShift, Endian>(space, view, r, w); break; - case 25: h_make_1<25, Width, AddrShift, Endian>(space, view, r, w); break; - case 26: h_make_1<26, Width, AddrShift, Endian>(space, view, r, w); break; - case 27: h_make_1<27, Width, AddrShift, Endian>(space, view, r, w); break; - case 28: h_make_1<28, Width, AddrShift, Endian>(space, view, r, w); break; - case 29: h_make_1<29, Width, AddrShift, Endian>(space, view, r, w); break; - case 30: h_make_1<20, Width, AddrShift, Endian>(space, view, r, w); break; - case 31: h_make_1<31, Width, AddrShift, Endian>(space, view, r, w); break; - case 32: h_make_1<32, Width, AddrShift, Endian>(space, view, r, w); break; + case 0: r = new handler_entry_read_dispatch(&space, view); w = new handler_entry_write_dispatch(&space, view); break; + case 1: r = new handler_entry_read_dispatch(&space, view); w = new handler_entry_write_dispatch(&space, view); break; + case 2: r = new handler_entry_read_dispatch(&space, view); w = new handler_entry_write_dispatch(&space, view); break; + case 3: r = new handler_entry_read_dispatch(&space, view); w = new handler_entry_write_dispatch(&space, view); break; + case 4: r = new handler_entry_read_dispatch< 4, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch< 4, Width, AddrShift, Endian>(&space, view); break; + case 5: r = new handler_entry_read_dispatch< 5, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch< 5, Width, AddrShift, Endian>(&space, view); break; + case 6: r = new handler_entry_read_dispatch< 6, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch< 6, Width, AddrShift, Endian>(&space, view); break; + case 7: r = new handler_entry_read_dispatch< 7, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch< 7, Width, AddrShift, Endian>(&space, view); break; + case 8: r = new handler_entry_read_dispatch< 8, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch< 8, Width, AddrShift, Endian>(&space, view); break; + case 9: r = new handler_entry_read_dispatch< 9, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch< 9, Width, AddrShift, Endian>(&space, view); break; + case 10: r = new handler_entry_read_dispatch<10, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<10, Width, AddrShift, Endian>(&space, view); break; + case 11: r = new handler_entry_read_dispatch<11, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<11, Width, AddrShift, Endian>(&space, view); break; + case 12: r = new handler_entry_read_dispatch<12, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<12, Width, AddrShift, Endian>(&space, view); break; + case 13: r = new handler_entry_read_dispatch<13, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<13, Width, AddrShift, Endian>(&space, view); break; + case 14: r = new handler_entry_read_dispatch<14, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<14, Width, AddrShift, Endian>(&space, view); break; + case 15: r = new handler_entry_read_dispatch<15, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<15, Width, AddrShift, Endian>(&space, view); break; + case 16: r = new handler_entry_read_dispatch<16, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<16, Width, AddrShift, Endian>(&space, view); break; + case 17: r = new handler_entry_read_dispatch<17, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<17, Width, AddrShift, Endian>(&space, view); break; + case 18: r = new handler_entry_read_dispatch<18, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<18, Width, AddrShift, Endian>(&space, view); break; + case 19: r = new handler_entry_read_dispatch<19, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<19, Width, AddrShift, Endian>(&space, view); break; + case 20: r = new handler_entry_read_dispatch<20, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<20, Width, AddrShift, Endian>(&space, view); break; + case 21: r = new handler_entry_read_dispatch<21, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<21, Width, AddrShift, Endian>(&space, view); break; + case 22: r = new handler_entry_read_dispatch<22, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<22, Width, AddrShift, Endian>(&space, view); break; + case 23: r = new handler_entry_read_dispatch<23, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<23, Width, AddrShift, Endian>(&space, view); break; + case 24: r = new handler_entry_read_dispatch<24, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<24, Width, AddrShift, Endian>(&space, view); break; + case 25: r = new handler_entry_read_dispatch<25, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<25, Width, AddrShift, Endian>(&space, view); break; + case 26: r = new handler_entry_read_dispatch<26, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<26, Width, AddrShift, Endian>(&space, view); break; + case 27: r = new handler_entry_read_dispatch<27, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<27, Width, AddrShift, Endian>(&space, view); break; + case 28: r = new handler_entry_read_dispatch<28, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<28, Width, AddrShift, Endian>(&space, view); break; + case 29: r = new handler_entry_read_dispatch<29, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<29, Width, AddrShift, Endian>(&space, view); break; + case 30: r = new handler_entry_read_dispatch<30, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<30, Width, AddrShift, Endian>(&space, view); break; + case 31: r = new handler_entry_read_dispatch<31, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<31, Width, AddrShift, Endian>(&space, view); break; + case 32: r = new handler_entry_read_dispatch<32, Width, AddrShift, Endian>(&space, view); w = new handler_entry_write_dispatch<32, Width, AddrShift, Endian>(&space, view); break; default: abort(); } } - template void h_make_3(int HighBits, endianness_t Endian, address_space &space, memory_view &view, handler_entry *&r, handler_entry *&w) { + template void h_make_2(int HighBits, endianness_t Endian, address_space &space, memory_view &view, handler_entry *&r, handler_entry *&w) { switch(Endian) { - case ENDIANNESS_LITTLE: h_make_2(HighBits, space, view, r, w); break; - case ENDIANNESS_BIG: h_make_2 (HighBits, space, view, r, w); break; + case ENDIANNESS_LITTLE: h_make_1(HighBits, space, view, r, w); break; + case ENDIANNESS_BIG: h_make_1 (HighBits, space, view, r, w); break; default: abort(); } } void h_make(int HighBits, int Width, int AddrShift, endianness_t Endian, address_space &space, memory_view &view, handler_entry *&r, handler_entry *&w) { switch (Width | (AddrShift + 4)) { - case 8|(4+1): h_make_3<0, 1>(HighBits, Endian, space, view, r, w); break; - case 8|(4-0): h_make_3<0, 0>(HighBits, Endian, space, view, r, w); break; - case 16|(4+3): h_make_3<1, 3>(HighBits, Endian, space, view, r, w); break; - case 16|(4-0): h_make_3<1, 0>(HighBits, Endian, space, view, r, w); break; - case 16|(4-1): h_make_3<1, -1>(HighBits, Endian, space, view, r, w); break; - case 32|(4+3): h_make_3<2, 3>(HighBits, Endian, space, view, r, w); break; - case 32|(4-0): h_make_3<2, 0>(HighBits, Endian, space, view, r, w); break; - case 32|(4-1): h_make_3<2, -1>(HighBits, Endian, space, view, r, w); break; - case 32|(4-2): h_make_3<2, -2>(HighBits, Endian, space, view, r, w); break; - case 64|(4-0): h_make_3<3, 0>(HighBits, Endian, space, view, r, w); break; - case 64|(4-1): h_make_3<3, -1>(HighBits, Endian, space, view, r, w); break; - case 64|(4-2): h_make_3<3, -2>(HighBits, Endian, space, view, r, w); break; - case 64|(4-3): h_make_3<3, -3>(HighBits, Endian, space, view, r, w); break; + case 8|(4+1): h_make_2<0, 1>(HighBits, Endian, space, view, r, w); break; + case 8|(4-0): h_make_2<0, 0>(HighBits, Endian, space, view, r, w); break; + case 16|(4+3): h_make_2<1, 3>(HighBits, Endian, space, view, r, w); break; + case 16|(4-0): h_make_2<1, 0>(HighBits, Endian, space, view, r, w); break; + case 16|(4-1): h_make_2<1, -1>(HighBits, Endian, space, view, r, w); break; + case 32|(4+3): h_make_2<2, 3>(HighBits, Endian, space, view, r, w); break; + case 32|(4-0): h_make_2<2, 0>(HighBits, Endian, space, view, r, w); break; + case 32|(4-1): h_make_2<2, -1>(HighBits, Endian, space, view, r, w); break; + case 32|(4-2): h_make_2<2, -2>(HighBits, Endian, space, view, r, w); break; + case 64|(4-0): h_make_2<3, 0>(HighBits, Endian, space, view, r, w); break; + case 64|(4-1): h_make_2<3, -1>(HighBits, Endian, space, view, r, w); break; + case 64|(4-2): h_make_2<3, -2>(HighBits, Endian, space, view, r, w); break; + case 64|(4-3): h_make_2<3, -3>(HighBits, Endian, space, view, r, w); break; default: abort(); } } -- cgit v1.2.3 From 2cd35edee299c4743c3f944dac120a5fc86b7208 Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Mon, 28 Dec 2020 18:33:59 +0100 Subject: imagetek_i4100_device: Add some missing initializations, hopefully fixing random metro.cpp crashes at startup --- src/devices/video/imagetek_i4100.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/devices/video/imagetek_i4100.cpp b/src/devices/video/imagetek_i4100.cpp index 8c0eaff1011..cba8a4b4034 100644 --- a/src/devices/video/imagetek_i4100.cpp +++ b/src/devices/video/imagetek_i4100.cpp @@ -371,6 +371,25 @@ void imagetek_i4100_device::device_start() void imagetek_i4100_device::device_reset() { + m_rombank = 0; + m_crtc_unlock = false; + m_sprite_count = 0; + m_sprite_priority = 0; + m_sprite_xoffset = 0; + m_sprite_yoffset = 0; + m_sprite_color_code = 0; + + for(int i=0; i != 3; i++) { + m_layer_priority[i] = 0; + m_layer_tile_select[i] = false; + } + + m_background_color = 0; + m_screen_xoffset = 0; + m_screen_yoffset = 0; + m_screen_blank = false; + m_screen_flip = false; + expand_gfx1(); } -- cgit v1.2.3