src/mess/drivers/ptcsol.c
| r10179 | r10180 | |
| 50 | 50 | - Some circuits are completely different... the video and keyboard are |
| 51 | 51 | notable examples, while the addresses of ram and bios on the basic |
| 52 | 52 | machines is another major difference. |
| 53 | |
| 54 | ToDo: |
| 55 | - connect up half/full duplex dipswitch function |
| 56 | - connect up the remaining functions of port FE |
| 57 | - keyboard (using terminal keyboard for now) |
| 58 | - optional floppy disk support and CP/M |
| 59 | - parallel i/o and handshake lines |
| 60 | - connect serial i/o to something |
| 61 | - support for loading the various file formats |
| 62 | |
| 63 | File Formats: |
| 64 | - Most files are simple ascii which can be loaded via the Paste handler. |
| 65 | These are ASC, ENT, BAS, ROM, BS5 and ECB. Most files require that the |
| 66 | correct version of BASIC be loaded first. Paste works, but it is very |
| 67 | very slow, and has a noticeable buffer limitation. Perhaps we need |
| 68 | something faster such as what Solace has. |
| 69 | - SVT (Solace Virtual Tape) files are a representation of a cassette, |
| 70 | usually holding about 4 games, just like a multifile tape. It will |
| 71 | need a 'format' program to be written to convert it to be loadable |
| 72 | via the cassette device. |
| 73 | - HEX files appear to be the standard Intel format, and can be loaded |
| 74 | by Solace. |
| 75 | - The remaining formats (OPN, PL, PRN, SMU, SOL, ASM and LIB) appear |
| 76 | at first glance to be more specialised, and probably not worth being |
| 77 | supported. |
| 53 | 78 | ****************************************************************************/ |
| 54 | 79 | #define ADDRESS_MAP_MODERN |
| 55 | 80 | |
| r10179 | r10180 | |
| 92 | 117 | required_device<device_t> m_uart; |
| 93 | 118 | required_device<device_t> m_uart_s; |
| 94 | 119 | required_device<device_t> m_terminal; |
| 120 | DECLARE_READ8_MEMBER( sol20_f8_r ); |
| 95 | 121 | DECLARE_READ8_MEMBER( sol20_f9_r ); |
| 96 | 122 | DECLARE_READ8_MEMBER( sol20_fa_r ); |
| 97 | 123 | DECLARE_READ8_MEMBER( sol20_fb_r ); |
| 98 | 124 | DECLARE_READ8_MEMBER( sol20_fc_r ); |
| 125 | DECLARE_READ8_MEMBER( sol20_fd_r ); |
| 126 | DECLARE_WRITE8_MEMBER( sol20_f8_w ); |
| 99 | 127 | DECLARE_WRITE8_MEMBER( sol20_f9_w ); |
| 100 | 128 | DECLARE_WRITE8_MEMBER( sol20_fa_w ); |
| 101 | 129 | DECLARE_WRITE8_MEMBER( sol20_fb_w ); |
| 130 | DECLARE_WRITE8_MEMBER( sol20_fd_w ); |
| 102 | 131 | DECLARE_WRITE8_MEMBER( sol20_fe_w ); |
| 103 | 132 | DECLARE_WRITE8_MEMBER( sol20_kbd_put ); |
| 104 | 133 | UINT8 m_sol20_fa; |
| r10179 | r10180 | |
| 215 | 244 | } |
| 216 | 245 | } |
| 217 | 246 | |
| 247 | READ8_MEMBER( sol20_state::sol20_f8_r ) |
| 248 | { |
| 249 | // d7 - TMBT; d6 - DAV; d5 - CTS; d4 - OE; d3 - PE; d2 - FE; d1 - DSR; d0 - CD |
| 250 | /* set unemulated bits (CTS/DSR/CD) high */ |
| 251 | UINT8 data = 0x23; |
| 252 | |
| 253 | ay31015_set_input_pin( m_uart_s, AY31015_SWE, 0 ); |
| 254 | data |= ay31015_get_output_pin( m_uart_s, AY31015_TBMT ) ? 0x80 : 0; |
| 255 | data |= ay31015_get_output_pin( m_uart_s, AY31015_DAV ) ? 0x40 : 0; |
| 256 | data |= ay31015_get_output_pin( m_uart_s, AY31015_OR ) ? 0x10 : 0; |
| 257 | data |= ay31015_get_output_pin( m_uart_s, AY31015_PE ) ? 0x08 : 0; |
| 258 | data |= ay31015_get_output_pin( m_uart_s, AY31015_FE ) ? 0x04 : 0; |
| 259 | ay31015_set_input_pin( m_uart_s, AY31015_SWE, 1 ); |
| 260 | |
| 261 | return data; |
| 262 | } |
| 263 | |
| 218 | 264 | READ8_MEMBER( sol20_state::sol20_f9_r) |
| 219 | 265 | { |
| 220 | 266 | UINT8 data = ay31015_get_received_data( m_uart_s ); |
| r10179 | r10180 | |
| 252 | 298 | return m_sol20_fc; |
| 253 | 299 | } |
| 254 | 300 | |
| 301 | READ8_MEMBER( sol20_state::sol20_fd_r ) |
| 302 | { |
| 303 | // Return a byte from parallel interface |
| 304 | return 0; |
| 305 | } |
| 306 | |
| 307 | WRITE8_MEMBER( sol20_state::sol20_f8_w ) |
| 308 | { |
| 309 | // The only function seems to be to send RTS from bit 4 |
| 310 | } |
| 311 | |
| 255 | 312 | WRITE8_MEMBER( sol20_state::sol20_f9_w ) |
| 256 | 313 | { |
| 257 | 314 | ay31015_set_transmit_data( m_uart_s, data ); |
| r10179 | r10180 | |
| 285 | 342 | ay31015_set_transmit_data( m_uart, data ); |
| 286 | 343 | } |
| 287 | 344 | |
| 345 | WRITE8_MEMBER( sol20_state::sol20_fd_w ) |
| 346 | { |
| 347 | // Output a byte to parallel interface |
| 348 | } |
| 349 | |
| 288 | 350 | WRITE8_MEMBER( sol20_state::sol20_fe_w ) |
| 289 | 351 | { |
| 290 | 352 | m_sol20_fe = data; |
| r10179 | r10180 | |
| 302 | 364 | static ADDRESS_MAP_START( sol20_io , ADDRESS_SPACE_IO, 8, sol20_state) |
| 303 | 365 | ADDRESS_MAP_UNMAP_HIGH |
| 304 | 366 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 367 | AM_RANGE(0xf8, 0xf8) AM_READWRITE(sol20_f8_r,sol20_f8_w) |
| 305 | 368 | AM_RANGE(0xf9, 0xf9) AM_READWRITE(sol20_f9_r,sol20_f9_w) |
| 306 | 369 | AM_RANGE(0xfa, 0xfa) AM_READWRITE(sol20_fa_r,sol20_fa_w) |
| 307 | 370 | AM_RANGE(0xfb, 0xfb) AM_READWRITE(sol20_fb_r,sol20_fb_w) |
| 308 | 371 | AM_RANGE(0xfc, 0xfc) AM_READ(sol20_fc_r) |
| 372 | AM_RANGE(0xfd, 0xfd) AM_READWRITE(sol20_fd_r,sol20_fd_w) |
| 309 | 373 | AM_RANGE(0xfe, 0xfe) AM_WRITE(sol20_fe_w) |
| 310 | 374 | AM_RANGE(0xff, 0xff) AM_READ_PORT("S2") |
| 311 | 375 | /* AM_RANGE(0xf8, 0xf8) serial status in (bit 6=data av, bit 7=tmbe) |
| r10179 | r10180 | |
| 320 | 384 | |
| 321 | 385 | /* Input ports */ |
| 322 | 386 | static INPUT_PORTS_START( sol20 ) |
| 323 | | PORT_START("S1") // these switches need to be checked for correct polarity |
| 387 | PORT_START("S1") |
| 324 | 388 | PORT_DIPNAME( 0x04, 0x00, "Ctrl Chars") |
| 325 | 389 | PORT_DIPSETTING( 0x04, DEF_STR(Off)) |
| 326 | 390 | PORT_DIPSETTING( 0x00, DEF_STR(On)) |
| r10179 | r10180 | |
| 369 | 433 | PORT_DIPSETTING( 0x40, "2400") |
| 370 | 434 | PORT_DIPSETTING( 0x80, "4800/9600") |
| 371 | 435 | |
| 372 | | PORT_START("S4") // these switches need to be checked for correct polarity |
| 436 | PORT_START("S4") |
| 373 | 437 | PORT_DIPNAME( 0x11, 0x10, "Parity") |
| 374 | 438 | PORT_DIPSETTING( 0x00, "Even") |
| 375 | 439 | PORT_DIPSETTING( 0x01, "Odd") |
| r10179 | r10180 | |
| 493 | 557 | static VIDEO_UPDATE( sol20 ) |
| 494 | 558 | { |
| 495 | 559 | // Visible screen is 64 x 16, with start position controlled by scroll register. |
| 560 | // Each character is 9 pixels wide (blank ones at the right) and 13 lines deep. |
| 496 | 561 | // Note on blinking characters: |
| 497 | 562 | // any character with bit 7 set will blink. With DPMON, do DA C000 C2FF to see what happens |
| 498 | | UINT8 s1 = input_port_read(machine, "S1"); |
| 563 | UINT8 s1 = input_port_read(screen->machine, "S1"); |
| 499 | 564 | sol20_state *state = screen->machine->driver_data<sol20_state>(); |
| 500 | 565 | UINT8 y,ra,chr,gfx; |
| 501 | 566 | UINT16 sy=0,ma,x,inv; |
| 502 | 567 | UINT8 polarity = (s1 & 8) ? 0xff : 0; |
| 503 | 568 | |
| 504 | 569 | UINT8 cursor_inv = FALSE; |
| 505 | | if ((s1 == 0x20) || ((s1 == 0x10) && (state->m_framecnt & 0x08))) |
| 570 | if (((s1 & 0x30) == 0x20) || (((s1 & 0x30) == 0x10) && (state->m_framecnt & 0x08))) |
| 506 | 571 | cursor_inv = TRUE; |
| 507 | 572 | |
| 508 | 573 | state->m_framecnt++; |
| r10179 | r10180 | |
| 543 | 608 | *p++ = ( gfx & 0x04 ) ? 1 : 0; |
| 544 | 609 | *p++ = ( gfx & 0x02 ) ? 1 : 0; |
| 545 | 610 | *p++ = ( gfx & 0x01 ) ? 1 : 0; |
| 611 | *p++ = (inv) ? 1 : 0; |
| 546 | 612 | } |
| 547 | 613 | } |
| 548 | 614 | ma+=64; |
| r10179 | r10180 | |
| 575 | 641 | MCFG_SCREEN_REFRESH_RATE(50) |
| 576 | 642 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 577 | 643 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 578 | | MCFG_SCREEN_SIZE(512, 208) |
| 579 | | MCFG_SCREEN_VISIBLE_AREA(0, 511, 0, 207) |
| 644 | MCFG_SCREEN_SIZE(576, 208) |
| 645 | MCFG_SCREEN_VISIBLE_AREA(0, 575, 0, 207) |
| 580 | 646 | MCFG_PALETTE_LENGTH(2) |
| 581 | 647 | MCFG_PALETTE_INIT(black_and_white) |
| 582 | 648 | |