(MESS) msx.c: slightly simplified sram handling in conjunction with softlists. no whatsnew.

This commit is contained in:
Fabio Priuli 2012-09-26 19:09:39 +00:00
parent 1069bca28d
commit b4343927a4
4 changed files with 1057 additions and 1020 deletions

View File

@ -22,6 +22,8 @@ Unless otherwise noted, the information in this list has not been verified by op
<dataarea name="rom" size="262144"> <dataarea name="rom" size="262144">
<rom name="lh532077" size="262144" crc="4ead5098" sha1="12b3c31f0fd10ff5823dcc8bf6dfeb785a8af2f7" offset="0" /> <rom name="lh532077" size="262144" crc="4ead5098" sha1="12b3c31f0fd10ff5823dcc8bf6dfeb785a8af2f7" offset="0" />
</dataarea> </dataarea>
<dataarea name="sram" size="8192" >
</dataarea>
</part> </part>
</software> </software>
@ -202,10 +204,11 @@ Unless otherwise noted, the information in this list has not been verified by op
<part name="cart" interface="msx_cart"> <part name="cart" interface="msx_cart">
<feature name="pcb" value="TA-621 KAGA" /> <feature name="pcb" value="TA-621 KAGA" />
<feature name="mapper" value="M60002-0125SP" /> <feature name="mapper" value="M60002-0125SP" />
<feature name="sram" value="SRAM" />
<dataarea name="rom" size="262144"> <dataarea name="rom" size="262144">
<rom name="lh532051" size="262144" crc="d640deaf" sha1="6c1814c70d69a50ec60e39ef281f0b8cd7bf8598" offset="0" /> <rom name="lh532051" size="262144" crc="d640deaf" sha1="6c1814c70d69a50ec60e39ef281f0b8cd7bf8598" offset="0" />
</dataarea> </dataarea>
<dataarea name="sram" size="8192" >
</dataarea>
</part> </part>
</software> </software>
@ -276,10 +279,11 @@ Unless otherwise noted, the information in this list has not been verified by op
<part name="cart" interface="msx_cart"> <part name="cart" interface="msx_cart">
<feature name="pcb" value="TAS-621-64K" /> <feature name="pcb" value="TAS-621-64K" />
<feature name="mapper" value="M60002-0125SP" /> <feature name="mapper" value="M60002-0125SP" />
<feature name="sram" value="SRAM" />
<dataarea name="rom" size="131072"> <dataarea name="rom" size="131072">
<rom name="lh23100y" size="131072" crc="" sha1="" offset="0" /> <rom name="lh23100y" size="131072" crc="" sha1="" offset="0" />
</dataarea> </dataarea>
<dataarea name="sram" size="8192" >
</dataarea>
</part> </part>
</software> </software>
--> -->
@ -501,6 +505,8 @@ Unless otherwise noted, the information in this list has not been verified by op
<dataarea name="rom" size="262144"> <dataarea name="rom" size="262144">
<rom name="lh532038" size="262144" crc="3aa33a30" sha1="e6de8bbd60123444de2a90928853985ceb0b4cbf" offset="0" /> <rom name="lh532038" size="262144" crc="3aa33a30" sha1="e6de8bbd60123444de2a90928853985ceb0b4cbf" offset="0" />
</dataarea> </dataarea>
<dataarea name="sram" size="8192" >
</dataarea>
</part> </part>
</software> </software>
@ -530,6 +536,8 @@ Unless otherwise noted, the information in this list has not been verified by op
<dataarea name="rom" size="131072"> <dataarea name="rom" size="131072">
<rom name="lh531043" size="131072" crc="d8055f5f" sha1="da4b44c734029f60388b7cea4ab97c3d5c6a09e9" offset="0" /> <rom name="lh531043" size="131072" crc="d8055f5f" sha1="da4b44c734029f60388b7cea4ab97c3d5c6a09e9" offset="0" />
</dataarea> </dataarea>
<dataarea name="sram" size="8192" >
</dataarea>
</part> </part>
</software> </software>

File diff suppressed because it is too large Load Diff

View File

