This commit is contained in:
Brad Hughes 2016-03-17 09:22:16 -04:00
commit 26ccf5e75f
43 changed files with 2255 additions and 441 deletions

View File

@ -118,7 +118,7 @@ ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = YES
# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
1# inherited members of a class in the documentation of that class as if those
# inherited members of a class in the documentation of that class as if those
# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
# The default value is: NO.

File diff suppressed because it is too large Load Diff

View File

@ -1059,6 +1059,7 @@ configuration { "asmjs" }
buildoptions {
"-std=gnu89",
"-Wno-implicit-function-declaration",
"-s USE_SDL_TTF=2",
}
buildoptions_cpp {
"-x c++",

View File

@ -2587,3 +2587,41 @@ 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/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",
}
end

View File

@ -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"

View File

@ -652,6 +652,8 @@ BUSES["SMS_EXP"] = true
BUSES["SNES"] = true
BUSES["SNES_CTRL"] = true
BUSES["SPC1000"] = true
BUSES["SVI_EXPANDER"] = true
BUSES["SVI_SLOT"] = true
BUSES["TI99PEB"] = true
BUSES["TI99X"] = true
BUSES["TIKI100"] = true

View File

@ -295,17 +295,17 @@ int gba_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
// first detect nvram type based on strings inside the file
for (int i = 0; i < len; i++)
{
if (!memcmp(&ROM[i], "EEPROM_V", 8))
if ((i<len-8) && !memcmp(&ROM[i], "EEPROM_V", 8))
chip |= GBA_CHIP_EEPROM; // should be either GBA_CHIP_EEPROM_4K or GBA_CHIP_EEPROM_64K, but it is not yet possible to automatically detect which one
else if ((!memcmp(&ROM[i], "SRAM_V", 6)) || (!memcmp(&ROM[i], "SRAM_F_V", 8))) // || (!memcmp(&data[i], "ADVANCEWARS", 11))) //advance wars 1 & 2 has SRAM, but no "SRAM_" string can be found inside the ROM space
else if (((i<len-6) && !memcmp(&ROM[i], "SRAM_V", 6)) || ((i<len-8) && !memcmp(&ROM[i], "SRAM_F_V", 8))) // || ((i<len-11) && !memcmp(&data[i], "ADVANCEWARS", 11))) //advance wars 1 & 2 has SRAM, but no "SRAM_" string can be found inside the ROM space
chip |= GBA_CHIP_SRAM;
else if (!memcmp(&ROM[i], "FLASH1M_V", 9))
else if ((i<len-9) && !memcmp(&ROM[i], "FLASH1M_V", 9))
chip |= GBA_CHIP_FLASH_1M;
else if (!memcmp(&ROM[i], "FLASH512_V", 10))
else if ((i<len-10) && !memcmp(&ROM[i], "FLASH512_V", 10))
chip |= GBA_CHIP_FLASH_512;
else if (!memcmp(&ROM[i], "FLASH_V", 7))
else if ((i<len-7) && !memcmp(&ROM[i], "FLASH_V", 7))
chip |= GBA_CHIP_FLASH;
else if (!memcmp(&ROM[i], "SIIRTC_V", 8))
else if ((i<len-8) && !memcmp(&ROM[i], "SIIRTC_V", 8))
chip |= GBA_CHIP_RTC;
}
osd_printf_info("GBA: Detected (ROM) %s\n", gba_chip_string(chip).c_str());

View File

@ -191,6 +191,7 @@ void trident_vga_device::device_reset()
// Windows 3.1 TGUI9440AGi drivers do not set the pointer colour registers?
tri.cursor_bg = 0x00000000;
tri.cursor_fg = 0xffffffff;
tri.pixel_depth = 0x10; //disable 8bpp mode by default
}
UINT32 trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
@ -443,7 +444,6 @@ void trident_vga_device::trident_seq_reg_write(UINT8 index, UINT8 data)
}
else
{
if(LOG) logerror("Trident SR%02X: %s mode write %02x\n",index,tri.new_mode ? "new" : "old",data);
switch(index)
{
case 0x0b:
@ -490,6 +490,7 @@ void trident_vga_device::trident_seq_reg_write(UINT8 index, UINT8 data)
if(!LOG) logerror("Trident: Sequencer index %02x read\n",index);
}
}
if(LOG) logerror("Trident SR%02X: %s mode write %02x\n",index,tri.new_mode ? "new" : "old",data);
}
UINT8 trident_vga_device::trident_crtc_reg_read(UINT8 index)
@ -605,7 +606,6 @@ void trident_vga_device::trident_crtc_reg_write(UINT8 index, UINT8 data)
}
else
{
if(LOG) logerror("Trident CR%02X: write %02x\n",index,data);
switch(index)
{
case 0x1e: // Module Testing Register
@ -704,6 +704,7 @@ void trident_vga_device::trident_crtc_reg_write(UINT8 index, UINT8 data)
break;
}
}
if(LOG) logerror("Trident CR%02X: write %02x\n",index,data);
}
UINT8 trident_vga_device::trident_gc_reg_read(UINT8 index)
@ -764,6 +765,7 @@ void trident_vga_device::trident_gc_reg_write(UINT8 index, UINT8 data)
break;
}
}
if(LOG) logerror("Trident GC%02X: write %02x\n",index,data);
}
READ8_MEMBER(trident_vga_device::port_03c0_r)

View File

