diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index acca179f..7565a354 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -25,6 +25,8 @@ if (BUSES["A7800"]~=null) then MAME_DIR .. "src/devices/bus/a7800/hiscore.h", MAME_DIR .. "src/devices/bus/a7800/xm.cpp", MAME_DIR .. "src/devices/bus/a7800/xm.h", + MAME_DIR .. "src/devices/bus/a7800/bankset.cpp", + MAME_DIR .. "src/devices/bus/a7800/bankset.h", MAME_DIR .. "src/devices/bus/a7800/cpuwiz.cpp", MAME_DIR .. "src/devices/bus/a7800/cpuwiz.h", } diff --git a/src/devices/bus/a7800/a78_carts.h b/src/devices/bus/a7800/a78_carts.h index 4db67bf4..6494f22f 100644 --- a/src/devices/bus/a7800/a78_carts.h +++ b/src/devices/bus/a7800/a78_carts.h @@ -9,6 +9,7 @@ #include "xm.h" #include "hiscore.h" #include "cpuwiz.h" +#include "bankset.h" static SLOT_INTERFACE_START(a7800_cart) SLOT_INTERFACE_INTERNAL("a78_rom", A78_ROM) @@ -22,6 +23,8 @@ static SLOT_INTERFACE_START(a7800_cart) SLOT_INTERFACE_INTERNAL("a78_act", A78_ROM_ACTIVISION) SLOT_INTERFACE_INTERNAL("a78_hsc", A78_HISCORE) SLOT_INTERFACE_INTERNAL("a78_xm", A78_XM) // the actual XM expansion (as passthru) + SLOT_INTERFACE_INTERNAL("a78_bankset_sg", A78_ROM_BANKSET_SG) + SLOT_INTERFACE_INTERNAL("a78_bankset_sg_bankram", A78_ROM_BANKSET_SG_BANKRAM) SLOT_INTERFACE_INTERNAL("a78_megacart", A78_ROM_MEGACART) SLOT_INTERFACE_INTERNAL("a78_versa", A78_ROM_VERSABOARD) // cart variants with a POKEY at 0x0450 (typically a VersaBoard variant, or an homebrew pcb) diff --git a/src/devices/bus/a7800/a78_slot.cpp b/src/devices/bus/a7800/a78_slot.cpp index a190b1a7..0733e3b9 100644 --- a/src/devices/bus/a7800/a78_slot.cpp +++ b/src/devices/bus/a7800/a78_slot.cpp @@ -261,7 +261,7 @@ int a78_cart_slot_device::validate_header(int head, bool log) const head &= 0xff00; } - if ((head & 0xff00) > 0x300) + if ((head & 0xff00) > 0x2000) { if (log) { @@ -301,6 +301,8 @@ static const a78_slot slot_list[] = { A78_ACTIVISION, "a78_act" }, { A78_HSC, "a78_hsc" }, { A78_XM_BOARD, "a78_xm" }, + { A78_BANKSET_SG, "a78_bankset_sg" }, + { A78_BANKSET_SG_BANKRAM, "a78_bankset_sg_bankram" }, { A78_MEGACART, "a78_megacart" }, { A78_VERSABOARD, "a78_versa" }, { A78_TYPE0_POK450, "a78_p450_t0" }, @@ -381,7 +383,7 @@ image_init_result a78_cart_slot_device::call_load() // let's try to auto-fix some common errors in the header mapper = validate_header((head[53] << 8) | head[54], true); - switch (mapper & 0x2e) + switch (mapper & 0x202e) { case 0x0000: m_type = BIT(mapper, 0) ? A78_TYPE1 : A78_TYPE0; @@ -402,6 +404,12 @@ image_init_result a78_cart_slot_device::call_load() else m_type = A78_VERSABOARD; break; + case 0x2002: + m_type = A78_BANKSET_SG; + break; + case 0x2022: + m_type = A78_BANKSET_SG_BANKRAM; + break; } // check if cart has a POKEY at $0450 (typically a VersaBoard variant) @@ -450,7 +458,7 @@ image_init_result a78_cart_slot_device::call_load() if (m_type == A78_TYPE6 || m_type == A78_TYPE8) m_cart->ram_alloc(0x4000); - if (m_type == A78_MEGACART || (m_type >= A78_VERSABOARD && m_type <= A78_VERSA_POK450)) + if (m_type == A78_MEGACART || (m_type == A78_BANKSET_SG_BANKRAM) || (m_type >= A78_VERSABOARD && m_type <= A78_VERSA_POK450)) m_cart->ram_alloc(0x8000); if (m_type == A78_XM_BOARD) m_cart->ram_alloc(0x20000); @@ -517,7 +525,7 @@ std::string a78_cart_slot_device::get_default_card_software(get_default_card_sof // let's try to auto-fix some common errors in the header mapper = validate_header((head[53] << 8) | head[54], false); - switch (mapper & 0x2e) + switch (mapper & 0x202e) { case 0x0000: type = BIT(mapper, 0) ? A78_TYPE1 : A78_TYPE0; @@ -538,6 +546,12 @@ std::string a78_cart_slot_device::get_default_card_software(get_default_card_sof else type = A78_VERSABOARD; break; + case 0x2002: + type = A78_BANKSET_SG; + break; + case 0x2022: + type = A78_BANKSET_SG_BANKRAM; + break; } // check if cart has a POKEY at $0450 (typically a VersaBoard variant)! diff --git a/src/devices/bus/a7800/a78_slot.h b/src/devices/bus/a7800/a78_slot.h index b49fedf7..32646a14 100644 --- a/src/devices/bus/a7800/a78_slot.h +++ b/src/devices/bus/a7800/a78_slot.h @@ -28,6 +28,8 @@ enum A78_HSC, // Atari HighScore cart A78_XB_BOARD, // A7800 Expansion Board (it shall more or less apply to the Expansion Module too, but this is not officially released yet) A78_XM_BOARD, // A7800 XM Expansion Module (theoretical specs only, since this is not officially released yet) + A78_BANKSET_SG, + A78_BANKSET_SG_BANKRAM, A78_MEGACART, // Homebrew by CPUWIZ, consists of SuperGame bank up to 512K + 32K RAM banked A78_VERSABOARD = 0x10, // Homebrew by CPUWIZ, consists of SuperGame bank up to 256K + 32K RAM banked // VersaBoard variants configured as Type 1/3/A or VersaBoard + POKEY at $0450