src/mess/machine/mac.c
| r6043 | r6044 | |
| 12 | 12 | Mac Model Feature Summary: |
| 13 | 13 | |
| 14 | 14 | CPU FDC Kbd/Mouse PRAM Video |
| 15 | | - Mac 128k 68k IWM orig orig Original |
| 16 | | - Mac 512k 68k IWM orig orig Original |
| 17 | | - Mac 512ke 68k IWM orig orig Original |
| 18 | | - Mac Plus 68k IWM orig ext Original |
| 19 | | - Mac SE 68k IWM MacII ADB ext Original |
| 20 | | - Mac Classic 68k SWIM MacII ADB ext Original |
| 21 | | - Mac Portable 68k (16 MHz) SWIM ADB-PMU PMU 640x480 B&W |
| 22 | | - PwrBook 100 68k (16 MHz) SWIM ADB-PMU PMU 640x480 B&W |
| 23 | | - Mac II 020 IWM MacII ADB ext NuBus card |
| 24 | | - Mac IIx 030 SWIM MacII ADB ext NuBus card |
| 25 | | - Mac IIfx 030 SWIM ADB-IOP ext NuBus card |
| 26 | | - Mac SE/30 030 SWIM MacII ADB ext Internal fake NuBus card (need video declaration ROM!) |
| 27 | | - Mac IIcx 030 SWIM ADB-CUDA ext NuBus card |
| 28 | | - Mac IIci 030 SWIM ADB-CUDA ext Internal "RBV" type |
| 29 | | - Mac LC 020 SWIM Egret ADB ext Internal "V8" type |
| 30 | | - Mac LC II 030 SWIM Egret ADB ext Internal "V8" type |
| 31 | | - Mac LC III 030 SWIM Egret ADB ext Internal "V8" type |
| 15 | - Mac 128k 68k IWM orig orig Original |
| 16 | - Mac 512k 68k IWM orig orig Original |
| 17 | - Mac 512ke 68k IWM orig orig Original |
| 18 | - Mac Plus 68k IWM orig ext Original |
| 19 | - Mac SE 68k IWM MacII ADB ext Original |
| 20 | - Mac Classic 68k SWIM MacII ADB ext Original |
| 21 | - Mac Portable 68k (16 MHz) SWIM ADB-PMU PMU 640x480 B&W |
| 22 | - PowerBook 100 68k (16 MHz) SWIM ADB-PMU PMU 640x480 B&W |
| 23 | - Mac II 020 IWM MacII ADB ext NuBus card |
| 24 | - Mac IIx 030 SWIM MacII ADB ext NuBus card |
| 25 | - Mac IIfx 030 SWIM ADB-IOP ext NuBus card |
| 26 | - Mac SE/30 030 SWIM MacII ADB ext Internal fake NuBus card |
| 27 | - Mac IIcx 030 SWIM ADB-CUDA ext NuBus card |
| 28 | - Mac IIci 030 SWIM ADB-CUDA ext Internal "RBV" type |
| 29 | - Mac LC 020 SWIM Egret ADB ext Internal "V8" type |
| 30 | - Mac LC II 030 SWIM Egret ADB ext Internal "V8" type |
| 31 | - Mac LC III 030 SWIM Egret ADB ext Internal "V8" type |
| 32 | 32 | |
| 33 | 33 | Notes: |
| 34 | 34 | - The Mac Plus boot code seems to check to see the extent of ROM |
| r6043 | r6044 | |
| 53 | 53 | IIcx, IIci, and PowerMac 5200. |
| 54 | 54 | |
| 55 | 55 | TODO: |
| 56 | | - Mac Portable and PowerBook 100 are similar to this hardware, but we need ROMs! |
| 56 | - Mac Portable and PowerBook 100 are similar to this hardware, but we need ROMs! |
| 57 | 57 | - Call the RTC timer |
| 58 | | - SE FDHD and Classic require SWIM support. SWIM is 100% IWM compatible with 800k drives, but |
| 58 | - SE FDHD and Classic require SWIM support. SWIM is IWM compatible with 800k drives, but |
| 59 | 59 | becomes a different chip for 1.44MB. |
| 60 | 60 | - Check that 0x600000-0x6fffff still address RAM when overlay bit is off |
| 61 | 61 | (IM-III seems to say it does not on Mac 128k, 512k, and 512ke). |
| 62 | 62 | - What on earth are 0x700000-0x7fffff mapped to ? |
| 63 | 63 | |
| 64 | 64 | |
| 65 | | Mac LC notes: |
| 66 | | IOBase is 50f00000 in 32-bit mode and f00000 in 24-bit |
| 67 | | VIA1 is at IOBase |
| 68 | | IWM is at IOBase + 0x16000 |
| 69 | | |
| 70 | | |
| 71 | 65 | ****************************************************************************/ |
| 72 | 66 | |
| 73 | 67 | #include <time.h> |
| r6043 | r6044 | |
| 93 | 87 | #else |
| 94 | 88 | #define LOG_VIA 0 |
| 95 | 89 | #define LOG_RTC 0 |
| 96 | | #define LOG_MAC_IWM |
| 90 | #define LOG_MAC_IWM 1 |
| 97 | 91 | #define LOG_GENERAL 0 |
| 98 | 92 | #define LOG_KEYBOARD 0 |
| 99 | 93 | #define LOG_MEMORY 0 |
| r6043 | r6044 | |
| 165 | 159 | DEVCB_LINE(mac_via2_irq) |
| 166 | 160 | }; |
| 167 | 161 | |
| 168 | | /* tells which model is being emulated (set by macxxx_init) */ |
| 169 | | typedef enum |
| 170 | | { |
| 171 | | MODEL_MAC_128K512K, |
| 172 | | MODEL_MAC_512KE, |
| 173 | | MODEL_MAC_PLUS, |
| 174 | | MODEL_MAC_SE, |
| 175 | | MODEL_MAC_SE_FDHD, |
| 176 | | MODEL_MAC_CLASSIC, |
| 177 | | MODEL_MAC_PORTABLE, |
| 178 | | MODEL_MAC_PB100, |
| 179 | | |
| 180 | | MODEL_MAC_II, // Mac II class machines |
| 181 | | MODEL_MAC_II_FDHD, |
| 182 | | MODEL_MAC_IIX, |
| 183 | | MODEL_MAC_IICX, |
| 184 | | MODEL_MAC_IICI, |
| 185 | | MODEL_MAC_IIFX, |
| 186 | | MODEL_MAC_SE30, |
| 187 | | |
| 188 | | MODEL_MAC_LC, // LC class machines, generally all with the same memory map and the V8 gate array |
| 189 | | MODEL_MAC_LC_II, |
| 190 | | MODEL_MAC_LC_III, |
| 191 | | MODEL_MAC_CLASSIC_II, |
| 192 | | MODEL_MAC_COLOR_CLASSIC |
| 193 | | } mac_model_t; |
| 194 | | |
| 195 | 162 | static UINT32 mac_overlay = 0; |
| 196 | | static mac_model_t mac_model; |
| 163 | mac_model_t mac_model; |
| 197 | 164 | static int mac_drive_select = 0; |
| 198 | 165 | static int mac_scsiirq_enable = 0; |
| 199 | 166 | |
| 167 | static UINT32 mac_via2_vbl = 0, mac_se30_vbl_enable = 0; |
| 168 | |
| 200 | 169 | // returns non-zero if this Mac has ADB |
| 201 | 170 | static int has_adb(void) |
| 202 | 171 | { |
| r6043 | r6044 | |
| 273 | 242 | Interrupt handling |
| 274 | 243 | */ |
| 275 | 244 | |
| 276 | | static int scc_interrupt, via_interrupt, scsi_interrupt, last_taken_interrupt; |
| 245 | static int scc_interrupt, via_interrupt, via2_interrupt, scsi_interrupt, last_taken_interrupt; |
| 277 | 246 | |
| 278 | 247 | static void mac_field_interrupts(running_machine *machine) |
| 279 | 248 | { |
| 280 | 249 | int take_interrupt = -1; |
| 281 | 250 | |
| 282 | | if ((scc_interrupt) || (scsi_interrupt)) |
| 251 | if (mac_model < MODEL_MAC_II) |
| 283 | 252 | { |
| 284 | | take_interrupt = 2; |
| 253 | if ((scc_interrupt) || (scsi_interrupt)) |
| 254 | { |
| 255 | take_interrupt = 2; |
| 256 | } |
| 257 | else if (via_interrupt) |
| 258 | { |
| 259 | take_interrupt = 1; |
| 260 | } |
| 285 | 261 | } |
| 286 | | else if (via_interrupt) |
| 262 | else |
| 287 | 263 | { |
| 288 | | take_interrupt = 1; |
| 264 | if (scc_interrupt) |
| 265 | { |
| 266 | take_interrupt = 4; |
| 267 | } |
| 268 | else if (via2_interrupt) |
| 269 | { |
| 270 | take_interrupt = 2; |
| 271 | } |
| 272 | else if (via_interrupt) |
| 273 | { |
| 274 | take_interrupt = 1; |
| 275 | } |
| 289 | 276 | } |
| 290 | 277 | |
| 291 | 278 | if (last_taken_interrupt != -1) |
| r6043 | r6044 | |
| 314 | 301 | } |
| 315 | 302 | |
| 316 | 303 | |
| 304 | static void set_via2_interrupt(running_machine *machine, int value) |
| 305 | { |
| 306 | via2_interrupt = value; |
| 307 | mac_field_interrupts(machine); |
| 308 | } |
| 309 | |
| 317 | 310 | WRITE16_HANDLER ( mac_autovector_w ) |
| 318 | 311 | { |
| 319 | 312 | if (LOG_GENERAL) |
| r6043 | r6044 | |
| 374 | 367 | } |
| 375 | 368 | |
| 376 | 369 | /* install the memory */ |
| 377 | | if (mac_model == MODEL_MAC_LC) |
| 370 | if (((mac_model >= MODEL_MAC_LC) && (mac_model <= MODEL_MAC_COLOR_CLASSIC))|| (mac_model == MODEL_MAC_LC_II)) |
| 378 | 371 | { |
| 379 | | mac_install_memory(machine, 0x000000, 0x9fffff, memory_size, memory_data, is_rom, 1); |
| 372 | mac_install_memory(machine, 0x00000000, 0x009fffff, memory_size, memory_data, is_rom, 1); |
| 380 | 373 | } |
| 374 | else if ((mac_model == MODEL_MAC_IICI) || (mac_model == MODEL_MAC_IISI)) |
| 375 | { |
| 376 | // ROM is OK to flood to 3fffffff |
| 377 | if (is_rom) |
| 378 | { |
| 379 | mac_install_memory(machine, 0x00000000, 0x3fffffff, memory_size, memory_data, is_rom, 1); |
| 380 | } |
| 381 | else // RAM: be careful not to populate ram B with a mirror or the ROM will get confused |
| 382 | { |
| 383 | mac_install_memory(machine, 0x00000000, 0x03ffffff, memory_size, memory_data, is_rom, 1); |
| 384 | } |
| 385 | } |
| 386 | else if ((mac_model == MODEL_MAC_CLASSIC_II) || ((mac_model == MODEL_MAC_II) && (mac_model <= MODEL_MAC_SE30))) |
| 387 | { |
| 388 | mac_install_memory(machine, 0x00000000, 0x3fffffff, memory_size, memory_data, is_rom, 1); |
| 389 | } |
| 381 | 390 | else |
| 382 | 391 | { |
| 383 | | mac_install_memory(machine, 0x000000, 0x3fffff, memory_size, memory_data, is_rom, 1); |
| 392 | mac_install_memory(machine, 0x00000000, 0x003fffff, memory_size, memory_data, is_rom, 1); |
| 384 | 393 | } |
| 385 | 394 | |
| 386 | 395 | mac_overlay = overlay; |
| r6043 | r6044 | |
| 822 | 831 | Location Location NCR 5380 Internal Register |
| 823 | 832 | |
| 824 | 833 | scsiWr+sODR+dackWr $580201 Output Data Register with DACK |
| 825 | | scsiRd+sIDR+dackRd $580260 Current SCSI Data with DACK |
| 826 | 834 | scsiWr+sODR $580001 Output Data Register |
| 827 | 835 | scsiWr+sICR $580011 Initiator Command Register |
| 828 | 836 | scsiWr+sMR $580021 Mode Register |
| r6043 | r6044 | |
| 831 | 839 | scsiWr+sDMAtx $580051 Start DMA Send |
| 832 | 840 | scsiWr+sTDMArx $580061 Start DMA Target Receive |
| 833 | 841 | scsiWr+sIDMArx $580071 Start DMA Initiator Receive |
| 842 | |
| 843 | scsiRd+sIDR+dackRd $580260 Current SCSI Data with DACK |
| 834 | 844 | scsiRd+sCDR $580000 Current SCSI Data |
| 835 | 845 | scsiRd+sICR $580010 Initiator Command Register |
| 836 | 846 | scsiRd+sMR $580020 Mode Registor |
| r6043 | r6044 | |
| 846 | 856 | { |
| 847 | 857 | int reg = (offset>>3) & 0xf; |
| 848 | 858 | |
| 859 | // logerror("macplus_scsi_r: offset %x mask %x\n", offset, mem_mask); |
| 860 | |
| 849 | 861 | if ((reg == 6) && (offset == 0x130)) |
| 850 | 862 | { |
| 851 | 863 | reg = R5380_CURDATA_DTACK; |
| r6043 | r6044 | |
| 854 | 866 | return ncr5380_r(space, reg)<<8; |
| 855 | 867 | } |
| 856 | 868 | |
| 869 | READ32_HANDLER (macii_scsi_drq_r) |
| 870 | { |
| 871 | return ncr5380_r(space, R5380_CURDATA_DTACK)<<24; |
| 872 | } |
| 873 | |
| 857 | 874 | WRITE16_HANDLER ( macplus_scsi_w ) |
| 858 | 875 | { |
| 859 | 876 | int reg = (offset>>3) & 0xf; |
| 860 | 877 | |
| 878 | logerror("macplus_scsi_w: data %x offset %x mask %x\n", data, offset, mem_mask); |
| 879 | |
| 861 | 880 | if ((reg == 0) && (offset == 0x100)) |
| 862 | 881 | { |
| 863 | 882 | reg = R5380_OUTDATA_DTACK; |
| r6043 | r6044 | |
| 866 | 885 | ncr5380_w(space, reg, data); |
| 867 | 886 | } |
| 868 | 887 | |
| 888 | WRITE16_HANDLER ( macii_scsi_w ) |
| 889 | { |
| 890 | int reg = (offset>>3) & 0xf; |
| 891 | |
| 892 | // logerror("macplus_scsi_w: data %x offset %x mask %x\n", data, offset, mem_mask); |
| 893 | |
| 894 | if ((reg == 0) && (offset == 0x100)) |
| 895 | { |
| 896 | reg = R5380_OUTDATA_DTACK; |
| 897 | } |
| 898 | |
| 899 | ncr5380_w(space, reg, data>>8); |
| 900 | } |
| 901 | |
| 869 | 902 | static void mac_scsi_irq(running_machine *machine, int state) |
| 870 | 903 | { |
| 871 | 904 | if ((mac_scsiirq_enable) && ((mac_model == MODEL_MAC_SE) || (mac_model == MODEL_MAC_CLASSIC))) |
| 872 | 905 | { |
| 906 | printf("SCSI IRQ -> %d\n", state); |
| 873 | 907 | scsi_interrupt = state; |
| 874 | 908 | mac_field_interrupts(machine); |
| 875 | 909 | } |
| r6043 | r6044 | |
| 1289 | 1323 | const device_config *fdc = devtag_get_device(space->machine, "fdc"); |
| 1290 | 1324 | |
| 1291 | 1325 | if (LOG_MAC_IWM) |
| 1292 | | logerror("mac_iwm_r: offset=0x%08x\n", offset); |
| 1326 | logerror("mac_iwm_r: offset=0x%08x (PC %x)\n", offset>>8, cpu_get_pc(space->cpu)); |
| 1293 | 1327 | |
| 1294 | 1328 | result = applefdc_r(fdc, offset >> 8); |
| 1295 | 1329 | return (result << 8) | result; |
| r6043 | r6044 | |
| 1300 | 1334 | const device_config *fdc = devtag_get_device(space->machine, "fdc"); |
| 1301 | 1335 | |
| 1302 | 1336 | if (LOG_MAC_IWM) |
| 1303 | | logerror("mac_iwm_w: offset=0x%08x data=0x%04x\n", offset, data); |
| 1337 | logerror("mac_iwm_w: offset=0x%08x data=0x%04x (PC=%x)\n", offset>>8, data, cpu_get_pc(space->cpu)); |
| 1304 | 1338 | |
| 1305 | 1339 | if (ACCESSING_BITS_0_7) |
| 1306 | 1340 | applefdc_w(fdc, offset >> 8, data & 0xff); |
| r6043 | r6044 | |
| 1676 | 1710 | |
| 1677 | 1711 | static READ8_DEVICE_HANDLER(mac_via_in_a) |
| 1678 | 1712 | { |
| 1679 | | if (mac_model == MODEL_MAC_CLASSIC) |
| 1713 | // printf("VIA1 IN_A (PC %x)\n", cpu_get_pc(cputag_get_cpu(device->machine, "maincpu"))); |
| 1714 | |
| 1715 | if ((mac_model == MODEL_MAC_CLASSIC) || (mac_model == MODEL_MAC_LC) || |
| 1716 | (mac_model == MODEL_MAC_LC_II) || (mac_model == MODEL_MAC_II) || |
| 1717 | (mac_model == MODEL_MAC_II_FDHD) || (mac_model == MODEL_MAC_IIX) || |
| 1718 | (mac_model == MODEL_MAC_SE30)) |
| 1680 | 1719 | { |
| 1681 | 1720 | return 0x81; // bit 0 must be set to avoid attempting to boot from AppleTalk |
| 1682 | 1721 | } |
| 1683 | 1722 | |
| 1723 | if (mac_model == MODEL_MAC_IICI) |
| 1724 | { |
| 1725 | return 0xc7; // 0x40 = IIcx/IIci/IIfx | 0x06 = IIci |
| 1726 | } |
| 1727 | |
| 1728 | if (mac_model == MODEL_MAC_IIFX) |
| 1729 | { |
| 1730 | return 0xc3; // 0x40 = IIcx/IIci/IIfx | 0x02 = IIfx |
| 1731 | } |
| 1732 | |
| 1733 | if (mac_model == MODEL_MAC_IICX) |
| 1734 | { |
| 1735 | return 0xc1; // 0x40 = IIcx/IIci/IIfx ID bit |
| 1736 | } |
| 1737 | |
| 1684 | 1738 | return 0x80; |
| 1685 | 1739 | } |
| 1686 | 1740 | |
| r6043 | r6044 | |
| 1688 | 1742 | { |
| 1689 | 1743 | int val = 0; |
| 1690 | 1744 | |
| 1745 | // printf("VIA1 IN_B (PC %x)\n", cpu_get_pc(cputag_get_cpu(device->machine, "maincpu"))); |
| 1746 | |
| 1691 | 1747 | /* video beam in display (! VBLANK && ! HBLANK basically) */ |
| 1692 | 1748 | if (video_screen_get_vpos(device->machine->primary_screen) >= MAC_V_VIS) |
| 1693 | 1749 | val |= 0x40; |
| r6043 | r6044 | |
| 1721 | 1777 | const device_config *sound = devtag_get_device(device->machine, "custom"); |
| 1722 | 1778 | const device_config *fdc = devtag_get_device(device->machine, "fdc"); |
| 1723 | 1779 | |
| 1780 | // printf("VIA1 OUT A: %02x (PC %x)\n", data, cpu_get_pc(cputag_get_cpu(device->machine, "maincpu"))); |
| 1781 | |
| 1724 | 1782 | set_scc_waitrequest((data & 0x80) >> 7); |
| 1725 | 1783 | mac_set_screen_buffer((data & 0x40) >> 6); |
| 1726 | 1784 | sony_set_sel_line(fdc,(data & 0x20) >> 5); |
| r6043 | r6044 | |
| 1733 | 1791 | { |
| 1734 | 1792 | mac_set_sound_buffer(sound, (data & 0x08) >> 3); |
| 1735 | 1793 | } |
| 1736 | | mac_set_volume(sound, data & 0x07); |
| 1737 | 1794 | |
| 1795 | if (mac_model < MODEL_MAC_II) |
| 1796 | { |
| 1797 | mac_set_volume(sound, data & 0x07); |
| 1798 | } |
| 1799 | |
| 1738 | 1800 | /* Early Mac models had VIA A4 control overlaying. In the Mac SE (and |
| 1739 | | * possibly later models), overlay was set on reset, but cleared on the |
| 1740 | | * first access to the ROM. */ |
| 1801 | * possibly later models), overlay was set on reset, but cleared on the |
| 1802 | * first access to the ROM. */ |
| 1741 | 1803 | if (mac_model < MODEL_MAC_SE) |
| 1742 | 1804 | set_memory_overlay(device->machine, (data & 0x10) >> 4); |
| 1743 | 1805 | } |
| r6043 | r6044 | |
| 1747 | 1809 | const device_config *sound = devtag_get_device(device->machine, "custom"); |
| 1748 | 1810 | int new_rtc_rTCClk; |
| 1749 | 1811 | |
| 1750 | | mac_enable_sound(sound, (data & 0x80) == 0); |
| 1812 | // printf("VIA1 OUT B: %02x (PC %x)\n", data, cpu_get_pc(cputag_get_cpu(device->machine, "maincpu"))); |
| 1751 | 1813 | |
| 1814 | if (mac_model < MODEL_MAC_II) |
| 1815 | { |
| 1816 | mac_enable_sound(sound, (data & 0x80) == 0); |
| 1817 | } |
| 1818 | |
| 1752 | 1819 | // SE and Classic have SCSI enable/disable here |
| 1753 | | if (mac_model >= MODEL_MAC_SE) |
| 1820 | if ((mac_model == MODEL_MAC_SE) || (mac_model == MODEL_MAC_CLASSIC)) |
| 1754 | 1821 | { |
| 1755 | | mac_scsiirq_enable = (data & 0x40) ? 1 : 0; |
| 1822 | mac_scsiirq_enable = (data & 0x40) ? 0 : 1; |
| 1823 | // printf("VIAB & 0x40 = %02x, IRQ enable %d\n", data & 0x40, mac_scsiirq_enable); |
| 1756 | 1824 | } |
| 1757 | 1825 | |
| 1826 | if (mac_model == MODEL_MAC_SE30) |
| 1827 | { |
| 1828 | // 0x40 = 0 means enable vblank on SE/30 |
| 1829 | mac_se30_vbl_enable = (data & 0x40) ? 0 : 1; |
| 1830 | } |
| 1831 | |
| 1758 | 1832 | rtc_write_rTCEnb(data & 0x04); |
| 1759 | 1833 | new_rtc_rTCClk = (data >> 1) & 0x01; |
| 1760 | 1834 | if ((! new_rtc_rTCClk) && (rtc_rTCClk)) |
| r6043 | r6044 | |
| 1770 | 1844 | static void mac_via_irq(const device_config *device, int state) |
| 1771 | 1845 | { |
| 1772 | 1846 | /* interrupt the 68k (level 1) */ |
| 1773 | | //cputag_set_input_line(machine, "maincpu", 1, state); |
| 1774 | 1847 | set_via_interrupt(device->machine, state); |
| 1775 | 1848 | } |
| 1776 | 1849 | |
| r6043 | r6044 | |
| 1809 | 1882 | |
| 1810 | 1883 | static void mac_via2_irq(const device_config *device, int state) |
| 1811 | 1884 | { |
| 1885 | set_via2_interrupt(device->machine, state); |
| 1812 | 1886 | } |
| 1813 | 1887 | |
| 1814 | 1888 | READ16_HANDLER ( mac_via2_r ) |
| r6043 | r6044 | |
| 1843 | 1917 | |
| 1844 | 1918 | static READ8_DEVICE_HANDLER(mac_via2_in_a) |
| 1845 | 1919 | { |
| 1846 | | logerror("VIA2 IN A (PC %x)\n", cpu_get_pc(cputag_get_cpu(device->machine, "maincpu"))); |
| 1920 | UINT8 result = 0xff; |
| 1847 | 1921 | |
| 1848 | | return 0; |
| 1922 | // logerror("VIA2 IN A (PC %x)\n", cpu_get_pc(cputag_get_cpu(device->machine, "maincpu"))); |
| 1923 | |
| 1924 | if ((mac_model == MODEL_MAC_IICI) || (mac_model == MODEL_MAC_IISI)) |
| 1925 | { |
| 1926 | result &= ~0x40; // RBV wants this clear to boot |
| 1927 | } |
| 1928 | |
| 1929 | if (mac_via2_vbl) |
| 1930 | { |
| 1931 | result &= ~0x20; // indicate slot interrupt |
| 1932 | } |
| 1933 | |
| 1934 | return result; |
| 1849 | 1935 | } |
| 1850 | 1936 | |
| 1851 | 1937 | static READ8_DEVICE_HANDLER(mac_via2_in_b) |
| 1852 | 1938 | { |
| 1853 | | logerror("VIA2 IN B (PC %x)\n", cpu_get_pc(cputag_get_cpu(device->machine, "maincpu"))); |
| 1939 | // logerror("VIA2 IN B (PC %x)\n", cpu_get_pc(cputag_get_cpu(device->machine, "maincpu"))); |
| 1854 | 1940 | |
| 1855 | | return 0; |
| 1941 | return 0xff; |
| 1856 | 1942 | } |
| 1857 | 1943 | |
| 1858 | 1944 | static WRITE8_DEVICE_HANDLER(mac_via2_out_a) |
| 1859 | 1945 | { |
| 1860 | | logerror("VIA2 OUT A: %02x (PC %x)\n", data, cpu_get_pc(cputag_get_cpu(device->machine, "maincpu"))); |
| 1946 | // logerror("VIA2 OUT A: %02x (PC %x)\n", data, cpu_get_pc(cputag_get_cpu(device->machine, "maincpu"))); |
| 1861 | 1947 | } |
| 1862 | 1948 | |
| 1863 | 1949 | static WRITE8_DEVICE_HANDLER(mac_via2_out_b) |
| 1864 | 1950 | { |
| 1865 | | logerror("VIA2 OUT B: %02x (PC %x)\n", data, cpu_get_pc(cputag_get_cpu(device->machine, "maincpu"))); |
| 1951 | const device_config *via_0 = devtag_get_device(device->machine, "via6522_0"); |
| 1952 | |
| 1953 | // logerror("VIA2 OUT B: %02x (PC %x)\n", data, cpu_get_pc(cputag_get_cpu(device->machine, "maincpu"))); |
| 1954 | |
| 1955 | // chain 60.15 Hz to VIA1 |
| 1956 | if ((mac_model != MODEL_MAC_IICI) && (mac_model != MODEL_MAC_IISI)) |
| 1957 | { |
| 1958 | via_ca1_w(via_0, 0, data>>7); |
| 1959 | } |
| 1866 | 1960 | } |
| 1867 | 1961 | |
| 1868 | 1962 | /* ************************************************************************* |
| r6043 | r6044 | |
| 1883 | 1977 | mac_set_screen_buffer(1); |
| 1884 | 1978 | |
| 1885 | 1979 | /* setup sound */ |
| 1886 | | mac_set_sound_buffer(devtag_get_device(machine, "custom"), 0); |
| 1980 | if (mac_model < MODEL_MAC_II) |
| 1981 | { |
| 1982 | mac_set_sound_buffer(devtag_get_device(machine, "custom"), 0); |
| 1983 | } |
| 1887 | 1984 | |
| 1888 | 1985 | if (has_adb()) |
| 1889 | 1986 | { |
| r6043 | r6044 | |
| 1921 | 2018 | { |
| 1922 | 2019 | if (mac_overlay != -1) |
| 1923 | 2020 | { |
| 1924 | | if ((address >= 0x400000) && (address <= 0x4fffff)) |
| 2021 | if ((mac_model == MODEL_MAC_SE) || (mac_model == MODEL_MAC_CLASSIC)) |
| 1925 | 2022 | { |
| 1926 | | set_memory_overlay(space->machine, 0); // kill the overlay |
| 1927 | | mac_overlay = -1; |
| 2023 | if ((address >= 0x400000) && (address <= 0x4fffff)) |
| 2024 | { |
| 2025 | set_memory_overlay(space->machine, 0); // kill the overlay |
| 2026 | mac_overlay = -1; |
| 2027 | } |
| 1928 | 2028 | } |
| 2029 | else if ((mac_model == MODEL_MAC_LC) || (mac_model == MODEL_MAC_LC_II)) |
| 2030 | { |
| 2031 | if ((address >= 0xa00000) && (address <= 0xafffff)) |
| 2032 | { |
| 2033 | set_memory_overlay(space->machine, 0); // kill the overlay |
| 2034 | mac_overlay = -1; |
| 2035 | } |
| 2036 | } |
| 2037 | else if ( ((mac_model >= MODEL_MAC_II) && (mac_model <= MODEL_MAC_SE30)) || (mac_model == MODEL_MAC_CLASSIC_II)) |
| 2038 | { |
| 2039 | if ((address >= 0x40000000) && (address <= 0x4fffffff)) |
| 2040 | { |
| 2041 | set_memory_overlay(space->machine, 0); // kill the overlay |
| 2042 | mac_overlay = -1; |
| 2043 | } |
| 2044 | } |
| 1929 | 2045 | } |
| 1930 | 2046 | |
| 1931 | 2047 | return address; |
| r6043 | r6044 | |
| 1946 | 2062 | mac_install_memory(machine, 0x400000, (model >= MODEL_MAC_PLUS) ? 0x43ffff : 0x5fffff, |
| 1947 | 2063 | memory_region_length(machine, "user1"), memory_region(machine, "user1"), TRUE, 3); |
| 1948 | 2064 | } |
| 1949 | | else if (model == MODEL_MAC_LC) |
| 2065 | else if ((model == MODEL_MAC_LC) || (model == MODEL_MAC_LC_II)) |
| 1950 | 2066 | { |
| 1951 | 2067 | mac_install_memory(machine, 0x000000, 0x9fffff, mess_ram_size, mess_ram, FALSE, 2); |
| 1952 | | |
| 1953 | | // ROM mapping is handled elsewhere for now |
| 1954 | 2068 | } |
| 2069 | else if ((mac_model == MODEL_MAC_CLASSIC_II) || ((mac_model >= MODEL_MAC_II) && (mac_model <= MODEL_MAC_SE30))) |
| 2070 | { |
| 2071 | mac_install_memory(machine, 0x00000000, 0x3fffffff, mess_ram_size, mess_ram, FALSE, 2); |
| 2072 | } |
| 1955 | 2073 | |
| 1956 | 2074 | set_memory_overlay(machine, 1); |
| 1957 | 2075 | |
| 1958 | | if ((model == MODEL_MAC_SE) || (model == MODEL_MAC_CLASSIC)) |
| 2076 | if ((model == MODEL_MAC_SE) || (model == MODEL_MAC_CLASSIC) || (model == MODEL_MAC_CLASSIC_II) || (model == MODEL_MAC_LC) || |
| 2077 | (model == MODEL_MAC_LC_II) || ((mac_model >= MODEL_MAC_II) && (mac_model <= MODEL_MAC_SE30))) |
| 1959 | 2078 | { |
| 1960 | 2079 | // classic will fail RAM test and try to boot appletalk if RAM is not all zero |
| 1961 | 2080 | memset(mess_ram, 0, mess_ram_size); |
| r6043 | r6044 | |
| 1976 | 2095 | state_save_register_postload(machine, mac_state_load, NULL); |
| 1977 | 2096 | } |
| 1978 | 2097 | |
| 1979 | | |
| 1980 | | |
| 1981 | 2098 | DRIVER_INIT(mac128k512k) |
| 1982 | 2099 | { |
| 1983 | 2100 | mac_driver_init(machine, MODEL_MAC_128K512K); |
| r6043 | r6044 | |
| 1990 | 2107 | |
| 1991 | 2108 | static const SCSIConfigTable dev_table = |
| 1992 | 2109 | { |
| 1993 | | 2, /* 2 SCSI devices */ |
| 2110 | 1, /* 2 SCSI devices */ |
| 1994 | 2111 | { |
| 1995 | 2112 | { SCSI_ID_5, "harddisk1", SCSI_DEVICE_HARDDISK }, /* SCSI ID 5, using CHD 1, and it's a harddisk */ |
| 1996 | | { SCSI_ID_6, "harddisk2", SCSI_DEVICE_HARDDISK } /* SCSI ID 6, using CHD 0, and it's a harddisk */ |
| 2113 | // { SCSI_ID_6, "harddisk2", SCSI_DEVICE_HARDDISK } /* SCSI ID 6, using CHD 0, and it's a harddisk */ |
| 1997 | 2114 | } |
| 1998 | 2115 | }; |
| 1999 | 2116 | // 41a868 41a5ac = data copy |
| r6043 | r6044 | |
| 2035 | 2152 | mac_driver_init(machine, MODEL_MAC_LC); |
| 2036 | 2153 | } |
| 2037 | 2154 | |
| 2155 | DRIVER_INIT(maclc2) |
| 2156 | { |
| 2157 | mac_driver_init(machine, MODEL_MAC_LC_II); |
| 2158 | } |
| 2159 | |
| 2160 | DRIVER_INIT(maciicx) |
| 2161 | { |
| 2162 | mac_driver_init(machine, MODEL_MAC_IICX); |
| 2163 | } |
| 2164 | |
| 2165 | DRIVER_INIT(maciifdhd) |
| 2166 | { |
| 2167 | mac_driver_init(machine, MODEL_MAC_II_FDHD); |
| 2168 | } |
| 2169 | |
| 2170 | DRIVER_INIT(maciix) |
| 2171 | { |
| 2172 | mac_driver_init(machine, MODEL_MAC_IIX); |
| 2173 | } |
| 2174 | |
| 2175 | DRIVER_INIT(maciici) |
| 2176 | { |
| 2177 | mac_driver_init(machine, MODEL_MAC_IICI); |
| 2178 | } |
| 2179 | |
| 2180 | DRIVER_INIT(maciisi) |
| 2181 | { |
| 2182 | mac_driver_init(machine, MODEL_MAC_IISI); |
| 2183 | } |
| 2184 | |
| 2185 | DRIVER_INIT(macse30) |
| 2186 | { |
| 2187 | mac_driver_init(machine, MODEL_MAC_SE30); |
| 2188 | } |
| 2189 | |
| 2190 | DRIVER_INIT(macclassic2) |
| 2191 | { |
| 2192 | mac_driver_init(machine, MODEL_MAC_CLASSIC_II); |
| 2193 | } |
| 2194 | |
| 2038 | 2195 | static void mac_vblank_irq(running_machine *machine) |
| 2039 | 2196 | { |
| 2040 | 2197 | static int irq_count = 0, ca1_data = 0, ca2_data = 0; |
| r6043 | r6044 | |
| 2063 | 2220 | } |
| 2064 | 2221 | |
| 2065 | 2222 | /* signal VBlank on CA1 input on the VIA */ |
| 2066 | | ca1_data ^= 1; |
| 2067 | | via_ca1_w(via_0, 0, ca1_data); |
| 2223 | if ((mac_model < MODEL_MAC_II) || (mac_model == MODEL_MAC_IICI) || (mac_model != MODEL_MAC_IISI)) |
| 2224 | { |
| 2225 | ca1_data ^= 1; |
| 2226 | via_ca1_w(via_0, 0, ca1_data); |
| 2227 | } |
| 2068 | 2228 | |
| 2069 | 2229 | if (++irq_count == 60) |
| 2070 | 2230 | { |
| r6043 | r6044 | |
| 2076 | 2236 | |
| 2077 | 2237 | rtc_incticks(); |
| 2078 | 2238 | } |
| 2239 | |
| 2240 | // try generating a slot interrupt every frame too |
| 2241 | if (mac_model >= MODEL_MAC_II) |
| 2242 | { |
| 2243 | const device_config *via_1 = devtag_get_device(machine, "via6522_1"); |
| 2244 | |
| 2245 | if (mac_model == MODEL_MAC_SE30) |
| 2246 | { |
| 2247 | if (mac_se30_vbl_enable) |
| 2248 | { |
| 2249 | mac_via2_vbl ^= 1; |
| 2250 | via_ca1_w(via_1, 0, mac_via2_vbl); |
| 2251 | } |
| 2252 | } |
| 2253 | else if ((mac_model != MODEL_MAC_IICI) && (mac_model != MODEL_MAC_IISI)) |
| 2254 | { |
| 2255 | mac_via2_vbl ^= 1; |
| 2256 | via_ca1_w(via_1, 0, mac_via2_vbl); |
| 2257 | } |
| 2258 | } |
| 2079 | 2259 | } |
| 2080 | 2260 | |
| 2081 | 2261 | |
| r6043 | r6044 | |
| 2084 | 2264 | { |
| 2085 | 2265 | int scanline; |
| 2086 | 2266 | |
| 2087 | | mac_sh_updatebuffer(devtag_get_device(machine, "custom")); |
| 2267 | if (mac_model < MODEL_MAC_II) |
| 2268 | { |
| 2269 | mac_sh_updatebuffer(devtag_get_device(machine, "custom")); |
| 2270 | } |
| 2088 | 2271 | |
| 2089 | 2272 | scanline = video_screen_get_vpos(machine->primary_screen); |
| 2090 | 2273 | if (scanline == MAC_V_VIS) |
| 2091 | 2274 | mac_vblank_irq(machine); |
| 2092 | 2275 | |
| 2093 | 2276 | /* check for mouse changes at 10 irqs per frame */ |
| 2094 | | if (!(scanline % 10)) |
| 2095 | | mouse_callback(machine); |
| 2277 | if (mac_model <= MODEL_MAC_PLUS) |
| 2278 | { |
| 2279 | if (!(scanline % 10)) |
| 2280 | mouse_callback(machine); |
| 2281 | } |
| 2096 | 2282 | |
| 2097 | 2283 | timer_adjust_oneshot(mac_scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, (scanline+1) % MAC_V_TOTAL, 0), 0); |
| 2098 | 2284 | } |
src/mess/drivers/mac.c
| r6043 | r6044 | |
| 1 | 1 | /**************************************************************************** |
| 2 | 2 | |
| 3 | | drivers/mac.c |
| 4 | | Mac Plus & 512ke emulation |
| 3 | drivers/mac.c |
| 4 | Macintosh family emulation |
| 5 | |
| 6 | Nate Woods, Raphael Nabet, R. Belmont |
| 7 | |
| 8 | |
| 9 | 0x000000 - 0x3fffff RAM/ROM (switches based on overlay) |
| 10 | 0x400000 - 0x4fffff ROM |
| 11 | 0x580000 - 0x5fffff 5380 NCR/Symbios SCSI peripherals chip (Mac Plus only) |
| 12 | 0x600000 - 0x6fffff RAM |
| 13 | 0x800000 - 0x9fffff Zilog 8530 SCC (Serial Control Chip) Read |
| 14 | 0xa00000 - 0xbfffff Zilog 8530 SCC (Serial Control Chip) Write |
| 15 | 0xc00000 - 0xdfffff IWM (Integrated Woz Machine; floppy) |
| 16 | 0xe80000 - 0xefffff Rockwell 6522 VIA |
| 17 | 0xf00000 - 0xffffef ??? (the ROM appears to be accessing here) |
| 18 | 0xfffff0 - 0xffffff Auto Vector |
| 19 | |
| 20 | |
| 21 | Interrupts: |
| 22 | M68K: |
| 23 | Level 1 from VIA |
| 24 | Level 2 from SCC |
| 25 | Level 4 : Interrupt switch (not implemented) |
| 26 | |
| 27 | VIA: |
| 28 | CA1 from VBLANK |
| 29 | CA2 from 1 Hz clock (RTC) |
| 30 | CB1 from Keyboard Clock |
| 31 | CB2 from Keyboard Data |
| 32 | SR from Keyboard Data Ready |
| 33 | |
| 34 | SCC: |
| 35 | PB_EXT from mouse Y circuitry |
| 36 | PA_EXT from mouse X circuitry |
| 5 | 37 | |
| 6 | | Nate Woods, Raphael Nabet |
| 7 | | |
| 8 | | |
| 9 | | 0x000000 - 0x3fffff RAM/ROM (switches based on overlay) |
| 10 | | 0x400000 - 0x4fffff ROM |
| 11 | | 0x580000 - 0x5fffff 5380 NCR/Symbios SCSI peripherals chip (Mac Plus only) |
| 12 | | 0x600000 - 0x6fffff RAM |
| 13 | | 0x800000 - 0x9fffff Zilog 8530 SCC (Serial Control Chip) Read |
| 14 | | 0xa00000 - 0xbfffff Zilog 8530 SCC (Serial Control Chip) Write |
| 15 | | 0xc00000 - 0xdfffff IWM (Integrated Woz Machine; floppy) |
| 16 | | 0xe80000 - 0xefffff Rockwell 6522 VIA |
| 17 | | 0xf00000 - 0xffffef ??? (the ROM appears to be accessing here) |
| 18 | | 0xfffff0 - 0xffffff Auto Vector |
| 19 | | |
| 20 | | |
| 21 | | Interrupts: |
| 22 | | M68K: |
| 23 | | Level 1 from VIA |
| 24 | | Level 2 from SCC |
| 25 | | Level 4 : Interrupt switch (not implemented) |
| 26 | | |
| 27 | | VIA: |
| 28 | | CA1 from VBLANK |
| 29 | | CA2 from 1 Hz clock (RTC) |
| 30 | | CB1 from Keyboard Clock |
| 31 | | CB2 from Keyboard Data |
| 32 | | SR from Keyboard Data Ready |
| 33 | | |
| 34 | | SCC: |
| 35 | | PB_EXT from mouse Y circuitry |
| 36 | | PA_EXT from mouse X circuitry |
| 37 | | |
| 38 | 38 | ****************************************************************************/ |
| 39 | 39 | |
| 40 | 40 | #include "driver.h" |
| r6043 | r6044 | |
| 47 | 47 | #include "devices/harddriv.h" |
| 48 | 48 | #include "formats/ap_dsk35.h" |
| 49 | 49 | |
| 50 | | // LC: boot needs 50f04000 bit 0 to go "1" at a49f00. SCC. |
| 50 | UINT32 *se30_vram; |
| 51 | 51 | |
| 52 | 52 | /* |
| 53 | | Apple Sound Chip |
| 53 | Apple Sound Chip |
| 54 | 54 | |
| 55 | | Base is normally IOBase + 0x14000 |
| 56 | | First 0x800 bytes is buffer RAM |
| 55 | Base is normally IOBase + 0x14000 |
| 56 | First 0x800 bytes is buffer RAM |
| 57 | 57 | |
| 58 | | Verified to be only 8 bits wide by Apple documentation. |
| 58 | Verified to be only 8 bits wide by Apple documentation. |
| 59 | 59 | |
| 60 | | Registers: |
| 61 | | 0x800: CONTROL |
| 62 | | 0x801: ENABLE |
| 63 | | 0x802: MODE |
| 64 | | 0x806: VOLUME |
| 65 | | 0x807: CHAN |
| 60 | Registers: |
| 61 | 0x800: CONTROL |
| 62 | 0x801: ENABLE |
| 63 | 0x802: MODE |
| 64 | 0x806: VOLUME |
| 65 | 0x807: CHAN |
| 66 | 66 | */ |
| 67 | 67 | |
| 68 | 68 | static UINT8 mac_asc_regs[0x2000]; |
| 69 | 69 | |
| 70 | 70 | static READ8_HANDLER(mac_asc_r) |
| 71 | 71 | { |
| 72 | | logerror("ASC: Read @ %x (PC %x)\n", offset, cpu_get_pc(cputag_get_cpu(space->machine, "maincpu"))); |
| 72 | // logerror("ASC: Read @ %x (PC %x)\n", offset, cpu_get_pc(cputag_get_cpu(space->machine, "maincpu"))); |
| 73 | 73 | |
| 74 | 74 | return mac_asc_regs[offset]; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | static WRITE8_HANDLER(mac_asc_w) |
| 78 | 78 | { |
| 79 | | logerror("ASC: %02x to %x (PC %x)\n", data, offset, cpu_get_pc(cputag_get_cpu(space->machine, "maincpu"))); |
| 79 | // logerror("ASC: %02x to %x (PC %x)\n", data, offset, cpu_get_pc(cputag_get_cpu(space->machine, "maincpu"))); |
| 80 | 80 | |
| 81 | 81 | mac_asc_regs[offset] = data; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | static READ32_HANDLER(mac_swim_r) |
| 85 | { |
| 86 | return 0x17171717; |
| 87 | } |
| 88 | |
| 89 | /* |
| 90 | RasterOps ColorBoard 264: fixed resolution 640x480 NuBus video card, 1/4/8/16/24 bit color |
| 91 | 1.5? MB of VRAM (tests up to 0x1fffff), Bt473 RAMDAC, and two custom gate arrays. |
| 92 | */ |
| 93 | |
| 94 | static UINT32 *cb264_vram; |
| 95 | static UINT32 cb264_mode = 0; // 0 = true color, 2 = 1bpp monochrome, others unknown |
| 96 | static UINT32 cb264_palette[256]; |
| 97 | |
| 98 | static VIDEO_START( cb264 ) |
| 99 | { |
| 100 | } |
| 101 | |
| 102 | static VIDEO_UPDATE( cb264 ) |
| 103 | { |
| 104 | UINT32 *scanline, *base; |
| 105 | int x, y; |
| 106 | |
| 107 | if (input_code_pressed(screen->machine, KEYCODE_G)) |
| 108 | { |
| 109 | FILE *f; |
| 110 | |
| 111 | f = fopen("vram.bin", "wb"); |
| 112 | fwrite(cb264_vram, 0x300000, 1, f); |
| 113 | fclose(f); |
| 114 | printf("Dumped CB264 VRAM\n"); |
| 115 | } |
| 116 | |
| 117 | if (cb264_mode == 0) |
| 118 | { |
| 119 | for (y = 0; y < 480; y++) |
| 120 | { |
| 121 | scanline = BITMAP_ADDR32(bitmap, y, 0); |
| 122 | base = &cb264_vram[y * 1024]; |
| 123 | for (x = 0; x < 640; x++) |
| 124 | { |
| 125 | *scanline++ = *base++; |
| 126 | } |
| 127 | } |
| 128 | } |
| 129 | else if (cb264_mode == 2) |
| 130 | { |
| 131 | UINT8 *vram8 = (UINT8 *)cb264_vram; //, *base8; |
| 132 | UINT8 pixels; |
| 133 | |
| 134 | for (y = 0; y < 480; y++) |
| 135 | { |
| 136 | scanline = BITMAP_ADDR32(bitmap, y, 0); |
| 137 | for (x = 0; x < 640; x+=8) |
| 138 | { |
| 139 | pixels = vram8[(y * 1024) + ((x/8)^3)]; |
| 140 | |
| 141 | *scanline++ = cb264_palette[(pixels>>7)^1]; |
| 142 | *scanline++ = cb264_palette[((pixels>>6)&1)^1]; |
| 143 | *scanline++ = cb264_palette[((pixels>>5)&1)^1]; |
| 144 | *scanline++ = cb264_palette[((pixels>>4)&1)^1]; |
| 145 | *scanline++ = cb264_palette[((pixels>>3)&1)^1]; |
| 146 | *scanline++ = cb264_palette[((pixels>>2)&1)^1]; |
| 147 | *scanline++ = cb264_palette[((pixels>>1)&1)^1]; |
| 148 | *scanline++ = cb264_palette[(pixels&1)^1]; |
| 149 | } |
| 150 | } |
| 151 | } |
| 152 | else |
| 153 | { |
| 154 | fatalerror("cb264: unknown video mode %d\n", cb264_mode); |
| 155 | } |
| 156 | |
| 157 | return 0; |
| 158 | } |
| 159 | |
| 160 | static WRITE32_HANDLER( cb264_mode_w ) |
| 161 | { |
| 162 | cb264_mode = data; |
| 163 | } |
| 164 | |
| 165 | static UINT32 cb264_toggle = 0; |
| 166 | static READ32_HANDLER( cb264_status_r ) |
| 167 | { |
| 168 | cb264_toggle ^= 1; |
| 169 | return cb264_toggle; // probably bit 0 is vblank |
| 170 | } |
| 171 | |
| 172 | static UINT32 cb264_colors[3], cb264_count, cb264_clutoffs; |
| 173 | static WRITE32_HANDLER( cb264_ramdac_w ) |
| 174 | { |
| 175 | if (!offset) |
| 176 | { |
| 177 | cb264_clutoffs = data>>24; |
| 178 | cb264_count = 0; |
| 179 | } |
| 180 | else |
| 181 | { |
| 182 | cb264_colors[cb264_count++] = data>>24; |
| 183 | |
| 184 | if (cb264_count == 3) |
| 185 | { |
| 186 | cb264_count = 0; |
| 187 | cb264_clutoffs++; |
| 188 | palette_set_color(space->machine, cb264_clutoffs, MAKE_RGB(cb264_colors[0], cb264_colors[1], cb264_colors[2])); |
| 189 | cb264_palette[cb264_clutoffs] = MAKE_RGB(cb264_colors[0], cb264_colors[1], cb264_colors[2]); |
| 190 | } |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | // IIci/IIsi RAM-Based Video (RBV) |
| 195 | |
| 196 | // 512x384x1 framebuffer at fb008000 |
| 197 | // 640x480x1 framebuffer at fee00000 |
| 198 | |
| 199 | static UINT32 *rbv_vram; |
| 200 | |
| 201 | static UINT32 rbv_colors[3], rbv_count, rbv_clutoffs; |
| 202 | static UINT32 rbv_palette[256]; |
| 203 | |
| 204 | static VIDEO_UPDATE( macrbv ) |
| 205 | { |
| 206 | UINT32 *scanline; |
| 207 | int x, y; |
| 208 | UINT8 *vram8 = (UINT8 *)rbv_vram; |
| 209 | UINT8 pixels; |
| 210 | |
| 211 | for (y = 0; y < 480; y++) |
| 212 | { |
| 213 | scanline = BITMAP_ADDR32(bitmap, y, 0); |
| 214 | for (x = 0; x < 640; x+=8) |
| 215 | { |
| 216 | pixels = vram8[(y * 1024) + ((x/8)^3)]; |
| 217 | |
| 218 | *scanline++ = rbv_palette[(pixels>>7)^1]; |
| 219 | *scanline++ = rbv_palette[((pixels>>6)&1)^1]; |
| 220 | *scanline++ = rbv_palette[((pixels>>5)&1)^1]; |
| 221 | *scanline++ = rbv_palette[((pixels>>4)&1)^1]; |
| 222 | *scanline++ = rbv_palette[((pixels>>3)&1)^1]; |
| 223 | *scanline++ = rbv_palette[((pixels>>2)&1)^1]; |
| 224 | *scanline++ = rbv_palette[((pixels>>1)&1)^1]; |
| 225 | *scanline++ = rbv_palette[(pixels&1)^1]; |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | return 0; |
| 230 | } |
| 231 | |
| 232 | static WRITE32_HANDLER( rbv_ramdac_w ) |
| 233 | { |
| 234 | if (!offset) |
| 235 | { |
| 236 | rbv_clutoffs = data>>24; |
| 237 | rbv_count = 0; |
| 238 | } |
| 239 | else |
| 240 | { |
| 241 | rbv_colors[rbv_count++] = data>>24; |
| 242 | |
| 243 | if (rbv_count == 3) |
| 244 | { |
| 245 | rbv_count = 0; |
| 246 | rbv_clutoffs++; |
| 247 | palette_set_color(space->machine, rbv_clutoffs, MAKE_RGB(rbv_colors[0], rbv_colors[1], rbv_colors[2])); |
| 248 | rbv_palette[rbv_clutoffs] = MAKE_RGB(rbv_colors[0], rbv_colors[1], rbv_colors[2]); |
| 249 | } |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | |
| 254 | static UINT32 rbv_toggle = 0; |
| 255 | READ16_HANDLER ( mac_rbv_r ) |
| 256 | { |
| 257 | int data; |
| 258 | const device_config *via_1 = devtag_get_device(space->machine, "via6522_1"); |
| 259 | |
| 260 | // logerror("rbv_r: %x, mask %x\n", offset, mem_mask); |
| 261 | |
| 262 | if (offset == 1) |
| 263 | { |
| 264 | rbv_toggle ^= 0x4040; |
| 265 | return rbv_toggle; |
| 266 | } |
| 267 | |
| 268 | if (offset == 0x0010) |
| 269 | { |
| 270 | logerror("RBV: Read monitor type (PC=%x)\n", cpu_get_pc(space->cpu)); |
| 271 | |
| 272 | data = (6<<3) | 3; // 13" RGB, 8 bits per pixel |
| 273 | |
| 274 | return (data & 0xff) | (data << 8); |
| 275 | } |
| 276 | |
| 277 | offset >>= 8; |
| 278 | offset &= 0x0f; |
| 279 | |
| 280 | data = via_r(via_1, offset); |
| 281 | |
| 282 | return (data & 0xff) | (data << 8); |
| 283 | } |
| 284 | |
| 285 | WRITE16_HANDLER ( mac_rbv_w ) |
| 286 | { |
| 287 | const device_config *via_1 = devtag_get_device(space->machine, "via6522_1"); |
| 288 | |
| 289 | // logerror("rbv_w: %x to offset %x, mask %x\n", data, offset, mem_mask); |
| 290 | |
| 291 | offset >>= 8; |
| 292 | offset &= 0x0f; |
| 293 | |
| 294 | if (ACCESSING_BITS_8_15) |
| 295 | via_w(via_1, offset, (data >> 8) & 0xff); |
| 296 | } |
| 297 | |
| 84 | 298 | /*************************************************************************** |
| 85 | 299 | ADDRESS MAPS |
| 86 | 300 | ***************************************************************************/ |
| r6043 | r6044 | |
| 103 | 317 | ADDRESS_MAP_END |
| 104 | 318 | |
| 105 | 319 | static ADDRESS_MAP_START(maclc_map, ADDRESS_SPACE_PROGRAM, 32) |
| 106 | | AM_RANGE(0x00fc0000, 0x00ffffff) AM_RAM AM_SHARE(1) // VRAM framebuffer |
| 107 | | AM_RANGE(0x00a00000, 0x00a7ffff) AM_ROM AM_REGION("user1", 0) // ROM (in 24-bit mode) |
| 108 | | AM_RANGE(0x40a00000, 0x40a7ffff) AM_ROM AM_REGION("user1", 0) // ROM (in 32-bit mode) |
| 109 | | AM_RANGE(0x50f00000, 0x50f01fff) AM_READ16(mac_via_r, 0xffffffff) |
| 110 | | AM_RANGE(0x50f00000, 0x50f01fff) AM_WRITE16(mac_via_w, 0xffffffff) |
| 111 | | AM_RANGE(0x50f04000, 0x50f05fff) AM_READ16(mac_scc_r, 0xffffffff) AM_WRITE16(mac_scc_2_w, 0xffffffff) |
| 320 | AM_RANGE(0x00a00000, 0x00a7ffff) AM_ROM AM_REGION("user1", 0) // ROM (in 32-bit mode) |
| 321 | |
| 322 | AM_RANGE(0x50f00000, 0x50f01fff) AM_READWRITE16(mac_via_r, mac_via_w, 0xffffffff) |
| 323 | AM_RANGE(0x50f04000, 0x50f05fff) AM_READWRITE16(mac_scc_r, mac_scc_2_w, 0xffffffff) |
| 324 | // 50f06000-7fff = SCSI handshake |
| 325 | |
| 326 | // 50f10000-1fff = SCSI |
| 327 | // 50f12000-3fff = SCSI DMA |
| 112 | 328 | AM_RANGE(0x50f14000, 0x50f15fff) AM_READ8(mac_asc_r, 0xffffffff) AM_WRITE8(mac_asc_w, 0xffffffff) |
| 113 | | AM_RANGE(0x50f26000, 0x50f27fff) AM_READ16(mac_via2_r, 0xffffffff) // VIA2 |
| 114 | | AM_RANGE(0x50f26000, 0x50f27fff) AM_WRITE16(mac_via2_w, 0xffffffff) |
| 115 | | AM_RANGE(0x50fc0000, 0x50ffffff) AM_RAM AM_SHARE(1) |
| 329 | AM_RANGE(0x50f16000, 0x50f17fff) AM_READ(mac_swim_r) AM_WRITENOP |
| 330 | // 50f18000-9fff = PWMs |
| 331 | |
| 332 | // 50f24000-5fff = VDAC (palette) |
| 333 | AM_RANGE(0x50f24000, 0x50f25fff) AM_RAM |
| 334 | AM_RANGE(0x50f26000, 0x50f27fff) AM_READWRITE16(mac_via2_r, mac_via2_w, 0xffffffff) // VIA2 (RBV) |
| 335 | |
| 336 | AM_RANGE(0xfeff8000, 0xfeffffff) AM_ROM AM_REGION("user1", 0x78000) |
| 116 | 337 | ADDRESS_MAP_END |
| 117 | 338 | |
| 339 | static ADDRESS_MAP_START(macii_map, ADDRESS_SPACE_PROGRAM, 32) |
| 340 | AM_RANGE(0x40000000, 0x4003ffff) AM_ROM AM_REGION("user1", 0) AM_MIRROR(0x0ffc0000) |
| 118 | 341 | |
| 342 | AM_RANGE(0x50f00000, 0x50f01fff) AM_READWRITE16(mac_via_r, mac_via_w, 0xffffffff) |
| 343 | AM_RANGE(0x50f02000, 0x50f03fff) AM_READWRITE16(mac_via2_r, mac_via2_w, 0xffffffff) |
| 344 | AM_RANGE(0x50f04000, 0x50f05fff) AM_READWRITE16(mac_scc_r, mac_scc_2_w, 0xffffffff) |
| 345 | |
| 346 | AM_RANGE(0x50f10000, 0x50f11fff) AM_READWRITE16(macplus_scsi_r, macii_scsi_w, 0xffffffff) |
| 347 | AM_RANGE(0x50f12060, 0x50f12063) AM_READ(macii_scsi_drq_r) |
| 348 | AM_RANGE(0x50f14000, 0x50f15fff) AM_READ8(mac_asc_r, 0xffffffff) AM_WRITE8(mac_asc_w, 0xffffffff) |
| 349 | AM_RANGE(0x50f16000, 0x50f17fff) AM_READ(mac_swim_r) AM_WRITENOP |
| 350 | |
| 351 | AM_RANGE(0x50f40000, 0x50f41fff) AM_READWRITE16(mac_via_r, mac_via_w, 0xffffffff) // mirror |
| 352 | |
| 353 | // RasterOps 264 640x480 fixed-res color video card (8, 16, or 24 bit) |
| 354 | AM_RANGE(0xfe000000, 0xfe1fffff) AM_RAM AM_BASE(&cb264_vram) // supposed to be 1.5 megs of VRAM, but every other word? |
| 355 | AM_RANGE(0xfeff6018, 0xfeff601b) AM_WRITE( cb264_mode_w ) |
| 356 | AM_RANGE(0xfeff6034, 0xfeff6037) AM_READ( cb264_status_r ) |
| 357 | AM_RANGE(0xfeff7000, 0xfeff7007) AM_WRITE( cb264_ramdac_w ) |
| 358 | AM_RANGE(0xfeff8000, 0xfeffffff) AM_ROM AM_REGION("rops264", 0) |
| 359 | ADDRESS_MAP_END |
| 360 | |
| 361 | static ADDRESS_MAP_START(maciici_map, ADDRESS_SPACE_PROGRAM, 32) |
| 362 | AM_RANGE(0x40000000, 0x4007ffff) AM_ROM AM_REGION("user1", 0) AM_MIRROR(0x0ff80000) |
| 363 | |
| 364 | // MMU remaps I/O without the F |
| 365 | AM_RANGE(0x50000000, 0x50001fff) AM_READWRITE16(mac_via_r, mac_via_w, 0xffffffff) |
| 366 | AM_RANGE(0x50004000, 0x50005fff) AM_READWRITE16(mac_scc_r, mac_scc_2_w, 0xffffffff) |
| 367 | |
| 368 | AM_RANGE(0x50010000, 0x50011fff) AM_READWRITE16(macplus_scsi_r, macii_scsi_w, 0xffffffff) |
| 369 | AM_RANGE(0x50012060, 0x50012063) AM_READ(macii_scsi_drq_r) |
| 370 | AM_RANGE(0x50014000, 0x50015fff) AM_READ8(mac_asc_r, 0xffffffff) AM_WRITE8(mac_asc_w, 0xffffffff) |
| 371 | AM_RANGE(0x50016000, 0x50017fff) AM_READ(mac_swim_r) AM_WRITENOP |
| 372 | |
| 373 | AM_RANGE(0x50024000, 0x50024007) AM_WRITE( rbv_ramdac_w ) |
| 374 | AM_RANGE(0x50026000, 0x50027fff) AM_READWRITE16(mac_rbv_r, mac_rbv_w, 0xffffffff) |
| 375 | |
| 376 | AM_RANGE(0x50040000, 0x50041fff) AM_READWRITE16(mac_via_r, mac_via_w, 0xffffffff) // mirror |
| 377 | |
| 378 | // upper (need to use AM_MIRROR for this) |
| 379 | |
| 380 | AM_RANGE(0x50f00000, 0x50f01fff) AM_READWRITE16(mac_via_r, mac_via_w, 0xffffffff) |
| 381 | AM_RANGE(0x50f04000, 0x50f05fff) AM_READWRITE16(mac_scc_r, mac_scc_2_w, 0xffffffff) |
| 382 | |
| 383 | AM_RANGE(0x50f10000, 0x50f11fff) AM_READWRITE16(macplus_scsi_r, macii_scsi_w, 0xffffffff) |
| 384 | AM_RANGE(0x50f12060, 0x50f12063) AM_READ(macii_scsi_drq_r) |
| 385 | AM_RANGE(0x50f14000, 0x50f15fff) AM_READ8(mac_asc_r, 0xffffffff) AM_WRITE8(mac_asc_w, 0xffffffff) |
| 386 | AM_RANGE(0x50f16000, 0x50f17fff) AM_READ(mac_swim_r) AM_WRITENOP |
| 387 | |
| 388 | // 50f24000 = VDAC |
| 389 | AM_RANGE(0x50f26000, 0x50f27fff) AM_READWRITE16(mac_rbv_r, mac_rbv_w, 0xffffffff) |
| 390 | // 51000000-51ffffff = RBV (framebuffer?) |
| 391 | |
| 392 | AM_RANGE(0x50f40000, 0x50f41fff) AM_READWRITE16(mac_via_r, mac_via_w, 0xffffffff) // mirror |
| 393 | |
| 394 | // mirror video declaration ROM |
| 395 | AM_RANGE(0xfee00000, 0xfee7ffff) AM_RAM AM_BASE(&rbv_vram) |
| 396 | AM_RANGE(0xfeff8000, 0xfeffffff) AM_ROM AM_REGION("user1", 0x78000) |
| 397 | ADDRESS_MAP_END |
| 398 | |
| 399 | static ADDRESS_MAP_START(macse30_map, ADDRESS_SPACE_PROGRAM, 32) |
| 400 | AM_RANGE(0x40000000, 0x4003ffff) AM_ROM AM_REGION("user1", 0) AM_MIRROR(0x0ffc0000) |
| 401 | |
| 402 | AM_RANGE(0x50f00000, 0x50f01fff) AM_READWRITE16(mac_via_r, mac_via_w, 0xffffffff) |
| 403 | AM_RANGE(0x50f02000, 0x50f03fff) AM_READWRITE16(mac_via2_r, mac_via2_w, 0xffffffff) |
| 404 | AM_RANGE(0x50f04000, 0x50f05fff) AM_READWRITE16(mac_scc_r, mac_scc_2_w, 0xffffffff) |
| 405 | |
| 406 | AM_RANGE(0x50f10000, 0x50f11fff) AM_READWRITE16(macplus_scsi_r, macii_scsi_w, 0xffffffff) |
| 407 | AM_RANGE(0x50f12060, 0x50f12063) AM_READ(macii_scsi_drq_r) |
| 408 | AM_RANGE(0x50f14000, 0x50f15fff) AM_READ8(mac_asc_r, 0xffffffff) AM_WRITE8(mac_asc_w, 0xffffffff) |
| 409 | AM_RANGE(0x50f16000, 0x50f17fff) AM_READ(mac_swim_r) AM_WRITENOP |
| 410 | |
| 411 | AM_RANGE(0x50f40000, 0x50f41fff) AM_READWRITE16(mac_via_r, mac_via_w, 0xffffffff) // mirror |
| 412 | |
| 413 | AM_RANGE(0xfe000000, 0xfe00ffff) AM_RAM AM_BASE(&se30_vram) |
| 414 | AM_RANGE(0xfeffe000, 0xfeffffff) AM_ROM AM_REGION("se30vrom", 0x0) |
| 415 | ADDRESS_MAP_END |
| 416 | |
| 417 | static ADDRESS_MAP_START(macclas2_map, ADDRESS_SPACE_PROGRAM, 32) |
| 418 | AM_RANGE(0x40000000, 0x4007ffff) AM_ROM AM_REGION("user1", 0) AM_MIRROR(0x0ff80000) |
| 419 | |
| 420 | AM_RANGE(0x50f00000, 0x50f01fff) AM_READWRITE16(mac_via_r, mac_via_w, 0xffffffff) |
| 421 | AM_RANGE(0x50f02000, 0x50f03fff) AM_READWRITE16(mac_via2_r, mac_via2_w, 0xffffffff) |
| 422 | AM_RANGE(0x50f04000, 0x50f05fff) AM_READWRITE16(mac_scc_r, mac_scc_2_w, 0xffffffff) |
| 423 | |
| 424 | AM_RANGE(0x50f10000, 0x50f11fff) AM_READWRITE16(macplus_scsi_r, macii_scsi_w, 0xffffffff) |
| 425 | AM_RANGE(0x50f12060, 0x50f12063) AM_READ(macii_scsi_drq_r) |
| 426 | AM_RANGE(0x50f14000, 0x50f15fff) AM_READ8(mac_asc_r, 0xffffffff) AM_WRITE8(mac_asc_w, 0xffffffff) |
| 427 | AM_RANGE(0x50f16000, 0x50f17fff) AM_READ(mac_swim_r) AM_WRITENOP |
| 428 | |
| 429 | AM_RANGE(0x50f40000, 0x50f41fff) AM_READWRITE16(mac_via_r, mac_via_w, 0xffffffff) // mirror |
| 430 | |
| 431 | // mirror video declaration ROM |
| 432 | AM_RANGE(0xfeff8000, 0xfeffffff) AM_ROM AM_REGION("user1", 0x78000) |
| 433 | ADDRESS_MAP_END |
| 434 | |
| 435 | VIDEO_START( maclc ) |
| 436 | { |
| 437 | } |
| 438 | |
| 439 | VIDEO_UPDATE( maclc ) |
| 440 | { |
| 441 | return 0; |
| 442 | } |
| 443 | |
| 444 | |
| 119 | 445 | /*************************************************************************** |
| 120 | 446 | DEVICE CONFIG |
| 121 | 447 | ***************************************************************************/ |
| r6043 | r6044 | |
| 193 | 519 | /* devices */ |
| 194 | 520 | MDRV_IWM_ADD("fdc", mac_iwm_interface) |
| 195 | 521 | MDRV_FLOPPY_SONY_2_DRIVES_ADD(mac128512_floppy_config) |
| 196 | | |
| 522 | |
| 197 | 523 | MDRV_SCC8530_ADD("scc") |
| 198 | 524 | MDRV_SCC8530_ACK(mac_scc_ack) |
| 199 | 525 | MDRV_VIA6522_ADD("via6522_0", 1000000, mac_via6522_intf) |
| r6043 | r6044 | |
| 208 | 534 | |
| 209 | 535 | MDRV_HARDDISK_ADD( "harddisk1" ) |
| 210 | 536 | MDRV_HARDDISK_ADD( "harddisk2" ) |
| 211 | | |
| 537 | |
| 212 | 538 | MDRV_FLOPPY_SONY_2_DRIVES_MODIFY(mac_floppy_config) |
| 213 | 539 | MACHINE_DRIVER_END |
| 214 | 540 | |
| r6043 | r6044 | |
| 220 | 546 | MDRV_VIA6522_ADD("via6522_0", 1000000, mac_via6522_adb_intf) |
| 221 | 547 | MACHINE_DRIVER_END |
| 222 | 548 | |
| 549 | static MACHINE_DRIVER_START( mac2fdhd ) |
| 550 | /* basic machine hardware */ |
| 551 | MDRV_CPU_ADD("maincpu", M68020_68851, 7833600*2) |
| 552 | MDRV_CPU_PROGRAM_MAP(macii_map) |
| 553 | MDRV_SCREEN_ADD("screen", RASTER) |
| 554 | MDRV_SCREEN_REFRESH_RATE(60.15) |
| 555 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1260)) |
| 556 | MDRV_QUANTUM_TIME(HZ(60)) |
| 557 | |
| 558 | MDRV_MACHINE_START(macscsi) |
| 559 | MDRV_MACHINE_RESET( mac ) |
| 560 | |
| 561 | /* video hardware */ |
| 562 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| 563 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 564 | MDRV_SCREEN_SIZE(1024, 768) |
| 565 | MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 566 | MDRV_PALETTE_LENGTH(256) |
| 567 | |
| 568 | MDRV_VIDEO_START(cb264) |
| 569 | MDRV_VIDEO_UPDATE(cb264) |
| 570 | |
| 571 | /* sound hardware */ |
| 572 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 573 | |
| 574 | /* nvram */ |
| 575 | MDRV_NVRAM_HANDLER(mac) |
| 576 | |
| 577 | /* devices */ |
| 578 | MDRV_IWM_ADD("fdc", mac_iwm_interface) |
| 579 | MDRV_FLOPPY_SONY_2_DRIVES_ADD(mac_floppy_config) |
| 580 | |
| 581 | MDRV_SCC8530_ADD("scc") |
| 582 | MDRV_SCC8530_ACK(mac_scc_ack) |
| 583 | MDRV_VIA6522_ADD("via6522_0", 1000000, mac_via6522_intf) |
| 584 | |
| 585 | MDRV_DEVICE_REMOVE("via6522_0") |
| 586 | MDRV_VIA6522_ADD("via6522_0", 1000000, mac_via6522_adb_intf) |
| 587 | MDRV_VIA6522_ADD("via6522_1", 1000000, mac_via6522_2_intf) |
| 588 | |
| 589 | MDRV_HARDDISK_ADD( "harddisk1" ) |
| 590 | MDRV_HARDDISK_ADD( "harddisk2" ) |
| 591 | MACHINE_DRIVER_END |
| 592 | |
| 223 | 593 | static MACHINE_DRIVER_START( maclc ) |
| 224 | | MDRV_IMPORT_FROM( macplus ) |
| 594 | MDRV_IMPORT_FROM( mac2fdhd ) |
| 225 | 595 | |
| 226 | 596 | MDRV_CPU_REPLACE("maincpu", M68020, 7833600*2) |
| 227 | 597 | MDRV_CPU_PROGRAM_MAP(maclc_map) |
| 228 | 598 | |
| 599 | MDRV_PALETTE_LENGTH(256) |
| 600 | |
| 601 | MDRV_VIDEO_START(maclc) |
| 602 | MDRV_VIDEO_UPDATE(maclc) |
| 603 | MACHINE_DRIVER_END |
| 604 | |
| 605 | static MACHINE_DRIVER_START( maciix ) |
| 606 | MDRV_IMPORT_FROM( mac2fdhd ) |
| 607 | |
| 608 | MDRV_CPU_REPLACE("maincpu", M68030, 7833600*2) |
| 609 | MDRV_CPU_PROGRAM_MAP(macii_map) |
| 610 | MACHINE_DRIVER_END |
| 611 | |
| 612 | static MACHINE_DRIVER_START( macse30 ) |
| 613 | MDRV_CPU_ADD("maincpu", M68030, 7833600*2) |
| 614 | MDRV_CPU_PROGRAM_MAP(macse30_map) |
| 615 | |
| 616 | MDRV_SCREEN_ADD("screen", RASTER) |
| 617 | MDRV_SCREEN_REFRESH_RATE(60.15) |
| 618 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1260)) |
| 619 | MDRV_QUANTUM_TIME(HZ(60)) |
| 620 | |
| 621 | MDRV_MACHINE_START(macscsi) |
| 622 | MDRV_MACHINE_RESET( mac ) |
| 623 | |
| 624 | /* video hardware */ |
| 625 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| 626 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 627 | MDRV_SCREEN_SIZE(MAC_H_TOTAL, MAC_V_TOTAL) |
| 628 | MDRV_SCREEN_VISIBLE_AREA(0, MAC_H_VIS-1, 0, MAC_V_VIS-1) |
| 629 | MDRV_PALETTE_LENGTH(2) |
| 630 | MDRV_PALETTE_INIT(mac) |
| 631 | |
| 632 | MDRV_VIDEO_START(mac) |
| 633 | MDRV_VIDEO_UPDATE(macse30) |
| 634 | |
| 635 | /* sound hardware */ |
| 636 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 637 | |
| 638 | /* nvram */ |
| 639 | MDRV_NVRAM_HANDLER(mac) |
| 640 | |
| 641 | /* devices */ |
| 642 | MDRV_IWM_ADD("fdc", mac_iwm_interface) |
| 643 | MDRV_FLOPPY_SONY_2_DRIVES_ADD(mac_floppy_config) |
| 644 | |
| 645 | MDRV_SCC8530_ADD("scc") |
| 646 | MDRV_SCC8530_ACK(mac_scc_ack) |
| 647 | MDRV_VIA6522_ADD("via6522_0", 1000000, mac_via6522_intf) |
| 648 | |
| 229 | 649 | MDRV_DEVICE_REMOVE("via6522_0") |
| 230 | 650 | MDRV_VIA6522_ADD("via6522_0", 1000000, mac_via6522_adb_intf) |
| 231 | 651 | MDRV_VIA6522_ADD("via6522_1", 1000000, mac_via6522_2_intf) |
| 652 | |
| 653 | MDRV_HARDDISK_ADD( "harddisk1" ) |
| 654 | MDRV_HARDDISK_ADD( "harddisk2" ) |
| 232 | 655 | MACHINE_DRIVER_END |
| 233 | 656 | |
| 657 | static MACHINE_DRIVER_START( macclas2 ) |
| 658 | MDRV_IMPORT_FROM( macse30 ) |
| 659 | |
| 660 | MDRV_CPU_REPLACE("maincpu", M68030, 7833600*2) |
| 661 | MDRV_CPU_PROGRAM_MAP(macclas2_map) |
| 662 | |
| 663 | MDRV_VIDEO_START(maclc) |
| 664 | MDRV_VIDEO_UPDATE(maclc) |
| 665 | MACHINE_DRIVER_END |
| 666 | |
| 667 | static MACHINE_DRIVER_START( maciici ) |
| 668 | MDRV_IMPORT_FROM( mac2fdhd ) |
| 669 | |
| 670 | MDRV_CPU_REPLACE("maincpu", M68030, 7833600*2) |
| 671 | MDRV_CPU_PROGRAM_MAP(maciici_map) |
| 672 | |
| 673 | MDRV_PALETTE_LENGTH(256) |
| 674 | |
| 675 | MDRV_VIDEO_START(maclc) |
| 676 | MDRV_VIDEO_UPDATE(macrbv) |
| 677 | MACHINE_DRIVER_END |
| 678 | |
| 679 | static MACHINE_DRIVER_START( maciisi ) |
| 680 | MDRV_IMPORT_FROM( mac2fdhd ) |
| 681 | |
| 682 | MDRV_CPU_REPLACE("maincpu", M68030, 25000000) |
| 683 | MDRV_CPU_PROGRAM_MAP(maciici_map) |
| 684 | |
| 685 | MDRV_PALETTE_LENGTH(256) |
| 686 | |
| 687 | MDRV_VIDEO_START(maclc) |
| 688 | MDRV_VIDEO_UPDATE(macrbv) |
| 689 | MACHINE_DRIVER_END |
| 690 | |
| 234 | 691 | static INPUT_PORTS_START( macplus ) |
| 235 | 692 | PORT_START("MOUSE0") /* Mouse - button */ |
| 236 | 693 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Mouse Button") PORT_CODE(MOUSECODE_BUTTON1) |
| r6043 | r6044 | |
| 404 | 861 | ROM_END |
| 405 | 862 | |
| 406 | 863 | ROM_START( maclc ) |
| 407 | | ROM_REGION32_BE(0x100000, "user1", 0) |
| 864 | ROM_REGION32_BE(0x80000, "user1", 0) |
| 408 | 865 | ROM_LOAD("350eacf0.rom", 0x000000, 0x080000, CRC(71681726) SHA1(6bef5853ae736f3f06c2b4e79772f65910c3b7d4)) |
| 409 | 866 | ROM_END |
| 410 | 867 | |
| 868 | ROM_START( mac2fdhd ) // same ROM for II FDHD, IIx, IIcx, and SE/30 |
| 869 | ROM_REGION32_BE(0x40000, "user1", 0) |
| 870 | ROM_LOAD( "97221136.rom", 0x000000, 0x040000, CRC(ce3b966f) SHA1(753b94351d94c369616c2c87b19d568dc5e2764e) ) |
| 871 | |
| 872 | // RasterOps "ColorBoard 264" NuBus video card |
| 873 | ROM_REGION32_BE(0x8000, "rops264", 0) |
| 874 | ROM_LOAD32_BYTE( "264-1914.bin", 0x000003, 0x002000, CRC(d5fbd5ad) SHA1(98d35ed3fb0bca4a9bee1cdb2af0d3f22b379386) ) |
| 875 | ROM_LOAD32_BYTE( "264-1915.bin", 0x000002, 0x002000, CRC(26c19ee5) SHA1(2b2853d04cc6b0258e85eccd23ebfd4f4f63a084) ) |
| 876 | ROM_END |
| 877 | |
| 878 | ROM_START( maciix ) |
| 879 | ROM_REGION32_BE(0x40000, "user1", 0) |
| 880 | ROM_LOAD( "97221136.rom", 0x000000, 0x040000, CRC(ce3b966f) SHA1(753b94351d94c369616c2c87b19d568dc5e2764e) ) |
| 881 | |
| 882 | // RasterOps "ColorBoard 264" NuBus video card |
| 883 | ROM_REGION32_BE(0x8000, "rops264", 0) |
| 884 | ROM_LOAD32_BYTE( "264-1914.bin", 0x000003, 0x002000, CRC(d5fbd5ad) SHA1(98d35ed3fb0bca4a9bee1cdb2af0d3f22b379386) ) |
| 885 | ROM_LOAD32_BYTE( "264-1915.bin", 0x000002, 0x002000, CRC(26c19ee5) SHA1(2b2853d04cc6b0258e85eccd23ebfd4f4f63a084) ) |
| 886 | ROM_END |
| 887 | |
| 888 | ROM_START( maciicx ) |
| 889 | ROM_REGION32_BE(0x40000, "user1", 0) |
| 890 | ROM_LOAD( "97221136.rom", 0x000000, 0x040000, CRC(ce3b966f) SHA1(753b94351d94c369616c2c87b19d568dc5e2764e) ) |
| 891 | |
| 892 | // RasterOps "ColorBoard 264" NuBus video card |
| 893 | ROM_REGION32_BE(0x8000, "rops264", 0) |
| 894 | ROM_LOAD32_BYTE( "264-1914.bin", 0x000003, 0x002000, CRC(d5fbd5ad) SHA1(98d35ed3fb0bca4a9bee1cdb2af0d3f22b379386) ) |
| 895 | ROM_LOAD32_BYTE( "264-1915.bin", 0x000002, 0x002000, CRC(26c19ee5) SHA1(2b2853d04cc6b0258e85eccd23ebfd4f4f63a084) ) |
| 896 | ROM_END |
| 897 | |
| 898 | ROM_START( macse30 ) |
| 899 | ROM_REGION32_BE(0x40000, "user1", 0) |
| 900 | ROM_LOAD( "97221136.rom", 0x000000, 0x040000, CRC(ce3b966f) SHA1(753b94351d94c369616c2c87b19d568dc5e2764e) ) |
| 901 | |
| 902 | ROM_REGION32_BE(0x2000, "se30vrom", 0) |
| 903 | ROM_LOAD( "se30vrom.uk6", 0x000000, 0x002000, CRC(b74c3463) SHA1(584201cc67d9452b2488f7aaaf91619ed8ce8f03) ) |
| 904 | ROM_END |
| 905 | |
| 906 | ROM_START( maciici ) |
| 907 | ROM_REGION32_BE(0x80000, "user1", 0) |
| 908 | ROM_LOAD( "368cadfe.rom", 0x000000, 0x080000, CRC(46adbf74) SHA1(b54f9d2ed16b63c49ed55adbe4685ebe73eb6e80) ) |
| 909 | ROM_END |
| 910 | |
| 911 | ROM_START( maciisi ) |
| 912 | ROM_REGION32_BE(0x80000, "user1", 0) |
| 913 | ROM_LOAD( "36b7fb6c.rom", 0x000000, 0x080000, CRC(f304d973) SHA1(f923de4125aae810796527ff6e25364cf1d54eec) ) |
| 914 | ROM_END |
| 915 | |
| 916 | ROM_START( macclas2 ) |
| 917 | ROM_REGION32_BE(0x80000, "user1", 0) |
| 918 | ROM_LOAD( "3193670e.rom", 0x000000, 0x080000, CRC(96d2e1fd) SHA1(50df69c1b6e805e12a405dc610bc2a1471b2eac2) ) |
| 919 | ROM_END |
| 920 | |
| 921 | ROM_START( maclc2 ) |
| 922 | ROM_REGION32_BE(0x80000, "user1", 0) |
| 923 | ROM_LOAD( "35c28f5f.rom", 0x000000, 0x080000, CRC(a92145b3) SHA1(d5786182b62a8ffeeb9fd3f80b5511dba70318a0) ) |
| 924 | ROM_END |
| 925 | |
| 411 | 926 | static SYSTEM_CONFIG_START(mac128k) |
| 412 | 927 | CONFIG_RAM_DEFAULT(0x020000) |
| 413 | 928 | SYSTEM_CONFIG_END |
| r6043 | r6044 | |
| 439 | 954 | CONFIG_RAM (0xa00000) // up to 10 MB |
| 440 | 955 | SYSTEM_CONFIG_END |
| 441 | 956 | |
| 957 | static SYSTEM_CONFIG_START(macclas2) |
| 958 | CONFIG_RAM_DEFAULT (0x400000) // 4MB default |
| 959 | CONFIG_RAM (0x600000) |
| 960 | CONFIG_RAM (0x800000) |
| 961 | CONFIG_RAM (0xa00000) // up to 10 MB |
| 962 | SYSTEM_CONFIG_END |
| 442 | 963 | |
| 443 | | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 444 | | COMP( 1984, mac128k, 0, 0, mac512ke, macplus, mac128k512k, mac128k, "Apple Computer", "Macintosh 128k", GAME_NOT_WORKING ) |
| 445 | | COMP( 1984, mac512k, mac128k, 0, mac512ke, macplus, mac128k512k, mac512k, "Apple Computer", "Macintosh 512k", GAME_NOT_WORKING ) |
| 446 | | COMP( 1986, mac512ke, macplus, 0, mac512ke, macplus, mac512ke, mac512k, "Apple Computer", "Macintosh 512ke", 0 ) |
| 447 | | COMP( 1986, macplus, 0, 0, macplus, macplus, macplus, macplus, "Apple Computer", "Macintosh Plus", 0 ) |
| 448 | | COMP( 1987, macse, 0, 0, macse, macplus, macse, macse, "Apple Computer", "Macintosh SE", 0 ) |
| 449 | | COMP( 1990, macclasc, 0, 0, macse, macplus, macclassic, macse, "Apple Computer", "Macintosh Classic", GAME_NOT_WORKING ) |
| 450 | | COMP( 1990, maclc, 0, 0, maclc, macplus, maclc, maclc, "Apple Computer", "Macintosh LC", GAME_NOT_WORKING ) |
| 964 | |
| 965 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 966 | COMP( 1984, mac128k, 0, 0, mac512ke, macplus, mac128k512k, mac128k, "Apple Computer", "Macintosh 128k", GAME_NOT_WORKING ) |
| 967 | COMP( 1984, mac512k, mac128k, 0, mac512ke, macplus, mac128k512k, mac512k, "Apple Computer", "Macintosh 512k", GAME_NOT_WORKING ) |
| 968 | COMP( 1986, mac512ke, macplus, 0, mac512ke, macplus, mac512ke, mac512k, "Apple Computer", "Macintosh 512ke", 0 ) |
| 969 | COMP( 1986, macplus, 0, 0, macplus, macplus, macplus, macplus, "Apple Computer", "Macintosh Plus", 0 ) |
| 970 | COMP( 1987, macse, 0, 0, macse, macplus, macse, macse, "Apple Computer", "Macintosh SE", 0 ) |
| 971 | COMP( 1988, mac2fdhd, 0, 0, mac2fdhd, macplus, maciifdhd, maclc, "Apple Computer", "Macintosh II (FDHD)", GAME_NOT_WORKING ) |
| 972 | COMP( 1988, maciix, mac2fdhd, 0, maciix, macplus, maciix, maclc, "Apple Computer", "Macintosh IIx", GAME_NOT_WORKING ) |
| 973 | COMP( 1989, macse30, mac2fdhd, 0, macse30, macplus, macse30, maclc, "Apple Computer", "Macintosh SE/30", GAME_NOT_WORKING ) |
| 974 | COMP( 1989, maciicx, mac2fdhd, 0, maciix, macplus, maciicx, maclc, "Apple Computer", "Macintosh IIcx", GAME_NOT_WORKING ) |
| 975 | COMP( 1989, maciici, 0, 0, maciici, macplus, maciici, macclas2, "Apple Computer", "Macintosh IIci", GAME_NOT_WORKING ) |
| 976 | COMP( 1990, macclasc, 0, 0, macse, macplus, macclassic, macse, "Apple Computer", "Macintosh Classic", GAME_NOT_WORKING ) |
| 977 | COMP( 1990, maclc, 0, 0, maclc, macplus, maclc, maclc, "Apple Computer", "Macintosh LC", GAME_NOT_WORKING ) |
| 978 | COMP( 1990, maciisi, 0, 0, maciisi, macplus, maciici, macclas2, "Apple Computer", "Macintosh IIsi", GAME_NOT_WORKING ) |
| 979 | COMP( 1991, macclas2, 0, 0, macclas2, macplus, macclassic2, macclas2, "Apple Computer", "Macintosh Classic II", GAME_NOT_WORKING ) |
| 980 | COMP( 1991, maclc2, 0, 0, maclc, macplus, maclc2, macclas2, "Apple Computer", "Macintosh LC II", GAME_NOT_WORKING ) |