Previous 15994 Revisions Next

r10176 Monday 24th January, 2011 at 03:59:19 UTC by Robbbert
[SOL20] Hooked up all the dips except for cursor type. Fixed defaults for dips.
[src/mess/drivers]ptcsol.c

src/mess/drivers/ptcsol.c
r10175r10176
105105   UINT8 m_sol20_fa;
106106   UINT8 m_sol20_fc;
107107   UINT8 m_sol20_fe;
108   UINT8 m_s4;
108109   const UINT8 *FNT;
109110   const UINT8 *m_videoram;
110111   UINT8 m_framecnt;
r10175r10176
321322   PORT_DIPSETTING(    0x30, DEF_STR(None))
322323
323324   PORT_START("S2") // Sense Switches
324   PORT_DIPNAME( 0x01, 0x00, "FF bit 0")
325   PORT_DIPNAME( 0x01, 0x01, "FF bit 0")
325326   PORT_DIPSETTING(    0x01, DEF_STR(Off))
326327   PORT_DIPSETTING(    0x00, DEF_STR(On))
327   PORT_DIPNAME( 0x02, 0x00, "FF bit 1")
328   PORT_DIPNAME( 0x02, 0x02, "FF bit 1")
328329   PORT_DIPSETTING(    0x02, DEF_STR(Off))
329330   PORT_DIPSETTING(    0x00, DEF_STR(On))
330   PORT_DIPNAME( 0x04, 0x00, "FF bit 2")
331   PORT_DIPNAME( 0x04, 0x04, "FF bit 2")
331332   PORT_DIPSETTING(    0x04, DEF_STR(Off))
332333   PORT_DIPSETTING(    0x00, DEF_STR(On))
333   PORT_DIPNAME( 0x08, 0x00, "FF bit 3")
334   PORT_DIPNAME( 0x08, 0x08, "FF bit 3")
334335   PORT_DIPSETTING(    0x08, DEF_STR(Off))
335336   PORT_DIPSETTING(    0x00, DEF_STR(On))
336   PORT_DIPNAME( 0x10, 0x00, "FF bit 4")
337   PORT_DIPNAME( 0x10, 0x10, "FF bit 4")
337338   PORT_DIPSETTING(    0x10, DEF_STR(Off))
338339   PORT_DIPSETTING(    0x00, DEF_STR(On))
339   PORT_DIPNAME( 0x20, 0x00, "FF bit 5")
340   PORT_DIPNAME( 0x20, 0x20, "FF bit 5")
340341   PORT_DIPSETTING(    0x20, DEF_STR(Off))
341342   PORT_DIPSETTING(    0x00, DEF_STR(On))
342   PORT_DIPNAME( 0x40, 0x00, "FF bit 6")
343   PORT_DIPNAME( 0x40, 0x40, "FF bit 6")
343344   PORT_DIPSETTING(    0x40, DEF_STR(Off))
344345   PORT_DIPSETTING(    0x00, DEF_STR(On))
345   PORT_DIPNAME( 0x80, 0x00, "FF bit 7")
346   PORT_DIPNAME( 0x80, 0x80, "FF bit 7")
346347   PORT_DIPSETTING(    0x80, DEF_STR(Off))
347348   PORT_DIPSETTING(    0x00, DEF_STR(On))
348349
349350   PORT_START("S3")
350351   PORT_DIPNAME( 0xff, 0x08, "Baud Rate")
351   PORT_DIPSETTING(    0x01, "110")
352   PORT_DIPSETTING(    0x02, "150")
352   PORT_DIPSETTING(    0x01, "75")
353   PORT_DIPSETTING(    0x02, "110")
353354   PORT_DIPSETTING(    0x04, "180")
354355   PORT_DIPSETTING(    0x08, "300")
355356   PORT_DIPSETTING(    0x10, "600")
r10175r10176
362363   PORT_DIPSETTING(    0x00, DEF_STR(None))
363364   PORT_DIPSETTING(    0x10, "Odd")
364365   PORT_DIPSETTING(    0x11, "Even")
365   PORT_DIPNAME( 0x06, 0x00, "Data Bits")
366   PORT_DIPNAME( 0x06, 0x06, "Data Bits")
366367   PORT_DIPSETTING(    0x00, "5")
367368   PORT_DIPSETTING(    0x02, "6")
368369   PORT_DIPSETTING(    0x04, "7")
369370   PORT_DIPSETTING(    0x06, "8")
370   PORT_DIPNAME( 0x08, 0x00, "Stop Bits")
371   PORT_DIPNAME( 0x08, 0x08, "Stop Bits")
371372   PORT_DIPSETTING(    0x00, "1")
372373   PORT_DIPSETTING(    0x08, "2")
373374   PORT_DIPNAME( 0x20, 0x00, "Duplex")
r10175r10176
416417static MACHINE_RESET( sol20 )
417418{
418419   sol20_state *state = machine->driver_data<sol20_state>();
420   UINT8 data = 0, s_count = 0;
421   int s_clock;
422   const UINT16 s_bauds[8]={ 75, 110, 180, 300, 600, 1200, 2400, 4800 };
419423   state->m_sol20_fe=0;
420424   state->m_sol20_fa=1;
425
421426   // set hard-wired uart pins
422427   ay31015_set_input_pin( state->m_uart, AY31015_CS, 0 );
423428   ay31015_set_input_pin( state->m_uart, AY31015_NB1, 1);
r10175r10176
426431   ay31015_set_input_pin( state->m_uart, AY31015_EPS, 1);
427432   ay31015_set_input_pin( state->m_uart, AY31015_NP,  1);
428433   ay31015_set_input_pin( state->m_uart, AY31015_CS, 1 );
434
435   // set switched uart pins
436   data = input_port_read(machine, "S4");
437   ay31015_set_input_pin( state->m_uart_s, AY31015_CS, 0 );
438   ay31015_set_input_pin( state->m_uart_s, AY31015_NB1, BIT(data, 1) ? 1 : 0);
439   ay31015_set_input_pin( state->m_uart_s, AY31015_NB2, BIT(data, 2) ? 1 : 0);
440   ay31015_set_input_pin( state->m_uart_s, AY31015_TSB, BIT(data, 3) ? 1 : 0);
441   ay31015_set_input_pin( state->m_uart_s, AY31015_EPS, BIT(data, 0) ? 1 : 0);
442   ay31015_set_input_pin( state->m_uart_s, AY31015_NP, BIT(data, 4) ? 1 : 0);
443   ay31015_set_input_pin( state->m_uart_s, AY31015_CS, 1 );
444
445   // set rs232 baud rate
446   data = input_port_read(machine, "S3");
447
448   if (data > 1)
449      do
450      {
451         s_count++;
452         data >>= 1;
453      }
454      while (!(data & 1) && (s_count < 7)); // find which switch is used
455
456   if ((s_count == 7) && (input_port_read(machine, "CONFIG"))) // if highest, look at jumper
457      s_clock = 9600 << 4;
458   else
459      s_clock = s_bauds[s_count] << 4;
460
461   // these lines could be commented out for now if you want better performance
462   ay31015_set_receiver_clock( state->m_uart_s, s_clock);
463   ay31015_set_transmitter_clock( state->m_uart_s, s_clock);
464
465   // video dips
466   state->m_s4 = input_port_read(machine, "S1");
467
429468   // boot-bank
430469   memory_set_bank(machine, "boot", 1);
431470   timer_set(machine, ATTOTIME_IN_USEC(9), NULL, 0, sol20_boot);
r10175r10176
449488/* visible screen is 64 x 16, with start position controlled by scroll register */
450489   UINT8 y,ra,chr,gfx;
451490   UINT16 sy=0,ma,x,inv;
491   UINT8 ctrl_off = state->m_s4 & 4;
492   UINT8 polarity = (state->m_s4 & 8) ? 0xff : 0;
452493
453494   state->m_framecnt++;
454495
r10175r10176
462503
463504         for (x = ma; x < ma + 64; x++)
464505         {
506            inv = polarity;
465507            chr = state->m_videoram[x & 0x3ff];
466            inv = 0;
467508
468509            /* Take care of flashing characters */
469510            //if ((chr & 0x80) && (state->m_framecnt & 0x08))
r10175r10176
472513
473514            chr &= 0x7f;
474515
475            if (ra == 0)
476               gfx = 0;
516            if ((ra == 0) || ((ctrl_off) && (chr < 0x20)))
517               gfx = inv;
477518            else
478519            if (ra < 10)
479520               gfx = state->FNT[(chr<<4) | (ra-1) ] ^ inv;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team