Previous 15994 Revisions Next

r6940 Tuesday 5th January, 2010 at 18:28:02 UTC by Wilbert Pol
[BBCBC] Added code to support software loaded from a software list.
[src/mess/drivers]bbcbc.c

src/mess/drivers/bbcbc.c
r6939r6940
118118   { NULL }
119119};
120120
121
122static DEVICE_START( bbcbc_cart )
123{
124   UINT8 *cart = memory_region(device->machine,  "maincpu" ) + 0x4000;
125
126   memset( cart, 0xFF, 0x8000 );
127}
128
129
130static DEVICE_IMAGE_LOAD( bbcbc_cart )
131{
132   UINT8 *cart = memory_region(image->machine,  "maincpu" ) + 0x4000;
133
134   if ( image_software_entry(image) == NULL )
135   {
136      int size = image_length( image );
137      if ( image_fread( image, cart, size ) != size ) {
138         image_seterror( image, IMAGE_ERROR_UNSPECIFIED, "Unable to fully read from file" );
139         return INIT_FAIL;
140      }
141   }
142   else
143   {
144      UINT8 *reg = image_get_software_region( image, CARTRIDGE_REGION_ROM );
145      int reg_len = image_get_software_region_length( image, CARTRIDGE_REGION_ROM );
146
147      memcpy( cart, reg, MIN(reg_len, 0x8000) );
148   }
149
150   return INIT_PASS;
151
152}
153
121154static MACHINE_START( bbcbc )
122155{
123156   TMS9928A_configure(&tms9129_interface);
r6939r6940
145178   MDRV_SCREEN_REFRESH_RATE( 50 )
146179
147180   MDRV_CARTSLOT_ADD("cart")
181   MDRV_CARTSLOT_NOT_MANDATORY
182   MDRV_CARTSLOT_START( bbcbc_cart )
183   MDRV_CARTSLOT_LOAD( bbcbc_cart )
184   MDRV_CARTSLOT_SOFTWARE_LIST( bbcbc_cart )
148185MACHINE_DRIVER_END
149186
150187
r6939r6940
152189   ROM_REGION( 0x10000, "maincpu", 0 )
153190   ROM_LOAD("br_4_1.ic3", 0x0000, 0x2000, CRC(7c880d75) SHA1(954db096bd9e8edfef72946637a12f1083841fb0))
154191   ROM_LOAD("br_4_2.ic4", 0x2000, 0x2000, CRC(16a33aef) SHA1(9529f9f792718a3715af2063b91a5fb18f741226))
155   ROM_CART_LOAD("cart", 0x4000, 0xBFFF, ROM_NOMIRROR | ROM_OPTIONAL)
156192ROM_END
157193
158194/***************************************************************************

Previous 15994 Revisions Next


© 1998-2018 The MESS Team