From 3ecdc6282ae582ec9d30363a79e0e4a70a3a37b9 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Thu, 3 Jun 2021 19:38:20 +1000 Subject: mbee_cart.xml: fixed some bugs --- hash/mbee_cart.xml | 100 ++++++++++++++++++++++---------------------- src/mame/drivers/mbee.cpp | 56 ++++++++++++------------- src/mame/includes/mbee.h | 18 ++++---- src/mame/machine/mbee.cpp | 103 +++++++++++++++++++++++----------------------- 4 files changed, 137 insertions(+), 140 deletions(-) diff --git a/hash/mbee_cart.xml b/hash/mbee_cart.xml index 917ee5f3731..fcc65837cb8 100644 --- a/hash/mbee_cart.xml +++ b/hash/mbee_cart.xml @@ -29,7 +29,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t 1982 <unknown> - + @@ -42,7 +42,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t <unknown> - + @@ -55,7 +55,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t <unknown> - + @@ -68,7 +68,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t <unknown> - + @@ -81,7 +81,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t <unknown> - + @@ -94,7 +94,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t <unknown> - + @@ -107,7 +107,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t <unknown> - + @@ -120,7 +120,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Mytek - + @@ -133,7 +133,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t <unknown> - + @@ -146,7 +146,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Mytek - + @@ -159,7 +159,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t <unknown> - + @@ -172,7 +172,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t <unknown> - + @@ -185,7 +185,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t <unknown> - + @@ -198,7 +198,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -211,7 +211,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -224,7 +224,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -237,7 +237,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -250,7 +250,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -263,7 +263,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -276,7 +276,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -288,7 +288,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t 1986 Microworld - + @@ -301,7 +301,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -314,7 +314,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -327,7 +327,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -340,7 +340,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -353,7 +353,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -366,7 +366,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -379,7 +379,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -392,7 +392,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -405,7 +405,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -418,7 +418,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -431,7 +431,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -444,7 +444,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -457,7 +457,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -470,7 +470,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -483,7 +483,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -496,7 +496,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -509,7 +509,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -522,7 +522,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -535,7 +535,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -548,7 +548,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -561,7 +561,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -574,7 +574,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -587,7 +587,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -600,7 +600,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -613,7 +613,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -626,7 +626,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -639,7 +639,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -652,7 +652,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + @@ -665,7 +665,7 @@ Most roms can be mounted in any slot, although sometimes one is recommended in t Microworld - + diff --git a/src/mame/drivers/mbee.cpp b/src/mame/drivers/mbee.cpp index 303f7add1ed..6dd388cbdbf 100644 --- a/src/mame/drivers/mbee.cpp +++ b/src/mame/drivers/mbee.cpp @@ -617,13 +617,13 @@ static void mbee_floppies(device_slot_interface &device) void mbee_state::remove_carts(machine_config &config) { config.device_remove("cart_list"); - config.device_remove("pak0"); - config.device_remove("pak1"); - config.device_remove("pak2"); - config.device_remove("pak3"); - config.device_remove("pak4"); - config.device_remove("pak5"); - config.device_remove("net"); + config.device_remove("optrom1"); + config.device_remove("optrom2"); + config.device_remove("optrom3"); + config.device_remove("optrom4"); + config.device_remove("optrom5"); + config.device_remove("optrom6"); + config.device_remove("optrom7"); } void mbee_state::mbee(machine_config &config) @@ -681,8 +681,8 @@ void mbee_state::mbee(machine_config &config) m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05); m_cassette->set_interface("mbee_cass"); - GENERIC_SOCKET(config, "net", generic_plain_slot, "mbee_cart", "mbn,rom").set_device_load(FUNC(mbee_state::net_load)); - GENERIC_SOCKET(config, "pak0", generic_plain_slot, "mbee_cart", "mbp,rom").set_device_load(FUNC(mbee_state::pak_load<0U>)); + GENERIC_SOCKET(config, "optrom1", generic_plain_slot, "mbee_net", "mbn").set_device_load(FUNC(mbee_state::pak_load<1U>)); // net + GENERIC_SOCKET(config, "optrom2", generic_plain_slot, "mbee_pak", "mbp").set_device_load(FUNC(mbee_state::pak_load<2U>)); // edasm SOFTWARE_LIST(config, "cass_list").set_original("mbee_cass").set_filter("1"); SOFTWARE_LIST(config, "quik_list").set_original("mbee_quik").set_filter("1"); @@ -745,13 +745,13 @@ void mbee_state::mbeeic(machine_config &config) m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05); m_cassette->set_interface("mbee_cass"); - GENERIC_SOCKET(config, "net", generic_plain_slot, "mbee_cart", "mbn,rom").set_device_load(FUNC(mbee_state::net_load)); - GENERIC_SOCKET(config, "pak0", generic_plain_slot, "mbee_cart", "mbp,rom").set_device_load(FUNC(mbee_state::pak_load<0U>)); - GENERIC_SOCKET(config, "pak1", generic_plain_slot, "mbee_cart", "mbp,rom").set_device_load(FUNC(mbee_state::pak_load<1U>)); - GENERIC_SOCKET(config, "pak2", generic_plain_slot, "mbee_cart", "mbp,rom").set_device_load(FUNC(mbee_state::pak_load<2U>)); - GENERIC_SOCKET(config, "pak3", generic_plain_slot, "mbee_cart", "mbp,rom").set_device_load(FUNC(mbee_state::pak_load<3U>)); - GENERIC_SOCKET(config, "pak4", generic_plain_slot, "mbee_cart", "mbp,rom").set_device_load(FUNC(mbee_state::pak_load<4U>)); - GENERIC_SOCKET(config, "pak5", generic_plain_slot, "mbee_cart", "mbp,rom").set_device_load(FUNC(mbee_state::pak_load<5U>)); + GENERIC_SOCKET(config, "optrom1", generic_plain_slot, "mbee_net", "mbn").set_device_load(FUNC(mbee_state::pak_load<1U>)); // net + GENERIC_SOCKET(config, "optrom2", generic_plain_slot, "mbee_pak", "mbp").set_device_load(FUNC(mbee_state::pak_load<2U>)); // pak0 + GENERIC_SOCKET(config, "optrom3", generic_plain_slot, "mbee_pak", "mbp").set_device_load(FUNC(mbee_state::pak_load<3U>)); // pak1 + GENERIC_SOCKET(config, "optrom4", generic_plain_slot, "mbee_pak", "mbp").set_device_load(FUNC(mbee_state::pak_load<4U>)); // pak2 + GENERIC_SOCKET(config, "optrom5", generic_plain_slot, "mbee_pak", "mbp").set_device_load(FUNC(mbee_state::pak_load<5U>)); // pak3 + GENERIC_SOCKET(config, "optrom6", generic_plain_slot, "mbee_pak", "mbp").set_device_load(FUNC(mbee_state::pak_load<6U>)); // pak4 + GENERIC_SOCKET(config, "optrom7", generic_plain_slot, "mbee_pak", "mbp").set_device_load(FUNC(mbee_state::pak_load<7U>)); // pak5 SOFTWARE_LIST(config, "cass_list").set_original("mbee_cass").set_filter("2"); SOFTWARE_LIST(config, "quik_list").set_original("mbee_quik").set_filter("2"); @@ -850,11 +850,11 @@ void mbee_state::mbeett(machine_config &config) m_maincpu->set_addrmap(AS_IO, &mbee_state::mbeett_io); TIMER(config, "newkb_timer").configure_periodic(FUNC(mbee_state::newkb_timer), attotime::from_hz(50)); config.device_remove("cass_list"); // mbeett is incompatible with the others - config.device_remove("pak1"); - config.device_remove("pak2"); - config.device_remove("pak3"); - config.device_remove("pak4"); - config.device_remove("pak5"); + config.device_remove("optrom3"); + config.device_remove("optrom4"); + config.device_remove("optrom5"); + config.device_remove("optrom6"); + config.device_remove("optrom7"); SOFTWARE_LIST(config.replace(), "cart_list").set_original("mbee_cart").set_filter("TT"); } @@ -880,7 +880,7 @@ ROM_START( mbeeic ) ROM_LOAD("bas522a.ic5", 0x0000, 0x2000, CRC(7896a696) SHA1(a158f7803296766160e1f258dfc46134735a9477) ) ROM_LOAD("bas522b.ic10", 0x2000, 0x2000, CRC(b21d9679) SHA1(332844433763331e9483409cd7da3f90ac58259d) ) - ROM_REGION( 0x1000, "netdef", 0 ) + ROM_REGION( 0x1000, "netdef", ROMREGION_ERASEFF ) ROM_LOAD_OPTIONAL( "telcom10.mbn", 0x0000, 0x1000, CRC(d1617e4f) SHA1(c73dc4dcf4c69419842fa4b52aa92e86924a2e2b) ) // net /* PAK option roms */ @@ -901,7 +901,7 @@ ROM_START( mbeepc ) ROM_LOAD("bas522a.ic5", 0x0000, 0x2000, CRC(7896a696) SHA1(a158f7803296766160e1f258dfc46134735a9477) ) ROM_LOAD("bas522b.ic10", 0x2000, 0x2000, CRC(b21d9679) SHA1(332844433763331e9483409cd7da3f90ac58259d) ) - ROM_REGION( 0x1000, "netdef", 0 ) + ROM_REGION( 0x1000, "netdef", ROMREGION_ERASEFF ) ROM_LOAD_OPTIONAL( "telcom10.mbn", 0x0000, 0x1000, CRC(d1617e4f) SHA1(c73dc4dcf4c69419842fa4b52aa92e86924a2e2b) ) // net /* PAK option roms */ @@ -922,7 +922,7 @@ ROM_START( mbeepc85 ) ROM_LOAD("bas525a.rom", 0x0000, 0x2000, CRC(a6e02afe) SHA1(0495308c7e1d84b5989a3af6d3b881f4580b2641) ) ROM_LOAD("bas525b.rom", 0x2000, 0x2000, CRC(245dd36b) SHA1(dd288f3e6737627f50d3d2a49df3e57c423d3118) ) - ROM_REGION( 0x2000, "netdef", 0 ) + ROM_REGION( 0x2000, "netdef", ROMREGION_ERASEFF ) ROM_LOAD_OPTIONAL("telcom321a.mbn", 0x0000, 0x2000, CRC(36852a11) SHA1(c45b8d03629e86231c6b256a7435abd87d8872a4) ) /* PAK option roms - Wordbee must be in slot 0 and Shell must be in slot 5. */ @@ -944,7 +944,7 @@ ROM_START( mbeepc85b ) ROM_LOAD("bas525a.rom", 0x0000, 0x2000, CRC(a6e02afe) SHA1(0495308c7e1d84b5989a3af6d3b881f4580b2641) ) ROM_LOAD("bas525b.rom", 0x2000, 0x2000, CRC(245dd36b) SHA1(dd288f3e6737627f50d3d2a49df3e57c423d3118) ) - ROM_REGION( 0x2000, "netdef", 0 ) + ROM_REGION( 0x2000, "netdef", ROMREGION_ERASEFF ) ROM_LOAD_OPTIONAL("telcom321a.mbn", 0x0000, 0x2000, CRC(36852a11) SHA1(c45b8d03629e86231c6b256a7435abd87d8872a4) ) /* PAK option roms - Wordbee must be in slot 0 and Shell must be in slot 5. */ @@ -971,7 +971,7 @@ ROM_START( mbeepc85s ) ROM_LOAD("bas524a.rom", 0x0000, 0x2000, CRC(ec9c7a60) SHA1(a4021bcedc8da8c0eb0bda036a1d457619a175b0) ) ROM_LOAD("bas524b.rom", 0x2000, 0x2000, CRC(17d3eac7) SHA1(d40d376cc5e751d257d951909a34445e70506c7b) ) - ROM_REGION( 0x2000, "netdef", 0 ) + ROM_REGION( 0x2000, "netdef", ROMREGION_ERASEFF ) ROM_LOAD_OPTIONAL("telcom321s.mbp", 0x0000, 0x2000, CRC(00f8fde1) SHA1(eb881bbab90c85fd6e29540decd25e884c67f738) ) /* PAK roms - These are not optional and will only work in the correct slots. */ @@ -995,7 +995,7 @@ ROM_START( mbeett ) ROM_REGION( 0x2000, "maincpu", 0 ) ROM_LOAD("kernel_106.rom", 0x0000, 0x2000, CRC(5ab9cb1d) SHA1(a1fb971622f85c4d866b91cb4bec6d75757e8c5f) ) - ROM_REGION( 0x2000, "netdef", 0 ) + ROM_REGION( 0x2000, "netdef", ROMREGION_ERASEFF ) ROM_LOAD("wm_106.mbn", 0x0000, 0x2000, CRC(77e0b355) SHA1(1db6769cd6b12e1c335c83f17f8c139986c87758) ) ROM_REGION( 0x20000, "pakdef", ROMREGION_ERASEFF ) @@ -1018,7 +1018,7 @@ ROM_START( mbeeppc ) ROM_REGION( 0x4000, "basicrom", 0 ) ROM_LOAD("bas529a.rom", 0x0000, 0x4000, CRC(fe8242e1) SHA1(ff790edf4fcc7a134d451dbad7779157b07f6abf) ) - ROM_REGION( 0x2000, "netdef", 0 ) + ROM_REGION( 0x2000, "netdef", ROMREGION_ERASEFF ) ROM_LOAD_OPTIONAL("telco321.rom", 0x0000, 0x2000, CRC(36852a11) SHA1(c45b8d03629e86231c6b256a7435abd87d8872a4) ) /* PAK option roms - Wordbee must be in slot 0 and Shell must be in slot 5. */ diff --git a/src/mame/includes/mbee.h b/src/mame/includes/mbee.h index 0266fbdf9e9..00196e83723 100644 --- a/src/mame/includes/mbee.h +++ b/src/mame/includes/mbee.h @@ -58,14 +58,13 @@ public: , m_p_netdef(*this, "netdef") , m_basic(*this, "basic") , m_io_x7(*this, "X.7") - , m_io_oldkb(*this, "X.%u", 0) - , m_io_newkb(*this, "Y.%u", 0) + , m_io_oldkb(*this, "X.%u", 0U) + , m_io_newkb(*this, "Y.%u", 0U) , m_io_config(*this, "CONFIG") , m_screen(*this, "screen") - , m_bankr(*this, "bankr%d", 0) - , m_bankw(*this, "bankw%d", 0) - , m_pak(*this, "pak%u", 0U) - , m_net(*this, "net") + , m_bankr(*this, "bankr%d", 0U) + , m_bankw(*this, "bankw%d", 0U) + , m_pak(*this, "optrom%u", 0U) // "rom" causes issues { } void mbee56(machine_config &config); @@ -124,7 +123,6 @@ private: image_init_result load_cart(device_image_interface &image, generic_slot_device *slot, u8); DECLARE_QUICKLOAD_LOAD_MEMBER(quickload_cb); template DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pak_load) { return load_cart(image, m_pak[T], T); } - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(net_load); WRITE_LINE_MEMBER(rtc_irq_w); WRITE_LINE_MEMBER(fdc_intrq_w); WRITE_LINE_MEMBER(fdc_drq_w); @@ -167,8 +165,7 @@ private: u8 m_sy6545_ind = 0; u8 m_fdc_rq = 0; u8 m_bank_array[33] = { 0, }; - bool m_pak_extended[8] = { 0, }; - bool m_net_extended = 0; + bool m_pak_extended[10] = { 0, }; std::unique_ptr m_dummy; // black hole for writes to rom std::unique_ptr m_ram; // main banked-switch ram, 128/256/pp std::unique_ptr m_vram; // video ram, all models @@ -201,8 +198,7 @@ private: required_device m_screen; optional_memory_bank_array<16> m_bankr; optional_memory_bank_array<16> m_bankw; - optional_device_array m_pak; - optional_device m_net; + optional_device_array m_pak; }; #endif // MAME_INCLUDES_MBEE_H diff --git a/src/mame/machine/mbee.cpp b/src/mame/machine/mbee.cpp index a79c9e384e7..c25d5df881e 100644 --- a/src/mame/machine/mbee.cpp +++ b/src/mame/machine/mbee.cpp @@ -391,7 +391,7 @@ u8 mbee_state::telcom_r(offs_t offset) u8 mbee_state::pak_r(offs_t offset) { - u8 data = m_0a & 7; + u8 data = (m_0a & 7)+2; if (m_pak[data] && m_pak[data]->exists()) { @@ -417,15 +417,16 @@ u8 mbee_state::pak_r(offs_t offset) u8 mbee_state::net_r(offs_t offset) { - if (m_net && m_net->exists()) + if (m_pak[1] && m_pak[1]->exists()) { - if (m_09 && m_net_extended) - return m_net->read_rom(0x1000 | offset); + if (m_09 && m_pak_extended[1]) + return m_pak[1]->read_rom(0x1000 | offset); else - return m_net->read_rom(offset); + return m_pak[1]->read_rom(offset); } else { + m_pak_extended[1] = false; if (m_netdef) return m_p_netdef[(m_09<<12)|offset]; else @@ -538,14 +539,14 @@ void mbee_state::machine_start() // set pak index to true for 16k roms if (m_pakdef) - for (u8 i = 8; i < 16; i++) - m_pak_extended[i & 7] = (m_p_pakdef[(i<<13)] == 0xff) ? false : true; + for (u8 i = 8; i < 14; i++) + m_pak_extended[(i & 7)+2] = (m_p_pakdef[(i<<13)] == 0xff) ? false : true; else - for (u8 i = 0; i < 8; i++) + for (u8 i = 2; i < 8; i++) m_pak_extended[i] = false; // set net index to true for 8k roms - m_net_extended = (m_netdef && (m_netdef->bytes() > 0x1000)) ? true : false; + m_pak_extended[1] = (m_netdef && (m_netdef->bytes() > 0x1000)) ? true : false; } void mbee_state::machine_reset() @@ -719,61 +720,61 @@ QUICKLOAD_LOAD_MEMBER(mbee_state::quickload_cb) return image_init_result::PASS; } +// Index usage: 0 = not used; 1 = net rom; 2-7 = pak roms image_init_result mbee_state::load_cart(device_image_interface &image, generic_slot_device *slot, u8 pak_index) { u32 size = slot->common_get_size("rom"); - if ((size == 0) || (size > 0x4000)) + if (pak_index > 1) { - image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported ROM size"); - return image_init_result::FAIL; - } + // "mbp" roms + if ((size == 0) || (size > 0x4000)) + { + image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported ROM size"); + return image_init_result::FAIL; + } - m_pak_extended[pak_index] = (size > 0x2000) ? true : false; + m_pak_extended[pak_index] = (size > 0x2000) ? true : false; - slot->rom_alloc(m_pak_extended ? 0x4000 : 0x2000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); // we alloc the amount for a real rom - slot->common_load_rom(slot->get_rom_base(), size, "rom"); + slot->rom_alloc(m_pak_extended ? 0x4000 : 0x2000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); // we alloc the amount for a real rom + slot->common_load_rom(slot->get_rom_base(), size, "rom"); - // Validate the rom - logerror ("Rom header = %02X %02X %02X\n", slot->read_rom(0), slot->read_rom(1), slot->read_rom(2)); - if ((slot->read_rom(0) != 0xc3) || ((slot->read_rom(2) & 0xe0) != 0xc0)) - { - image.seterror(IMAGE_ERROR_UNSPECIFIED, "Not a PAK rom"); - slot->call_unload(); - if (m_pakdef) - m_pak_extended[pak_index] = (m_p_pakdef[((pak_index+8)<<13)] == 0xff) ? false : true; - else - m_pak_extended[pak_index] = false; - return image_init_result::FAIL; + // Validate the rom + logerror ("Rom header = %02X %02X %02X\n", slot->read_rom(0), slot->read_rom(1), slot->read_rom(2)); + if ((slot->read_rom(0) != 0xc3) || ((slot->read_rom(2) & 0xe0) != 0xc0)) + { + image.seterror(IMAGE_ERROR_UNSPECIFIED, "Not a PAK rom"); + slot->call_unload(); + if (m_pakdef) + m_pak_extended[pak_index] = (m_p_pakdef[((pak_index+8)<<13)] == 0xff) ? false : true; + else + m_pak_extended[pak_index] = false; + return image_init_result::FAIL; + } } - - return image_init_result::PASS; -} - -DEVICE_IMAGE_LOAD_MEMBER(mbee_state::net_load) -{ - uint32_t size = m_net->common_get_size("rom"); - - if ((size == 0) || (size > 0x2000)) + else { - image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported ROM size"); - return image_init_result::FAIL; - } - - size = (size > 0x1000) ? 0x2000 : 0x1000; + // "mbn" roms + if ((size == 0) || (size > 0x2000)) + { + image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported ROM size"); + return image_init_result::FAIL; + } - m_net->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); - m_net->common_load_rom(m_net->get_rom_base(), size, "rom"); + m_pak_extended[pak_index] = (size > 0x1000) ? true : false; + slot->rom_alloc(m_pak_extended ? 0x2000 : 0x1000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); + slot->common_load_rom(slot->get_rom_base(), size, "rom"); - // Validate the rom - logerror ("Rom header = %02X %02X %02X\n", m_net->read_rom(0), m_net->read_rom(1), m_net->read_rom(2)); - if ((m_net->read_rom(0) != 0xc3) || ((m_net->read_rom(2) & 0xf0) != 0xe0)) - { - image.seterror(IMAGE_ERROR_UNSPECIFIED, "Not a NET rom"); - m_net->call_unload(); - m_net_extended = (m_netdef && (m_netdef->bytes() > 0x1000)) ? true : false; - return image_init_result::FAIL; + // Validate the rom + logerror ("Rom header = %02X %02X %02X\n", slot->read_rom(0), slot->read_rom(1), slot->read_rom(2)); + if ((slot->read_rom(0) != 0xc3) || ((slot->read_rom(2) & 0xf0) != 0xe0)) + { + image.seterror(IMAGE_ERROR_UNSPECIFIED, "Not a NET rom"); + slot->call_unload(); + m_pak_extended[pak_index] = (m_netdef && (m_netdef->bytes() > 0x1000)) ? true : false; + return image_init_result::FAIL; + } } return image_init_result::PASS; -- cgit v1.2.3