@ -0,0 +1,151 @@
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
SVI 318/328 Expansion Slot
50-pin slot
***************************************************************************/
#include "expander.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
const device_type SVI_EXPANDER = &device_creator<svi_expander_device>;
//**************************************************************************
// SLOT DEVICE
//**************************************************************************
//-------------------------------------------------
// svi_expander_device - constructor
//-------------------------------------------------
svi_expander_device::svi_expander_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, SVI_EXPANDER, "SVI 318/328 Expander Bus", tag, owner, clock, "svi_expander", __FILE__),
device_slot_interface(mconfig, *this),
m_module(nullptr),
m_int_handler(*this),
m_romdis_handler(*this),
m_ramdis_handler(*this),
m_ctrl1_handler(*this),
m_ctrl2_handler(*this)
{
}
//-------------------------------------------------
// svi_expander_device - destructor
//-------------------------------------------------
svi_expander_device::~svi_expander_device()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void svi_expander_device::device_start()
{
// get inserted module
m_module = dynamic_cast<device_svi_expander_interface *>(get_card_device());
// resolve callbacks
m_int_handler.resolve_safe();
m_romdis_handler.resolve_safe();
m_ramdis_handler.resolve_safe();
m_ctrl1_handler.resolve_safe();
m_ctrl2_handler.resolve_safe();
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void svi_expander_device::device_reset()
{
}
//-------------------------------------------------
// host to module interface
//-------------------------------------------------
READ8_MEMBER( svi_expander_device::mreq_r )
{
if (m_module)
return m_module->mreq_r(space, offset);
return 0xff;
}
WRITE8_MEMBER( svi_expander_device::mreq_w )
{
if (m_module)
m_module->mreq_w(space, offset, data);
}
READ8_MEMBER( svi_expander_device::iorq_r )
{
if (m_module)
return m_module->iorq_r(space, offset);
return 0xff;
}
WRITE8_MEMBER( svi_expander_device::iorq_w )
{
if (m_module)
m_module->iorq_w(space, offset, data);
}
WRITE_LINE_MEMBER( svi_expander_device::bk21_w )
{
if (m_module)
m_module->bk21_w(state);
}
WRITE_LINE_MEMBER( svi_expander_device::bk22_w )
{
if (m_module)
m_module->bk22_w(state);
}
WRITE_LINE_MEMBER( svi_expander_device::bk31_w )
{
if (m_module)
m_module->bk31_w(state);
}
WRITE_LINE_MEMBER( svi_expander_device::bk32_w )
{
if (m_module)
m_module->bk32_w(state);
}
//**************************************************************************
// CARTRIDGE INTERFACE
//**************************************************************************
//-------------------------------------------------
// device_svi_expander_interface - constructor
//-------------------------------------------------
device_svi_expander_interface::device_svi_expander_interface(const machine_config &mconfig, device_t &device) :
device_slot_card_interface(mconfig, device)
{
m_expander = dynamic_cast<svi_expander_device *>(device.owner());
}
//-------------------------------------------------
// ~device_expansion_interface - destructor
//-------------------------------------------------
device_svi_expander_interface::~device_svi_expander_interface()
{
}

View File

@ -0,0 +1,162 @@
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
SVI 318/328 Expander Slot
50-pin slot
1 +5V 2 /CNTRL2
3 +12V 4 -12V
5 /CNTRL1 6 /WAIT
7 /RST 8 CPUCLK
9 A15 10 A14
11 A13 12 A12
13 A11 14 A10
15 A9 16 A8
17 A7 18 A6
19 A5 20 A4
21 A3 22 A2
23 A1 24 A0
25 /RFSH 26 /EXCSR
27 /M1 28 /EXCSW
29 /WR 30 /MREQ
31 /IORQ 32 /RD
33 D0 34 D1
35 D2 36 D3
37 D4 38 D5
39 D6 40 D7
41 CSOUND 42 /INT
43 /RAMDIS 44 /ROMDIS
45 /BK32 46 /BK31
47 /BK22 48 /BK21
49 GND 50 GND
***************************************************************************/
#pragma once
#ifndef __SVI3X8_EXPANDER_H__
#define __SVI3X8_EXPANDER_H__
#include "emu.h"
//**************************************************************************
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_SVI_EXPANDER_BUS_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, SVI_EXPANDER, 0) \
MCFG_DEVICE_SLOT_INTERFACE(svi_expander_modules, NULL, false) \
#define MCFG_SVI_EXPANDER_INT_HANDLER(_devcb) \
devcb = &svi_expander_device::set_int_handler(*device, DEVCB_##_devcb);
#define MCFG_SVI_EXPANDER_ROMDIS_HANDLER(_devcb) \
devcb = &svi_expander_device::set_romdis_handler(*device, DEVCB_##_devcb);
#define MCFG_SVI_EXPANDER_RAMDIS_HANDLER(_devcb) \
devcb = &svi_expander_device::set_ramdis_handler(*device, DEVCB_##_devcb);
#define MCFG_SVI_EXPANDER_CTRL1_HANDLER(_devcb) \
devcb = &svi_expander_device::set_ctrl1_handler(*device, DEVCB_##_devcb);
#define MCFG_SVI_EXPANDER_CTRL2_HANDLER(_devcb) \
devcb = &svi_expander_device::set_ctrl2_handler(*device, DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
class device_svi_expander_interface;
// ======================> svi_expander_device
class svi_expander_device : public device_t, public device_slot_interface
{
public:
// construction/destruction
svi_expander_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~svi_expander_device();
// callbacks
template<class _Object> static devcb_base &set_int_handler(device_t &device, _Object object)
{ return downcast<svi_expander_device &>(device).m_int_handler.set_callback(object); }
template<class _Object> static devcb_base &set_romdis_handler(device_t &device, _Object object)
{ return downcast<svi_expander_device &>(device).m_romdis_handler.set_callback(object); }
template<class _Object> static devcb_base &set_ramdis_handler(device_t &device, _Object object)
{ return downcast<svi_expander_device &>(device).m_ramdis_handler.set_callback(object); }
template<class _Object> static devcb_base &set_ctrl1_handler(device_t &device, _Object object)
{ return downcast<svi_expander_device &>(device).m_ctrl1_handler.set_callback(object); }
template<class _Object> static devcb_base &set_ctrl2_handler(device_t &device, _Object object)
{ return downcast<svi_expander_device &>(device).m_ctrl2_handler.set_callback(object); }
// called from cart device
DECLARE_WRITE_LINE_MEMBER( int_w ) { m_int_handler(state); }
DECLARE_WRITE_LINE_MEMBER( romdis_w ) { m_romdis_handler(state); }
DECLARE_WRITE_LINE_MEMBER( ramdis_w ) { m_ramdis_handler(state); }
DECLARE_WRITE_LINE_MEMBER( ctrl1_w ) { m_ctrl1_handler(state); }
DECLARE_WRITE_LINE_MEMBER( ctrl2_w ) { m_ctrl2_handler(state); }
// called from host
DECLARE_READ8_MEMBER( mreq_r );
DECLARE_WRITE8_MEMBER( mreq_w );
DECLARE_READ8_MEMBER( iorq_r );
DECLARE_WRITE8_MEMBER( iorq_w );
DECLARE_WRITE_LINE_MEMBER( bk21_w );
DECLARE_WRITE_LINE_MEMBER( bk22_w );
DECLARE_WRITE_LINE_MEMBER( bk31_w );
DECLARE_WRITE_LINE_MEMBER( bk32_w );
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
private:
device_svi_expander_interface *m_module;
devcb_write_line m_int_handler;
devcb_write_line m_romdis_handler;
devcb_write_line m_ramdis_handler;
devcb_write_line m_ctrl1_handler;
devcb_write_line m_ctrl2_handler;
};
// ======================> device_svi_expander_interface
class device_svi_expander_interface : public device_slot_card_interface
{
public:
// construction/destruction
device_svi_expander_interface(const machine_config &mconfig, device_t &device);
virtual ~device_svi_expander_interface();
virtual DECLARE_READ8_MEMBER( mreq_r ) { return 0xff; };
virtual DECLARE_WRITE8_MEMBER( mreq_w ){};
virtual DECLARE_READ8_MEMBER( iorq_r ) { return 0xff; };
virtual DECLARE_WRITE8_MEMBER( iorq_w ){};
virtual void bk21_w(int state) {};
virtual void bk22_w(int state) {};
virtual void bk31_w(int state) {};
virtual void bk32_w(int state) {};
protected:
svi_expander_device *m_expander;
};
// device type definition
extern const device_type SVI_EXPANDER;
// include here so drivers don't need to
#include "modules.h"
#endif // __SVI3X8_EXPANDER_H__

View File

@ -0,0 +1,13 @@
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
SVI 318/328 Expander Bus Modules
***************************************************************************/
#include "modules.h"
SLOT_INTERFACE_START( svi_expander_modules )
SLOT_INTERFACE("sv601", SV601)
SLOT_INTERFACE_END

View File

@ -0,0 +1,19 @@
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
SVI 318/328 Expander Bus Modules
***************************************************************************/
#pragma once
#ifndef __SVI_EXPANDER_MODULES_H__
#define __SVI_EXPANDER_MODULES_H__
#include "emu.h"
#include "sv601.h"
SLOT_INTERFACE_EXTERN( svi_expander_modules );
#endif // __SVI_EXPANDER_MODULES_H__

View File

@ -0,0 +1,98 @@
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
SV-601 Super Expander for SVI-318/328
***************************************************************************/
#include "sv601.h"
//**************************************************************************
// CONSTANTS/MACROS
//**************************************************************************
#define VERBOSE 0
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
const device_type SV601 = &device_creator<sv601_device>;
//-------------------------------------------------
// machine_config_additions - device-specific
// machine configurations
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( sv601 )
MCFG_SVI_SLOT_BUS_ADD
MCFG_SVI_SLOT_INT_HANDLER(WRITELINE(sv601_device, int_w))
MCFG_SVI_SLOT_ROMDIS_HANDLER(WRITELINE(sv601_device, romdis_w))
MCFG_SVI_SLOT_RAMDIS_HANDLER(WRITELINE(sv601_device, ramdis_w))
MCFG_SVI_SLOT_ADD("0", NULL)
MCFG_SVI_SLOT_ADD("1", NULL)
MCFG_SVI_SLOT_ADD("2", NULL)
MCFG_SVI_SLOT_ADD("3", NULL)
MCFG_SVI_SLOT_ADD("4", NULL)
MCFG_SVI_SLOT_ADD("5", NULL)
MCFG_SVI_SLOT_ADD("6", NULL)
MACHINE_CONFIG_END
machine_config_constructor sv601_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( sv601 );
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// sv601_device - constructor
//-------------------------------------------------
sv601_device::sv601_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, SV601, "SV-601 Super Expander", tag, owner, clock, "sv601", __FILE__),
device_svi_expander_interface(mconfig, *this),
m_slotbus(*this, "slotbus")
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void sv601_device::device_start()
{
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void sv601_device::device_reset()
{
}
//**************************************************************************
// IMPLEMENTATION
//**************************************************************************
WRITE_LINE_MEMBER( sv601_device::int_w ) { m_expander->int_w(state); }
WRITE_LINE_MEMBER( sv601_device::romdis_w ) { m_expander->romdis_w(state); }
WRITE_LINE_MEMBER( sv601_device::ramdis_w ) { m_expander->ramdis_w(state); }
READ8_MEMBER( sv601_device::mreq_r ) { return m_slotbus->mreq_r(space, offset); }
WRITE8_MEMBER( sv601_device::mreq_w ) { m_slotbus->mreq_w(space, offset, data); }
READ8_MEMBER( sv601_device::iorq_r ) { return m_slotbus->iorq_r(space, offset); }
WRITE8_MEMBER( sv601_device::iorq_w ) { m_slotbus->iorq_w(space, offset, data); }
void sv601_device::bk21_w(int state) { m_slotbus->bk21_w(state); }
void sv601_device::bk22_w(int state) { m_slotbus->bk22_w(state); }
void sv601_device::bk31_w(int state) { m_slotbus->bk31_w(state); }
void sv601_device::bk32_w(int state) { m_slotbus->bk32_w(state); }

View File

@ -0,0 +1,59 @@
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
SV-601 Super Expander for SVI-318/328
***************************************************************************/
#pragma once
#ifndef __SVI3X8_EXPANDER_SV601_H__
#define __SVI3X8_EXPANDER_SV601_H__
#include "emu.h"
#include "expander.h"
#include "bus/svi3x8/slot/slot.h"
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> sv601_device
class sv601_device : public device_t, public device_svi_expander_interface
{
public:
// construction/destruction
sv601_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// from slots
WRITE_LINE_MEMBER( int_w );
WRITE_LINE_MEMBER( romdis_w );
WRITE_LINE_MEMBER( ramdis_w );
// from host
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;
virtual void bk21_w(int state) override;
virtual void bk22_w(int state) override;
virtual void bk31_w(int state) override;
virtual void bk32_w(int state) override;
protected:
virtual machine_config_constructor device_mconfig_additions() const override;
virtual void device_start() override;
virtual void device_reset() override;
private:
required_device<svi_slot_bus_device> m_slotbus;
};
// device type definition
extern const device_type SV601;
#endif // __SVI3X8_EXPANDER_SV601_H__

View File

@ -0,0 +1,16 @@
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
SVI 318/328 Slot Cards
***************************************************************************/
#include "cards.h"
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

View File

@ -0,0 +1,22 @@
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
SVI 318/328 Slot Cards
***************************************************************************/
#pragma once
#ifndef __SVI3X8_SLOT_CARDS_H__
#define __SVI3X8_SLOT_CARDS_H__
#include "emu.h"
#include "sv801.h"
#include "sv803.h"
#include "sv806.h"
#include "sv807.h"
SLOT_INTERFACE_EXTERN( svi_slot_cards );
#endif // __SVI3X8_SLOT_CARDS_H__

View File

@ -0,0 +1,284 @@
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
SVI 318/328 Expansion Slot
***************************************************************************/
#include "slot.h"
//**************************************************************************
// SLOT BUS DEVICE
//**************************************************************************
const device_type SVI_SLOT_BUS = &device_creator<svi_slot_bus_device>;
//-------------------------------------------------
// svi_slot_bus_device - constructor
//-------------------------------------------------
svi_slot_bus_device::svi_slot_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, SVI_SLOT_BUS, "SVI Slot Bus", tag, owner, clock, "svislotbus", __FILE__),
m_int_handler(*this),
m_romdis_handler(*this),
m_ramdis_handler(*this)
{
}
//-------------------------------------------------
// svi_slot_bus_device - destructor
//-------------------------------------------------
svi_slot_bus_device::~svi_slot_bus_device()
{
m_dev.detach_all();
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void svi_slot_bus_device::device_start()
{
// resolve callbacks
m_int_handler.resolve_safe();
m_romdis_handler.resolve_safe();
m_ramdis_handler.resolve_safe();
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void svi_slot_bus_device::device_reset()
{
}
//-------------------------------------------------
// add_card - add new card to our bus
//-------------------------------------------------
void svi_slot_bus_device::add_card(device_svi_slot_interface *card)
{
card->set_bus_device(this);
m_dev.append(*card);
}
//-------------------------------------------------
// mreq_r - memory read from slot
//-------------------------------------------------
READ8_MEMBER( svi_slot_bus_device::mreq_r )
{
device_svi_slot_interface *entry = m_dev.first();
UINT8 data = 0xff;
romdis_w(1);
ramdis_w(1);
while (entry)
{
data &= entry->mreq_r(space, offset);
entry = entry->next();
}
return data;
}
//-------------------------------------------------
// mreq_w - memory write to slot
//-------------------------------------------------
WRITE8_MEMBER( svi_slot_bus_device::mreq_w )
{
device_svi_slot_interface *entry = m_dev.first();
romdis_w(1);
ramdis_w(1);
while (entry)
{
entry->mreq_w(space, offset, data);
entry = entry->next();
}
}
//-------------------------------------------------
// iorq_r - memory read from slot
//-------------------------------------------------
READ8_MEMBER( svi_slot_bus_device::iorq_r )
{
device_svi_slot_interface *entry = m_dev.first();
UINT8 data = 0xff;
while (entry)
{
data &= entry->iorq_r(space, offset);
entry = entry->next();
}
return data;
}
//-------------------------------------------------
// iorq_w - memory write to slot
//-------------------------------------------------
WRITE8_MEMBER( svi_slot_bus_device::iorq_w )
{
device_svi_slot_interface *entry = m_dev.first();
while (entry)
{
entry->iorq_w(space, offset, data);
entry = entry->next();
}
}
//-------------------------------------------------
// bk21_w - signal from host to slots
//-------------------------------------------------
WRITE_LINE_MEMBER( svi_slot_bus_device::bk21_w )
{
device_svi_slot_interface *entry = m_dev.first();
while (entry)
{
entry->bk21_w(state);
entry = entry->next();
}
}
//-------------------------------------------------
// bk22_w - signal from host to slots
//-------------------------------------------------
WRITE_LINE_MEMBER( svi_slot_bus_device::bk22_w )
{
device_svi_slot_interface *entry = m_dev.first();
while (entry)
{
entry->bk22_w(state);
entry = entry->next();
}
}
//-------------------------------------------------
// bk31_w - signal from host to slots
//-------------------------------------------------
WRITE_LINE_MEMBER( svi_slot_bus_device::bk31_w )
{
device_svi_slot_interface *entry = m_dev.first();
while (entry)
{
entry->bk31_w(state);
entry = entry->next();
}
}
//-------------------------------------------------
// bk32_w - signal from host to slots
//-------------------------------------------------
WRITE_LINE_MEMBER( svi_slot_bus_device::bk32_w )
{
device_svi_slot_interface *entry = m_dev.first();
while (entry)
{
entry->bk32_w(state);
entry = entry->next();
}
}
//**************************************************************************
// SVI SLOT DEVICE
//**************************************************************************
const device_type SVI_SLOT = &device_creator<svi_slot_device>;
//-------------------------------------------------
// svi_slot_device - constructor
//-------------------------------------------------
svi_slot_device::svi_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, SVI_SLOT, "SVI Slot", tag, owner, clock, "svislot", __FILE__),
device_slot_interface(mconfig, *this),
m_bus_tag(nullptr)
{
}
//-------------------------------------------------
// set_bus - set owner bus tag
//-------------------------------------------------
void svi_slot_device::set_bus(device_t &device, device_t *owner, const char *bus_tag)
{
svi_slot_device &card = dynamic_cast<svi_slot_device &>(device);
card.m_owner = owner;
card.m_bus_tag = bus_tag;
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void svi_slot_device::device_start()
{
device_svi_slot_interface *dev = dynamic_cast<device_svi_slot_interface *>(get_card_device());
if (dev)
{
svi_slot_bus_device *bus = downcast<svi_slot_bus_device *>(m_owner->subdevice(m_bus_tag));
bus->add_card(dev);
}
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void svi_slot_device::device_reset()
{
}
//**************************************************************************
// CARD INTERFACE
//**************************************************************************
//-------------------------------------------------
// device_svi_slot_interface - constructor
//-------------------------------------------------
device_svi_slot_interface::device_svi_slot_interface(const machine_config &mconfig, device_t &device) :
device_slot_card_interface(mconfig, device),
m_next(nullptr),
m_bus(nullptr)
{
}
//-------------------------------------------------
// ~device_svi_slot_interface - destructor
//-------------------------------------------------
device_svi_slot_interface::~device_svi_slot_interface()
{
}
//-------------------------------------------------
// set_bus_device - set bus we are attached to
//-------------------------------------------------
void device_svi_slot_interface::set_bus_device(svi_slot_bus_device *bus)
{
m_bus = bus;
}

View File

@ -0,0 +1,178 @@
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
SVI 318/328 Expansion Slot
50-pin slot
1 +5V 2 +5V
3 +12V 4 -12V
5 GND 6 /WAIT
7 /RST 8 CPUCLK
9 A15 10 A14
11 A13 12 A12
13 A11 14 A10
15 A9 16 A8
17 A7 18 A6
19 A5 20 A4
21 A3 22 A2
23 A1 24 A0
25 /RFSH 26 GND
27 /M1 28 GND
29 /WR 30 /MREQ
31 /IORQ 32 /RD
33 D0 34 D1
35 D2 36 D3
37 D4 38 D5
39 D6 40 D7
41 CSOUND 42 /INT
43 /RAMDIS 44 /ROMDIS
45 /BK32 46 /BK31
47 /BK22 48 /BK21
49 GND 50 GND
***************************************************************************/
#pragma once
#ifndef __SVI3X8_SLOT_H__
#define __SVI3X8_SLOT_H__
#include "emu.h"
//**************************************************************************
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_SVI_SLOT_BUS_ADD \
MCFG_DEVICE_ADD("slotbus", SVI_SLOT_BUS, 0)
#define MCFG_SVI_SLOT_ADD(_tag, _def_slot) \
MCFG_DEVICE_ADD(_tag, SVI_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(svi_slot_cards, _def_slot, false) \
svi_slot_device::set_bus(*device, owner, "slotbus");
#define MCFG_SVI_SLOT_INT_HANDLER(_devcb) \
devcb = &svi_slot_bus_device::set_int_handler(*device, DEVCB_##_devcb);
#define MCFG_SVI_SLOT_ROMDIS_HANDLER(_devcb) \
devcb = &svi_slot_bus_device::set_romdis_handler(*device, DEVCB_##_devcb);
#define MCFG_SVI_SLOT_RAMDIS_HANDLER(_devcb) \
devcb = &svi_slot_bus_device::set_ramdis_handler(*device, DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
class device_svi_slot_interface;
// ======================> svi_slot_bus_device
class svi_slot_bus_device : public device_t
{
public:
// construction/destruction
svi_slot_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~svi_slot_bus_device();
// callbacks
template<class _Object> static devcb_base &set_int_handler(device_t &device, _Object object)
{ return downcast<svi_slot_bus_device &>(device).m_int_handler.set_callback(object); }
template<class _Object> static devcb_base &set_romdis_handler(device_t &device, _Object object)
{ return downcast<svi_slot_bus_device &>(device).m_romdis_handler.set_callback(object); }
template<class _Object> static devcb_base &set_ramdis_handler(device_t &device, _Object object)
{ return downcast<svi_slot_bus_device &>(device).m_ramdis_handler.set_callback(object); }
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
void add_card(device_svi_slot_interface *card);
// from slot
DECLARE_WRITE_LINE_MEMBER( romdis_w ) { m_romdis_handler(state); };
DECLARE_WRITE_LINE_MEMBER( ramdis_w ) { m_ramdis_handler(state); };
// from host
DECLARE_READ8_MEMBER( mreq_r );
DECLARE_WRITE8_MEMBER( mreq_w );
DECLARE_READ8_MEMBER( iorq_r );
DECLARE_WRITE8_MEMBER( iorq_w );
DECLARE_WRITE_LINE_MEMBER( bk21_w );
DECLARE_WRITE_LINE_MEMBER( bk22_w );
DECLARE_WRITE_LINE_MEMBER( bk31_w );
DECLARE_WRITE_LINE_MEMBER( bk32_w );
private:
simple_list<device_svi_slot_interface> m_dev;
devcb_write_line m_int_handler;
devcb_write_line m_romdis_handler;
devcb_write_line m_ramdis_handler;
};
// device type definition
extern const device_type SVI_SLOT_BUS;
// ======================> svi_slot_device
class svi_slot_device : public device_t, public device_slot_interface
{
public:
// construction/destruction
svi_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// inline configuration
static void set_bus(device_t &device, device_t *owner, const char *bus_tag);
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
// configuration
const char *m_bus_tag;
};
// device type definition
extern const device_type SVI_SLOT;
// ======================> svi_slot_device
class device_svi_slot_interface : public device_slot_card_interface
{
public:
// construction/destruction
device_svi_slot_interface(const machine_config &mconfig, device_t &device);
virtual ~device_svi_slot_interface();
void set_bus_device(svi_slot_bus_device *bus);
device_svi_slot_interface *next() const { return m_next; }
device_svi_slot_interface *m_next;
virtual DECLARE_READ8_MEMBER( mreq_r ) { return 0xff; };
virtual DECLARE_WRITE8_MEMBER( mreq_w ) {};
virtual DECLARE_READ8_MEMBER( iorq_r ) { return 0xff; };
virtual DECLARE_WRITE8_MEMBER( iorq_w ) {};
virtual DECLARE_WRITE_LINE_MEMBER( bk21_w ) {};
virtual DECLARE_WRITE_LINE_MEMBER( bk22_w ) {};
virtual DECLARE_WRITE_LINE_MEMBER( bk31_w ) {};
virtual DECLARE_WRITE_LINE_MEMBER( bk32_w ) {};
protected:
svi_slot_bus_device *m_bus;
};
// include here so drivers don't need to
#include "cards.h"
#endif // __SVI3X8_SLOT_H__

View File

@ -0,0 +1,144 @@
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
SV-801 Disk Controller
***************************************************************************/
#include "sv801.h"
#include "softlist.h"
#include "formats/svi_dsk.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
const device_type SV801 = &device_creator<sv801_device>;
//-------------------------------------------------
// machine_config_additions - device-specific
// machine configurations
//-------------------------------------------------
FLOPPY_FORMATS_MEMBER( sv801_device::floppy_formats )
FLOPPY_SVI_FORMAT
FLOPPY_FORMATS_END
static SLOT_INTERFACE_START( svi_floppies )
SLOT_INTERFACE("dd", FLOPPY_525_DD)
SLOT_INTERFACE_END
static MACHINE_CONFIG_FRAGMENT( sv801 )
MCFG_FD1793_ADD("fdc", XTAL_1MHz)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(sv801_device, intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(sv801_device, drq_w))
MCFG_FLOPPY_DRIVE_ADD("fdc:0", svi_floppies, "dd", sv801_device::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", svi_floppies, "dd", sv801_device::floppy_formats)
MCFG_SOFTWARE_LIST_ADD("disk_list", "svi318_flop")
MACHINE_CONFIG_END
machine_config_constructor sv801_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( sv801 );
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// sv801_device - constructor
//-------------------------------------------------
sv801_device::sv801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, SV801, "SV-801 Disk Controller", tag, owner, clock, "sv801", __FILE__),
device_svi_slot_interface(mconfig, *this),
m_fdc(*this, "fdc"),
m_floppy0(*this, "fdc:0"),
m_floppy1(*this, "fdc:1"),
m_floppy(nullptr),
m_irq(0), m_drq(0)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void sv801_device::device_start()
{
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void sv801_device::device_reset()
{
}
//**************************************************************************
// IMPLEMENTATION
//**************************************************************************
WRITE_LINE_MEMBER( sv801_device::intrq_w )
{
m_irq = state;
}
WRITE_LINE_MEMBER( sv801_device::drq_w )
{
m_drq = state;
}
WRITE8_MEMBER( sv801_device::motor_w )
{
m_floppy = nullptr;
if (BIT(data, 0)) m_floppy = m_floppy0->get_device();
if (BIT(data, 1)) m_floppy = m_floppy1->get_device();
m_fdc->set_floppy(m_floppy);
if (m_floppy0->get_device())
m_floppy0->get_device()->mon_w(!BIT(data, 2));
if (m_floppy1->get_device())
m_floppy1->get_device()->mon_w(!BIT(data, 3));
}
READ8_MEMBER( sv801_device::iorq_r )
{
switch (offset)
{
case 0x30: return m_fdc->status_r(space, 0);
case 0x31: return m_fdc->track_r(space, 0);
case 0x32: return m_fdc->sector_r(space, 0);
case 0x33: return m_fdc->data_r(space, 0);
case 0x34: return (m_drq << 6) | (m_irq << 7);
}
return 0xff;
}
WRITE8_MEMBER( sv801_device::iorq_w )
{
switch (offset)
{
case 0x30: m_fdc->cmd_w(space, 0, data); break;
case 0x31: m_fdc->track_w(space, 0, data); break;
case 0x32: m_fdc->sector_w(space, 0, data); break;
case 0x33: m_fdc->data_w(space, 0, data); break;
case 0x34: motor_w(space, 0, data); break;
case 0x38:
m_fdc->dden_w(BIT(data, 0));
if (m_floppy)
m_floppy->ss_w(BIT(data, 1));
break;
}
}

View File

@ -0,0 +1,61 @@
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
SV-801 Disk Controller
***************************************************************************/
#pragma once
#ifndef __SVI3X8_SLOT_SV801_H__
#define __SVI3X8_SLOT_SV801_H__
#include "emu.h"
#include "slot.h"
#include "machine/wd_fdc.h"
#include "imagedev/floppy.h"
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> sv801_device
class sv801_device : public device_t, public device_svi_slot_interface
{
public:
// construction/destruction
sv801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
DECLARE_FLOPPY_FORMATS(floppy_formats);
virtual DECLARE_READ8_MEMBER( iorq_r ) override;
virtual DECLARE_WRITE8_MEMBER( iorq_w ) override;
DECLARE_WRITE_LINE_MEMBER( intrq_w );
DECLARE_WRITE_LINE_MEMBER( drq_w );
protected:
virtual machine_config_constructor device_mconfig_additions() const override;
virtual void device_start() override;
virtual void device_reset() override;
private:
DECLARE_WRITE8_MEMBER( motor_w );
required_device<fd1793_t> m_fdc;
required_device<floppy_connector> m_floppy0;
required_device<floppy_connector> m_floppy1;
floppy_image_device *m_floppy;
int m_irq;
int m_drq;
};
// device type definition
extern const device_type SV801;
#endif // __SVI3X8_SLOT_SV801_H__

View File

@ -0,0 +1,68 @@
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
SV-803 16k memory expansion for SVI-318
***************************************************************************/
#include "sv803.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
const device_type SV803 = &device_creator<sv803_device>;
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// sv803_device - constructor
//-------------------------------------------------
sv803_device::sv803_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, SV803, "SV-803 16k RAM Cartridge", tag, owner, clock, "sv803", __FILE__),
device_svi_slot_interface(mconfig, *this)
{
m_ram = std::make_unique<UINT8[]>(0x4000);
memset(m_ram.get(), 0xff, 0x4000);
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void sv803_device::device_start()
{
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void sv803_device::device_reset()
{
}
//**************************************************************************
// IMPLEMENTATION
//**************************************************************************
READ8_MEMBER( sv803_device::mreq_r )
{
if (offset >= 0x8000 && offset <= 0xbfff)
return m_ram[offset - 0x8000];
return 0xff;
}
WRITE8_MEMBER( sv803_device::mreq_w )
{
if (offset >= 0x8000 && offset <= 0xbfff)
m_ram[offset - 0x8000] = data;
}

View File

@ -0,0 +1,44 @@
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
SV-803 16k memory expansion for SVI-318
***************************************************************************/
#pragma once
#ifndef __SVI3X8_SLOT_SV803_H__
#define __SVI3X8_SLOT_SV803_H__
#include "emu.h"
#include "slot.h"
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> sv803_device
class sv803_device : public device_t, public device_svi_slot_interface
{
public:
// construction/destruction
sv803_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;
protected:
virtual void device_start() override;
virtual void device_reset() override;
private:
std::unique_ptr<UINT8[]> m_ram;
};
// device type definition
extern const device_type SV803;
#endif // __SVI3X8_SLOT_SV803_H__

View File

@ -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;
}
}

View File

@ -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__

View File

@ -0,0 +1,163 @@
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
SV-807 64k memory expansion for SVI-318/328
TODO:
- Switch S6 (but needs to be off for the SVI anyway)
***************************************************************************/
#include "sv807.h"
//**************************************************************************
// CONSTANTS / MACROS
//**************************************************************************
#define BK21_ACTIVE ((m_bk21 == 0) && (m_switch->read() & 0x01))
#define BK22_ACTIVE ((m_bk22 == 0) && (m_switch->read() & 0x02))
#define BK31_ACTIVE ((m_bk31 == 0) && (m_switch->read() & 0x04))
#define BK32_ACTIVE ((m_bk32 == 0) && (m_switch->read() & 0x08))
#define BK02_ACTIVE (m_switch->read() & 0x10)
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
const device_type SV807 = &device_creator<sv807_device>;
//-------------------------------------------------
// input_ports - device-specific input ports
//-------------------------------------------------
static INPUT_PORTS_START( sv807_switches )
PORT_START("S")
PORT_DIPNAME(0x01, 0x00, "Bank/Page 21")
PORT_DIPLOCATION("S:1")
PORT_DIPSETTING(0x00, "Off")
PORT_DIPSETTING(0x01, "On")
PORT_DIPNAME(0x02, 0x02, "Bank/Page 22")
PORT_DIPLOCATION("S:2")
PORT_DIPSETTING(0x00, "Off")
PORT_DIPSETTING(0x02, "On")
PORT_DIPNAME(0x04, 0x04, "Bank/Page 31")
PORT_DIPLOCATION("S:3")
PORT_DIPSETTING(0x00, "Off")
PORT_DIPSETTING(0x04, "On")
PORT_DIPNAME(0x08, 0x00, "Bank/Page 32")
PORT_DIPLOCATION("S:4")
PORT_DIPSETTING(0x00, "Off")
PORT_DIPSETTING(0x08, "On")
PORT_DIPNAME(0x10, 0x00, "Bank/Page 02")
PORT_DIPLOCATION("S:5")
PORT_DIPSETTING(0x00, "Off")
PORT_DIPSETTING(0x10, "On")
PORT_DIPNAME(0x20, 0x00, "48k/32k")
PORT_DIPLOCATION("S:6")
PORT_DIPSETTING(0x00, "Off")
PORT_DIPSETTING(0x20, "On")
INPUT_PORTS_END
ioport_constructor sv807_device::device_input_ports() const
{
return INPUT_PORTS_NAME( sv807_switches );
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// sv807_device - constructor
//-------------------------------------------------
sv807_device::sv807_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, SV803, "SV-807 64k RAM Cartridge", tag, owner, clock, "sv807", __FILE__),
device_svi_slot_interface(mconfig, *this),
m_switch(*this, "S"),
m_bk21(1), m_bk22(1), m_bk31(1), m_bk32(1)
{
m_ram_bank1 = std::make_unique<UINT8[]>(0x8000);
m_ram_bank2 = std::make_unique<UINT8[]>(0x8000);
memset(m_ram_bank1.get(), 0xff, 0x8000);
memset(m_ram_bank2.get(), 0xff, 0x8000);
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void sv807_device::device_start()
{
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void sv807_device::device_reset()
{
}
//**************************************************************************
// IMPLEMENTATION
//**************************************************************************
// test setup: S2 = enabled (22), S3 = enabled (31)
READ8_MEMBER( sv807_device::mreq_r )
{
if ((BK21_ACTIVE || BK31_ACTIVE) && offset < 0x8000)
{
m_bus->romdis_w(0);
return m_ram_bank1[offset];
}
if ((BK22_ACTIVE || BK32_ACTIVE || BK02_ACTIVE) && offset >= 0x8000)
{
m_bus->ramdis_w(0);
return m_ram_bank2[offset - 0x8000];
}
return 0xff;
}
WRITE8_MEMBER( sv807_device::mreq_w )
{
if ((BK21_ACTIVE || BK31_ACTIVE) && offset < 0x8000)
{
m_bus->romdis_w(0);
m_ram_bank1[offset] = data;
}
if ((BK22_ACTIVE || BK32_ACTIVE || BK02_ACTIVE) && offset >= 0x8000)
{
m_bus->ramdis_w(0);
m_ram_bank2[offset - 0x8000] = data;
}
}
void sv807_device::bk21_w(int state)
{
m_bk21 = state;
}
void sv807_device::bk22_w(int state)
{
m_bk22 = state;
}
void sv807_device::bk31_w(int state)
{
m_bk31 = state;
}
void sv807_device::bk32_w(int state)
{
m_bk32 = state;
}

View File

@ -0,0 +1,60 @@
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
SV-807 64k memory expansion for SVI-318/328
***************************************************************************/
#pragma once
#ifndef __SVI3X8_SLOT_SV807_H__
#define __SVI3X8_SLOT_SV807_H__
#include "emu.h"
#include "slot.h"
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> sv807_device
class sv807_device : public device_t, public device_svi_slot_interface
{
public:
// construction/destruction
sv807_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// optional information overrides
virtual ioport_constructor device_input_ports() const override;
virtual DECLARE_READ8_MEMBER( mreq_r ) override;
virtual DECLARE_WRITE8_MEMBER( mreq_w ) override;
virtual void bk21_w(int state) override;
virtual void bk22_w(int state) override;
virtual void bk31_w(int state) override;
virtual void bk32_w(int state) override;
protected:
virtual void device_start() override;
virtual void device_reset() override;
private:
required_ioport m_switch;
std::unique_ptr<UINT8[]> m_ram_bank1;
std::unique_ptr<UINT8[]> m_ram_bank2;
int m_bk21;
int m_bk22;
int m_bk31;
int m_bk32;
};
// device type definition
extern const device_type SV807;
#endif // __SVI3X8_SLOT_SV807_H__

View File

@ -72,11 +72,15 @@ void atapi_cdrom_device::device_start()
m_identify_buffer[ 49 ] = 0x0600; // Word 49=Capabilities, IORDY may be disabled (bit_10), LBA Supported mandatory (bit_9)
m_media_change = true;
atapi_hle_device::device_start();
}
void atapi_cdrom_device::device_reset()
{
atapi_hle_device::device_reset();
m_media_change = true;
}
void atapi_cdrom_device::process_buffer()
{
if(m_cdrom != m_image->get_cdrom_file())
@ -130,10 +134,10 @@ void atapi_cdrom_device::ExecCommand()
}
break;
case T10SPC_CMD_INQUIRY:
break;
case T10SPC_CMD_REQUEST_SENSE:
m_media_change = false;
break;
}
t10mmc::ExecCommand();
if((command[0] == T10SPC_CMD_REQUEST_SENSE) && m_media_change)
m_media_change = false;
}

View File

@ -28,6 +28,7 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
virtual machine_config_constructor device_mconfig_additions() const override;
virtual void perform_diagnostic() override;

View File

@ -117,17 +117,6 @@ public:
UINT64 as_ticks(UINT32 frequency) const;
const char *as_string(int precision = 9) const;
// Needed by gba.c FIXME: this shouldn't be necessary?
void normalize()
{
while (m_attoseconds >= ATTOSECONDS_PER_SECOND)
{
m_seconds++;
m_attoseconds -= ATTOSECONDS_PER_SECOND;
}
}
attoseconds_t attoseconds() const { return m_attoseconds; }
seconds_t seconds() const { return m_seconds; }

View File

@ -370,6 +370,7 @@ bool debug_view_disasm::recompute(offs_t pc, int startline, int lines)
// allocate disassembly buffer
const auto total_bytes = m_total.x * m_total.y;
m_dasm.clear();
m_dasm.reserve(total_bytes).seekp(total_bytes);
// iterate over lines
@ -387,6 +388,7 @@ bool debug_view_disasm::recompute(offs_t pc, int startline, int lines)
// convert back and set the address of this instruction
m_byteaddress[instr] = pcbyte;
m_dasm.clear();
util::stream_format(m_dasm.seekp(base),
source.m_space.is_octal() ? " %0*o " : " %0*X ",
source.m_space.logaddrchars()/2*char_num, source.m_space.byte_to_address(pcbyte));

View File

@ -611,6 +611,7 @@ int core_text_file::puts(char const *s)
int core_text_file::vprintf(util::format_argument_pack<std::ostream> const &args)
{
m_printf_buffer.clear();
m_printf_buffer.reserve(1024);
m_printf_buffer.seekp(0, ovectorstream::beg);
util::stream_format<std::ostream, std::ostream>(m_printf_buffer, args);

View File

@ -35,8 +35,6 @@ static inline void ATTR_PRINTF(3,4) verboselog(device_t &device, int n_level, co
}
}
#define GBA_ATTOTIME_NORMALIZE(a) a.normalize()
static const UINT32 timer_clks[4] = { 16777216, 16777216/64, 16777216/256, 16777216/1024 };
@ -343,7 +341,6 @@ TIMER_CALLBACK_MEMBER(gba_state::timer_expire)
final = clocksel / rate;
m_timer_hz[tmr] = final;
time = attotime::from_hz(final);
GBA_ATTOTIME_NORMALIZE(time);
m_tmr_timer[tmr]->adjust(time, tmr, time);
}
@ -1639,7 +1636,6 @@ WRITE32_MEMBER(gba_state::gba_io_w)
if( !(data & 0x40000) ) // if we're not in Count-Up mode
{
attotime time = attotime::from_hz(final);
GBA_ATTOTIME_NORMALIZE(time);
m_tmr_timer[offset]->adjust(time, offset, time);
}
}

View File

@ -4245,4 +4245,7 @@ GAME( 1998, slqz2, 0, slqz2, slqz2, igs017_state, slqz2, ROT
GAME( 1999?, tarzan, 0, iqblocka, iqblocka, igs017_state, tarzan, ROT0, "IGS", "Tarzan (V109C)", MACHINE_NOT_WORKING )
GAME( 1999?, tarzana, tarzan, iqblocka, iqblocka, igs017_state, tarzana, ROT0, "IGS", "Tarzan (V107)", MACHINE_NOT_WORKING )
GAME( 2000?, starzan, 0, starzan, iqblocka, igs017_state, starzan, ROT0, "IGS / G.F. Gioca", "Super Tarzan (Italy, V100I)", MACHINE_NOT_WORKING )
GAME( ????, spkrform, spk116it, spkrform, spkrform, igs017_state, spkrform, ROT0, "IGS", "Super Poker (v100xD03) / Formosa", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION )
/* Parent spk306us in driver spoker.cpp. Move this set to that driver? */
GAME( ????, spkrform, spk306us, spkrform, spkrform, igs017_state, spkrform, ROT0, "IGS", "Super Poker (v100xD03) / Formosa", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION )

View File

@ -683,6 +683,8 @@ ROM_END
. NGH-007
NEO-AEG PROG42G / NEO-AEG CHA42G
NEO-AEG PROG42G / NEO-AEG CHA-8M
. prototype
NEO-AEG PROG-EP / NEO-AEG CHA-EP
****************************************/
ROM_START( alpham2 ) /* MVS AND AES VERSION */
@ -707,33 +709,33 @@ ROM_START( alpham2 ) /* MVS AND AES VERSION */
ROM_LOAD16_BYTE( "007-c4.c4", 0x200001, 0x080000, CRC(7d588349) SHA1(a5ed789d7bbc25be5c5b2d99883b64d379c103a2) ) /* Plane 2,3 */ /* TC534200 */
ROM_END
ROM_START( alpham2p ) /* early prototype - all roms were hand labeled with CRCs, dumps verified against them */
ROM_START( alpham2p ) /* early prototype - all roms were hand labeled with CRCs, dumps verified against them */ /* AES VERSION*/
ROM_REGION( 0x100000, "maincpu", 0 )
ROM_LOAD16_BYTE( "proto_007-p1.p1", 0x000001, 0x080000, CRC(c763e52a) SHA1(b24acbac255c5ee1a2e92e77cdde6620a24081cf) )
ROM_LOAD16_BYTE( "proto_007-p2.p2", 0x000000, 0x080000, CRC(7a0b435c) SHA1(40e6f42a92001d9f4e51898dd7489da143b6b74b) )
ROM_LOAD16_BYTE( "007_p1_faac.p1", 0x000001, 0x080000, CRC(c763e52a) SHA1(b24acbac255c5ee1a2e92e77cdde6620a24081cf) )
ROM_LOAD16_BYTE( "007_p2_1813.p2", 0x000000, 0x080000, CRC(7a0b435c) SHA1(40e6f42a92001d9f4e51898dd7489da143b6b74b) )
NEO_SFIX_128K( "proto_007-s1.s1", CRC(efc9ae2e) SHA1(a594826b0082fe5a13191673e8d9aa42517230f5) )
NEO_SFIX_128K( "007_s1_36f1.s1", CRC(efc9ae2e) SHA1(a594826b0082fe5a13191673e8d9aa42517230f5) )
NEO_BIOS_AUDIO_128K( "proto_007-m1.m1", CRC(5976b464) SHA1(ec824567ecc3579f6d86c9d9385710cbaeef16a3) )
NEO_BIOS_AUDIO_128K( "007_m1_9384.m1", CRC(5976b464) SHA1(ec824567ecc3579f6d86c9d9385710cbaeef16a3) )
ROM_REGION( 0x200000, "ymsnd", 0 )
ROM_LOAD( "proto_007-v11.v11", 0x000000, 0x080000, CRC(18eaa9e1) SHA1(85c94d8660f8a32e4ca8e015f0bd704208482d68) )
ROM_LOAD( "proto_007-v12.v12", 0x080000, 0x080000, CRC(2487d495) SHA1(49af3c4dc6a38c5158d3641fd8f9a40041b42aa6) )
ROM_LOAD( "proto_007-v13.v13", 0x100000, 0x080000, CRC(25e60f25) SHA1(d06b0df872372de38fcf90187195070ac5f8c651) )
ROM_LOAD( "proto_007-v21.v21", 0x180000, 0x080000, CRC(ac44b75a) SHA1(7399a05cd4e2c7ecde4a7323d3e189255afe5fc2) )
ROM_LOAD( "007_v11_1bb4.v11", 0x000000, 0x080000, CRC(18eaa9e1) SHA1(85c94d8660f8a32e4ca8e015f0bd704208482d68) )
ROM_LOAD( "007_v12_c8e8.v12", 0x080000, 0x080000, CRC(2487d495) SHA1(49af3c4dc6a38c5158d3641fd8f9a40041b42aa6) )
ROM_LOAD( "007_v13_09fa.v13", 0x100000, 0x080000, CRC(25e60f25) SHA1(d06b0df872372de38fcf90187195070ac5f8c651) )
ROM_LOAD( "007_v21_28c2.v21", 0x180000, 0x080000, CRC(ac44b75a) SHA1(7399a05cd4e2c7ecde4a7323d3e189255afe5fc2) )
ROM_REGION( 0x080000, "ymsnd.deltat", 0 )
ROM_COPY( "ymsnd", 0x180000, 0x00000, 0x80000 )
ROM_REGION( 0x400000, "sprites", 0 ) // note, ROM_LOAD32_BYTE
ROM_LOAD32_BYTE( "proto_007-c1.c1", 0x000000, 0x80000, CRC(24841639) SHA1(fcc2a349121dad86ffefc44b9f0e8ba616ce0d30) ) /* Plane 0 */
ROM_LOAD32_BYTE( "proto_007-c2.c2", 0x000002, 0x80000, CRC(912763ab) SHA1(cedf26d7d85ad140399ee62813c71f35e65498d6) ) /* Plane 2 */
ROM_LOAD32_BYTE( "proto_007-c3.c3", 0x000001, 0x80000, CRC(0743bde2) SHA1(0d13ad6333909ad3cf10f9ac360f9abf191318de) ) /* Plane 1 */
ROM_LOAD32_BYTE( "proto_007-c4.c4", 0x000003, 0x80000, CRC(61240212) SHA1(dee36f6604adaeb96e0d761a7256241c066b1cd2) ) /* Plane 3 */
ROM_LOAD32_BYTE( "proto_007-c5.c5", 0x200000, 0x80000, CRC(cf9f4c53) SHA1(f979c85f83d9f76e554c2617f85f6d4efca6799c) ) /* Plane 0 */
ROM_LOAD32_BYTE( "proto_007-c6.c6", 0x200002, 0x80000, CRC(3d903b19) SHA1(001a8c762336b855fe1df69fe2e605d30a3f00a1) ) /* Plane 2 */
ROM_LOAD32_BYTE( "proto_007-c7.c7", 0x200001, 0x80000, CRC(e41e3875) SHA1(730aceb8a66cb33d0194b096568f053ad7dc000a) ) /* Plane 1 */
ROM_LOAD32_BYTE( "proto_007-c8.c8", 0x200003, 0x80000, CRC(4483e2cf) SHA1(47c3364f5c36ae9dc3a49fe37ca60bcee0e73314) ) /* Plane 3 */
ROM_LOAD32_BYTE( "007_c1_210e.c11", 0x000000, 0x80000, CRC(24841639) SHA1(fcc2a349121dad86ffefc44b9f0e8ba616ce0d30) ) /* Plane 0 */
ROM_LOAD32_BYTE( "007_c2_29ae.c12", 0x000002, 0x80000, CRC(912763ab) SHA1(cedf26d7d85ad140399ee62813c71f35e65498d6) ) /* Plane 2 */
ROM_LOAD32_BYTE( "007_c3_c873.c13", 0x000001, 0x80000, CRC(0743bde2) SHA1(0d13ad6333909ad3cf10f9ac360f9abf191318de) ) /* Plane 1 */
ROM_LOAD32_BYTE( "007_c4_2462.c14", 0x000003, 0x80000, CRC(61240212) SHA1(dee36f6604adaeb96e0d761a7256241c066b1cd2) ) /* Plane 3 */
ROM_LOAD32_BYTE( "007_c5_5f16.c15", 0x200000, 0x80000, CRC(cf9f4c53) SHA1(f979c85f83d9f76e554c2617f85f6d4efca6799c) ) /* Plane 0 */
ROM_LOAD32_BYTE( "007_c6_8abc.c16", 0x200002, 0x80000, CRC(3d903b19) SHA1(001a8c762336b855fe1df69fe2e605d30a3f00a1) ) /* Plane 2 */
ROM_LOAD32_BYTE( "007_c7_c983.c17", 0x200001, 0x80000, CRC(e41e3875) SHA1(730aceb8a66cb33d0194b096568f053ad7dc000a) ) /* Plane 1 */
ROM_LOAD32_BYTE( "007_c8_b599.c18", 0x200003, 0x80000, CRC(4483e2cf) SHA1(47c3364f5c36ae9dc3a49fe37ca60bcee0e73314) ) /* Plane 3 */
ROM_END
/****************************************
@ -1023,6 +1025,8 @@ ROM_END
NEO-MVS PROG42G / NEO-MVS CHA42G
. NGH-018
NEO-AEG PROG42G / NEO-AEG CHA42G
. prototype
NEO-AEG PROG-EP / NEO-AEG CHA-EP
****************************************/
ROM_START( burningf ) /* MVS AND AES VERSION */
@ -1067,32 +1071,32 @@ ROM_START( burningfh ) /* AES VERSION (US) */
ROM_LOAD16_BYTE( "018-c4.c4", 0x200001, 0x100000, CRC(e2e0aff7) SHA1(1c691c092a6e2787de4f433b0eb9252bfdaa7e16) ) /* Plane 2,3 */ /* HN62408 */
ROM_END
ROM_START( burningfp ) /* early prototype - all roms were hand labeled with CRCs, dumps verified against them */
ROM_START( burningfp ) /* early prototype - all roms were hand labeled with CRCs, dumps verified against them */ /* AES VERSION */
ROM_REGION( 0x100000, "maincpu", 0 )
ROM_LOAD16_BYTE( "proto_018-p1.p1", 0x000001, 0x080000, CRC(5b4032e7) SHA1(55df91dad6f484d3d49c28ab5972700bf71a8662) )
ROM_LOAD16_BYTE( "proto_018-p2.p2", 0x000000, 0x080000, CRC(78762f68) SHA1(12170fc6efe75cb5d32624033d3d341032c97548) )
ROM_LOAD16_BYTE( "018_p1_9397.p1", 0x000001, 0x080000, CRC(5b4032e7) SHA1(55df91dad6f484d3d49c28ab5972700bf71a8662) )
ROM_LOAD16_BYTE( "018_p2_e335.p2", 0x000000, 0x080000, CRC(78762f68) SHA1(12170fc6efe75cb5d32624033d3d341032c97548) )
NEO_SFIX_128K( "proto_018-s1.s1", CRC(f3d130e8) SHA1(2fdeb93f4bb2a60d391cac2822be41661b1e1795) )
NEO_SFIX_128K( "018_s1_9899.s1", CRC(f3d130e8) SHA1(2fdeb93f4bb2a60d391cac2822be41661b1e1795) )
NEO_BIOS_AUDIO_128K( "proto_018-m1.m1", CRC(470dd5d4) SHA1(4291811b4aefe45261a1ae3631b6999fcd74fb3f) )
NEO_BIOS_AUDIO_128K( "018_m1_4586.m1", CRC(470dd5d4) SHA1(4291811b4aefe45261a1ae3631b6999fcd74fb3f) )
ROM_REGION( 0x200000, "ymsnd", 0 )
ROM_LOAD( "proto_018-v11.v11", 0x000000, 0x080000, CRC(dc07ea3c) SHA1(c3e71aaec44ead7ddc581565d16b90030e6db5fd) )
ROM_LOAD( "proto_018-v12.v12", 0x080000, 0x080000, CRC(f1ae637c) SHA1(02a4c7d4a544350a314ab7b26d8c9d3baa8f5778) )
ROM_LOAD( "proto_018-v21.v21", 0x100000, 0x080000, CRC(9f3b4eda) SHA1(7f516923d04daa483b4b99c9babba66505931a34) )
ROM_LOAD( "018_v11_56ac.v11", 0x000000, 0x080000, CRC(dc07ea3c) SHA1(c3e71aaec44ead7ddc581565d16b90030e6db5fd) )
ROM_LOAD( "018_v12_db95.v12", 0x080000, 0x080000, CRC(f1ae637c) SHA1(02a4c7d4a544350a314ab7b26d8c9d3baa8f5778) )
ROM_LOAD( "018_v21_98dd.v21", 0x100000, 0x080000, CRC(9f3b4eda) SHA1(7f516923d04daa483b4b99c9babba66505931a34) )
ROM_REGION( 0x080000, "ymsnd.deltat", 0 )
ROM_COPY( "ymsnd", 0x100000, 0x00000, 0x80000 )
ROM_REGION( 0x400000, "sprites", 0 ) // note, ROM_LOAD32_BYTE
ROM_LOAD32_BYTE( "proto_018-c1.c1", 0x000000, 0x80000, CRC(6569018b) SHA1(25040e0a9c2b72900100a22a2a41de5f6c339d8a) ) /* Plane 0 */
ROM_LOAD32_BYTE( "proto_018-c2.c2", 0x000002, 0x80000, CRC(6949b501) SHA1(d8ee48837faff6cc849046ee8757b2b94d440303) ) /* Plane 2 */
ROM_LOAD32_BYTE( "proto_018-c3.c3", 0x000001, 0x80000, CRC(410f653b) SHA1(ce94667721baa7b2c318fc268e3bb9209671c9f5) ) /* Plane 1 */
ROM_LOAD32_BYTE( "proto_018-c4.c4", 0x000003, 0x80000, CRC(d43bf2a5) SHA1(c27985d8973611d02570f469a0d8cb4f5b63b614) ) /* Plane 3 */
ROM_LOAD32_BYTE( "proto_018-c5.c5", 0x200000, 0x80000, CRC(837d09d3) SHA1(d3b06931fca6123604549599544b04529ef34c53) ) /* Plane 0 */
ROM_LOAD32_BYTE( "proto_018-c6.c6", 0x200002, 0x80000, CRC(5fee51e7) SHA1(835c632fa12a1d5b4104cd80b8f686ac80b314a1) ) /* Plane 2 */
ROM_LOAD32_BYTE( "proto_018-c7.c7", 0x200001, 0x80000, CRC(0f3f0823) SHA1(ec1d681c1795de43d20f30f85956e2473ec39c95) ) /* Plane 1 */
ROM_LOAD32_BYTE( "proto_018-c8.c8", 0x200003, 0x80000, CRC(67cc9e34) SHA1(dc72a464c1456a4d2f7b992b416a984fb7885e99) ) /* Plane 3 */
ROM_LOAD32_BYTE( "018_c1_ba06.c11", 0x000000, 0x80000, CRC(6569018b) SHA1(25040e0a9c2b72900100a22a2a41de5f6c339d8a) ) /* Plane 0 */
ROM_LOAD32_BYTE( "018_c2_d534.c12", 0x000002, 0x80000, CRC(6949b501) SHA1(d8ee48837faff6cc849046ee8757b2b94d440303) ) /* Plane 2 */
ROM_LOAD32_BYTE( "018_c3_9d70.c13", 0x000001, 0x80000, CRC(410f653b) SHA1(ce94667721baa7b2c318fc268e3bb9209671c9f5) ) /* Plane 1 */
ROM_LOAD32_BYTE( "018_c4_bf9d.c14", 0x000003, 0x80000, CRC(d43bf2a5) SHA1(c27985d8973611d02570f469a0d8cb4f5b63b614) ) /* Plane 3 */
ROM_LOAD32_BYTE( "018_c5_ac9d.c15", 0x200000, 0x80000, CRC(837d09d3) SHA1(d3b06931fca6123604549599544b04529ef34c53) ) /* Plane 0 */
ROM_LOAD32_BYTE( "018_c6_d2a5.c16", 0x200002, 0x80000, CRC(5fee51e7) SHA1(835c632fa12a1d5b4104cd80b8f686ac80b314a1) ) /* Plane 2 */
ROM_LOAD32_BYTE( "018_c7_d568.c17", 0x200001, 0x80000, CRC(0f3f0823) SHA1(ec1d681c1795de43d20f30f85956e2473ec39c95) ) /* Plane 1 */
ROM_LOAD32_BYTE( "018_c8_d256.c18", 0x200003, 0x80000, CRC(67cc9e34) SHA1(dc72a464c1456a4d2f7b992b416a984fb7885e99) ) /* Plane 3 */
ROM_END
/****************************************
@ -1287,6 +1291,9 @@ ROM_END
. NGM-024
NEO-MVS PROG42G-1 / NEO-MVS CHA42G-1
. NGH-024
. prototype
NEO-MVS PROG-EP / NEO-MVS CHA-EPG
****************************************/
ROM_START( lresort )
@ -1310,32 +1317,32 @@ ROM_START( lresort )
ROM_LOAD16_BYTE( "024-c4.c4", 0x200001, 0x080000, CRC(7382fefb) SHA1(e916dec5bb5462eb9ae9711f08c7388937abb980) ) /* Plane 2,3 */ /* TC534200 */
ROM_END
ROM_START( lresortp ) /* prototype - all roms were hand labeled with CRCs */
ROM_START( lresortp ) /* prototype - all roms were hand labeled with CRCs */ /* MVS VERSION */
ROM_REGION( 0x100000, "maincpu", 0 )
ROM_LOAD16_BYTE( "024_p1_5937.bin", 0x000001, 0x080000, CRC(8e6008ee) SHA1(6779663118782207156dc9fa9e24e81e30c6391c) )
ROM_LOAD16_BYTE( "024_p2_8d37.bin", 0x000000, 0x080000, CRC(6d9ee90f) SHA1(ecd42182988092417bc96db8301ea408e47735f2) )
ROM_LOAD16_BYTE( "024_p1_5937.podd", 0x000001, 0x080000, CRC(8e6008ee) SHA1(6779663118782207156dc9fa9e24e81e30c6391c) )
ROM_LOAD16_BYTE( "024_p2_8d37.peven", 0x000000, 0x080000, CRC(6d9ee90f) SHA1(ecd42182988092417bc96db8301ea408e47735f2) )
NEO_SFIX_128K( "024_s1_22fe.bin", CRC(5cef5cc6) SHA1(9ec305007bdb356e9f8f279beae5e2bcb3f2cf7b) )
NEO_SFIX_128K( "024_s1_22fe.s1", CRC(5cef5cc6) SHA1(9ec305007bdb356e9f8f279beae5e2bcb3f2cf7b) )
NEO_BIOS_AUDIO_128K( "024_m1_fc7a.bin", CRC(22122875) SHA1(540c21559163381467679f836cb068adaf526659) )
NEO_BIOS_AUDIO_128K( "024_m1_fc7a.m1", CRC(22122875) SHA1(540c21559163381467679f836cb068adaf526659) )
ROM_REGION( 0x200000, "ymsnd", 0 )
ROM_LOAD( "024_v11_b085.bin", 0x000000, 0x080000, CRC(0722da38) SHA1(66a9b463d5277908b3a01c03de82b3de9118f2cb) ) // 024_v11_b085.bin 024-v1.v1 [1/2] IDENTICAL
ROM_LOAD( "024_v12_d3b7.bin", 0x080000, 0x080000, CRC(670ce3ec) SHA1(9004aa85d4a9b0ecf9cf9357b073ed55a98fdb02) ) // 024_v12_d3b7.bin 024-v1.v1 [2/2] IDENTICAL
ROM_LOAD( "024_v13_a31e.bin", 0x100000, 0x080000, CRC(2e39462b) SHA1(b0a9b1a3377bf0369f3020192505c46ca52927d6) ) // 024_v13_a31e.bin 024-v2.v2 [1/2] IDENTICAL
ROM_LOAD( "024_v24_2f0f.bin", 0x180000, 0x080000, CRC(7944754f) SHA1(d42a46c5127c6c62041ebffb0007af8a24abd360) ) // 024_v24_2f0f.bin 024-v2.v2 [2/2] IDENTICAL
ROM_LOAD( "024_v11_b085.v11", 0x000000, 0x080000, CRC(0722da38) SHA1(66a9b463d5277908b3a01c03de82b3de9118f2cb) ) // 024_v11_b085.bin 024-v1.v1 [1/2] IDENTICAL
ROM_LOAD( "024_v12_d3b7.v12", 0x080000, 0x080000, CRC(670ce3ec) SHA1(9004aa85d4a9b0ecf9cf9357b073ed55a98fdb02) ) // 024_v12_d3b7.bin 024-v1.v1 [2/2] IDENTICAL
ROM_LOAD( "024_v13_a31e.v13", 0x100000, 0x080000, CRC(2e39462b) SHA1(b0a9b1a3377bf0369f3020192505c46ca52927d6) ) // 024_v13_a31e.bin 024-v2.v2 [1/2] IDENTICAL
ROM_LOAD( "024_v24_2f0f.v24", 0x180000, 0x080000, CRC(7944754f) SHA1(d42a46c5127c6c62041ebffb0007af8a24abd360) ) // 024_v24_2f0f.bin 024-v2.v2 [2/2] IDENTICAL
NO_DELTAT_REGION
ROM_REGION( 0x400000, "sprites", 0 ) // note, ROM_LOAD32_BYTE
ROM_LOAD32_BYTE( "024_c1_b764.bin", 0x000000, 0x80000, CRC(677749ec) SHA1(6f94675e037956a380652ab1056e6f1dec605bec) ) /* Plane 0 */
ROM_LOAD32_BYTE( "024_c2_1951.bin", 0x000002, 0x80000, CRC(104d7b59) SHA1(404e8776ee8df4ca282eb7b747759af8628ddca1) ) /* Plane 2 */
ROM_LOAD32_BYTE( "024_c3_0f63.bin", 0x000001, 0x80000, CRC(b0965a74) SHA1(e8026dd4f722ccab9c913261d09ab8843ef56a0e) ) /* Plane 1 */
ROM_LOAD32_BYTE( "024_c4_c5b5.bin", 0x000003, 0x80000, CRC(dcfc3860) SHA1(8443b455ae8de656adab57f3b7e68919f22d3b9d) ) /* Plane 3 */
ROM_LOAD32_BYTE( "024_c5_dd03.bin", 0x200000, 0x80000, CRC(50322397) SHA1(3308fbe48ad165b9894a52fc3a8d9898bbbc0c0e) ) /* Plane 0 */
ROM_LOAD32_BYTE( "024_c6_c81a.bin", 0x200002, 0x80000, CRC(c3c93894) SHA1(f23b9d7e2b54d44c96370dde282bdf45cebd9cba) ) /* Plane 2 */
ROM_LOAD32_BYTE( "024_c7_5edc.bin", 0x200001, 0x80000, CRC(21faf72b) SHA1(00bf257b06180ae6ede57744cea6257b3488d9f0) ) /* Plane 1 */
ROM_LOAD32_BYTE( "024_c8_0850.bin", 0x200003, 0x80000, CRC(fb57217b) SHA1(607a98da754e8b1dd94a6432b21a36cc38e06a0f) ) /* Plane 3 */
ROM_LOAD32_BYTE( "024_c1_b764.c1", 0x000000, 0x80000, CRC(677749ec) SHA1(6f94675e037956a380652ab1056e6f1dec605bec) ) /* Plane 0 */
ROM_LOAD32_BYTE( "024_c2_1951.c2", 0x000002, 0x80000, CRC(104d7b59) SHA1(404e8776ee8df4ca282eb7b747759af8628ddca1) ) /* Plane 2 */
ROM_LOAD32_BYTE( "024_c3_0f63.c3", 0x000001, 0x80000, CRC(b0965a74) SHA1(e8026dd4f722ccab9c913261d09ab8843ef56a0e) ) /* Plane 1 */
ROM_LOAD32_BYTE( "024_c4_c5b5.c4", 0x000003, 0x80000, CRC(dcfc3860) SHA1(8443b455ae8de656adab57f3b7e68919f22d3b9d) ) /* Plane 3 */
ROM_LOAD32_BYTE( "024_c5_dd03.c5", 0x200000, 0x80000, CRC(50322397) SHA1(3308fbe48ad165b9894a52fc3a8d9898bbbc0c0e) ) /* Plane 0 */
ROM_LOAD32_BYTE( "024_c6_c81a.c6", 0x200002, 0x80000, CRC(c3c93894) SHA1(f23b9d7e2b54d44c96370dde282bdf45cebd9cba) ) /* Plane 2 */
ROM_LOAD32_BYTE( "024_c7_5edc.c7", 0x200001, 0x80000, CRC(21faf72b) SHA1(00bf257b06180ae6ede57744cea6257b3488d9f0) ) /* Plane 1 */
ROM_LOAD32_BYTE( "024_c8_0850.c8", 0x200003, 0x80000, CRC(fb57217b) SHA1(607a98da754e8b1dd94a6432b21a36cc38e06a0f) ) /* Plane 3 */
ROM_END

View File

@ -1523,27 +1523,12 @@ MACHINE_CONFIG_END
ROM_START( aes )
ROM_REGION16_BE( 0x20000, "mainbios", 0 )
ROM_SYSTEM_BIOS( 0, "asia", "Asia AES" )
ROM_LOAD16_WORD_SWAP_BIOS( 0, "neo-epo.bin", 0x00000, 0x020000, CRC(d27a71f1) SHA1(1b3b22092f30c4d1b2c15f04d1670eb1e9fbea07) ) /* AES Console (Asia?) Bios */
ROM_LOAD16_WORD_SWAP_BIOS( 0, "neo-epo.bin", 0x00000, 0x020000, CRC(d27a71f1) SHA1(1b3b22092f30c4d1b2c15f04d1670eb1e9fbea07) ) /* AES Console (Asia?) Bios */
ROM_SYSTEM_BIOS( 1, "japan", "Japan AES" )
ROM_LOAD16_WORD_SWAP_BIOS( 1, "neo-po.bin", 0x00000, 0x020000, CRC(16d0c132) SHA1(4e4a440cae46f3889d20234aebd7f8d5f522e22c) ) /* AES Console (Japan) Bios */
ROM_LOAD16_WORD_SWAP_BIOS( 1, "neo-po.bin", 0x00000, 0x020000, CRC(16d0c132) SHA1(4e4a440cae46f3889d20234aebd7f8d5f522e22c) ) /* AES Console (Japan) Bios */
ROM_SYSTEM_BIOS( 2, "devel", "Development System ROM" )
ROM_LOAD16_WORD_SWAP_BIOS( 2, "neodebug.rom", 0x00000, 0x020000, CRC(698ebb7d) SHA1(081c49aa8cc7dad5939833dc1b18338321ea0a07) ) /* Official debug (development) ROM, for home-use base board */
ROM_SYSTEM_BIOS( 3, "unibios31", "Universe Bios (Hack, Ver. 3.1)" )
ROM_LOAD16_WORD_SWAP_BIOS( 3, "uni-bios_3_1.rom", 0x00000, 0x020000, CRC(0c58093f) SHA1(29329a3448c2505e1ff45ffa75e61e9693165153) ) /* Universe Bios v3.1 (hack) */
ROM_SYSTEM_BIOS( 4, "unibios30", "Universe Bios (Hack, Ver. 3.0)" )
ROM_LOAD16_WORD_SWAP_BIOS( 4, "uni-bios_3_0.rom", 0x00000, 0x020000, CRC(a97c89a9) SHA1(97a5eff3b119062f10e31ad6f04fe4b90d366e7f) ) /* Universe Bios v3.0 (hack) */
ROM_SYSTEM_BIOS( 5, "unibios23", "Universe Bios (Hack, Ver. 2.3)" )
ROM_LOAD16_WORD_SWAP_BIOS( 5, "uni-bios_2_3.rom", 0x00000, 0x020000, CRC(27664eb5) SHA1(5b02900a3ccf3df168bdcfc98458136fd2b92ac0) ) /* Universe Bios v2.3 (hack) */
ROM_SYSTEM_BIOS( 6, "unibios23o", "Universe Bios (Hack, Ver. 2.3, older?)" )
ROM_LOAD16_WORD_SWAP_BIOS( 6, "uni-bios_2_3o.rom", 0x00000, 0x020000, CRC(601720ae) SHA1(1b8a72c720cdb5ee3f1d735bbcf447b09204b8d9) ) /* Universe Bios v2.3 (hack) alt version, withdrawn? */
ROM_SYSTEM_BIOS( 7, "unibios22", "Universe Bios (Hack, Ver. 2.2)" )
ROM_LOAD16_WORD_SWAP_BIOS( 7, "uni-bios_2_2.rom", 0x00000, 0x020000, CRC(2d50996a) SHA1(5241a4fb0c63b1a23fd1da8efa9c9a9bd3b4279c) ) /* Universe Bios v2.2 (hack) */
ROM_SYSTEM_BIOS( 8, "unibios21", "Universe Bios (Hack, Ver. 2.1)" )
ROM_LOAD16_WORD_SWAP_BIOS( 8, "uni-bios_2_1.rom", 0x00000, 0x020000, CRC(8dabf76b) SHA1(c23732c4491d966cf0373c65c83c7a4e88f0082c) ) /* Universe Bios v2.1 (hack) */
ROM_SYSTEM_BIOS( 9, "unibios20", "Universe Bios (Hack, Ver. 2.0)" )
ROM_LOAD16_WORD_SWAP_BIOS( 9, "uni-bios_2_0.rom", 0x00000, 0x020000, CRC(0c12c2ad) SHA1(37bcd4d30f3892078b46841d895a6eff16dc921e) ) /* Universe Bios v2.0 (hack) */
ROM_SYSTEM_BIOS(10, "unibios13", "Universe Bios (Hack, Ver. 1.3)" )
ROM_LOAD16_WORD_SWAP_BIOS(10, "uni-bios_1_3.rom", 0x00000, 0x020000, CRC(b24b44a0) SHA1(eca8851d30557b97c309a0d9f4a9d20e5b14af4e) ) /* Universe Bios v1.3 (hack) - note: versions older than 1.3 don't support AES hardware */
ROM_LOAD16_WORD_SWAP_BIOS( 2, "neodebug.rom", 0x00000, 0x020000, CRC(698ebb7d) SHA1(081c49aa8cc7dad5939833dc1b18338321ea0a07) ) /* Official debug (development) ROM, for home-use base board */
NEOGEO_UNIBIOS(3)
ROM_REGION( 0x200000, "maincpu", ROMREGION_ERASEFF )

View File

@ -23,7 +23,7 @@ If the output isn't satisfactory, it prints "I/O BOARD FAILURE".
#include "emu.h"
#include "cpu/i386/i386.h"
#include "machine/pcshare.h"
#include "video/pc_vga.h"
#include "bus/isa/trident.h"
#include "machine/bankdev.h"
#include "machine/ds128x.h"
#include "machine/ins8250.h"
@ -56,7 +56,7 @@ WRITE8_MEMBER(pcat_dyn_state::bank2_w)
static ADDRESS_MAP_START( pcat_map, AS_PROGRAM, 32, pcat_dyn_state )
AM_RANGE(0x00000000, 0x0009ffff) AM_RAM
AM_RANGE(0x000a0000, 0x000bffff) AM_DEVREADWRITE8("vga", vga_device, mem_r, mem_w, 0xffffffff)
AM_RANGE(0x000a0000, 0x000bffff) AM_DEVREADWRITE8("vga", trident_vga_device, mem_r, mem_w, 0xffffffff)
AM_RANGE(0x000c0000, 0x000c7fff) AM_ROM AM_REGION("video_bios", 0)
AM_RANGE(0x000d0000, 0x000d0fff) AM_ROM AM_REGION("game_prg", 0x0000) AM_WRITE8(bank1_w, 0xffffffff)
AM_RANGE(0x000d1000, 0x000d1fff) AM_ROM AM_REGION("game_prg", 0x1000) AM_WRITE8(bank2_w, 0xffffffff)
@ -70,9 +70,9 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( pcat_io, AS_IO, 32, pcat_dyn_state )
AM_IMPORT_FROM(pcat32_io_common)
AM_RANGE(0x03b0, 0x03bf) AM_DEVREADWRITE8("vga", vga_device, port_03b0_r, port_03b0_w, 0xffffffff)
AM_RANGE(0x03c0, 0x03cf) AM_DEVREADWRITE8("vga", vga_device, port_03c0_r, port_03c0_w, 0xffffffff)
AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff)
AM_RANGE(0x03b0, 0x03bf) AM_DEVREADWRITE8("vga", trident_vga_device, port_03b0_r, port_03b0_w, 0xffffffff)
AM_RANGE(0x03c0, 0x03cf) AM_DEVREADWRITE8("vga", trident_vga_device, port_03c0_r, port_03c0_w, 0xffffffff)
AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", trident_vga_device, port_03d0_r, port_03d0_w, 0xffffffff)
AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8("ns16550", ns16550_device, ins8250_r, ins8250_w, 0xffffffff)
ADDRESS_MAP_END
@ -126,7 +126,7 @@ static MACHINE_CONFIG_START( pcat_dyn, pcat_dyn_state )
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic8259_1", pic8259_device, inta_cb)
/* video hardware */
MCFG_FRAGMENT_ADD( pcvideo_vga )
MCFG_FRAGMENT_ADD( pcvideo_trident_vga )
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_REFRESH_RATE(60)

View File

@ -416,6 +416,7 @@ void ssem_state::glyph_print(bitmap_rgb32 &bitmap, INT32 x, INT32 y, Format &&fm
{
const rectangle &visarea = m_screen->visible_area();
m_glyph_print_buf.clear();
m_glyph_print_buf.seekp(0, util::ovectorstream::beg);
util::stream_format(m_glyph_print_buf, std::forward<Format>(fmt), std::forward<Params>(args)...);
m_glyph_print_buf.put('\0');

View File

@ -22,9 +22,17 @@
#include "formats/svi_cas.h"
#include "bus/generic/slot.h"
#include "bus/generic/carts.h"
#include "bus/svi3x8/expander/expander.h"
#include "softlist.h"
//**************************************************************************
// CONSTANTS & MACROS
//**************************************************************************
#define IS_SVI328 (m_ram->size() == 64 * 1024)
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@ -39,18 +47,32 @@ public:
m_basic(*this, "basic"),
m_speaker(*this, "speaker"),
m_cassette(*this, "cassette"),
m_cart(*this, "cartslot"),
m_cart_rom(*this, "cartslot"),
m_expander(*this, "exp"),
m_keyboard(*this, "KEY"),
m_buttons(*this, "BUTTONS"),
m_intvdp(0), m_intexp(0),
m_romdis(1), m_ramdis(1),
m_cart(1), m_bk21(1),
m_keyboard_row(0)
{}
DECLARE_READ8_MEMBER( ppi_port_a_r );
DECLARE_READ8_MEMBER( ppi_port_b_r );
DECLARE_WRITE8_MEMBER( ppi_port_c_w );
DECLARE_WRITE8_MEMBER( psg_port_b_w );
DECLARE_WRITE8_MEMBER( bank_w );
DECLARE_WRITE_LINE_MEMBER( intvdp_w );
READ8_MEMBER( page1_r );
WRITE8_MEMBER( page1_w );
READ8_MEMBER( page2_r );
WRITE8_MEMBER( page2_w );
// from expander bus
DECLARE_WRITE_LINE_MEMBER( intexp_w );
DECLARE_WRITE_LINE_MEMBER( romdis_w );
DECLARE_WRITE_LINE_MEMBER( ramdis_w );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cartridge);
protected:
@ -58,17 +80,23 @@ protected:
virtual void machine_reset() override;
private:
void reset_memory_configuration();
required_device<cpu_device> m_maincpu;
required_device<ram_device> m_ram;
required_memory_region m_basic;
required_device<speaker_sound_device> m_speaker;
required_device<cassette_image_device> m_cassette;
required_device<generic_slot_device> m_cart;
required_device<generic_slot_device> m_cart_rom;
required_device<svi_expander_device> m_expander;
required_ioport_array<16> m_keyboard;
required_ioport m_buttons;
int m_intvdp;
int m_intexp;
int m_romdis;
int m_ramdis;
int m_cart;
int m_bk21;
UINT8 m_keyboard_row;
};
@ -79,10 +107,13 @@ private:
static ADDRESS_MAP_START( svi3x8_mem, AS_PROGRAM, 8, svi3x8_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000, 0x7fff) AM_READWRITE(page1_r, page1_w)
AM_RANGE(0x8000, 0xffff) AM_READWRITE(page2_r, page2_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( svi3x8_io, AS_IO, 8, svi3x8_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x7f) AM_DEVREADWRITE("exp", svi_expander_device, iorq_r, iorq_w)
AM_RANGE(0x80, 0x80) AM_MIRROR(0x22) AM_DEVWRITE("vdp", tms9928a_device, vram_write)
AM_RANGE(0x81, 0x81) AM_MIRROR(0x22) AM_DEVWRITE("vdp", tms9928a_device, register_write)
AM_RANGE(0x84, 0x84) AM_MIRROR(0x22) AM_DEVREAD("vdp", tms9928a_device, vram_read)
@ -261,7 +292,8 @@ WRITE_LINE_MEMBER( svi3x8_state::intvdp_w )
{
// note: schematics show a CNTRL line that allows switching between
// IRQ and NMI for the interrupt
m_maincpu->set_input_line(INPUT_LINE_IRQ0, state);
m_intvdp = state;
m_maincpu->set_input_line(INPUT_LINE_IRQ0, (m_intvdp || m_intexp) ? ASSERT_LINE : CLEAR_LINE);
}
@ -269,69 +301,90 @@ WRITE_LINE_MEMBER( svi3x8_state::intvdp_w )
// MACHINE EMULATION
//**************************************************************************
void svi3x8_state::reset_memory_configuration()
{
m_maincpu->space(AS_PROGRAM).install_rom(0x0000, 0x7fff, m_basic->base());
if (m_ram->size() == 64 * 1024)
{
// SVI-328
m_maincpu->space(AS_PROGRAM).install_ram(0x8000, 0xffff, m_ram->pointer());
}
else
{
// SVI-318
m_maincpu->space(AS_PROGRAM).unmap_readwrite(0x8000, 0xbfff);
m_maincpu->space(AS_PROGRAM).install_ram(0xc000, 0xffff, m_ram->pointer());
}
}
void svi3x8_state::machine_start()
{
// register for save states
save_item(NAME(m_intvdp));
save_item(NAME(m_intexp));
save_item(NAME(m_romdis));
save_item(NAME(m_ramdis));
save_item(NAME(m_cart));
save_item(NAME(m_bk21));
save_item(NAME(m_keyboard_row));
}
void svi3x8_state::machine_reset()
{
reset_memory_configuration();
m_intvdp = 0;
m_intexp = 0;
m_romdis = 1;
m_ramdis = 1;
m_cart = 1;
m_bk21 = 1;
}
WRITE8_MEMBER( svi3x8_state::psg_port_b_w )
READ8_MEMBER( svi3x8_state::page1_r)
{
reset_memory_configuration();
if (m_cart == 0)
return m_cart_rom->exists() ? m_cart_rom->read_rom(space, offset) : 0xff;
// CART
if (BIT(data, 0) == 0)
{
if (m_cart->exists())
m_maincpu->space(AS_PROGRAM).install_rom(0x0000, 0x7fff, m_cart->get_rom_base());
else
m_maincpu->space(AS_PROGRAM).unmap_readwrite(0x0000, 0x7fff);
}
else
{
// BK21 (SV-328)
if (BIT(data, 1) == 0)
{
if (m_ram->size() == 64 * 1024)
m_maincpu->space(AS_PROGRAM).install_ram(0x0000, 0x7fff, m_ram->pointer() + 0x8000);
else
m_maincpu->space(AS_PROGRAM).unmap_readwrite(0x0000, 0x7fff);
}
UINT8 data = m_expander->mreq_r(space, offset);
// BK22 (SV-807)
if (BIT(data, 2) == 0)
m_maincpu->space(AS_PROGRAM).unmap_readwrite(0x8000, 0xffff);
if (m_romdis == 1)
data = m_basic->u8(offset);
// BK31 (SV-807)
if (BIT(data, 3) == 0)
m_maincpu->space(AS_PROGRAM).unmap_readwrite(0x0000, 0x7fff);
if (m_bk21 == 0 && IS_SVI328)
data = m_ram->read(offset);
// BK32 (SV-807)
if (BIT(data, 4) == 0)
m_maincpu->space(AS_PROGRAM).unmap_readwrite(0x8000, 0xffff);
}
return data;
}
WRITE8_MEMBER( svi3x8_state::page1_w)
{
if (m_cart == 0)
return;
m_expander->mreq_w(space, offset, data);
if (m_bk21 == 0 && IS_SVI328)
m_ram->write(offset, data);
}
READ8_MEMBER( svi3x8_state::page2_r)
{
offset += 0x8000;
UINT8 data = m_expander->mreq_r(space, offset);
if (m_ramdis == 1 && (offset >= 0x4000 || IS_SVI328))
return m_ram->read(IS_SVI328 ? offset : offset - 0xc000);
return data;
}
WRITE8_MEMBER( svi3x8_state::page2_w )
{
offset += 0x8000;
m_expander->mreq_w(space, offset, data);
if (m_ramdis == 1 && (offset >= 0x4000 || IS_SVI328))
m_ram->write(IS_SVI328 ? offset : offset - 0xc000, data);
}
WRITE8_MEMBER( svi3x8_state::bank_w )
{
logerror("bank_w: %02x\n", data);
m_cart = BIT(data, 0);
m_bk21 = BIT(data, 1);
m_expander->bk21_w(BIT(data, 1));
m_expander->bk22_w(BIT(data, 2));
m_expander->bk31_w(BIT(data, 3));
m_expander->bk32_w(BIT(data, 4));
// TODO: handle ROM2/ROM3 enable (bit 6 + 7)
output().set_value("led_caps_lock", BIT(data, 5));
}
@ -372,6 +425,22 @@ WRITE8_MEMBER( svi3x8_state::ppi_port_c_w )
m_speaker->level_w(BIT(data, 7));
}
WRITE_LINE_MEMBER( svi3x8_state::intexp_w )
{
m_intexp = state;
m_maincpu->set_input_line(INPUT_LINE_IRQ0, (m_intvdp || m_intexp) ? ASSERT_LINE : CLEAR_LINE);
}
WRITE_LINE_MEMBER( svi3x8_state::romdis_w )
{
m_romdis = state;
}
WRITE_LINE_MEMBER( svi3x8_state::ramdis_w )
{
m_ramdis = state;
}
//**************************************************************************
// CARTRIDGE
@ -379,7 +448,7 @@ WRITE8_MEMBER( svi3x8_state::ppi_port_c_w )
DEVICE_IMAGE_LOAD_MEMBER( svi3x8_state, cartridge )
{
UINT32 size = m_cart->common_get_size("rom");
UINT32 size = m_cart_rom->common_get_size("rom");
if (size != 0x8000)
{
@ -387,8 +456,8 @@ DEVICE_IMAGE_LOAD_MEMBER( svi3x8_state, cartridge )
return IMAGE_INIT_FAIL;
}
m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
m_cart_rom->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
m_cart_rom->common_load_rom(m_cart_rom->get_rom_base(), size, "rom");
return IMAGE_INIT_PASS;
}
@ -427,7 +496,7 @@ static MACHINE_CONFIG_START( svi318, svi3x8_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MCFG_SOUND_ADD("psg", AY8910, XTAL_10_738635MHz / 6)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("JOY"))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(svi3x8_state, psg_port_b_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(svi3x8_state, bank_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
// cassette
@ -442,6 +511,12 @@ static MACHINE_CONFIG_START( svi318, svi3x8_state )
MCFG_GENERIC_EXTENSIONS("bin,rom")
MCFG_GENERIC_LOAD(svi3x8_state, cartridge)
MCFG_SOFTWARE_LIST_ADD("cart_list", "svi318_cart")
// expander bus
MCFG_SVI_EXPANDER_BUS_ADD("exp")
MCFG_SVI_EXPANDER_INT_HANDLER(WRITELINE(svi3x8_state, intexp_w))
MCFG_SVI_EXPANDER_ROMDIS_HANDLER(WRITELINE(svi3x8_state, romdis_w))
MCFG_SVI_EXPANDER_RAMDIS_HANDLER(WRITELINE(svi3x8_state, ramdis_w))
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( svi318n, svi318 )

View File

@ -386,6 +386,34 @@ ADDRESS_MAP_EXTERN(neogeo_main_map,16);
#define ROM_LOAD16_WORD_SWAP_BIOS(bios,name,offset,length,hash) \
ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(bios+1)) /* Note '+1' */
#define NEOGEO_UNIBIOS(x) \
ROM_SYSTEM_BIOS( x+ 0, "unibios32", "Universe Bios (Hack, Ver. 3.2)" ) \
ROM_LOAD16_WORD_SWAP_BIOS( x+ 0, "uni-bios_3_2.rom", 0x00000, 0x020000, CRC(a4e8b9b3) SHA1(c92f18c3f1edda543d264ecd0ea915240e7c8258) ) /* Universe Bios v3.2 (hack) */ \
ROM_SYSTEM_BIOS( x+ 1, "unibios31", "Universe Bios (Hack, Ver. 3.1)" ) \
ROM_LOAD16_WORD_SWAP_BIOS( x+ 1, "uni-bios_3_1.rom", 0x00000, 0x020000, CRC(0c58093f) SHA1(29329a3448c2505e1ff45ffa75e61e9693165153) ) /* Universe Bios v3.1 (hack) */ \
ROM_SYSTEM_BIOS( x+ 2, "unibios30", "Universe Bios (Hack, Ver. 3.0)" ) \
ROM_LOAD16_WORD_SWAP_BIOS( x+ 2, "uni-bios_3_0.rom", 0x00000, 0x020000, CRC(a97c89a9) SHA1(97a5eff3b119062f10e31ad6f04fe4b90d366e7f) ) /* Universe Bios v3.0 (hack) */ \
ROM_SYSTEM_BIOS( x+ 3, "unibios23", "Universe Bios (Hack, Ver. 2.3)" ) \
ROM_LOAD16_WORD_SWAP_BIOS( x+ 3, "uni-bios_2_3.rom", 0x00000, 0x020000, CRC(27664eb5) SHA1(5b02900a3ccf3df168bdcfc98458136fd2b92ac0) ) /* Universe Bios v2.3 (hack) */ \
ROM_SYSTEM_BIOS( x+ 4, "unibios23o", "Universe Bios (Hack, Ver. 2.3, older?)" ) \
ROM_LOAD16_WORD_SWAP_BIOS( x+ 4, "uni-bios_2_3o.rom", 0x00000, 0x020000, CRC(601720ae) SHA1(1b8a72c720cdb5ee3f1d735bbcf447b09204b8d9) ) /* Universe Bios v2.3 (hack) alt version, withdrawn? */ \
ROM_SYSTEM_BIOS( x+ 5, "unibios22", "Universe Bios (Hack, Ver. 2.2)" ) \
ROM_LOAD16_WORD_SWAP_BIOS( x+ 5, "uni-bios_2_2.rom", 0x00000, 0x020000, CRC(2d50996a) SHA1(5241a4fb0c63b1a23fd1da8efa9c9a9bd3b4279c) ) /* Universe Bios v2.2 (hack) */ \
ROM_SYSTEM_BIOS( x+ 6, "unibios21", "Universe Bios (Hack, Ver. 2.1)" ) \
ROM_LOAD16_WORD_SWAP_BIOS( x+ 6, "uni-bios_2_1.rom", 0x00000, 0x020000, CRC(8dabf76b) SHA1(c23732c4491d966cf0373c65c83c7a4e88f0082c) ) /* Universe Bios v2.1 (hack) */ \
ROM_SYSTEM_BIOS( x+ 7, "unibios20", "Universe Bios (Hack, Ver. 2.0)" ) \
ROM_LOAD16_WORD_SWAP_BIOS( x+ 7, "uni-bios_2_0.rom", 0x00000, 0x020000, CRC(0c12c2ad) SHA1(37bcd4d30f3892078b46841d895a6eff16dc921e) ) /* Universe Bios v2.0 (hack) */ \
ROM_SYSTEM_BIOS( x+ 8, "unibios13", "Universe Bios (Hack, Ver. 1.3)" ) \
ROM_LOAD16_WORD_SWAP_BIOS( x+ 8, "uni-bios_1_3.rom", 0x00000, 0x020000, CRC(b24b44a0) SHA1(eca8851d30557b97c309a0d9f4a9d20e5b14af4e) ) /* Universe Bios v1.3 (hack) */ \
ROM_SYSTEM_BIOS( x+ 9, "unibios12", "Universe Bios (Hack, Ver. 1.2)" ) \
ROM_LOAD16_WORD_SWAP_BIOS( x+ 9, "uni-bios_1_2.rom", 0x00000, 0x020000, CRC(4fa698e9) SHA1(682e13ec1c42beaa2d04473967840c88fd52c75a) ) /* Universe Bios v1.2 (hack) */ \
ROM_SYSTEM_BIOS( x+10, "unibios12o", "Universe Bios (Hack, Ver. 1.2, older)" ) \
ROM_LOAD16_WORD_SWAP_BIOS( x+10, "uni-bios_1_2o.rom", 0x00000, 0x020000, CRC(e19d3ce9) SHA1(af88ef837f44a3af2d7144bb46a37c8512b67770) ) /* Universe Bios v1.2 (hack) alt version */ \
ROM_SYSTEM_BIOS( x+11, "unibios11", "Universe Bios (Hack, Ver. 1.1)" ) \
ROM_LOAD16_WORD_SWAP_BIOS( x+11, "uni-bios_1_1.rom", 0x00000, 0x020000, CRC(5dda0d84) SHA1(4153d533c02926a2577e49c32657214781ff29b7) ) /* Universe Bios v1.1 (hack) */ \
ROM_SYSTEM_BIOS( x+12, "unibios10", "Universe Bios (Hack, Ver. 1.0)" ) \
ROM_LOAD16_WORD_SWAP_BIOS( x+12, "uni-bios_1_0.rom", 0x00000, 0x020000, CRC(0ce453a0) SHA1(3b4c0cd26c176fc6b26c3a2f95143dd478f6abf9) ) /* Universe Bios v1.0 (hack) */
#define NEOGEO_BIOS \
ROM_REGION16_BE( 0x80000, "mainbios", 0 ) \
ROM_SYSTEM_BIOS( 0, "euro", "Europe MVS (Ver. 2)" ) \
@ -398,7 +426,7 @@ ADDRESS_MAP_EXTERN(neogeo_main_map,16);
ROM_SYSTEM_BIOS( 3, "us-e", "US MVS (Ver. 1)" ) \
ROM_LOAD16_WORD_SWAP_BIOS( 3, "sp-e.sp1", 0x00000, 0x020000, CRC(2723a5b5) SHA1(5dbff7531cf04886cde3ef022fb5ca687573dcb8) ) /* US, 6 Slot (V5?) */ \
ROM_SYSTEM_BIOS( 4, "us-v2", "US MVS (4 slot, Ver 2)" ) \
ROM_LOAD16_WORD_SWAP_BIOS(4, "v2.bin", 0x00000, 0x020000, CRC(62f021f4) SHA1(62d372269e1b3161c64ae21123655a0a22ffd1bb) ) /* US, 4 slot */ \
ROM_LOAD16_WORD_SWAP_BIOS( 4, "v2.bin", 0x00000, 0x020000, CRC(62f021f4) SHA1(62d372269e1b3161c64ae21123655a0a22ffd1bb) ) /* US, 4 slot */ \
\
ROM_SYSTEM_BIOS( 5, "asia", "Asia MVS (Ver. 3)" ) \
ROM_LOAD16_WORD_SWAP_BIOS( 5, "asia-s3.rom", 0x00000, 0x020000, CRC(91b64be3) SHA1(720a3e20d26818632aedf2c2fd16c54f213543e1) ) /* Asia */ \
@ -412,36 +440,11 @@ ADDRESS_MAP_EXTERN(neogeo_main_map,16);
ROM_SYSTEM_BIOS( 9, "mv1c", "NEO-MVH MV1C" ) \
ROM_LOAD16_WORD_SWAP_BIOS( 9, "sp-45.sp1", 0x00000, 0x080000, CRC(03cc9f6a) SHA1(cdf1f49e3ff2bac528c21ed28449cf35b7957dc1) ) /* Latest Asia bios */ \
ROM_SYSTEM_BIOS( 10, "japan-j3", "Japan MVS (J3)" ) \
ROM_LOAD16_WORD_SWAP_BIOS( 10, "japan-j3.bin", 0x00000, 0x020000, CRC(dff6d41f) SHA1(e92910e20092577a4523a6b39d578a71d4de7085) ) /* Latest Japan bios; correct chip label unknown */ \
ROM_SYSTEM_BIOS(11, "japan-hotel", "Custom Japanese Hotel" ) \
ROM_LOAD16_WORD_SWAP_BIOS(11, "sp-1v1_3db8c.bin", 0x00000, 0x020000, CRC(162f0ebe) SHA1(fe1c6dd3dfcf97d960065b1bb46c1e11cb7bf271) ) /* 'rare MVS found in japanese hotels' shows v1.3 in test mode */ \
ROM_LOAD16_WORD_SWAP_BIOS( 10, "japan-j3.bin", 0x00000, 0x020000, CRC(dff6d41f) SHA1(e92910e20092577a4523a6b39d578a71d4de7085) ) /* Latest Japan bios; correct chip label unknown */ \
ROM_SYSTEM_BIOS( 11, "japan-hotel", "Custom Japanese Hotel" ) \
ROM_LOAD16_WORD_SWAP_BIOS( 11, "sp-1v1_3db8c.bin", 0x00000, 0x020000, CRC(162f0ebe) SHA1(fe1c6dd3dfcf97d960065b1bb46c1e11cb7bf271) ) /* 'rare MVS found in japanese hotels' shows v1.3 in test mode */ \
\
ROM_SYSTEM_BIOS(12, "unibios31", "Universe Bios (Hack, Ver. 3.1)" ) \
ROM_LOAD16_WORD_SWAP_BIOS(12, "uni-bios_3_1.rom", 0x00000, 0x020000, CRC(0c58093f) SHA1(29329a3448c2505e1ff45ffa75e61e9693165153) ) /* Universe Bios v3.1 (hack) */ \
ROM_SYSTEM_BIOS(13, "unibios30", "Universe Bios (Hack, Ver. 3.0)" ) \
ROM_LOAD16_WORD_SWAP_BIOS(13, "uni-bios_3_0.rom", 0x00000, 0x020000, CRC(a97c89a9) SHA1(97a5eff3b119062f10e31ad6f04fe4b90d366e7f) ) /* Universe Bios v3.0 (hack) */ \
ROM_SYSTEM_BIOS(14, "unibios23", "Universe Bios (Hack, Ver. 2.3)" ) \
ROM_LOAD16_WORD_SWAP_BIOS(14, "uni-bios_2_3.rom", 0x00000, 0x020000, CRC(27664eb5) SHA1(5b02900a3ccf3df168bdcfc98458136fd2b92ac0) ) /* Universe Bios v2.3 (hack) */ \
ROM_SYSTEM_BIOS(15, "unibios23o", "Universe Bios (Hack, Ver. 2.3, older?)" ) \
ROM_LOAD16_WORD_SWAP_BIOS(15, "uni-bios_2_3o.rom", 0x00000, 0x020000, CRC(601720ae) SHA1(1b8a72c720cdb5ee3f1d735bbcf447b09204b8d9) ) /* Universe Bios v2.3 (hack) alt version, withdrawn? */ \
ROM_SYSTEM_BIOS(16, "unibios22", "Universe Bios (Hack, Ver. 2.2)" ) \
ROM_LOAD16_WORD_SWAP_BIOS(16, "uni-bios_2_2.rom", 0x00000, 0x020000, CRC(2d50996a) SHA1(5241a4fb0c63b1a23fd1da8efa9c9a9bd3b4279c) ) /* Universe Bios v2.2 (hack) */ \
ROM_SYSTEM_BIOS(17, "unibios21", "Universe Bios (Hack, Ver. 2.1)" ) \
ROM_LOAD16_WORD_SWAP_BIOS(17, "uni-bios_2_1.rom", 0x00000, 0x020000, CRC(8dabf76b) SHA1(c23732c4491d966cf0373c65c83c7a4e88f0082c) ) /* Universe Bios v2.1 (hack) */ \
ROM_SYSTEM_BIOS(18, "unibios20", "Universe Bios (Hack, Ver. 2.0)" ) \
ROM_LOAD16_WORD_SWAP_BIOS(18, "uni-bios_2_0.rom", 0x00000, 0x020000, CRC(0c12c2ad) SHA1(37bcd4d30f3892078b46841d895a6eff16dc921e) ) /* Universe Bios v2.0 (hack) */ \
ROM_SYSTEM_BIOS(19, "unibios13", "Universe Bios (Hack, Ver. 1.3)" ) \
ROM_LOAD16_WORD_SWAP_BIOS(19, "uni-bios_1_3.rom", 0x00000, 0x020000, CRC(b24b44a0) SHA1(eca8851d30557b97c309a0d9f4a9d20e5b14af4e) ) /* Universe Bios v1.3 (hack) */ \
ROM_SYSTEM_BIOS(20, "unibios12", "Universe Bios (Hack, Ver. 1.2)" ) \
ROM_LOAD16_WORD_SWAP_BIOS(20, "uni-bios_1_2.rom", 0x00000, 0x020000, CRC(4fa698e9) SHA1(682e13ec1c42beaa2d04473967840c88fd52c75a) ) /* Universe Bios v1.2 (hack) */ \
ROM_SYSTEM_BIOS(21, "unibios12o", "Universe Bios (Hack, Ver. 1.2, older)" ) \
ROM_LOAD16_WORD_SWAP_BIOS(21, "uni-bios_1_2o.rom", 0x00000, 0x020000, CRC(e19d3ce9) SHA1(af88ef837f44a3af2d7144bb46a37c8512b67770) ) /* Universe Bios v1.2 (hack) alt version */ \
ROM_SYSTEM_BIOS(22, "unibios11", "Universe Bios (Hack, Ver. 1.1)" ) \
ROM_LOAD16_WORD_SWAP_BIOS(22, "uni-bios_1_1.rom", 0x00000, 0x020000, CRC(5dda0d84) SHA1(4153d533c02926a2577e49c32657214781ff29b7) ) /* Universe Bios v1.1 (hack) */ \
ROM_SYSTEM_BIOS(23, "unibios10", "Universe Bios (Hack, Ver. 1.0)" ) \
ROM_LOAD16_WORD_SWAP_BIOS(23, "uni-bios_1_0.rom", 0x00000, 0x020000, CRC(0ce453a0) SHA1(3b4c0cd26c176fc6b26c3a2f95143dd478f6abf9) ) /* Universe Bios v1.0 (hack) */
NEOGEO_UNIBIOS(12)
#define NEO_BIOS_AUDIO_64K(name, hash) \

View File

@ -50,10 +50,6 @@ public:
virtual error read(void *buffer, std::uint64_t offset, std::uint32_t count, std::uint32_t &actual) override
{
#if defined(EMSCRIPTEN)
m_listening = false;
return error::FAILURE; // TODO: work out what it dislikes about emscripten
#else
fd_set readfds;
FD_ZERO(&readfds);
FD_SET(m_sock, &readfds);
@ -107,7 +103,6 @@ public:
{
return error::FAILURE;
}
#endif
}
virtual error write(void const *buffer, std::uint64_t offset, std::uint32_t count, std::uint32_t &actual) override

View File

@ -1,5 +1,5 @@
// license:BSD-3-Clause
// copyright-holders:Olivier Galibert, R. Belmont
// copyright-holders:Olivier Galibert, R. Belmont, Vas Crabb
/*
* font_osx.c
*

View File

@ -1,5 +1,5 @@
// license:BSD-3-Clause
// copyright-holders:Olivier Galibert, R. Belmont
// copyright-holders:Olivier Galibert, R. Belmont, Vas Crabb
/*
* font_sdl.c
*
@ -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 <SDL_ttf.h>
#else
#include <SDL2/SDL_ttf.h>
#ifndef SDLMAME_HAIKU
#endif
#if !defined(SDLMAME_HAIKU) && !defined(SDLMAME_EMSCRIPTEN)
#include <fontconfig/fontconfig.h>
#endif
@ -52,11 +56,11 @@ private:
static constexpr double POINT_SIZE = 144.0;
#ifndef SDLMAME_HAIKU
TTF_Font_ptr search_font_config(std::string const &name, bool bold, bool italic, bool underline, bool &bakedstyles);
#if !defined(SDLMAME_HAIKU) && !defined(SDLMAME_EMSCRIPTEN)
TTF_Font_ptr search_font_config(std::string const &family, std::string const &style, bool &bakedstyles);
#endif
bool BDF_Check_Magic(std::string const &name);
TTF_Font_ptr TTF_OpenFont_Magic(std::string const &name, int fsize);
TTF_Font_ptr TTF_OpenFont_Magic(std::string const &name, int fsize, long index);
TTF_Font_ptr m_font;
};
@ -65,42 +69,42 @@ bool osd_font_sdl::open(std::string const &font_path, std::string const &_name,
{
bool bakedstyles = false;
// accept qualifiers from the name
std::string name(_name);
if (name.compare("default") == 0)
{
name = "Liberation Sans";
name = "Liberation Sans|Regular";
}
bool const bold = (strreplace(name, "[B]", "") + strreplace(name, "[b]", "") > 0);
bool const italic = (strreplace(name, "[I]", "") + strreplace(name, "[i]", "") > 0);
// accept qualifiers from the name
bool const underline = (strreplace(name, "[U]", "") + strreplace(name, "[u]", "") > 0);
bool const strike = (strreplace(name, "[S]", "") + strreplace(name, "[s]", "") > 0);
std::string::size_type const separator = name.rfind('|');
std::string const family(name.substr(0, separator));
std::string const style((std::string::npos != separator) ? name.substr(separator + 1) : std::string());
// first up, try it as a filename
TTF_Font_ptr font = TTF_OpenFont_Magic(name, POINT_SIZE);
TTF_Font_ptr font = TTF_OpenFont_Magic(family, POINT_SIZE, 0);
// if no success, try the font path
if (!font)
{
osd_printf_verbose("Searching font %s in -%s\n", name.c_str(), OPTION_FONTPATH);
osd_printf_verbose("Searching font %s in -%s\n", family.c_str(), OPTION_FONTPATH);
//emu_file file(options().font_path(), OPEN_FLAG_READ);
emu_file file(font_path.c_str(), OPEN_FLAG_READ);
if (file.open(name.c_str()) == osd_file::error::NONE)
if (file.open(family.c_str()) == osd_file::error::NONE)
{
std::string full_name = file.fullpath();
font = TTF_OpenFont_Magic(full_name, POINT_SIZE);
font = TTF_OpenFont_Magic(full_name, POINT_SIZE, 0);
if (font)
osd_printf_verbose("Found font %s\n", full_name.c_str());
}
}
// 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);
font = search_font_config(family, style, bakedstyles);
}
#endif
@ -114,21 +118,21 @@ bool osd_font_sdl::open(std::string const &font_path, std::string const &_name,
}
// apply styles
int style = 0;
int styleflags = 0;
if (!bakedstyles)
{
style |= bold ? TTF_STYLE_BOLD : 0;
style |= italic ? TTF_STYLE_ITALIC : 0;
if ((style.find("Bold") != std::string::npos) || (style.find("Black") != std::string::npos)) styleflags |= TTF_STYLE_BOLD;
if ((style.find("Italic") != std::string::npos) || (style.find("Oblique") != std::string::npos)) styleflags |= TTF_STYLE_ITALIC;
}
style |= underline ? TTF_STYLE_UNDERLINE : 0;
styleflags |= underline ? TTF_STYLE_UNDERLINE : 0;
// SDL_ttf 2.0.9 and earlier does not define TTF_STYLE_STRIKETHROUGH
#if SDL_VERSIONNUM(TTF_MAJOR_VERSION, TTF_MINOR_VERSION, TTF_PATCHLEVEL) > SDL_VERSIONNUM(2,0,9)
style |= strike ? TTF_STYLE_STRIKETHROUGH : 0;
styleflags |= strike ? TTF_STYLE_STRIKETHROUGH : 0;
#else
if (strike)
osd_printf_warning("Ignoring strikethrough for SDL_TTF older than 2.0.10\n");
#endif // PATCHLEVEL
TTF_SetFontStyle(font.get(), style);
TTF_SetFontStyle(font.get(), styleflags);
height = TTF_FontLineSkip(font.get());
@ -157,9 +161,9 @@ void osd_font_sdl::close()
bool osd_font_sdl::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs)
{
SDL_Color const fcol = { 0xff, 0xff, 0xff };
std::uint16_t ustr[16];
ustr[utf16_from_uchar(ustr, ARRAY_LENGTH(ustr), chnum)] = 0;
std::unique_ptr<SDL_Surface, void (*)(SDL_Surface *)> const drawsurf(TTF_RenderUNICODE_Solid(m_font.get(), ustr, fcol), &SDL_FreeSurface);
char ustr[16];
ustr[utf8_from_uchar(ustr, ARRAY_LENGTH(ustr), chnum)] = '\0';
std::unique_ptr<SDL_Surface, void (*)(SDL_Surface *)> const drawsurf(TTF_RenderUTF8_Solid(m_font.get(), ustr, fcol), &SDL_FreeSurface);
// was nothing returned?
if (drawsurf)
@ -187,18 +191,26 @@ bool osd_font_sdl::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::in
return bitmap.valid();
}
osd_font_sdl::TTF_Font_ptr osd_font_sdl::TTF_OpenFont_Magic(std::string const &name, int fsize)
osd_font_sdl::TTF_Font_ptr osd_font_sdl::TTF_OpenFont_Magic(std::string const &name, int fsize, long index)
{
emu_file file(OPEN_FLAG_READ);
if (file.open(name.c_str()) == osd_file::error::NONE)
{
unsigned char const magic[] = { 0x00, 0x01, 0x00, 0x00, 0x00 };
unsigned char buffer[sizeof(magic)] = { 0xff, 0xff, 0xff, 0xff, 0xff };
if ((sizeof(magic) != file.read(buffer, sizeof(magic))) || memcmp(buffer, magic, sizeof(magic)))
return TTF_Font_ptr(nullptr, &TTF_CloseFont);
unsigned char const ttf_magic[] = { 0x00, 0x01, 0x00, 0x00, 0x00 };
unsigned char const ttc1_magic[] = { 0x74, 0x74, 0x63, 0x66, 0x00, 0x01, 0x00, 0x00 };
unsigned char const ttc2_magic[] = { 0x74, 0x74, 0x63, 0x66, 0x00, 0x02, 0x00, 0x00 };
unsigned char buffer[std::max({ sizeof(ttf_magic), sizeof(ttc1_magic), sizeof(ttc2_magic) })];
auto const bytes_read = file.read(buffer, sizeof(buffer));
file.close();
if ((bytes_read >= sizeof(ttf_magic)) && !std::memcmp(buffer, ttf_magic, sizeof(ttf_magic)))
return TTF_Font_ptr(TTF_OpenFont(name.c_str(), POINT_SIZE), &TTF_CloseFont);
if (((bytes_read >= sizeof(ttc1_magic)) && !std::memcmp(buffer, ttc1_magic, sizeof(ttc1_magic))) ||
((bytes_read >= sizeof(ttc2_magic)) && !std::memcmp(buffer, ttc2_magic, sizeof(ttc2_magic))))
return TTF_Font_ptr(TTF_OpenFontIndex(name.c_str(), POINT_SIZE, index), &TTF_CloseFont);
}
return TTF_Font_ptr(TTF_OpenFont(name.c_str(), POINT_SIZE), &TTF_CloseFont);
return TTF_Font_ptr(nullptr, &TTF_CloseFont);
}
bool osd_font_sdl::BDF_Check_Magic(std::string const &name)
@ -214,36 +226,24 @@ bool osd_font_sdl::BDF_Check_Magic(std::string const &name)
return false;
}
#ifndef SDLMAME_HAIKU
osd_font_sdl::TTF_Font_ptr osd_font_sdl::search_font_config(std::string const &name, bool bold, bool italic, bool underline, bool &bakedstyles)
#if !defined(SDLMAME_HAIKU) && !defined(SDLMAME_EMSCRIPTEN)
osd_font_sdl::TTF_Font_ptr osd_font_sdl::search_font_config(std::string const &family, std::string const &style, bool &bakedstyles)
{
TTF_Font_ptr font(nullptr, &TTF_CloseFont);
FcConfig *const config = FcConfigGetCurrent();
std::unique_ptr<FcPattern, void (*)(FcPattern *)> pat(FcPatternCreate(), &FcPatternDestroy);
std::unique_ptr<FcObjectSet, void (*)(FcObjectSet *)> os(FcObjectSetCreate(), &FcObjectSetDestroy);
FcPatternAddString(pat.get(), FC_FAMILY, (const FcChar8 *)name.c_str());
FcPatternAddString(pat.get(), FC_FAMILY, (const FcChar8 *)family.c_str());
// try and get a font with the requested styles baked-in
if (bold)
{
if (italic)
FcPatternAddString(pat.get(), FC_STYLE, (const FcChar8 *)"Bold Italic");
else
FcPatternAddString(pat.get(), FC_STYLE, (const FcChar8 *)"Bold");
}
else if (italic)
{
FcPatternAddString(pat.get(), FC_STYLE, (const FcChar8 *)"Italic");
}
else
{
FcPatternAddString(pat.get(), FC_STYLE, (const FcChar8 *)"Regular");
}
if (!style.empty())
FcPatternAddString(pat.get(), FC_STYLE, (const FcChar8 *)style.c_str());
FcPatternAddString(pat.get(), FC_FONTFORMAT, (const FcChar8 *)"TrueType");
FcObjectSetAdd(os.get(), FC_FILE);
FcObjectSetAdd(os.get(), FC_INDEX);
std::unique_ptr<FcFontSet, void (*)(FcFontSet *)> fontset(FcFontList(config, pat.get(), os.get()), &FcFontSetDestroy);
for (int i = 0; (i < fontset->nfont) && !font; i++)
@ -253,8 +253,9 @@ osd_font_sdl::TTF_Font_ptr osd_font_sdl::search_font_config(std::string const &n
{
osd_printf_verbose("Matching font: %s\n", val.u.s);
std::string match_name((const char*)val.u.s);
font = TTF_OpenFont_Magic(match_name, POINT_SIZE);
std::string const match_name((const char*)val.u.s);
long const index = ((FcPatternGet(fontset->fonts[i], FC_INDEX, 0, &val) == FcResultMatch) && (val.type == FcTypeInteger)) ? val.u.i : 0;
font = TTF_OpenFont_Magic(match_name, POINT_SIZE, index);
if (font)
bakedstyles = true;
@ -262,12 +263,11 @@ osd_font_sdl::TTF_Font_ptr osd_font_sdl::search_font_config(std::string const &n
}
// didn't get a font above? try again with no baked-in styles
if (!font)
// note that this simply returns the first match for the family name, which could be regular if you're lucky, but it could be bold oblique or something
if (!font && !style.empty())
{
pat.reset(FcPatternCreate());
FcPatternAddString(pat.get(), FC_FAMILY, (const FcChar8 *)name.c_str());
//Quite a lot of fonts don't have a "Regular" font type attribute
//FcPatternAddString(pat.get(), FC_STYLE, (const FcChar8 *)"Regular");
FcPatternAddString(pat.get(), FC_FAMILY, (const FcChar8 *)family.c_str());
FcPatternAddString(pat.get(), FC_FONTFORMAT, (const FcChar8 *)"TrueType");
fontset.reset(FcFontList(config, pat.get(), os.get()));
@ -278,8 +278,12 @@ osd_font_sdl::TTF_Font_ptr osd_font_sdl::search_font_config(std::string const &n
{
osd_printf_verbose("Matching unstyled font: %s\n", val.u.s);
std::string const match_name((const char *)val.u.s);
font = TTF_OpenFont_Magic(match_name, POINT_SIZE);
std::string const match_name((const char*)val.u.s);
long const index = ((FcPatternGet(fontset->fonts[i], FC_INDEX, 0, &val) == FcResultMatch) && (val.type == FcTypeInteger)) ? val.u.i : 0;
font = TTF_OpenFont_Magic(match_name, POINT_SIZE, index);
if (font)
bakedstyles = false;
}
}
}
@ -296,12 +300,12 @@ public:
{
}
osd_font::ptr font_alloc()
osd_font::ptr font_alloc() override
{
return std::make_unique<osd_font_sdl>();
}
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<std::
// TODO: enumerate TTF files in font path, since we can load them, too
#if !defined(SDLMAME_HAIKU) && !defined(SDLMAME_EMSCRIPTEN)
FcConfig *const config = FcConfigGetCurrent();
std::unique_ptr<FcPattern, void (*)(FcPattern *)> pat(FcPatternCreate(), &FcPatternDestroy);
FcPatternAddString(pat.get(), FC_FONTFORMAT, (const FcChar8 *)"TrueType");
@ -333,6 +338,7 @@ bool font_sdl::get_font_families(std::string const &font_path, std::vector<std::
std::unique_ptr<FcObjectSet, void (*)(FcObjectSet *)> os(FcObjectSetCreate(), &FcObjectSetDestroy);
FcObjectSetAdd(os.get(), FC_FAMILY);
FcObjectSetAdd(os.get(), FC_FILE);
FcObjectSetAdd(os.get(), FC_STYLE);
std::unique_ptr<FcFontSet, void (*)(FcFontSet *)> fontset(FcFontList(config, pat.get(), os.get()), &FcFontSetDestroy);
for (int i = 0; (i < fontset->nfont); i++)
@ -345,18 +351,30 @@ bool font_sdl::get_font_families(std::string const &font_path, std::vector<std::
{
auto const compare_fonts = [](std::pair<std::string, std::string> const &a, std::pair<std::string, std::string> const &b) -> bool
{
int const first = core_stricmp(a.first.c_str(), b.first.c_str());
if (first < 0) return true;
else if (first > 0) return false;
else return core_stricmp(b.second.c_str(), b.second.c_str()) < 0;
int const second = core_stricmp(a.second.c_str(), b.second.c_str());
if (second < 0) return true;
else if (second > 0) return false;
else return core_stricmp(b.first.c_str(), b.first.c_str()) < 0;
};
std::pair<std::string, std::string> font((const char *)val.u.s, (const char *)val.u.s);
std::string config((const char *)val.u.s);
std::string display(config);
if ((FcPatternGet(fontset->fonts[i], FC_STYLE, 0, &val) == FcResultMatch) && (val.type == FcTypeString))
{
config.push_back('|');
config.append((const char *)val.u.s);
display.push_back(' ');
display.append((const char *)val.u.s);
}
std::pair<std::string, std::string> font(std::move(config), std::move(display));
auto const pos = std::lower_bound(result.begin(), result.end(), font, compare_fonts);
if ((result.end() == pos) || (pos->first != font.first)) result.emplace(pos, std::move(font));
}
}
return true;
#else
return false;
#endif
}
#else /* SDLMAME_UNIX */

View File

@ -14,10 +14,6 @@
#include <sys/types.h>
#include <signal.h>
#ifdef SDLMAME_EMSCRIPTEN
#include <emscripten.h>
#endif
// MAME headers
#include "osdcore.h"
#include "osdlib.h"