From cfe90961b1b5c8872e6223f59d2fab8e33eecf66 Mon Sep 17 00:00:00 2001 From: arbee Date: Tue, 29 Oct 2024 22:52:14 -0400 Subject: apple/macpwrbk030.cpp: Major updates [R. Belmont] - Major modernization pass to bring in line with other Mac drivers - Pseudo VIA hooked up for VIA 2 - Displays properly emulated for all models - Added 165 and 165c support - Power management MCU hookup greatly improved - Fixed ADB, audio, and SCSI issues - All models set the correct Gestalt ID New systems marked not working ------------------------------ Apple Macintosh PowerBook 165 Apple Macintosh PowerBook 165c --- src/mame/apple/macpwrbk030.cpp | 1363 ++++++++++++++++++++++++++-------------- src/mame/mame.lst | 4 +- 2 files changed, 881 insertions(+), 486 deletions(-) diff --git a/src/mame/apple/macpwrbk030.cpp b/src/mame/apple/macpwrbk030.cpp index 2be5ec80782..6789a3be470 100644 --- a/src/mame/apple/macpwrbk030.cpp +++ b/src/mame/apple/macpwrbk030.cpp @@ -2,113 +2,146 @@ // copyright-holders:R. Belmont /**************************************************************************** - drivers/macpwrbk030.cpp - Mac PowerBooks with a 68030 CPU and M50753 PMU - By R. Belmont - - These are basically late-period Mac IIs without NuBus and with - Egret/Cuda replaced with the PMU. - - VIA 1 connections: (PowerBook 140/170, 160/180/180C are similar) - Port A: 0: VIA_TEST - 1: CPU_ID0 - 2: CPU_ID1 - 3: MODEM - 4: CPU_ID2 - 5: HDSEL (floppy head select) - 6: CPU_ID3 - 7: SCC REQ - - Port B: 0: RTC DATA - 1: RTC CLOCK - 2: RTC - 3: LINK SEL - 4: N/C - 5: N/C - 6: N/C - 7: N/C - - CA1: 60 Hz clock - CA2: 1 second clock - CB1: PMU IRQ - CB2: MODEM SND EN - - VIA 2 connections: (VIA2 is inside the "Peripheral Glue" ASIC) - Port A: bi-directional PMU data bus - - Port B: 0: SV1 - 1: PMACK - 2: PMREQ - 3: SV0 - 4: SV2 - 5: HMMU - 6: N/C - 7: MODEM RESET - - PMU (M50753) connections: - IN port: 0: BRITE SENSE - 1: A/D BATT - 2: SND CNTL - 3: MODEM BUSY - 4: PWR ON - 5: TEMP A/D - 6: NICAD SLA - 7: TABLE SEL - - Port 0: 0: SWIM CNTL - 1: SCC CNTL - 2: HD PWR - 3: MODEM PWR - 4: N/C - 5: SOUND PWR - 6: MODEM PWROUT - 7: SYS_PWR - - Port 1: 0: CCFL PWR CNTL - 1: AKD - 2: STOP CLK - 3: CHRG ON - 4: KBD RST (resets keyboard M50740) - 5: HICHG - 6: RING DETECT - 7: CHG OFF - - Port 2: bi-directional data bus, connected to VIA port A - - Port 3: 0: PWR OFF - 1: SYS RST - 2: VIA TEST - 3: SOUND OFF - 4: 1 SEC - 5: PMINT - 6: PMACK - 7: PMREQ - - Port 4: 0: PMGR_ADB (ADB out) - 1: ADB (ADB in) - 2: DISP BLANK - 3: MODEM_INS - - INT1: 60 Hz clock - INT2: INT2 PULLUP (pulled up and otherwise N/C) - - PG&E (68HC05 PMU) version spotting: - (find the text "BORG" in the system ROM, the next 32768 bytes are the PG&E image. - offset +4 in the image is the version byte). - 01 - PowerBook Duo 210/230/250 - 02 - PowerBook 540c, PBDuo 270C, PBDuo 280/280C - 03 - PowerBook 150 - 08 - PB190cs, PowerBook 540c PPC update, all PowerPC PowerBooks through WallStreet G3s + drivers/macpwrbk030.cpp + Mac PowerBooks with a 68030 CPU and M50753 PMU + By R. Belmont + + These are basically late-period Mac IIs without NuBus and with + Egret/Cuda replaced with the PMU. + + Generation 1: + PowerBook 140: 16 MHz 68030, 2 MiB RAM, no FPU, passive-matrix screen + PowerBook 145: 140 with 25 MHz 68030 + PowerBook 145B: 140 with 25 MHz 68030 and 4 MiB of RAM standard + PowerBook 170: 140, with 25 MHz 68030, 68881 FPU, active-matrix screen + + Generation 2: (all models include external monitor support) + PowerBook 160: 25 MHz 68030, no FPU, passive-matrix screen with 2 bits per pixel grayscale + PowerBook 180: 33 MHz 68030, 68881 FPU, active-matrix screen with 2 bits per pixel grayscale + PowerBook 165: 160 with 33 MHz 68030 + PowerBook 165c: 160 with 33 MHz 68030, FPU, color 640x400 display + PowerBook 180c: 165c with color 640x480 display + + Driver features: + - Display, audio, floppy, SCSI, and ADB all work. You can boot compatible System versions + and run arbitrary software. + - FPU presence and Jaws/Niagra CPU speed readback are supported so that Gestalt properly + identifies all models (except the 145B is shown as a 145; Apple documents this as also + occuring on hardware). + - 165c/180c use of a VGA GPIO feature bit to determine the correct model is supported. + + Driver TODOs: + - Shutting down or restarting from Finder freezes the machine. Something related + to power management presumably, but the cause is not clear. This is why the driver is MACHINE_NOT_WORKING. + - External video interface on 160/165/165c/180/180c. + + ============================================================================ + Technical info + + VIA 1 connections: (PowerBook 140/170, 160/180/180C are similar) + Port A: 0: VIA_TEST + 1: CPU_ID0 + 2: CPU_ID1 + 3: MODEM + 4: CPU_ID2 + 5: HDSEL (floppy head select) + 6: CPU_ID3 + 7: SCC REQ + + Port B: 0: RTC DATA + 1: RTC CLOCK + 2: RTC + 3: LINK SEL + 4: N/C + 5: N/C + 6: N/C + 7: N/C + + CA1: 60 Hz clock + CA2: 1 second clock + CB1: PMU IRQ + CB2: MODEM SND EN + + VIA 2 connections: (VIA2 is a pseudo-VIA inside the "Peripheral Glue" ASIC) + Port A: bi-directional PMU data bus + + Port B: 0: SV1 + 1: PMACK + 2: PMREQ + 3: SV0 + 4: SV2 + 5: HMMU + 6: N/C + 7: MODEM RESET + + PMU (M50753) connections: + IN port: 0: BRITE SENSE + 1: A/D BATT (battery charge level) + 2: SND CNTL + 3: MODEM BUSY + 4: PWR ON (input, 1 = system power on) + 5: TEMP A/D (battery temperature) + 6: NICAD SLA + 7: TABLE SEL (A/D input, some kind of battery state) + + Port 0: 0: SWIM CNTL + 1: SCC CNTL + 2: HD PWR + 3: MODEM PWR + 4: N/C + 5: SOUND PWR + 6: MODEM PWROUT + 7: SYS_PWR + + Port 1: 0: CCFL PWR CNTL + 1: AKD (input, works like the high bit of $C000 on the Apple II, except includes the modifiers) + 2: STOP CLK + 3: CHRG ON (input, 1 = charger is on, 7.1.1 Battery applet shows charging symbol on ) + 4: KBD RST (output, resets keyboard M50740) + 5: HICHG (output) + 6: RING DETECT + 7: CHG OFF (output) + + Port 2: bi-directional data bus, connected to VIA port A + + Port 3: 0: PWR OFF + 1: SYS RST + 2: VIA TEST + 3: SOUND OFF + 4: 1 SEC (input from Mac Plus RTC/PRAM chip, never read by the PMU program) + 5: PMINT + 6: PMACK + 7: PMREQ + + Port 4: 0: PMGR_ADB (ADB out) + 1: ADB (ADB in) + 2: DISP BLANK + 3: MODEM_INS + + INT1: 60 Hz clock + INT2: INT2 PULLUP (pulled up and otherwise N/C) + + PG&E (68HC05 PMU) version spotting: + (find the text "BORG" in the system ROM, the next 32768 bytes are the PG&E image. + offset +4 in the image is the version byte). + 01 - PowerBook Duo 210/230/250 + 02 - PowerBook 540c, PBDuo 270C, PBDuo 280/280C + 03 - PowerBook 150 + 08 - PB190cs, PowerBook 540c PPC update, all PowerPC PowerBooks through WallStreet G3s ****************************************************************************/ #include "emu.h" +#include "dfac.h" #include "macadb.h" #include "macrtc.h" #include "macscsi.h" #include "mactoolbox.h" +#include "pseudovia.h" +#include "bus/nscsi/cd.h" +#include "bus/nscsi/devices.h" #include "cpu/m68000/m68030.h" #include "cpu/m6502/m5074x.h" #include "machine/6522via.h" @@ -130,13 +163,7 @@ #include "formats/ap_dsk35.h" - namespace { - -#define C32M (31.3344_MHz_XTAL) -#define C15M (C32M/2) -#define C7M (C32M/4) - class macpb030_state : public driver_device { public: @@ -145,7 +172,7 @@ public: m_maincpu(*this, "maincpu"), m_pmu(*this, "pmu"), m_via1(*this, "via1"), - m_via2(*this, "via2"), + m_pseudovia(*this, "via2"), m_macadb(*this, "macadb"), m_ncr5380(*this, "scsi:7:ncr5380"), m_scsihelp(*this, "scsihelp"), @@ -158,13 +185,42 @@ public: m_asc(*this, "asc"), m_scc(*this, "scc"), m_vram(*this, "vram"), - m_vga(*this, "vga") + m_ext_vram(*this, "ext_vram"), + m_vga(*this, "vga"), + m_ram_ptr(nullptr), + m_rom_ptr(nullptr), + m_ram_mask(0), + m_ram_size(0), + m_rom_size(0), + m_via_interrupt(0), + m_via2_interrupt(0), + m_scc_interrupt(0), + m_last_taken_interrupt(0), + m_ca1_data(0), + m_adb_line(0), + m_overlay(false), + m_cur_floppy(nullptr), + m_hdsel(0), + m_pmu_blank_display(false), + m_pmu_from_via(0), + m_pmu_to_via(0), + m_pmu_ack(0), + m_pmu_req(0), + m_pangola_data(0x1e), + m_ponti_modem_ctl(0), + m_ponti_snd_ctl(0), + m_ponti_SPI_SR(0), + m_ponti_backlight_ctl(0) { + std::fill(std::begin(m_gsc_regs), std::end(m_gsc_regs), 0); } void macpb140(machine_config &config); void macpb145(machine_config &config); + void macpb145b(machine_config &config); void macpb160(machine_config &config); + void macpb165(machine_config &config); + void macpb165c(machine_config &config); void macpb170(machine_config &config); void macpb180(machine_config &config); void macpb180c(machine_config &config); @@ -174,14 +230,11 @@ public: void macpb165c_map(address_map &map) ATTR_COLD; void macpd210_map(address_map &map) ATTR_COLD; - void init_macpb140(); - void init_macpb160(); - private: required_device m_maincpu; required_device m_pmu; required_device m_via1; - required_device m_via2; + required_device m_pseudovia; required_device m_macadb; required_device m_ncr5380; required_device m_scsihelp; @@ -193,134 +246,509 @@ private: required_device m_palette; required_device m_asc; required_device m_scc; - optional_shared_ptr m_vram; + optional_shared_ptr m_vram, m_ext_vram; optional_device m_vga; + u32 *m_ram_ptr, *m_rom_ptr; + u32 m_ram_mask, m_ram_size, m_rom_size; + + emu_timer *m_6015_timer; + + int m_via_interrupt, m_via2_interrupt, m_scc_interrupt, m_last_taken_interrupt; + int m_ca1_data; + int m_adb_line; + + bool m_overlay; + + floppy_image_device *m_cur_floppy; + int m_hdsel; + + u8 m_gsc_regs[0x20]; + bool m_pmu_blank_display; + u8 m_pmu_from_via, m_pmu_to_via, m_pmu_ack, m_pmu_req; + + u16 m_pangola_data; + + u8 m_ponti_modem_ctl, m_ponti_snd_ctl, m_ponti_SPI_SR, m_ponti_backlight_ctl; + virtual void machine_start() override ATTR_COLD; virtual void machine_reset() override ATTR_COLD; - u32 screen_update_macpb140(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - u32 screen_update_macpb160(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - - u32 *m_ram_ptr = nullptr, *m_rom_ptr = nullptr; - u32 m_ram_mask = 0, m_ram_size = 0, m_rom_size = 0; - - emu_timer *m_6015_timer = nullptr; - - u16 mac_via_r(offs_t offset); - void mac_via_w(offs_t offset, u16 data, u16 mem_mask); - u16 mac_via2_r(offs_t offset); - void mac_via2_w(offs_t offset, u16 data, u16 mem_mask); - u8 mac_via_in_a(); - u8 mac_via_in_b(); - void mac_via_out_a(u8 data); - void mac_via_out_b(u8 data); - u8 mac_via2_in_a(); - u8 mac_via2_in_b(); - void mac_via2_out_a(u8 data); - void mac_via2_out_b(u8 data); + u32 screen_update_ddc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update_gsc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + u16 via_r(offs_t offset); + void via_w(offs_t offset, u16 data, u16 mem_mask); + u8 via_in_a(); + u8 via_in_b(); + void via_out_a(u8 data); + void via_out_b(u8 data); void field_interrupts(); - void mac_via_sync(); + void via_sync(); + void scc_irq_w(int state); void via_irq_w(int state); + u8 via2_r(offs_t offset); + void via2_w(offs_t offset, u8 data); + u8 via2_in_a(); + u8 via2_in_b(); + void via2_out_a(u8 data); + void via2_out_b(u8 data); void via2_irq_w(int state); TIMER_CALLBACK_MEMBER(mac_6015_tick); - int m_via_interrupt = 0, m_via2_interrupt = 0, m_scc_interrupt = 0, m_asc_interrupt = 0, m_last_taken_interrupt = 0; - int m_ca1_data = 0, m_via2_ca1_hack = 0; u32 rom_switch_r(offs_t offset); - bool m_overlay = false; - u16 scsi_r(offs_t offset, u16 mem_mask); void scsi_w(offs_t offset, u16 data, u16 mem_mask); - uint32_t scsi_drq_r(offs_t offset, uint32_t mem_mask = ~0); - void scsi_drq_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); - void scsi_berr_w(uint8_t data); - u16 mac_scc_r(offs_t offset) - { - mac_via_sync(); - u16 result = m_scc->dc_ab_r(offset); - return (result << 8) | result; - } - void mac_scc_2_w(offs_t offset, u16 data) { m_scc->dc_ab_w(offset, data >> 8); } + u32 scsi_drq_r(offs_t offset, u32 mem_mask = ~0); + void scsi_drq_w(offs_t offset, u32 data, u32 mem_mask = ~0); + void scsi_berr_w(u8 data); + u16 scc_r(offs_t offset); + void scc_w(offs_t offset, u16 data); + void phases_w(u8 phases); + void devsel_w(u8 devsel); + u16 swim_r(offs_t offset, u16 mem_mask); + void swim_w(offs_t offset, u16 data, u16 mem_mask); + u32 buserror_r(); - floppy_image_device *m_cur_floppy = nullptr; - int m_hdsel = 0; + u8 gsc_r(offs_t offset); + void gsc_w(offs_t offset, u8 data); + void macgsc_palette(palette_device &palette) const; - void phases_w(uint8_t phases); - void devsel_w(uint8_t devsel); + u32 jaws_r(offs_t offset, u32 mem_mask); + void jaws_w(offs_t offset, u32 data, u32 mem_mask); + u32 niagra_r(offs_t offset, u32 mem_mask); + void niagra_w(offs_t offset, u32 data, u32 mem_mask); + + u16 pangola_r(); + void pangola_w(u16 data); + u8 pangola_vram_r(offs_t offset); + void pangola_vram_w(offs_t offset, u8 data); + + u8 ext_video_r(offs_t offset); + void ext_video_w(offs_t offset, u8 data); + + u8 pmu_p1_r(); + u8 pmu_data_r(); + void pmu_data_w(u8 data); + u8 pmu_comms_r(); + void pmu_comms_w(u8 data); + void set_adb_line(int state); + u8 pmu_p4_r(); + void pmu_p4_w(u8 data); + u8 pmu_in_r(); + u8 battery_r(); + u8 battery2_r(); + u8 battery3_r(); + u8 brightness_r(); - u16 swim_r(offs_t offset, u16 mem_mask) - { + // ID for PowerBook Duo 210 + u32 pd210_id_r() { return 0xa55a1004; } +}; + +void macpb030_state::machine_start() +{ + m_ram_ptr = (u32 *)m_ram->pointer(); + m_ram_size = m_ram->size() >> 1; + m_ram_mask = m_ram_size - 1; + m_rom_ptr = (u32 *)memregion("bootrom")->base(); + m_rom_size = memregion("bootrom")->bytes(); + m_via_interrupt = m_via2_interrupt = m_scc_interrupt = 0; + m_last_taken_interrupt = -1; + m_ca1_data = 0; + + m_6015_timer = timer_alloc(FUNC(macpb030_state::mac_6015_tick), this); + m_6015_timer->adjust(attotime::never); + + /* + HACK-ish: There is an uninitialized variable in the PMU code that can + cause the charger connected state to not be checked until after + the 68K startup code reads it and makes decisions. On hardware this + likely is ameliorated by the PMU always having power unless the + battery goes 100% dead. + + In normal operation this location counts down and when it reaches zero, + the charger and battery states are refreshed. The variable is then set to + either 0x3c or 0x5b depending on battery state. The important part is that + in normal operation it never is allowed to wrap to 0xff, which was happening + in MAME due to RAM being initialized to zero. + */ + m_pmu->space(AS_PROGRAM).write_byte(0x25, 0x5b); + + m_maincpu->space(AS_PROGRAM).install_write_tap(0x50f14000, 0x50f15fff, "snd_latch_mon", [this](offs_t offset, u32 &data, u32 mem_mask) { if (!machine().side_effects_disabled()) { - m_maincpu->adjust_icount(-5); + this->m_ponti_snd_ctl |= 0x08; // indicate sound chip write so power management knows not to sleep } + }); +} - u16 result = m_swim->read((offset >> 8) & 0xf); - return result << 8; +void macpb030_state::machine_reset() +{ + m_overlay = true; + m_via_interrupt = m_via2_interrupt = m_scc_interrupt = 0; + m_last_taken_interrupt = -1; + m_ca1_data = 0; + + m_cur_floppy = nullptr; + m_hdsel = 0; + + // put ROM mirror at 0 + address_space &space = m_maincpu->space(AS_PROGRAM); + const u32 memory_size = std::min((u32)0x3fffff, m_rom_size); + const u32 memory_end = memory_size - 1; + offs_t memory_mirror = memory_end & ~(memory_size - 1); + + space.unmap_write(0x00000000, memory_end); + space.install_rom(0x00000000, memory_end & ~memory_mirror, memory_mirror, m_rom_ptr); + + // start 60.15 Hz timer + m_6015_timer->adjust(attotime::from_hz(60.15), 0, attotime::from_hz(60.15)); + + // main cpu shouldn't start until PMU wakes it up + m_maincpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); +} + +// Jaws memory controller for the PowerBook 140/170 and 145/145B. +u32 macpb030_state::jaws_r(offs_t offset, u32 mem_mask) +{ + switch (offset >> 10) + { + case 0x00: // RAM wait state control + case 0x04: // Econo-Mode register + case 0x06: // ROM wait state control + case 0x10: // RAM bank A config + case 0x12: // RAM bank B config + case 0x14: // RAM bank C config + case 0x20: // CPU power off control + case 0x22: // Set CPU clock + case 0x30: // Select plain SCC vs. 85C80 "Combo" SCC + 53C80 SCSI + case 0x32: // Puts RAM into self-refresh mode + break; + + case 0x34: // Get CPU clock + if (m_maincpu->clock() == 25'000'000) + { + return 1<<24; + } + break; } - void swim_w(offs_t offset, u16 data, u16 mem_mask) + return 0; +} + +void macpb030_state::jaws_w(offs_t offset, u32 data, u32 mem_mask) +{ + switch (offset >> 10) { - if (ACCESSING_BITS_0_7) - m_swim->write((offset >> 8) & 0xf, data & 0xff); - else - m_swim->write((offset >> 8) & 0xf, data >> 8); + case 0x00: // RAM wait state control + case 0x04: // Econo-Mode register + case 0x06: // ROM wait state control + case 0x10: // RAM bank A config + case 0x12: // RAM bank B config + case 0x14: // RAM bank C config + case 0x22: // Set CPU clock + case 0x30: // Select plain SCC vs. 85C80 "Combo" SCC + 53C80 SCSI + case 0x32: // Puts RAM into self-refresh mode + case 0x34: // Get CPU clock + break; + + case 0x20: // CPU power down control, expects the CPU to reset after a short delay to resume + // We make that no delay, since we don't care about saving power. + m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); + m_maincpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); + break; } +} - u32 buserror_r(); +// Niagra (Jaws derivative) memory controller for the PowerBook 160/180 and 165c/180c. +u32 macpb030_state::niagra_r(offs_t offset, u32 mem_mask) +{ + switch (offset >> 10) + { + case 0x02: // Video count options + case 0x22: // Video accesses through 64 + case 0x24: // Video accesses through 512 + case 0x26: // Video accesses through 2K + case 0x30: // Enable flash through Niagra + break; + + case 0x34: // FPU access detected + return 0xff000000; + + case 0x36: // CPU speed register + if (m_maincpu->clock() == 25'000'000) + { + return 2<<24; + } + else if (m_maincpu->clock() == 33'000'000) + { + return 3<<24; + } + return 0; - void asc_irq_w(int state) + case 0x16: // "Ponti registers" + switch ((offset >> 8) & 3) + { + case 0: // SPI modem control + return m_ponti_modem_ctl << 24; + + case 1: // Sound control + return m_ponti_snd_ctl << 24; + + case 2: // SPI shift register + return m_ponti_SPI_SR << 24; + + case 3: // Backlight control + return m_ponti_backlight_ctl << 24; + } + break; + + default: + return jaws_r(offset, mem_mask); + } + + return 0; +} + +void macpb030_state::niagra_w(offs_t offset, u32 data, u32 mem_mask) +{ + switch (offset >> 10) { - m_asc_interrupt = state; - field_interrupts(); + case 0x02: // Video count options + case 0x22: // Video accesses through 64 + case 0x24: // Video accesses through 512 + case 0x26: // Video accesses through 2K + case 0x30: // Enable flash through Niagra + case 0x34: // FPU access detected + case 0x36: // CPU speed register + break; + + case 0x16: // "Ponti registers" + data >>= 24; + switch ((offset >> 8) & 3) + { + case 0: // SPI modem control + m_ponti_modem_ctl = data; + break; + + case 1: // Sound control + // if the sound latch clear is asserted, clear the latch + if (BIT(data, 2) && !BIT(m_ponti_snd_ctl, 2)) + { + m_ponti_snd_ctl &= ~0x08; + } + + // preserve the value of the sound latch output + m_ponti_snd_ctl &= 0x08; + m_ponti_snd_ctl |= data & ~0x08; + break; + + case 2: // SPI shift register + m_ponti_SPI_SR = data; + break; + + case 3: // Backlight control + m_ponti_backlight_ctl = data; + break; + } + break; + + default: + jaws_w(offset, data, mem_mask); + break; } +} - // ID for PowerBook Duo 210 - u32 pd210_id_r() { return 0xa55a1004; } +/* + Color PowerBooks used a stock Western Digital SVGA chipset that could drive LCDs, + but in order to maintain compatibility with all Mac video depths, the Pangola chip was + inserted in between. The SVGA chip is always run at 8 bits per pixel, while Pangola + sits in between and does the necessary conversion between 1, 2, and 4 bpp on the Mac + end and 8 bpp on QuickDraw's end. In 8bpp mode it's just a passthrough. +*/ +u16 macpb030_state::pangola_r() +{ + return m_pangola_data; +} - uint8_t mac_gsc_r(offs_t offset); - void mac_gsc_w(uint8_t data); - void macgsc_palette(palette_device &palette) const; +void macpb030_state::pangola_w(u16 data) +{ + m_pangola_data = data; +} - u8 m_pmu_from_via = 0, m_pmu_to_via = 0, m_pmu_ack = 0, m_pmu_req = 0; +u8 macpb030_state::pangola_vram_r(offs_t offset) +{ + switch ((m_pangola_data >> 5) & 3) + { + case 0: // 8 bpp, do the default thing + break; + + case 1: // 4bpp + offset <<= 1; + return (m_vga->mem_linear_r(offset) << 4) | (m_vga->mem_linear_r(offset+1) & 0xf); + + case 2: // 2bpp + offset <<= 2; + return (m_vga->mem_linear_r(offset) << 6) | + (m_vga->mem_linear_r(offset + 1) & 0x3) << 4 | + (m_vga->mem_linear_r(offset + 2) & 0x3) << 2 | + (m_vga->mem_linear_r(offset + 3) & 0x3); + + case 3: // 1bpp + offset <<= 3; + return (m_vga->mem_linear_r(offset) << 7) | + (m_vga->mem_linear_r(offset + 1) & 0x1) << 6 | + (m_vga->mem_linear_r(offset + 2) & 0x1) << 5 | + (m_vga->mem_linear_r(offset + 3) & 0x1) << 4 | + (m_vga->mem_linear_r(offset + 4) & 0x1) << 3 | + (m_vga->mem_linear_r(offset + 5) & 0x1) << 2 | + (m_vga->mem_linear_r(offset + 6) & 0x1) << 1 | + (m_vga->mem_linear_r(offset + 7) & 0x1); + } + + return m_vga->mem_linear_r(offset); +} - u8 pmu_p1_r() { return 0; } - u8 pmu_data_r() { return m_pmu_from_via; } - void pmu_data_w(u8 data) +void macpb030_state::pangola_vram_w(offs_t offset, u8 data) +{ + switch ((m_pangola_data >> 5) & 3) { - m_pmu_to_via = data; + case 0: // 8 bpp, passthrough + m_vga->mem_linear_w(offset, data); + break; + + case 1: // 4bpp + offset <<= 1; + m_vga->mem_linear_w(offset, data>>4); + m_vga->mem_linear_w(offset+1, data & 0xf); + break; + + case 2: // 2bpp + offset <<= 2; + m_vga->mem_linear_w(offset, data >> 6); + m_vga->mem_linear_w(offset + 1, (data >> 4) & 0x3); + m_vga->mem_linear_w(offset + 2, (data >> 2) & 0x3); + m_vga->mem_linear_w(offset + 3, data & 0x3); + break; + + case 3: // 1bpp + offset <<= 3; + m_vga->mem_linear_w(offset, data >> 7); + m_vga->mem_linear_w(offset + 1, (data >> 6) & 0x1); + m_vga->mem_linear_w(offset + 2, (data >> 5) & 0x1); + m_vga->mem_linear_w(offset + 3, (data >> 4) & 0x1); + m_vga->mem_linear_w(offset + 4, (data >> 3) & 0x1); + m_vga->mem_linear_w(offset + 5, (data >> 2) & 0x1); + m_vga->mem_linear_w(offset + 6, (data >> 1) & 0x1); + m_vga->mem_linear_w(offset + 7, data & 0x1); + break; } - u8 pmu_comms_r() { return (m_pmu_req<<7); } - void pmu_comms_w(u8 data) +} + +/* + PB160/180 external video (stub for now) +*/ +u8 macpb030_state::ext_video_r(offs_t offset) +{ + switch (offset) { - m_via1->write_cb1(BIT(data, 5) ^ 1); - if (m_pmu_ack != BIT(data, 6)) - { - m_pmu_ack = BIT(data, 6); - machine().scheduler().synchronize(); - } + case 4: // Monitor ID in bits 4-6. Return 7 (no connection) for now. + return 0x70; // No monitor for now } - int m_adb_line = 0; - void set_adb_line(int state) { m_adb_line = state; } - u8 pmu_adb_r() { return (m_adb_line<<1); } - void pmu_adb_w(u8 data) + + return 0; +} + +void macpb030_state::ext_video_w(offs_t offset, u8 data) +{ + // 0 = DAC color number + // 1 = DAC color write (write R, then G, then B, like usual) +} + +u8 macpb030_state::pmu_in_r() +{ + // power on, no target disk mode + return 0x30; +} + +u8 macpb030_state::brightness_r() +{ + return 0x7f; +} + +// ADC 1 - battery level +u8 macpb030_state::battery_r() +{ + return 0xff; +} + +// ADC 5 - battery temperature +u8 macpb030_state::battery2_r() +{ + return 0x40; +} + +// ADC 7 - "TABLE SEL" on the schematic +u8 macpb030_state::battery3_r() +{ + return 0x10; +} + +void macpb030_state::set_adb_line(int state) +{ + m_adb_line = state; +} + +u8 macpb030_state::pmu_p1_r() +{ + return 0x88; +} + +u8 macpb030_state::pmu_data_r() +{ + return m_pmu_from_via; +} + +void macpb030_state::pmu_data_w(u8 data) +{ + m_pmu_to_via = data; +} + +u8 macpb030_state::pmu_comms_r() +{ + return (m_pmu_req << 7); +} + +void macpb030_state::pmu_comms_w(u8 data) +{ + m_maincpu->set_input_line(INPUT_LINE_HALT, BIT(data, 0) ? CLEAR_LINE : ASSERT_LINE); + m_maincpu->set_input_line(INPUT_LINE_RESET, BIT(data, 1) ? CLEAR_LINE : ASSERT_LINE); + + m_via1->write_cb1(BIT(data, 5) ^ 1); + if (m_pmu_ack != BIT(data, 6)) { - m_adb_line = (data & 1) ^ 1; - m_macadb->adb_linechange_w((data & 1) ^ 1); + m_pmu_ack = BIT(data, 6); + machine().scheduler().synchronize(); } +} - u8 pmu_in_r() { return 0x20; } // bit 5 is 0 if the Target Disk Mode should be enabled +u8 macpb030_state::pmu_p4_r() +{ + return (m_adb_line << 1); +} - u8 battery_r() { return 0x7f; } -}; +void macpb030_state::pmu_p4_w(u8 data) +{ + m_macadb->adb_linechange_w((data & 1) ^ 1); + m_pmu_blank_display = BIT(data, 2) ^ 1; +} -// 4-level grayscale +// 16-level grayscale void macpb030_state::macgsc_palette(palette_device &palette) const { - palette.set_pen_color(0, 0xff, 0xff, 0xff); - palette.set_pen_color(1, 0x7f, 0x7f, 0x7f); - palette.set_pen_color(2, 0x3f, 0x3f, 0x3f); - palette.set_pen_color(3, 0x00, 0x00, 0x00); + for (u8 i = 0; i < 16; i++) + { + palette.set_pen_color(i, ((15 - i) << 4) | 0xf, ((15 - i) << 4) | 0xf, ((15 - i) << 4) | 0xf); + } } u32 macpb030_state::buserror_r() @@ -330,6 +758,37 @@ u32 macpb030_state::buserror_r() return 0; } +u16 macpb030_state::swim_r(offs_t offset, u16 mem_mask) +{ + if (!machine().side_effects_disabled()) + { + m_maincpu->adjust_icount(-5); + } + + u16 result = m_swim->read((offset >> 8) & 0xf); + return result << 8; +} + +void macpb030_state::swim_w(offs_t offset, u16 data, u16 mem_mask) +{ + if (ACCESSING_BITS_0_7) + m_swim->write((offset >> 8) & 0xf, data & 0xff); + else + m_swim->write((offset >> 8) & 0xf, data >> 8); +} + +u16 macpb030_state::scc_r(offs_t offset) +{ + via_sync(); + const u16 result = m_scc->dc_ab_r(offset); + return (result << 8) | result; +} + +void macpb030_state::scc_w(offs_t offset, u16 data) +{ + m_scc->dc_ab_w(offset, data >> 8); +} + void macpb030_state::field_interrupts() { int take_interrupt = -1; @@ -360,7 +819,7 @@ void macpb030_state::field_interrupts() } } -void macpb030_state::mac_via_sync() +void macpb030_state::via_sync() { // The via runs at 783.36KHz while the main cpu runs at 15MHz or // more, so we need to sync the access with the via clock. Plus @@ -383,76 +842,43 @@ void macpb030_state::mac_via_sync() m_maincpu->adjust_icount(-int(main_cycle - cycle)); } -void macpb030_state::phases_w(uint8_t phases) +void macpb030_state::phases_w(u8 phases) { if (m_cur_floppy) m_cur_floppy->seek_phase_w(phases); } -void macpb030_state::devsel_w(uint8_t devsel) +void macpb030_state::devsel_w(u8 devsel) { if (devsel == 1) + { m_cur_floppy = m_floppy[0]->get_device(); + } else if (devsel == 2) + { m_cur_floppy = m_floppy[1]->get_device(); + } else + { m_cur_floppy = nullptr; - + } m_swim->set_floppy(m_cur_floppy); if (m_cur_floppy) + { m_cur_floppy->ss_w(m_hdsel); + } } -void macpb030_state::machine_start() -{ - m_ram_ptr = (u32*)m_ram->pointer(); - m_ram_size = m_ram->size()>>1; - m_ram_mask = m_ram_size - 1; - m_rom_ptr = (u32*)memregion("bootrom")->base(); - m_rom_size = memregion("bootrom")->bytes(); - m_via_interrupt = m_via2_interrupt = m_scc_interrupt = m_asc_interrupt = 0; - m_last_taken_interrupt = -1; - m_ca1_data = 0; - - m_6015_timer = timer_alloc(FUNC(macpb030_state::mac_6015_tick), this); - m_6015_timer->adjust(attotime::never); -} - -void macpb030_state::machine_reset() -{ - m_overlay = true; - m_via_interrupt = m_via2_interrupt = m_scc_interrupt = m_asc_interrupt = 0; - m_last_taken_interrupt = -1; - m_ca1_data = 0; - m_via2_ca1_hack = 0; - - m_cur_floppy = nullptr; - m_hdsel = 0; - - // put ROM mirror at 0 - address_space& space = m_maincpu->space(AS_PROGRAM); - const u32 memory_size = std::min((u32)0x3fffff, m_rom_size); - const u32 memory_end = memory_size - 1; - offs_t memory_mirror = memory_end & ~(memory_size - 1); - - space.unmap_write(0x00000000, memory_end); - space.install_rom(0x00000000, memory_end & ~memory_mirror, memory_mirror, m_rom_ptr); - - // start 60.15 Hz timer - m_6015_timer->adjust(attotime::from_hz(60.15), 0, attotime::from_hz(60.15)); -} - -void macpb030_state::init_macpb140() -{ -} - -void macpb030_state::init_macpb160() +u32 macpb030_state::screen_update_ddc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { -} + // is the display enabled? + if (m_pmu_blank_display) + { + bitmap.fill(0, cliprect); + return 0; + } -u32 macpb030_state::screen_update_macpb140(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - u16 const *const video_ram = (const uint16_t *)m_vram.target(); + u16 const *const video_ram = (const u16 *)m_vram.target(); for (int y = 0; y < 400; y++) { @@ -460,7 +886,7 @@ u32 macpb030_state::screen_update_macpb140(screen_device &screen, bitmap_ind16 & for (int x = 0; x < 640; x += 16) { - uint16_t const word = video_ram[((y * 640) / 16) + ((x / 16) ^ 1)]; + u16 const word = video_ram[((y * 640) / 16) + ((x / 16) ^ 1)]; for (int b = 0; b < 16; b++) { line[x + b] = (word >> (15 - b)) & 0x0001; @@ -470,28 +896,73 @@ u32 macpb030_state::screen_update_macpb140(screen_device &screen, bitmap_ind16 & return 0; } -u32 macpb030_state::screen_update_macpb160(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 macpb030_state::screen_update_gsc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - u8 const *const vram8 = (uint8_t *)m_vram.target(); + u8 const *const vram8 = (u8 *)m_vram.target(); - for (int y = 0; y < 400; y++) + // is the display enabled? + if (!(m_gsc_regs[4] & 0x20) || m_pmu_blank_display) { - u16 *line = &bitmap.pix(y); + bitmap.fill(0, cliprect); + return 0; + } - for (int x = 0; x < 640/4; x++) + switch (m_gsc_regs[4] & 3) + { + case 0: + for (int y = 0; y < 400; y++) { - static const u16 palette[4] = { 0, 1, 2, 3 }; - u8 const pixels = vram8[(y * 640/4) + (BYTE4_XOR_BE(x))]; - *line++ = palette[((pixels >> 6) & 3)]; - *line++ = palette[((pixels >> 4) & 3)]; - *line++ = palette[((pixels >> 2) & 3)]; - *line++ = palette[(pixels & 3)]; + u16 *line = &bitmap.pix(y); + + for (int x = 0; x < 640; x += 8) + { + u8 const pixels = vram8[(y * 640 / 8) + (BYTE4_XOR_BE(x / 8))]; + *line++ = ((pixels >> 7) & 1) ? 0xf : 0; + *line++ = ((pixels >> 6) & 1) ? 0xf : 0; + *line++ = ((pixels >> 5) & 1) ? 0xf : 0; + *line++ = ((pixels >> 4) & 1) ? 0xf : 0; + *line++ = ((pixels >> 3) & 1) ? 0xf : 0; + *line++ = ((pixels >> 2) & 1) ? 0xf : 0; + *line++ = ((pixels >> 1) & 1) ? 0xf : 0; + *line++ = (pixels & 1) ? 0xf : 0; + } + } + break; + + case 1: + for (int y = 0; y < 400; y++) + { + u16 *line = &bitmap.pix(y); + + for (int x = 0; x < 640; x += 4) + { + u8 const pixels = vram8[(y * 640 / 4) + (BYTE4_XOR_BE(x / 4))]; + *line++ = ((pixels >> 4) & 0xc); + *line++ = ((pixels >> 2) & 0xc); + *line++ = (pixels & 0xc); + *line++ = ((pixels << 2) & 0xc); + } + } + break; + + case 2: + for (int y = 0; y < 400; y++) + { + u16 *line = &bitmap.pix(y); + + for (int x = 0; x < 640; x += 2) + { + u8 const pixels = vram8[(y * 640 / 2) + (BYTE4_XOR_BE(x / 2))]; + *line++ = pixels >> 4; + *line++ = pixels & 0xf; + } } + break; } return 0; } -u16 macpb030_state::mac_via_r(offs_t offset) +u16 macpb030_state::via_r(offs_t offset) { u16 data; @@ -501,12 +972,12 @@ u16 macpb030_state::mac_via_r(offs_t offset) data = m_via1->read(offset); if (!machine().side_effects_disabled()) - mac_via_sync(); + via_sync(); return (data & 0xff) | (data << 8); } -void macpb030_state::mac_via_w(offs_t offset, u16 data, u16 mem_mask) +void macpb030_state::via_w(offs_t offset, u16 data, u16 mem_mask) { offset >>= 8; offset &= 0x0f; @@ -516,42 +987,35 @@ void macpb030_state::mac_via_w(offs_t offset, u16 data, u16 mem_mask) if (ACCESSING_BITS_8_15) m_via1->write(offset, (data >> 8) & 0xff); - mac_via_sync(); + via_sync(); } -uint16_t macpb030_state::mac_via2_r(offs_t offset) +void macpb030_state::scc_irq_w(int state) { - int data; - - offset >>= 8; - offset &= 0x0f; - - if (!machine().side_effects_disabled()) - mac_via_sync(); - - data = m_via2->read(offset); - return (data & 0xff) | (data << 8); + m_scc_interrupt = state; + field_interrupts(); } -void macpb030_state::mac_via2_w(offs_t offset, uint16_t data, uint16_t mem_mask) +void macpb030_state::via_irq_w(int state) { - offset >>= 8; - offset &= 0x0f; - - mac_via_sync(); + m_via_interrupt = state; + field_interrupts(); +} - //printf("%02x to VIA2 @ %x\n", data & 0xff, offset); +u8 macpb030_state::via2_r(offs_t offset) +{ + if (!machine().side_effects_disabled()) + { + via_sync(); + } - if (ACCESSING_BITS_0_7) - m_via2->write(offset, data & 0xff); - if (ACCESSING_BITS_8_15) - m_via2->write(offset, (data >> 8) & 0xff); + return m_pseudovia->read(offset); } -void macpb030_state::via_irq_w(int state) +void macpb030_state::via2_w(offs_t offset, u8 data) { - m_via_interrupt = state; - field_interrupts(); + via_sync(); + m_pseudovia->write(offset, data); } void macpb030_state::via2_irq_w(int state) @@ -574,8 +1038,6 @@ u32 macpb030_state::rom_switch_r(offs_t offset) m_overlay = false; } - //printf("rom_switch_r: offset %08x ROM_size -1 = %08x, masked = %08x\n", offset, m_rom_size-1, offset & ((m_rom_size - 1)>>2)); - return m_rom_ptr[offset & ((m_rom_size - 1)>>2)]; } @@ -590,27 +1052,21 @@ TIMER_CALLBACK_MEMBER(macpb030_state::mac_6015_tick) u16 macpb030_state::scsi_r(offs_t offset, u16 mem_mask) { - int reg = (offset >> 3) & 0xf; - - //printf("scsi_r: offset %x mask %x\n", offset, mem_mask); - - bool pseudo_dma = (reg == 6) && (offset == 0x130); + const int reg = (offset >> 3) & 0xf; + const bool pseudo_dma = (reg == 6) && (offset >= 0x130); return m_scsihelp->read_wrapper(pseudo_dma, reg) << 8; } void macpb030_state::scsi_w(offs_t offset, u16 data, u16 mem_mask) { - int reg = (offset >> 3) & 0xf; - - //printf("scsi_w: data %x offset %x mask %x\n", data, offset, mem_mask); - - bool pseudo_dma = (reg == 0) && (offset == 0x100); + const int reg = (offset >> 3) & 0xf; + const bool pseudo_dma = (reg == 0) && (offset >= 0x100); m_scsihelp->write_wrapper(pseudo_dma, reg, data>>8); } -uint32_t macpb030_state::scsi_drq_r(offs_t offset, uint32_t mem_mask) +u32 macpb030_state::scsi_drq_r(offs_t offset, u32 mem_mask) { switch (mem_mask) { @@ -630,7 +1086,7 @@ uint32_t macpb030_state::scsi_drq_r(offs_t offset, uint32_t mem_mask) return 0; } -void macpb030_state::scsi_drq_w(offs_t offset, uint32_t data, uint32_t mem_mask) +void macpb030_state::scsi_drq_w(offs_t offset, u32 data, u32 mem_mask) { switch (mem_mask) { @@ -656,12 +1112,12 @@ void macpb030_state::scsi_drq_w(offs_t offset, uint32_t data, uint32_t mem_mask) } } -void macpb030_state::scsi_berr_w(uint8_t data) +void macpb030_state::scsi_berr_w(u8 data) { m_maincpu->pulse_input_line(M68K_LINE_BUSERROR, attotime::zero); } -uint8_t macpb030_state::mac_gsc_r(offs_t offset) +u8 macpb030_state::gsc_r(offs_t offset) { if (offset == 1) { @@ -671,8 +1127,9 @@ uint8_t macpb030_state::mac_gsc_r(offs_t offset) return 0; } -void macpb030_state::mac_gsc_w(uint8_t data) +void macpb030_state::gsc_w(offs_t offset, u8 data) { + m_gsc_regs[offset & 0x1f] = data; } /*************************************************************************** @@ -684,15 +1141,16 @@ void macpb030_state::macpb140_map(address_map &map) { map(0x40000000, 0x400fffff).r(FUNC(macpb030_state::rom_switch_r)).mirror(0x0ff00000); - map(0x50000000, 0x50001fff).rw(FUNC(macpb030_state::mac_via_r), FUNC(macpb030_state::mac_via_w)).mirror(0x01f00000); - map(0x50002000, 0x50003fff).rw(FUNC(macpb030_state::mac_via2_r), FUNC(macpb030_state::mac_via2_w)).mirror(0x01f00000); - map(0x50004000, 0x50005fff).rw(FUNC(macpb030_state::mac_scc_r), FUNC(macpb030_state::mac_scc_2_w)).mirror(0x01f00000); + map(0x50000000, 0x50001fff).rw(FUNC(macpb030_state::via_r), FUNC(macpb030_state::via_w)).mirror(0x01f00000); + map(0x50002000, 0x50003fff).rw(FUNC(macpb030_state::via2_r), FUNC(macpb030_state::via2_w)).mirror(0x01f00000); + map(0x50004000, 0x50005fff).rw(FUNC(macpb030_state::scc_r), FUNC(macpb030_state::scc_w)).mirror(0x01f00000); map(0x50006000, 0x50007fff).rw(FUNC(macpb030_state::scsi_drq_r), FUNC(macpb030_state::scsi_drq_w)).mirror(0x01f00000); map(0x50010000, 0x50011fff).rw(FUNC(macpb030_state::scsi_r), FUNC(macpb030_state::scsi_w)).mirror(0x01f00000); map(0x50012060, 0x50012063).r(FUNC(macpb030_state::scsi_drq_r)).mirror(0x01f00000); map(0x50014000, 0x50015fff).rw(m_asc, FUNC(asc_device::read), FUNC(asc_device::write)).mirror(0x01f00000); map(0x50016000, 0x50017fff).rw(FUNC(macpb030_state::swim_r), FUNC(macpb030_state::swim_w)).mirror(0x01f00000); map(0x50024000, 0x50027fff).r(FUNC(macpb030_state::buserror_r)).mirror(0x01f00000); // bus error here to make sure we aren't mistaken for another decoder + map(0x50080000, 0x500bffff).rw(FUNC(macpb030_state::jaws_r), FUNC(macpb030_state::jaws_w)).mirror(0x01f00000); map(0xfee08000, 0xfeffffff).ram().share("vram"); } @@ -701,27 +1159,32 @@ void macpb030_state::macpb160_map(address_map &map) { map(0x40000000, 0x400fffff).r(FUNC(macpb030_state::rom_switch_r)).mirror(0x0ff00000); - map(0x50f00000, 0x50f01fff).rw(FUNC(macpb030_state::mac_via_r), FUNC(macpb030_state::mac_via_w)); - map(0x50f02000, 0x50f03fff).rw(FUNC(macpb030_state::mac_via2_r), FUNC(macpb030_state::mac_via2_w)); - map(0x50f04000, 0x50f05fff).rw(FUNC(macpb030_state::mac_scc_r), FUNC(macpb030_state::mac_scc_2_w)); + map(0x50f00000, 0x50f01fff).rw(FUNC(macpb030_state::via_r), FUNC(macpb030_state::via_w)); + map(0x50f02000, 0x50f03fff).rw(FUNC(macpb030_state::via2_r), FUNC(macpb030_state::via2_w)); + map(0x50f04000, 0x50f05fff).rw(FUNC(macpb030_state::scc_r), FUNC(macpb030_state::scc_w)); map(0x50f06000, 0x50f07fff).rw(FUNC(macpb030_state::scsi_drq_r), FUNC(macpb030_state::scsi_drq_w)); map(0x50f10000, 0x50f11fff).rw(FUNC(macpb030_state::scsi_r), FUNC(macpb030_state::scsi_w)); map(0x50f12060, 0x50f12063).r(FUNC(macpb030_state::scsi_drq_r)); map(0x50f14000, 0x50f15fff).rw(m_asc, FUNC(asc_device::read), FUNC(asc_device::write)); map(0x50f16000, 0x50f17fff).rw(FUNC(macpb030_state::swim_r), FUNC(macpb030_state::swim_w)); - map(0x50f20000, 0x50f21fff).rw(FUNC(macpb030_state::mac_gsc_r), FUNC(macpb030_state::mac_gsc_w)); + map(0x50f20000, 0x50f21fff).rw(FUNC(macpb030_state::gsc_r), FUNC(macpb030_state::gsc_w)); map(0x50f24000, 0x50f27fff).r(FUNC(macpb030_state::buserror_r)); // bus error here to make sure we aren't mistaken for another decoder + map(0x50f80000, 0x50fbffff).rw(FUNC(macpb030_state::niagra_r), FUNC(macpb030_state::niagra_w)); map(0x60000000, 0x6001ffff).ram().share("vram").mirror(0x0ffe0000); + + // external video on 160/180 + map(0xfe0fe000, 0xfe0fe0ff).rw(FUNC(macpb030_state::ext_video_r), FUNC(macpb030_state::ext_video_w)); + map(0xfe100000, 0xfe17ffff).ram().share("ext_vram"); } void macpb030_state::macpb165c_map(address_map &map) { map(0x40000000, 0x400fffff).r(FUNC(macpb030_state::rom_switch_r)).mirror(0x0ff00000); - map(0x50f00000, 0x50f01fff).rw(FUNC(macpb030_state::mac_via_r), FUNC(macpb030_state::mac_via_w)); - map(0x50f02000, 0x50f03fff).rw(FUNC(macpb030_state::mac_via2_r), FUNC(macpb030_state::mac_via2_w)); - map(0x50f04000, 0x50f05fff).rw(FUNC(macpb030_state::mac_scc_r), FUNC(macpb030_state::mac_scc_2_w)); + map(0x50f00000, 0x50f01fff).rw(FUNC(macpb030_state::via_r), FUNC(macpb030_state::via_w)); + map(0x50f02000, 0x50f03fff).rw(FUNC(macpb030_state::via2_r), FUNC(macpb030_state::via2_w)); + map(0x50f04000, 0x50f05fff).rw(FUNC(macpb030_state::scc_r), FUNC(macpb030_state::scc_w)); map(0x50f06000, 0x50f07fff).rw(FUNC(macpb030_state::scsi_drq_r), FUNC(macpb030_state::scsi_drq_w)); map(0x50f10000, 0x50f11fff).rw(FUNC(macpb030_state::scsi_r), FUNC(macpb030_state::scsi_w)); map(0x50f12060, 0x50f12063).r(FUNC(macpb030_state::scsi_drq_r)); @@ -729,28 +1192,32 @@ void macpb030_state::macpb165c_map(address_map &map) map(0x50f16000, 0x50f17fff).rw(FUNC(macpb030_state::swim_r), FUNC(macpb030_state::swim_w)); map(0x50f20000, 0x50f21fff).r(FUNC(macpb030_state::buserror_r)); // bus error here to detect we're not the grayscale 160/165/180 map(0x50f24000, 0x50f27fff).r(FUNC(macpb030_state::buserror_r)); // bus error here to make sure we aren't mistaken for another decoder + map(0x50f80000, 0x50fbffff).rw(FUNC(macpb030_state::niagra_r), FUNC(macpb030_state::niagra_w)); // on-board color video on 165c/180c - map(0xfc000000, 0xfc07ffff).rw(m_vga, FUNC(wd90c26_vga_device::mem_linear_r), FUNC(wd90c26_vga_device::mem_linear_w)).mirror(0x00380000); // 512k of VRAM -// map(0xfc400000, 0xfc7fffff).rw(FUNC(macpb030_state::macwd_r), FUNC(macpb030_state::macwd_w)); + map(0xfc000000, 0xfc07ffff).rw(FUNC(macpb030_state::pangola_vram_r), FUNC(macpb030_state::pangola_vram_w)).mirror(0x00380000); map(0xfc4003b0, 0xfc4003df).m(m_vga, FUNC(wd90c26_vga_device::io_map)); - // something else video related? is at fc800000 + map(0xfc800000, 0xfc800003).rw(FUNC(macpb030_state::pangola_r), FUNC(macpb030_state::pangola_w)); map(0xfcff8000, 0xfcffffff).rom().region("vrom", 0x0000); + + // external video on 165c/180c + map(0xfe0fe000, 0xfe0fe0ff).rw(FUNC(macpb030_state::ext_video_r), FUNC(macpb030_state::ext_video_w)); + map(0xfe100000, 0xfe17ffff).ram().share("ext_vram"); } void macpb030_state::macpd210_map(address_map &map) { map(0x40000000, 0x400fffff).r(FUNC(macpb030_state::rom_switch_r)).mirror(0x0ff00000); - map(0x50f00000, 0x50f01fff).rw(FUNC(macpb030_state::mac_via_r), FUNC(macpb030_state::mac_via_w)); - map(0x50f02000, 0x50f03fff).rw(FUNC(macpb030_state::mac_via2_r), FUNC(macpb030_state::mac_via2_w)); - map(0x50f04000, 0x50f05fff).rw(FUNC(macpb030_state::mac_scc_r), FUNC(macpb030_state::mac_scc_2_w)); + map(0x50f00000, 0x50f01fff).rw(FUNC(macpb030_state::via_r), FUNC(macpb030_state::via_w)); + map(0x50f02000, 0x50f03fff).rw(FUNC(macpb030_state::via2_r), FUNC(macpb030_state::via2_w)); + map(0x50f04000, 0x50f05fff).rw(FUNC(macpb030_state::scc_r), FUNC(macpb030_state::scc_w)); map(0x50f06000, 0x50f07fff).rw(FUNC(macpb030_state::scsi_drq_r), FUNC(macpb030_state::scsi_drq_w)); map(0x50f10000, 0x50f11fff).rw(FUNC(macpb030_state::scsi_r), FUNC(macpb030_state::scsi_w)); map(0x50f12060, 0x50f12063).r(FUNC(macpb030_state::scsi_drq_r)); map(0x50f14000, 0x50f15fff).rw(m_asc, FUNC(asc_device::read), FUNC(asc_device::write)); map(0x50f16000, 0x50f17fff).rw(FUNC(macpb030_state::swim_r), FUNC(macpb030_state::swim_w)); - map(0x50f20000, 0x50f21fff).rw(FUNC(macpb030_state::mac_gsc_r), FUNC(macpb030_state::mac_gsc_w)); + map(0x50f20000, 0x50f21fff).rw(FUNC(macpb030_state::gsc_r), FUNC(macpb030_state::gsc_w)); map(0x50f24000, 0x50f27fff).r(FUNC(macpb030_state::buserror_r)); // bus error here to make sure we aren't mistaken for another decoder map(0x5ffffffc, 0x5fffffff).r(FUNC(macpb030_state::pd210_id_r)); @@ -758,17 +1225,17 @@ void macpb030_state::macpd210_map(address_map &map) map(0x60000000, 0x6001ffff).ram().share("vram").mirror(0x0ffe0000); } -u8 macpb030_state::mac_via_in_a() +u8 macpb030_state::via_in_a() { return 0x81 | 0x12; // ID for 140/160 } -u8 macpb030_state::mac_via_in_b() +u8 macpb030_state::via_in_b() { return 0x08 | m_rtc->data_r(); // flag indicating no Target Disk Mode } -void macpb030_state::mac_via_out_a(u8 data) +void macpb030_state::via_out_a(u8 data) { int hdsel = BIT(data, 5); if (hdsel != m_hdsel) @@ -781,29 +1248,29 @@ void macpb030_state::mac_via_out_a(u8 data) m_hdsel = hdsel; } -void macpb030_state::mac_via_out_b(u8 data) +void macpb030_state::via_out_b(u8 data) { m_rtc->ce_w(BIT(data, 2)); m_rtc->data_w(BIT(data, 0)); m_rtc->clk_w(BIT(data, 1)); } -u8 macpb030_state::mac_via2_in_a() +u8 macpb030_state::via2_in_a() { return m_pmu_to_via; } -u8 macpb030_state::mac_via2_in_b() +u8 macpb030_state::via2_in_b() { return ((m_pmu_ack & 1) << 1); } -void macpb030_state::mac_via2_out_a(u8 data) +void macpb030_state::via2_out_a(u8 data) { m_pmu_from_via = data; } -void macpb030_state::mac_via2_out_b(u8 data) +void macpb030_state::via2_out_b(u8 data) { if (m_pmu_req != BIT(data, 2)) { @@ -821,9 +1288,10 @@ INPUT_PORTS_END void macpb030_state::macpb140(machine_config &config) { - M68030(config, m_maincpu, C15M); + M68030(config, m_maincpu, 31.3344_MHz_XTAL/2); m_maincpu->set_addrmap(AS_PROGRAM, &macpb030_state::macpb140_map); m_maincpu->set_dasm_override(std::function(&mac68k_dasm_override), "mac68k_dasm_override"); + m_maincpu->set_fpu_enable(false); M50753(config, m_pmu, 3.93216_MHz_XTAL); m_pmu->read_p<1>().set(FUNC(macpb030_state::pmu_p1_r)); @@ -831,10 +1299,13 @@ void macpb030_state::macpb140(machine_config &config) m_pmu->write_p<2>().set(FUNC(macpb030_state::pmu_data_w)); m_pmu->read_p<3>().set(FUNC(macpb030_state::pmu_comms_r)); m_pmu->write_p<3>().set(FUNC(macpb030_state::pmu_comms_w)); - m_pmu->read_p<4>().set(FUNC(macpb030_state::pmu_adb_r)); - m_pmu->write_p<4>().set(FUNC(macpb030_state::pmu_adb_w)); + m_pmu->read_p<4>().set(FUNC(macpb030_state::pmu_p4_r)); + m_pmu->write_p<4>().set(FUNC(macpb030_state::pmu_p4_w)); m_pmu->read_in_p().set(FUNC(macpb030_state::pmu_in_r)); + m_pmu->ad_in<0>().set(FUNC(macpb030_state::brightness_r)); m_pmu->ad_in<1>().set(FUNC(macpb030_state::battery_r)); + m_pmu->ad_in<5>().set(FUNC(macpb030_state::battery2_r)); + m_pmu->ad_in<8>().set(FUNC(macpb030_state::battery3_r)); SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60.15); @@ -843,17 +1314,17 @@ void macpb030_state::macpb140(machine_config &config) m_screen->set_size(700, 480); m_screen->set_visarea(0, 639, 0, 399); m_screen->set_palette(m_palette); - m_screen->set_screen_update(FUNC(macpb030_state::screen_update_macpb140)); + m_screen->set_screen_update(FUNC(macpb030_state::screen_update_ddc)); PALETTE(config, m_palette, palette_device::MONOCHROME_INVERTED); - MACADB(config, m_macadb, C15M); + MACADB(config, m_macadb, 31.3344_MHz_XTAL/2); m_macadb->adb_data_callback().set(FUNC(macpb030_state::set_adb_line)); RTC3430042(config, m_rtc, 32.768_kHz_XTAL); m_rtc->cko_cb().set(m_via1, FUNC(via6522_device::write_ca2)); - SWIM1(config, m_swim, C15M); + SWIM1(config, m_swim, 31.3344_MHz_XTAL / 2); m_swim->phases_cb().set(FUNC(macpb030_state::phases_w)); m_swim->devsel_cb().set(FUNC(macpb030_state::devsel_w)); @@ -864,7 +1335,12 @@ void macpb030_state::macpb140(machine_config &config) NSCSI_CONNECTOR(config, "scsi:0", mac_scsi_devices, nullptr); NSCSI_CONNECTOR(config, "scsi:1", mac_scsi_devices, nullptr); NSCSI_CONNECTOR(config, "scsi:2", mac_scsi_devices, nullptr); - NSCSI_CONNECTOR(config, "scsi:3", mac_scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "scsi:3").option_set("cdrom", NSCSI_CDROM_APPLE).machine_config( + [](device_t *device) + { + device->subdevice("cdda")->add_route(0, "^^lspeaker", 1.0); + device->subdevice("cdda")->add_route(1, "^^rspeaker", 1.0); + }); NSCSI_CONNECTOR(config, "scsi:4", mac_scsi_devices, nullptr); NSCSI_CONNECTOR(config, "scsi:5", mac_scsi_devices, nullptr); NSCSI_CONNECTOR(config, "scsi:6", mac_scsi_devices, "harddisk"); @@ -881,48 +1357,53 @@ void macpb030_state::macpb140(machine_config &config) m_scsihelp->cpu_halt_callback().set_inputline(m_maincpu, INPUT_LINE_HALT); m_scsihelp->timeout_error_callback().set(FUNC(macpb030_state::scsi_berr_w)); - SCC85C30(config, m_scc, C7M); -// m_scc->intrq_callback().set(FUNC(macpb030_state::set_scc_interrupt)); + SCC85C30(config, m_scc, 31.3344_MHz_XTAL / 4); + m_scc->out_int_callback().set(FUNC(macpb030_state::scc_irq_w)); - R65C22(config, m_via1, C7M/10); - m_via1->readpa_handler().set(FUNC(macpb030_state::mac_via_in_a)); - m_via1->readpb_handler().set(FUNC(macpb030_state::mac_via_in_b)); - m_via1->writepa_handler().set(FUNC(macpb030_state::mac_via_out_a)); - m_via1->writepb_handler().set(FUNC(macpb030_state::mac_via_out_b)); + R65C22(config, m_via1, 31.3344_MHz_XTAL / 20); + m_via1->readpa_handler().set(FUNC(macpb030_state::via_in_a)); + m_via1->readpb_handler().set(FUNC(macpb030_state::via_in_b)); + m_via1->writepa_handler().set(FUNC(macpb030_state::via_out_a)); + m_via1->writepb_handler().set(FUNC(macpb030_state::via_out_b)); m_via1->irq_handler().set(FUNC(macpb030_state::via_irq_w)); - R65NC22(config, m_via2, C7M/10); - m_via2->readpa_handler().set(FUNC(macpb030_state::mac_via2_in_a)); - m_via2->readpb_handler().set(FUNC(macpb030_state::mac_via2_in_b)); - m_via2->writepa_handler().set(FUNC(macpb030_state::mac_via2_out_a)); - m_via2->writepb_handler().set(FUNC(macpb030_state::mac_via2_out_b)); - m_via2->irq_handler().set(FUNC(macpb030_state::via2_irq_w)); + APPLE_PSEUDOVIA(config, m_pseudovia, 31.3344_MHz_XTAL / 20); + m_pseudovia->readpa_handler().set(FUNC(macpb030_state::via2_in_a)); + m_pseudovia->readpb_handler().set(FUNC(macpb030_state::via2_in_b)); + m_pseudovia->writepa_handler().set(FUNC(macpb030_state::via2_out_a)); + m_pseudovia->writepb_handler().set(FUNC(macpb030_state::via2_out_b)); + m_pseudovia->irq_callback().set(FUNC(macpb030_state::via2_irq_w)); SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); ASC(config, m_asc, 22.5792_MHz_XTAL, asc_device::asc_type::EASC); - m_asc->irqf_callback().set(FUNC(macpb030_state::asc_irq_w)); + m_asc->irqf_callback().set(m_pseudovia, FUNC(pseudovia_device::asc_irq_w)); m_asc->add_route(0, "lspeaker", 1.0); m_asc->add_route(1, "rspeaker", 1.0); - /* internal ram */ RAM(config, m_ram); m_ram->set_default_size("2M"); m_ram->set_extra_options("4M,6M,8M"); + SOFTWARE_LIST(config, "hdd_list").set_original("mac_hdd"); + SOFTWARE_LIST(config, "cd_list").set_original("mac_cdrom").set_filter("MC68030,MC68030_32"); SOFTWARE_LIST(config, "flop_mac35_orig").set_original("mac_flop_orig"); SOFTWARE_LIST(config, "flop_mac35_clean").set_original("mac_flop_clcracked"); SOFTWARE_LIST(config, "flop35_list").set_original("mac_flop"); SOFTWARE_LIST(config, "flop35hd_list").set_original("mac_hdflop"); - SOFTWARE_LIST(config, "hdd_list").set_original("mac_hdd"); } -// PowerBook 145 = 140 @ 25 MHz (still 2MB RAM - the 145B upped that to 4MB) +// PowerBook 145 = 140 @ 25 MHz (still 2MB RAM) void macpb030_state::macpb145(machine_config &config) { macpb140(config); - m_maincpu->set_clock(25000000); + m_maincpu->set_clock(25_MHz_XTAL); +} +// PowerBook 145B = 140 @ 25 MHz with 4MB RAM +void macpb030_state::macpb145b(machine_config &config) +{ + macpb145(config); m_ram->set_default_size("4M"); m_ram->set_extra_options("6M,8M"); } @@ -931,7 +1412,8 @@ void macpb030_state::macpb145(machine_config &config) void macpb030_state::macpb170(machine_config &config) { macpb140(config); - m_maincpu->set_clock(25000000); + m_maincpu->set_clock(25_MHz_XTAL); + m_maincpu->set_fpu_enable(true); m_ram->set_default_size("4M"); m_ram->set_extra_options("6M,8M"); @@ -939,109 +1421,33 @@ void macpb030_state::macpb170(machine_config &config) void macpb030_state::macpb160(machine_config &config) { - M68030(config, m_maincpu, 25000000); + macpb140(config); + m_maincpu->set_clock(25_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &macpb030_state::macpb160_map); - m_maincpu->set_dasm_override(std::function(&mac68k_dasm_override), "mac68k_dasm_override"); - - M50753(config, m_pmu, 3.93216_MHz_XTAL); - m_pmu->read_p<2>().set(FUNC(macpb030_state::pmu_data_r)); - m_pmu->write_p<2>().set(FUNC(macpb030_state::pmu_data_w)); - m_pmu->read_p<3>().set(FUNC(macpb030_state::pmu_comms_r)); - m_pmu->write_p<3>().set(FUNC(macpb030_state::pmu_comms_w)); - m_pmu->read_p<4>().set(FUNC(macpb030_state::pmu_adb_r)); - m_pmu->write_p<4>().set(FUNC(macpb030_state::pmu_adb_w)); - m_pmu->read_in_p().set(FUNC(macpb030_state::pmu_in_r)); - - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60.15); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(1260)); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_size(700, 480); - m_screen->set_visarea(0, 639, 0, 399); - m_screen->set_palette(m_palette); - m_screen->set_screen_update(FUNC(macpb030_state::screen_update_macpb160)); - - PALETTE(config, m_palette, FUNC(macpb030_state::macgsc_palette), 16); - - MACADB(config, m_macadb, C15M); - m_macadb->adb_data_callback().set(FUNC(macpb030_state::set_adb_line)); - - RTC3430042(config, m_rtc, 32.768_kHz_XTAL); - m_rtc->cko_cb().set(m_via1, FUNC(via6522_device::write_ca2)); - - SWIM1(config, m_swim, C15M); - m_swim->phases_cb().set(FUNC(macpb030_state::phases_w)); - m_swim->devsel_cb().set(FUNC(macpb030_state::devsel_w)); - - applefdintf_device::add_35_hd(config, m_floppy[0]); - applefdintf_device::add_35_nc(config, m_floppy[1]); - - NSCSI_BUS(config, "scsi"); - NSCSI_CONNECTOR(config, "scsi:0", mac_scsi_devices, nullptr); - NSCSI_CONNECTOR(config, "scsi:1", mac_scsi_devices, nullptr); - NSCSI_CONNECTOR(config, "scsi:2", mac_scsi_devices, nullptr); - NSCSI_CONNECTOR(config, "scsi:3", mac_scsi_devices, nullptr); - NSCSI_CONNECTOR(config, "scsi:4", mac_scsi_devices, nullptr); - NSCSI_CONNECTOR(config, "scsi:5", mac_scsi_devices, nullptr); - NSCSI_CONNECTOR(config, "scsi:6", mac_scsi_devices, "harddisk"); - NSCSI_CONNECTOR(config, "scsi:7").option_set("ncr5380", NCR53C80).machine_config([this](device_t *device) { - ncr53c80_device &adapter = downcast(*device); - adapter.drq_handler().set(m_scsihelp, FUNC(mac_scsi_helper_device::drq_w)); - }); - - MAC_SCSI_HELPER(config, m_scsihelp); - m_scsihelp->scsi_read_callback().set(m_ncr5380, FUNC(ncr53c80_device::read)); - m_scsihelp->scsi_write_callback().set(m_ncr5380, FUNC(ncr53c80_device::write)); - m_scsihelp->scsi_dma_read_callback().set(m_ncr5380, FUNC(ncr53c80_device::dma_r)); - m_scsihelp->scsi_dma_write_callback().set(m_ncr5380, FUNC(ncr53c80_device::dma_w)); - m_scsihelp->cpu_halt_callback().set_inputline(m_maincpu, INPUT_LINE_HALT); - m_scsihelp->timeout_error_callback().set(FUNC(macpb030_state::scsi_berr_w)); - - SCC85C30(config, m_scc, C7M); - // m_scc->intrq_callback().set(FUNC(macpb030_state::set_scc_interrupt)); - - R65C22(config, m_via1, C7M / 10); - m_via1->readpa_handler().set(FUNC(macpb030_state::mac_via_in_a)); - m_via1->readpb_handler().set(FUNC(macpb030_state::mac_via_in_b)); - m_via1->writepa_handler().set(FUNC(macpb030_state::mac_via_out_a)); - m_via1->writepb_handler().set(FUNC(macpb030_state::mac_via_out_b)); - m_via1->irq_handler().set(FUNC(macpb030_state::via_irq_w)); - - R65NC22(config, m_via2, C7M / 10); - m_via2->readpa_handler().set(FUNC(macpb030_state::mac_via2_in_a)); - m_via2->readpb_handler().set(FUNC(macpb030_state::mac_via2_in_b)); - m_via2->writepa_handler().set(FUNC(macpb030_state::mac_via2_out_a)); - m_via2->writepb_handler().set(FUNC(macpb030_state::mac_via2_out_b)); - m_via2->irq_handler().set(FUNC(macpb030_state::via2_irq_w)); + m_maincpu->set_fpu_enable(false); - SPEAKER(config, "lspeaker").front_left(); - SPEAKER(config, "rspeaker").front_right(); - ASC(config, m_asc, 22.5792_MHz_XTAL, asc_device::asc_type::EASC); - m_asc->irqf_callback().set(FUNC(macpb030_state::asc_irq_w)); - m_asc->add_route(0, "lspeaker", 1.0); - m_asc->add_route(1, "rspeaker", 1.0); + PALETTE(config.replace(), m_palette, FUNC(macpb030_state::macgsc_palette), 16); + m_screen->set_screen_update(FUNC(macpb030_state::screen_update_gsc)); - /* internal ram */ - RAM(config, m_ram); - m_ram->set_default_size("2M"); - m_ram->set_extra_options("4M,6M,8M"); + m_ram->set_extra_options("4M,6M,8M,12M,14M"); +} - SOFTWARE_LIST(config, "flop_mac35_orig").set_original("mac_flop_orig"); - SOFTWARE_LIST(config, "flop_mac35_clean").set_original("mac_flop_clcracked"); - SOFTWARE_LIST(config, "flop35_list").set_original("mac_flop"); - SOFTWARE_LIST(config, "hdd_list").set_original("mac_hdd"); +void macpb030_state::macpb165(machine_config &config) +{ + macpb160(config); + m_maincpu->set_clock(33_MHz_XTAL); } void macpb030_state::macpb180(machine_config &config) { macpb160(config); - m_maincpu->set_clock(33000000); + m_maincpu->set_clock(33_MHz_XTAL); + m_maincpu->set_fpu_enable(true); } -void macpb030_state::macpb180c(machine_config &config) +void macpb030_state::macpb165c(machine_config &config) { - macpb160(config); - m_maincpu->set_clock(33000000); + macpb180(config); m_maincpu->set_addrmap(AS_PROGRAM, &macpb030_state::macpb165c_map); m_screen->set_raw(25.175_MHz_XTAL, 800, 0, 640, 524, 0, 480); @@ -1052,6 +1458,14 @@ void macpb030_state::macpb180c(machine_config &config) m_vga->set_screen(m_screen); // 512KB m_vga->set_vram_size(0x80000); + // model ID: 0 = 180c, 1 = 165c + m_vga->read_cnf15_callback().set_constant(1); +} + +void macpb030_state::macpb180c(machine_config &config) +{ + macpb165c(config); + m_vga->read_cnf15_callback().set_constant(0); } void macpb030_state::macpd210(machine_config &config) @@ -1072,29 +1486,9 @@ ROM_START(macpb140) ROM_LOAD("pmuv2.bin", 0x000000, 0x001800, CRC(1a32b5e5) SHA1(7c096324763cfc8d2024893b3e8493b7729b3a92)) ROM_END -ROM_START(macpb145) - ROM_REGION32_BE(0x100000, "bootrom", 0) - ROM_LOAD("420dbff3.rom", 0x000000, 0x100000, CRC(88ea2081) SHA1(7a8ee468d16e64f2ad10cb8d1a45e6f07cc9e212)) - - ROM_REGION(0x1800, "pmu", 0) - ROM_LOAD("pmuv2.bin", 0x000000, 0x001800, CRC(1a32b5e5) SHA1(7c096324763cfc8d2024893b3e8493b7729b3a92)) -ROM_END - -ROM_START(macpb145b) - ROM_REGION32_BE(0x100000, "bootrom", 0) - ROM_LOAD("420dbff3.rom", 0x000000, 0x100000, CRC(88ea2081) SHA1(7a8ee468d16e64f2ad10cb8d1a45e6f07cc9e212)) - - ROM_REGION(0x1800, "pmu", 0) - ROM_LOAD("pmuv2.bin", 0x000000, 0x001800, CRC(1a32b5e5) SHA1(7c096324763cfc8d2024893b3e8493b7729b3a92)) -ROM_END - -ROM_START(macpb170) - ROM_REGION32_BE(0x100000, "bootrom", 0) - ROM_LOAD("420dbff3.rom", 0x000000, 0x100000, CRC(88ea2081) SHA1(7a8ee468d16e64f2ad10cb8d1a45e6f07cc9e212)) - - ROM_REGION(0x1800, "pmu", 0) - ROM_LOAD("pmuv2.bin", 0x000000, 0x001800, CRC(1a32b5e5) SHA1(7c096324763cfc8d2024893b3e8493b7729b3a92)) -ROM_END +#define rom_macpb145 rom_macpb140 +#define rom_macpb145b rom_macpb140 +#define rom_macpb170 rom_macpb140 ROM_START(macpb160) ROM_REGION32_BE(0x100000, "bootrom", 0) @@ -1104,13 +1498,8 @@ ROM_START(macpb160) ROM_LOAD("pmuv3.bin", 0x000000, 0x001800, CRC(f2df696c) SHA1(fc312cbfd407c6f0248c6463910e41ad6b5b0daa)) ROM_END -ROM_START(macpb180) - ROM_REGION32_BE(0x100000, "bootrom", 0) - ROM_LOAD("e33b2724.rom", 0x000000, 0x100000, CRC(536c60f4) SHA1(c0510682ae6d973652d7e17f3c3b27629c47afac)) - - ROM_REGION(0x1800, "pmu", 0) - ROM_LOAD("pmuv3.bin", 0x000000, 0x001800, CRC(f2df696c) SHA1(fc312cbfd407c6f0248c6463910e41ad6b5b0daa)) -ROM_END +#define rom_macpb165 rom_macpb160 +#define rom_macpb180 rom_macpb160 ROM_START(macpb180c) ROM_REGION32_BE(0x100000, "bootrom", 0) @@ -1123,6 +1512,8 @@ ROM_START(macpb180c) ROM_LOAD("pmuv3.bin", 0x000000, 0x001800, CRC(f2df696c) SHA1(fc312cbfd407c6f0248c6463910e41ad6b5b0daa)) ROM_END +#define rom_macpb165c rom_macpb180c + ROM_START(macpd210) ROM_REGION32_BE(0x100000, "bootrom", 0) ROM_LOAD("ecfa989b.rom", 0x000000, 0x100000, CRC(b86ed854) SHA1(ed1371c97117a5884da4a6605ecfc5abed48ae5a)) @@ -1133,13 +1524,15 @@ ROM_END } // anonymous namespace -COMP(1991, macpb140, 0, 0, macpb140, macadb, macpb030_state, init_macpb140, "Apple Computer", "Macintosh PowerBook 140", MACHINE_NOT_WORKING) -COMP(1991, macpb170, macpb140, 0, macpb170, macadb, macpb030_state, init_macpb140, "Apple Computer", "Macintosh PowerBook 170", MACHINE_NOT_WORKING) -COMP(1992, macpb145, macpb140, 0, macpb145, macadb, macpb030_state, init_macpb140, "Apple Computer", "Macintosh PowerBook 145", MACHINE_NOT_WORKING) -COMP(1992, macpb145b, macpb140, 0, macpb170, macadb, macpb030_state, init_macpb140, "Apple Computer", "Macintosh PowerBook 145B", MACHINE_NOT_WORKING) -COMP(1992, macpb160, 0, 0, macpb160, macadb, macpb030_state, init_macpb160, "Apple Computer", "Macintosh PowerBook 160", MACHINE_NOT_WORKING) -COMP(1992, macpb180, macpb160, 0, macpb180, macadb, macpb030_state, init_macpb160, "Apple Computer", "Macintosh PowerBook 180", MACHINE_NOT_WORKING) -COMP(1992, macpb180c, macpb160, 0, macpb180c, macadb, macpb030_state, init_macpb160, "Apple Computer", "Macintosh PowerBook 180c", MACHINE_NOT_WORKING) +COMP(1991, macpb140, 0, 0, macpb140, macadb, macpb030_state, empty_init, "Apple Computer", "Macintosh PowerBook 140", MACHINE_NOT_WORKING) +COMP(1991, macpb170, macpb140, 0, macpb170, macadb, macpb030_state, empty_init, "Apple Computer", "Macintosh PowerBook 170", MACHINE_NOT_WORKING) +COMP(1992, macpb145, macpb140, 0, macpb145, macadb, macpb030_state, empty_init, "Apple Computer", "Macintosh PowerBook 145", MACHINE_NOT_WORKING) +COMP(1993, macpb145b, macpb140, 0, macpb145b, macadb, macpb030_state, empty_init, "Apple Computer", "Macintosh PowerBook 145B", MACHINE_NOT_WORKING) +COMP(1992, macpb160, 0, 0, macpb160, macadb, macpb030_state, empty_init, "Apple Computer", "Macintosh PowerBook 160", MACHINE_NOT_WORKING) +COMP(1993, macpb165, macpb160, 0, macpb165, macadb, macpb030_state, empty_init, "Apple Computer", "Macintosh PowerBook 165", MACHINE_NOT_WORKING) +COMP(1993, macpb165c, macpb180c, 0, macpb165c, macadb, macpb030_state, empty_init, "Apple Computer", "Macintosh PowerBook 165c", MACHINE_NOT_WORKING) +COMP(1992, macpb180, macpb160, 0, macpb180, macadb, macpb030_state, empty_init, "Apple Computer", "Macintosh PowerBook 180", MACHINE_NOT_WORKING) +COMP(1993, macpb180c, 0, 0, macpb180c, macadb, macpb030_state, empty_init, "Apple Computer", "Macintosh PowerBook 180c", MACHINE_NOT_WORKING) -// PowerBook Duos (may or may not belong in this driver ultimately) -COMP(1992, macpd210, 0, 0, macpd210, macadb, macpb030_state, init_macpb160, "Apple Computer", "Macintosh PowerBook Duo 210", MACHINE_NOT_WORKING) +// PowerBook Duos (probably will not belong in this driver ultimately) +COMP(1992, macpd210, 0, 0, macpd210, macadb, macpb030_state, empty_init, "Apple Computer", "Macintosh PowerBook Duo 210", MACHINE_NOT_WORKING) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 139680b3b40..912fd456e4e 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -923,9 +923,11 @@ macpb140 // 1991 Apple Macintosh PowerBook 140 macpb145 // 1992 Apple Macintosh PowerBook 145 macpb145b // 1993 Apple Macintosh PowerBook 145B macpb160 // 1992 Apple Macintosh PowerBook 160 +macpb165 // 1993 Apple Macintosh PowerBook 165 +macpb165c // 1993 Apple Macintosh PowerBook 165c macpb170 // 1991 Apple Macintosh PowerBook 170 macpb180 // 1992 Apple Macintosh PowerBook 180 -macpb180c // 1992 Apple Macintosh PowerBook 180c +macpb180c // 1993 Apple Macintosh PowerBook 180c macpd210 // 1992 Apple Macintosh PowerBook Duo 210 @source:apple/macquadra605.cpp -- cgit v1.2.3