Previous 199869 Revisions Next

r30676 Monday 26th May, 2014 at 15:51:55 UTC by Dirk Best
Amiga: Add proper RS-232 port emulation.
[src/mame]mame.mak
[src/mame/drivers]alg.c cubo.c
[src/mame/includes]amiga.h
[src/mame/machine]amiga.c
[src/mess/drivers]amiga.c

trunk/src/mame/drivers/cubo.c
r30675r30676
328328   m_cdda(*this, "cdda")
329329   { }
330330
331   DECLARE_WRITE8_MEMBER(microtouch_tx);
332
333331   DECLARE_CUSTOM_INPUT_MEMBER(cubo_input);
334332   DECLARE_CUSTOM_INPUT_MEMBER(cd32_sel_mirror_input);
335333
r30675r30676
353351   UINT16 m_potgo_value;
354352
355353protected:
356   virtual void serdat_w(UINT16 data);
354   virtual void rs232_tx(int state);
357355   virtual void potgo_w(UINT16 data);
358356
359357private:
360   required_device<microtouch_device> m_microtouch;
358   required_device<microtouch_serial_device> m_microtouch;
361359   required_device<cdda_device> m_cdda;
362360
363361   typedef void (cubo_state::*input_hack_func)();
r30675r30676
430428 *
431429 *************************************/
432430
431void cubo_state::rs232_tx(int state)
432{
433   m_microtouch->rx_w(state);
434}
435
433436void cubo_state::potgo_w(UINT16 data)
434437{
435438   int i;
r30675r30676
10701073   MCFG_DEVICE_ADD("cia_1", MOS8520, amiga_state::CLK_E_PAL)
10711074   MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(amiga_state, cia_1_irq))
10721075
1073   MCFG_MICROTOUCH_ADD("microtouch", WRITE8(cubo_state, microtouch_tx))
1076   MCFG_MICROTOUCH_SERIAL_ADD("microtouch", 9600, WRITELINE(cubo_state, rs232_rx_w))
10741077
10751078   MCFG_CDROM_ADD("cd32_cdrom")
10761079   MCFG_CDROM_INTERFACE("cd32_cdrom")
r30675r30676
13421345INPUT_PORTS_END
13431346
13441347
1345void cubo_state::serdat_w(UINT16 data)
1346{
1347   data &= 0xff;
1348   if (data)
1349      m_microtouch->rx(generic_space(), 0, data);
1350}
13511348
1352WRITE8_MEMBER( cubo_state::microtouch_tx )
1353{
1354   serial_in_w(data);
1355}
1356
1357
1358
13591349GAME( 1993, cubo,     0,    cubo, cubo,     cubo_state, cubo,     ROT0, "Commodore",  "Cubo BIOS",                 GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_IS_BIOS_ROOT )
13601350GAME( 1995, cndypuzl, cubo, cubo, cndypuzl, cubo_state, cndypuzl, ROT0, "CD Express", "Candy Puzzle (v1.0)",       GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
13611351GAME( 1995, haremchl, cubo, cubo, haremchl, cubo_state, haremchl, ROT0, "CD Express", "Harem Challenge",           GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
trunk/src/mame/drivers/alg.c
r30675r30676
5353   TIMER_CALLBACK_MEMBER(response_timer);
5454
5555protected:
56   // driver_device overrides
57   virtual void machine_start();
58
5956   // amiga_state overrides
60   virtual void vblank();
61   virtual void serdat_w(UINT16 data);
6257   virtual void potgo_w(UINT16 data);
6358
6459private:
6560   required_device<sony_ldp1450_device> m_laserdisc;
6661
67   emu_timer *m_serial_timer;
68   UINT8 m_serial_timer_active;
69
7062   UINT16 m_input_select;
7163};
7264
r30675r30676
9789
9890
9991
92
10093/*************************************
10194 *
10295 *  Video startup
r30675r30676
115108
116109
117110
118/*************************************
119 *
120 *  Machine start/reset
121 *
122 *************************************/
123111
124void alg_state::machine_start()
125{
126   amiga_state::machine_start();
127
128   m_serial_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(alg_state::response_timer),this));
129   m_serial_timer_active = FALSE;
130}
131
132
133
134112/*************************************
135113 *
136 *  Laserdisc communication
137 *
138 *************************************/
139
140TIMER_CALLBACK_MEMBER(alg_state::response_timer)
141{
142   /* if we still have data to send, do it now */
143   if (m_laserdisc->data_available_r() == ASSERT_LINE)
144   {
145      UINT8 data = m_laserdisc->data_r();
146      if (data != 0x0a)
147         osd_printf_debug("Sending serial data = %02X\n", data);
148      serial_in_w(data);
149   }
150
151   /* if there's more to come, set another timer */
152   if (m_laserdisc->data_available_r() == ASSERT_LINE)
153      m_serial_timer->adjust(serial_char_period());
154   else
155      m_serial_timer_active = FALSE;
156}
157
158
159void alg_state::vblank()
160{
161   amiga_state::vblank();
162
163   /* if we have data available, set a timer to read it */
164   if (!m_serial_timer_active && m_laserdisc->data_available_r() == ASSERT_LINE)
165   {
166      m_serial_timer->adjust(serial_char_period());
167      m_serial_timer_active = TRUE;
168   }
169}
170
171
172void alg_state::serdat_w(UINT16 data)
173{
174   /* write to the laserdisc player */
175   m_laserdisc->data_w(data & 0xff);
176
177   /* if we have data available, set a timer to read it */
178   if (!m_serial_timer_active && m_laserdisc->data_available_r() == ASSERT_LINE)
179   {
180      m_serial_timer->adjust(serial_char_period());
181      m_serial_timer_active = TRUE;
182   }
183}
184
185
186
187/*************************************
188 *
189114 *  I/O ports
190115 *
191116 *************************************/
r30675r30676
622547
623548DRIVER_INIT_MEMBER( alg_state, ntsc )
624549{
625   m_agnus_id = AGNUS_HR_NTSC;
550   m_agnus_id = AGNUS_NTSC;
626551   m_denise_id = DENISE;
627552}
628553
629554DRIVER_INIT_MEMBER( alg_state, pal )
630555{
631   m_agnus_id = AGNUS_HR_PAL;
556   m_agnus_id = AGNUS_PAL;
632557   m_denise_id = DENISE;
633558}
634559
trunk/src/mame/machine/amiga.c
r30675r30676
2222#define LOG_CUSTOM  0
2323#define LOG_CIA     0
2424#define LOG_BLITS   0
25#define LOG_SERIAL  1
2526
2627
2728
r30675r30676
239240   // setup the timers
240241   m_irq_timer = timer_alloc(TIMER_AMIGA_IRQ);
241242   m_blitter_timer = timer_alloc(TIMER_AMIGA_BLITTER);
243   m_serial_timer = timer_alloc(TIMER_SERIAL);
242244
243245   // start the scanline timer
244246   timer_set(m_screen->time_until_pos(0), TIMER_SCANLINE);
r30675r30676
290292   case TIMER_AMIGA_BLITTER:
291293      amiga_blitter_proc(ptr, param);
292294      break;
293   case TIMER_FINISH_SERIAL_WRITE:
294      finish_serial_write(ptr, param);
295   case TIMER_SERIAL:
296      serial_shift();
295297      break;
296298   default:
297      assert_always(FALSE, "Unknown id in amiga_state::device_timer");
299      fatalerror("Invalid timer: %d\n", id);
300      break;
298301   }
299302}
300303
r30675r30676
412415
413416UINT16 amiga_state::joy0dat_r()
414417{
418   if (m_input_device == NULL)
419      return m_joy0dat_port->read_safe(0xffff);
420
415421   if (m_input_device->read_safe(0xff) & 0x10)
416422      return m_joy0dat_port->read_safe(0xffff);
417423   else
r30675r30676
420426
421427UINT16 amiga_state::joy1dat_r()
422428{
429   if (m_input_device == NULL)
430      return m_joy1dat_port->read_safe(0xffff);
431
423432   if (m_input_device->read_safe(0xff) & 0x20)
424433      return m_joy1dat_port->read_safe(0xffff);
425434   else
r30675r30676
11301139{
11311140   UINT8 data = 0;
11321141
1133   // centronics
1142   // bit 0 to 2, centronics
11341143   data |= m_centronics_busy << 0;
11351144   data |= m_centronics_perror << 1;
1136   data |= m_centronics_select << 2; // shared with rs232 "ring indicator" (not emulated)
1145   data |= m_centronics_select << 2;
11371146
1138   // bit 3 to 7, serial line (not emulated)
1147   // bit 2 to 7, serial line
1148   data |= m_rs232_ri << 2;
1149   data |= m_rs232_dsr << 3;
1150   data |= m_rs232_cts << 4;
1151   data |= m_rs232_dcd << 5;
11391152
11401153   return data;
11411154}
11421155
1156WRITE8_MEMBER( amiga_state::cia_1_port_a_write )
1157{
1158   if (m_rs232)
1159   {
1160      m_rs232->write_rts(BIT(data, 6));
1161      m_rs232->write_dtr(BIT(data, 7));
1162   }
1163}
1164
11431165WRITE_LINE_MEMBER( amiga_state::cia_1_irq )
11441166{
11451167   if (LOG_CIA)
r30675r30676
11631185   CUSTOM_REG(REG_DDFSTRT) = 0x18;
11641186   CUSTOM_REG(REG_DDFSTOP) = 0xd8;
11651187   CUSTOM_REG(REG_INTENA) = 0x0000;
1166   CUSTOM_REG(REG_SERDATR) = 0x3000;
1188   CUSTOM_REG(REG_SERDATR) = SERDATR_RXD | SERDATR_TSRE | SERDATR_TBE;
11671189   CUSTOM_REG(REG_BEAMCON0) = (m_agnus_id & 0x10) ? 0x0000 : 0x0020;
11681190}
11691191
r30675r30676
11931215         return amiga_gethvpos(*m_screen) & 0xffff;
11941216
11951217      case REG_SERDATR:
1196         CUSTOM_REG(REG_SERDATR) &= ~0x4000;
1197         CUSTOM_REG(REG_SERDATR) |= (CUSTOM_REG(REG_INTREQ) & INTENA_RBF) ? 0x4000 : 0x0000;
1218         if (LOG_SERIAL)
1219            logerror("r SERDATR: %04x\n", CUSTOM_REG(REG_SERDATR));
1220
11981221         return CUSTOM_REG(REG_SERDATR);
11991222
12001223      case REG_JOY0DAT:
r30675r30676
13011324         break;
13021325
13031326      case REG_SERDAT:
1304         serdat_w(data);
1305         CUSTOM_REG(REG_SERDATR) &= ~0x3000;
1306         timer_set(serial_char_period(), TIMER_FINISH_SERIAL_WRITE);
1307         break;
1327         if (LOG_SERIAL)
1328            logerror("w SERDAT: %04x\n", data);
13081329
1330         CUSTOM_REG(REG_SERDAT) = data;
1331
1332         // transmit shift register currently empty?
1333         if (CUSTOM_REG(REG_SERDATR) & SERDATR_TSRE)
1334         {
1335            // transfer new data to shift register
1336            m_tx_shift = CUSTOM_REG(REG_SERDAT);
1337            CUSTOM_REG(REG_SERDAT) = 0;
1338
1339            // and signal transmit buffer empty
1340            CUSTOM_REG(REG_SERDATR) &= ~SERDATR_TSRE;
1341            CUSTOM_REG(REG_SERDATR) |= SERDATR_TBE;
1342            set_interrupt(INTENA_SETCLR | INTENA_TBE);
1343         }
1344         else
1345         {
1346            // transmit buffer now full
1347            CUSTOM_REG(REG_SERDATR) &= ~SERDATR_TBE;
1348         }
1349
1350         return;
1351
1352      case REG_SERPER:
1353         if (LOG_SERIAL)
1354            logerror("w SERPER: %04x\n", data);
1355
1356         CUSTOM_REG(REG_SERPER) = data;
1357         serial_adjust();
1358
1359         return;
1360
13091361      case REG_BLTSIZE:
13101362         CUSTOM_REG(REG_BLTSIZE) = data;
13111363         CUSTOM_REG(REG_BLTSIZV) = (data >> 6) & 0x3ff;
r30675r30676
14181470
14191471      case REG_INTREQ:
14201472         temp = data;
1421         // update serial data line status if appropriate */
1473
1474         // clear receive buffer full?
14221475         if (!(data & INTENA_SETCLR) && (data & INTENA_RBF))
1423            CUSTOM_REG(REG_SERDATR) &= ~INTENA_SETCLR;
1476         {
1477            CUSTOM_REG(REG_SERDATR) &= ~SERDATR_OVRUN;
1478            CUSTOM_REG(REG_SERDATR) &= ~SERDATR_RBF;
1479         }
14241480
1481         // clear transmit buffer empty?
1482         if (!(data & INTENA_SETCLR) && (data & INTENA_TBE))
1483            CUSTOM_REG(REG_SERDATR) |= SERDATR_TBE;
1484
14251485         data = (data & INTENA_SETCLR) ? (CUSTOM_REG(offset) | (data & 0x7fff)) : (CUSTOM_REG(offset) & ~(data & 0x7fff));
14261486         CUSTOM_REG(offset) = data;
14271487
r30675r30676
15191579//  SERIAL
15201580//**************************************************************************
15211581
1522TIMER_CALLBACK_MEMBER( amiga_state::finish_serial_write )
1582void amiga_state::serial_adjust()
15231583{
1524   amiga_state *state = machine().driver_data<amiga_state>();
1584   amiga_state *state = this;
15251585
1526   // mark the transfer buffer empty
1527   CUSTOM_REG(REG_SERDATR) |= 0x3000;
1586   UINT32 divisor = (CUSTOM_REG(REG_SERPER) & 0x7fff) + 1;
1587   UINT32 baud = m_sound->clock() / divisor;
15281588
1529   // signal an interrupt
1530   set_interrupt(INTENA_SETCLR | INTENA_TBE);
1589   m_serial_timer->adjust(attotime::from_hz(baud) / 2, 0, attotime::from_hz(baud));
15311590}
15321591
1533void amiga_state::serial_in_w(UINT16 data)
1592void amiga_state::serial_shift()
15341593{
15351594   amiga_state *state = this;
1536   int mask = (CUSTOM_REG(REG_SERPER) & 0x8000) ? 0x1ff : 0xff;
15371595
1538   // copy the data to the low 8 bits of SERDATR and set RBF
1539   CUSTOM_REG(REG_SERDATR) &= ~0x3ff;
1540   CUSTOM_REG(REG_SERDATR) |= (data & mask) | (mask + 1) | 0x4000;
1596   if (CUSTOM_REG(REG_ADKCON) & ADKCON_UARTBRK)
1597   {
1598      // break active, force low
1599      rs232_tx(0);
1600   }
1601   else
1602   {
1603      // transmit shift register not empty?
1604      if ((CUSTOM_REG(REG_SERDATR) & SERDATR_TSRE) == 0)
1605      {
1606         if (m_tx_state == 0)
1607         {
1608            // transmit start bit
1609            rs232_tx(0);
1610            m_tx_state++;
1611         }
1612         else if (m_tx_state <= 8 + BIT(CUSTOM_REG(REG_SERPER), 15))
1613         {
1614            // send data bits
1615            rs232_tx(m_tx_shift & 1);
1616            m_tx_shift >>= 1;
1617            m_tx_state++;
1618         }
1619         else
1620         {
1621            // send stop bits until we run out
1622            if (m_tx_shift & 1)
1623            {
1624               rs232_tx(m_tx_shift & 1);
1625               m_tx_shift >>= 1;
1626            }
1627            else
1628            {
1629               // more data?
1630               if (CUSTOM_REG(REG_SERDAT))
1631               {
1632                  // transfer to shift register
1633                  m_tx_shift = CUSTOM_REG(REG_SERDAT);
1634                  CUSTOM_REG(REG_SERDAT) = 0;
15411635
1542   // set overrun if we weren't cleared
1543   if (CUSTOM_REG(REG_INTREQ) & INTENA_RBF)
1636                  // signal buffer empty
1637                  CUSTOM_REG(REG_SERDATR) |= SERDATR_TBE;
1638                  set_interrupt(INTENA_SETCLR | INTENA_TBE);
1639               }
1640               else
1641               {
1642                  // we're done
1643                  CUSTOM_REG(REG_SERDATR) |= SERDATR_TSRE;
1644               }
1645
1646               m_tx_state = 0;
1647            }
1648         }
1649      }
1650      else
1651      {
1652         // transmit register empty
1653         rs232_tx(1);
1654      }
1655   }
1656
1657   // waiting for start bit?
1658   if (m_rx_state == 0)
15441659   {
1545      osd_printf_debug("Serial data overflow\n");
1546      CUSTOM_REG(REG_SERDATR) |= 0x8000;
1660      // start bit seen (high to low transition)
1661      if (m_rx_previous && (CUSTOM_REG(REG_SERDATR) & SERDATR_RXD) == 0)
1662      {
1663         m_rx_state++;
1664      }
15471665   }
1666   else if (m_rx_state <= 8 + BIT(CUSTOM_REG(REG_SERPER), 15))
1667   {
1668      // receive data
1669      m_rx_shift >>= 1;
1670      m_rx_shift = (m_rx_shift & 0x7fff) | (BIT(CUSTOM_REG(REG_SERDATR), 11) << 15);
1671      m_rx_state++;
1672   }
1673   else
1674   {
1675      // stop bit
1676      m_rx_shift >>= 1;
1677      m_rx_shift = (m_rx_shift & 0x7fff) | (BIT(CUSTOM_REG(REG_SERDATR), 11) << 15);
15481678
1549   // signal an interrupt
1550   set_interrupt(INTENA_SETCLR | INTENA_RBF);
1679      // shift to start
1680      m_rx_shift >>= (15 - (8 + BIT(CUSTOM_REG(REG_SERPER), 15)));
1681
1682      // save data
1683      CUSTOM_REG(REG_SERDATR) &= ~0x3ff;
1684      CUSTOM_REG(REG_SERDATR) |= m_rx_shift & 0x3ff;
1685
1686      // overrun?
1687      if (CUSTOM_REG(REG_SERDATR) & SERDATR_RBF)
1688         CUSTOM_REG(REG_SERDATR) |= SERDATR_OVRUN;
1689
1690      // set ready and signal interrupt
1691      CUSTOM_REG(REG_SERDATR) |= SERDATR_RBF;
1692      set_interrupt(INTENA_SETCLR | INTENA_RBF);
1693
1694      m_rx_shift = 0;
1695      m_rx_state = 0;
1696   }
15511697}
15521698
1553attotime amiga_state::serial_char_period()
1699void amiga_state::rs232_tx(int state)
15541700{
1555   amiga_state *state = this;
1701   if (m_rs232)
1702      m_rs232->write_txd(state);
1703}
15561704
1557   UINT32 divisor = (CUSTOM_REG(REG_SERPER) & 0x7fff) + 1;
1558   UINT32 baud = m_maincpu->unscaled_clock() / 2 / divisor;
1559   UINT32 numbits = 2 + ((CUSTOM_REG(REG_SERPER) & 0x8000) ? 9 : 8);
1705void amiga_state::rx_write(amiga_state *state, int level)
1706{
1707   m_rx_previous = BIT(CUSTOM_REG(REG_SERDATR), 11);
1708   CUSTOM_REG(REG_SERDATR) &= ~SERDATR_RXD;
1709   CUSTOM_REG(REG_SERDATR) |= level << 11;
1710}
15601711
1561   return attotime::from_hz(baud) * numbits;
1712WRITE_LINE_MEMBER( amiga_state::rs232_rx_w )
1713{
1714   rx_write(this, state);
1715
1716   // start bit received?
1717   if (m_rx_state == 1)
1718      serial_adjust();
15621719}
1720
1721WRITE_LINE_MEMBER( amiga_state::rs232_dcd_w )
1722{
1723   m_rs232_dcd = state;
1724}
1725
1726WRITE_LINE_MEMBER( amiga_state::rs232_dsr_w )
1727{
1728   m_rs232_dsr = state;
1729}
1730
1731WRITE_LINE_MEMBER( amiga_state::rs232_ri_w )
1732{
1733   m_rs232_ri = state;
1734}
1735
1736WRITE_LINE_MEMBER( amiga_state::rs232_cts_w )
1737{
1738   m_rs232_cts = state;
1739}
trunk/src/mame/includes/amiga.h
r30675r30676
1212
1313#include "cpu/m68000/m68000.h"
1414#include "machine/bankdev.h"
15#include "bus/rs232/rs232.h"
1516#include "bus/centronics/ctronics.h"
1617#include "machine/mos6526.h"
1718#include "machine/amigafdc.h"
r30675r30676
332333   m_maincpu(*this, "maincpu"),
333334   m_cia_0(*this, "cia_0"),
334335   m_cia_1(*this, "cia_1"),
336   m_rs232(*this, "rs232"),
335337   m_centronics(*this, "centronics"),
336338   m_sound(*this, "amiga"),
337339   m_fdc(*this, "fdc"),
r30675r30676
358360   m_centronics_busy(0),
359361   m_centronics_perror(0),
360362   m_centronics_select(0),
361   m_gayle_reset(false)
363   m_gayle_reset(false),
364   m_rx_shift(0),
365   m_tx_shift(0),
366   m_rx_state(0),
367   m_tx_state(0),
368   m_rx_previous(1)
362369   { }
363370
364371
r30675r30676
417424   TIMER_CALLBACK_MEMBER( scanline_callback );
418425   TIMER_CALLBACK_MEMBER (amiga_irq_proc );
419426   TIMER_CALLBACK_MEMBER( amiga_blitter_proc );
420   TIMER_CALLBACK_MEMBER( finish_serial_write );
421
422427   void update_irqs();
423428
424   void serial_in_w(UINT16 data);
425   attotime serial_char_period();
426
427429   DECLARE_CUSTOM_INPUT_MEMBER( amiga_joystick_convert );
428430   DECLARE_CUSTOM_INPUT_MEMBER( floppy_drive_status );
429431
r30675r30676
435437   DECLARE_WRITE8_MEMBER( cia_0_port_a_write );
436438   DECLARE_WRITE_LINE_MEMBER( cia_0_irq );
437439   DECLARE_READ8_MEMBER( cia_1_port_a_read );
440   DECLARE_WRITE8_MEMBER( cia_1_port_a_write );
438441   DECLARE_WRITE_LINE_MEMBER( cia_1_irq );
439442   
443   DECLARE_WRITE_LINE_MEMBER( rs232_rx_w );
444   DECLARE_WRITE_LINE_MEMBER( rs232_dcd_w );
445   DECLARE_WRITE_LINE_MEMBER( rs232_dsr_w );
446   DECLARE_WRITE_LINE_MEMBER( rs232_ri_w );
447   DECLARE_WRITE_LINE_MEMBER( rs232_cts_w );
448
440449   DECLARE_WRITE_LINE_MEMBER( centronics_ack_w );
441450   DECLARE_WRITE_LINE_MEMBER( centronics_busy_w );
442451   DECLARE_WRITE_LINE_MEMBER( centronics_perror_w );
r30675r30676
524533   virtual void vblank();
525534
526535   virtual void potgo_w(UINT16 data) {};
527   virtual void serdat_w(UINT16 data) {};
528536
529537   // joystick/mouse
530538   virtual UINT16 joy0dat_r();
531539   virtual UINT16 joy1dat_r();
532540
541   // serial
542   virtual void rs232_tx(int state);
543
533544   // devices
534545   required_device<m68000_base_device> m_maincpu;
535546   required_device<mos8520_device> m_cia_0;
536547   required_device<mos8520_device> m_cia_1;
548   optional_device<rs232_port_device> m_rs232;
537549   optional_device<centronics_device> m_centronics;
538550   required_device<amiga_sound_device> m_sound;
539551   optional_device<amiga_fdc> m_fdc;
r30675r30676
569581      TIMER_SCANLINE,
570582      TIMER_AMIGA_IRQ,
571583      TIMER_AMIGA_BLITTER,
572      TIMER_FINISH_SERIAL_WRITE
584      TIMER_SERIAL
573585   };
574586
587   enum
588   {
589      ADKCON_UARTBRK = 0x800   // send break
590   };
591
592   // serial port flags
593   enum
594   {
595      SERDATR_RXD   = 0x0800,   // serial data
596      SERDATR_TSRE  = 0x1000,   // transmit ready
597      SERDATR_TBE   = 0x2000,   // transmit buffer empty
598      SERDATR_RBF   = 0x4000,   // receive buffer full
599      SERDATR_OVRUN = 0x8000   // receive buffer overrun
600   };
601
602   enum
603   {
604      SERPER_LONG = 0x8000   // 9-bit mode
605   };
606
575607   int m_centronics_busy;
576608   int m_centronics_perror;
577609   int m_centronics_select;
578610
579611   emu_timer *m_irq_timer;
612   emu_timer *m_serial_timer;
580613
581614   bool m_gayle_reset;
582615
583616   bitmap_ind16 m_flickerfixer;
617
618   UINT16 m_rx_shift;
619   UINT16 m_tx_shift;
620
621   int m_rx_state;
622   int m_tx_state;
623   int m_rx_previous;
624
625   int m_rs232_dcd;
626   int m_rs232_dsr;
627   int m_rs232_ri;
628   int m_rs232_cts;
629
630   void serial_adjust();
631   void serial_shift();
632   void rx_write(amiga_state *state, int level);
584633};
585634
586635
trunk/src/mame/mame.mak
r30675r30676
606606#BUSES += PC_KBD
607607#BUSES += PET
608608#BUSES += PLUS4
609#BUSES += RS232
609BUSES += RS232
610610#BUSES += S100
611611#BUSES += SATURN
612612BUSES += SCSI
trunk/src/mess/drivers/amiga.c
r30675r30676
12551255   MCFG_DEVICE_ADD("cia_1", MOS8520, amiga_state::CLK_E_PAL)
12561256   MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(amiga_state, cia_1_irq))
12571257   MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(amiga_state, cia_1_port_a_read))
1258   MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(amiga_state, cia_1_port_a_write))
12581259   MCFG_MOS6526_PB_OUTPUT_CALLBACK(DEVWRITE8("fdc", amiga_fdc, ciaaprb_w))
12591260
12601261   // audio
r30675r30676
12721273   MCFG_FLOPPY_DRIVE_ADD("fdc:2", amiga_floppies, 0, amiga_fdc::floppy_formats)
12731274   MCFG_FLOPPY_DRIVE_ADD("fdc:3", amiga_floppies, 0, amiga_fdc::floppy_formats)
12741275
1276   // rs232
1277   MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, NULL)
1278   MCFG_RS232_RXD_HANDLER(WRITELINE(amiga_state, rs232_rx_w))
1279   MCFG_RS232_DCD_HANDLER(WRITELINE(amiga_state, rs232_dcd_w))
1280   MCFG_RS232_DSR_HANDLER(WRITELINE(amiga_state, rs232_dsr_w))
1281   MCFG_RS232_RI_HANDLER(WRITELINE(amiga_state, rs232_ri_w))
1282   MCFG_RS232_CTS_HANDLER(WRITELINE(amiga_state, rs232_cts_w))
1283
12751284   // centronics
12761285   MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer")
12771286   MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(amiga_state, centronics_ack_w))
r30675r30676
12801289   MCFG_CENTRONICS_SELECT_HANDLER(WRITELINE(amiga_state, centronics_select_w))
12811290   MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
12821291
1283   // todo: rs232
1284
12851292   // keyboard
12861293   MCFG_DEVICE_ADD("kbd", AMIGAKBD, 0)
12871294   MCFG_AMIGA_KEYBOARD_KCLK_CALLBACK(DEVWRITELINE("cia_0", mos8520_device, cnt_w))

Previous 199869 Revisions Next


© 1997-2024 The MAME Team