@ -98,52 +98,49 @@ DEVICE_IMAGE_LOAD (msx_cart)
/* Load software from software list */ /* Load software from software list */
/* TODO: Add proper SRAM (size) handling */ /* TODO: Add proper SRAM (size) handling */
const char *mapper = software_part_get_feature( (software_part*)image.part_entry(), "mapper" ); const char *mapper = software_part_get_feature((software_part*)image.part_entry(), "mapper");
const char *sram = software_part_get_feature( (software_part*)image.part_entry(), "sram" ); if (mapper != NULL)
if ( mapper != NULL )
{ {
/* TODO: Split out the SRAM recognition code and 8KB/16KB bank configuration */ static const struct { const char *mapper_name; int mapper_type; } mapper_types[] =
static const struct { const char *mapper_name; bool sram_present; int mapper_type; } mapper_types[] =
{ {
{ "M60002-0125SP", false, SLOT_ASCII8 }, { "M60002-0125SP", SLOT_ASCII8 },
{ "M60002-0125SP", true, SLOT_ASCII8_SRAM }, { "LZ93A13", SLOT_ASCII8 },
{ "LZ93A13", false, SLOT_ASCII8 }, { "LZ93A13-16", SLOT_ASCII16 },
{ "LZ93A13", true, SLOT_ASCII8_SRAM }, { "M60002-0125SP-16", SLOT_ASCII16 },
{ "LZ93A13-16", false, SLOT_ASCII16 }, { "IREM TAM-S1", SLOT_RTYPE },
{ "LZ93A13-16", true, SLOT_ASCII16_SRAM }, { "MR6401", SLOT_ASCII16 },
{ "M60002-0125SP-16", false, SLOT_ASCII16 }, { "NEOS MR6401", SLOT_ASCII8 },
{ "M60002-0125SP-16", true, SLOT_ASCII16_SRAM }, { "BS6202", SLOT_ASCII8 },
{ "IREM TAM-S1", false, SLOT_RTYPE }, { "BS6101", SLOT_ASCII8 },
{ "MR6401", false, SLOT_ASCII16 }, { "BS6101-16", SLOT_ASCII16 },
{ "NEOS MR6401", false, SLOT_ASCII8 }, { "KONAMI-SCC", SLOT_KONAMI_SCC },
{ "BS6202", false, SLOT_ASCII8 }, { "KONAMI", SLOT_KONAMI },
{ "BS6101", false, SLOT_ASCII8 }, { "SUPERLODE", SLOT_MAJUTSUSHI },
{ "BS6101-16", false, SLOT_ASCII16 }, { "MAJUTSUSHI", SLOT_SUPERLOADRUNNER },
}; };
for ( int i = 0; i < ARRAY_LENGTH(mapper_types) && type < 0; i++ ) for (int i = 0; i < ARRAY_LENGTH(mapper_types) && type < 0; i++)
{ {
if ( !mame_stricmp( mapper, mapper_types[i].mapper_name ) ) if (!mame_stricmp(mapper, mapper_types[i].mapper_name))
{
if ( sram == NULL && ! mapper_types[i].sram_present )
type = mapper_types[i].mapper_type;
if ( sram != NULL && mapper_types[i].sram_present )
type = mapper_types[i].mapper_type; type = mapper_types[i].mapper_type;
} }
if (-1 == type)
logerror("Mapper '%s' not recognized!\n", mapper);
} }
if ( -1 == type ) UINT8 *tmp_sram = image.get_software_region("sram");
logerror( "Mapper '%s' not recognized!\n", mapper ); if (tmp_sram)
{
if (type == SLOT_ASCII8) type = SLOT_ASCII8_SRAM;
if (type == SLOT_ASCII16) type = SLOT_ASCII16_SRAM;
} }
UINT8 *rom_region = image.get_software_region( "rom" ); UINT8 *rom_region = image.get_software_region("rom");
size = size_aligned = image.get_software_region_length( "rom" ); size = size_aligned = image.get_software_region_length("rom");
mem = auto_alloc_array( image.device().machine(), UINT8, size_aligned ); mem = auto_alloc_array(image.device().machine(), UINT8, size_aligned);
memcpy( mem, rom_region, size_aligned ); memcpy(mem, rom_region, size_aligned);
} }
else else
{ {