summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus
diff options
context:
space:
mode:
author Dirk Best <mail@dirk-best.de>2016-03-17 03:03:36 +0100
committer Dirk Best <mail@dirk-best.de>2016-03-17 03:06:00 +0100
commit776bfad1c1f4e9a4dd5e799f9ca5e9145ca644a0 (patch)
treed102f88d373bcff4c549ece929e0d2a4c2134aa7 /src/devices/bus
parent4cc9dd016a15cb562070c8be42036e0368a1f87c (diff)
svi318: add support for the 80 column card (sv806)
Diffstat (limited to 'src/devices/bus')
-rw-r--r--src/devices/bus/svi3x8/slot/cards.cpp1
-rw-r--r--src/devices/bus/svi3x8/slot/cards.h1
-rw-r--r--src/devices/bus/svi3x8/slot/sv806.cpp150
-rw-r--r--src/devices/bus/svi3x8/slot/sv806.h55
4 files changed, 207 insertions, 0 deletions
diff --git a/src/devices/bus/svi3x8/slot/cards.cpp b/src/devices/bus/svi3x8/slot/cards.cpp
index e86317dedb4..8e60b1ae1d8 100644
--- a/src/devices/bus/svi3x8/slot/cards.cpp
+++ b/src/devices/bus/svi3x8/slot/cards.cpp
@@ -11,5 +11,6 @@
SLOT_INTERFACE_START( svi_slot_cards )
SLOT_INTERFACE("sv801", SV801)
SLOT_INTERFACE("sv803", SV803)
+ SLOT_INTERFACE("sv806", SV806)
SLOT_INTERFACE("sv807", SV807)
SLOT_INTERFACE_END
diff --git a/src/devices/bus/svi3x8/slot/cards.h b/src/devices/bus/svi3x8/slot/cards.h
index 22d601a22fa..03492742e53 100644
--- a/src/devices/bus/svi3x8/slot/cards.h
+++ b/src/devices/bus/svi3x8/slot/cards.h
@@ -14,6 +14,7 @@
#include "emu.h"
#include "sv801.h"
#include "sv803.h"
+#include "sv806.h"
#include "sv807.h"
SLOT_INTERFACE_EXTERN( svi_slot_cards );
diff --git a/src/devices/bus/svi3x8/slot/sv806.cpp b/src/devices/bus/svi3x8/slot/sv806.cpp
new file mode 100644
index 00000000000..3db7d8ee2a7
--- /dev/null
+++ b/src/devices/bus/svi3x8/slot/sv806.cpp
@@ -0,0 +1,150 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ SV-806 80 Column Cartridge for SVI-318/328
+
+***************************************************************************/
+
+#include "sv806.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+const device_type SV806 = &device_creator<sv806_device>;
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+ROM_START( sv806 )
+ ROM_REGION(0x1000, "gfx", 0)
+ ROM_SYSTEM_BIOS(0, "en", "English Character Set")
+ ROMX_LOAD("sv806.ic27", 0x0000, 0x1000, CRC(850bc232) SHA1(ed45cb0e9bd18a9d7bd74f87e620f016a7ae840f), ROM_BIOS(1))
+ ROM_SYSTEM_BIOS(1, "se", "Swedish Character Set")
+ ROMX_LOAD("sv806se.ic27", 0x0000, 0x1000, CRC(daea8956) SHA1(3f16d5513ad35692488ae7d864f660e76c6e8ed3), ROM_BIOS(2))
+ROM_END
+
+const rom_entry *sv806_device::device_rom_region() const
+{
+ return ROM_NAME( sv806 );
+}
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+static MACHINE_CONFIG_FRAGMENT( sv806 )
+ MCFG_SCREEN_ADD_MONOCHROME("80col", RASTER, rgb_t::green)
+ MCFG_SCREEN_RAW_PARAMS((XTAL_12MHz / 6) * 8, 864, 0, 640, 317, 0, 192)
+ MCFG_SCREEN_UPDATE_DEVICE("crtc", hd6845_device, screen_update)
+
+ MCFG_PALETTE_ADD_MONOCHROME("palette")
+
+ MCFG_MC6845_ADD("crtc", HD6845, "80col", XTAL_12MHz / 6)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(sv806_device, crtc_update_row)
+MACHINE_CONFIG_END
+
+machine_config_constructor sv806_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( sv806 );
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// sv806_device - constructor
+//-------------------------------------------------
+
+sv806_device::sv806_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, SV806, "SV-806 80 Column Cartridge", tag, owner, clock, "sv806", __FILE__),
+ device_svi_slot_interface(mconfig, *this),
+ m_crtc(*this, "crtc"),
+ m_palette(*this, "palette"),
+ m_gfx(*this, "gfx"),
+ m_ram_enabled(0)
+{
+ m_ram = std::make_unique<UINT8[]>(0x800);
+ memset(m_ram.get(), 0xff, 0x800);
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void sv806_device::device_start()
+{
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+MC6845_UPDATE_ROW( sv806_device::crtc_update_row )
+{
+ const pen_t *pen = m_palette->pens();
+
+ for (int i = 0; i < x_count; i++)
+ {
+ UINT8 data = m_gfx->u8((m_ram[(ma + i) & 0x7ff] << 4) | ra);
+
+ if (i == cursor_x)
+ data = 0xff;
+
+ bitmap.pix32(y, i * 8 + 0) = pen[BIT(data, 7)];
+ bitmap.pix32(y, i * 8 + 1) = pen[BIT(data, 6)];
+ bitmap.pix32(y, i * 8 + 2) = pen[BIT(data, 5)];
+ bitmap.pix32(y, i * 8 + 3) = pen[BIT(data, 4)];
+ bitmap.pix32(y, i * 8 + 4) = pen[BIT(data, 3)];
+ bitmap.pix32(y, i * 8 + 5) = pen[BIT(data, 2)];
+ bitmap.pix32(y, i * 8 + 6) = pen[BIT(data, 1)];
+ bitmap.pix32(y, i * 8 + 7) = pen[BIT(data, 0)];
+ }
+}
+
+READ8_MEMBER( sv806_device::mreq_r )
+{
+ if (offset >= 0xf000 && m_ram_enabled)
+ {
+ m_bus->ramdis_w(0);
+ return m_ram[offset & 0x7ff];
+ }
+
+ return 0xff;
+}
+
+WRITE8_MEMBER( sv806_device::mreq_w )
+{
+ if (offset >= 0xf000 && m_ram_enabled)
+ {
+ m_bus->ramdis_w(0);
+ m_ram[offset & 0x7ff] = data;
+ }
+}
+
+READ8_MEMBER( sv806_device::iorq_r )
+{
+ if (offset == 0x51)
+ return m_crtc->register_r(space, 0);
+
+ return 0xff;
+}
+
+WRITE8_MEMBER( sv806_device::iorq_w )
+{
+ switch (offset)
+ {
+ case 0x50: m_crtc->address_w(space, 0, data); break;
+ case 0x51: m_crtc->register_w(space, 0, data); break;
+ case 0x58: m_ram_enabled = data; break;
+ }
+}
diff --git a/src/devices/bus/svi3x8/slot/sv806.h b/src/devices/bus/svi3x8/slot/sv806.h
new file mode 100644
index 00000000000..4782faa4812
--- /dev/null
+++ b/src/devices/bus/svi3x8/slot/sv806.h
@@ -0,0 +1,55 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ SV-806 80 column card for SVI-318/328
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __SVI3X8_SLOT_SV806_H__
+#define __SVI3X8_SLOT_SV806_H__
+
+#include "emu.h"
+#include "slot.h"
+#include "video/mc6845.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> sv806_device
+
+class sv806_device : public device_t, public device_svi_slot_interface
+{
+public:
+ // construction/destruction
+ sv806_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ virtual DECLARE_READ8_MEMBER( mreq_r ) override;
+ virtual DECLARE_WRITE8_MEMBER( mreq_w ) override;
+ virtual DECLARE_READ8_MEMBER( iorq_r ) override;
+ virtual DECLARE_WRITE8_MEMBER( iorq_w ) override;
+
+ MC6845_UPDATE_ROW(crtc_update_row);
+
+protected:
+ virtual const rom_entry *device_rom_region() const override;
+ virtual machine_config_constructor device_mconfig_additions() const override;
+ virtual void device_start() override;
+
+private:
+ required_device<hd6845_device> m_crtc;
+ required_device<palette_device> m_palette;
+ required_memory_region m_gfx;
+
+ std::unique_ptr<UINT8[]> m_ram;
+ int m_ram_enabled;
+};
+
+// device type definition
+extern const device_type SV806;
+
+#endif // __SVI3X8_SLOT_SV806_H__