summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/apple/macpwrbk030.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/apple/macpwrbk030.cpp')
-rw-r--r--src/mame/apple/macpwrbk030.cpp91
1 files changed, 15 insertions, 76 deletions
diff --git a/src/mame/apple/macpwrbk030.cpp b/src/mame/apple/macpwrbk030.cpp
index c74b3f0549c..13d7556c950 100644
--- a/src/mame/apple/macpwrbk030.cpp
+++ b/src/mame/apple/macpwrbk030.cpp
@@ -121,6 +121,7 @@
#include "machine/nscsi_bus.h"
#include "bus/nscsi/devices.h"
#include "sound/asc.h"
+#include "video/wd90c26.h"
#include "emupal.h"
#include "screen.h"
@@ -156,7 +157,8 @@ public:
m_palette(*this, "palette"),
m_asc(*this, "asc"),
m_scc(*this, "scc"),
- m_vram(*this, "vram")
+ m_vram(*this, "vram"),
+ m_vga(*this, "vga")
{
}
@@ -191,14 +193,14 @@ private:
required_device<palette_device> m_palette;
required_device<asc_device> m_asc;
required_device<z80scc_device> m_scc;
- required_shared_ptr<u32> m_vram;
+ optional_shared_ptr<u32> m_vram;
+ optional_device<wd90c26_vga_device> m_vga;
virtual void machine_start() override;
virtual void machine_reset() override;
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 screen_update_macpbwd(screen_device &screen, bitmap_rgb32 &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;
@@ -280,11 +282,6 @@ private:
void mac_gsc_w(uint8_t data);
void macgsc_palette(palette_device &palette) const;
- uint8_t macwd_r(offs_t offset);
- void macwd_w(offs_t offset, uint8_t data);
-
- u32 m_colors[3]{}, m_count = 0, m_clutoffs = 0, m_wd_palette[256]{};
-
u8 m_pmu_via_bus = 0, m_pmu_ack = 0, m_pmu_req = 0;
u8 pmu_data_r() { return m_pmu_via_bus; }
void pmu_data_w(u8 data)
@@ -494,23 +491,6 @@ u32 macpb030_state::screen_update_macpb160(screen_device &screen, bitmap_ind16 &
return 0;
}
-u32 macpb030_state::screen_update_macpbwd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) /* Color PowerBooks using an off-the-shelf WD video chipset */
-{
- u8 const *vram8 = (uint8_t *)m_vram.target();
-
- for (int y = 0; y < 480; y++)
- {
- u32 *line = &bitmap.pix(y);
- for (int x = 0; x < 640; x++)
- {
- u8 const pixels = vram8[(y * 640) + (BYTE4_XOR_BE(x))];
- *line++ = m_wd_palette[pixels];
- }
- }
-
- return 0;
-}
-
u16 macpb030_state::mac_via_r(offs_t offset)
{
u16 data;
@@ -695,52 +675,6 @@ void macpb030_state::mac_gsc_w(uint8_t data)
{
}
-uint8_t macpb030_state::macwd_r(offs_t offset)
-{
- switch (offset)
- {
- case 0x3da: // VGA "Input Status 1"
- if (m_screen->vblank())
- {
- return 0x8;
- }
- else
- {
- return 0;
- }
-
- default:
- // printf("macwd_r: @ %x, mask %08x (PC=%x)\n", offset, mem_mask, m_maincpu->pc());
- break;
- }
- return 0;
-}
-
-void macpb030_state::macwd_w(offs_t offset, uint8_t data)
-{
- switch (offset)
- {
- case 0x3c8: // VGA palette address
- m_clutoffs = data;
- m_count = 0;
- break;
-
- case 0x3c9: // VGA palette data
- m_colors[m_count++] = (data & 0x3f) << 2;
- if (m_count == 3)
- {
- m_wd_palette[m_clutoffs] = rgb_t(m_colors[0], m_colors[1], m_colors[2]);
- m_clutoffs++;
- m_count = 0;
- }
- break;
-
- default:
- //printf("macwd_w: %x @ %x (PC=%x)\n", data, offset, m_maincpu->pc());
- break;
- }
-}
-
/***************************************************************************
ADDRESS MAPS
****************************************************************************/
@@ -797,8 +731,9 @@ void macpb030_state::macpb165c_map(address_map &map)
map(0x50f24000, 0x50f27fff).r(FUNC(macpb030_state::buserror_r)); // bus error here to make sure we aren't mistaken for another decoder
// on-board color video on 165c/180c
- map(0xfc000000, 0xfc07ffff).ram().share("vram").mirror(0x00380000); // 512k of VRAM
- map(0xfc400000, 0xfc7fffff).rw(FUNC(macpb030_state::macwd_r), FUNC(macpb030_state::macwd_w));
+ 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(0xfc4003b0, 0xfc4003df).m(m_vga, FUNC(wd90c26_vga_device::io_map));
// something else video related? is at fc800000
map(0xfcff8000, 0xfcffffff).rom().region("vrom", 0x0000);
}
@@ -1103,10 +1038,14 @@ void macpb030_state::macpb180c(machine_config &config)
m_maincpu->set_clock(33000000);
m_maincpu->set_addrmap(AS_PROGRAM, &macpb030_state::macpb165c_map);
- m_screen->set_size(800, 525);
- m_screen->set_visarea(0, 640 - 1, 0, 480 - 1);
- m_screen->set_screen_update(FUNC(macpb030_state::screen_update_macpbwd));
+ m_screen->set_raw(25.175_MHz_XTAL, 800, 0, 640, 524, 0, 480);
+ m_screen->set_screen_update("vga", FUNC(wd90c26_vga_device::screen_update));
m_screen->set_no_palette();
+
+ WD90C26(config, m_vga, 0);
+ m_vga->set_screen(m_screen);
+ // 512KB
+ m_vga->set_vram_size(0x80000);
}
void macpb030_state::macpd210(machine_config &config)