From 59a41ff1d793b64277f00021f51499060aa2c986 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Wed, 16 Mar 2016 22:05:14 +0100 Subject: svi318: rewrite banking, add expander bus, add svi601 super expander and slot modules for the sv801 disk controller, sv803 16k memory epansion and the sv807 64k memory expansion --- scripts/src/bus.lua | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'scripts/src') diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 1379c572fa8..d6bc6cfedda 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -2587,3 +2587,39 @@ if (BUSES["NEWBRAIN"]~=null) then MAME_DIR .. "src/devices/bus/newbrain/fdc.h", } end + +--------------------------------------------------- +-- +--@src/devices/bus/svi3x8/expander/expander.h,BUSES["SVI_EXPANDER"] = true +--------------------------------------------------- + +if (BUSES["SVI_EXPANDER"]~=null) then + files { + MAME_DIR .. "src/devices/bus/svi3x8/expander/expander.cpp", + MAME_DIR .. "src/devices/bus/svi3x8/expander/expander.h", + MAME_DIR .. "src/devices/bus/svi3x8/expander/modules.cpp", + MAME_DIR .. "src/devices/bus/svi3x8/expander/modules.h", + MAME_DIR .. "src/devices/bus/svi3x8/expander/sv601.cpp", + MAME_DIR .. "src/devices/bus/svi3x8/expander/sv601.h", + } +end + +--------------------------------------------------- +-- +--@src/devices/bus/svi3x8/slot/slot.h,BUSES["SVI_SLOT"] = true +--------------------------------------------------- + +if (BUSES["SVI_SLOT"]~=null) then + files { + MAME_DIR .. "src/devices/bus/svi3x8/slot/slot.cpp", + MAME_DIR .. "src/devices/bus/svi3x8/slot/slot.h", + MAME_DIR .. "src/devices/bus/svi3x8/slot/cards.cpp", + MAME_DIR .. "src/devices/bus/svi3x8/slot/cards.h", + MAME_DIR .. "src/devices/bus/svi3x8/slot/sv801.cpp", + MAME_DIR .. "src/devices/bus/svi3x8/slot/sv801.h", + MAME_DIR .. "src/devices/bus/svi3x8/slot/sv803.cpp", + MAME_DIR .. "src/devices/bus/svi3x8/slot/sv803.h", + MAME_DIR .. "src/devices/bus/svi3x8/slot/sv807.cpp", + MAME_DIR .. "src/devices/bus/svi3x8/slot/sv807.h", + } +end -- cgit v1.2.3-70-g09d2 From d0ce8784a7005e3c4912847f4ffbe2c41404a28f Mon Sep 17 00:00:00 2001 From: Justin Kerk Date: Thu, 17 Mar 2016 01:42:48 +0000 Subject: Build more of font_sdl.cpp with Emscripten since there is an SDL2_ttf port now (nw) --- scripts/genie.lua | 1 + scripts/src/main.lua | 1 + src/osd/modules/font/font_sdl.cpp | 22 ++++++++++++++-------- 3 files changed, 16 insertions(+), 8 deletions(-) (limited to 'scripts/src') diff --git a/scripts/genie.lua b/scripts/genie.lua index e991bb5ed38..0a7c79d5825 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -1059,6 +1059,7 @@ configuration { "asmjs" } buildoptions { "-std=gnu89", "-Wno-implicit-function-declaration", + "-s USE_SDL_TTF=2", } buildoptions_cpp { "-x c++", diff --git a/scripts/src/main.lua b/scripts/src/main.lua index c9c99a354c3..18a5b28210f 100644 --- a/scripts/src/main.lua +++ b/scripts/src/main.lua @@ -109,6 +109,7 @@ end local emccopts = "" emccopts = emccopts .. " -O3" emccopts = emccopts .. " -s USE_SDL=2" + emccopts = emccopts .. " -s USE_SDL_TTF=2" emccopts = emccopts .. " --memory-init-file 0" emccopts = emccopts .. " -s ALLOW_MEMORY_GROWTH=0" emccopts = emccopts .. " -s TOTAL_MEMORY=268435456" diff --git a/src/osd/modules/font/font_sdl.cpp b/src/osd/modules/font/font_sdl.cpp index 3c8a69d5d63..cdcfc1bcedb 100644 --- a/src/osd/modules/font/font_sdl.cpp +++ b/src/osd/modules/font/font_sdl.cpp @@ -8,15 +8,19 @@ #include "font_module.h" #include "modules/osdmodule.h" -#if defined(SDLMAME_UNIX) && !defined(SDLMAME_MACOSX) && !defined(SDLMAME_SOLARIS) && !defined(SDLMAME_HAIKU) && !defined(SDLMAME_EMSCRIPTEN) +#if defined(SDLMAME_UNIX) && !defined(SDLMAME_MACOSX) && !defined(SDLMAME_SOLARIS) && !defined(SDLMAME_HAIKU) #include "corestr.h" #include "corealloc.h" #include "fileio.h" #include "unicode.h" +#ifdef SDLMAME_EMSCRIPTEN +#include +#else #include -#ifndef SDLMAME_HAIKU +#endif +#if !defined(SDLMAME_HAIKU) && !defined(SDLMAME_EMSCRIPTEN) #include #endif @@ -52,7 +56,7 @@ private: static constexpr double POINT_SIZE = 144.0; -#ifndef SDLMAME_HAIKU +#if !defined(SDLMAME_HAIKU) && !defined(SDLMAME_EMSCRIPTEN) TTF_Font_ptr search_font_config(std::string const &name, bool bold, bool italic, bool underline, bool &bakedstyles); #endif bool BDF_Check_Magic(std::string const &name); @@ -97,7 +101,7 @@ bool osd_font_sdl::open(std::string const &font_path, std::string const &_name, } // if that didn't work, crank up the FontConfig database -#ifndef SDLMAME_HAIKU +#if !defined(SDLMAME_HAIKU) && !defined(SDLMAME_EMSCRIPTEN) if (!font) { font = search_font_config(name, bold, italic, underline, bakedstyles); @@ -214,7 +218,7 @@ bool osd_font_sdl::BDF_Check_Magic(std::string const &name) return false; } -#ifndef SDLMAME_HAIKU +#if !defined(SDLMAME_HAIKU) && !defined(SDLMAME_EMSCRIPTEN) osd_font_sdl::TTF_Font_ptr osd_font_sdl::search_font_config(std::string const &name, bool bold, bool italic, bool underline, bool &bakedstyles) { TTF_Font_ptr font(nullptr, &TTF_CloseFont); @@ -296,12 +300,12 @@ public: { } - osd_font::ptr font_alloc() + osd_font::ptr font_alloc() override { return std::make_unique(); } - virtual int init(const osd_options &options) + virtual int init(const osd_options &options) override { if (TTF_Init() == -1) { @@ -311,7 +315,7 @@ public: return 0; } - virtual void exit() + virtual void exit() override { TTF_Quit(); } @@ -326,6 +330,7 @@ bool font_sdl::get_font_families(std::string const &font_path, std::vector pat(FcPatternCreate(), &FcPatternDestroy); FcPatternAddString(pat.get(), FC_FONTFORMAT, (const FcChar8 *)"TrueType"); @@ -355,6 +360,7 @@ bool font_sdl::get_font_families(std::string const &font_path, std::vectorfirst != font.first)) result.emplace(pos, std::move(font)); } } +#endif return true; } -- cgit v1.2.3-70-g09d2 From 776bfad1c1f4e9a4dd5e799f9ca5e9145ca644a0 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Thu, 17 Mar 2016 03:03:36 +0100 Subject: svi318: add support for the 80 column card (sv806) --- scripts/src/bus.lua | 2 + src/devices/bus/svi3x8/slot/cards.cpp | 1 + src/devices/bus/svi3x8/slot/cards.h | 1 + src/devices/bus/svi3x8/slot/sv806.cpp | 150 ++++++++++++++++++++++++++++++++++ src/devices/bus/svi3x8/slot/sv806.h | 55 +++++++++++++ 5 files changed, 209 insertions(+) create mode 100644 src/devices/bus/svi3x8/slot/sv806.cpp create mode 100644 src/devices/bus/svi3x8/slot/sv806.h (limited to 'scripts/src') diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index d6bc6cfedda..e4451462806 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -2619,6 +2619,8 @@ if (BUSES["SVI_SLOT"]~=null) then MAME_DIR .. "src/devices/bus/svi3x8/slot/sv801.h", MAME_DIR .. "src/devices/bus/svi3x8/slot/sv803.cpp", MAME_DIR .. "src/devices/bus/svi3x8/slot/sv803.h", + MAME_DIR .. "src/devices/bus/svi3x8/slot/sv806.cpp", + MAME_DIR .. "src/devices/bus/svi3x8/slot/sv806.h", MAME_DIR .. "src/devices/bus/svi3x8/slot/sv807.cpp", MAME_DIR .. "src/devices/bus/svi3x8/slot/sv807.h", } 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; + +//------------------------------------------------- +// 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(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 m_crtc; + required_device m_palette; + required_memory_region m_gfx; + + std::unique_ptr m_ram; + int m_ram_enabled; +}; + +// device type definition +extern const device_type SV806; + +#endif // __SVI3X8_SLOT_SV806_H__ -- cgit v1.2.3-70-g09d2