diff options
author | arbee <rb6502@users.noreply.github.com> | 2021-03-27 21:57:46 -0400 |
---|---|---|
committer | arbee <rb6502@users.noreply.github.com> | 2021-03-27 21:57:46 -0400 |
commit | e20239398c18cf25d433aa4388f0fd4509ccc1a6 (patch) | |
tree | 16dc4ed1fdccfc7eecfb245af1ee80973381551d | |
parent | 87bf87dae8ac66290d062de10dc93755aaa22b64 (diff) |
mac.cpp: more dead code removal [R. Belmont]
-rw-r--r-- | src/mame/includes/mac.h | 57 | ||||
-rw-r--r-- | src/mame/machine/mac.cpp | 113 | ||||
-rw-r--r-- | src/mame/video/mac.cpp | 53 |
3 files changed, 20 insertions, 203 deletions
diff --git a/src/mame/includes/mac.h b/src/mame/includes/mac.h index 8088178b114..4d349f781b0 100644 --- a/src/mame/includes/mac.h +++ b/src/mame/includes/mac.h @@ -22,7 +22,6 @@ #include "bus/nubus/nubus.h" #include "bus/macpds/macpds.h" #include "machine/applefdintf.h" -#include "machine/ncr539x.h" #include "machine/ncr5380.h" #include "machine/macrtc.h" #include "sound/asc.h" @@ -32,27 +31,21 @@ #include "screen.h" #define MAC_SCREEN_NAME "screen" -#define MAC_539X_1_TAG "539x_1" -#define MAC_539X_2_TAG "539x_2" // model helpers -#define ADB_IS_BITBANG_CLASS ((m_model == MODEL_MAC_SE || m_model == MODEL_MAC_CLASSIC) || (m_model >= MODEL_MAC_II && m_model <= MODEL_MAC_IICI) || (m_model == MODEL_MAC_SE30) || (m_model == MODEL_MAC_QUADRA_700)) +#define ADB_IS_BITBANG_CLASS ((m_model >= MODEL_MAC_II && m_model <= MODEL_MAC_IICI) || (m_model == MODEL_MAC_SE30)) #define ADB_IS_EGRET (m_model >= MODEL_MAC_LC && m_model <= MODEL_MAC_CLASSIC_II) || ((m_model >= MODEL_MAC_IISI) && (m_model <= MODEL_MAC_IIVI)) -#define ADB_IS_CUDA ((m_model >= MODEL_MAC_COLOR_CLASSIC && m_model <= MODEL_MAC_LC_580) || ((m_model >= MODEL_MAC_QUADRA_660AV) && (m_model <= MODEL_MAC_QUADRA_630)) || (m_model >= MODEL_MAC_POWERMAC_6100)) +#define ADB_IS_CUDA ((m_model >= MODEL_MAC_COLOR_CLASSIC && m_model <= MODEL_MAC_LC_580) || ((m_model >= MODEL_MAC_QUADRA_660AV) && (m_model <= MODEL_MAC_QUADRA_630))) // video parameters for classic Macs #define MAC_H_VIS (512) #define MAC_V_VIS (342) -#define MAC_H_TOTAL (704) // (512+192) -#define MAC_V_TOTAL (370) // (342+28) +#define MAC_H_TOTAL (704) // (512+192) +#define MAC_V_TOTAL (370) // (342+28) -/*----------- defined in machine/mac.c -----------*/ + /* Mac driver data */ -void mac_fdc_set_enable_lines(device_t *device, int enable_mask); - -/* Mac driver data */ - -class mac_state : public driver_device + class mac_state:public driver_device { public: mac_state(const machine_config &mconfig, device_type type, const char *tag) : @@ -66,8 +59,6 @@ public: m_macadb(*this, "macadb"), m_ram(*this, RAM_TAG), m_scc(*this, "scc"), - m_539x_1(*this, MAC_539X_1_TAG), - m_539x_2(*this, MAC_539X_2_TAG), m_ncr5380(*this, "ncr5380"), m_fdc(*this, "fdc"), m_floppy(*this, "fdc:%d", 0U), @@ -104,7 +95,6 @@ public: void maciici(machine_config &config); void maciix(machine_config &config, bool nubus_bank1 = true, bool nubus_bank2 = true); void maclc520(machine_config &config); - void pwrmac(machine_config &config); void maciivx(machine_config &config); void maccclas(machine_config &config); void maciivi(machine_config &config); @@ -123,12 +113,9 @@ public: void init_maciivx(); void init_maciivi(); void init_macii(); - void init_macclassic(); void init_macclassic2(); void init_maciifx(); void init_maclc(); - void init_macse(); - void init_macpm6100(); void init_maclc520(); void init_maciici(); void init_maciix(); @@ -137,21 +124,10 @@ public: void init_maciicx(); void init_maclc3(); void init_maclc3plus(); - void init_macpm7100(); - void init_macpm8100(); /* tells which model is being emulated (set by macxxx_init) */ enum model_t { - MODEL_MAC_128K512K, // 68000 machines - MODEL_MAC_512KE, - MODEL_MAC_PLUS, - MODEL_MAC_SE, - MODEL_MAC_CLASSIC, - - MODEL_MAC_PORTABLE, // Portable/PB100 are sort of hybrid classic and Mac IIs - MODEL_MAC_PB100, - MODEL_MAC_II, // Mac II class 68020/030 machines MODEL_MAC_II_FDHD, MODEL_MAC_IIX, @@ -206,10 +182,6 @@ public: MODEL_MAC_PB540c, MODEL_MAC_PB190, MODEL_MAC_PB190cs, - - MODEL_MAC_POWERMAC_6100, // NuBus PowerMacs - MODEL_MAC_POWERMAC_7100, - MODEL_MAC_POWERMAC_8100 }; model_t m_model; @@ -224,8 +196,6 @@ private: optional_device<macadb_device> m_macadb; required_device<ram_device> m_ram; required_device<scc8530_legacy_device> m_scc; - optional_device<ncr539x_device> m_539x_1; - optional_device<ncr539x_device> m_539x_2; optional_device<ncr5380_device> m_ncr5380; required_device<applefdintf_device> m_fdc; required_device_array<floppy_connector, 2> m_floppy; @@ -346,9 +316,6 @@ private: DECLARE_WRITE_LINE_MEMBER(nubus_irq_d_w); DECLARE_WRITE_LINE_MEMBER(nubus_irq_e_w); - DECLARE_WRITE_LINE_MEMBER(irq_539x_1_w); - DECLARE_WRITE_LINE_MEMBER(drq_539x_1_w); - DECLARE_WRITE_LINE_MEMBER(cuda_reset_w); DECLARE_WRITE_LINE_MEMBER(mac_scsi_irq); @@ -362,16 +329,8 @@ private: void macse30_map(address_map &map); void pwrmac_map(address_map &map); - inline bool has_adb() { return m_model >= MODEL_MAC_SE; } - uint8_t m_oss_regs[0x400]; - // AMIC for x100 PowerMacs - uint8_t m_amic_regs[0x200]; - - // HMC for x100 PowerMacs - uint64_t m_hmc_reg, m_hmc_shiftout; - int m_via2_ca1_hack; optional_device<screen_device> m_screen; optional_device<palette_device> m_palette; @@ -397,14 +356,12 @@ private: DECLARE_VIDEO_RESET(macsonora); DECLARE_VIDEO_RESET(maceagle); DECLARE_VIDEO_START(macrbv); - uint32_t screen_update_mac(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_macse30(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_macrbv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - uint32_t screen_update_pwrmac(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t screen_update_macrbvvram(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t screen_update_macv8(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t screen_update_macsonora(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - uint32_t screen_update_macpbwd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + DECLARE_WRITE_LINE_MEMBER(mac_rbv_vbl); TIMER_CALLBACK_MEMBER(mac_6015_tick); TIMER_CALLBACK_MEMBER(mac_adbrefresh_tick); diff --git a/src/mame/machine/mac.cpp b/src/mame/machine/mac.cpp index f7007df15e3..0830f5e79c7 100644 --- a/src/mame/machine/mac.cpp +++ b/src/mame/machine/mac.cpp @@ -4,7 +4,7 @@ machine/mac.c - Mac hardware - Mac 128k, 512k, 512ke, Plus, SE, Classic, II, PowerBook (SCSI, SCC, ADB, etc) + Mac II series hardware Nate Woods Ernesto Corvi @@ -13,14 +13,6 @@ Mac Model Feature Summary: CPU FDC Kbd/Mouse PRAM Video - - Mac 128k 68k IWM orig orig Original - - Mac 512k 68k IWM orig orig Original - - Mac 512ke 68k IWM orig orig Original - - Mac Plus 68k IWM orig ext Original - - Mac SE 68k IWM MacII ADB ext Original - - Mac Classic 68k SWIM MacII ADB ext Original - - Mac Portable 68k (16 MHz) SWIM ADB-PMU PMU 640x400 B&W - - PowerBook 100 68k (16 MHz) SWIM ADB-PMU PMU 640x400 B&W - Mac II 020 IWM MacII ADB ext NuBus card - Mac IIx 030 SWIM MacII ADB ext NuBus card - Mac IIfx 030 SWIM IOP ADB ext NuBus card @@ -28,22 +20,14 @@ - Mac IIcx 030 SWIM MacII ADB ext NuBus card - Mac IIci 030 SWIM MacII ADB ext Internal "RBV" type - Mac IIsi 030 SWIM Egret ADB n/a Internal "RBV" type - - PowerBook 140/145(B) 030 (16/25 MHz) SWIM ADB-PMU PMU 640x400 B&W (passive matrix) - - PowerBook 170 030 (25 MHz) SWIM ADB-PMU PMU 640x400 B&W (active matrix) - Mac IIvx/IIvi 030 SWIM Egret ADB n/a Internal "VASP" type - Mac LC 020 SWIM Egret ADB n/a Internal "V8" type - Mac LC II 030 SWIM Egret ADB n/a Internal "V8" type - Mac LC III 030 SWIM Egret ADB n/a Internal "Sonora" type - Mac Classic II 030 SWIM Egret ADB n/a Internal "Eagle" type (V8 clone) - Mac Color Classic 030 SWIM Cuda ADB n/a Internal "Spice" type (V8 clone) - - Mac Quadra 700 040 (25 MHz) SWIM II MacII ADB ext Internal "DAFB" type - - Mac Quadra 900 040 (33 MHz) SWIM II IOP ADB ext Internal "DAFB" type Notes: - - The Mac Plus boot code seems to check to see the extent of ROM - mirroring to determine if SCSI is available. If the ROM is mirrored, - then SCSI is not available. Thanks to R. Belmont for making this - discovery. - On the SE and most later Macs, the first access to ROM turns off the overlay. However, the Mac II/IIx/IIcx (and others?) have the old-style VIA overlay control bit! - The Mac II can have either a 68551 PMMU fitted or an Apple custom that handles 24 vs. 32 @@ -96,14 +80,8 @@ #include "machine/iwm.h" #include "machine/swim1.h" -#define AUDIO_IS_CLASSIC (m_model <= MODEL_MAC_CLASSIC) -#define MAC_HAS_VIA2 ((m_model >= MODEL_MAC_II) && (m_model != MODEL_MAC_IIFX)) - #define INTS_RBV ((m_model >= MODEL_MAC_IICI) && (m_model <= MODEL_MAC_IIVI)) || ((m_model >= MODEL_MAC_LC) && (m_model <= MODEL_MAC_LC_580)) -#define MAC_MAIN_SND_BUF_OFFSET 0x0300 -#define MAC_ALT_SND_BUF_OFFSET 0x5F00 - #ifdef MAME_DEBUG #define LOG_ADB 0 #define LOG_VIA 0 @@ -162,18 +140,7 @@ void mac_state::field_interrupts() { int take_interrupt = -1; - if (m_model < MODEL_MAC_PORTABLE) - { - if ((m_scc_interrupt) || (m_scsi_interrupt)) - { - take_interrupt = 2; - } - else if (m_via_interrupt) - { - take_interrupt = 1; - } - } - else if ((m_model < MODEL_MAC_POWERMAC_6100) && (m_model != MODEL_MAC_IIFX)) + if (m_model != MODEL_MAC_IIFX) { if (m_scc_interrupt) { @@ -190,7 +157,7 @@ void mac_state::field_interrupts() } else { - return; // no interrupts for PowerPC yet + return; // no interrupts for IIfx yet } if (m_last_taken_interrupt > -1) @@ -240,7 +207,7 @@ WRITE_LINE_MEMBER(mac_state::mac_asc_irq) rbv_recalc_irqs(); } } - else if ((m_model >= MODEL_MAC_II) && (m_model != MODEL_MAC_IIFX)) + else if (m_model != MODEL_MAC_IIFX) { m_via2->write_cb1(state^1); } @@ -411,12 +378,6 @@ void mac_state::set_memory_overlay(int overlay) space.unmap_write(0x000000, 0x9fffff); mac_install_memory(0x000000, memory_size-1, memory_size, memory_data, is_rom); } - else if ((m_model == MODEL_MAC_PB140) || (m_model == MODEL_MAC_PB160) || ((m_model >= MODEL_MAC_PBDUO_210) && (m_model <= MODEL_MAC_PBDUO_270c))) - { - address_space& space = m_maincpu->space(AS_PROGRAM); - space.unmap_write(0x000000, 0xffffff); - mac_install_memory(0x000000, memory_size-1, memory_size, memory_data, is_rom); - } else if ((m_model >= MODEL_MAC_II) && (m_model <= MODEL_MAC_SE30) && (m_model != MODEL_MAC_IIVX) && (m_model != MODEL_MAC_IIVI)) { mac_install_memory(0x00000000, 0x3fffffff, memory_size, memory_data, is_rom); @@ -435,14 +396,6 @@ void mac_state::set_memory_overlay(int overlay) m_maincpu->space(AS_PROGRAM).install_rom(0x40000000, 0x4fffffff & ~rom_mirror, rom_mirror, m_rom_ptr); } } - else if (m_model == MODEL_MAC_QUADRA_700) - { - if (!is_rom) - { - mac_install_memory(0x40000000, 0x400fffff, m_rom_size, m_rom_ptr, true); - } - mac_install_memory(0x00000000, memory_size-1, memory_size, memory_data, is_rom); - } else { mac_install_memory(0x00000000, 0x003fffff, memory_size, memory_data, is_rom); @@ -746,13 +699,9 @@ uint8_t mac_state::mac_via_in_a() switch (m_model) { - case MODEL_MAC_CLASSIC: case MODEL_MAC_II: case MODEL_MAC_II_FDHD: case MODEL_MAC_IIX: - case MODEL_MAC_POWERMAC_6100: - case MODEL_MAC_POWERMAC_7100: - case MODEL_MAC_POWERMAC_8100: return 0x81; // bit 0 must be set on most Macs to avoid attempting to boot from AppleTalk case MODEL_MAC_SE30: @@ -776,15 +725,10 @@ uint8_t mac_state::mac_via_in_a() case MODEL_MAC_IICX: return 0x81 | PA6; - case MODEL_MAC_PB140: // since the ASICs are different, these are allowed to "collide" - case MODEL_MAC_PB160: case MODEL_MAC_CLASSIC_II: case MODEL_MAC_QUADRA_800: return 0x81 | PA4 | PA1; - case MODEL_MAC_QUADRA_700: - return 0x81 | PA6; - case MODEL_MAC_QUADRA_900: return 0x81 | PA6 | PA4; @@ -1130,11 +1074,8 @@ void mac_state::machine_reset() m_last_taken_interrupt = -1; /* setup the memory overlay */ - if (m_model < MODEL_MAC_POWERMAC_6100) // no overlay for PowerPC - { - m_overlay = -1; // insure no match - this->set_memory_overlay(1); - } + m_overlay = -1; // insure no match + this->set_memory_overlay(1); if (m_overlay_timeout != (emu_timer *)nullptr) { @@ -1159,7 +1100,7 @@ void mac_state::machine_reset() /* setup videoram */ this->m_screen_buffer = 1; - if (MAC_HAS_VIA2) // prime CB1 for ASC and slot interrupts + if (m_model != MODEL_MAC_IIFX) // prime CB1 for ASC and slot interrupts { m_via2_ca1_hack = 1; m_via2->write_ca1(1); @@ -1176,7 +1117,7 @@ void mac_state::machine_reset() WRITE_LINE_MEMBER(mac_state::cuda_reset_w) { - if ((state == ASSERT_LINE) && (m_model < MODEL_MAC_POWERMAC_6100)) + if (state == ASSERT_LINE) { set_memory_overlay(0); set_memory_overlay(1); @@ -1190,11 +1131,8 @@ void mac_state::mac_state_load() { int overlay; overlay = m_overlay; - if (m_model < MODEL_MAC_POWERMAC_6100) // no overlay for PowerPC - { - m_overlay = -1; - set_memory_overlay(overlay); - } + m_overlay = -1; + set_memory_overlay(overlay); } @@ -1273,25 +1211,12 @@ void mac_state::mac_driver_init(model_t model) m_rom_size = memregion("bootrom")->bytes(); m_rom_ptr = reinterpret_cast<uint32_t *>(memregion("bootrom")->base()); - if (model < MODEL_MAC_PORTABLE) - { - /* set up RAM mirror at 0x600000-0x6fffff (0x7fffff ???) */ - mac_install_memory(0x600000, 0x6fffff, m_ram->size(), m_ram->pointer(), false); - - /* set up ROM at 0x400000-0x4fffff (-0x5fffff for mac 128k/512k/512ke) */ - mac_install_memory(0x400000, (model >= MODEL_MAC_PLUS) ? 0x4fffff : 0x5fffff, - m_rom_size, m_rom_ptr, true); - } - m_overlay = -1; - if (m_model < MODEL_MAC_POWERMAC_6100) // no overlay for PowerPC - { - set_memory_overlay(1); - } + set_memory_overlay(1); memset(m_ram->pointer(), 0, m_ram->size()); - if ((model == MODEL_MAC_SE) || (model == MODEL_MAC_CLASSIC) || (model == MODEL_MAC_CLASSIC_II) || (model == MODEL_MAC_LC) || (model == MODEL_MAC_COLOR_CLASSIC) || (model >= MODEL_MAC_LC_475 && model <= MODEL_MAC_LC_580) || + if ((model == MODEL_MAC_CLASSIC_II) || (model == MODEL_MAC_LC) || (model == MODEL_MAC_COLOR_CLASSIC) || (model >= MODEL_MAC_LC_475 && model <= MODEL_MAC_LC_580) || (model == MODEL_MAC_LC_II) || (model == MODEL_MAC_LC_III) || (model == MODEL_MAC_LC_III_PLUS) || ((m_model >= MODEL_MAC_II) && (m_model <= MODEL_MAC_SE30))) { m_overlay_timeout = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mac_state::overlay_timeout_func),this)); @@ -1311,8 +1236,6 @@ void mac_state::init_##label() \ mac_driver_init(model); \ } -MAC_DRIVER_INIT(macse, MODEL_MAC_SE) -MAC_DRIVER_INIT(macclassic, MODEL_MAC_CLASSIC) MAC_DRIVER_INIT(maclc, MODEL_MAC_LC) MAC_DRIVER_INIT(maclc2, MODEL_MAC_LC_II) MAC_DRIVER_INIT(maclc3, MODEL_MAC_LC_III) @@ -1323,9 +1246,6 @@ MAC_DRIVER_INIT(macii, MODEL_MAC_II) MAC_DRIVER_INIT(macse30, MODEL_MAC_SE30) MAC_DRIVER_INIT(macclassic2, MODEL_MAC_CLASSIC_II) MAC_DRIVER_INIT(maclrcclassic, MODEL_MAC_COLOR_CLASSIC) -MAC_DRIVER_INIT(macpm6100, MODEL_MAC_POWERMAC_6100) -MAC_DRIVER_INIT(macpm7100, MODEL_MAC_POWERMAC_7100) -MAC_DRIVER_INIT(macpm8100, MODEL_MAC_POWERMAC_8100) MAC_DRIVER_INIT(maciivx, MODEL_MAC_IIVX) MAC_DRIVER_INIT(maciivi, MODEL_MAC_IIVI) MAC_DRIVER_INIT(maciifx, MODEL_MAC_IIFX) @@ -1380,18 +1300,11 @@ void mac_state::nubus_slot_interrupt(uint8_t slot, uint32_t state) void mac_state::vblank_irq() { /* handle ADB keyboard/mouse */ - if (has_adb() && m_macadb) + if (m_macadb) { m_macadb->adb_vblank(); } - /* signal VBlank on CA1 input on the VIA */ - if ((m_model < MODEL_MAC_II) || (m_model == MODEL_MAC_PB140) || (m_model == MODEL_MAC_PB160) || (m_model == MODEL_MAC_QUADRA_700)) - { - ca1_data ^= 1; - m_via1->write_ca1(ca1_data); - } - if (++irq_count == 60) { irq_count = 0; diff --git a/src/mame/video/mac.cpp b/src/mame/video/mac.cpp index 2b49dbfd3b2..552d2334bd8 100644 --- a/src/mame/video/mac.cpp +++ b/src/mame/video/mac.cpp @@ -63,30 +63,6 @@ VIDEO_START_MEMBER(mac_state,mac) { } -#define MAC_MAIN_SCREEN_BUF_OFFSET 0x5900 -#define MAC_ALT_SCREEN_BUF_OFFSET 0xD900 - -uint32_t mac_state::screen_update_mac(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - uint32_t const video_base = m_ram->size() - (m_screen_buffer ? MAC_MAIN_SCREEN_BUF_OFFSET : MAC_ALT_SCREEN_BUF_OFFSET); - uint16_t const *video_ram = (const uint16_t *) (m_ram->pointer() + video_base); - - for (int y = 0; y < MAC_V_VIS; y++) - { - uint16_t *const line = &bitmap.pix(y); - - for (int x = 0; x < MAC_H_VIS; x += 16) - { - uint16_t const word = *(video_ram++); - for (int b = 0; b < 16; b++) - { - line[x + b] = (word >> (15 - b)) & 0x0001; - } - } - } - return 0; -} - uint32_t mac_state::screen_update_macse30(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { uint32_t const video_base = (m_screen_buffer ? 0x8000 : 0) + (MAC_H_VIS/8); @@ -367,35 +343,6 @@ uint32_t mac_state::screen_update_macrbv(screen_device &screen, bitmap_rgb32 &bi return 0; } -uint32_t mac_state::screen_update_pwrmac(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - uint8_t const *const vram8 = (uint8_t *)m_vram64.target(); - int hres, vres; - - hres = 640; - vres = 480; - - for (int y = 0; y < vres; y++) - { - uint32_t *scanline = &bitmap.pix(y); - for (int x = 0; x < hres; x += 8) - { - uint8_t const pixels = vram8[(y * (hres / 8)) + ((x / 8) ^ 3)]; - - *scanline++ = m_rbv_palette[0x7f | (pixels & 0x80)]; - *scanline++ = m_rbv_palette[0x7f | ((pixels << 1) & 0x80)]; - *scanline++ = m_rbv_palette[0x7f | ((pixels << 2) & 0x80)]; - *scanline++ = m_rbv_palette[0x7f | ((pixels << 3) & 0x80)]; - *scanline++ = m_rbv_palette[0x7f | ((pixels << 4) & 0x80)]; - *scanline++ = m_rbv_palette[0x7f | ((pixels << 5) & 0x80)]; - *scanline++ = m_rbv_palette[0x7f | ((pixels << 6) & 0x80)]; - *scanline++ = m_rbv_palette[0x7f | ((pixels << 7) & 0x80)]; - } - } - - return 0; -} - uint32_t mac_state::screen_update_macrbvvram(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int hres, vres; |