Previous 199869 Revisions Next

r33133 Sunday 2nd November, 2014 at 09:39:30 UTC by Curt Coder
(MESS) victor9k: Keyboard WIP. (nw)
[src/mess/drivers]victor9k.c
[src/mess/machine]victor9kb.c victor9kb.h

trunk/src/mess/drivers/victor9k.c
r241644r241645
770770
771771WRITE_LINE_MEMBER( victor9k_state::kbrdy_w )
772772{
773   //logerror("KBRDY %u\n", state);
773774   m_via2->write_cb1(state);
774775
775776   m_pic->ir6_w(state ? CLEAR_LINE : ASSERT_LINE);
r241644r241645
777778
778779WRITE_LINE_MEMBER( victor9k_state::kbdata_w )
779780{
781   //logerror("KBDATA %u\n", state);
780782   m_via2->write_cb2(state);
781783   m_via2->write_pa6(state);
782784}
trunk/src/mess/machine/victor9kb.c
r241644r241645
2828const device_type VICTOR9K_KEYBOARD = &device_creator<victor9k_keyboard_device>;
2929
3030
31
3231//-------------------------------------------------
3332//  ROM( victor9k_keyboard )
3433//-------------------------------------------------
r241644r241645
237236//  victor9k_keyboard_device - constructor
238237//-------------------------------------------------
239238
240victor9k_keyboard_device::victor9k_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
241   : device_t(mconfig, VICTOR9K_KEYBOARD, "Victor 9000 Keyboard", tag, owner, clock, "victor9kb", __FILE__),
242      m_maincpu(*this, I8021_TAG),
243      m_y0(*this, "Y0"),
244      m_y1(*this, "Y1"),
245      m_y2(*this, "Y2"),
246      m_y3(*this, "Y3"),
247      m_y4(*this, "Y4"),
248      m_y5(*this, "Y5"),
249      m_y6(*this, "Y6"),
250      m_y7(*this, "Y7"),
251      m_y8(*this, "Y8"),
252      m_y9(*this, "Y9"),
253      m_ya(*this, "YA"),
254      m_yb(*this, "YB"),
255      m_yc(*this, "YC"),
256      m_kbrdy_handler(*this),
257      m_kbdata_handler(*this),
258      m_y(0),
259      m_kbrdy(1),
260      m_kbdata(1),
261      m_kback(1)
239victor9k_keyboard_device::victor9k_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
240   device_t(mconfig, VICTOR9K_KEYBOARD, "Victor 9000 Keyboard", tag, owner, clock, "victor9kb", __FILE__),
241   m_maincpu(*this, I8021_TAG),
242   m_y0(*this, "Y0"),
243   m_y1(*this, "Y1"),
244   m_y2(*this, "Y2"),
245   m_y3(*this, "Y3"),
246   m_y4(*this, "Y4"),
247   m_y5(*this, "Y5"),
248   m_y6(*this, "Y6"),
249   m_y7(*this, "Y7"),
250   m_y8(*this, "Y8"),
251   m_y9(*this, "Y9"),
252   m_ya(*this, "YA"),
253   m_yb(*this, "YB"),
254   m_yc(*this, "YC"),
255   m_kbrdy_handler(*this),
256   m_kbdata_handler(*this),
257   m_y(0),
258   m_kbrdy(1),
259   m_kbdata(1),
260   m_kback(1)
262261{
263262}
264263
r241644r241645
291290
292291
293292//-------------------------------------------------
294//  kbrdy_r -
295//-------------------------------------------------
296
297READ_LINE_MEMBER( victor9k_keyboard_device::kbrdy_r )
298{
299   return m_kbrdy;
300}
301
302
303//-------------------------------------------------
304293//  kback_w -
305294//-------------------------------------------------
306295
307296WRITE_LINE_MEMBER( victor9k_keyboard_device::kback_w )
308297{
298   //logerror("KBACK %u\n", state);
309299   m_kback = state;
310300}
311301
312302
313303//-------------------------------------------------
314//  kbdata_r -
315//-------------------------------------------------
316
317READ_LINE_MEMBER( victor9k_keyboard_device::kbdata_r )
318{
319   return m_kbdata;
320}
321
322
323//-------------------------------------------------
324304//  kb_p1_r -
325305//-------------------------------------------------
326306
r241644r241645
360340      m_y = data & 0x0f;
361341   }
362342
363   logerror("P1 %02x\n", data);
343   //logerror("P1 %02x\n", data);
364344}
365345
366346
r241644r241645
374354
375355       bit     description
376356
377       P20     keylatch enable ?
378       P21
379       P22     key available ?
380       P23     data ?
357       P20     ?
358       P21    KBRDY
359       P22     ?
360       P23     KBDATA
381361
382362   */
383363
384   int kbrdy = BIT(data, 2);
364   int kbrdy = BIT(data, 1);
385365
386366   if (m_kbrdy != kbrdy)
387367   {
r241644r241645
397377      m_kbdata_handler(m_kbdata);
398378   }
399379
400   logerror("P2 %01x\n", data & 0x0f);
380   //logerror("P2 %02x\n", data);
401381}
402382
403383
r241644r241645
407387
408388READ8_MEMBER( victor9k_keyboard_device::kb_t1_r )
409389{
410   logerror("read T1 %u\n", m_kback);
411
412390   return m_kback;
413391}
trunk/src/mess/machine/victor9kb.h
r241644r241645
5151   virtual machine_config_constructor device_mconfig_additions() const;
5252   virtual ioport_constructor device_input_ports() const;
5353
54   DECLARE_READ_LINE_MEMBER( kbrdy_r );
5554   DECLARE_WRITE_LINE_MEMBER( kback_w );
56   DECLARE_READ_LINE_MEMBER( kbdata_r );
5755
5856   // not really public
5957   DECLARE_READ8_MEMBER( kb_p1_r );


Previous 199869 Revisions Next


© 1997-2024 The MAME Team