Previous 199869 Revisions Next

r29288 Saturday 5th April, 2014 at 04:25:58 UTC by Fabio Priuli
(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.
[hash]bbcm_cart.xml
[src/mess/machine]bbc.c

trunk/hash/bbcm_cart.xml
r29287r29288
1515      <year>198?</year>
1616      <publisher>Acorn</publisher>
1717      <part name="cart" interface="bbcm_cart">
18         <dataarea name="rom" size="32768">
18         <dataarea name="uprom" size="16384">
1919            <rom name="bbcmasterdemonstrationcartridge_1.rom" size="16384" crc="fc40c0e8" sha1="970ff4721e707f3c843f4fb09ce7f03e7ab265ae" offset="0" />
20            <rom name="bbcmasterdemonstrationcartridge_2.rom" size="16384" crc="2e73522d" sha1="ff39620d93b18fd36a4718474495211a46ef8184" offset="0x4000" />
2120         </dataarea>
21         <dataarea name="lorom" size="16384">
22            <rom name="bbcmasterdemonstrationcartridge_2.rom" size="16384" crc="2e73522d" sha1="ff39620d93b18fd36a4718474495211a46ef8184" offset="0" />
23         </dataarea>
2224      </part>
2325   </software>
2426
trunk/src/mess/machine/bbc.c
r29287r29288
20202020DEVICE_IMAGE_LOAD_MEMBER( bbc_state, bbcm_cart )
20212021{
20222022   UINT8 *RAM = m_region_user1->base();
2023   UINT32 size;
20242023   int addr = 0, index = 0;
20252024
20262025   if (strcmp(image.device().tag(),":cart1") == 0)
r29287r29288
20312030
20322031   if (image.software_entry() == NULL)
20332032   {
2034      size = image.length();
2033      UINT32 size = image.length();
20352034      logerror("loading rom %s, size:%.4x\n", image.filename(), size);
20362035
20372036      if (size != 0x8000)
r29287r29288
20442043   }
20452044   else
20462045   {
2047      size = image.get_software_region_length("rom");
2048      logerror("loading rom %s, size:%.4x\n", image.filename(), size);
2046      UINT32 size_lo = image.get_software_region_length("lorom");
2047      UINT32 size_hi = image.get_software_region_length("uprom");
2048      logerror("loading rom %s, size:%.4x\n", image.filename(), size_lo + size_hi);
20492049
2050      memcpy(RAM + addr, image.get_software_region("rom"), size);
2050      if (size_lo + size_hi != 0x8000)
2051      {
2052         image.seterror(IMAGE_ERROR_UNSUPPORTED, "Invalid rom file size");
2053         return IMAGE_INIT_FAIL;
2054      }
2055
2056      memcpy(RAM + addr + 0,       image.get_software_region("uprom"), size_hi);
2057      memcpy(RAM + addr + size_hi, image.get_software_region("lorom"), size_lo);
20512058   }
20522059
20532060   return IMAGE_INIT_PASS;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team