diff options
Diffstat (limited to 'src/devices/bus/nubus/laserview.cpp')
| -rw-r--r-- | src/devices/bus/nubus/laserview.cpp | 124 |
1 files changed, 89 insertions, 35 deletions
diff --git a/src/devices/bus/nubus/laserview.cpp b/src/devices/bus/nubus/laserview.cpp index 4ced40e7935..d8c35c00441 100644 --- a/src/devices/bus/nubus/laserview.cpp +++ b/src/devices/bus/nubus/laserview.cpp @@ -2,31 +2,36 @@ // copyright-holders:R. Belmont /*************************************************************************** - Sigma Designs fixed-resolution monochrome video card - 1664x1200 or 832x600 according to the ad, but more modes exist - in the dumped v3.0 declaration ROM. + Sigma Designs fixed-resolution monochrome NuBus video card + Sigma Designs L-View SE/30 PDS video card - VRAM at Fs000000, mirrored at Fs900000. - Fs0BFFEC: write 0x04 to enable VBL, 0x01 to ack VBL + 1664x1200 or 832x600 according to the ad, but more modes exist + in the dumped declaration ROMs. - Card has one ASIC, a Sigma Designs 53C280A. This is shared with the PC ISA - "LaserView Plus" card. + Card has one ASIC, a Sigma Designs 53C280A. This is shared with the PC ISA + "LaserView Plus" card. - Crystals: - 160.00 MHz - 122.925 MHz - 99.108 MHz - 16.0 MHz + VRAM at Fs000000, mirrored at Fss00000. + Fs0BFFEC: write 0x04 to enable VBL, 0x01 to ack VBL - Modes in the declaration ROM shown by SlotsParse are: - 832x600 - 1664x1200 - 640x480 - 1280x960 - 512x384 - 1024x768 + Crystals: + 160.00 MHz + 122.925 MHz + 99.108 MHz + 16.0 MHz - TODO: Figure out how to set the other modes. A software driver, possibly? + Modes in the declaration ROM shown by SlotsParse are: + 832x600 + 1664x1200 + 640x480 + 1280x960 + 512x384 + 1024x768 + + The code in the declaration ROM has most of the code/data to just let + System 7+ select other modes in the Monitors control panel, but it was + disabled in the key code path, likely to force the use of a software + driver that may now be unobtainium. ***************************************************************************/ @@ -50,6 +55,8 @@ namespace { nubus_laserview_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: + nubus_laserview_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, bool invert_id); + // device-level overrides virtual void device_start() override ATTR_COLD; virtual void device_reset() override ATTR_COLD; @@ -58,7 +65,7 @@ namespace { virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD; - private: +private: u8 regs_r(offs_t offset); void regs_w(offs_t offset, u8 data); @@ -71,7 +78,8 @@ namespace { std::unique_ptr<u32[]> m_vram; u16 m_htotal, m_hvis, m_vtotal, m_vvis, m_stride; u32 m_vbl_disable; - u8 m_prot_latch; + u8 m_id, m_mode; + bool m_invert_id; }; ROM_START( laserview ) @@ -100,11 +108,19 @@ const tiny_rom_entry *nubus_laserview_device::device_rom_region() const } nubus_laserview_device::nubus_laserview_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - device_t(mconfig, NUBUS_LASERVIEW, tag, owner, clock), + nubus_laserview_device(mconfig, NUBUS_LASERVIEW, tag, owner, clock, true) +{ +} + + +nubus_laserview_device::nubus_laserview_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, bool invert_id) : + device_t(mconfig, type, tag, owner, clock), device_nubus_card_interface(mconfig, *this), m_screen(*this, "screen"), m_htotal(0), m_hvis(0), m_vtotal(0), m_vvis(0), - m_vbl_disable(1), m_prot_latch(0) + m_vbl_disable(1), + m_id(0), m_mode(0), + m_invert_id(invert_id) { } @@ -116,7 +132,10 @@ void nubus_laserview_device::device_start() m_vram = std::make_unique<u32[]>(VRAM_SIZE / sizeof(u32)); install_bank(slotspace, slotspace + VRAM_SIZE - 1, &m_vram[0]); - install_bank(slotspace+0x900000, slotspace+0x900000+VRAM_SIZE-1, &m_vram[0]); + u32 mirror = slotno() << 20; + printf("slotno %x\n", slotno()); + printf("%s: Installing VRAM at %08x-%08x (mirror %08x)\n", machine().describe_context().c_str(), slotspace, slotspace + VRAM_SIZE - 1, slotspace + mirror); + install_bank(slotspace+mirror, slotspace+mirror+VRAM_SIZE-1, &m_vram[0]); nubus().install_device(slotspace+0xB0000, slotspace+0xBFFFF, emu::rw_delegate(*this, FUNC(nubus_laserview_device::regs_r)), emu::rw_delegate(*this, FUNC(nubus_laserview_device::regs_w))); @@ -125,7 +144,8 @@ void nubus_laserview_device::device_start() save_item(NAME(m_vtotal)); save_item(NAME(m_vvis)); save_item(NAME(m_vbl_disable)); - save_item(NAME(m_prot_latch)); + save_item(NAME(m_id)); + save_item(NAME(m_mode)); save_pointer(NAME(m_vram), VRAM_SIZE / sizeof(u32)); } @@ -138,7 +158,7 @@ void nubus_laserview_device::device_reset() u32 nubus_laserview_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { auto const vram8 = util::big_endian_cast<u8 const>(&m_vram[0]); - for (int y = 0; y < m_vvis; y++) + for (int y = 0; y < m_vvis / 2; y++) { u16 *scanline = &bitmap.pix(y); for (int x = 0; x < m_hvis/8; x++) @@ -170,8 +190,24 @@ void nubus_laserview_device::regs_w(offs_t offset, u8 data) { switch (offset) { + case 0x20f9: + m_id = m_invert_id ? 0x00 : 0x1a; + break; + case 0x00f9: - m_prot_latch = data ^ 0xff; + m_id = m_invert_id ? 0x1a : 0x00; + break; + + case 0xfffc: + m_mode = (data & 0xc0); + if (m_invert_id) + { + m_mode &= ~0x01; + } + else + { + m_mode |= 0x01; + } break; case 0x08ff: @@ -182,10 +218,6 @@ void nubus_laserview_device::regs_w(offs_t offset, u8 data) } break; - case 0x20f9: - m_prot_latch = data; - break; - case 0xffef: if ((data & 0xff) == 0x04) { @@ -258,16 +290,38 @@ u8 nubus_laserview_device::regs_r(offs_t offset) return m_screen->vblank(); case 0xff08: - return m_prot_latch; + return m_id; - // monitor sense? DIP switches? case 0xfffc: - return 0xe4; + return m_mode; } return 0xff; } +class nubus_lview_device : public nubus_laserview_device +{ +public: + nubus_lview_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + nubus_laserview_device(mconfig, PDS030_LVIEW, tag, owner, clock, false) + { + } + +protected: + virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD; +}; + +ROM_START( lview ) + ROM_REGION(0x4000, "declrom", 0) + ROM_LOAD( "lv_asi_4_00.bin", 0x000000, 0x004000, CRC(b806f875) SHA1(1e58593b1a8720193d1651b0d8a0d43e4e47563d) ) +ROM_END + +const tiny_rom_entry *nubus_lview_device::device_rom_region() const +{ + return ROM_NAME(lview); +} + } // anonymous namespace DEFINE_DEVICE_TYPE_PRIVATE(NUBUS_LASERVIEW, device_nubus_card_interface, nubus_laserview_device, "nb_laserview", "Sigma Designs LaserView video card") +DEFINE_DEVICE_TYPE_PRIVATE(PDS030_LVIEW, device_nubus_card_interface, nubus_lview_device, "pd3_lviw", "Sigma Designs L-View") |
