src/mess/machine/ti99/mapper8.c
| r9542 | r9543 | |
| 174 | 174 | mapper->logcomp[index].write_select = write_sel; |
| 175 | 175 | mapper->logcomp[index].read_byte = read; |
| 176 | 176 | mapper->logcomp[index].write_byte = write; |
| 177 | | // printf("registering the device at logical position %d, device %lx\n", index, busdevice); |
| 177 | logerror("ti99_8: registering a device at logical position %d\n", index); |
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | else |
| r9542 | r9543 | |
| 197 | 197 | mapper->physcomp[index].select = address_bits; |
| 198 | 198 | mapper->physcomp[index].read_byte = read; |
| 199 | 199 | mapper->physcomp[index].write_byte = write; |
| 200 | | // printf("registering the device at physical position %d, device %lx\n", index, busdevice); |
| 200 | logerror("ti99_8: registering a device at physical position %d\n", index); |
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | 203 | else |
| r9542 | r9543 | |
| 214 | 214 | { |
| 215 | 215 | mapper8_state *mapper = get_safe_token(device); |
| 216 | 216 | int found = FALSE; |
| 217 | | // printf("ti99_8: read access %04x ... ", offset); |
| 218 | 217 | // Look for components responding to the logical address |
| 219 | 218 | for (int i=0; i < MAXLOGDEV; i++) |
| 220 | 219 | { |
| r9542 | r9543 | |
| 229 | 228 | if (adev->device == MAP8_SRAM) |
| 230 | 229 | { |
| 231 | 230 | *value = mapper->sram[offset & ~adev->address_mask]; |
| 232 | | // printf("sram"); |
| 233 | 231 | found = TRUE; |
| 234 | 232 | } |
| 235 | 233 | else |
| r9542 | r9543 | |
| 238 | 236 | { |
| 239 | 237 | // Starts at 0000 |
| 240 | 238 | *value = mapper->rom[offset & ~adev->address_mask]; |
| 241 | | // printf("rom0"); |
| 242 | 239 | found = TRUE; |
| 243 | 240 | } |
| 244 | 241 | else |
| r9542 | r9543 | |
| 246 | 243 | // device |
| 247 | 244 | if (adev->read_byte != NULL) |
| 248 | 245 | { |
| 249 | | // printf("device "); |
| 250 | 246 | adev->read_byte(adev->device, offset, value); |
| 251 | 247 | found = TRUE; |
| 252 | 248 | } |
| r9542 | r9543 | |
| 265 | 261 | mapper8_state *mapper = get_safe_token(device); |
| 266 | 262 | int found = FALSE; |
| 267 | 263 | |
| 268 | | // printf("ti99_8: write access %04x ... ", offset); |
| 269 | 264 | for (int i=0; i < MAXLOGDEV; i++) |
| 270 | 265 | { |
| 271 | 266 | log_addressed_device *adev = &mapper->logcomp[i]; |
| r9542 | r9543 | |
| 279 | 274 | if (adev->device == MAP8_SRAM) |
| 280 | 275 | { |
| 281 | 276 | mapper->sram[offset & ~adev->address_mask] = data; |
| 282 | | // printf("sram"); |
| 283 | 277 | found = TRUE; |
| 284 | 278 | } |
| 285 | 279 | else |
| 286 | 280 | { |
| 287 | 281 | if (adev->device == MAP8_ROM0) |
| 288 | 282 | { |
| 289 | | // printf("rom0 (ignored)"); |
| 290 | 283 | found = TRUE; |
| 291 | 284 | } |
| 292 | 285 | else |
| 293 | 286 | { |
| 294 | 287 | if (adev->write_byte != NULL) |
| 295 | 288 | { |
| 296 | | // printf("device "); |
| 297 | 289 | adev->write_byte(adev->device, offset, data); |
| 298 | 290 | found = TRUE; |
| 299 | 291 | } |
| r9542 | r9543 | |
| 323 | 315 | |
| 324 | 316 | if (!found) |
| 325 | 317 | { |
| 326 | | // printf(" not logical ..."); |
| 327 | 318 | // In that case, the address decoder could not find a suitable device. |
| 328 | 319 | // This means the logical address is transformed by the mapper. |
| 329 | 320 | UINT32 pas_address = mapper->pas_offset[(offset & 0xf000)>>12] + (offset & 0xfff); |
| 330 | | // printf("%08x ", pas_address); |
| 331 | 321 | |
| 332 | 322 | // So now let's do the same as above with physical addresses |
| 333 | 323 | for (int i=0; i < MAXPHYSDEV; i++) |
| r9542 | r9543 | |
| 340 | 330 | if (adev->device == MAP8_DRAM) |
| 341 | 331 | { |
| 342 | 332 | value = mapper->dram[pas_address & ~adev->address_mask]; |
| 343 | | found = TRUE; |
| 344 | | // printf("dram"); |
| 345 | 333 | } |
| 346 | 334 | else |
| 347 | 335 | { |
| r9542 | r9543 | |
| 349 | 337 | { |
| 350 | 338 | // Starts at 2000 in the image, 8K |
| 351 | 339 | value = mapper->rom[0x2000 + (pas_address & 0x1fff)]; |
| 352 | | found = TRUE; |
| 353 | | // printf("rom1"); |
| 354 | 340 | } |
| 355 | 341 | else |
| 356 | 342 | { |
| r9542 | r9543 | |
| 358 | 344 | { |
| 359 | 345 | // Starts at 6000 in the image, 8K |
| 360 | 346 | value = mapper->rom[0x6000 + (pas_address & 0x1fff)]; |
| 361 | | found = TRUE; |
| 362 | | // printf("rom1a"); |
| 363 | 347 | } |
| 364 | 348 | else |
| 365 | 349 | { |
| 366 | 350 | if (adev->device == MAP8_INTS) |
| 367 | 351 | { |
| 368 | 352 | // Interrupt sense |
| 369 | | // printf("ti99_8: ILSENSE not implemented.\n"); |
| 370 | | // printf("sense"); |
| 371 | | found = TRUE; |
| 353 | logerror("ti99_8: ILSENSE not implemented.\n"); |
| 372 | 354 | } |
| 373 | 355 | else |
| 374 | 356 | { |
| 375 | | // only one option left: cartridge port (aka grom port) |
| 357 | // devices |
| 376 | 358 | if (adev->read_byte != NULL) |
| 377 | 359 | { |
| 378 | | // printf("pdevice "); |
| 379 | 360 | adev->read_byte(adev->device, pas_address, &value); |
| 380 | | found = TRUE; |
| 381 | 361 | } |
| 382 | 362 | } |
| 383 | 363 | } |
| 384 | 364 | } |
| 385 | 365 | } |
| 366 | if (adev->stop) break; |
| 386 | 367 | } |
| 387 | 368 | } |
| 388 | | if (found && adev->stop) break; |
| 389 | 369 | } |
| 390 | | |
| 391 | | if (!found) |
| 392 | | { |
| 393 | | // Still not found? Then we route the physical address to the I/O port |
| 394 | | // which has the peribox attached |
| 395 | | // printf("not mapped ... ioport"); |
| 396 | | if (mapper->ioport!=NULL) |
| 397 | | ti99_peb_data_rz(mapper->ioport, pas_address, &value); |
| 398 | | // printf("ti99_8: io read %04x = %02x\n", offset, value); |
| 399 | | } |
| 400 | 370 | } |
| 401 | | // printf(" %02x\n", value); |
| 402 | 371 | |
| 403 | 372 | return value; |
| 404 | 373 | } |
| r9542 | r9543 | |
| 412 | 381 | int found = FALSE; |
| 413 | 382 | if (mapper->sram==NULL) |
| 414 | 383 | return; |
| 415 | | // // printf("ti99_8: write %04x = %02x\n", offset, data); |
| 416 | 384 | |
| 417 | 385 | // Look for components responding to the logical address |
| 418 | 386 | found = check_logically_addressed_w(device, offset, data); |
| 419 | 387 | |
| 420 | 388 | if (!found) |
| 421 | 389 | { |
| 422 | | // printf(" not logical ..."); |
| 423 | 390 | // In that case, the address decoder could not find a suitable device. |
| 424 | 391 | // This means the logical address is transformed by the mapper. |
| 425 | 392 | UINT32 pas_address = mapper->pas_offset[(offset & 0xf000)>>12] + (offset & 0xfff); |
| r9542 | r9543 | |
| 435 | 402 | if (adev->device == MAP8_DRAM) |
| 436 | 403 | { |
| 437 | 404 | mapper->dram[pas_address & ~adev->address_mask] = data; |
| 438 | | // printf("dram base %08x", pas_address); |
| 439 | | found = TRUE; |
| 440 | 405 | } |
| 441 | 406 | else |
| 442 | 407 | { |
| 443 | 408 | if (adev->device == MAP8_ROM1 || adev->device == MAP8_ROM1A) |
| 444 | 409 | { |
| 445 | | // printf("rom1 (ignored)"); |
| 446 | | found = TRUE; |
| 410 | logerror("ti99_8: write to rom1 ignored\n"); |
| 447 | 411 | } |
| 448 | 412 | else |
| 449 | 413 | { |
| 450 | 414 | if (adev->device == MAP8_INTS) |
| 451 | 415 | { |
| 452 | 416 | // Interrupt sense |
| 453 | | // printf("ilsense (ignored)"); |
| 454 | | found = TRUE; |
| 417 | logerror("ti99_8: write to ilsense ignored\n"); |
| 455 | 418 | } |
| 456 | 419 | else |
| 457 | 420 | { |
| 458 | | // only one option left: cartridge port (aka grom port) |
| 421 | // cartridge port (aka grom port) or peribox |
| 459 | 422 | if (adev->write_byte != NULL) |
| 460 | 423 | { |
| 461 | | // printf("pdevice "); |
| 462 | 424 | adev->write_byte(adev->device, pas_address, data); |
| 463 | | found = TRUE; |
| 464 | 425 | } |
| 465 | 426 | } |
| 466 | 427 | } |
| 467 | 428 | } |
| 429 | if (adev->stop) break; |
| 468 | 430 | } |
| 469 | 431 | } |
| 470 | | if (found && adev->stop) break; |
| 471 | 432 | } |
| 472 | | |
| 473 | | if (!found) |
| 474 | | { |
| 475 | | // Still not found? Then we route the physical address to the I/O port |
| 476 | | // which has the peribox attached |
| 477 | | // printf("not mapped ... ioport"); |
| 478 | | if (mapper->ioport!=NULL) |
| 479 | | ti99_peb_data_w(mapper->ioport, pas_address, data); |
| 480 | | // printf("ti99_8: io write %04x = %02x\n", offset, data); |
| 481 | | } |
| 482 | 433 | } |
| 483 | | // printf(" %02x\n", data); |
| 484 | 434 | } |
| 485 | 435 | |
| 486 | 436 | /* |
| r9542 | r9543 | |
| 498 | 448 | int bankindx = (data & 0x0e)>>1; |
| 499 | 449 | if (data & 1) |
| 500 | 450 | { |
| 501 | | // printf("mapper8: load from sram bank %02x", bankindx); |
| 502 | 451 | // Load from SRAM |
| 503 | 452 | for (int i=0; i < 16; i++) |
| 504 | 453 | { |
| r9542 | r9543 | |
| 508 | 457 | + (mapper->sram[i*4 + ptr+1] << 16) |
| 509 | 458 | + (mapper->sram[i*4 + ptr+2] << 8) |
| 510 | 459 | + (mapper->sram[i*4 + ptr+3]); |
| 511 | | // // printf(" values (%04x) %02x %02x %02x %02x, ", i*4+ptr, mapper->sram[i*4 + ptr], mapper->sram[i*4 + ptr+1], mapper->sram[i*4 + ptr+2], mapper->sram[i*4 + ptr+3]); |
| 512 | 460 | } |
| 513 | 461 | } |
| 514 | 462 | else |
| 515 | 463 | { |
| 516 | 464 | // Store in SRAM |
| 517 | | // printf("mapper8: copy to sram bank %02x", bankindx); |
| 518 | 465 | for (int i=0; i < 16; i++) |
| 519 | 466 | { |
| 520 | 467 | int ptr = (bankindx << 6); |
| r9542 | r9543 | |
| 540 | 487 | // Starts at 0x4000 in the image |
| 541 | 488 | *value = mapper->rom[0x4000 + (offset & 0x1fff)]; |
| 542 | 489 | } |
| 543 | | else |
| 544 | | { |
| 545 | | if (mapper->ioport!=NULL) |
| 546 | | ti99_peb_data_rz(mapper->ioport, 0x4000 + (offset & 0x1fff), value); |
| 547 | | // printf("ti99_8: io1 read %04x = %02x\n", offset, *value); |
| 548 | | } |
| 549 | 490 | } |
| 550 | 491 | |
| 551 | 492 | |
| r9542 | r9543 | |
| 564 | 505 | if (addr==2) |
| 565 | 506 | { |
| 566 | 507 | // TODO |
| 567 | | // printf("ti-99/8: Hardware reset via CRU\n"); |
| 508 | logerror("ti99_8: Hardware reset via CRU not implemented\n"); |
| 568 | 509 | } |
| 569 | 510 | } |
| 570 | 511 | } |
| r9542 | r9543 | |
| 573 | 514 | { |
| 574 | 515 | mapper8_state *mapper = get_safe_token(device); |
| 575 | 516 | mapper->CRUS = data; |
| 576 | | // printf("ti99_8: CRUS = %02x\n", data); |
| 577 | 517 | } |
| 578 | 518 | |
| 579 | 519 | WRITE8_DEVICE_HANDLER( mapper8_PTGEN_w ) |
| 580 | 520 | { |
| 581 | 521 | mapper8_state *mapper = get_safe_token(device); |
| 582 | 522 | mapper->PTGEN = data; |
| 583 | | // printf("ti99_8: PTGEN = %02x\n", data); |
| 584 | 523 | } |
| 585 | 524 | |
| 586 | 525 | /*************************************************************************** |
| r9542 | r9543 | |
| 589 | 528 | |
| 590 | 529 | static DEVICE_START( mapper8 ) |
| 591 | 530 | { |
| 592 | | // // printf("Starting mapper\n"); |
| 531 | logerror("ti99_8: Starting mapper\n"); |
| 593 | 532 | mapper8_state *mapper = get_safe_token(device); |
| 594 | 533 | mapper->sram = (UINT8*)malloc(SRAM_SIZE); |
| 595 | 534 | mapper->dram = (UINT8*)malloc(DRAM_SIZE); |
| 596 | 535 | mapper->rom = memory_region(device->machine, "maincpu"); |
| 597 | 536 | |
| 537 | memset(mapper->sram, 0x00, SRAM_SIZE); |
| 538 | memset(mapper->dram, 0x00, DRAM_SIZE); |
| 539 | |
| 598 | 540 | int i = 0; |
| 599 | 541 | int done=FALSE; |
| 600 | 542 | |
| r9542 | r9543 | |
| 627 | 569 | { |
| 628 | 570 | for (int j=1; (j < 7) && (dev == NULL); j++) |
| 629 | 571 | { |
| 630 | | // printf("%s, %s\n", cons[i].name, list[j-1]); |
| 631 | 572 | if (strcmp(cons[i].name, list[j-1])==0) |
| 632 | 573 | dev = (void *)j; |
| 633 | 574 | } |
| r9542 | r9543 | |
| 658 | 599 | |
| 659 | 600 | static DEVICE_STOP( mapper8 ) |
| 660 | 601 | { |
| 661 | | // printf("Stopping mapper\n"); |
| 602 | logerror("ti99_8: Stopping mapper\n"); |
| 662 | 603 | mapper8_state *mapper = get_safe_token(device); |
| 663 | 604 | free(mapper->sram); |
| 664 | 605 | free(mapper->dram); |
| r9542 | r9543 | |
| 666 | 607 | |
| 667 | 608 | static DEVICE_RESET( mapper8 ) |
| 668 | 609 | { |
| 669 | | // printf("Resetting mapper\n"); |
| 610 | logerror("ti99_8: Resetting mapper\n"); |
| 670 | 611 | mapper8_state *mapper = get_safe_token(device); |
| 671 | 612 | |
| 672 | 613 | mapper->dsr_selected = FALSE; |
src/mess/drivers/ti99_8.c
| r9542 | r9543 | |
| 146 | 146 | - INT6*-INT11*: row inputs (int6* is only used for joystick fire) |
| 147 | 147 | |
| 148 | 148 | ROM file contents: |
| 149 | | 0000-1fff ROM0 0x0000 (logical address) |
| 149 | 0000-1fff ROM0 0x0000 (logical address) |
| 150 | 150 | 2000-3fff ROM1 0xffa000 - 0xffbfff |
| 151 | | 4000-5fff DSR1 0xff4000 (TTS) |
| 151 | 4000-5fff DSR1 0xff4000 (TTS) |
| 152 | 152 | 6000-7fff ROM1a 0xffc000 - 0xffdfff |
| 153 | | 8000-9fff DSR2 0xff4000 (missing; Hexbus?) |
| 153 | 8000-9fff DSR2 0xff4000 (missing; Hexbus?) |
| 154 | 154 | |
| 155 | 155 | =========================================================================== |
| 156 | 156 | Known Issues (MZ, 2010-11-07) |
| 157 | 157 | |
| 158 | | KEEP IN MIND THAT TEXAS INSTRUMENTS NEVER RELEASED THE TI-99/8 AND THAT |
| 159 | | THERE ARE ONLY A FEW PROTOTYPES OF THE TI-99/8 AVAILABLE. ALL SOFTWARE |
| 158 | KEEP IN MIND THAT TEXAS INSTRUMENTS NEVER RELEASED THE TI-99/8 AND THAT |
| 159 | THERE ARE ONLY A FEW PROTOTYPES OF THE TI-99/8 AVAILABLE. ALL SOFTWARE |
| 160 | 160 | MUST BE ASSUMED TO HAVE REMAINED IN A PRELIMINARY STATE. |
| 161 | 161 | |
| 162 | 162 | - Extended Basic II does not start when a floppy controller is present. This is |
| 163 | 163 | a problem of the prototypical XB II which we cannot solve. It seems as if only |
| 164 | | hexbus devices are properly supported, but we currently do not have an |
| 164 | hexbus devices are properly supported, but we currently do not have an |
| 165 | 165 | emulation for those. Thus you can currently only use cassette to load and |
| 166 | | save programs. You MUST turn off the floppy controller support in the |
| 166 | save programs. You MUST turn off the floppy controller support in the |
| 167 | 167 | configuration before you enter XB II. Other cartridges (like Editor/Assembler) |
| 168 | | seem to be not affected by this problem and can make use of the floppy |
| 168 | seem to be not affected by this problem and can make use of the floppy |
| 169 | 169 | controllers. |
| 170 | 170 | Technical detail: The designers of XB II seem to have decided to put PABs |
| 171 | | (Peripheral access block; contains pointers to buffers, the file name, and |
| 171 | (Peripheral access block; contains pointers to buffers, the file name, and |
| 172 | 172 | the access modes) into CPU RAM instead of the traditional storage in VDP |
| 173 | | RAM. The existing peripheral cards are hard-coded to interpret the given |
| 174 | | pointer to the PAB as pointing to a VDP RAM address. That is, as soon as |
| 173 | RAM. The existing peripheral cards are hard-coded to interpret the given |
| 174 | pointer to the PAB as pointing to a VDP RAM address. That is, as soon as |
| 175 | 175 | the card is found, control is passed to the DSR (device service routine), |
| 176 | 176 | the file name will not be found, and control returns with an error. It seems |
| 177 | | as if XB II does not properly handle this situation and may lock up |
| 177 | as if XB II does not properly handle this situation and may lock up |
| 178 | 178 | (sometimes it starts up, but file access is still not possible). |
| 179 | 179 | |
| 180 | 180 | - Multiple cartridges are not shown in the startup screen; only one |
| 181 | 181 | cartridge is presented. You have to manually select the cartridges with the |
| 182 | 182 | dip switch. |
| 183 | | |
| 183 | |
| 184 | 184 | - Emulation speed may still be incorrect. |
| 185 | | |
| 185 | |
| 186 | 186 | - SAVE and OLD MINIMEM do not work properly in XB II. It seems as if the |
| 187 | 187 | mapper shadows the NVRAM of the cartridge. You will lose the contents when |
| 188 | 188 | you turn off the machine. |
| r9542 | r9543 | |
| 266 | 266 | PORT_DIPSETTING( 0x02, "Slot 2" ) |
| 267 | 267 | PORT_DIPSETTING( 0x03, "Slot 3" ) |
| 268 | 268 | PORT_DIPSETTING( 0x04, "Slot 4" ) |
| 269 | | |
| 269 | |
| 270 | 270 | PORT_START( "BWGDIP1" ) |
| 271 | 271 | PORT_DIPNAME( 0x01, 0x00, "BwG step rate" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x02 ) |
| 272 | 272 | PORT_DIPSETTING( 0x00, "6 ms") |
| r9542 | r9543 | |
| 276 | 276 | PORT_DIPNAME( 0x01, 0x00, "BwG date/time display" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x02 ) |
| 277 | 277 | PORT_DIPSETTING( 0x00, "Hide") |
| 278 | 278 | PORT_DIPSETTING( 0x01, "Show") |
| 279 | | |
| 279 | |
| 280 | 280 | PORT_START( "BWGDIP34" ) |
| 281 | 281 | PORT_DIPNAME( 0x03, 0x00, "BwG drives" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x02 ) |
| 282 | 282 | PORT_DIPSETTING( 0x00, "DSK1 only") |
| r9542 | r9543 | |
| 508 | 508 | }; |
| 509 | 509 | |
| 510 | 510 | /* |
| 511 | | Format: |
| 512 | | Name, mode, stop, mask, select, write, read8z function, write8 function |
| 513 | | |
| 514 | | Multiple devices may have the same select pattern; as in the real hardware, |
| 515 | | care must be taken that only one device actually responds. In the case of |
| 516 | | GROMs, each chip has an internal address counter and an ID, and the chip |
| 517 | | only responds when the ID and the most significant 3 bits match. |
| 511 | Format: |
| 512 | Name, mode, stop, mask, select, write, read8z function, write8 function |
| 513 | |
| 514 | Multiple devices may have the same select pattern; as in the real hardware, |
| 515 | care must be taken that only one device actually responds. In the case of |
| 516 | GROMs, each chip has an internal address counter and an ID, and the chip |
| 517 | only responds when the ID and the most significant 3 bits match. |
| 518 | 518 | */ |
| 519 | 519 | static const mapper8_dev_config mapper_devices[] = |
| 520 | 520 | { |
| 521 | 521 | // TI-99/8 mode |
| 522 | | { SRAMNAME, 0, 1, 0xf800, 0xf000, 0x0000, NULL, NULL }, |
| 522 | { SRAMNAME, 0, 1, 0xf800, 0xf000, 0x0000, NULL, NULL }, |
| 523 | 523 | { "soundgen", 0, 1, 0xfff0, 0xf800, 0x0000, NULL, sn76496_w }, |
| 524 | 524 | { "video", 0, 1, 0xfffd, 0xf810, 0x0000, ti8_tms991x_rz, ti8_tms991x_w }, |
| 525 | | { "speech", 0, 1, 0xfff0, 0xf820, 0x0000, ti998spch_rz, ti998spch_w }, |
| 526 | | { "grom_0", 0, 0, 0xfff1, 0xf830, 0x0000, ti99grom_rz, ti99grom_w }, |
| 527 | | { "grom_1", 0, 0, 0xfff1, 0xf830, 0x0000, ti99grom_rz, ti99grom_w }, |
| 525 | { "speech", 0, 1, 0xfff0, 0xf820, 0x0000, ti998spch_rz, ti998spch_w }, |
| 526 | { "grom_0", 0, 0, 0xfff1, 0xf830, 0x0000, ti99grom_rz, ti99grom_w }, |
| 527 | { "grom_1", 0, 0, 0xfff1, 0xf830, 0x0000, ti99grom_rz, ti99grom_w }, |
| 528 | 528 | { "grom_2", 0, 0, 0xfff1, 0xf830, 0x0000, ti99grom_rz, ti99grom_w }, |
| 529 | 529 | { "gromport", 0, 0, 0xfff1, 0xf830, 0x0400, gromportg_rz, gromportg_w, }, |
| 530 | | // { "grom_tts_0", 2, 0, 0xfff1, 0xf840, 0x0000, 0, 0, ti99grom_rz, ti99grom_w }, // up to 6 GROMs; no good dumps known |
| 531 | | // { "grom_pcode1_0", 2, 0, 0xfff1, 0xf850, 0x0000, 0, 0, ti99grom_rz, ti99grom_w }, // up to 6 GROMs; no good dumps known |
| 532 | | // { "grom_pcode2_0", 2, 0, 0xfff1, 0xf860, 0x0000, 0, 0, ti99grom_rz, ti99grom_w }, // up to 6 GROMs; no good dumps known |
| 533 | | { "mapper", 0, 1, 0xfff0, 0xf870, 0x0000, NULL, ti99_mapreg_w }, |
| 530 | // { "grom_tts_0", 2, 0, 0xfff1, 0xf840, 0x0000, 0, 0, ti99grom_rz, ti99grom_w }, // up to 6 GROMs; no good dumps known |
| 531 | // { "grom_pcode1_0", 2, 0, 0xfff1, 0xf850, 0x0000, 0, 0, ti99grom_rz, ti99grom_w }, // up to 6 GROMs; no good dumps known |
| 532 | // { "grom_pcode2_0", 2, 0, 0xfff1, 0xf860, 0x0000, 0, 0, ti99grom_rz, ti99grom_w }, // up to 6 GROMs; no good dumps known |
| 533 | { "mapper", 0, 1, 0xfff0, 0xf870, 0x0000, NULL, ti99_mapreg_w }, |
| 534 | 534 | |
| 535 | 535 | // TI-99/4A mode |
| 536 | 536 | // GROM: 1001 1000 0000 xxa0 |
| r9542 | r9543 | |
| 539 | 539 | { "grom_1", 1, 0, 0xfff1, 0x9800, 0x0400, ti99grom_rz, ti99grom_w }, |
| 540 | 540 | { "grom_2", 1, 0, 0xfff1, 0x9800, 0x0400, ti99grom_rz, ti99grom_w }, |
| 541 | 541 | { "gromport", 1, 0, 0xfff1, 0x9800, 0x0400, gromportg_rz, gromportg_w, }, |
| 542 | | |
| 543 | | { "mapper", 1, 1, 0xfff0, 0x8810, 0x0000, NULL, ti99_mapreg_w }, |
| 544 | | { "soundgen", 1, 1, 0xfff0, 0x8400, 0x0000, NULL, sn76496_w }, |
| 545 | | { "video", 1, 1, 0xfffd, 0x8800, 0x0400, ti8_tms991x_rz, ti8_tms991x_w }, |
| 546 | | { "speech", 1, 1, 0xfff0, 0x9000, 0x0400, ti998spch_rz, ti998spch_w }, |
| 547 | | { SRAMNAME, 1, 1, 0xf800, 0x8000, 0x0000, NULL, NULL }, // write at the end; soundgen must be found earlier |
| 548 | 542 | |
| 543 | { "mapper", 1, 1, 0xfff0, 0x8810, 0x0000, NULL, ti99_mapreg_w }, |
| 544 | { "soundgen", 1, 1, 0xfff0, 0x8400, 0x0000, NULL, sn76496_w }, |
| 545 | { "video", 1, 1, 0xfffd, 0x8800, 0x0400, ti8_tms991x_rz, ti8_tms991x_w }, |
| 546 | { "speech", 1, 1, 0xfff0, 0x9000, 0x0400, ti998spch_rz, ti998spch_w }, |
| 547 | { SRAMNAME, 1, 1, 0xf800, 0x8000, 0x0000, NULL, NULL }, // write at the end; soundgen must be found earlier |
| 548 | |
| 549 | 549 | // Physical (need to pack this into here as well) |
| 550 | 550 | { DRAMNAME, 3, 1, 0xff0000, 0x000000, 0x000000, NULL, NULL }, |
| 551 | | { "mapper", 3, 1, 0xffe000, 0xff4000, 0x000000, ti998dsr_rz, NULL }, // DSR |
| 552 | | { "gromport", 3, 1, 0xffe000, 0xff6000, 0x000000, gromportr_rz, gromportr_w }, |
| 553 | | { "gromport", 3, 1, 0xffe000, 0xff8000, 0x000000, gromportr_rz, gromportr_w }, |
| 551 | { "mapper", 3, 0, 0xffe000, 0xff4000, 0x000000, ti998dsr_rz, NULL }, // DSR |
| 552 | { "gromport", 3, 1, 0xffe000, 0xff6000, 0x000000, gromportr_rz, gromportr_w }, |
| 553 | { "gromport", 3, 1, 0xffe000, 0xff8000, 0x000000, gromportr_rz, gromportr_w }, |
| 554 | 554 | { ROM1NAME, 3, 1, 0xffe000, 0xffa000, 0x000000, NULL, NULL }, |
| 555 | | { ROM1ANAME, 3, 1, 0xffe000, 0xffc000, 0x000000, NULL, NULL }, |
| 556 | | { INTSNAME, 3, 1, 0xfffff0, 0xffe000, 0x000000, NULL, NULL }, |
| 555 | { ROM1ANAME, 3, 1, 0xffe000, 0xffc000, 0x000000, NULL, NULL }, |
| 556 | { INTSNAME, 3, 1, 0xfffff0, 0xffe000, 0x000000, NULL, NULL }, |
| 557 | { "peribox", 3, 1, 0x000000, 0x000000, 0x000000, ti99_peb_data_rz, ti99_peb_data_w }, |
| 557 | 558 | |
| 558 | 559 | { NULL, 0, 0, 0, 0, 0, NULL, NULL } |
| 559 | 560 | }; |
| 560 | 561 | |
| 561 | | static const cruconf_device cru_devices[] = |
| 562 | static const cruconf_device cru_devices[] = |
| 562 | 563 | { |
| 563 | 564 | { "mapper", 0xfff0, 0x2700, NULL, mapper8c_w }, |
| 564 | | { "gromport", 0xf800, 0x0800, gromportc_rz, gromportc_w }, // Check: Is this really limited? |
| 565 | | { "peribox", 0x0000, 0x0000, ti99_peb_cru_rz, ti99_peb_cru_w }, // Peribox needs all addresses |
| 565 | { "gromport", 0xf800, 0x0800, gromportc_rz, gromportc_w }, // Check: Is this really limited? |
| 566 | { "peribox", 0x0000, 0x0000, ti99_peb_cru_rz, ti99_peb_cru_w }, // Peribox needs all addresses |
| 566 | 567 | { NULL, 0, 0, NULL, NULL } |
| 567 | 568 | }; |
| 568 | 569 | |
| r9542 | r9543 | |
| 582 | 583 | MDRV_MACHINE_RESET( ti99_8 ) |
| 583 | 584 | |
| 584 | 585 | /* video hardware */ |
| 585 | | MDRV_TI_TMS991x_ADD("video", tms9928a, 60, "screen", 2500, &tms9118_interface) |
| 586 | MDRV_TI_TMS991x_ADD("video", tms9928a, 60, "screen", 2500, &tms9118_interface) |
| 586 | 587 | |
| 587 | 588 | MDRV_GFXDECODE(ti99_8) |
| 588 | 589 | |
| r9542 | r9543 | |
| 627 | 628 | MDRV_MACHINE_RESET( ti99_8 ) |
| 628 | 629 | |
| 629 | 630 | /* video hardware */ |
| 630 | | MDRV_TI_TMS991x_ADD("video", tms9928a, 50, "screen", 2500, &tms9129_interface) |
| 631 | MDRV_TI_TMS991x_ADD("video", tms9928a, 50, "screen", 2500, &tms9129_interface) |
| 631 | 632 | |
| 632 | 633 | MDRV_GFXDECODE(ti99_8) |
| 633 | 634 | |
| r9542 | r9543 | |
| 639 | 640 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) |
| 640 | 641 | |
| 641 | 642 | MDRV_TISPEECH_ADD("speech") |
| 642 | | |
| 643 | |
| 643 | 644 | MDRV_MAPPER8_ADD( "mapper", mapper_devices ) |
| 644 | 645 | |
| 645 | 646 | /* tms9901 */ |
src/mess/drivers/ti99_4x.c
| r9542 | r9543 | |
| 49 | 49 | AM_RANGE(0x8000, 0x80ff) AM_MIRROR(0x0300) AM_RAM /*RAM PAD, mirrored 4 times*/ |
| 50 | 50 | AM_RANGE(0x8800, 0x8bff) AM_DEVREADWRITE("video", ti_tms991x_r16, ti_video_wnop) /*vdp read*/ |
| 51 | 51 | AM_RANGE(0x8C00, 0x8fff) AM_DEVREADWRITE("video", ti_video_rnop, ti_tms991x_w16) /*vdp write*/ |
| 52 | | AM_RANGE(0x0000, 0xffff) AM_DEVREADWRITE("datamux_16_8", ti99_dmux_r, ti99_dmux_w) |
| 52 | AM_RANGE(0x0000, 0xffff) AM_DEVREADWRITE("datamux_16_8", ti99_dmux_r, ti99_dmux_w) |
| 53 | 53 | ADDRESS_MAP_END |
| 54 | 54 | |
| 55 | 55 | static ADDRESS_MAP_START(memmap_4ev, ADDRESS_SPACE_PROGRAM, 16) |
| r9542 | r9543 | |
| 58 | 58 | AM_RANGE(0x8000, 0x80ff) AM_MIRROR(0x0300) AM_RAM /*RAM PAD, mirrored 4 times*/ |
| 59 | 59 | AM_RANGE(0x8800, 0x8bff) AM_DEVREADWRITE("video", ti_v9938_r16, ti_video_wnop) /*vdp read*/ |
| 60 | 60 | AM_RANGE(0x8C00, 0x8fff) AM_DEVREADWRITE("video", ti_video_rnop, ti_v9938_w16) /*vdp write*/ |
| 61 | | AM_RANGE(0x0000, 0xffff) AM_DEVREADWRITE("datamux_16_8", ti99_dmux_r, ti99_dmux_w) |
| 61 | AM_RANGE(0x0000, 0xffff) AM_DEVREADWRITE("datamux_16_8", ti99_dmux_r, ti99_dmux_w) |
| 62 | 62 | ADDRESS_MAP_END |
| 63 | 63 | |
| 64 | 64 | /* |
| r9542 | r9543 | |
| 79 | 79 | INPUT_CHANGED( gk_changed ) |
| 80 | 80 | { |
| 81 | 81 | running_device *cartsys = field->port->machine->device("gromport"); |
| 82 | | set_gk_switches(cartsys, (UINT8)((UINT64)param&0x07), newval); |
| 82 | set_gk_switches(cartsys, (UINT8)((UINT64)param&0x07), newval); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /* TI99/4a: 48-key keyboard, plus two optional joysticks (2 shift keys) */ |
| r9542 | r9543 | |
| 121 | 121 | |
| 122 | 122 | /* Flash setting is used to flash an empty HSGPL DSR ROM */ |
| 123 | 123 | PORT_START( "EXTCARD" ) |
| 124 | | PORT_CONFNAME( 0x03, 0x00, "HSGPL extension" ) |
| 124 | PORT_CONFNAME( 0x03, 0x00, "HSGPL extension" ) |
| 125 | 125 | PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) |
| 126 | 126 | PORT_CONFSETTING( 0x01, "Flash" ) |
| 127 | 127 | PORT_CONFSETTING( 0x02, DEF_STR( On ) ) |
| r9542 | r9543 | |
| 179 | 179 | PORT_DIPNAME( 0x01, 0x00, "BwG date/time display" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x02 ) |
| 180 | 180 | PORT_DIPSETTING( 0x00, "Hide") |
| 181 | 181 | PORT_DIPSETTING( 0x01, "Show") |
| 182 | | |
| 182 | |
| 183 | 183 | PORT_START( "BWGDIP34" ) |
| 184 | 184 | PORT_DIPNAME( 0x03, 0x00, "BwG drives" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x02 ) |
| 185 | 185 | PORT_DIPSETTING( 0x00, "DSK1 only") |
| r9542 | r9543 | |
| 746 | 746 | }; |
| 747 | 747 | |
| 748 | 748 | /* |
| 749 | | Format: |
| 750 | | Name, address bus mask, select pattern, write select bit(s), read8z function, write8 function, Condition name, bits which must be set, bits which must not be set |
| 751 | | |
| 752 | | Multiple devices may have the same select pattern; as in the real hardware, |
| 753 | | care must be taken that only one device actually responds. In the case of |
| 754 | | GROMs, each chip has an internal address counter and an ID, and the chip |
| 755 | | only responds when the ID and the most significant 3 bits match. |
| 756 | | If the HSGPL extension is active, the console GROMs should be removed. In |
| 757 | | reality, the chips should be pulled out of their sockets. Here we simulate |
| 758 | | this by a condition. |
| 749 | Format: |
| 750 | Name, address bus mask, select pattern, write select bit(s), read8z function, write8 function, Condition name, bits which must be set, bits which must not be set |
| 751 | |
| 752 | Multiple devices may have the same select pattern; as in the real hardware, |
| 753 | care must be taken that only one device actually responds. In the case of |
| 754 | GROMs, each chip has an internal address counter and an ID, and the chip |
| 755 | only responds when the ID and the most significant 3 bits match. |
| 756 | If the HSGPL extension is active, the console GROMs should be removed. In |
| 757 | reality, the chips should be pulled out of their sockets. Here we simulate |
| 758 | this by a condition. |
| 759 | 759 | */ |
| 760 | 760 | static const bus_device dmux_devices[] = |
| 761 | 761 | { |
| r9542 | r9543 | |
| 769 | 769 | { NULL, 0, 0, 0, NULL, NULL, 0, 0 } |
| 770 | 770 | }; |
| 771 | 771 | |
| 772 | | static const cruconf_device cru_devices[] = |
| 772 | static const cruconf_device cru_devices[] = |
| 773 | 773 | { |
| 774 | 774 | { "gromport", 0xf800, 0x0800, gromportc_rz, gromportc_w }, // Check: Is this really limited? |
| 775 | 775 | { "peribox", 0x0000, 0x0000, ti99_peb_cru_rz, ti99_peb_cru_w }, // Peribox needs all addresses |
| r9542 | r9543 | |
| 800 | 800 | // MDRV_SCREEN_REFRESH_RATE(60) |
| 801 | 801 | // MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 802 | 802 | |
| 803 | | MDRV_TI_TMS991x_ADD("video", tms9928a, 60, "screen", 2500, &tms9918_interface) |
| 803 | MDRV_TI_TMS991x_ADD("video", tms9928a, 60, "screen", 2500, &tms9918_interface) |
| 804 | 804 | MDRV_GFXDECODE(ti99) |
| 805 | 805 | |
| 806 | 806 | /* sound hardware */ |
| r9542 | r9543 | |
| 812 | 812 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 813 | 813 | |
| 814 | 814 | MDRV_TI994_BOARD_ADD( "ti_board" ) |
| 815 | | |
| 815 | |
| 816 | 816 | /* tms9901 */ |
| 817 | 817 | MDRV_TMS9901_ADD("tms9901", tms9901_wiring_ti99_4) |
| 818 | 818 | |
| 819 | 819 | MDRV_CRUBUS_ADD( "crubus", cru_devices ) |
| 820 | 820 | MDRV_DMUX_ADD( "datamux_16_8", dmux_devices ) |
| 821 | | |
| 821 | |
| 822 | 822 | MDRV_GROM_ADD( "console_grom_0", 0, region_grom, 0x0000, 0x1800, console_ready ) |
| 823 | 823 | MDRV_GROM_ADD( "console_grom_1", 1, region_grom, 0x2000, 0x1800, console_ready ) |
| 824 | 824 | MDRV_GROM_ADD( "console_grom_2", 2, region_grom, 0x4000, 0x1800, console_ready ) |
| 825 | 825 | |
| 826 | 826 | MDRV_TI99_GROMPORT_ADD( "gromport", console_ready ) |
| 827 | | |
| 827 | |
| 828 | 828 | MDRV_PBOX4_ADD( "peribox", console_extint, console_notconnected, console_ready ) |
| 829 | 829 | |
| 830 | 830 | MDRV_CASSETTE_ADD( "cassette1", default_cassette_config ) |
| 831 | | MDRV_CASSETTE_ADD( "cassette2", default_cassette_config ) |
| 831 | MDRV_CASSETTE_ADD( "cassette2", default_cassette_config ) |
| 832 | 832 | |
| 833 | 833 | MDRV_MECMOUSE_ADD( "mecmouse" ) |
| 834 | | MDRV_HANDSET_ADD( "handset", "tms9901" ) |
| 834 | MDRV_HANDSET_ADD( "handset", "tms9901" ) |
| 835 | 835 | MACHINE_CONFIG_END |
| 836 | 836 | |
| 837 | 837 | static MACHINE_CONFIG_START( ti99_4_50hz, driver_device ) |
| r9542 | r9543 | |
| 845 | 845 | MDRV_MACHINE_RESET( ti99_4 ) |
| 846 | 846 | |
| 847 | 847 | /* video hardware */ |
| 848 | | MDRV_TI_TMS991x_ADD("video", tms9928a, 50, "screen", 2500, &tms9929_interface) |
| 848 | MDRV_TI_TMS991x_ADD("video", tms9928a, 50, "screen", 2500, &tms9929_interface) |
| 849 | 849 | |
| 850 | 850 | MDRV_GFXDECODE(ti99) |
| 851 | | |
| 851 | |
| 852 | 852 | /* sound hardware */ |
| 853 | 853 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 854 | 854 | MDRV_SOUND_ADD("soundgen", SN94624, 3579545/8) /* 3.579545 MHz */ |
| r9542 | r9543 | |
| 870 | 870 | MDRV_GROM_ADD( "console_grom_2", 2, region_grom, 0x4000, 0x1800, console_ready ) |
| 871 | 871 | |
| 872 | 872 | MDRV_TI99_GROMPORT_ADD( "gromport", console_ready ) |
| 873 | | |
| 873 | |
| 874 | 874 | MDRV_PBOX4_ADD( "peribox", console_extint, console_notconnected, console_ready ) |
| 875 | 875 | |
| 876 | 876 | MDRV_CASSETTE_ADD( "cassette1", default_cassette_config ) |
| 877 | 877 | MDRV_CASSETTE_ADD( "cassette2", default_cassette_config ) |
| 878 | | |
| 878 | |
| 879 | 879 | MDRV_MECMOUSE_ADD( "mecmouse" ) |
| 880 | | MDRV_HANDSET_ADD( "handset", "tms9901" ) |
| 880 | MDRV_HANDSET_ADD( "handset", "tms9901" ) |
| 881 | 881 | MACHINE_CONFIG_END |
| 882 | 882 | |
| 883 | 883 | static MACHINE_CONFIG_START( ti99_4a_60hz, driver_device ) |
| r9542 | r9543 | |
| 891 | 891 | MDRV_MACHINE_RESET( ti99_4a ) |
| 892 | 892 | |
| 893 | 893 | /* video hardware */ |
| 894 | | MDRV_TI_TMS991x_ADD("video", tms9928a, 60, "screen", 2500, &tms9918a_interface) |
| 894 | MDRV_TI_TMS991x_ADD("video", tms9928a, 60, "screen", 2500, &tms9918a_interface) |
| 895 | 895 | MDRV_GFXDECODE(ti99a) |
| 896 | | |
| 896 | |
| 897 | 897 | /* sound hardware */ |
| 898 | 898 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 899 | 899 | MDRV_SOUND_ADD("soundgen", SN94624, 3579545/8) /* 3.579545 MHz */ |
| r9542 | r9543 | |
| 915 | 915 | MDRV_GROM_ADD( "console_grom_2", 2, region_grom, 0x4000, 0x1800, console_ready ) |
| 916 | 916 | |
| 917 | 917 | MDRV_TI99_GROMPORT_ADD( "gromport", console_ready ) |
| 918 | | |
| 918 | |
| 919 | 919 | MDRV_PBOX4A_ADD( "peribox", console_extint, console_notconnected, console_ready ) |
| 920 | 920 | |
| 921 | 921 | MDRV_CASSETTE_ADD( "cassette1", default_cassette_config ) |
| r9542 | r9543 | |
| 931 | 931 | MDRV_CPU_PROGRAM_MAP(memmap) |
| 932 | 932 | MDRV_CPU_IO_MAP(cru_map) |
| 933 | 933 | MDRV_CPU_VBLANK_INT("screen", ti99_vblank_interrupt) |
| 934 | | |
| 934 | |
| 935 | 935 | MDRV_MACHINE_RESET( ti99_4a ) |
| 936 | 936 | |
| 937 | 937 | /* video hardware */ |
| 938 | | MDRV_TI_TMS991x_ADD("video", tms9928a, 60, "screen", 2500, &tms9929a_interface) |
| 938 | MDRV_TI_TMS991x_ADD("video", tms9928a, 60, "screen", 2500, &tms9929a_interface) |
| 939 | 939 | MDRV_GFXDECODE(ti99a) |
| 940 | | |
| 940 | |
| 941 | 941 | /* sound hardware */ |
| 942 | 942 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 943 | 943 | MDRV_SOUND_ADD("soundgen", SN94624, 3579545/8) /* 3.579545 MHz */ |
| r9542 | r9543 | |
| 947 | 947 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 948 | 948 | |
| 949 | 949 | MDRV_TI994A_BOARD_ADD( "ti_board" ) |
| 950 | | |
| 950 | |
| 951 | 951 | /* tms9901 */ |
| 952 | 952 | MDRV_TMS9901_ADD("tms9901", tms9901_wiring_ti99_4a) |
| 953 | | |
| 953 | |
| 954 | 954 | MDRV_CRUBUS_ADD( "crubus", cru_devices ) |
| 955 | 955 | MDRV_DMUX_ADD( "datamux_16_8", dmux_devices ) |
| 956 | 956 | |
| r9542 | r9543 | |
| 959 | 959 | MDRV_GROM_ADD( "console_grom_2", 2, region_grom, 0x4000, 0x1800, console_ready ) |
| 960 | 960 | |
| 961 | 961 | MDRV_TI99_GROMPORT_ADD( "gromport", console_ready ) |
| 962 | | |
| 962 | |
| 963 | 963 | MDRV_PBOX4A_ADD( "peribox", console_extint, console_notconnected, console_ready ) |
| 964 | 964 | |
| 965 | 965 | MDRV_CASSETTE_ADD( "cassette1", default_cassette_config ) |
| r9542 | r9543 | |
| 990 | 990 | MDRV_MACHINE_RESET( ti99_4a ) |
| 991 | 991 | |
| 992 | 992 | /* video hardware */ |
| 993 | | MDRV_TI_V9938_ADD("video", 60, "screen", 2500, 512+32, (212+28)*2, tms9901_set_int2) |
| 993 | MDRV_TI_V9938_ADD("video", 60, "screen", 2500, 512+32, (212+28)*2, tms9901_set_int2) |
| 994 | 994 | |
| 995 | 995 | MDRV_GFXDECODE(ti99b) |
| 996 | 996 | |
| r9542 | r9543 | |
| 1003 | 1003 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 1004 | 1004 | |
| 1005 | 1005 | MDRV_TI994A_BOARD_ADD( "ti_board" ) |
| 1006 | | |
| 1006 | |
| 1007 | 1007 | MDRV_TMS9901_ADD("tms9901", tms9901_wiring_ti99_4a) |
| 1008 | 1008 | |
| 1009 | 1009 | MDRV_CRUBUS_ADD( "crubus", cru_devices ) |