Previous 199869 Revisions Next

r36300 Saturday 7th March, 2015 at 06:01:48 UTC by Robbbert
(MESS) mbee : some work on the old keyboard (nw)
[src/mess/drivers]mbee.c
[src/mess/includes]mbee.h
[src/mess/video]mbee.c

trunk/src/mess/drivers/mbee.c
r244811r244812
370370
371371   PORT_START("X.3") /* IN3 KEY ROW 3 [180] */
372372   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') PORT_CHAR(0x18)
373   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) PORT_CHAR('u') PORT_CHAR('Y') PORT_CHAR(0x19)
373   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') PORT_CHAR(0x19)
374374   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') PORT_CHAR(0x1a)
375375   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("[") PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') PORT_CHAR(0x1b)
376376   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("\\") PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') PORT_CHAR(0x1c)
r244811r244812
391391   PORT_START("X.5") /* IN5 KEY ROW 5 [280] */
392392   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("8 (") PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(')
393393   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("9 )") PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')')
394   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("; +") PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+')
395   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME(": *") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') PORT_CHAR('*')
394   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME(": *") PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CHAR('*')
395   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("; +") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(';') PORT_CHAR('+')
396396   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME(", <") PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
397397   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("- =") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=')
398398   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME(". >") PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
r244811r244812
418418   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("(Right)") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT))
419419   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
420420
421   PORT_START("EXTRA") /* IN8 extra keys (non-premium keyboard only) */
422   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("(Up)") PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP))
423   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("(Down)") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN))
424   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("(Left)") PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT))
425   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("(Right)") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT))
426   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("(Insert)") PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT))
427   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
428
429421   // Autorun on quickload
430422   PORT_START("CONFIG")
431423   PORT_CONFNAME( 0x01, 0x01, "Autorun on Quickload")
trunk/src/mess/includes/mbee.h
r244811r244812
4949      , m_pak(*this, "pak")
5050      , m_telcom(*this, "telcom")
5151      , m_basic(*this, "basic")
52      , m_io_extra(*this, "EXTRA")
53      , m_io_config(*this, "CONFIG")
52      , m_io_x7(*this, "X.7")
5453      , m_io_oldkb(*this, "X")
5554      , m_io_newkb(*this, "Y")
55      , m_io_config(*this, "CONFIG")
5656      , m_screen(*this, "screen")
5757   { }
5858
r244811r244812
164164   optional_memory_bank m_pak;
165165   optional_memory_bank m_telcom;
166166   optional_memory_bank m_basic;
167   optional_ioport m_io_extra;
168   required_ioport m_io_config;
167   optional_ioport m_io_x7;
169168   optional_ioport_array<8> m_io_oldkb;
170169   optional_ioport_array<15> m_io_newkb;
170   required_ioport m_io_config;
171171   required_device<screen_device> m_screen;
172172};
173173
trunk/src/mess/video/mbee.c
r244811r244812
156156{
157157   if (m_has_oldkb)
158158   {
159      offs &= 0x3f0; // safety check
159160      UINT8 port = (offs >> 7) & 7;
160161      UINT8 bit = (offs >> 4) & 7;
162      UINT8 extra = 0;
161163      UINT8 data = m_io_oldkb[port]->read();
164      if ((port == 0) || (port == 2) || (port == 3))
165         extra = m_io_x7->read();
166      else
167      if (port == 7)
168         extra = data;
169     
162170      bool keydown  = ( data >> bit ) & 1;
163171
164      // This adds premium-style cursor keys to the old keyboard
165      // They are used by the pc85 & ppc menu, and the 128k shell.
166      if (!keydown)
172      // This adds premium-style cursor keys to the old keyboard.
173      // They are used by the pc85 menu. Premium keyboards already
174      // have these keys fitted.
175      if (!keydown && !m_is_premium && extra)
167176      {
168         UINT8 extra = m_io_extra->read();
169
170         if (extra && port == 7 && bit == 1) keydown = 1;   /* Control */
171
172         if (BIT(extra, 0) && ( port == 0 && bit == 5 )) keydown = 1; // cursor up = ^E
177         if BIT(extra, 0) // cursor up
178         {
179            if( port == 7 && bit == 1 ) keydown = 1;
180            if( port == 0 && bit == 5 ) keydown = 1; // control E
181         }
173182         else
174         if (BIT(extra, 1) && ( port == 3 && bit == 0 )) keydown = 1; // cursor down = ^X
183         if BIT(extra, 2) // cursor down
184         {
185            if( port == 7 && bit == 1 ) keydown = 1;
186            if( port == 3 && bit == 0 ) keydown = 1; // control X
187         }
175188         else
176         if (BIT(extra, 2) && ( port == 2 && bit == 3 )) keydown = 1; // cursor left = ^S
189         if BIT(extra, 3) // cursor left
190         {
191            if( port == 7 && bit == 1 ) keydown = 1;
192            if( port == 2 && bit == 3 ) keydown = 1; // control S
193         }
177194         else
178         if (BIT(extra, 3) && ( port == 0 && bit == 4 )) keydown = 1; // cursor right = ^D
179         else
180         if (BIT(extra, 4) && ( port == 2 && bit == 6 )) keydown = 1; // insert = ^V
195         if BIT(extra, 6) // cursor right
196         {
197            if( port == 7 && bit == 1 ) keydown = 1;
198            if( port == 0 && bit == 4 ) keydown = 1; // control D
199         }
181200      }
182201
183202      if( keydown )


Previous 199869 Revisions Next


© 1997-2024 The MAME Team