Previous 15994 Revisions Next

r14561 Tuesday 21st February, 2012 at 07:39:53 UTC by smf
fixed building with visual studio
[src/mess/machine]apollo.c apollo_kbd.c

src/mess/machine/apollo_kbd.c
r14560r14561
1616#include "machine/apollo_kbd.h"
1717#include "sound/beep.h"
1818
19#if defined(__linux__)
1920#include <unistd.h>
2021#include <fcntl.h>
2122#include <errno.h>
22
23#if defined(__linux__)
2423// on linux we may attach a real Apollo keyboard at /dev/ttyS0
2524#include <termios.h>
2625#include <sys/ioctl.h>
r14560r14561
494493
495494int apollo_kbd_device::keyboard_tty::getchar()
496495{
496#if defined(KBD_TTY_NAME)
497497   UINT8 data;
498498   if (m_tty_fd < 0 || read(m_tty_fd, &data, 1) != 1) {
499499      return -1;
r14560r14561
502502      m_connected = 1;
503503      return data;
504504   }
505#else
506   return -1;
507#endif
505508}
506509
507510void apollo_kbd_device::keyboard_tty::putchar(UINT8 data)
508511{
512#if defined(KBD_TTY_NAME)
509513   if (isConnected() && m_tty_fd >= 0 ) {
510514      while (write(m_tty_fd, &data, 1) != 1) {
511515         LOG(("keyboard_tty::putchar data=%02x errno=%d", data, errno ));
512516      }
513517      LOG2(("keyboard_tty::putchar -> %02x", data));
514518   }
519#endif
515520}
516521
517522/*-------------------------------------------------
src/mess/machine/apollo.c
r14560r14561
4444
4545#include "emuopts.h"
4646
47#if 0 //defined(__linux__)
4748#include <fcntl.h>
4849#include <unistd.h>
50#endif
4951
5052#define APOLLO_IRQ_VECTOR 0xa0
5153#define APOLLO_IRQ_PTM 0

Previous 15994 Revisions Next


© 1998-2018 The MESS Team