Previous 199869 Revisions Next

r20543 Sunday 27th January, 2013 at 18:12:16 UTC by Curt Coder
(MESS) Tagmap lookup cleanup. (nw)
[src/mess/machine]s100_dj2db.c s100_dj2db.h wangpckb.c wangpckb.h

trunk/src/mess/machine/s100_dj2db.c
r20542r20543
266266   m_floppy2(*this, MB8866_TAG":2"),
267267   m_floppy3(*this, MB8866_TAG":3"),
268268   m_floppy(NULL),
269   m_rom(*this, "dj2db"),
270   m_ram(*this, "ram"),
269271   m_j1a(*this, "J1A"),
270   m_ram(*this, "ram"),
272   m_j3a(*this, "J3A"),
273   m_j4(*this, "J4"),
274   m_sw1(*this, "SW1"),
271275   m_drive(0),
272276   m_head(1),
273277   m_int_enbl(0),
r20542r20543
284288
285289void s100_dj2db_device::device_start()
286290{
287   // find memory regions
288   m_rom = memregion("dj2db")->base();
289
290291   // allocate memory
291292   m_ram.allocate(0x400);
292293
r20542r20543
310311
311312void s100_dj2db_device::device_reset()
312313{
313   m_board_enbl = ioport("J4")->read();
314   m_board_enbl = m_j4->read();
314315}
315316
316317
r20542r20543
326327
327328   if ((offset >= 0xf800) && (offset < 0xfbf8))
328329   {
329      data = m_rom[offset & 0x3ff] ^ 0xff;
330      data = m_rom->base()[offset & 0x3ff] ^ 0xff;
330331   }
331332   else if (offset == 0xfbf8) // SERIAL IN
332333   {
r20542r20543
504505{
505506   if (offset == 0x41)
506507   {
507      m_board_enbl = (data & ioport("J3A")->read()) ? 1 : 0;
508      m_board_enbl = (data & m_j3a->read()) ? 1 : 0;
508509   }
509510}
510511
r20542r20543
515516
516517void s100_dj2db_device::s100_phantom_w(int state)
517518{
518   if (!BIT(ioport("SW1")->read(), 2))
519   if (!BIT(m_sw1->read(), 2))
519520   {
520521      m_phantom = state;
521522   }
trunk/src/mess/machine/s100_dj2db.h
r20542r20543
6666   required_device<floppy_connector> m_floppy2;
6767   required_device<floppy_connector> m_floppy3;
6868   floppy_image_device *m_floppy;
69   required_memory_region m_rom;
70   optional_shared_ptr<UINT8> m_ram;
6971   required_ioport m_j1a;
70   optional_shared_ptr<UINT8> m_ram;
72   required_ioport m_j3a;
73   required_ioport m_j4;
74   required_ioport m_sw1;
7175
7276   // floppy state
7377   int m_drive;                // selected drive
r20542r20543
7579   int m_int_enbl;             // interrupt enable
7680
7781   // S-100 bus state
78   const UINT8 *m_rom;
7982   int m_access_enbl;          // access enable
8083   int m_board_enbl;           // board enable
8184   int m_phantom;              // phantom
trunk/src/mess/machine/wangpckb.c
r20542r20543
385385wangpc_keyboard_device::wangpc_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
386386   : device_t(mconfig, WANGPC_KEYBOARD, "Wang PC Keyboard", tag, owner, clock),
387387      device_serial_interface(mconfig, *this),
388      m_maincpu(*this, I8051_TAG)
388      m_maincpu(*this, I8051_TAG),
389      m_y0(*this, "Y0"),
390      m_y1(*this, "Y1"),
391      m_y2(*this, "Y2"),
392      m_y3(*this, "Y3"),
393      m_y4(*this, "Y4"),
394      m_y5(*this, "Y5"),
395      m_y6(*this, "Y6"),
396      m_y7(*this, "Y7"),
397      m_y8(*this, "Y8"),
398      m_y9(*this, "Y9"),
399      m_ya(*this, "YA"),
400      m_yb(*this, "YB"),
401      m_yc(*this, "YC"),
402      m_yd(*this, "YD"),
403      m_ye(*this, "YE"),
404      m_yf(*this, "YF")
389405{
390406}
391407
r20542r20543
479495
480496   switch (m_y & 0x0f)
481497   {
482      case 0: data &= ioport("Y0")->read(); break;
483      case 1: data &= ioport("Y1")->read(); break;
484      case 2: data &= ioport("Y2")->read(); break;
485      case 3: data &= ioport("Y3")->read(); break;
486      case 4: data &= ioport("Y4")->read(); break;
487      case 5: data &= ioport("Y5")->read(); break;
488      case 6: data &= ioport("Y6")->read(); break;
489      case 7: data &= ioport("Y7")->read(); break;
490      case 8: data &= ioport("Y8")->read(); break;
491      case 9: data &= ioport("Y9")->read(); break;
492      case 0xa: data &= ioport("YA")->read(); break;
493      case 0xb: data &= ioport("YB")->read(); break;
494      case 0xc: data &= ioport("YC")->read(); break;
495      case 0xd: data &= ioport("YD")->read(); break;
496      case 0xe: data &= ioport("YE")->read(); break;
497      case 0xf: data &= ioport("YF")->read(); break;
498      case 0: data &= m_y0->read(); break;
499      case 1: data &= m_y1->read(); break;
500      case 2: data &= m_y2->read(); break;
501      case 3: data &= m_y3->read(); break;
502      case 4: data &= m_y4->read(); break;
503      case 5: data &= m_y5->read(); break;
504      case 6: data &= m_y6->read(); break;
505      case 7: data &= m_y7->read(); break;
506      case 8: data &= m_y8->read(); break;
507      case 9: data &= m_y9->read(); break;
508      case 0xa: data &= m_ya->read(); break;
509      case 0xb: data &= m_yb->read(); break;
510      case 0xc: data &= m_yc->read(); break;
511      case 0xd: data &= m_yd->read(); break;
512      case 0xe: data &= m_ye->read(); break;
513      case 0xf: data &= m_yf->read(); break;
498514   }
499515
500516   return data;
trunk/src/mess/machine/wangpckb.h
r20542r20543
7474
7575private:
7676   required_device<cpu_device> m_maincpu;
77   required_ioport m_y0;
78   required_ioport m_y1;
79   required_ioport m_y2;
80   required_ioport m_y3;
81   required_ioport m_y4;
82   required_ioport m_y5;
83   required_ioport m_y6;
84   required_ioport m_y7;
85   required_ioport m_y8;
86   required_ioport m_y9;
87   required_ioport m_ya;
88   required_ioport m_yb;
89   required_ioport m_yc;
90   required_ioport m_yd;
91   required_ioport m_ye;
92   required_ioport m_yf;
7793
7894   UINT8 m_y;
7995};

Previous 199869 Revisions Next


© 1997-2024 The MAME Team