src/mess/machine/trs80.c
| r4435 | r4436 | |
| 11 | 11 | #include "driver.h" |
| 12 | 12 | #include "machine/ctronics.h" |
| 13 | 13 | #include "machine/ay31015.h" |
| 14 | #include "sound/speaker.h" |
| 14 | 15 | #include "includes/trs80.h" |
| 15 | 16 | |
| 16 | 17 | /* Components */ |
| r4435 | r4436 | |
| 32 | 33 | #define LOG(x) do { if (VERBOSE) logerror x; } while (0) |
| 33 | 34 | |
| 34 | 35 | |
| 35 | | UINT8 trs80_port_ff = 0; |
| 36 | static UINT8 trs80_port_e0 = 0; |
| 37 | UINT8 trs80_port_ff = 0; // will be changed to pass mode bits to video rather than port bits |
| 36 | 38 | |
| 37 | | #define IRQ_TIMER 0x80 |
| 38 | | #define IRQ_FDC 0x40 |
| 39 | | static UINT8 irq_status = 0; |
| 39 | #define IRQ_TIMER 0x80 /* RTC on Model I */ |
| 40 | #define IRQ_RTC 0x04 /* RTC on Model 4 */ |
| 41 | #define IRQ_FDC 0x40 /* FDC on Model 1 */ |
| 42 | static UINT8 irq_status = 0; |
| 40 | 43 | |
| 41 | | #define MAX_LUMPS 192 /* crude storage units - don't now much about it */ |
| 44 | #define MAX_LUMPS 192 /* crude storage units - don't now much about it */ |
| 42 | 45 | #define MAX_GRANULES 8 /* lumps consisted of granules.. aha */ |
| 43 | 46 | #define MAX_SECTORS 5 /* and granules of sectors */ |
| 44 | 47 | |
| r4435 | r4436 | |
| 61 | 64 | static const device_config *trs80_printer; |
| 62 | 65 | static const device_config *trs80_ay31015; |
| 63 | 66 | static const device_config *trs80_cass; |
| 67 | static const device_config *trs80_speaker; |
| 68 | static const device_config *trs80_fdc; |
| 64 | 69 | |
| 65 | 70 | static TIMER_CALLBACK( cassette_data_callback ) |
| 66 | 71 | { |
| r4435 | r4436 | |
| 216 | 221 | trs80_printer = devtag_get_device(machine, "centronics"); |
| 217 | 222 | trs80_ay31015 = devtag_get_device(machine, "tr1602"); |
| 218 | 223 | trs80_cass = devtag_get_device(machine, "cassette"); |
| 224 | trs80_speaker = devtag_get_device(machine, "speaker"); |
| 225 | trs80_fdc = devtag_get_device(machine, "wd179x"); |
| 219 | 226 | } |
| 220 | 227 | |
| 221 | 228 | |
| r4435 | r4436 | |
| 330 | 337 | * |
| 331 | 338 | *************************************/ |
| 332 | 339 | |
| 333 | | READ8_HANDLER( trs80m3_e8_r ) |
| 340 | READ8_HANDLER( trs80m4_e0_r ) |
| 334 | 341 | { |
| 342 | return ~trs80_port_e0; |
| 343 | } |
| 344 | |
| 345 | READ8_HANDLER( trs80m4_e8_r ) |
| 346 | { |
| 335 | 347 | /* These bits directly read pins on the RS-232 socket, and are not emulated |
| 336 | 348 | d7 Clear-to-Send (CTS), Pin 5 |
| 337 | 349 | d6 Data-Set-Ready (DSR), pin 6 |
| r4435 | r4436 | |
| 343 | 355 | return 0; // this is a guess |
| 344 | 356 | } |
| 345 | 357 | |
| 346 | | READ8_HANDLER( trs80m3_ea_r ) |
| 358 | READ8_HANDLER( trs80m4_ea_r ) |
| 347 | 359 | { |
| 348 | 360 | /* UART Status Register |
| 349 | 361 | d7 Data Received ('1'=condition true) |
| r4435 | r4436 | |
| 365 | 377 | return data; |
| 366 | 378 | } |
| 367 | 379 | |
| 368 | | READ8_HANDLER( trs80m3_eb_r ) |
| 380 | READ8_HANDLER( trs80m4_eb_r ) |
| 369 | 381 | { |
| 370 | 382 | /* UART received data */ |
| 371 | 383 | UINT8 data = ay31015_get_received_data( trs80_ay31015 ); |
| r4435 | r4436 | |
| 374 | 386 | return data; |
| 375 | 387 | } |
| 376 | 388 | |
| 389 | READ8_HANDLER( trs80m4_ec_r ) |
| 390 | { |
| 391 | /* Reset the RTC interrupt */ |
| 392 | // trs80_port_e0 &= ~IRQ_RTC; |
| 393 | return 0; |
| 394 | } |
| 395 | |
| 377 | 396 | READ8_HANDLER( sys80_f9_r ) |
| 378 | 397 | { |
| 379 | 398 | /* UART Status Register (d4..d6 not emulated) |
| r4435 | r4436 | |
| 398 | 417 | return data; |
| 399 | 418 | } |
| 400 | 419 | |
| 401 | | READ8_HANDLER( trs80_fe_r ) |
| 420 | READ8_HANDLER( trs80_ff_r ) |
| 402 | 421 | { |
| 403 | | /* not emulated yet */ |
| 404 | | return 0xff; |
| 422 | UINT8 data = (~trs80_port_ff & 8) << 3; // MODESEL bit (32 or 64 chars per line) |
| 423 | return data | cassette_data; |
| 405 | 424 | } |
| 406 | 425 | |
| 426 | READ8_HANDLER( trs80m4_ff_r ) |
| 427 | { |
| 428 | /* Return of cassette data stream from tape |
| 429 | d7 Low-speed data |
| 430 | d0 High-speed data (not emulated yet) */ |
| 407 | 431 | |
| 408 | | READ8_HANDLER( trs80_ff_r ) |
| 432 | UINT8 data = trs80m4_ec_r(space, 0); // this is a mirror of 0xec |
| 433 | data++; // get rid of compile error |
| 434 | return cassette_data; |
| 435 | } |
| 436 | |
| 437 | WRITE8_HANDLER( trs80m4_84_w ) |
| 409 | 438 | { |
| 410 | | UINT8 data = (~trs80_port_ff & 8) << 3; // MODESEL bit (32 or 64 chars per line) |
| 411 | | return data | cassette_data; |
| 439 | /* Hi-res graphics control (not emulated) |
| 440 | d7 Page Control |
| 441 | d6 Fix upper memory |
| 442 | d5 Memory bit 1 |
| 443 | d4 Memory bit 0 |
| 444 | d3 Invert Video (whole screen) |
| 445 | d2 80/64 width |
| 446 | d1 Select bit 1 |
| 447 | d0 Select bit 0 */ |
| 412 | 448 | } |
| 413 | 449 | |
| 450 | WRITE8_HANDLER( trs80m4_90_w ) |
| 451 | { |
| 452 | speaker_level_w(trs80_speaker, ~data & 1); |
| 453 | } |
| 414 | 454 | |
| 415 | | WRITE8_HANDLER( trs80m3_e8_w ) |
| 455 | WRITE8_HANDLER( trs80m4_e0_w ) |
| 416 | 456 | { |
| 457 | /* Interrupt settings |
| 458 | d6 Enable Rec Err |
| 459 | d5 Enable Rec Data |
| 460 | d4 Enable Xmit Emp |
| 461 | d3 Enable I/O int |
| 462 | d2 Enable RT int |
| 463 | d1 C fall Int |
| 464 | d0 C Rise Int */ |
| 465 | |
| 466 | trs80_port_e0 = data; |
| 467 | } |
| 468 | |
| 469 | WRITE8_HANDLER( trs80m4_e8_w ) |
| 470 | { |
| 417 | 471 | /* d1 when '1' enables control register load (see below) */ |
| 418 | 472 | trs80_reg_load = data & 2; |
| 419 | 473 | } |
| 420 | 474 | |
| 421 | | WRITE8_HANDLER( trs80m3_e9_w ) |
| 475 | WRITE8_HANDLER( trs80m4_e9_w ) |
| 422 | 476 | { |
| 423 | 477 | /* UART set baud rate. Rx = bits 0..3, Tx = bits 4..7 |
| 424 | 478 | 00h 50 |
| r4435 | r4436 | |
| 443 | 497 | ay31015_set_transmitter_clock( trs80_ay31015, baud_clock[data>>4]); |
| 444 | 498 | } |
| 445 | 499 | |
| 446 | | WRITE8_HANDLER( trs80m3_ea_w ) |
| 500 | WRITE8_HANDLER( trs80m4_ea_w ) |
| 447 | 501 | { |
| 448 | 502 | if (trs80_reg_load) |
| 449 | 503 | |
| r4435 | r4436 | |
| 483 | 537 | } |
| 484 | 538 | } |
| 485 | 539 | |
| 486 | | WRITE8_HANDLER( trs80m3_eb_w ) |
| 540 | WRITE8_HANDLER( trs80m4_eb_w ) |
| 487 | 541 | { |
| 488 | 542 | ay31015_set_transmit_data( trs80_ay31015, data ); |
| 489 | 543 | } |
| 490 | 544 | |
| 545 | WRITE8_HANDLER( trs80m4_ec_w ) |
| 546 | { |
| 547 | /* Hardware settings - not yet emulated |
| 548 | d6 CPU fast (1=4MHz, 0=2MHz) |
| 549 | d5 Enable Video Wait |
| 550 | d4 Enable External I/O bus |
| 551 | d3 Enable Alternate Character Set |
| 552 | d2 Mode Select (0=64 chars, 1=32chars) |
| 553 | d1 Cassette Motor (1=On) */ |
| 554 | |
| 555 | cassette_change_state( trs80_cass, ( data & 2 ) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR ); |
| 556 | } |
| 557 | |
| 491 | 558 | WRITE8_HANDLER( sys80_f8_w ) |
| 492 | 559 | { |
| 493 | 560 | /* These adjust levels at the socket pins - not emulated |
| r4435 | r4436 | |
| 500 | 567 | { |
| 501 | 568 | static const double levels[4] = { 0.0, -1.0, 0.0, 1.0 }; |
| 502 | 569 | |
| 503 | | cassette_change_state( trs80_cass, ( data & 0x04 ) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR ); |
| 504 | | cassette_output( trs80_cass, levels[data & 0x03]); |
| 505 | | |
| 570 | cassette_change_state( trs80_cass, ( data & 4 ) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR ); |
| 571 | cassette_output( trs80_cass, levels[data & 3]); |
| 506 | 572 | cassette_data &= ~0x80; |
| 507 | 573 | trs80_port_ff = data; |
| 508 | 574 | } |
| 509 | 575 | |
| 576 | WRITE8_HANDLER( trs80m4_ff_w ) |
| 577 | { |
| 578 | static const double levels[4] = { 0.0, -1.0, 0.0, 1.0 }; |
| 579 | cassette_output( trs80_cass, levels[data & 3]); |
| 580 | cassette_data &= ~0x80; |
| 581 | } |
| 510 | 582 | |
| 583 | |
| 511 | 584 | /************************************* |
| 512 | 585 | * |
| 513 | 586 | * Interrupt handlers. |
| r4435 | r4436 | |
| 523 | 596 | } |
| 524 | 597 | } |
| 525 | 598 | |
| 599 | INTERRUPT_GEN( trs80m4_rtc_interrupt ) |
| 600 | { |
| 601 | // if( (irq_status & IRQ_RTC) == 0 ) |
| 602 | if( (irq_status & 1) == 0 ) |
| 603 | { |
| 604 | irq_status |= IRQ_RTC; |
| 605 | irq_status |= 1; // indicate irq in progress |
| 606 | cpu_set_input_line(device, 0, HOLD_LINE); |
| 607 | } |
| 608 | else |
| 609 | if (irq_status & 1) |
| 610 | { |
| 611 | irq_status &= 0xfe; |
| 612 | cpu_set_input_line(device, 0, CLEAR_LINE); |
| 613 | } |
| 614 | } |
| 615 | |
| 526 | 616 | static void trs80_fdc_interrupt_internal(running_machine *machine) |
| 527 | 617 | { |
| 528 | 618 | if ((irq_status & IRQ_FDC) == 0) |
| r4435 | r4436 | |
| 600 | 690 | WRITE8_HANDLER( trs80_motor_w ) |
| 601 | 691 | { |
| 602 | 692 | UINT8 drive = 255; |
| 603 | | const device_config *fdc = devtag_get_device(space->machine, "wd179x"); |
| 604 | 693 | |
| 605 | 694 | LOG(("trs80 motor_w $%02X\n", data)); |
| 606 | 695 | |
| r4435 | r4436 | |
| 639 | 728 | if (drive > 3) |
| 640 | 729 | return; |
| 641 | 730 | |
| 642 | | wd17xx_set_drive(fdc,drive); |
| 643 | | wd17xx_set_side(fdc,head); |
| 731 | wd17xx_set_drive(trs80_fdc,drive); |
| 732 | wd17xx_set_side(trs80_fdc,head); |
| 644 | 733 | |
| 645 | 734 | } |
| 646 | 735 | |
src/mess/drivers/trs80.c
| r4435 | r4436 | |
| 54 | 54 | - bit 4 selects internal cassette player (low) or external unit (high) on a system-80 |
| 55 | 55 | |
| 56 | 56 | FD: |
| 57 | | - bit 7 for reading the printer status on a system-80 |
| 58 | | - all bits for writing to a printer on a system-80 |
| 57 | - Read printer status on a system-80 |
| 58 | - Write to printer on a system-80 |
| 59 | 59 | |
| 60 | 60 | F9: |
| 61 | 61 | - UART data (write) status (read) on a system-80 |
| 62 | 62 | |
| 63 | 63 | F8: |
| 64 | 64 | - UART data (read) status (write) on a system-80 |
| 65 | | For Model 4... |
| 66 | | F8h Write (output) send data to the printer data lines with strobe pulsed low. |
| 67 | | F8h Read (input) reads printer status as follows: |
| 68 | | d7 BUSY ('1'=true) |
| 69 | | d6 Out-of-Paper ('1'=true) |
| 70 | | d5 Device Select ('1'=true) |
| 71 | | d4 ERROR, printer fault ('1'=true) |
| 72 | | d3..d0 Reserved |
| 65 | - Write to printer (Model III/4) |
| 66 | - Read printer status (Model III/4) |
| 73 | 67 | |
| 74 | 68 | EB: |
| 75 | 69 | - UART data (read and write) on a Model III/4 |
| 76 | 70 | |
| 77 | 71 | EA: |
| 78 | 72 | - UART status (read and write) on a Model III/4 |
| 79 | | EAh Output (Write), when E8h bit d1 is '1' (Control Register enabled): |
| 80 | | bits d7..d3 are UART control; d2..d0 are Modem line control |
| 81 | | d7 Even Parity Enable ('1'=even, '0'=odd) |
| 82 | | d6='1',d5='1' for 8 bits |
| 83 | | d6='0',d5='1' for 7 bits |
| 84 | | d6='1',d5='0' for 6 bits |
| 85 | | d6='0',d5='0' for 5 bits |
| 86 | | d4 Stop Bit Select ('1'=two stop bits, '0'=one stop bit) |
| 87 | | d3 Parity Inhibit ('1'=disable; No parity, '0'=parity enabled) |
| 88 | | d2 Break ('0'=disable transmit data; continuous RS232 'SPACE' condition) |
| 89 | | d1 Request-to-Send (RTS), pin 4 |
| 90 | | d0 Data-Terminal-Ready (DTR), pin 20 |
| 91 | | EAh Output (Write), when E8h bit d1 is '0' (Control Register disabled): bits d5..d3 are secondary line control, and could even be used for steering or multiplexing logic; d2..d0 are Modem line control same as above |
| 92 | | d7,d6 Not used |
| 93 | | d5 Secondary Unassigned, pin 18 |
| 94 | | d4 Secondary Transmit Data, pin 14 |
| 95 | | d3 Secondary Request-to-Send, pin 19 |
| 96 | | d2 Break ('0'=disable transmit data; continuous RS232 'SPACE' condition) |
| 97 | | d1 Data-Terminal-Ready (DTR), pin 20 |
| 98 | | d0 Request-to-Send (RTS), pin 4 |
| 99 | | EAh Input (Read): UART Status Register |
| 100 | | d7 Data Received ('1'=condition true) |
| 101 | | d6 Transmitter Holding Register empty ('1'=condition true) |
| 102 | | d5 Overrun Error ('1'=condition true) |
| 103 | | d4 Framing Error ('1'=condition true) |
| 104 | | d3 Parity Error ('1'=condition true) |
| 105 | | d2..d0 Not used |
| 106 | 73 | |
| 107 | 74 | E9: |
| 108 | | - UART Configuration jumpers (read) on a Model III/4 (?) |
| 109 | | Rx = bits 0..3, Tx = bits 4..7 |
| 110 | | 00h 50 |
| 111 | | 11h 75 |
| 112 | | 22h 100 |
| 113 | | 33h 134.5 |
| 114 | | 44h 150 |
| 115 | | 55h 300 |
| 116 | | 66h 600 |
| 117 | | 77h 1200 |
| 118 | | 88h 1800 |
| 119 | | 99h 2000 |
| 120 | | AAh 2400 |
| 121 | | BBh 3600 |
| 122 | | CCh 4800 |
| 123 | | DDh 7200 |
| 124 | | EEh 9600 |
| 125 | | FFh 19200 |
| 75 | - UART Configuration jumpers (read) on a Model III/4 |
| 76 | - Set baud rate (Model III/4) |
| 126 | 77 | |
| 127 | 78 | E8: |
| 128 | 79 | - UART Modem Status register (read) on a Model III/4 |
| 129 | 80 | - UART Master Reset (write) on a Model III/4 |
| 130 | | Port E8h |
| 131 | | E8h Output: UART Master Reset, enables UART control register load |
| 132 | | d1 when '1' enables control register load (see Port EAh description above). |
| 133 | | Input: Modem Status Register |
| 134 | | d7 Clear-to-Send (CTS), Pin 5 |
| 135 | | d6 Data-Set-Ready (DSR), pin 6 |
| 136 | | d5 Carrier Detect (CD), pin 8 |
| 137 | | d4 Ring Indicator (RI), pin 22 |
| 138 | | d3..d2,d0 Not used |
| 139 | | d1 UART Receiver Input, pin 20 (pin 20 is also DTR) |
| 140 | 81 | |
| 82 | Model 4 - C0-CF = hard drive (optional) |
| 83 | - 90-93 write sound (optional) |
| 84 | - 80-8F hires graphics (optional) |
| 85 | |
| 86 | About the Model II - this runs a boostrap rom, and boots a floppy. The rom is then bankswitched |
| 87 | out, and RAM takes its place. There is no rom basic, and no cassette support. Display sizes are |
| 88 | 80x24 and 40x24. It could have 32k or 64k RAM. 2x RS-232C ports. 1x Parallel printer port. 1x |
| 89 | Expansion interface for more floppy drives. The drives use 8-inch floppies holding 0.5mb of data. |
| 90 | It was extremely expensive, non-standard, and not many were sold. A rom dump does not seem to exist. |
| 91 | |
| 92 | About the Model 4 - Our emulation is incorrect. The correct display size is 80x24. We possibly |
| 93 | have the wrong roms - to be checked. |
| 94 | |
| 141 | 95 | *************************************************************************** |
| 142 | 96 | |
| 143 | 97 | Not dumped: |
| r4435 | r4436 | |
| 162 | 116 | #include "sound/wave.h" |
| 163 | 117 | #include "machine/ctronics.h" |
| 164 | 118 | #include "machine/ay31015.h" |
| 119 | #include "sound/speaker.h" |
| 165 | 120 | #include "includes/trs80.h" |
| 166 | 121 | |
| 167 | 122 | /* Components */ |
| r4435 | r4436 | |
| 205 | 160 | static ADDRESS_MAP_START( model1_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 206 | 161 | AM_RANGE(0x0000, 0x35ff) AM_ROM |
| 207 | 162 | AM_RANGE(0x37de, 0x37de) AM_READWRITE(sys80_f9_r, sys80_f8_w) |
| 208 | | AM_RANGE(0x37df, 0x37df) AM_READWRITE(trs80m3_eb_r, trs80m3_eb_w) |
| 163 | AM_RANGE(0x37df, 0x37df) AM_READWRITE(trs80m4_eb_r, trs80m4_eb_w) |
| 209 | 164 | AM_RANGE(0x37e0, 0x37e3) AM_READWRITE(trs80_irq_status_r, trs80_motor_w) |
| 210 | | // AM_RANGE(0x37e4, 0x37e7) AM_NOP |
| 211 | 165 | AM_RANGE(0x37e8, 0x37eb) AM_READWRITE(trs80_printer_r, trs80_printer_w) |
| 212 | 166 | AM_RANGE(0x37ec, 0x37ec) AM_DEVREADWRITE("wd179x", trs80_wd179x_r, wd17xx_command_w) |
| 213 | 167 | AM_RANGE(0x37ed, 0x37ed) AM_DEVREADWRITE("wd179x", wd17xx_track_r, wd17xx_track_w) |
| 214 | 168 | AM_RANGE(0x37ee, 0x37ee) AM_DEVREADWRITE("wd179x", wd17xx_sector_r, wd17xx_sector_w) |
| 215 | 169 | AM_RANGE(0x37ef, 0x37ef) AM_DEVREADWRITE("wd179x", wd17xx_data_r, wd17xx_data_w) |
| 216 | | // AM_RANGE(0x37f0, 0x37ff) AM_NOP |
| 217 | 170 | AM_RANGE(0x3800, 0x38ff) AM_MIRROR(0x300) AM_READ(trs80_keyboard_r) |
| 218 | 171 | AM_RANGE(0x3c00, 0x3fff) AM_READWRITE(SMH_RAM, trs80_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) |
| 219 | 172 | AM_RANGE(0x4000, 0xffff) AM_RAM |
| r4435 | r4436 | |
| 221 | 174 | |
| 222 | 175 | static ADDRESS_MAP_START( model1_io, ADDRESS_SPACE_IO, 8 ) |
| 223 | 176 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 224 | | AM_RANGE(0xfe, 0xfe) AM_READ(trs80_fe_r) |
| 225 | 177 | AM_RANGE(0xff, 0xff) AM_READWRITE(trs80_ff_r, trs80_ff_w) |
| 226 | 178 | ADDRESS_MAP_END |
| 227 | 179 | |
| 228 | 180 | static ADDRESS_MAP_START( sys80_io, ADDRESS_SPACE_IO, 8 ) |
| 229 | 181 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 230 | | AM_RANGE(0xf8, 0xf8) AM_READWRITE(trs80m3_eb_r, sys80_f8_w) |
| 231 | | AM_RANGE(0xf9, 0xf9) AM_READWRITE(sys80_f9_r, trs80m3_eb_w) |
| 182 | AM_RANGE(0xf8, 0xf8) AM_READWRITE(trs80m4_eb_r, sys80_f8_w) |
| 183 | AM_RANGE(0xf9, 0xf9) AM_READWRITE(sys80_f9_r, trs80m4_eb_w) |
| 232 | 184 | AM_RANGE(0xfd, 0xfd) AM_READWRITE(trs80_printer_r, trs80_printer_w) |
| 233 | | AM_RANGE(0xfe, 0xfe) AM_READ(trs80_fe_r) |
| 185 | // AM_RANGE(0xfe, 0xfe) AM_WRITE(sys80_fe_w) |
| 234 | 186 | AM_RANGE(0xff, 0xff) AM_READWRITE(trs80_ff_r, trs80_ff_w) |
| 235 | 187 | ADDRESS_MAP_END |
| 236 | 188 | |
| r4435 | r4436 | |
| 243 | 195 | |
| 244 | 196 | static ADDRESS_MAP_START( model3_io, ADDRESS_SPACE_IO, 8 ) |
| 245 | 197 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 246 | | /* the ports marked NOP are not emulated yet */ |
| 247 | | // AM_RANGE(0xe0, 0xe3) AM_READWRITE(trs80_irq_status_r, trs80_irq_mask_w) // it breaks the keyboard |
| 248 | | AM_RANGE(0xe4, 0xe4) AM_READWRITE(SMH_NOP,trs80_motor_w) |
| 249 | | AM_RANGE(0xe8, 0xe8) AM_READWRITE(trs80m3_e8_r, trs80m3_e8_w) |
| 250 | | AM_RANGE(0xe9, 0xe9) AM_READ_PORT("E9") AM_WRITE(trs80m3_e9_w) |
| 251 | | AM_RANGE(0xea, 0xea) AM_READWRITE(trs80m3_ea_r, trs80m3_ea_w) |
| 252 | | AM_RANGE(0xeb, 0xeb) AM_READWRITE(trs80m3_eb_r, trs80m3_eb_w) |
| 253 | | // AM_RANGE(0xec, 0xec) AM_WRITENOP |
| 198 | AM_RANGE(0x84, 0x87) AM_WRITE(trs80m4_84_w) |
| 199 | AM_RANGE(0x90, 0x93) AM_WRITE(trs80m4_90_w) |
| 200 | AM_RANGE(0xe0, 0xe3) AM_READWRITE(trs80m4_e0_r, trs80m4_e0_w) |
| 201 | // AM_RANGE(0xe4, 0xe4) AM_READWRITE(SMH_NOP,SMH_NOP) // read nmi status, write nmi mask |
| 202 | AM_RANGE(0xe8, 0xe8) AM_READWRITE(trs80m4_e8_r, trs80m4_e8_w) |
| 203 | AM_RANGE(0xe9, 0xe9) AM_READ_PORT("E9") AM_WRITE(trs80m4_e9_w) |
| 204 | AM_RANGE(0xea, 0xea) AM_READWRITE(trs80m4_ea_r, trs80m4_ea_w) |
| 205 | AM_RANGE(0xeb, 0xeb) AM_READWRITE(trs80m4_eb_r, trs80m4_eb_w) |
| 206 | AM_RANGE(0xec, 0xef) AM_READWRITE(trs80m4_ec_r, trs80m4_ec_w) |
| 254 | 207 | AM_RANGE(0xf0, 0xf0) AM_DEVREADWRITE("wd179x", trs80_wd179x_r, wd17xx_command_w) |
| 255 | 208 | AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("wd179x", wd17xx_track_r, wd17xx_track_w) |
| 256 | 209 | AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("wd179x", wd17xx_sector_r, wd17xx_sector_w) |
| 257 | 210 | AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("wd179x", wd17xx_data_r, wd17xx_data_w) |
| 258 | | // AM_RANGE(0xf4, 0xf4) AM_WRITENOP |
| 259 | | AM_RANGE(0xf8, 0xf8) AM_READWRITE(trs80_printer_r, trs80_printer_w) |
| 260 | | AM_RANGE(0xff, 0xff) AM_READWRITE(trs80_ff_r, trs80_ff_w) |
| 211 | AM_RANGE(0xf4, 0xf4) AM_WRITE(trs80_motor_w) |
| 212 | AM_RANGE(0xf8, 0xfb) AM_READWRITE(trs80_printer_r, trs80_printer_w) |
| 213 | AM_RANGE(0xfc, 0xff) AM_READWRITE(trs80m4_ff_r, trs80m4_ff_w) |
| 261 | 214 | ADDRESS_MAP_END |
| 262 | 215 | |
| 263 | 216 | |
| r4435 | r4436 | |
| 470 | 423 | static GFXDECODE_START( ht1080z ) |
| 471 | 424 | GFXDECODE_ENTRY( "gfx1", 0, ht1080z_charlayout, 0, 1 ) |
| 472 | 425 | GFXDECODE_END |
| 473 | | |
| 426 | #if 0 |
| 474 | 427 | static const INT16 speaker_levels[3] = {0.0*32767,0.46*32767,0.85*32767}; |
| 475 | 428 | |
| 476 | 429 | static const speaker_interface trs80_speaker_interface = |
| r4435 | r4436 | |
| 478 | 431 | 3, /* optional: number of different levels */ |
| 479 | 432 | speaker_levels /* optional: level lookup table */ |
| 480 | 433 | }; |
| 481 | | |
| 434 | #endif |
| 482 | 435 | static const cassette_config trs80l2_cassette_config = |
| 483 | 436 | { |
| 484 | 437 | trs80l2_cassette_formats, |
| r4435 | r4436 | |
| 496 | 449 | NULL |
| 497 | 450 | }; |
| 498 | 451 | |
| 499 | | static MACHINE_DRIVER_START( trs80 ) |
| 452 | static MACHINE_DRIVER_START( trs80 ) // the original model I, level I, with no extras |
| 500 | 453 | /* basic machine hardware */ |
| 501 | 454 | MDRV_CPU_ADD("maincpu", Z80, 1796000) /* 1.796 MHz */ |
| 502 | 455 | MDRV_CPU_PROGRAM_MAP(trs80_map, 0) |
| 503 | 456 | MDRV_CPU_IO_MAP(trs80_io, 0) |
| 504 | | MDRV_CPU_VBLANK_INT("screen", trs80_frame_interrupt) |
| 505 | | MDRV_CPU_PERIODIC_INT(trs80_timer_interrupt, 40) |
| 506 | 457 | |
| 507 | 458 | MDRV_MACHINE_RESET( trs80 ) |
| 508 | 459 | |
| r4435 | r4436 | |
| 522 | 473 | /* sound hardware */ |
| 523 | 474 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 524 | 475 | MDRV_SOUND_ADD("speaker", SPEAKER, 0) |
| 525 | | MDRV_SOUND_CONFIG(trs80_speaker_interface) |
| 476 | // MDRV_SOUND_CONFIG(trs80_speaker_interface) |
| 526 | 477 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 527 | 478 | MDRV_SOUND_WAVE_ADD("wave", "cassette") |
| 528 | 479 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| r4435 | r4436 | |
| 531 | 482 | MDRV_CASSETTE_ADD( "cassette", default_cassette_config ) |
| 532 | 483 | MACHINE_DRIVER_END |
| 533 | 484 | |
| 534 | | static MACHINE_DRIVER_START( model1 ) |
| 485 | static MACHINE_DRIVER_START( model1 ) // model I, level II |
| 535 | 486 | MDRV_IMPORT_FROM( trs80 ) |
| 536 | 487 | MDRV_CPU_MODIFY( "maincpu" ) |
| 537 | 488 | MDRV_CPU_PROGRAM_MAP( model1_map, 0 ) |
| r4435 | r4436 | |
| 551 | 502 | MDRV_CPU_MODIFY( "maincpu" ) |
| 552 | 503 | MDRV_CPU_PROGRAM_MAP( model3_map, 0 ) |
| 553 | 504 | MDRV_CPU_IO_MAP( model3_io, 0 ) |
| 554 | | MDRV_CPU_VBLANK_INT_HACK(trs80_frame_interrupt, 2) |
| 505 | // MDRV_CPU_VBLANK_INT_HACK(trs80_frame_interrupt, 2) |
| 506 | MDRV_CPU_PERIODIC_INT(trs80m4_rtc_interrupt, 60) |
| 555 | 507 | MACHINE_DRIVER_END |
| 556 | 508 | |
| 557 | 509 | static MACHINE_DRIVER_START( sys80 ) |