src/mess/drivers/bbcbc.c
| r6939 | r6940 | |
| 118 | 118 | { NULL } |
| 119 | 119 | }; |
| 120 | 120 | |
| 121 | |
| 122 | static DEVICE_START( bbcbc_cart ) |
| 123 | { |
| 124 | UINT8 *cart = memory_region(device->machine, "maincpu" ) + 0x4000; |
| 125 | |
| 126 | memset( cart, 0xFF, 0x8000 ); |
| 127 | } |
| 128 | |
| 129 | |
| 130 | static 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 | |
| 121 | 154 | static MACHINE_START( bbcbc ) |
| 122 | 155 | { |
| 123 | 156 | TMS9928A_configure(&tms9129_interface); |
| r6939 | r6940 | |
| 145 | 178 | MDRV_SCREEN_REFRESH_RATE( 50 ) |
| 146 | 179 | |
| 147 | 180 | 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 ) |
| 148 | 185 | MACHINE_DRIVER_END |
| 149 | 186 | |
| 150 | 187 | |
| r6939 | r6940 | |
| 152 | 189 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 153 | 190 | ROM_LOAD("br_4_1.ic3", 0x0000, 0x2000, CRC(7c880d75) SHA1(954db096bd9e8edfef72946637a12f1083841fb0)) |
| 154 | 191 | ROM_LOAD("br_4_2.ic4", 0x2000, 0x2000, CRC(16a33aef) SHA1(9529f9f792718a3715af2063b91a5fb18f741226)) |
| 155 | | ROM_CART_LOAD("cart", 0x4000, 0xBFFF, ROM_NOMIRROR | ROM_OPTIONAL) |
| 156 | 192 | ROM_END |
| 157 | 193 | |
| 158 | 194 | /*************************************************************************** |