hash/c64_cart.xml
| r11462 | r11463 | |
| 2 | 2 | <!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> |
| 3 | 3 | |
| 4 | 4 | <softwarelist name="c64_cart" description="Commodore 64 Cartridge"> |
| 5 | | <software name="vw64" supported="no"> |
| 5 | <software name="vw64"> |
| 6 | 6 | <description>VizaWrite 64</description> |
| 7 | 7 | <year>1984</year> |
| 8 | 8 | <publisher>Viza Software</publisher> |
| r11462 | r11463 | |
| 12 | 12 | |=| R | |
| 13 | 13 | |=| | |
| 14 | 14 | |=| | |
| 15 | | |=| ROM0 ROM1 ROM2 | |
| 15 | |=| ROM0 ROM2 ROM1 | |
| 16 | 16 | |=| | |
| 17 | 17 | |=| | |
| 18 | 18 | |=| | |
| 19 | 19 | |===========================| |
| 20 | 20 | |
| 21 | 21 | ROM0 - Mitsubishi M5L2764K 8Kx8 EPROM "U" |
| 22 | | ROM1 - Mitsubishi M5L2764K 8Kx8 EPROM "2" (located on solder side) |
| 23 | | ROM2 - Mitsubishi M5L2764K 8Kx8 EPROM "3" |
| 22 | ROM1 - Mitsubishi M5L2764K 8Kx8 EPROM "3" |
| 23 | ROM2 - Mitsubishi M5L2764K 8Kx8 EPROM "2" (located on solder side) |
| 24 | 24 | R - 56K |
| 25 | 25 | C - 47uF |
| 26 | 26 | |
| 27 | 27 | data and address lines are scrambled: |
| 28 | 28 | data = BITSWAP8(7,6,0,5,1,4,2,3) |
| 29 | 29 | address = BITSWAP16(15,14,13,12,7,8,6,9,5,11,4,3,2,10,1,0) |
| 30 | GAME:after reset GND for 1.1844s (74LS122 tW=0.45*R*C) then goes to Vcc |
| 30 | 31 | EXROM:GND |
| 31 | | GAME:after reset GND for 1.1844s (74LS122 tW=0.45*R*C) then goes to Vcc |
| 32 | 32 | --> |
| 33 | 33 | <part name="cart" interface="c64_cart"> |
| 34 | <feature name="cart_type" value="vizawrite" /> |
| 34 | 35 | <feature name="game" value="0" /> |
| 35 | 36 | <feature name="exrom" value="0" /> |
| 36 | 37 | |
| 37 | | <dataarea name="rom" size="0x6000"> |
| 38 | <dataarea name="roml" size="0x4000"> |
| 38 | 39 | <rom name="u" size="0x2000" crc="b0cc7564" sha1="59f7b3a9df26053fdcb720fe07a22f437a7a2241" offset="0x0000" /> |
| 39 | | <rom name="2" size="0x2000" crc="32f2a5df" sha1="5f3e5d416eab59a75ba64131588861991fa571a5" offset="0x2000" /> |
| 40 | | <rom name="3" size="0x2000" crc="ef80b1e7" sha1="80392a04bc9ca2fea006653a507f6f5338a10beb" offset="0x4000" /> |
| 40 | <rom name="3" size="0x2000" crc="ef80b1e7" sha1="80392a04bc9ca2fea006653a507f6f5338a10beb" offset="0x2000" /> |
| 41 | 41 | </dataarea> |
| 42 | |
| 43 | <dataarea name="romh" size="0x2000"> |
| 44 | <rom name="2" size="0x2000" crc="32f2a5df" sha1="5f3e5d416eab59a75ba64131588861991fa571a5" offset="0x0000" /> |
| 45 | </dataarea> |
| 42 | 46 | </part> |
| 43 | 47 | </software> |
| 44 | 48 | |
| r11462 | r11463 | |
| 49 | 53 | <!-- |
| 50 | 54 | --> |
| 51 | 55 | <part name="cart" interface="c64_cart"> |
| 56 | <feature name="cart_type" value="tdos" /> |
| 52 | 57 | <feature name="game" value="1" /> |
| 53 | 58 | <feature name="exrom" value="0" /> |
| 54 | 59 | |
| r11462 | r11463 | |
| 79 | 84 | SP0256 - General Instruments SP0256A-AL2 Speech Synthesizer |
| 80 | 85 | --> |
| 81 | 86 | <part name="cart" interface="c64_cart"> |
| 87 | <feature name="cart_type" value="currah_speech_64" /> |
| 82 | 88 | <feature name="game" value="1" /> |
| 83 | 89 | <feature name="exrom" value="0" /> |
| 84 | 90 | <feature name="vlsi" value="LA05-164" /> |
| r11462 | r11463 | |
| 132 | 138 | <!-- |
| 133 | 139 | --> |
| 134 | 140 | <part name="cart" interface="c64_cart"> |
| 141 | <feature name="cart_type" value="epyx_fast_load" /> |
| 135 | 142 | <feature name="game" value="1" /> |
| 136 | 143 | <feature name="exrom" value="0" /> |
| 137 | 144 | |
| r11462 | r11463 | |
| 164 | 171 | CN1 - connector to C64 video/audio port |
| 165 | 172 | --> |
| 166 | 173 | <part name="cart" interface="c64_cart"> |
| 174 | <feature name="cart_type" value="ps64" /> |
| 167 | 175 | <feature name="game" value="1" /> |
| 168 | 176 | <feature name="exrom" value="0" /> |
| 169 | 177 | <feature name="speech" value="SSI-263AP" /> |
| r11462 | r11463 | |
| 195 | 203 | ROM1 - National Instruments NMC27C256Q 32Kx8 EPROM |
| 196 | 204 | --> |
| 197 | 205 | <part name="cart" interface="c64_cart"> |
| 206 | <feature name="cart_type" value="pagefox" /> |
| 198 | 207 | <feature name="game" value="1" /> |
| 199 | 208 | <feature name="exrom" value="0" /> |
| 200 | 209 | |
| r11462 | r11463 | |
| 214 | 223 | <!-- |
| 215 | 224 | --> |
| 216 | 225 | <part name="cart" interface="c64_cart"> |
| 226 | <feature name="cart_type" value="calc_result_easy" /> |
| 217 | 227 | <feature name="game" value="1" /> |
| 218 | 228 | <feature name="exrom" value="0" /> |
| 219 | 229 | |
| r11462 | r11463 | |
| 221 | 231 | <rom name="calc_rom1.bin" size="0x2000" crc="f617bec4" sha1="c5ef2418cf9dba3e14f586d5d6997f271b521a24" offset="0x0000" /> |
| 222 | 232 | </dataarea> |
| 223 | 233 | |
| 224 | | <dataarea name="rom" size="0x4000"> |
| 234 | <dataarea name="romh" size="0x4000"> |
| 225 | 235 | <rom name="calc_rom2.bin" size="0x4000" crc="4997dd31" sha1="9820b1e6b90d72f095a2b74438dac3cfc33e80b8" offset="0x0000" /> |
| 226 | 236 | </dataarea> |
| 227 | 237 | </part> |
| r11462 | r11463 | |
| 282 | 292 | <!-- |
| 283 | 293 | --> |
| 284 | 294 | <part name="cart" interface="c64_cart"> |
| 295 | <feature name="cart_type" value="game_saver_card" /> |
| 285 | 296 | <feature name="game" value="1" /> |
| 286 | 297 | <feature name="exrom" value="0" /> |
| 287 | 298 | |
| r11462 | r11463 | |
| 326 | 337 | ROM6 - not populated |
| 327 | 338 | --> |
| 328 | 339 | <part name="cart" interface="c64_cart"> |
| 340 | <feature name="cart_type" value="multiscreen" /> |
| 329 | 341 | <feature name="game" value="1" /> |
| 330 | 342 | <feature name="exrom" value="0" /> |
| 331 | 343 | <feature name="battery" value="CR2325" /> |
| r11462 | r11463 | |
| 384 | 396 | GAME:Vcc |
| 385 | 397 | --> |
| 386 | 398 | <part name="cart" interface="c64_cart"> |
| 399 | <feature name="cart_type" value="4040_fast_hack_em" /> |
| 387 | 400 | <feature name="game" value="1" /> |
| 388 | 401 | <feature name="exrom" value="0" /> |
| 389 | 402 | |
| r11462 | r11463 | |
| 421 | 434 | latch is cleared to 0 on computer reset |
| 422 | 435 | --> |
| 423 | 436 | <part name="cart" interface="c64_cart"> |
| 437 | <feature name="cart_type" value="hugo" /> |
| 424 | 438 | <feature name="game" value="0" /> |
| 425 | 439 | <feature name="exrom" value="0" /> |
| 426 | 440 | <feature name="pcb" value="e9048" /> |
src/mess/machine/c64.c
| r11462 | r11463 | |
| 1263 | 1263 | return IMAGE_INIT_PASS; |
| 1264 | 1264 | } |
| 1265 | 1265 | |
| 1266 | | static DEVICE_IMAGE_LOAD( c64_cart ) |
| 1266 | void load_standard_c64_cartridge(device_image_interface &image) |
| 1267 | 1267 | { |
| 1268 | 1268 | c64_state *state = image.device().machine().driver_data<c64_state>(); |
| 1269 | | int result = IMAGE_INIT_PASS; |
| 1269 | UINT32 size; |
| 1270 | 1270 | |
| 1271 | | if (image.software_entry() != NULL) |
| 1271 | // is there anything to load at 0x8000? |
| 1272 | size = image.get_software_region_length("roml"); |
| 1273 | |
| 1274 | if (size) |
| 1272 | 1275 | { |
| 1273 | | UINT32 size; |
| 1274 | | |
| 1275 | | state->m_exrom = atol(image.get_feature("exrom")); |
| 1276 | | state->m_game = atol(image.get_feature("game")); |
| 1276 | memcpy(state->m_roml, image.get_software_region("roml"), MIN(0x2000, size)); |
| 1277 | 1277 | |
| 1278 | | state->m_roml = state->m_c64_roml; |
| 1279 | | state->m_romh = state->m_c64_romh; |
| 1278 | if (size == 0x4000) |
| 1279 | { |
| 1280 | // continue loading to ROMH region |
| 1281 | memcpy(state->m_romh, image.get_software_region("roml") + 0x2000, 0x2000); |
| 1282 | } |
| 1283 | } |
| 1280 | 1284 | |
| 1281 | | memset(state->m_roml, 0, 0x2000); |
| 1282 | | memset(state->m_romh, 0, 0x2000); |
| 1285 | // is there anything to load at 0xa000? |
| 1286 | size = image.get_software_region_length("romh"); |
| 1287 | if (size) |
| 1288 | memcpy(state->m_romh, image.get_software_region("romh"), size); |
| 1289 | } |
| 1283 | 1290 | |
| 1284 | | // is there anything to load at 0x8000? |
| 1285 | | size = image.get_software_region_length("roml"); |
| 1291 | TIMER_CALLBACK( vizawrite_timer ) |
| 1292 | { |
| 1293 | c64_state *state = machine.driver_data<c64_state>(); |
| 1294 | UINT8 *decrypted = machine.region("user1")->base(); |
| 1286 | 1295 | |
| 1287 | | if (size) |
| 1288 | | { |
| 1289 | | memcpy(state->m_roml, image.get_software_region("roml"), MIN(0x2000, size)); |
| 1290 | | |
| 1291 | | if (size == 0x4000) |
| 1292 | | { |
| 1293 | | // continue loading to ROMH region |
| 1294 | | memcpy(state->m_romh, image.get_software_region("roml") + 0x2000, 0x2000); |
| 1295 | | } |
| 1296 | | } |
| 1296 | // map cartridge ROMs |
| 1297 | memcpy(state->m_roml, decrypted + 0x2000, 0x2000); |
| 1298 | memset(state->m_romh, 0, 0x2000); |
| 1297 | 1299 | |
| 1298 | | // is there anything to load at 0xa000? |
| 1299 | | size = image.get_software_region_length("romh"); |
| 1300 | | if (size) |
| 1301 | | memcpy(state->m_romh, image.get_software_region("romh"), size); |
| 1300 | // set GAME line |
| 1301 | state->m_game = 1; |
| 1302 | c64_bankswitch(machine, 0); |
| 1303 | } |
| 1304 | |
| 1305 | void load_vizawrite_cartridge(device_image_interface &image) |
| 1306 | { |
| 1307 | #define DECRYPT_ADDRESS(_offset) \ |
| 1308 | BITSWAP16(_offset,15,14,13,12,7,8,6,9,5,11,4,3,2,10,1,0) |
| 1309 | |
| 1310 | #define DECRYPT_DATA(_data) \ |
| 1311 | BITSWAP8(_data,7,6,0,5,1,4,2,3) |
| 1312 | |
| 1313 | c64_state *state = image.device().machine().driver_data<c64_state>(); |
| 1314 | |
| 1315 | UINT8 *roml = image.get_software_region("roml"); |
| 1316 | UINT8 *romh = image.get_software_region("romh"); |
| 1317 | UINT8 *decrypted = image.device().machine().region("user1")->base(); |
| 1318 | |
| 1319 | // decrypt ROMs |
| 1320 | for (offs_t offset = 0; offset < 0x2000; offset++) |
| 1321 | { |
| 1322 | offs_t address = DECRYPT_ADDRESS(offset); |
| 1323 | decrypted[address] = DECRYPT_DATA(roml[offset]); |
| 1324 | decrypted[address + 0x2000] = DECRYPT_DATA(roml[offset + 0x2000]); |
| 1325 | decrypted[address + 0x4000] = DECRYPT_DATA(romh[offset]); |
| 1302 | 1326 | } |
| 1327 | |
| 1328 | // map cartridge ROMs |
| 1329 | memcpy(state->m_roml, decrypted, 0x2000); |
| 1330 | memcpy(state->m_romh, decrypted + 0x4000, 0x2000); |
| 1331 | |
| 1332 | // allocate GAME changing timer |
| 1333 | state->m_cartridge_timer = image.device().machine().scheduler().timer_alloc(FUNC(vizawrite_timer)); |
| 1334 | state->m_cartridge_timer->adjust(attotime::from_msec(1184), 0); |
| 1335 | } |
| 1336 | |
| 1337 | void c64_software_list_cartridge_load(device_image_interface &image) |
| 1338 | { |
| 1339 | c64_state *state = image.device().machine().driver_data<c64_state>(); |
| 1340 | |
| 1341 | // initialize ROML and ROMH pointers |
| 1342 | state->m_roml = state->m_c64_roml; |
| 1343 | state->m_romh = state->m_c64_romh; |
| 1344 | |
| 1345 | // clear ROML and ROMH areas |
| 1346 | memset(state->m_roml, 0, 0x2000); |
| 1347 | memset(state->m_romh, 0, 0x2000); |
| 1348 | |
| 1349 | // set GAME and EXROM |
| 1350 | state->m_game = atol(image.get_feature("game")); |
| 1351 | state->m_exrom = atol(image.get_feature("exrom")); |
| 1352 | |
| 1353 | // determine cartridge type |
| 1354 | const char *cart_type = image.get_feature("cart_type"); |
| 1355 | |
| 1356 | if (cart_type == NULL) |
| 1357 | { |
| 1358 | load_standard_c64_cartridge(image); |
| 1359 | } |
| 1303 | 1360 | else |
| 1361 | { |
| 1362 | if (!strcmp(cart_type, "vizawrite")) |
| 1363 | load_vizawrite_cartridge(image); |
| 1364 | } |
| 1365 | } |
| 1366 | |
| 1367 | static DEVICE_IMAGE_LOAD( c64_cart ) |
| 1368 | { |
| 1369 | c64_state *state = image.device().machine().driver_data<c64_state>(); |
| 1370 | int result = IMAGE_INIT_PASS; |
| 1371 | |
| 1372 | if (image.software_entry() != NULL) |
| 1373 | { |
| 1374 | c64_software_list_cartridge_load(image); |
| 1375 | } |
| 1376 | else |
| 1304 | 1377 | result = c64_crt_load(image); |
| 1305 | 1378 | |
| 1306 | 1379 | return result; |