Previous 199869 Revisions Next

r20512 Saturday 26th January, 2013 at 20:42:33 UTC by R. Belmont
(MESS) mac: Use pre-cached tagmaps for keyboard/mouse (nw)

(No speed difference, sorry folks).
[src/mess/drivers]mac.c
[src/mess/includes]mac.h
[src/mess/machine]mac.c
[src/mess/video]mac.c

trunk/src/mess/machine/mac.c
r20511r20512
561561   int i, j;
562562   int keybuf;
563563   int keycode;
564   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6" };
565564   mac_state *mac = machine.driver_data<mac_state>();
566565
567566   if (mac->m_keycode_buf_index)
r20511r20512
571570
572571   for (i=0; i<7; i++)
573572   {
574      keybuf = machine.root_device().ioport(keynames[i])->read();
573      switch (i)
574      {
575         case 0:
576            keybuf = mac->m_key0->read();
577            break;
578         case 1:
579            keybuf = mac->m_key1->read();
580            break;
581         case 2:
582            keybuf = mac->m_key2->read();
583            break;
584         case 3:
585            keybuf = mac->m_key3->read();
586            break;
587         case 4:
588            keybuf = mac->m_key4->read();
589            break;
590         case 5:
591            keybuf = mac->m_key5->read();
592            break;
593         case 6:
594            keybuf = mac->m_key6->read();
595            break;   
596      }
575597
576598      if (keybuf != mac->m_key_matrix[i])
577599      {
r20511r20512
839861   int     x_needs_update = 0, y_needs_update = 0;
840862   mac_state *mac = machine().driver_data<mac_state>();
841863
842   new_mx = ioport("MOUSE1")->read();
843   new_my = ioport("MOUSE2")->read();
864   new_mx = m_mouse1->read();
865   new_my = m_mouse2->read();
844866
845867   /* see if it moved in the x coord */
846868   if (new_mx != last_mx)
r20511r20512
13531375            val |= 0x20;
13541376         if (m_mouse_bit_x)  /* Mouse X2 */
13551377            val |= 0x10;
1356         if ((machine().root_device().ioport("MOUSE0")->read() & 0x01) == 0)
1378         if ((m_mouse0->read() & 0x01) == 0)
13571379            val |= 0x08;
13581380
13591381         if (!ADB_IS_PM_CLASS)
trunk/src/mess/includes/mac.h
r20511r20512
198198      m_ncr5380(*this, "scsi:ncr5380"),
199199      m_mackbd(*this, MACKBD_TAG),
200200      m_rtc(*this,"rtc"),
201      m_mouse0(*this, "MOUSE0"),
202      m_mouse1(*this, "MOUSE1"),
203      m_mouse2(*this, "MOUSE2"),
204      m_key0(*this, "KEY0"),
205      m_key1(*this, "KEY1"),
206      m_key2(*this, "KEY2"),
207      m_key3(*this, "KEY3"),
208      m_key4(*this, "KEY4"),
209      m_key5(*this, "KEY5"),
210      m_key6(*this, "KEY6"),
211      m_montype(*this, "MONTYPE"),
201212      m_vram(*this,"vram"),
202213      m_vram16(*this,"vram16")
203214      { }
r20511r20512
217228   optional_device<mackbd_device> m_mackbd;
218229   optional_device<rtc3430042_device> m_rtc;
219230
231   required_ioport m_mouse0, m_mouse1, m_mouse2;
232   required_ioport m_key0, m_key1, m_key2, m_key3, m_key4, m_key5;
233   optional_ioport m_key6, m_montype;
234
220235   virtual void machine_start();
221236   virtual void machine_reset();
222237
trunk/src/mess/video/mac.c
r20511r20512
242242   visarea.min_x = 0;
243243   visarea.min_y = 0;
244244   view = 0;
245   m_rbv_montype = machine().root_device().ioport("MONTYPE")->read_safe(2);
245   m_rbv_montype = m_montype->read_safe(2);
246246   switch (m_rbv_montype)
247247   {
248248      case 1: // 15" portrait display
r20511r20512
299299   visarea.min_x = 0;
300300   visarea.min_y = 0;
301301
302   m_rbv_montype = machine().root_device().ioport("MONTYPE")->read_safe(2);
302   m_rbv_montype = m_montype->read_safe(2);
303303   switch (m_rbv_montype)
304304   {
305305      case 1: // 15" portrait display
trunk/src/mess/drivers/mac.c
r20511r20512
3939          'g 6802c73c' to get to the interesting part (wait past the boot chime).  PPC register r24 is the 68000 PC.
4040          when the PC hits GetCPUID, the move.l (a2), d0 at PC = 0x10000 will cause an MMU fault (jump to 0xFFF00300).  why?
4141          a2 = 0x5ffffffc (the CPU ID register).  MMU is unable to resolve this; defect in the MMU emulation probable.
42
42
4343****************************************************************************/
4444
4545
r20511r20512
127127         if (m_model != MODEL_MAC_CLASSIC_II)
128128         {
129129            // Color Classic has no MONTYPE so the safe read gets us 512x384, which is right
130            if (space.machine().root_device().ioport("MONTYPE")->read_safe(2) == 1)
130            if (m_montype->read_safe(2) == 1)
131131            {
132132               palette_set_color(space.machine(), m_rbv_clutoffs, MAKE_RGB(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2]));
133133               m_rbv_palette[m_rbv_clutoffs] = MAKE_RGB(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2]);
r20511r20512
163163         if (m_model != MODEL_MAC_CLASSIC_II)
164164         {
165165            // Color Classic has no MONTYPE so the safe read gets us 512x384, which is right
166            if (space.machine().root_device().ioport("MONTYPE")->read_safe(2) == 1)
166            if (m_montype->read_safe(2) == 1)
167167            {
168168               palette_set_color(space.machine(), m_rbv_clutoffs, MAKE_RGB(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2]));
169169               m_rbv_palette[m_rbv_clutoffs] = MAKE_RGB(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2]);
r20511r20512
195195   if (offset == 2)
196196   {
197197//        printf("Sonora: read monitor ID at PC=%x\n", m_maincpu->pc());
198      return (space.machine().root_device().ioport("MONTYPE")->read_safe(6)<<4);
198      return (m_montype->read_safe(6)<<4);
199199   }
200200
201201   return m_sonora_vctl[offset];
r20511r20512
251251      if (offset == 0x10)
252252      {
253253         data &= ~0x38;
254         data |= (space.machine().root_device().ioport("MONTYPE")->read_safe(2)<<3);
254         data |= (m_montype->read_safe(2)<<3);
255255//            printf("rbv_r montype: %02x (PC %x)\n", data, space.cpu->safe_pc());
256256      }
257257

Previous 199869 Revisions Next


© 1997-2024 The MAME Team