Previous 15994 Revisions Next

r10180 Monday 24th January, 2011 at 13:05:48 UTC by Robbbert
[SOL20] Hooked up more ports. Fixed some video bugs.
[src/mess/drivers]ptcsol.c

src/mess/drivers/ptcsol.c
r10179r10180
5050      - Some circuits are completely different... the video and keyboard are
5151        notable examples, while the addresses of ram and bios on the basic
5252        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.
5378****************************************************************************/
5479#define ADDRESS_MAP_MODERN
5580
r10179r10180
92117   required_device<device_t> m_uart;
93118   required_device<device_t> m_uart_s;
94119   required_device<device_t> m_terminal;
120   DECLARE_READ8_MEMBER( sol20_f8_r );
95121   DECLARE_READ8_MEMBER( sol20_f9_r );
96122   DECLARE_READ8_MEMBER( sol20_fa_r );
97123   DECLARE_READ8_MEMBER( sol20_fb_r );
98124   DECLARE_READ8_MEMBER( sol20_fc_r );
125   DECLARE_READ8_MEMBER( sol20_fd_r );
126   DECLARE_WRITE8_MEMBER( sol20_f8_w );
99127   DECLARE_WRITE8_MEMBER( sol20_f9_w );
100128   DECLARE_WRITE8_MEMBER( sol20_fa_w );
101129   DECLARE_WRITE8_MEMBER( sol20_fb_w );
130   DECLARE_WRITE8_MEMBER( sol20_fd_w );
102131   DECLARE_WRITE8_MEMBER( sol20_fe_w );
103132   DECLARE_WRITE8_MEMBER( sol20_kbd_put );
104133   UINT8 m_sol20_fa;
r10179r10180
215244   }
216245}
217246
247READ8_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
218264READ8_MEMBER( sol20_state::sol20_f9_r)
219265{
220266   UINT8 data = ay31015_get_received_data( m_uart_s );
r10179r10180
252298   return m_sol20_fc;
253299}
254300
301READ8_MEMBER( sol20_state::sol20_fd_r )
302{
303// Return a byte from parallel interface
304   return 0;
305}
306
307WRITE8_MEMBER( sol20_state::sol20_f8_w )
308{
309// The only function seems to be to send RTS from bit 4
310}
311
255312WRITE8_MEMBER( sol20_state::sol20_f9_w )
256313{
257314   ay31015_set_transmit_data( m_uart_s, data );
r10179r10180
285342   ay31015_set_transmit_data( m_uart, data );
286343}
287344
345WRITE8_MEMBER( sol20_state::sol20_fd_w )
346{
347// Output a byte to parallel interface
348}
349
288350WRITE8_MEMBER( sol20_state::sol20_fe_w )
289351{
290352   m_sol20_fe = data;
r10179r10180
302364static ADDRESS_MAP_START( sol20_io , ADDRESS_SPACE_IO, 8, sol20_state)
303365   ADDRESS_MAP_UNMAP_HIGH
304366   ADDRESS_MAP_GLOBAL_MASK(0xff)
367   AM_RANGE(0xf8, 0xf8) AM_READWRITE(sol20_f8_r,sol20_f8_w)
305368   AM_RANGE(0xf9, 0xf9) AM_READWRITE(sol20_f9_r,sol20_f9_w)
306369   AM_RANGE(0xfa, 0xfa) AM_READWRITE(sol20_fa_r,sol20_fa_w)
307370   AM_RANGE(0xfb, 0xfb) AM_READWRITE(sol20_fb_r,sol20_fb_w)
308371   AM_RANGE(0xfc, 0xfc) AM_READ(sol20_fc_r)
372   AM_RANGE(0xfd, 0xfd) AM_READWRITE(sol20_fd_r,sol20_fd_w)
309373   AM_RANGE(0xfe, 0xfe) AM_WRITE(sol20_fe_w)
310374   AM_RANGE(0xff, 0xff) AM_READ_PORT("S2")
311375/*  AM_RANGE(0xf8, 0xf8) serial status in (bit 6=data av, bit 7=tmbe)
r10179r10180
320384
321385/* Input ports */
322386static INPUT_PORTS_START( sol20 )
323   PORT_START("S1") // these switches need to be checked for correct polarity
387   PORT_START("S1")
324388   PORT_DIPNAME( 0x04, 0x00, "Ctrl Chars")
325389   PORT_DIPSETTING(    0x04, DEF_STR(Off))
326390   PORT_DIPSETTING(    0x00, DEF_STR(On))
r10179r10180
369433   PORT_DIPSETTING(    0x40, "2400")
370434   PORT_DIPSETTING(    0x80, "4800/9600")
371435
372   PORT_START("S4") // these switches need to be checked for correct polarity
436   PORT_START("S4")
373437   PORT_DIPNAME( 0x11, 0x10, "Parity")
374438   PORT_DIPSETTING(    0x00, "Even")
375439   PORT_DIPSETTING(    0x01, "Odd")
r10179r10180
493557static VIDEO_UPDATE( sol20 )
494558{
495559// 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.
496561// Note on blinking characters:
497562// 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");
499564   sol20_state *state = screen->machine->driver_data<sol20_state>();
500565   UINT8 y,ra,chr,gfx;
501566   UINT16 sy=0,ma,x,inv;
502567   UINT8 polarity = (s1 & 8) ? 0xff : 0;
503568
504569   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)))
506571      cursor_inv = TRUE;
507572
508573   state->m_framecnt++;
r10179r10180
543608            *p++ = ( gfx & 0x04 ) ? 1 : 0;
544609            *p++ = ( gfx & 0x02 ) ? 1 : 0;
545610            *p++ = ( gfx & 0x01 ) ? 1 : 0;
611            *p++ = (inv) ? 1 : 0;
546612         }
547613      }
548614      ma+=64;
r10179r10180
575641   MCFG_SCREEN_REFRESH_RATE(50)
576642   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
577643   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)
580646   MCFG_PALETTE_LENGTH(2)
581647   MCFG_PALETTE_INIT(black_and_white)
582648

Previous 15994 Revisions Next


© 1998-2018 The MESS Team