msx1_cart.xml: Hexadecimal sizes, explicitly configure loading for smaller images, add information and usage notes. (#10883)

* Use hexadecimal sizes.
* Added a feature to explicitly indicate where in memory cartridges without mappers should be loaded.
* Updated serial, isbn, gtin, and usage notes.
* Updated versions in Arabic releases and added Arabic alt_titles.
This commit is contained in:
wilbertpol 2023-02-11 21:24:12 +00:00 committed by GitHub
parent 6f93428f96
commit 2afd1bf48e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4575 additions and 2880 deletions

File diff suppressed because it is too large Load Diff

View File

@ -184,6 +184,7 @@ LZ93A13 (32 pin) - 8KB banks
<year>1987</year>
<publisher>Taito</publisher>
<info name="alt_title" value="バブルボブル" />
<info name="serial" value="TMS-02" />
<info name="usage" value="Requires a Japanese system" />
<part name="cart" interface="msx_cart">
<feature name="pcb" value="TA-1M" />
@ -3104,9 +3105,9 @@ LZ93A13 (32 pin) - 8KB banks
<year>19??</year>
<publisher>Philips</publisher>
<part name="cart" interface="msx_cart">
<feature name="mapper" value="NOMAPPER" />
<dataarea name="rom" size="16384">
<rom name="stcmsx2p.bin" size="16384" crc="4e4fbe2a" sha1="f29cef9d13d50d9e3158064c6bb381def6ff384d" offset="0x0000" />
<feature name="start_page" value="0"/>
<dataarea name="rom" size="0x4000">
<rom name="stcmsx2p.bin" size="0x4000" crc="4e4fbe2a" sha1="f29cef9d13d50d9e3158064c6bb381def6ff384d" />
</dataarea>
</part>
</software>
@ -3115,10 +3116,11 @@ LZ93A13 (32 pin) - 8KB banks
<description>Cheese 2 (Japan)</description>
<year>1985</year>
<publisher>Neos</publisher>
<info name="usage" value="Requires a mouse in general purpose port 1."/>
<part name="cart" interface="msx_cart">
<feature name="mapper" value="NOMAPPER" />
<dataarea name="rom" size="32768">
<rom name="cheese 2 (japan) (program).rom" size="32768" crc="2ffb49c3" sha1="930b4896c1590ebbb74d330447ec36e3feb5cab6" status="baddump" offset="0" />
<feature name="start_page" value="1"/>
<dataarea name="rom" size="0x8000">
<rom name="cheese 2 (japan) (program).rom" size="0x8000" crc="2ffb49c3" sha1="930b4896c1590ebbb74d330447ec36e3feb5cab6" status="baddump" />
</dataarea>
</part>
</software>

View File

@ -50,60 +50,81 @@ image_init_result msx_cart_nomapper_device::initialize_cartridge(std::string &me
const u32 size = cart_rom_region()->bytes();
u8 *rom = cart_rom_region()->base();
// determine start address, default to 0x4000
m_start_address = 0x4000;
switch (size)
// 64KB images fill all pages.
if (size == 0x10000)
{
// 8KB/16KB
case 0x2000: case 0x4000:
m_start_address = 0;
}
else if (is_loaded_through_softlist())
{
const char *start_page_str = get_feature("start_page");
if (!start_page_str)
{
uint16_t start = rom[3] << 8 | rom[2];
// start address of $0000: call address in the $4000 region: $4000, else $8000
if (start == 0)
{
if ((rom[5] & 0xc0) == 0x40)
m_start_address = 0x4000;
else
m_start_address = 0x8000;
}
// start address in the $8000 region: $8000, else default
else if ((start & 0xc000) == 0x8000)
m_start_address = 0x8000;
break;
message = "msx_cart_nomapper_device: Feature 'start_page' was not found.";
return image_init_result::FAIL;
}
u32 start_page = strtol(start_page_str, nullptr, 0);
if (start_page > 2)
{
message = "msx_cart_nomapper_device: Invalid value for 'start_page', allowed values are 0, 1, and 2";
return image_init_result::FAIL;
}
// 32KB
case 0x8000:
// take default, check when no "AB" at $0000, but "AB" at $4000
if (rom[0] != 'A' && rom[1] != 'B' && rom[0x4000] == 'A' && rom[0x4001] == 'B')
{
uint16_t start = rom[0x4003] << 8 | rom[0x4002];
m_start_address = start_page * 0x4000;
}
else
{
// Try to guess the start address from the rom contents.
// determine start address, default to 0x4000
m_start_address = 0x4000;
// start address of $0000 and call address in the $4000 region, or start address outside the $8000 region: $0000, else default
if ((start == 0 && (rom[0x4005] & 0xc0) == 0x40) || start < 0x8000 || start >= 0xc000)
m_start_address = 0;
switch (size)
{
// 8KB/16KB
case 0x2000: case 0x4000:
{
uint16_t start = rom[3] << 8 | rom[2];
// start address of $0000: call address in the $4000 region: $4000, else $8000
if (start == 0)
{
if ((rom[5] & 0xc0) == 0x40)
m_start_address = 0x4000;
else
m_start_address = 0x8000;
}
// start address in the $8000 region: $8000, else default
else if ((start & 0xc000) == 0x8000)
m_start_address = 0x8000;
break;
}
break;
// 32KB
case 0x8000:
// take default, check when no "AB" at $0000, but "AB" at $4000
if (rom[0] != 'A' && rom[1] != 'B' && rom[0x4000] == 'A' && rom[0x4001] == 'B')
{
uint16_t start = rom[0x4003] << 8 | rom[0x4002];
// 48KB
case 0xc000:
// "AB" at $0000, but no "AB" at $4000, not "AB": $0000
if (rom[0] == 'A' && rom[1] == 'B' && rom[0x4000] != 'A' && rom[0x4001] != 'B')
m_start_address = 0x4000;
else
m_start_address = 0;
// start address of $0000 and call address in the $4000 region, or start address outside the $8000 region: $0000, else default
if ((start == 0 && (rom[0x4005] & 0xc0) == 0x40) || start < 0x8000 || start >= 0xc000)
m_start_address = 0;
}
break;
break;
// 64KB
default:
m_start_address = 0;
break;
// 48KB
case 0xc000:
// "AB" at $0000, but no "AB" at $4000, not "AB": $0000
if (rom[0] == 'A' && rom[1] == 'B' && rom[0x4000] != 'A' && rom[0x4001] != 'B')
m_start_address = 0x4000;
else
m_start_address = 0;
break;
}
}
m_end_address = std::min<u32>(m_start_address + size, 0x10000);

View File

@ -92,6 +92,8 @@ protected:
memory_region *cart_kanji_region() { return m_exp ? m_exp->memregion("kanji") : nullptr; }
memory_region *cart_ram_region() { return m_exp ? m_exp->memregion("ram") : nullptr; }
memory_region *cart_sram_region() { return m_exp ? m_exp->memregion("sram") : nullptr; }
const char *get_feature(std::string_view feature_name) { return m_exp ? m_exp->get_feature(feature_name) : nullptr; }
bool is_loaded_through_softlist() { return m_exp ? m_exp->loaded_through_softlist() : false; }
DECLARE_WRITE_LINE_MEMBER(irq_out);
address_space &memory_space() const;
address_space &io_space() const;