(MESS) previous BBC Master commit was over-simplifying the cart

mapping compared to the real thing. This should be more in line 
with the code which will be needed with slots. nw.
This commit is contained in:
Fabio Priuli 2014-04-05 04:25:58 +00:00
parent e75ca754dc
commit bf1199eb2a
2 changed files with 16 additions and 7 deletions

View File

@ -15,9 +15,11 @@
<year>198?</year> <year>198?</year>
<publisher>Acorn</publisher> <publisher>Acorn</publisher>
<part name="cart" interface="bbcm_cart"> <part name="cart" interface="bbcm_cart">
<dataarea name="rom" size="32768"> <dataarea name="uprom" size="16384">
<rom name="bbcmasterdemonstrationcartridge_1.rom" size="16384" crc="fc40c0e8" sha1="970ff4721e707f3c843f4fb09ce7f03e7ab265ae" offset="0" /> <rom name="bbcmasterdemonstrationcartridge_1.rom" size="16384" crc="fc40c0e8" sha1="970ff4721e707f3c843f4fb09ce7f03e7ab265ae" offset="0" />
<rom name="bbcmasterdemonstrationcartridge_2.rom" size="16384" crc="2e73522d" sha1="ff39620d93b18fd36a4718474495211a46ef8184" offset="0x4000" /> </dataarea>
<dataarea name="lorom" size="16384">
<rom name="bbcmasterdemonstrationcartridge_2.rom" size="16384" crc="2e73522d" sha1="ff39620d93b18fd36a4718474495211a46ef8184" offset="0" />
</dataarea> </dataarea>
</part> </part>
</software> </software>

View File

@ -2020,7 +2020,6 @@ DEVICE_IMAGE_LOAD_MEMBER( bbc_state, bbc_exp_rom )
DEVICE_IMAGE_LOAD_MEMBER( bbc_state, bbcm_cart ) DEVICE_IMAGE_LOAD_MEMBER( bbc_state, bbcm_cart )
{ {
UINT8 *RAM = m_region_user1->base(); UINT8 *RAM = m_region_user1->base();
UINT32 size;
int addr = 0, index = 0; int addr = 0, index = 0;
if (strcmp(image.device().tag(),":cart1") == 0) if (strcmp(image.device().tag(),":cart1") == 0)
@ -2031,7 +2030,7 @@ DEVICE_IMAGE_LOAD_MEMBER( bbc_state, bbcm_cart )
if (image.software_entry() == NULL) if (image.software_entry() == NULL)
{ {
size = image.length(); UINT32 size = image.length();
logerror("loading rom %s, size:%.4x\n", image.filename(), size); logerror("loading rom %s, size:%.4x\n", image.filename(), size);
if (size != 0x8000) if (size != 0x8000)
@ -2044,10 +2043,18 @@ DEVICE_IMAGE_LOAD_MEMBER( bbc_state, bbcm_cart )
} }
else else
{ {
size = image.get_software_region_length("rom"); UINT32 size_lo = image.get_software_region_length("lorom");
logerror("loading rom %s, size:%.4x\n", image.filename(), size); UINT32 size_hi = image.get_software_region_length("uprom");
logerror("loading rom %s, size:%.4x\n", image.filename(), size_lo + size_hi);
memcpy(RAM + addr, image.get_software_region("rom"), size); if (size_lo + size_hi != 0x8000)
{
image.seterror(IMAGE_ERROR_UNSUPPORTED, "Invalid rom file size");
return IMAGE_INIT_FAIL;
}
memcpy(RAM + addr + 0, image.get_software_region("uprom"), size_hi);
memcpy(RAM + addr + size_hi, image.get_software_region("lorom"), size_lo);
} }
return IMAGE_INIT_PASS; return IMAGE_INIT_PASS;