src/mess/machine/ti99/genboard.c
| r10778 | r10779 | |
| 40 | 40 | 1 0111 00.. .... .... .... p-box address block 0xxx, 2xxx |
| 41 | 41 | 1 0111 010. .... .... .... p-box address block 4xxx (DSR) |
| 42 | 42 | 1 0111 011. .... .... .... p-box address block 6xxx |
| 43 | | 1 0111 100. .... .... .... p-box address block 8xxx |
| 43 | 1 0111 100. .... .... .... p-box address block 8xxx (Speech at 0x9000) |
| 44 | 44 | 1 0111 101. .... .... .... p-box address block axxx |
| 45 | 45 | 1 0111 11.. .... .... .... p-box address block cxxx, exxx |
| 46 | 46 | |
| r10778 | r10779 | |
| 55 | 55 | |
| 56 | 56 | The TI console (or more precise, the Flex Cable Interface) sets the AMA/B/C |
| 57 | 57 | lines to 1. Most cards actually check for AMA/B/C=1. However, this decoding |
| 58 | | was forgotten in some designs which cause the card memory to be mirrored. The |
| 59 | | usual DSR space at 0x4000-0x5fff which would be reachable via page 0xba is then |
| 60 | | mirrored on a number of other pages: |
| 58 | was forgotten in third party cards which cause the card address space |
| 59 | to be mirrored. The usual DSR space at 4000-5fff which would be reachable |
| 60 | via page 0xba is then mirrored on a number of other pages: |
| 61 | 61 | |
| 62 | 62 | 10 xxx 010x = 82, 8a, 92, 9a, a2, aa, b2, ba |
| 63 | 63 | |
| r10778 | r10779 | |
| 70 | 70 | to detect AMD=0, AME=1. Otherwise these cards, although completely decoding the |
| 71 | 71 | 19-bit address, would reappear at 512 KiB distances. |
| 72 | 72 | |
| 73 | | For the page numbers we get |
| 74 | | |
| 73 | For the page numbers we get: |
| 75 | 74 | Standard: |
| 76 | 75 | 00-3f are internal (DRAM) |
| 77 | 76 | 40-7f are internal expansion, never used |
| r10778 | r10779 | |
| 85 | 84 | c0-ef are the P-Box address space (expect Memex at that location) |
| 86 | 85 | f0-ff are internal (EPROM) |
| 87 | 86 | |
| 87 | Genmod's double switch box is also emulated. There are two switches: |
| 88 | - Turbo mode: Activates or deactivates the wait state logic on the Geneve |
| 89 | board. This switch may be changed at any time. |
| 90 | - TI mode: Selects between the on-board memory, which is obviously required |
| 91 | for the GPL interpreter, and the external Memex memory. This switch |
| 92 | triggers a reset when changed. |
| 93 | |
| 88 | 94 | Michael Zapf, February 2011 |
| 89 | 95 | ***************************************************************************/ |
| 90 | 96 | |
| r10778 | r10779 | |
| 137 | 143 | int zero_wait; |
| 138 | 144 | |
| 139 | 145 | int genmod; |
| 146 | int turbo; |
| 147 | int timode; |
| 140 | 148 | |
| 141 | 149 | /* GROM simulation */ |
| 142 | 150 | int grom_address; |
| r10778 | r10779 | |
| 230 | 238 | } |
| 231 | 239 | } |
| 232 | 240 | |
| 241 | void set_gm_switches(device_t *board, int number, int value) |
| 242 | { |
| 243 | if (number==1) |
| 244 | { |
| 245 | // Turbo switch. May be changed at any time. |
| 246 | logerror("Genmod: Setting turbo flag to %d\n", value); |
| 247 | ((genboard_state*)board)->turbo = value; |
| 248 | } |
| 249 | else |
| 250 | { |
| 251 | // TIMode switch. Causes reset when changed. |
| 252 | logerror("Genmod: Setting timode flag to %d\n", value); |
| 253 | ((genboard_state*)board)->timode = value; |
| 254 | board->machine->schedule_hard_reset(); |
| 255 | } |
| 256 | } |
| 233 | 257 | /**************************************************************************** |
| 234 | 258 | GROM simulation. The Geneve board simulated GROM circuits within its gate |
| 235 | 259 | array. |
| r10778 | r10779 | |
| 424 | 448 | physaddr = 0x1e0000; // points to boot eprom |
| 425 | 449 | } |
| 426 | 450 | else |
| 427 | | { // mf_mapmode=0 (bit 11) |
| 451 | { |
| 428 | 452 | if (!board->geneve_mode && page==3) |
| 429 | 453 | { |
| 430 | 454 | // Cartridge paging in TI mode |
| r10778 | r10779 | |
| 482 | 506 | // Route everything else to the P-Box |
| 483 | 507 | // 0x000000-0x07ffff for the stock Geneve (AMC,AMB,AMA,A0 ...,A15) |
| 484 | 508 | // 0x000000-0x1fffff for the GenMod.(AME,AMD,AMC,AMB,AMA,A0 ...,A15) |
| 485 | | // Add a wait state (if not GenMod) |
| 509 | // Add a wait state |
| 486 | 510 | cpu_adjust_icount(board->cpu, -4); |
| 487 | 511 | physaddr = (physaddr & 0x0007ffff); // 19 bit address (with AMA..AMC) |
| 488 | 512 | ti99_peb_data_rz(board->peribox, physaddr, &value); |
| r10778 | r10779 | |
| 490 | 514 | } |
| 491 | 515 | else |
| 492 | 516 | { |
| 517 | // GenMod mode |
| 518 | if (!board->turbo) |
| 519 | { |
| 520 | cpu_adjust_icount(board->cpu, -4); |
| 521 | } |
| 522 | if ((board->timode) && ((physaddr & 0x180000)==0x000000)) |
| 523 | { |
| 524 | // DRAM. One wait state. |
| 525 | value = board->dram[physaddr & 0x07ffff]; |
| 526 | return value; |
| 527 | } |
| 528 | |
| 493 | 529 | if ((physaddr & 0x1e0000)==0x1e0000) |
| 494 | 530 | { |
| 495 | 531 | // 1 111. ..xx xxxx xxxx xxxx on-board eprom (16K) |
| r10778 | r10779 | |
| 676 | 712 | } |
| 677 | 713 | else |
| 678 | 714 | { |
| 715 | // GenMod mode |
| 716 | if (!board->turbo) |
| 717 | { |
| 718 | cpu_adjust_icount(board->cpu, -4); |
| 719 | } |
| 720 | if ((board->timode) && ((physaddr & 0x180000)==0x000000)) |
| 721 | { |
| 722 | // DRAM. One wait state. |
| 723 | board->dram[physaddr & 0x07ffff] = data; |
| 724 | return; |
| 725 | } |
| 726 | |
| 679 | 727 | if ((physaddr & 0x1e0000)==0x1e0000) |
| 680 | 728 | { |
| 681 | 729 | // 1 111. ..xx xxxx xxxx xxxx on-board eprom (16K) |
| r10778 | r10779 | |
| 1388 | 1436 | fatalerror("GenMod boot rom missing.\n"); |
| 1389 | 1437 | } |
| 1390 | 1438 | board->genmod = TRUE; |
| 1439 | board->turbo = input_port_read(device->machine, "GENMODDIPS") & GM_TURBO; |
| 1440 | board->timode = input_port_read(device->machine, "GENMODDIPS") & GM_TIM; |
| 1391 | 1441 | } |
| 1392 | 1442 | |
| 1393 | 1443 | switch (input_port_read(device->machine, "SRAM")) |
src/mess/drivers/geneve.c
| r10778 | r10779 | |
| 235 | 235 | AM_RANGE(0x0800, 0x0fff) AM_DEVWRITE("geneve_board", geneve_cru_w) |
| 236 | 236 | ADDRESS_MAP_END |
| 237 | 237 | |
| 238 | static INPUT_CHANGED( gm_changed ) |
| 239 | { |
| 240 | device_t *board = field->port->machine->device("geneve_board"); |
| 241 | set_gm_switches(board, (UINT8)((UINT64)param&0x03), newval); |
| 242 | } |
| 243 | |
| 238 | 244 | /* |
| 239 | 245 | Input ports, used by machine code for keyboard and joystick emulation. |
| 240 | 246 | */ |
| r10778 | r10779 | |
| 328 | 334 | PORT_CONFSETTING( 0x00, "128 KiB" ) |
| 329 | 335 | PORT_CONFSETTING( 0x01, "192 KiB" ) |
| 330 | 336 | |
| 337 | PORT_START( "GENMODDIPS" ) |
| 338 | PORT_DIPNAME( GM_TURBO, 0x00, "Genmod Turbo mode") PORT_CONDITION( "MODE", 0x01, PORTCOND_EQUALS, GENMOD ) PORT_CHANGED( gm_changed, (void *)1) |
| 339 | PORT_CONFSETTING( 0x00, DEF_STR( Off )) |
| 340 | PORT_CONFSETTING( GM_TURBO, DEF_STR( On )) |
| 341 | PORT_DIPNAME( GM_TIM, GM_TIM, "Genmod TI mode") PORT_CONDITION( "MODE", 0x01, PORTCOND_EQUALS, GENMOD ) PORT_CHANGED( gm_changed, (void *)2) |
| 342 | PORT_CONFSETTING( 0x00, DEF_STR( Off )) |
| 343 | PORT_CONFSETTING( GM_TIM, DEF_STR( On )) |
| 344 | |
| 331 | 345 | PORT_START( "DRVSPD" ) |
| 332 | 346 | PORT_CONFNAME( 0x01, 0x01, "Floppy and HD speed" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x03 ) |
| 333 | 347 | PORT_CONFSETTING( 0x00, "No delay") |
| r10778 | r10779 | |
| 546 | 560 | /*CPU memory space*/ |
| 547 | 561 | ROM_REGION(0xc000, "maincpu", 0) |
| 548 | 562 | ROM_LOAD("genbt100.bin", 0x0000, 0x4000, CRC(8001e386) SHA1(b44618b54dabac3882543e18555d482b299e0109)) /* CPU ROMs */ |
| 549 | | ROM_LOAD_OPTIONAL("genbt090.bin", 0x4000, 0x4000, CRC(b2e20df9) SHA1(2d5d09177afe97d63ceb3ad59b498b1c9e2153f7)) /* CPU ROMs */ |
| 563 | ROM_LOAD_OPTIONAL("genbt098.bin", 0x4000, 0x4000, CRC(b2e20df9) SHA1(2d5d09177afe97d63ceb3ad59b498b1c9e2153f7)) /* CPU ROMs */ |
| 550 | 564 | ROM_LOAD_OPTIONAL("gnmbt100.bin", 0x8000, 0x4000, CRC(19b89479) SHA1(6ef297eda78dc705946f6494e9d7e95e5216ec47)) /* CPU ROMs */ |
| 551 | 565 | ROM_END |
| 552 | 566 | |