src/mess/drivers/a2600.c
| r804 | r805 | |
| 75 | 75 | static unsigned number_banks; |
| 76 | 76 | static unsigned current_bank; |
| 77 | 77 | static unsigned current_32in1_bank; |
| 78 | static unsigned current_JVP_bank; |
| 78 | 79 | static unsigned mode3E_ram_enabled; |
| 79 | 80 | static UINT8 modeSS_byte; |
| 80 | 81 | static UINT32 modeSS_byte_started; |
| r804 | r805 | |
| 338 | 339 | return 0; |
| 339 | 340 | } |
| 340 | 341 | |
| 342 | static int detect_modeJVP(void) |
| 343 | { |
| 344 | int i,j,numfound = 0; |
| 345 | unsigned char signatures[][4] = { |
| 346 | { 0x2c, 0xc0, 0xef, 0x60 }, |
| 347 | { 0x8d, 0xa0, 0x0f, 0xf0 }}; |
| 348 | if (cart_size == 0x4000 || cart_size == 0x2000) |
| 349 | { |
| 350 | for (i = 0; i < cart_size - (sizeof signatures/sizeof signatures[0]); i++) |
| 351 | { |
| 352 | for (j = 0; j < (sizeof signatures/sizeof signatures[0]) && !numfound; j++) |
| 353 | { |
| 354 | if (!memcmp(&CART[i], &signatures[j],sizeof signatures[0])) |
| 355 | { |
| 356 | numfound = 1; |
| 357 | } |
| 358 | } |
| 359 | } |
| 360 | } |
| 361 | if (numfound) return 1; |
| 362 | return 0; |
| 363 | } |
| 341 | 364 | |
| 342 | 365 | static int detect_modeMN(void) |
| 343 | 366 | { |
| r804 | r805 | |
| 1306 | 1329 | r6532_reset(0); |
| 1307 | 1330 | memset( riot_ram, 0x00, 0x80 ); |
| 1308 | 1331 | current_32in1_bank = 0x1F; |
| 1332 | current_JVP_bank = 1; |
| 1309 | 1333 | } |
| 1310 | 1334 | |
| 1311 | 1335 | static MACHINE_START( a2600p ) |
| r804 | r805 | |
| 1318 | 1342 | r6532_reset(0); |
| 1319 | 1343 | memset( riot_ram, 0x00, 0x80 ); |
| 1320 | 1344 | current_32in1_bank = 0x1F; |
| 1345 | current_JVP_bank = 1; |
| 1321 | 1346 | } |
| 1322 | 1347 | |
| 1323 | 1348 | static MACHINE_RESET( a2600 ) |
| r804 | r805 | |
| 1345 | 1370 | if (mode == 0xff) if (detect_modePB()) mode = modePB; |
| 1346 | 1371 | if (mode == 0xff) if (detect_modeCV()) mode = modeCV; |
| 1347 | 1372 | if (mode == 0xff) if (detect_modeFV()) mode = modeFV; |
| 1373 | if (mode == 0xff) if (detect_modeJVP()) mode = modeJVP; |
| 1348 | 1374 | if (mode == 0xff) if (detect_modeUA()) mode = modeUA; |
| 1349 | 1375 | if (mode == 0xff) if (detect_8K_modeTV()) mode = modeTV; |
| 1350 | 1376 | if (mode == 0xff) if (detect_32K_modeTV()) mode = modeTV; |
| r804 | r805 | |
| 1485 | 1511 | break; |
| 1486 | 1512 | |
| 1487 | 1513 | case modeJVP: |
| 1488 | | install_banks(1, 0x0000); |
| 1514 | install_banks(2, 0x0000); |
| 1515 | current_JVP_bank = ( current_JVP_bank + 1 ) & 1; |
| 1489 | 1516 | current_bank = 0; |
| 1490 | 1517 | break; |
| 1491 | 1518 | } |
| r804 | r805 | |
| 1603 | 1630 | break; |
| 1604 | 1631 | |
| 1605 | 1632 | case modeJVP: |
| 1606 | | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0FA0, 0x0FFF, 0, 0, modeJVP_switch_r); |
| 1607 | | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0FA0, 0x0FFF, 0, 0, modeJVP_switch_w); |
| 1633 | memory_set_bankptr( 1, CART + current_JVP_bank * 0x2000 ); |
| 1634 | memory_set_bankptr( 2, CART + current_JVP_bank * 0x2000 ); |
| 1635 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0FA0, 0x0FC0, 0, 0, modeJVP_switch_r); |
| 1636 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0FA0, 0x0FC0, 0, 0, modeJVP_switch_w); |
| 1608 | 1637 | break; |
| 1609 | 1638 | } |
| 1610 | 1639 | |