trunk/src/mess/machine/mac.c
| r20511 | r20512 | |
| 561 | 561 | int i, j; |
| 562 | 562 | int keybuf; |
| 563 | 563 | int keycode; |
| 564 | | static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6" }; |
| 565 | 564 | mac_state *mac = machine.driver_data<mac_state>(); |
| 566 | 565 | |
| 567 | 566 | if (mac->m_keycode_buf_index) |
| r20511 | r20512 | |
| 571 | 570 | |
| 572 | 571 | for (i=0; i<7; i++) |
| 573 | 572 | { |
| 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 | } |
| 575 | 597 | |
| 576 | 598 | if (keybuf != mac->m_key_matrix[i]) |
| 577 | 599 | { |
| r20511 | r20512 | |
| 839 | 861 | int x_needs_update = 0, y_needs_update = 0; |
| 840 | 862 | mac_state *mac = machine().driver_data<mac_state>(); |
| 841 | 863 | |
| 842 | | new_mx = ioport("MOUSE1")->read(); |
| 843 | | new_my = ioport("MOUSE2")->read(); |
| 864 | new_mx = m_mouse1->read(); |
| 865 | new_my = m_mouse2->read(); |
| 844 | 866 | |
| 845 | 867 | /* see if it moved in the x coord */ |
| 846 | 868 | if (new_mx != last_mx) |
| r20511 | r20512 | |
| 1353 | 1375 | val |= 0x20; |
| 1354 | 1376 | if (m_mouse_bit_x) /* Mouse X2 */ |
| 1355 | 1377 | val |= 0x10; |
| 1356 | | if ((machine().root_device().ioport("MOUSE0")->read() & 0x01) == 0) |
| 1378 | if ((m_mouse0->read() & 0x01) == 0) |
| 1357 | 1379 | val |= 0x08; |
| 1358 | 1380 | |
| 1359 | 1381 | if (!ADB_IS_PM_CLASS) |
trunk/src/mess/includes/mac.h
| r20511 | r20512 | |
| 198 | 198 | m_ncr5380(*this, "scsi:ncr5380"), |
| 199 | 199 | m_mackbd(*this, MACKBD_TAG), |
| 200 | 200 | 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"), |
| 201 | 212 | m_vram(*this,"vram"), |
| 202 | 213 | m_vram16(*this,"vram16") |
| 203 | 214 | { } |
| r20511 | r20512 | |
| 217 | 228 | optional_device<mackbd_device> m_mackbd; |
| 218 | 229 | optional_device<rtc3430042_device> m_rtc; |
| 219 | 230 | |
| 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 | |
| 220 | 235 | virtual void machine_start(); |
| 221 | 236 | virtual void machine_reset(); |
| 222 | 237 | |
trunk/src/mess/drivers/mac.c
| r20511 | r20512 | |
| 39 | 39 | 'g 6802c73c' to get to the interesting part (wait past the boot chime). PPC register r24 is the 68000 PC. |
| 40 | 40 | when the PC hits GetCPUID, the move.l (a2), d0 at PC = 0x10000 will cause an MMU fault (jump to 0xFFF00300). why? |
| 41 | 41 | a2 = 0x5ffffffc (the CPU ID register). MMU is unable to resolve this; defect in the MMU emulation probable. |
| 42 | | |
| 42 | |
| 43 | 43 | ****************************************************************************/ |
| 44 | 44 | |
| 45 | 45 | |
| r20511 | r20512 | |
| 127 | 127 | if (m_model != MODEL_MAC_CLASSIC_II) |
| 128 | 128 | { |
| 129 | 129 | // 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) |
| 131 | 131 | { |
| 132 | 132 | palette_set_color(space.machine(), m_rbv_clutoffs, MAKE_RGB(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2])); |
| 133 | 133 | m_rbv_palette[m_rbv_clutoffs] = MAKE_RGB(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2]); |
| r20511 | r20512 | |
| 163 | 163 | if (m_model != MODEL_MAC_CLASSIC_II) |
| 164 | 164 | { |
| 165 | 165 | // 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) |
| 167 | 167 | { |
| 168 | 168 | palette_set_color(space.machine(), m_rbv_clutoffs, MAKE_RGB(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2])); |
| 169 | 169 | m_rbv_palette[m_rbv_clutoffs] = MAKE_RGB(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2]); |
| r20511 | r20512 | |
| 195 | 195 | if (offset == 2) |
| 196 | 196 | { |
| 197 | 197 | // 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); |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | return m_sonora_vctl[offset]; |
| r20511 | r20512 | |
| 251 | 251 | if (offset == 0x10) |
| 252 | 252 | { |
| 253 | 253 | data &= ~0x38; |
| 254 | | data |= (space.machine().root_device().ioport("MONTYPE")->read_safe(2)<<3); |
| 254 | data |= (m_montype->read_safe(2)<<3); |
| 255 | 255 | // printf("rbv_r montype: %02x (PC %x)\n", data, space.cpu->safe_pc()); |
| 256 | 256 | } |
| 257 | 257 | |