src/mess/machine/ti99/genboard.c
| r10262 | r10263 | |
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | Geneve 9640 system board |
| 3 | 3 | |
| 4 | | Michael Zapf, October 2010 |
| 4 | Onboard SRAM configuration: |
| 5 | There is an adjustable SRAM configuration on board, representing the |
| 6 | various enhancements by users. |
| 7 | |
| 8 | The standard memory configuration as reported by chkdsk (32 KiB): |
| 9 | 557056 bytes of total memory |
| 10 | |
| 11 | With 64 KiB SRAM: |
| 12 | 589824 bytes of total memory |
| 13 | |
| 14 | With 384 KiB SRAM: |
| 15 | 917504 bytes of total memory |
| 16 | |
| 17 | The original 32 KiB SRAM memory needs to be expanded to 64 KiB for |
| 18 | MDOS 2.50s and higher, or the system will lock up. Therefore the emulation |
| 19 | default is 64 KiB. |
| 20 | |
| 21 | The ultimate expansion is a 512 KiB SRAM circuit wired to the gate array |
| 22 | to provide 48 pages of fast static RAM. This also requires to build an |
| 23 | adapter for a larger socket. From the 512 KiB, only 384 KiB will be |
| 24 | accessed, since the higher pages are hidden behind the EPROM pages. |
| 25 | |
| 26 | Michael Zapf, February 2011 |
| 5 | 27 | ***************************************************************************/ |
| 6 | 28 | |
| 7 | 29 | #include "emu.h" |
| r10262 | r10263 | |
| 17 | 39 | #define KEYAUTOREPEATDELAY 30 |
| 18 | 40 | #define KEYAUTOREPEATRATE 6 |
| 19 | 41 | |
| 20 | | #define SRAM_SIZE 64*1024 |
| 42 | #define SRAM_SIZE 384*1024 // maximum expansion on-board |
| 21 | 43 | #define DRAM_SIZE 512*1024 |
| 22 | 44 | |
| 23 | 45 | typedef struct _genboard_state |
| r10262 | r10263 | |
| 61 | 83 | UINT8 *sram; |
| 62 | 84 | UINT8 *dram; |
| 63 | 85 | UINT8 *eprom; |
| 86 | int sram_mask, sram_val; |
| 64 | 87 | |
| 65 | 88 | /* Mapper */ |
| 66 | 89 | int geneve_mode; |
| r10262 | r10263 | |
| 362 | 385 | ti99_peb_data_rz(board->peribox, physaddr, &value); |
| 363 | 386 | return value; |
| 364 | 387 | } |
| 365 | | if ((physaddr & 0x1f0000)==0x1d0000) |
| 366 | | { |
| 367 | | // 1 1101 xxxx xxxx xxxx xxxx on-board sram (64K) |
| 368 | | value = board->sram[physaddr & 0x00ffff]; |
| 369 | | return value; |
| 370 | | } |
| 388 | |
| 371 | 389 | if ((physaddr & 0x1e0000)==0x1e0000) |
| 372 | 390 | { |
| 373 | 391 | // 1 111. ..xx xxxx xxxx xxxx on-board eprom (16K) |
| r10262 | r10263 | |
| 376 | 394 | return value; |
| 377 | 395 | } |
| 378 | 396 | |
| 397 | if ((physaddr & board->sram_mask)==board->sram_val) |
| 398 | { |
| 399 | // 1 100. .... .... .... .... on-board sram (128K) -+ |
| 400 | // 1 101. .... .... .... .... on-board sram (128K) -+-- maximum SRAM expansion |
| 401 | // 1 1100 .... .... .... .... on-board sram (64K) --+ |
| 402 | // 1 1101 0... .... .... .... on-board sram (32K) - additional 32 KiB required for MDOS 2.50s and higher |
| 403 | // 1 1101 1... .... .... .... on-board sram (32K) - standard setup |
| 404 | // NOTE: This must be tested after the EPROM test above |
| 405 | value = board->sram[physaddr & 0x00ffff]; |
| 406 | return value; |
| 407 | } |
| 408 | |
| 379 | 409 | return 0; |
| 380 | 410 | } |
| 381 | 411 | /* |
| r10262 | r10263 | |
| 542 | 572 | ti99_peb_data_w(board->peribox, physaddr, data); |
| 543 | 573 | return; |
| 544 | 574 | } |
| 545 | | if ((physaddr & 0x1f0000)==0x1d0000) |
| 575 | |
| 576 | if ((physaddr & 0x1e0000)==0x1e0000) |
| 546 | 577 | { |
| 547 | | // SRAM write |
| 578 | // 1 111. ..xx xxxx xxxx xxxx on-board eprom (16K) |
| 579 | // mirrored for f0, f2, f4, ...; f1, f3, f5, ... |
| 580 | // Ignore EPROM write |
| 581 | return; |
| 582 | } |
| 583 | |
| 584 | if ((physaddr & board->sram_mask)==board->sram_val) |
| 585 | { |
| 586 | // 1 100. .... .... .... .... on-board sram (128K) -+ |
| 587 | // 1 101. .... .... .... .... on-board sram (128K) -+-- maximum SRAM expansion |
| 588 | // 1 1100 .... .... .... .... on-board sram (64K) --+ |
| 589 | // 1 1101 0... .... .... .... on-board sram (32K) - additional 32 KiB required for MDOS 2.50s and higher |
| 590 | // 1 1101 1... .... .... .... on-board sram (32K) - standard setup |
| 591 | // NOTE: This must be tested after the EPROM test above |
| 548 | 592 | board->sram[physaddr & 0x00ffff] = data; |
| 549 | 593 | return; |
| 550 | 594 | } |
| 551 | | // Ignore EPROM write |
| 552 | 595 | } |
| 553 | 596 | |
| 554 | 597 | /* |
| r10262 | r10263 | |
| 584 | 627 | 1 0111 101. .... .... .... p-box address block axxx |
| 585 | 628 | 1 0111 11.. .... .... .... p-box address block cxxx, exxx |
| 586 | 629 | |
| 587 | | 1 1101 .... .... .... .... on-board sram (64K) |
| 630 | 1 100. .... .... .... .... on-board sram (128K) -+ |
| 631 | 1 101. .... .... .... .... on-board sram (128K) -+-- maximum SRAM expansion |
| 632 | 1 1100 .... .... .... .... on-board sram (64K) --+ |
| 633 | 1 1101 0... .... .... .... on-board sram (32K) - additional 32 KiB required for MDOS 2.50s and higher |
| 634 | 1 1101 1... .... .... .... on-board sram (32K) - standard setup |
| 635 | |
| 588 | 636 | 1 111. ..0. .... .... .... on-board boot1 |
| 589 | 637 | 1 111. ..1. .... .... .... on-board boot2 |
| 590 | 638 | |
| r10262 | r10263 | |
| 1250 | 1298 | { |
| 1251 | 1299 | board->eprom = device->machine->region("maincpu")->base() + 0x4000; |
| 1252 | 1300 | } |
| 1301 | |
| 1302 | switch (input_port_read(device->machine, "SRAM")) |
| 1303 | { |
| 1304 | /* 1 100. .... .... .... .... on-board sram (128K) -+ |
| 1305 | 1 101. .... .... .... .... on-board sram (128K) -+-- maximum SRAM expansion |
| 1306 | 1 1100 .... .... .... .... on-board sram (64K) --+ |
| 1307 | 1 1101 0... .... .... .... on-board sram (32K) - additional 32 KiB required for MDOS 2.50s and higher |
| 1308 | 1 1101 1... .... .... .... on-board sram (32K) - standard setup |
| 1309 | */ |
| 1310 | case 0: // 32 KiB |
| 1311 | board->sram_mask = 0x1f8000; |
| 1312 | board->sram_val = 0x1d8000; |
| 1313 | break; |
| 1314 | case 1: // 64 KiB |
| 1315 | board->sram_mask = 0x1f0000; |
| 1316 | board->sram_val = 0x1d0000; |
| 1317 | break; |
| 1318 | case 2: // 384 KiB (actually 512 KiB, but the EPROM masks the upper 128 KiB) |
| 1319 | board->sram_mask = 0x180000; |
| 1320 | board->sram_val = 0x180000; |
| 1321 | break; |
| 1322 | } |
| 1253 | 1323 | } |
| 1254 | 1324 | |
| 1255 | 1325 | static const char DEVTEMPLATE_SOURCE[] = __FILE__; |
src/mess/drivers/geneve.c
| r10262 | r10263 | |
| 251 | 251 | PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) |
| 252 | 252 | PORT_CONFSETTING( 0x01, DEF_STR( On ) ) |
| 253 | 253 | |
| 254 | PORT_START( "SRAM" ) |
| 255 | PORT_CONFNAME( 0x03, 0x01, "Onboard SRAM" ) |
| 256 | PORT_CONFSETTING( 0x00, "32 KiB" ) |
| 257 | PORT_CONFSETTING( 0x01, "64 KiB" ) |
| 258 | PORT_CONFSETTING( 0x02, "384 KiB" ) |
| 259 | |
| 254 | 260 | PORT_START( "DISKCTRL" ) |
| 255 | 261 | PORT_CONFNAME( 0x07, 0x03, "Disk controller" ) |
| 256 | 262 | PORT_CONFSETTING( 0x00, DEF_STR( None ) ) |
| r10262 | r10263 | |
| 279 | 285 | PORT_DIPSETTING( 0xaa, "40 track, 8 ms") |
| 280 | 286 | PORT_DIPSETTING( 0x55, "80 track, 2 ms") |
| 281 | 287 | PORT_DIPSETTING( 0xff, "80 track HD, 2 ms") |
| 282 | | |
| 288 | |
| 283 | 289 | PORT_START( "V9938-MEM" ) |
| 284 | 290 | PORT_CONFNAME( 0x01, 0x00, "V9938 RAM size" ) |
| 285 | 291 | PORT_CONFSETTING( 0x00, "128 KiB" ) |
| 286 | | PORT_CONFSETTING( 0x01, "192 KiB" ) |
| 292 | PORT_CONFSETTING( 0x01, "192 KiB" ) |
| 287 | 293 | |
| 288 | 294 | PORT_START( "DRVSPD" ) |
| 289 | 295 | PORT_CONFNAME( 0x01, 0x01, "Floppy and HD speed" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x03 ) |