Merge remote-tracking branch 'refs/remotes/mamedev/master' into hlsl

This commit is contained in:
Westley M. Martinez 2016-12-13 12:06:41 -08:00
commit e874afa308
156 changed files with 4176 additions and 4686 deletions

View File

@ -3082,7 +3082,7 @@
</software>
<software name="captckoo">
<description>Captain Cuckoo</description>
<description>Captain Cuckoo (cracked)</description>
<year>1984</year>
<publisher>Kurt and Yan Software</publisher>

View File

@ -70,6 +70,11 @@
;@s:1945kiii.cpp
1945kiiin:
1945kiiio:
@:maincpu,program,100a2d,63,03,88
;*******1945k III
1945kiii:
@:maincpu,program,100a2d,63,03,88
@ -97,6 +102,15 @@ undoukai:
;@s:8080bw.cpp
cosmicin:
@:maincpu,program,20f4,02,00,00
ozmawarsmr:
@:maincpu,program,2043,02,00,00
@:maincpu,program,2023,01,01,01
;updated when start a game
escmars:
@:maincpu,program,20db,1,0a,0a
@ -2413,6 +2427,10 @@ circusce:
;@s:cischeat.cpp
f1gpstaro:
@:cpu1,program,f2803,5e3,04,4d
;(big run (11th rallye version))
bigrun:
@:cpu1,program,f61da,2bc,50,05
@ -3045,11 +3063,12 @@ rockmanj:
forgottn:
forgottnu:
forgottnu1:
forgottnua:
forgottnuaa:
lostwrld:
lostwrldo:
forgottnuc:
forgottnue:
@:maincpu,program,ffe142,50,00,20
@:maincpu,program,ffb2a0,04,00,00
@ -3932,9 +3951,9 @@ stoffyu:
;wwfwfestb:******www wrestlefest (us bootleg)
;wwfwfesta:******www wrestlefest (us tecmo)
wwfwfest:
wwfwfesta:
wwfwfestb:
wwfwfestj:
wwfwfestu:
@:maincpu,program,1c00c2,84,08,01
@ -6707,6 +6726,11 @@ hvyunitu:
;@s:hyperspt.cpp
roadf3:
@:maincpu,program,3bd0,10a,01,01
@:maincpu,program,3066,3,01,00
roadf:
roadf2:
@:maincpu,program,3bd0,10a,01,01
@ -8873,6 +8897,10 @@ mnchmobl:
;@s:mustache.cpp
mustachei:
@:maincpu,program,f000,50,00,47
;*******mustache boy
mustache:
@:maincpu,program,f000,50,00,47
@ -8880,6 +8908,10 @@ mustache:
;@s:mw8080bw.cpp
blueshrkmr:
@:maincpu,program,200a,05,00,00
lagunar:
@:maincpu,program,2011,9,00,00
@:maincpu,program,2005,3,00,00
@ -10972,6 +11004,12 @@ btlkroadk:
;@s:psikyosh.cpp
;(sol divide) (by Paul Priest)
soldividk:
@:maincpu,program,600bb50,18,00,50
@:maincpu,program,600bb68,1e,24,02
;gunbarich (by tamphax)
gnbarich:
@:maincpu,program,6076864,a5,00,01
@ -14425,6 +14463,14 @@ tail2nos:
;@s:taito_b.cpp
;** you must wait untill the hiscore table has displayed in attract mode before **
;** starting a game, for the save to work **
hiticej:
hiticerb:
@:maincpu,program,802830,27,00,4b
@:maincpu,program,802852,1,56,56
crimec:
crimecj:
crimecu:
@ -16606,6 +16652,10 @@ vastar4:
;@s:vendetta.cpp
vendetta2pun:
@:maincpu,program,2980,28,00,48
vendetta:
vendetta2p:
vendetta2pd:

View File

@ -1317,6 +1317,13 @@ configuration { "Debug", "gmake" }
configuration { }
if (_OPTIONS["SOURCES"] ~= nil) then
local str = _OPTIONS["SOURCES"]
for word in string.gmatch(str, '([^,]+)') do
if (not os.isfile(path.join(MAME_DIR ,word))) then
print("File " .. word.. " does not exist")
os.exit()
end
end
OUT_STR = os.outputof( PYTHON .. " " .. MAME_DIR .. "scripts/build/makedep.py " .. MAME_DIR .. " " .. _OPTIONS["SOURCES"] .. " target " .. _OPTIONS["subtarget"])
load(OUT_STR)()
os.outputof( PYTHON .. " " .. MAME_DIR .. "scripts/build/makedep.py " .. MAME_DIR .. " " .. _OPTIONS["SOURCES"] .. " drivers " .. _OPTIONS["subtarget"] .. " > ".. GEN_DIR .. _OPTIONS["target"] .. "/" .. _OPTIONS["subtarget"]..".flt")

Binary file not shown.

View File

@ -1401,3 +1401,26 @@ if (SOUNDS["VOLT_REG"]~=null) then
MAME_DIR .. "src/devices/sound/volt_reg.h",
}
end
---------------------------------------------------
-- DAC-76 COMDAC
--@src/devices/sound/dac76.h,SOUNDS["DAC76"] = true
---------------------------------------------------
if (SOUNDS["DAC76"]~=null) then
files {
MAME_DIR .. "src/devices/sound/dac76.cpp",
MAME_DIR .. "src/devices/sound/dac76.h",
}
end
---------------------------------------------------
-- MM5837 Noise Generator
--@src/devices/sound/mm5837.h,MACHINES["MM5837"] = true
---------------------------------------------------
if (SOUNDS["MM5837"]~=null) then
files {
MAME_DIR .. "src/devices/sound/mm5837.cpp",
MAME_DIR .. "src/devices/sound/mm5837.h",
}
end

View File

@ -263,6 +263,8 @@ SOUNDS["AD1848"] = true
--SOUNDS["UPD1771"] = true
SOUNDS["VOLT_REG"] = true
--SOUNDS["MEA8000"] = true
SOUNDS["DAC76"] = true
SOUNDS["MM5837"] = true
--------------------------------------------------
-- specify available video cores
@ -1884,6 +1886,7 @@ files {
MAME_DIR .. "src/mame/machine/pgmprot_orlegend.cpp",
MAME_DIR .. "src/mame/machine/pgmprot_orlegend.h",
MAME_DIR .. "src/mame/drivers/pgm2.cpp",
MAME_DIR .. "src/mame/drivers/pgm3.cpp",
MAME_DIR .. "src/mame/drivers/spoker.cpp",
MAME_DIR .. "src/mame/machine/igs036crypt.cpp",
MAME_DIR .. "src/mame/machine/igs036crypt.h",
@ -3046,8 +3049,8 @@ files {
MAME_DIR .. "src/mame/video/blockade.cpp",
MAME_DIR .. "src/mame/drivers/calorie.cpp",
MAME_DIR .. "src/mame/drivers/chihiro.cpp",
MAME_DIR .. "src/mame/includes/chihiro.h",
MAME_DIR .. "src/mame/video/chihiro.cpp",
MAME_DIR .. "src/mame/includes/xbox_nv2a.h",
MAME_DIR .. "src/mame/video/xbox_nv2a.cpp",
MAME_DIR .. "src/mame/drivers/coolridr.cpp",
MAME_DIR .. "src/mame/drivers/deniam.cpp",
MAME_DIR .. "src/mame/includes/deniam.h",
@ -3968,10 +3971,6 @@ files {
createMAMEProjects(_target, _subtarget, "tong")
files {
MAME_DIR .. "src/mame/drivers/beezer.cpp",
MAME_DIR .. "src/mame/includes/beezer.h",
MAME_DIR .. "src/mame/machine/beezer.cpp",
MAME_DIR .. "src/mame/video/beezer.cpp",
MAME_DIR .. "src/mame/audio/beezer.cpp",
}
createMAMEProjects(_target, _subtarget, "unico")

View File

@ -264,6 +264,8 @@ SOUNDS["GB_SOUND"] = true
SOUNDS["PCD3311"] = true
SOUNDS["VOLT_REG"] = true
SOUNDS["MEA8000"] = true
--SOUNDS["DAC76"] = true
--SOUNDS["MM5837"] = true
--------------------------------------------------
-- specify available video cores
@ -1227,7 +1229,7 @@ files {
MAME_DIR .. "src/mame/drivers/cps1.cpp",
MAME_DIR .. "src/mame/includes/cps1.h",
MAME_DIR .. "src/mame/video/cps1.cpp",
MAME_DIR .. "src/mame/video/chihiro.cpp",
MAME_DIR .. "src/mame/video/xbox_nv2a.cpp",
MAME_DIR .. "src/mame/machine/xbox.cpp",
MAME_DIR .. "src/mame/machine/xbox_usb.cpp",
MAME_DIR .. "src/mame/includes/saturn.h",

View File

@ -2628,7 +2628,7 @@ int rpk_reader::find_file(util::archive_file &zip, const char *filename, uint32_
/*
Load a rom resource and put it in a pcb socket instance.
*/
std::unique_ptr<rpk_socket> rpk_reader::load_rom_resource(util::archive_file &zip, xml_data_node const* rom_resource_node, const char* socketname)
std::unique_ptr<rpk_socket> rpk_reader::load_rom_resource(util::archive_file &zip, util::xml::data_node const* rom_resource_node, const char* socketname)
{
const char* file;
const char* crcstr;
@ -2693,7 +2693,7 @@ std::unique_ptr<rpk_socket> rpk_reader::load_rom_resource(util::archive_file &zi
/*
Load a ram resource and put it in a pcb socket instance.
*/
std::unique_ptr<rpk_socket> rpk_reader::load_ram_resource(emu_options &options, xml_data_node const* ram_resource_node, const char* socketname, const char* system_name)
std::unique_ptr<rpk_socket> rpk_reader::load_ram_resource(emu_options &options, util::xml::data_node const* ram_resource_node, const char* socketname, const char* system_name)
{
const char* length_string;
const char* ram_type;
@ -2787,7 +2787,7 @@ rpk* rpk_reader::open(emu_options &options, const char *filename, const char *sy
util::archive_file::ptr zipfile;
std::vector<char> layout_text;
xml_data_node *layout_xml = nullptr;
util::xml::data_node *layout_xml = nullptr;
int i;
@ -2816,25 +2816,25 @@ rpk* rpk_reader::open(emu_options &options, const char *filename, const char *sy
layout_text[zipfile->current_uncompressed_length()] = '\0'; // Null-terminate
/* parse the layout text */
layout_xml = xml_data_node::string_read(&layout_text[0], nullptr);
layout_xml = util::xml::data_node::string_read(&layout_text[0], nullptr);
if (!layout_xml) throw rpk_exception(RPK_XML_ERROR);
// Now we work within the XML tree
// romset is the root node
xml_data_node const *const romset_node = layout_xml->get_child("romset");
util::xml::data_node const *const romset_node = layout_xml->get_child("romset");
if (!romset_node) throw rpk_exception(RPK_INVALID_LAYOUT, "document element must be <romset>");
// resources is a child of romset
xml_data_node const *const resources_node = romset_node->get_child("resources");
util::xml::data_node const *const resources_node = romset_node->get_child("resources");
if (!resources_node) throw rpk_exception(RPK_INVALID_LAYOUT, "<romset> must have a <resources> child");
// configuration is a child of romset; we're actually interested in ...
xml_data_node const *const configuration_node = romset_node->get_child("configuration");
util::xml::data_node const *const configuration_node = romset_node->get_child("configuration");
if (!configuration_node) throw rpk_exception(RPK_INVALID_LAYOUT, "<romset> must have a <configuration> child");
// ... pcb, which is a child of configuration
xml_data_node const *const pcb_node = configuration_node->get_child("pcb");
util::xml::data_node const *const pcb_node = configuration_node->get_child("pcb");
if (!pcb_node) throw rpk_exception(RPK_INVALID_LAYOUT, "<configuration> must have a <pcb> child");
// We'll try to find the PCB type on the provided type list.
@ -2856,7 +2856,7 @@ rpk* rpk_reader::open(emu_options &options, const char *filename, const char *sy
if (m_types[i].id==0) throw rpk_exception(RPK_UNKNOWN_PCB_TYPE);
// Find the sockets and load their respective resource
for (xml_data_node const *socket_node = pcb_node->get_first_child(); socket_node != nullptr; socket_node = socket_node->get_next_sibling())
for (util::xml::data_node const *socket_node = pcb_node->get_first_child(); socket_node != nullptr; socket_node = socket_node->get_next_sibling())
{
if (strcmp(socket_node->get_name(), "socket")!=0) throw rpk_exception(RPK_INVALID_LAYOUT, "<pcb> element has only <socket> children");
char const *const id = socket_node->get_attribute_string("id", nullptr);
@ -2866,7 +2866,7 @@ rpk* rpk_reader::open(emu_options &options, const char *filename, const char *sy
bool found = false;
// Locate the resource node
for (xml_data_node const *resource_node = resources_node->get_first_child(); resource_node != nullptr; resource_node = resource_node->get_next_sibling())
for (util::xml::data_node const *resource_node = resources_node->get_first_child(); resource_node != nullptr; resource_node = resource_node->get_next_sibling())
{
char const *const resource_name = resource_node->get_attribute_string("id", nullptr);
if (!resource_name) throw rpk_exception(RPK_INVALID_LAYOUT, "resource node must have an 'id' attribute");

View File

@ -515,9 +515,9 @@ public:
rpk *open(emu_options &options, const char *filename, const char *system_name);
private:
int find_file(util::archive_file &zip, const char *filename, uint32_t crc);
std::unique_ptr<rpk_socket> load_rom_resource(util::archive_file &zip, xml_data_node const* rom_resource_node, const char* socketname);
std::unique_ptr<rpk_socket> load_ram_resource(emu_options &options, xml_data_node const* ram_resource_node, const char* socketname, const char* system_name);
int find_file(util::archive_file &zip, const char *filename, uint32_t crc);
std::unique_ptr<rpk_socket> load_rom_resource(util::archive_file &zip, util::xml::data_node const* rom_resource_node, const char* socketname);
std::unique_ptr<rpk_socket> load_ram_resource(emu_options &options, util::xml::data_node const* ram_resource_node, const char* socketname, const char* system_name);
const pcb_type* m_types;
};

View File

@ -105,6 +105,13 @@ uint32_t i960_cpu_device::get_ea(uint32_t opcode)
switch(mode) {
case 0x4:
return m_r[abase];
case 0x5: // address of this instruction + the offset dword + 8
// which in reality is "address of next instruction + the offset dword"
ret = m_direct->read_dword(m_IP);
m_IP += 4;
ret += m_IP;
return ret;
case 0x7:
return m_r[abase] + (m_r[index] << scale);
@ -357,6 +364,7 @@ void i960_cpu_device::bxx(uint32_t opcode, int mask)
{
if(m_AC & mask) {
m_IP += get_disp(opcode);
m_IP &= ~3;
}
}
@ -364,6 +372,7 @@ void i960_cpu_device::bxx_s(uint32_t opcode, int mask)
{
if(m_AC & mask) {
m_IP += get_disp_s(opcode);
m_IP &= ~3;
}
}
@ -1068,6 +1077,20 @@ void i960_cpu_device::execute_op(uint32_t opcode)
cmp_s(t1, t2);
set_ri(opcode, t2-1);
break;
case 0xc: // scanbyte
m_icount -= 2;
m_AC &= ~7; // clear CC
t1 = get_1_ri(opcode);
t2 = get_2_ri(opcode);
if ((t1 & 0xff000000) == (t2 & 0xff000000) ||
(t1 & 0x00ff0000) == (t2 & 0x00ff0000) ||
(t1 & 0x0000ff00) == (t2 & 0x0000ff00) ||
(t1 & 0x000000ff) == (t2 & 0x000000ff))
{
m_AC |= 2;
}
break;
case 0xe: // chkbit
m_icount -= 2;

View File

@ -52,29 +52,37 @@ enum
SHARC_B12, SHARC_B13, SHARC_B14, SHARC_B15
};
#define ROPCODE(pc) ((uint64_t)(m_internal_ram[((pc-0x20000) * 3) + 0]) << 32) | \
((uint64_t)(m_internal_ram[((pc-0x20000) * 3) + 1]) << 16) | \
((uint64_t)(m_internal_ram[((pc-0x20000) * 3) + 2]) << 0)
const device_type ADSP21062 = &device_creator<adsp21062_device>;
// This is just used to stop the debugger from complaining about executing from I/O space
static ADDRESS_MAP_START( internal_pgm, AS_PROGRAM, 64, adsp21062_device )
AM_RANGE(0x20000, 0x7ffff) AM_RAM AM_SHARE("x")
AM_RANGE(0x20000, 0x24fff) AM_READWRITE(pm0_r, pm0_w)
AM_RANGE(0x28000, 0x2cfff) AM_READWRITE(pm1_r, pm1_w)
AM_RANGE(0x30000, 0x34fff) AM_READWRITE(pm1_r, pm1_w)
AM_RANGE(0x38000, 0x3cfff) AM_READWRITE(pm1_r, pm1_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( internal_data, AS_DATA, 32, adsp21062_device )
AM_RANGE(0x00000, 0x000ff) AM_READWRITE(iop_r, iop_w)
AM_RANGE(0x20000, 0x27fff) AM_RAM AM_SHARE("block0")
AM_RANGE(0x28000, 0x2ffff) AM_RAM AM_SHARE("block1")
AM_RANGE(0x30000, 0x37fff) AM_RAM AM_SHARE("block1")
AM_RANGE(0x38000, 0x3ffff) AM_RAM AM_SHARE("block1")
AM_RANGE(0x40000, 0x4ffff) AM_READWRITE(dmw0_r, dmw0_w)
AM_RANGE(0x50000, 0x5ffff) AM_READWRITE(dmw1_r, dmw1_w)
AM_RANGE(0x60000, 0x6ffff) AM_READWRITE(dmw1_r, dmw1_w)
AM_RANGE(0x70000, 0x7ffff) AM_READWRITE(dmw1_r, dmw1_w)
ADDRESS_MAP_END
adsp21062_device::adsp21062_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: cpu_device(mconfig, ADSP21062, "ADSP21062", tag, owner, clock, "adsp21062", __FILE__)
, m_program_config("program", ENDIANNESS_LITTLE, 64, 24, -3, ADDRESS_MAP_NAME(internal_pgm))
, m_data_config("data", ENDIANNESS_LITTLE, 32, 32, -2)
, m_data_config("data", ENDIANNESS_LITTLE, 32, 32, -2, ADDRESS_MAP_NAME(internal_data))
, m_boot_mode(BOOT_MODE_HOST)
, m_cache(CACHE_SIZE + sizeof(sharc_internal_state))
, m_drcuml(nullptr)
, m_drcfe(nullptr)
, m_block0(*this, "block0")
, m_block1(*this, "block1")
, m_enable_drc(false)
{
}
@ -88,7 +96,7 @@ offs_t adsp21062_device::disasm_disassemble(std::ostream &stream, offs_t pc, con
void adsp21062_device::enable_recompiler()
{
m_enable_drc = true;
m_enable_drc = allow_drc();
}
@ -144,11 +152,98 @@ void adsp21062_device::sharc_iop_delayed_w(uint32_t reg, uint32_t data, int cycl
m_core->delayed_iop_timer->adjust(cycles_to_attotime(cycles), 0);
}
// 0 012 0h 0l 1h
// 1 453 2h 2l 1l
// 2 678 3h 3l 4h
// 3 ab9 5h 5l 4l
// 4 cde 6h 6l 7h
READ64_MEMBER( adsp21062_device::pm0_r)
{
offs_t slot = offset >> 12;
offs_t base = (offset & 0xfff) + (slot >> 1) * (3<<12);
if(slot & 1)
return (uint64_t(m_block0[base + 0x2000]) << 16) | (m_block0[base + 0x1000] & 0xffff);
else
return (uint64_t(m_block0[base ]) << 16) | (m_block0[base + 0x1000] >> 16);
}
WRITE64_MEMBER(adsp21062_device::pm0_w)
{
offs_t slot = offset >> 12;
offs_t base = (offset & 0xfff) + (slot >> 1) * (3<<12);
if(slot & 1) {
if(ACCESSING_BITS_0_15)
m_block0[base + 0x1000] = (m_block0[base + 0x1000] & 0xffff0000) | (data & 0xffff);
m_block0[base + 0x2000] = (m_block0[base + 0x2000] & ~(mem_mask >> 16)) | ((data & mem_mask) >> 16);
} else {
m_block0[base + 0x0000] = (m_block0[base + 0x0000] & ~(mem_mask >> 16)) | ((data & mem_mask) >> 16);
if(ACCESSING_BITS_0_15)
m_block0[base + 0x1000] = (m_block0[base + 0x1000] & 0xffff) | ((data & 0xffff) << 16);
}
}
READ64_MEMBER( adsp21062_device::pm1_r)
{
offs_t slot = offset >> 12;
offs_t base = (offset & 0xfff) + (slot >> 1) * (3<<12);
if(slot & 1)
return (uint64_t(m_block1[base + 0x2000]) << 16) | (m_block1[base + 0x1000] & 0xffff);
else
return (uint64_t(m_block1[base ]) << 16) | (m_block1[base + 0x1000] >> 16);
}
WRITE64_MEMBER(adsp21062_device::pm1_w)
{
offs_t slot = offset >> 12;
offs_t base = (offset & 0xfff) + (slot >> 1) * (3<<12);
if(slot & 1) {
if(ACCESSING_BITS_0_15)
m_block1[base + 0x1000] = (m_block1[base + 0x1000] & 0xffff0000) | (data & 0xffff);
m_block1[base + 0x2000] = (m_block1[base + 0x2000] & ~(mem_mask >> 16)) | ((data & mem_mask) >> 16);
} else {
m_block1[base + 0x0000] = (m_block1[base + 0x0000] & ~(mem_mask >> 16)) | ((data & mem_mask) >> 16);
if(ACCESSING_BITS_0_15)
m_block1[base + 0x1000] = (m_block1[base + 0x1000] & 0xffff) | ((data & 0xffff) << 16);
}
}
READ32_MEMBER( adsp21062_device::dmw0_r)
{
if(offset & 1)
return m_block0[offset >> 1] >> 16;
else
return m_block0[offset >> 1] & 0xffff;
}
WRITE32_MEMBER(adsp21062_device::dmw0_w)
{
if(offset & 1)
m_block0[offset >> 1] = (m_block0[offset >> 1] & 0xffff) | (data << 16);
else
m_block0[offset >> 1] = (m_block0[offset >> 1] & 0xffff0000) | (data & 0xffff);
}
READ32_MEMBER( adsp21062_device::dmw1_r)
{
if(offset & 1)
return m_block1[offset >> 1] >> 16;
else
return m_block1[offset >> 1] & 0xffff;
}
WRITE32_MEMBER(adsp21062_device::dmw1_w)
{
if(offset & 1)
m_block1[offset >> 1] = (m_block1[offset >> 1] & 0xffff) | (data << 16);
else
m_block1[offset >> 1] = (m_block1[offset >> 1] & 0xffff0000) | (data & 0xffff);
}
/* IOP registers */
uint32_t adsp21062_device::sharc_iop_r(uint32_t address)
READ32_MEMBER( adsp21062_device::iop_r)
{
switch (address)
switch (offset)
{
case 0x00: return 0; // System configuration
@ -156,13 +251,13 @@ uint32_t adsp21062_device::sharc_iop_r(uint32_t address)
{
return m_core->dma_status;
}
default: fatalerror("sharc_iop_r: Unimplemented IOP reg %02X at %08X\n", address, m_core->pc);
default: fatalerror("sharc_iop_r: Unimplemented IOP reg %02X at %08X\n", offset, m_core->pc);
}
}
void adsp21062_device::sharc_iop_w(uint32_t address, uint32_t data)
WRITE32_MEMBER(adsp21062_device::iop_w)
{
switch (address)
switch (offset)
{
case 0x00: break; // System configuration
case 0x02: break; // External Memory Wait State Configuration
@ -240,7 +335,7 @@ void adsp21062_device::sharc_iop_w(uint32_t address, uint32_t data)
case 0x4e: m_core->dma[7].ext_modifier = data; return;
case 0x4f: m_core->dma[7].ext_count = data; return;
default: fatalerror("sharc_iop_w: Unimplemented IOP reg %02X, %08X at %08X\n", address, data, m_core->pc);
default: fatalerror("sharc_iop_w: Unimplemented IOP reg %02X, %08X at %08X\n", offset, data, m_core->pc);
}
}
@ -297,7 +392,7 @@ void adsp21062_device::external_iop_write(uint32_t address, uint32_t data)
else
{
osd_printf_debug("SHARC IOP write %08X, %08X\n", address, data);
sharc_iop_w(address, data);
m_data->write_dword(address << 2, data);
}
}
@ -341,14 +436,10 @@ void adsp21062_device::device_start()
memset(m_core, 0, sizeof(sharc_internal_state));
m_program = &space(AS_PROGRAM);
m_direct = &m_program->direct();
m_data = &space(AS_DATA);
build_opcode_table();
m_internal_ram_block0 = &m_internal_ram[0];
m_internal_ram_block1 = &m_internal_ram[0x20000/2];
// init UML generator
uint32_t umlflags = 0;
m_drcuml = std::make_unique<drcuml_state>(*this, m_cache, umlflags, 1, 24, 0);
@ -615,8 +706,6 @@ void adsp21062_device::device_start()
save_item(NAME(m_core->px));
save_pointer(NAME(m_internal_ram), 2 * 0x10000);
save_item(NAME(m_core->opcode));
save_item(NAME(m_core->nfaddr));
@ -767,7 +856,8 @@ void adsp21062_device::device_start()
void adsp21062_device::device_reset()
{
memset(m_internal_ram, 0, 2 * 0x10000 * sizeof(uint16_t));
memset(m_block0, 0, 0x8000 * sizeof(uint32_t));
memset(m_block1, 0, 0x8000 * sizeof(uint32_t));
switch(m_boot_mode)
{
@ -898,6 +988,12 @@ void adsp21062_device::check_interrupts()
void adsp21062_device::execute_run()
{
static bool first = true;
if(first) {
first = false;
machine().debug_break();
}
if (m_enable_drc)
{
if (m_core->irq_pending != 0)
@ -931,9 +1027,15 @@ void adsp21062_device::execute_run()
m_core->astat_old_old = m_core->astat_old;
m_core->astat_old = m_core->astat;
static bool first = true;
if(first) {
first = false;
machine().debug_break();
}
debugger_instruction_hook(this, m_core->pc);
m_core->opcode = ROPCODE(m_core->pc);
m_core->opcode = m_program->read_qword(m_core->pc << 3);
// handle looping
if (m_core->pc == m_core->laddr.addr)
@ -1011,92 +1113,3 @@ void adsp21062_device::execute_run()
};
}
}
bool adsp21062_device::memory_read(address_spacenum spacenum, offs_t offset, int size, uint64_t &value)
{
if (spacenum == AS_PROGRAM)
{
int address = offset >> 3;
if (address >= 0x20000 && address < 0x30000)
{
switch (size)
{
case 1:
{
int frac = offset & 7;
value = (pm_read48(offset >> 3) >> ((frac^7) * 8)) & 0xff;
break;
}
case 8:
{
value = pm_read48(offset >> 3);
break;
}
}
}
else
{
value = 0;
}
}
else if (spacenum == AS_DATA)
{
int address = offset >> 2;
if (address >= 0x20000)
{
switch (size)
{
case 1:
{
int frac = offset & 3;
value = (dm_read32(offset >> 2) >> ((frac^3) * 8)) & 0xff;
break;
}
case 2:
{
int frac = (offset >> 1) & 1;
value = (dm_read32(offset >> 2) >> ((frac^1) * 16)) & 0xffff;
break;
}
case 4:
{
value = dm_read32(offset >> 2);
break;
}
}
}
else
{
value = 0;
}
}
return true;
}
bool adsp21062_device::memory_readop(offs_t offset, int size, uint64_t &value)
{
uint64_t mask = (size < 8) ? (((uint64_t)1 << (8 * size)) - 1) : ~(uint64_t)0;
int shift = 8 * (offset & 7);
offset >>= 3;
if (offset >= 0x20000 && offset < 0x28000)
{
uint64_t op = ((uint64_t)(m_internal_ram_block0[((offset-0x20000) * 3) + 0]) << 32) |
((uint64_t)(m_internal_ram_block0[((offset-0x20000) * 3) + 1]) << 16) |
((uint64_t)(m_internal_ram_block0[((offset-0x20000) * 3) + 2]) << 0);
value = (op >> shift) & mask;
return true;
}
else if (offset >= 0x28000 && offset < 0x30000)
{
uint64_t op = ((uint64_t)(m_internal_ram_block1[((offset-0x28000) * 3) + 0]) << 32) |
((uint64_t)(m_internal_ram_block1[((offset-0x28000) * 3) + 1]) << 16) |
((uint64_t)(m_internal_ram_block1[((offset-0x28000) * 3) + 2]) << 0);
value = (op >> shift) & mask;
return true;
}
return false;
}

View File

@ -171,6 +171,17 @@ public:
void enable_recompiler();
DECLARE_READ64_MEMBER( pm0_r);
DECLARE_WRITE64_MEMBER(pm0_w);
DECLARE_READ64_MEMBER( pm1_r);
DECLARE_WRITE64_MEMBER(pm1_w);
DECLARE_READ32_MEMBER( dmw0_r);
DECLARE_WRITE32_MEMBER(dmw0_w);
DECLARE_READ32_MEMBER( dmw1_r);
DECLARE_WRITE32_MEMBER(dmw1_w);
DECLARE_READ32_MEMBER( iop_r);
DECLARE_WRITE32_MEMBER(iop_w);
enum ASTAT_FLAGS
{
// ASTAT flags
@ -257,16 +268,12 @@ protected:
// device_memory_interface overrides
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_DATA) ? &m_data_config : nullptr ); }
virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, uint64_t &value) override;
virtual bool memory_readop(offs_t offset, int size, uint64_t &value) override;
// device_disasm_interface overrides
virtual uint32_t disasm_min_opcode_bytes() const override { return 6; }
virtual uint32_t disasm_max_opcode_bytes() const override { return 6; }
virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override;
direct_read_data *m_direct;
private:
address_space_config m_program_config;
address_space_config m_data_config;
@ -448,21 +455,18 @@ private:
uml::code_handle *m_swap_r0_7;
uml::code_handle *m_swap_r8_15;
uint16_t *m_internal_ram_block0, *m_internal_ram_block1;
address_space *m_program;
address_space *m_data;
opcode_func m_sharc_op[512];
uint16_t m_internal_ram[2 * 0x10000]; // 2x 128KB
required_shared_ptr<uint32_t> m_block0, m_block1;
opcode_func m_sharc_op[512];
bool m_enable_drc;
inline void CHANGE_PC(uint32_t newpc);
inline void CHANGE_PC_DELAYED(uint32_t newpc);
void sharc_iop_delayed_w(uint32_t reg, uint32_t data, int cycles);
uint32_t sharc_iop_r(uint32_t address);
void sharc_iop_w(uint32_t address, uint32_t data);
uint32_t pm_read32(uint32_t address);
void pm_write32(uint32_t address, uint32_t data);
uint64_t pm_read48(uint32_t address);

View File

@ -18,7 +18,6 @@
using namespace uml;
#define USE_SWAPDQ 0
#define WRITE_SNOOP 0
// map variables
@ -114,24 +113,13 @@ inline void adsp21062_device::alloc_handle(drcuml_state *drcuml, code_handle **h
static void cfunc_unimplemented(void *param)
{
adsp21062_device *sharc = (adsp21062_device *)param;
sharc->sharc_cfunc_unimplemented();
}
static void cfunc_read_iop(void *param)
{
adsp21062_device *sharc = (adsp21062_device *)param;
sharc->sharc_cfunc_read_iop();
}
static void cfunc_write_iop(void *param)
{
adsp21062_device *sharc = (adsp21062_device *)param;
sharc->sharc_cfunc_write_iop();
}
static void cfunc_pcstack_overflow(void *param)
{
adsp21062_device *sharc = (adsp21062_device *)param;
@ -180,21 +168,6 @@ static void cfunc_unimplemented_shiftimm(void *param)
sharc->sharc_cfunc_unimplemented_shiftimm();
}
#if WRITE_SNOOP
void adsp21062_device::sharc_cfunc_write_snoop()
{
printf("Write %08X to %08X at %08X\n", m_core->arg0, m_core->arg1, m_core->arg2);
}
static void cfunc_write_snoop(void *param)
{
adsp21062_device *sharc = (adsp21062_device *)param;
sharc->sharc_cfunc_write_snoop();
}
#endif
void adsp21062_device::sharc_cfunc_unimplemented()
{
uint64_t op = m_core->arg64;
@ -213,16 +186,6 @@ void adsp21062_device::sharc_cfunc_unimplemented_shiftimm()
fatalerror("PC=%08X: Unimplemented shiftimm %04X%08X\n", m_core->pc, (uint32_t)(op >> 32), (uint32_t)(op));
}
void adsp21062_device::sharc_cfunc_read_iop()
{
m_core->arg1 = sharc_iop_r(m_core->arg0);
}
void adsp21062_device::sharc_cfunc_write_iop()
{
sharc_iop_w(m_core->arg0, m_core->arg1);
}
void adsp21062_device::sharc_cfunc_pcstack_overflow()
{
fatalerror("SHARC: PCStack overflow");
@ -334,16 +297,6 @@ void adsp21062_device::static_generate_memory_accessor(MEM_ACCESSOR_TYPE type, c
{
// I0 = read/write data
// I1 = address
// I2 is trashed
void* block0 = &m_internal_ram_block0[0];
void* block0_1 = &m_internal_ram_block0[1];
void* block0_2 = &m_internal_ram_block0[2];
void* block1 = &m_internal_ram_block1[0];
void* block1_1 = &m_internal_ram_block1[1];
void* block1_2 = &m_internal_ram_block1[2];
code_label label = 1;
drcuml_block *block = m_drcuml->begin_block(1024);
@ -354,298 +307,35 @@ void adsp21062_device::static_generate_memory_accessor(MEM_ACCESSOR_TYPE type, c
switch (type)
{
case MEM_ACCESSOR_PM_READ48:
UML_CMP(block, I1, IRAM_BLOCK0_START); // cmp i1,IRAM_BLOCK0_START
UML_JMPc(block, COND_B, label); // jb label1
UML_CMP(block, I1, IRAM_BLOCK0_END); // cmp i1,IRAM_BLOCK0_END
UML_JMPc(block, COND_A, label); // ja label1
// 0x20000 ... 0x27fff
UML_AND(block, I1, I1, 0x7fff); // and i1,i1,0x7fff
UML_MULS(block, I1, I1, I1, 3); // muls i1,3
UML_DLOAD(block, I0, block0, I1, SIZE_WORD, SCALE_x2); // dload i0,[block0],i1,word,scale_x2
UML_DSHL(block, I0, I0, 32); // dshl i0,i0,32
UML_DLOAD(block, I2, block0_1, I1, SIZE_WORD, SCALE_x2); // dload i2,[block0_1],i1,word,scale_x2
UML_DSHL(block, I2, I2, 16); // dshl i2,i2,16
UML_DOR(block, I0, I0, I2); // dor i0,i0,i2
UML_DLOAD(block, I2, block0_2, I1, SIZE_WORD, SCALE_x2); // dload i2,[block0_2],i1,word,scale_x2
UML_DOR(block, I0, I0, I2); // dor i0,i0,i2
UML_RET(block); // ret
UML_LABEL(block, label++); // label1:
UML_CMP(block, I1, IRAM_BLOCK1_START); // cmp i1,IRAM_BLOCK1_START
UML_JMPc(block, COND_B, label); // jb label2
UML_CMP(block, I1, IRAM_BLOCK1_END); // cmp i1,IRAM_BLOCK1_END
UML_JMPc(block, COND_A, label); // ja label2
// 0x28000 ... 0x3ffff
UML_AND(block, I1, I1, 0x7fff); // and i1,i1,0x7fff (block 1 is mirrored in 0x28000...2ffff, 0x30000...0x37fff and 0x38000...3ffff)
UML_MULS(block, I1, I1, I1, 3); // muls i1,3
UML_DLOAD(block, I0, block1, I1, SIZE_WORD, SCALE_x2); // dload i0,[block1],i1,word,scale_x2
UML_DSHL(block, I0, I0, 32); // dshl i0,i0,32
UML_DLOAD(block, I2, block1_1, I1, SIZE_WORD, SCALE_x2); // dload i2,[block1_1],i1,word,scale_x2
UML_DSHL(block, I2, I2, 16); // dshl i2,i2,16
UML_DOR(block, I0, I0, I2); // dor i0,i0,i2
UML_DLOAD(block, I2, block1_2, I1, SIZE_WORD, SCALE_x2); // dload i2,[block1_2],i1,word,scale_x2
UML_DOR(block, I0, I0, I2); // dor i0,i0,i2
UML_RET(block); // ret
UML_LABEL(block, label++); // label2:
UML_SHL(block, I1, I1, 3);
UML_DREAD(block, I0, I1, SIZE_QWORD, SPACE_PROGRAM);
break;
case MEM_ACCESSOR_PM_WRITE48:
UML_CMP(block, I1, IRAM_BLOCK0_START); // cmp i1,IRAM_BLOCK0_START
UML_JMPc(block, COND_B, label); // jb label1
UML_CMP(block, I1, IRAM_BLOCK0_END); // cmp i1,IRAM_BLOCK0_END
UML_JMPc(block, COND_A, label); // ja label1
// 0x20000 ... 0x27fff
UML_AND(block, I1, I1, 0x7fff); // and i1,i1,0x7fff
UML_MULS(block, I1, I1, I1, 3); // muls i1,3
UML_DSTORE(block, block0_2, I1, I0, SIZE_WORD, SCALE_x2); // dstore [block0_2],i1,i0,word,scale_x2
UML_DSHR(block, I0, I0, 16); // dshr i0,i0,16
UML_DSTORE(block, block0_1, I1, I0, SIZE_WORD, SCALE_x2); // dstore [block0_1],i1,i0,word,scale_x2
UML_DSHR(block, I0, I0, 16); // dshr i0,i0,16
UML_DSTORE(block, block0, I1, I0, SIZE_WORD, SCALE_x2); // dstore [block0],i1,i0,word,scale_x2
UML_SHL(block, I1, I1, 3);
UML_DWRITE(block, I1, I0, SIZE_QWORD, SPACE_PROGRAM);
UML_MOV(block, mem(&m_core->force_recompile), 1);
UML_RET(block); // ret
UML_LABEL(block, label++); // label1:
UML_CMP(block, I1, IRAM_BLOCK1_START); // cmp i1,IRAM_BLOCK1_START
UML_JMPc(block, COND_B, label); // jb label2
UML_CMP(block, I1, IRAM_BLOCK1_END); // cmp i1,IRAM_BLOCK1_END
UML_JMPc(block, COND_A, label); // ja label2
// 0x28000 ... 0x3ffff
UML_AND(block, I1, I1, 0x7fff); // and i1,i1,0x7fff (block 1 is mirrored in 0x28000...2ffff, 0x30000...0x37fff and 0x38000...3ffff)
UML_MULS(block, I1, I1, I1, 3); // muls i1,3
UML_DSTORE(block, block1_2, I1, I0, SIZE_WORD, SCALE_x2); // dstore [block1_2],i1,i0,word,scale_x2
UML_DSHR(block, I0, I0, 16); // dshr i0,i0,16
UML_DSTORE(block, block1_1, I1, I0, SIZE_WORD, SCALE_x2); // dstore [block1_1],i1,i0,word,scale_x2
UML_DSHR(block, I0, I0, 16); // dshr i0,i0,16
UML_DSTORE(block, block1, I1, I0, SIZE_WORD, SCALE_x2); // dstore [block1],i1,i0,word,scale_x2
UML_RET(block); // ret
UML_LABEL(block, label++); // label2:
break;
case MEM_ACCESSOR_PM_READ32:
UML_CMP(block, I1, IRAM_BLOCK0_START); // cmp i1,IRAM_BLOCK0_START
UML_JMPc(block, COND_B, label); // jb label1
UML_CMP(block, I1, IRAM_BLOCK0_END); // cmp i1,IRAM_BLOCK0_END
UML_JMPc(block, COND_A, label); // ja label1
// 0x20000 ... 0x27fff
UML_AND(block, I1, I1, 0x7fff); // and i1,i1,0x7fff
UML_MULS(block, I1, I1, I1, 3); // muls i1,3
UML_LOAD(block, I0, block0, I1, SIZE_WORD, SCALE_x2); // load i0,[block0],i1,word,scale_x2
UML_SHL(block, I0, I0, 16); // shl i0,i0,16
UML_LOAD(block, I2, block0_1, I1, SIZE_WORD, SCALE_x2); // load i2,[block0_1],i1,word,scale_x2
UML_OR(block, I0, I0, I2); // or i0,i0,i2
UML_RET(block); // ret
UML_LABEL(block, label++); // label1:
UML_CMP(block, I1, IRAM_BLOCK1_START); // cmp i1,IRAM_BLOCK1_START
UML_JMPc(block, COND_B, label); // jb label2
UML_CMP(block, I1, IRAM_BLOCK1_END); // cmp i1,IRAM_BLOCK1_END
UML_JMPc(block, COND_A, label); // ja label2
// 0x28000 ... 0x3ffff
UML_AND(block, I1, I1, 0x7fff); // and i1,i1,0x7fff (block 1 is mirrored in 0x28000...2ffff, 0x30000...0x37fff and 0x38000...3ffff)
UML_MULS(block, I1, I1, I1, 3); // muls i1,3
UML_LOAD(block, I0, block1, I1, SIZE_WORD, SCALE_x2); // load i0,[block1],i1,word,scale_x2
UML_SHL(block, I0, I0, 16); // shl i0,i0,16
UML_LOAD(block, I2, block1_1, I1, SIZE_WORD, SCALE_x2); // load i2,[block1_1],i1,word,scale_x2
UML_OR(block, I0, I0, I2); // or i0,i0,i2
UML_RET(block); // ret
UML_LABEL(block, label++); // label2:
UML_SHL(block, I1, I1, 3);
UML_READ(block, I0, I1, SIZE_DWORD, SPACE_PROGRAM);
break;
case MEM_ACCESSOR_PM_WRITE32:
UML_CMP(block, I1, IRAM_BLOCK0_START); // cmp i1,IRAM_BLOCK0_START
UML_JMPc(block, COND_B, label); // jb label1
UML_CMP(block, I1, IRAM_BLOCK0_END); // cmp i1,IRAM_BLOCK0_END
UML_JMPc(block, COND_A, label); // ja label1
// 0x20000 ... 0x27fff
UML_AND(block, I1, I1, 0x7fff); // and i1,i1,0x7fff
UML_MULS(block, I1, I1, I1, 3); // muls i1,3
UML_STORE(block, block0_1, I1, I0, SIZE_WORD, SCALE_x2); // store [block0_1],i1,i0,word,scale_x2
UML_SHR(block, I0, I0, 16); // shr i0,i0,16
UML_STORE(block, block0, I1, I0, SIZE_WORD, SCALE_x2); // store [block0],i1,i0,word,scale_x2
UML_RET(block); // ret
UML_LABEL(block, label++); // label1:
UML_CMP(block, I1, IRAM_BLOCK1_START); // cmp i1,IRAM_BLOCK1_START
UML_JMPc(block, COND_B, label); // jb label2
UML_CMP(block, I1, IRAM_BLOCK1_END); // cmp i1,IRAM_BLOCK1_END
UML_JMPc(block, COND_A, label); // ja label2
// 0x28000 ... 0x3ffff
UML_AND(block, I1, I1, 0x7fff); // and i1,i1,0x7fff (block 1 is mirrored in 0x28000...2ffff, 0x30000...0x37fff and 0x38000...3ffff)
UML_MULS(block, I1, I1, I1, 3); // muls i1,3
UML_STORE(block, block1_1, I1, I0, SIZE_WORD, SCALE_x2); // store [block1_1],i1,i0,word,scale_x2
UML_SHR(block, I0, I0, 16); // shr i0,i0,16
UML_STORE(block, block1, I1, I0, SIZE_WORD, SCALE_x2); // store [block1],i1,i0,word,scale_x2
UML_RET(block); // ret
UML_LABEL(block, label++); // label2:
UML_SHL(block, I1, I1, 3);
UML_WRITE(block, I1, I0, SIZE_DWORD, SPACE_PROGRAM);
UML_MOV(block, mem(&m_core->force_recompile), 1);
break;
case MEM_ACCESSOR_DM_READ32:
UML_CMP(block, I1, IRAM_END); // cmp i1,IRAM_END
UML_JMPc(block, COND_BE, label); // jbe label1
// 0x80000 ...
UML_SHL(block, I1, I1, 2); // shl i1,i1,2
UML_READ(block, I0, I1, SIZE_DWORD, SPACE_DATA); // read i0,i1,dword,SPACE_DATA
UML_RET(block);
UML_LABEL(block, label++); // label1:
UML_CMP(block, I1, IRAM_BLOCK0_START); // cmp i1,IRAM_BLOCK0_START
UML_JMPc(block, COND_B, label); // jb label2
UML_CMP(block, I1, IRAM_BLOCK0_END); // cmp i1,IRAM_BLOCK0_END
UML_JMPc(block, COND_A, label); // ja label2
// 0x20000 ... 0x27fff
UML_AND(block, I1, I1, 0x7fff); // and i1,i1,0x7fff
UML_LOAD(block, I0, block0, I1, SIZE_WORD, SCALE_x4); // load i0,[block0],i1,word,scale_x4
UML_SHL(block, I0, I0, 16); // shl i0,i0,16
UML_LOAD(block, I2, block0_1, I1, SIZE_WORD, SCALE_x4); // load i2,[block0_1],i1,word,scale_x4
UML_OR(block, I0, I0, I2); // or i0,i0,i2
UML_RET(block);
UML_LABEL(block, label++); // label2:
UML_CMP(block, I1, IRAM_BLOCK1_START); // cmp i1,IRAM_BLOCK1_START
UML_JMPc(block, COND_B, label); // jb label3
UML_CMP(block, I1, IRAM_BLOCK1_END); // cmp i1,IRAM_BLOCK1_END
UML_JMPc(block, COND_A, label); // ja label3
// 0x28000 ... 0x3ffff
UML_AND(block, I1, I1, 0x7fff); // and i1,i1,0x7fff
UML_LOAD(block, I0, block1, I1, SIZE_WORD, SCALE_x4); // load i0,[block1],i1,word,scale_x4
UML_SHL(block, I0, I0, 16); // shl i0,i0,16
UML_LOAD(block, I2, block1_1, I1, SIZE_WORD, SCALE_x4); // load i2,[block1_1],i1,word,scale_x4
UML_OR(block, I0, I0, I2); // or i0,i0,i2
UML_RET(block);
UML_LABEL(block, label++); // Label3:
UML_CMP(block, I1, IOP_REGISTER_END); // cmp i1,IOP_REGISTER_END
UML_JMPc(block, COND_A, label); // ja label4
// IOP registers
UML_MOV(block, mem(&m_core->arg0), I1); // mov [m_core->arg0],i1
UML_CALLC(block, cfunc_read_iop, this); // callc cfunc_read_iop
UML_MOV(block, I0, mem(&m_core->arg1)); // mov i0,[m_core->arg1]
UML_RET(block);
UML_LABEL(block, label++); // label4:
UML_CMP(block, I1, IRAM_SHORT_BLOCK0_START); // cmp i1,IRAM_SHORT_BLOCK0_START
UML_JMPc(block, COND_B, label+1); // jb label6
UML_CMP(block, I1, IRAM_SHORT_BLOCK0_END); // cmp i1,IRAM_SHORT_BLOCK0_END
UML_JMPc(block, COND_A, label+1); // ja label6
// 0x40000 ... 0x4ffff
UML_AND(block, I1, I1, 0xffff); // and i1,i1,0xffff
UML_XOR(block, I1, I1, 1); // xor i1,i1,1
UML_TEST(block, mem(&m_core->mode1), 0x4000); // test [m_core->mode1],0x4000
UML_JMPc(block, COND_Z, label); // jz label5
UML_LOADS(block, I0, block0, I1, SIZE_WORD, SCALE_x2); // loads i0,[block0],i1,word,scale_x2
UML_RET(block);
UML_LABEL(block, label++); // label5:
UML_LOAD(block, I0, block0, I1, SIZE_WORD, SCALE_x2); // load i0,[block0],i1,word,scale_x2
UML_RET(block);
UML_LABEL(block, label++); // label6:
UML_CMP(block, I1, IRAM_SHORT_BLOCK1_START); // cmp i1,IRAM_SHORT_BLOCK1_START
UML_JMPc(block, COND_B, label+1); // jb label8
UML_CMP(block, I1, IRAM_SHORT_BLOCK1_END); // cmp i1,IRAM_SHORT_BLOCK1_END
UML_JMPc(block, COND_A, label+1); // ja label8
// 0x50000 ... 0x7ffff
UML_AND(block, I1, I1, 0xffff); // and i1,i1,0xffff
UML_XOR(block, I1, I1, 1); // xor i1,i1,1
UML_TEST(block, mem(&m_core->mode1), 0x4000); // test [m_core->mode1],0x4000
UML_JMPc(block, COND_Z, label); // jz label7
UML_LOADS(block, I0, block1, I1, SIZE_WORD, SCALE_x2); // loads i0,[block1],i1,word,scale_x2
UML_RET(block);
UML_LABEL(block, label++); // label7:
UML_LOAD(block, I0, block1, I1, SIZE_WORD, SCALE_x2); // load i0,[block1],i1,word,scale_x2
UML_RET(block);
UML_LABEL(block, label++); // label8:
UML_SHL(block, I1, I1, 2);
UML_READ(block, I0, I1, SIZE_DWORD, SPACE_DATA);
break;
case MEM_ACCESSOR_DM_WRITE32:
#if WRITE_SNOOP
//UML_CMP(block, I1, 0x283eb);
UML_CMP(block, I1, 0x2400047);
UML_JMPc(block, COND_NE, label);
UML_MOV(block, mem(&m_core->arg0), I0);
UML_MOV(block, mem(&m_core->arg1), I1);
UML_MOV(block, mem(&m_core->arg2), mem(&m_core->pc));
UML_CALLC(block, cfunc_write_snoop, this);
UML_LABEL(block, label++);
#endif
UML_CMP(block, I1, IRAM_END); // cmp i1,IRAM_END
UML_JMPc(block, COND_BE, label); // jbe label1
// 0x80000 ...
UML_SHL(block, I1, I1, 2); // shl i1,i1,2
UML_WRITE(block, I1, I0, SIZE_DWORD, SPACE_DATA); // write i1,i0,dword,SPACE_DATA
UML_RET(block);
UML_LABEL(block, label++); // label1:
UML_CMP(block, I1, IRAM_BLOCK0_START); // cmp i1,IRAM_BLOCK0_START
UML_JMPc(block, COND_B, label); // jb label2
UML_CMP(block, I1, IRAM_BLOCK0_END); // cmp i1,IRAM_BLOCK0_END
UML_JMPc(block, COND_A, label); // ja label2
// 0x20000 ... 0x27fff
UML_AND(block, I1, I1, 0x7fff); // and i1,i1,0x7fff
UML_STORE(block, block0_1, I1, I0, SIZE_WORD, SCALE_x4); // store [block0_1],i1,i0,word,scale_x4
UML_SHR(block, I0, I0, 16); // shr i0,i0,16
UML_STORE(block, block0, I1, I0, SIZE_WORD, SCALE_x4); // store [block0],i1,i0,word,scale_x4
UML_RET(block);
UML_LABEL(block, label++); // label2:
UML_CMP(block, I1, IRAM_BLOCK1_START); // cmp i1,IRAM_BLOCK1_START
UML_JMPc(block, COND_B, label); // jb label3
UML_CMP(block, I1, IRAM_BLOCK1_END); // cmp i1,IRAM_BLOCK1_END
UML_JMPc(block, COND_A, label); // ja label3
// 0x28000 ... 0x3ffff
UML_AND(block, I1, I1, 0x7fff); // and i1,i1,0x7fff
UML_STORE(block, block1_1, I1, I0, SIZE_WORD, SCALE_x4); // store [block1_1],i1,i0,word,scale_x4
UML_SHR(block, I0, I0, 16); // shr i0,i0,16
UML_STORE(block, block1, I1, I0, SIZE_WORD, SCALE_x4); // store [block1],i1,i0,word,scale_x4
UML_RET(block);
UML_LABEL(block, label++); // Label3:
UML_CMP(block, I1, IOP_REGISTER_END); // cmp i1,IOP_REGISTER_END
UML_JMPc(block, COND_A, label); // ja label4
// IOP registers
UML_MOV(block, mem(&m_core->arg0), I1); // mov [m_core->arg0],i1
UML_MOV(block, mem(&m_core->arg1), I0); // mov [m_core->arg1],i0
UML_CALLC(block, cfunc_write_iop, this); // callc cfunc_write_iop
UML_RET(block);
UML_LABEL(block, label++); // label4:
UML_CMP(block, I1, IRAM_SHORT_BLOCK0_START); // cmp i1,IRAM_SHORT_BLOCK0_START
UML_JMPc(block, COND_B, label); // jb label5
UML_CMP(block, I1, IRAM_SHORT_BLOCK0_END); // cmp i1,IRAM_SHORT_BLOCK0_END
UML_JMPc(block, COND_A, label); // ja label5
// 0x40000 ... 0x4ffff
UML_AND(block, I1, I1, 0xffff); // and i1,i1,0xffff
UML_XOR(block, I1, I1, 1); // xor i1,i1,1
UML_STORE(block, block0, I1, I0, SIZE_WORD, SCALE_x2); // store [block0],i1,i0,word,scale_x2
UML_RET(block);
UML_LABEL(block, label++); // label5:
UML_CMP(block, I1, IRAM_SHORT_BLOCK1_START); // cmp i1,IRAM_SHORT_BLOCK1_START
UML_JMPc(block, COND_B, label); // jb label6
UML_CMP(block, I1, IRAM_SHORT_BLOCK1_END); // cmp i1,IRAM_SHORT_BLOCK1_END
UML_JMPc(block, COND_A, label); // ja label6
// 0x50000 ... 0x7ffff
UML_AND(block, I1, I1, 0xffff); // and i1,i1,0xffff
UML_XOR(block, I1, I1, 1); // xor i1,i1,1
UML_STORE(block, block1, I1, I0, SIZE_WORD, SCALE_x2); // store [block1],i1,i0,word,scale_x2
UML_RET(block);
UML_LABEL(block, label++); // label6:
UML_SHL(block, I1, I1, 2);
UML_WRITE(block, I1, I0, SIZE_DWORD, SPACE_DATA);
break;
}

View File

@ -4,201 +4,30 @@
uint32_t adsp21062_device::pm_read32(uint32_t address)
{
if (address >= 0x20000 && address < 0x28000)
{
uint32_t addr = (address & 0x7fff) * 3;
return (uint32_t)(m_internal_ram_block0[addr + 0] << 16) |
(m_internal_ram_block0[addr + 1]);
}
else if (address >= 0x28000 && address < 0x40000)
{
// block 1 is mirrored in 0x28000...2ffff, 0x30000...0x37fff and 0x38000...3ffff
uint32_t addr = (address & 0x7fff) * 3;
return (uint32_t)(m_internal_ram_block1[addr + 0] << 16) |
(m_internal_ram_block1[addr + 1]);
}
else {
fatalerror("SHARC: PM Bus Read32 %08X at %08X\n", address, m_core->pc);
}
return m_program->read_dword(address << 3);
}
void adsp21062_device::pm_write32(uint32_t address, uint32_t data)
{
if (address >= 0x20000 && address < 0x28000)
{
uint32_t addr = (address & 0x7fff) * 3;
m_internal_ram_block0[addr + 0] = (uint16_t)(data >> 16);
m_internal_ram_block0[addr + 1] = (uint16_t)(data);
return;
}
else if (address >= 0x28000 && address < 0x40000)
{
// block 1 is mirrored in 0x28000...2ffff, 0x30000...0x37fff and 0x38000...3ffff
uint32_t addr = (address & 0x7fff) * 3;
m_internal_ram_block1[addr + 0] = (uint16_t)(data >> 16);
m_internal_ram_block1[addr + 1] = (uint16_t)(data);
return;
}
else {
fatalerror("SHARC: PM Bus Write32 %08X, %08X at %08X\n", address, data, m_core->pc);
}
m_program->write_dword(address << 3, data);
}
uint64_t adsp21062_device::pm_read48(uint32_t address)
{
if ((address >= 0x20000 && address < 0x28000))
{
uint32_t addr = (address & 0x7fff) * 3;
return ((uint64_t)(m_internal_ram_block0[addr + 0]) << 32) |
((uint64_t)(m_internal_ram_block0[addr + 1]) << 16) |
((uint64_t)(m_internal_ram_block0[addr + 2]) << 0);
}
else if (address >= 0x28000 && address < 0x40000)
{
// block 1 is mirrored in 0x28000...2ffff, 0x30000...0x37fff and 0x38000...3ffff
uint32_t addr = (address & 0x7fff) * 3;
return ((uint64_t)(m_internal_ram_block1[addr + 0]) << 32) |
((uint64_t)(m_internal_ram_block1[addr + 1]) << 16) |
((uint64_t)(m_internal_ram_block1[addr + 2]) << 0);
}
else {
fatalerror("SHARC: PM Bus Read48 %08X at %08X\n", address, m_core->pc);
}
return 0;
return m_program->read_qword(address << 3);
}
void adsp21062_device::pm_write48(uint32_t address, uint64_t data)
{
if ((address >= 0x20000 && address < 0x28000))
{
uint32_t addr = (address & 0x7fff) * 3;
m_internal_ram_block0[addr + 0] = (uint16_t)(data >> 32);
m_internal_ram_block0[addr + 1] = (uint16_t)(data >> 16);
m_internal_ram_block0[addr + 2] = (uint16_t)(data);
return;
}
else if (address >= 0x28000 && address < 0x40000)
{
// block 1 is mirrored in 0x28000...2ffff, 0x30000...0x37fff and 0x38000...3ffff
uint32_t addr = (address & 0x7fff) * 3;
m_internal_ram_block1[addr + 0] = (uint16_t)(data >> 32);
m_internal_ram_block1[addr + 1] = (uint16_t)(data >> 16);
m_internal_ram_block1[addr + 2] = (uint16_t)(data);
return;
}
else {
fatalerror("SHARC: PM Bus Write48 %08X, %04X%08X at %08X\n", address, (uint16_t)(data >> 32),(uint32_t)data, m_core->pc);
}
m_program->write_qword(address << 3, data);
}
uint32_t adsp21062_device::dm_read32(uint32_t address)
{
if (address < 0x100)
{
return sharc_iop_r(address);
}
else if (address >= 0x20000 && address < 0x28000)
{
uint32_t addr = (address & 0x7fff) * 2;
return (uint32_t)(m_internal_ram_block0[addr + 0] << 16) |
(m_internal_ram_block0[addr + 1]);
}
else if (address >= 0x28000 && address < 0x40000)
{
// block 1 is mirrored in 0x28000...2ffff, 0x30000...0x37fff and 0x38000...3ffff
uint32_t addr = (address & 0x7fff) * 2;
return (uint32_t)(m_internal_ram_block1[addr + 0] << 16) |
(m_internal_ram_block1[addr + 1]);
}
// short word addressing
else if (address >= 0x40000 && address < 0x50000)
{
uint32_t addr = address & 0xffff;
uint16_t r = m_internal_ram_block0[addr ^ 1];
if (m_core->mode1 & 0x4000)
{
// sign-extend
return (int32_t)(int16_t)(r);
}
else
{
return (uint32_t)(r);
}
}
else if (address >= 0x50000 && address < 0x80000)
{
// block 1 is mirrored in 0x50000...5ffff, 0x60000...0x6ffff and 0x70000...7ffff
uint32_t addr = address & 0xffff;
uint16_t r = m_internal_ram_block1[addr ^ 1];
if (m_core->mode1 & 0x4000)
{
// sign-extend
return (int32_t)(int16_t)(r);
}
else
{
return (uint32_t)(r);
}
}
return m_data->read_dword(address << 2);
}
void adsp21062_device::dm_write32(uint32_t address, uint32_t data)
{
if (address < 0x100)
{
sharc_iop_w(address, data);
return;
}
else if (address >= 0x20000 && address < 0x28000)
{
uint32_t addr = (address & 0x7fff) * 2;
m_internal_ram_block0[addr + 0] = (uint16_t)(data >> 16);
m_internal_ram_block0[addr + 1] = (uint16_t)(data);
return;
}
else if (address >= 0x28000 && address < 0x40000)
{
// block 1 is mirrored in 0x28000...2ffff, 0x30000...0x37fff and 0x38000...3ffff
uint32_t addr = (address & 0x7fff) * 2;
m_internal_ram_block1[addr + 0] = (uint16_t)(data >> 16);
m_internal_ram_block1[addr + 1] = (uint16_t)(data);
return;
}
// short word addressing
else if (address >= 0x40000 && address < 0x50000)
{
uint32_t addr = address & 0xffff;
m_internal_ram_block0[addr ^ 1] = data;
return;
}
else if (address >= 0x50000 && address < 0x80000)
{
// block 1 is mirrored in 0x50000...5ffff, 0x60000...0x6ffff and 0x70000...7ffff
uint32_t addr = address & 0xffff;
m_internal_ram_block1[addr ^ 1] = data;
return;
}
m_data->write_dword(address << 2, data);
}

File diff suppressed because it is too large Load Diff

View File

@ -82,7 +82,7 @@ class tms32025_device : public cpu_device
public:
// construction/destruction
tms32025_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
tms32025_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
tms32025_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source, address_map_constructor map);
// static configuration helpers
template<class _Object> static devcb_base & set_bio_in_cb(device_t &device, _Object object) { return downcast<tms32025_device &>(device).m_bio_in.set_callback(object); }
@ -92,6 +92,19 @@ public:
template<class _Object> static devcb_base & set_dr_in_cb(device_t &device, _Object object) { return downcast<tms32025_device &>(device).m_dr_in.set_callback(object); }
template<class _Object> static devcb_base & set_dx_out_cb(device_t &device, _Object object) { return downcast<tms32025_device &>(device).m_dx_out.set_callback(object); }
DECLARE_READ16_MEMBER( drr_r);
DECLARE_WRITE16_MEMBER(drr_w);
DECLARE_READ16_MEMBER( dxr_r);
DECLARE_WRITE16_MEMBER(dxr_w);
DECLARE_READ16_MEMBER( tim_r);
DECLARE_WRITE16_MEMBER(tim_w);
DECLARE_READ16_MEMBER( prd_r);
DECLARE_WRITE16_MEMBER(prd_w);
DECLARE_READ16_MEMBER( imr_r);
DECLARE_WRITE16_MEMBER(imr_w);
DECLARE_READ16_MEMBER( greg_r);
DECLARE_WRITE16_MEMBER(greg_w);
protected:
// device-level overrides
virtual void device_start() override;
@ -106,13 +119,8 @@ protected:
// device_memory_interface overrides
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : ( (spacenum == AS_DATA) ? &m_data_config : nullptr ) ); }
virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, uint64_t &value) override;
virtual bool memory_write(address_spacenum spacenum, offs_t offset, int size, uint64_t value) override;
virtual bool memory_readop(offs_t offset, int size, uint64_t &value) override;
// device_state_interface overrides
virtual void state_import(const device_state_entry &entry) override;
virtual void state_export(const device_state_entry &entry) override;
virtual void state_string_export(const device_state_entry &entry, std::string &str) const override;
// device_disasm_interface overrides
@ -120,11 +128,22 @@ protected:
virtual uint32_t disasm_max_opcode_bytes() const override { return 4; }
virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override;
private:
void common_reset();
address_space_config m_program_config;
address_space_config m_data_config;
address_space_config m_io_config;
required_shared_ptr<uint16_t> m_b0;
required_shared_ptr<uint16_t> m_b1;
required_shared_ptr<uint16_t> m_b2;
optional_shared_ptr<uint16_t> m_b3;
address_space *m_program;
direct_read_data *m_direct;
address_space *m_data;
address_space *m_io;
typedef void ( tms32025_device::*opcode_func ) ();
struct tms32025_opcode
{
@ -156,9 +175,8 @@ private:
uint16_t m_AR[8];
uint16_t m_STACK[8];
PAIR m_ALU;
protected:
uint16_t m_intRAM[0x800];
private:
uint16_t m_drr, m_dxr, m_tim, m_prd, m_imr, m_greg;
uint8_t m_timerover;
/********************** Status data ****************************/
@ -176,18 +194,6 @@ private:
int m_mHackIgnoreARP; /* special handling for lst, lst1 instructions */
int m_waiting_for_serial_frame;
address_space *m_program;
direct_read_data *m_direct;
address_space *m_data;
address_space *m_io;
uint16_t *m_pgmmap[0x200];
protected:
uint16_t *m_datamap[0x200];
private:
uint32_t m_debugger_temp;
inline void CLR0(uint16_t flag);
inline void SET0(uint16_t flag);
inline void CLR1(uint16_t flag);
@ -250,9 +256,9 @@ private:
void call();
void cmpl();
void cmpr();
void cnfd();
void cnfp();
void conf();
virtual void cnfd();
virtual void cnfp();
virtual void conf();
void dint();
void dmov();
void eint();
@ -380,6 +386,9 @@ public:
protected:
virtual void device_reset() override;
virtual void cnfd() override;
virtual void cnfp() override;
virtual void conf() override;
};

View File

@ -631,26 +631,6 @@ WRITE16_MEMBER( tms32051_device::cpuregs_w )
}
bool tms32051_device::memory_read(address_spacenum spacenum, offs_t offset, int size, uint64_t &value)
{
/* TODO: alignment if offset is odd */
if (spacenum == AS_PROGRAM)
{
value = (PM_READ16(offset>>1));
}
else if (spacenum == AS_DATA)
{
value = (DM_READ16(offset>>1));
}
else if (spacenum == AS_IO)
{
value = m_io->read_word(offset);
}
return 1;
}
void tms32053_device::device_reset()
{
// reset registers

View File

@ -77,7 +77,6 @@ protected:
// device_memory_interface overrides
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : ( (spacenum == AS_DATA) ? &m_data_config : nullptr ) ); }
virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, uint64_t &value) override;
// device_disasm_interface overrides
virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }

View File

@ -3126,6 +3126,8 @@ OP(op,ff) { rst(0x38);
void z80_device::take_nmi()
{
PRVPC = 0xffff; // HACK: segag80r protection kludge
/* Check if processor was halted */
leave_halt();
@ -3146,6 +3148,8 @@ void z80_device::take_interrupt()
{
int irq_vector;
PRVPC = 0xffff; // HACK: segag80r protection kludge
/* Check if processor was halted */
leave_halt();
@ -3230,6 +3234,8 @@ void z80_device::take_interrupt()
void nsc800_device::take_interrupt_nsc800()
{
PRVPC = 0xffff; // HACK: segag80r protection kludge
/* Check if processor was halted */
leave_halt();

View File

@ -294,18 +294,9 @@ void i8155_device::device_timer(emu_timer &timer, device_timer_id id, int param,
{
if (LOG) logerror("8155 Timer Count Reached\n");
switch (m_command & COMMAND_TM_MASK)
{
case COMMAND_TM_STOP_AFTER_TC:
// stop timer
m_timer->enable(0);
if (LOG) logerror("8155 Timer Stopped\n");
break;
}
switch (get_timer_mode())
{
case TIMER_MODE_LOW:
case TIMER_MODE_SQUARE_WAVE:
// toggle timer output
m_to = !m_to;
@ -313,15 +304,8 @@ void i8155_device::device_timer(emu_timer &timer, device_timer_id id, int param,
break;
case TIMER_MODE_SINGLE_PULSE:
// single pulse upon TC being reached
pulse_timer_output();
// clear timer mode setting
m_command &= ~COMMAND_TM_MASK;
break;
case TIMER_MODE_AUTOMATIC_RELOAD:
// automatic reload, i.e. single pulse every time TC is reached
// pulse upon TC being reached
pulse_timer_output();
break;
}
@ -329,8 +313,28 @@ void i8155_device::device_timer(emu_timer &timer, device_timer_id id, int param,
// set timer flag
m_status |= STATUS_TIMER;
// reload timer counter
m_counter = m_count_length & 0x3fff;
if ((m_command & COMMAND_TM_MASK) == COMMAND_TM_START)
{
// load new timer counter
m_counter = m_count_length & 0x3fff;
if (LOG) logerror("8155 Timer New Start\n");
}
else if ((m_command & COMMAND_TM_MASK) == COMMAND_TM_STOP_AFTER_TC || get_timer_mode() == TIMER_MODE_SINGLE_PULSE)
{
// stop timer
m_timer->enable(0);
if (LOG) logerror("8155 Timer Stopped\n");
}
else
{
// automatically reload the counter
m_counter = m_count_length & 0x3fff;
}
// clear timer command
m_command &= ~COMMAND_TM_MASK;
}
}
@ -455,6 +459,9 @@ void i8155_device::register_w(int offset, uint8_t data)
// load mode and CNT length and start immediately after loading (if timer is not running)
m_counter = m_count_length & 0x3fff;
m_timer->adjust(attotime::zero, 0, attotime::from_hz(clock()));
// clear timer command so this won't execute twice
m_command &= ~COMMAND_TM_MASK;
}
break;
}

View File

@ -321,7 +321,7 @@ void laserdisc_device::device_start()
init_audio();
// register callbacks
machine().configuration().config_register("laserdisc", config_saveload_delegate(&laserdisc_device::config_load, this), config_saveload_delegate(&laserdisc_device::config_save, this));
machine().configuration().config_register("laserdisc", config_load_delegate(&laserdisc_device::config_load, this), config_save_delegate(&laserdisc_device::config_save, this));
}
@ -1142,10 +1142,10 @@ void laserdisc_device::process_track_data()
// configuration file
//-------------------------------------------------
void laserdisc_device::config_load(config_type cfg_type, xml_data_node *parentnode)
void laserdisc_device::config_load(config_type cfg_type, util::xml::data_node const *parentnode)
{
// we only care about game files
if (cfg_type != config_type::CONFIG_TYPE_GAME)
if (cfg_type != config_type::GAME)
return;
// might not have any data
@ -1153,13 +1153,13 @@ void laserdisc_device::config_load(config_type cfg_type, xml_data_node *parentno
return;
// iterate over overlay nodes
for (xml_data_node const *ldnode = parentnode->get_child("device"); ldnode != nullptr; ldnode = ldnode->get_next_sibling("device"))
for (util::xml::data_node const *ldnode = parentnode->get_child("device"); ldnode != nullptr; ldnode = ldnode->get_next_sibling("device"))
{
const char *devtag = ldnode->get_attribute_string("tag", "");
if (strcmp(devtag, tag()) == 0)
{
// handle the overlay node
xml_data_node const *const overnode = ldnode->get_child("overlay");
util::xml::data_node const *const overnode = ldnode->get_child("overlay");
if (overnode != nullptr)
{
// fetch positioning controls
@ -1178,21 +1178,21 @@ void laserdisc_device::config_load(config_type cfg_type, xml_data_node *parentno
// file
//-------------------------------------------------
void laserdisc_device::config_save(config_type cfg_type, xml_data_node *parentnode)
void laserdisc_device::config_save(config_type cfg_type, util::xml::data_node *parentnode)
{
// we only care about game files
if (cfg_type != config_type::CONFIG_TYPE_GAME)
if (cfg_type != config_type::GAME)
return;
// create a node
xml_data_node *const ldnode = parentnode->add_child("device", nullptr);
util::xml::data_node *const ldnode = parentnode->add_child("device", nullptr);
if (ldnode != nullptr)
{
// output the basics
ldnode->set_attribute("tag", tag());
// add an overlay node
xml_data_node *const overnode = ldnode->add_child("overlay", nullptr);
util::xml::data_node *const overnode = ldnode->add_child("overlay", nullptr);
bool changed = false;
if (overnode != nullptr)
{

View File

@ -286,8 +286,8 @@ private:
void read_track_data();
static void *read_async_static(void *param, int threadid);
void process_track_data();
void config_load(config_type cfg_type, xml_data_node *parentnode);
void config_save(config_type cfg_type, xml_data_node *parentnode);
void config_load(config_type cfg_type, util::xml::data_node const *parentnode);
void config_save(config_type cfg_type, util::xml::data_node *parentnode);
// configuration
laserdisc_get_disc_delegate m_getdisc_callback;

View File

@ -284,7 +284,7 @@ void pci_device::map_device(uint64_t memory_window_start, uint64_t memory_window
case 5: space->install_readwrite_handler(start, end, read32_delegate(FUNC(pci_device::unmapped5_r), this), write32_delegate(FUNC(pci_device::unmapped5_w), this)); break;
}
space->install_device_delegate(start, end, *this, bi.map);
space->install_device_delegate(start, end, *bi.device, bi.map);
logerror("map %s at %0*x-%0*x\n", bi.map.name(), bi.flags & M_IO ? 4 : 8, uint32_t(start), bi.flags & M_IO ? 4 : 8, uint32_t(end));
}
@ -317,11 +317,12 @@ void pci_device::skip_map_regs(int count)
assert(bank_reg_count <= 6);
}
void pci_device::add_map(uint64_t size, int flags, address_map_delegate &map)
void pci_device::add_map(uint64_t size, int flags, address_map_delegate &map, device_t *relative_to)
{
assert(bank_count < 6);
int bid = bank_count++;
bank_infos[bid].map = map;
bank_infos[bid].device = relative_to ? relative_to : this;
bank_infos[bid].adr = 0;
bank_infos[bid].size = size;
bank_infos[bid].flags = flags;

View File

@ -94,8 +94,8 @@ protected:
};
struct bank_info {
// One of the two
address_map_delegate map;
device_t *device;
uint64_t adr;
uint32_t size;
@ -123,7 +123,7 @@ protected:
virtual void device_reset() override;
void skip_map_regs(int count);
void add_map(uint64_t size, int flags, address_map_delegate &map);
void add_map(uint64_t size, int flags, address_map_delegate &map, device_t *relative_to = nullptr);
template <typename T> void add_map(uint64_t size, int flags, void (T::*map)(address_map &map), const char *name) {
address_map_delegate delegate(map, name, static_cast<T *>(this));
add_map(size, flags, delegate);

View File

@ -50,32 +50,22 @@ pci9050_device::pci9050_device(const machine_config &mconfig, const char *tag, d
}
}
void pci9050_device::set_map(int id, address_map_constructor map, const char *name, device_t *device)
void pci9050_device::set_map(int id, const address_map_delegate &map, device_t *device)
{
m_maps[id] = map;
m_names[id] = name;
m_devices[id] = device;
}
void pci9050_device::device_start()
{
typedef void (pci9050_device::*tramp_t)(address_map &);
static const tramp_t trampolines[4] = {
&pci9050_device::map_trampoline<0>,
&pci9050_device::map_trampoline<1>,
&pci9050_device::map_trampoline<2>,
&pci9050_device::map_trampoline<3>
};
pci_device::device_start();
add_map(0x80, M_MEM, FUNC(pci9050_device::map)); // map 0 is our config registers, mem space
add_map(0x80, M_IO, FUNC(pci9050_device::map)); // map 1 is our config registers, i/o space
for(int i=0; i<4; i++)
if(m_names[i])
// add_map(0, M_MEM | M_DISABLED, m_maps[i], m_names[i], m_devices[i]);
add_map(0, M_MEM | M_DISABLED, trampolines[i], m_names[i]);
if(!m_maps[i].isnull())
add_map(0, M_MEM | M_DISABLED, m_maps[i], m_devices[i]);
else
add_map(0, M_MEM | M_DISABLED, FUNC(pci9050_device::empty));

View File

@ -17,7 +17,7 @@
MCFG_PCI_DEVICE_ADD(_tag, PCI9050, 0x10b59050, 0x01, 0x06800000, 0x10b59050)
#define MCFG_PCI9050_SET_MAP(id, map) \
downcast<pci9050_device *>(device)->set_map(id, ADDRESS_MAP_NAME(map), #map, owner);
downcast<pci9050_device *>(device)->set_map(id, address_map_delegate(ADDRESS_MAP_NAME(map), #map), owner);
#define MCFG_PCI9050_USER_INPUT_CALLBACK(_write) \
devcb = &pci9050_device::set_user_input_callback(*device, DEVCB_##_write);
@ -29,7 +29,7 @@ class pci9050_device :
public pci_device
{
public:
pci9050_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
pci9050_device(const machine_config &mconfig, const char *tag, device_t *device, uint32_t clock);
// PCI9050 I/O register space handlers
DECLARE_READ32_MEMBER( lasrr_r );
@ -54,7 +54,7 @@ public:
template<class _Object> static devcb_base &set_user_input_callback(device_t &device, _Object object) { return downcast<pci9050_device &>(device).m_user_input_handler.set_callback(object); }
template<class _Object> static devcb_base &set_user_output_callback(device_t &device, _Object object) { return downcast<pci9050_device &>(device).m_user_output_handler.set_callback(object); }
void set_map(int id, address_map_constructor map, const char *name, device_t *device);
void set_map(int id, const address_map_delegate &map, device_t *device);
protected:
virtual void device_start() override;
@ -67,7 +67,7 @@ private:
const char *m_names[4];
device_t *m_devices[4];
address_map_constructor m_maps[4];
address_map_delegate m_maps[4];
uint32_t m_lasrr[4], m_lasba[4], m_lasbrd[4], m_csbase[4];
uint32_t m_eromrr, m_eromba, m_erombrd, m_intcsr, m_cntrl;
@ -75,10 +75,6 @@ private:
void remap_local(int id);
void remap_rom();
template<int id> void map_trampoline(address_map &map) {
m_maps[id](map);
}
devcb_read32 m_user_input_handler;
devcb_write32 m_user_output_handler;

View File

@ -1772,17 +1772,19 @@ void z80scc_channel::do_sccreg_wr1(uint8_t data)
break;
case WR1_RX_INT_FIRST:
LOG(("- Receiver Interrupt on First Character\n"));
break;
case WR1_RX_INT_ALL_PARITY:
LOG(("- Receiver Interrupt on All Characters, Parity Affects Vector\n"));
LOG(("- Receiver Interrupt on First Character or Special Conditions\n"));
break;
case WR1_RX_INT_ALL:
LOG(("- Receiver Interrupt on All Characters\n"));
LOG(("- Receiver Interrupt on All Characters or Special Conditions\n"));
break;
case WR1_RX_INT_PARITY:
LOG(("- Receiver Interrupt on Special Conditions only\n"));
break;
}
if ((data & WR1_RX_INT_MODE_MASK) == WR1_PARITY_IS_SPEC_COND)
LOG(("- Parity error is a Special Condition\n"));
m_uart->check_interrupts();
}
@ -2266,13 +2268,13 @@ uint8_t z80scc_channel::data_read()
received into the other bytes of the Receive FIFO.*/
// load data from the FIFO
data = m_rx_fifo_rp_data();
data = m_rx_data_fifo[m_rx_fifo_rp];
// load error status from the FIFO
m_rr1 = (m_rr1 & ~(RR1_CRC_FRAMING_ERROR | RR1_RX_OVERRUN_ERROR | RR1_PARITY_ERROR)) | m_rx_error_fifo[m_rx_fifo_rp];
// trigger interrupt and lock the fifo if an error is present
if (m_rr1 & (RR1_CRC_FRAMING_ERROR | RR1_RX_OVERRUN_ERROR | RR1_PARITY_ERROR))
if (m_rr1 & (RR1_CRC_FRAMING_ERROR | RR1_RX_OVERRUN_ERROR | ((m_wr1 & WR1_PARITY_IS_SPEC_COND) ? RR1_PARITY_ERROR : 0)))
{
logerror("Rx Error %02x\n", m_rr1 & (RR1_CRC_FRAMING_ERROR | RR1_RX_OVERRUN_ERROR | RR1_PARITY_ERROR));
m_uart->trigger_interrupt(m_index, INT_SPECIAL);
@ -2293,18 +2295,6 @@ uint8_t z80scc_channel::data_read()
return data;
}
/* Get data from top of fifo data but restore read pointer in case of exit latch lock */
uint8_t z80scc_channel::m_rx_fifo_rp_data()
{
uint8_t data;
uint8_t old_rp = m_rx_fifo_rp;
m_rx_fifo_rp_step();
data = m_rx_data_fifo[m_rx_fifo_rp];
m_rx_fifo_rp = old_rp;
return data;
}
/* Step read pointer */
void z80scc_channel::m_rx_fifo_rp_step()
{

View File

@ -409,8 +409,8 @@ protected:
WR1_RX_INT_MODE_MASK = 0x18,
WR1_RX_INT_DISABLE = 0x00,
WR1_RX_INT_FIRST = 0x08,
WR1_RX_INT_ALL_PARITY = 0x10,
WR1_RX_INT_ALL = 0x18,
WR1_RX_INT_ALL = 0x10,
WR1_RX_INT_PARITY = 0x18,
WR1_WRDY_ON_RX_TX = 0x20,
WR1_WRDY_FUNCTION = 0x40,
WR1_WRDY_ENABLE = 0x80

View File

@ -0,0 +1,91 @@
// license: GPL-2.0+
// copyright-holders: Dirk Best
/***************************************************************************
PMI DAC-76 COMDAC
Companding D/A Converter
***************************************************************************/
#include "dac76.h"
//**************************************************************************
// CONSTEXPR DEFINITIONS
//**************************************************************************
constexpr int dac76_device::m_level[];
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
const device_type DAC76 = &device_creator<dac76_device>;
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// dac76_device - constructor
//-------------------------------------------------
dac76_device::dac76_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, DAC76, "DAC-76 COMDAC", tag, owner, clock, "dac76", __FILE__),
device_sound_interface(mconfig, *this),
m_stream(nullptr),
m_chord(0),
m_step(0),
m_sb(false)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void dac76_device::device_start()
{
// create sound stream
m_stream = machine().sound().stream_alloc(*this, 0, 1, machine().sample_rate() * 8);
// register for save states
save_item(NAME(m_chord));
save_item(NAME(m_step));
save_item(NAME(m_sb));
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void dac76_device::device_reset()
{
m_chord = 0;
m_step = 0;
m_sb = false;
}
//-------------------------------------------------
// sound_stream_update - handle update requests for
// our sound stream
//-------------------------------------------------
void dac76_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// get current output level
int step_size = (2 << m_chord);
stream_sample_t vout = m_level[m_chord] + m_step * step_size;
// apply sign bit
vout *= (m_sb ? +1 : -1);
// range is 0-8031, normalize to about 0-32768 range
vout *= 4;
for (int i = 0; i < samples; i++)
outputs[0][i] = vout;
}

76
src/devices/sound/dac76.h Normal file
View File

@ -0,0 +1,76 @@
// license: GPL-2.0+
// copyright-holders: Dirk Best
/***************************************************************************
PMI DAC-76 COMDAC
Companding D/A Converter
___ ___
E/D 1 |* u | 10 VLC
SB 2 | | 11 VR+
B1 3 | | 12 VR-
B2 4 | | 13 V-
B3 5 | | 14 IOE+
B4 6 | | 15 IOE-
B5 7 | | 16 IOD+
B6 8 | | 17 IOD-
B7 9 |_______| 18 V+
***************************************************************************/
#pragma once
#ifndef __DAC76_H__
#define __DAC76_H__
#include "emu.h"
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
class dac76_device : public device_t, public device_sound_interface
{
public:
// construction/destruction
dac76_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// chord
DECLARE_WRITE_LINE_MEMBER(b1_w) { m_chord &= ~(1 << 2); m_chord |= (state << 2); };
DECLARE_WRITE_LINE_MEMBER(b2_w) { m_chord &= ~(1 << 1); m_chord |= (state << 1); };
DECLARE_WRITE_LINE_MEMBER(b3_w) { m_chord &= ~(1 << 0); m_chord |= (state << 0); };
// step
DECLARE_WRITE_LINE_MEMBER(b4_w) { m_step &= ~(1 << 3); m_step |= (state << 3); };
DECLARE_WRITE_LINE_MEMBER(b5_w) { m_step &= ~(1 << 2); m_step |= (state << 2); };
DECLARE_WRITE_LINE_MEMBER(b6_w) { m_step &= ~(1 << 1); m_step |= (state << 1); };
DECLARE_WRITE_LINE_MEMBER(b7_w) { m_step &= ~(1 << 0); m_step |= (state << 0); };
// sign bit
DECLARE_WRITE_LINE_MEMBER(sb_w) { m_sb = bool(state); };
void update() { m_stream->update(); }
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;
private:
static constexpr int m_level[8] = { 0, 33, 99, 231, 495, 1023, 2079, 4191 };
sound_stream *m_stream;
uint8_t m_chord; // 4-bit
uint8_t m_step; // 3-bit
bool m_sb;
};
// device type definition
extern const device_type DAC76;
#endif // __DAC76_H__

View File

@ -0,0 +1,90 @@
// license: GPL-2.0+
// copyright-holders: Dirk Best
/***************************************************************************
National Semiconductor MM5837
Digital Noise Source
***************************************************************************/
#include "mm5837.h"
//**************************************************************************
// CONSTEXPR DEFINITIONS
//**************************************************************************
constexpr int mm5837_device::m_frequency[];
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
const device_type MM5837 = &device_creator<mm5837_device>;
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// mm5837_device - constructor
//-------------------------------------------------
mm5837_device::mm5837_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, MM5837, "MM5837 Digital Noise Source", tag, owner, clock, "mm5837", __FILE__),
m_output_cb(*this),
m_vdd(0),
m_timer(nullptr),
m_shift(0)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void mm5837_device::device_start()
{
// resolve callbacks
m_output_cb.resolve_safe();
// get timer
m_timer = timer_alloc(0);
// register for save states
save_item(NAME(m_shift));
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void mm5837_device::device_reset()
{
// initialize with something
m_shift = 123456;
if (m_vdd < 16)
m_timer->adjust(attotime::zero, 0, attotime::from_hz(m_frequency[m_vdd]));
else
throw emu_fatalerror("%s: Invalid voltage: %d\n", tag(), m_vdd);
}
//-------------------------------------------------
// device_timer - handle timer callbacks
//-------------------------------------------------
void mm5837_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
int tap_14 = BIT(m_shift, 13);
int tap_17 = BIT(m_shift, 16);
int zero = (m_shift == 0) ? 1 : 0;
m_shift <<= 1;
m_shift |= tap_14 ^ tap_17 ^ zero;
m_output_cb(BIT(m_shift, 16));
}

View File

@ -0,0 +1,81 @@
// license: GPL-2.0+
// copyright-holders: Dirk Best
/***************************************************************************
National Semiconductor MM5837
Digital Noise Source
___ ___
VDD 1 |* u | 5 N/C
VGG 2 | | 6 N/C
OUTPUT 3 | | 7 N/C
VSS 4 |_______| 8 N/C
***************************************************************************/
#pragma once
#ifndef __MM5837_H__
#define __MM5837_H__
#include "emu.h"
//**************************************************************************
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_MM5837_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, MM5837, 0)
#define MCFG_MM5837_VDD(_voltage) \
mm5837_device::set_vdd_voltage(*device, _voltage);
#define MCFG_MM5837_OUTPUT_CB(_devcb) \
devcb = &mm5837_device::set_output_callback(*device, DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
class mm5837_device : public device_t
{
public:
// construction/destruction
mm5837_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration
static void set_vdd_voltage(device_t &device, int voltage) { downcast<mm5837_device &>(device).m_vdd = voltage; }
template<class _Object> static devcb_base &set_output_callback(device_t &device, _Object object)
{ return downcast<mm5837_device &>(device).m_output_cb.set_callback(object); }
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
private:
// taken from the book 'mims circuit scrapbook, vol. 1'
// this is the frequency the chip runs at when given a vdd voltage of -0 to -15
static constexpr int m_frequency[16] = { 0, 0, 0, 0, 0, 0, 1, 2267, 8731, 16382, 23531, 32564, 38347, 40010, 37800, 33173 };
// callbacks
devcb_write_line m_output_cb;
// voltage (as positive number)
int m_vdd;
// output timer
emu_timer *m_timer;
// state
uint32_t m_shift;
};
// device type definition
extern const device_type MM5837;
#endif // __MM5837_H__

View File

@ -117,6 +117,8 @@ void zeus2_device::device_reset()
memset(m_zeusbase, 0, sizeof(m_zeusbase[0]) * 0x80);
memset(m_renderRegs, 0, sizeof(m_renderRegs[0]) * 0x50);
m_curUCodeSrc = 0;
m_curPalTableSrc = 0;
m_palSize = 0;
zbase = 32.0f;
m_yScale = 0;
@ -192,7 +194,7 @@ void zeus2_device::device_stop()
uint32_t zeus2_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
// Wait until configuration is completed before transfering anything
if (m_zeusbase[0x30] == 0)
if (!(m_zeusbase[0x10] & 0x20))
return 0;
int x, y;
@ -206,14 +208,12 @@ uint32_t zeus2_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap
//if (!machine().input().code_pressed(KEYCODE_W))
if (1)
{
int xoffs = screen.visible_area().min_x;
for (y = cliprect.min_y; y <= cliprect.max_y; y++)
{
uint32_t *colorptr = &m_frameColor[frame_addr_from_xy(0, y, false)];
uint32_t *dest = &bitmap.pix32(y);
for (x = cliprect.min_x; x <= cliprect.max_x; x++) {
uint32_t bufX = x - xoffs;
dest[x] = colorptr[bufX];
dest[x] = colorptr[x];
}
}
}
@ -398,90 +398,105 @@ void zeus2_device::zeus2_register_update(offs_t offset, uint32_t oldval, int log
int_timer->adjust(attotime::from_nsec(500));
break;
case 0x20:
/* toggles between two values based on the page:
Page # m_zeusbase[0x20] m_zeusbase[0x38]
------ -------------- --------------
0 $04000190 $00000000
1 $04000000 $01900000
*/
zeus2_pointer_write(m_zeusbase[0x20] >> 24, (m_zeusbase[0x20] & 0xffffff), logit);
break;
case 0x22:
if (logit)
logerror("\tRend Setup 0");
break;
case 0x23:
if (logit)
logerror("\tRend Setup 1");
break;
case 0x24:
if (logit)
logerror("\tRend Setup 4");
break;
case 0x2a:
// 0x000000c0 = bilenear off
if (logit)
logerror("\tRend Force Off");
break;
case 0x2b:
if (logit)
logerror("\tRend Force On");
break;
case 0x2c:
if (logit)
logerror("\tRend AE Flag");
break;
case 0x2d:
if (logit)
logerror("\tRend AF Flag");
break;
case 0x2f:
if (logit)
logerror("\tPixel Proc Setup");
break;
case 0x30:
case 0x10:
// BITS 11 - 10 COL SIZE / BANK FOR WR1
// BITS 9 - 8 COL SIZE / BANK FOR WR0
if (logit) logerror("\tSys Setup");
if (m_zeusbase[0x10] & 0x20)
{
m_yScale = (((m_zeusbase[0x39] >> 16) & 0xfff) < 0x100) ? 0 : 1;
int hor = ((m_zeusbase[0x34] & 0xffff) - (m_zeusbase[0x33] >> 16)) << m_yScale;
int ver = ((m_zeusbase[0x35] & 0xffff) + 1) << m_yScale;
popmessage("reg[30]: %08X Screen: %dH X %dV yScale: %d", m_zeusbase[0x30], hor, ver, m_yScale);
}
m_screen->update_partial(m_screen->vpos());
{
int vtotal = (m_zeusbase[0x37] & 0xffff) << m_yScale;
int htotal = (m_zeusbase[0x34] >> 16) << m_yScale;
rectangle visarea((m_zeusbase[0x33] >> 16) << m_yScale, htotal - 1, 0, (m_zeusbase[0x35] & 0xffff) << m_yScale);
if (htotal > 0 && vtotal > 0 && visarea.min_x < visarea.max_x && visarea.max_y < vtotal)
{
m_screen->configure(htotal, vtotal, visarea, HZ_TO_ATTOSECONDS((double)ZEUS2_VIDEO_CLOCK / 4.0 / (htotal * vtotal)));
zeus_cliprect = visarea;
zeus_cliprect.max_x -= zeus_cliprect.min_x;
zeus_cliprect.min_x = 0;
// Startup vblank timer
vblank_timer->adjust(attotime::from_usec(1));
}
//rectangle visarea((m_zeusbase[0x33] >> 16) << m_yScale, htotal - 1, 0, (m_zeusbase[0x35] & 0xffff) << m_yScale);
rectangle visarea(0, hor-1, 0, ver-1);
m_screen->configure(htotal, vtotal, visarea, HZ_TO_ATTOSECONDS((double)ZEUS2_VIDEO_CLOCK / 4.0 / (htotal * vtotal)));
zeus_cliprect = visarea;
zeus_cliprect.max_x -= zeus_cliprect.min_x;
zeus_cliprect.min_x = 0;
// Startup vblank timer
vblank_timer->adjust(attotime::from_usec(1));
}
break;
case 0x33:
case 0x34:
case 0x35:
case 0x36:
case 0x37:
case 0x11:
if (logit) logerror("\tHost Interface Setup");
break;
case 0x12:
if (logit) logerror("\tPLL Setup");
break;
case 0x13:
if (logit) logerror("\tZeus Test Out");
break;
case 0x20:
zeus2_pointer_write(m_zeusbase[0x20] >> 24, (m_zeusbase[0x20] & 0xffffff), logit);
break;
case 0x22:
if (logit) logerror("\tRend Setup 0");
break;
case 0x23:
if (logit) logerror("\tRend Setup 1");
break;
case 0x24:
// 0x601 == test mode
if (logit) logerror("\tRend Setup 4");
break;
case 0x2a:
// 0x000000c0 = bilenear off
if (logit) logerror("\tRend Force Off");
break;
case 0x2b:
if (logit) logerror("\tRend Force On");
break;
case 0x2c:
if (logit) logerror("\tRend AE Flag");
break;
case 0x2d:
if (logit) logerror("\tRend AF Flag");
break;
case 0x2f:
if (logit) logerror("\tPixel Proc Setup");
break;
case 0x30:
if (logit) logerror("\tCRT Controller Setup = %08X", m_zeusbase[offset]);
break;
case 0x31:
if (logit) logerror("\tDotClk Sel 1 : DotClk Sel 2 = %08X", m_zeusbase[offset]);
break;
case 0x32:
if (logit) logerror("\tHSync End = %i HSync Start = %i", (m_zeusbase[offset] >> 16), m_zeusbase[offset] & 0xffff);
break;
case 0x33:
if (logit) logerror("\tHBlank End = %i Update Start = %i", (m_zeusbase[offset] >> 16), m_zeusbase[offset] & 0xffff);
break;
case 0x34:
if (logit) logerror("\tHTotal = %i HBlank Start = %i", (m_zeusbase[offset] >> 16), m_zeusbase[offset] & 0xffff);
break;
case 0x35:
if (logit) logerror("\tVSync Start = %i VBlank Start = %i", (m_zeusbase[offset] >> 16), m_zeusbase[offset] & 0xffff);
break;
case 0x36:
if (logit) logerror("\tVTotal = %i VSync End = %i", (m_zeusbase[offset] >> 16), m_zeusbase[offset] & 0xffff);
break;
case 0x37:
if (logit) logerror("\tVTotal = %i", m_zeusbase[offset]);
break;
case 0x38:
{
uint32_t temp = m_zeusbase[0x38];
@ -492,6 +507,9 @@ void zeus2_device::zeus2_register_update(offs_t offset, uint32_t oldval, int log
m_zeusbase[0x38] = temp;
}
break;
case 0x39:
if (logit) logerror("\tLine Length = %i FIFO AF = %i FIFO AE = %i", (m_zeusbase[offset] >> 16) & 0xfff, (m_zeusbase[offset] >> 8) & 0xff, m_zeusbase[offset] & 0xff);
break;
case 0x40:
{
@ -511,24 +529,30 @@ void zeus2_device::zeus2_register_update(offs_t offset, uint32_t oldval, int log
m_zeusbase[0x41] &= ~0xfc00;
}
}
// mwskinsa 0xE085001F -- light table?
// thegrid 0x0055002C ???
// crusnexo 0x005500FF ???
// crusnexo 0x00A20000 ???
}
else if (code == 0x4) {
// Load pal table from RGB555
if (logit)
logerror("\t-- pal table rgb555 load: control: %08X addr: %08X", m_zeusbase[0x40], m_zeusbase[0x41]);
poly->wait("PAL_TABLE_WRITE");
m_curPalTableSrc = m_zeusbase[0x41];
void *dataPtr = waveram0_ptr_from_expanded_addr(m_zeusbase[0x41]);
load_pal_table(dataPtr, m_zeusbase[0x40], 0, logit);
}
else if (code == 0x5) {
// Zeus burst from waveram
// Zeus microcode burst from waveram
if (logit)
logerror("\t-- ucode load: control: %08X addr: %08X", m_zeusbase[0x40], m_zeusbase[0x41]);
// Load ucode from waveram
poly->wait("UCODE_LOAD");
void *dataPtr = waveram0_ptr_from_expanded_addr(m_zeusbase[0x41]);
load_ucode(dataPtr, m_zeusbase[0x40], logit);
if (((m_zeusbase[0x40] >> 24) & 0xff) == 0xc0) {
if (((m_zeusbase[0x40] >> 24) & 0xff) >= 0xc0) {
// Light table load
if (logit) logerror("\t-- light table loaded");
}
else {
m_curUCodeSrc = m_zeusbase[0x41];
// Zeus Quad Size
switch (m_zeusbase[0x40]) {
case 0x38550083: case 0x2D550083: case 0x3885007B:
@ -568,13 +592,8 @@ void zeus2_device::zeus2_register_update(offs_t offset, uint32_t oldval, int log
logerror("\n");
}
}
else if (code == 0x4) {
// Load pal table from RGB555
if (logit)
logerror("\t-- pal table rgb555 load: control: %08X addr: %08X", m_zeusbase[0x40], m_zeusbase[0x41]);
poly->wait("PAL_TABLE_WRITE");
void *dataPtr = waveram0_ptr_from_expanded_addr(m_zeusbase[0x41]);
load_pal_table(dataPtr, m_zeusbase[0x40], 0, logit);
else if (code == 0x6) {
// Zeus model fifo burst from waveram
}
else {
if (logit)
@ -638,65 +657,67 @@ void zeus2_device::zeus2_register_update(offs_t offset, uint32_t oldval, int log
break;
case 0x50:
if (m_zeusbase[0x50] == 0x00510000) {
// SGRAM Special Mode Register Write
if (m_zeusbase[0x51] == 0x00200000) {
// SGRAM Mask Register
if ((m_zeusbase[0x58] & m_zeusbase[0x59] & m_zeusbase[0x5a]) != 0xffffffff)
logerror("zeus2_register_update: Warning! Mask Register not equal to 0xffffffff\n");
{
int code = (m_zeusbase[0x50] >> 16) & 0xf;
if (code == 0x1) {
// SGRAM Special Mode Register Write
if (m_zeusbase[0x51] == 0x00200000) {
// SGRAM Mask Register
if ((m_zeusbase[0x58] & m_zeusbase[0x59] & m_zeusbase[0x5a]) != 0xffffffff)
logerror("zeus2_register_update: Warning! Mask Register not equal to 0xffffffff\n");
}
if (m_zeusbase[0x51] == 0x00400000) {
// SGRAM Color Register
m_fill_color = m_zeusbase[0x58];
m_fill_depth = ((m_zeusbase[0x5a] & 0xffff) << 16) | ((m_zeusbase[0x58] >> 24) << 8);
m_fill_depth >>= 8; // Sign extend down to 24 bits
if (m_zeusbase[0x58] != m_zeusbase[0x59])
logerror("zeus2_register_update: Warning! Different fill colors are set.\n");
}
}
if (m_zeusbase[0x51] == 0x00400000) {
// SGRAM Color Register
m_fill_color = m_zeusbase[0x58];
m_fill_depth = ((m_zeusbase[0x5a] & 0xffff) << 16) | ((m_zeusbase[0x58]>>24)<<8);
m_fill_depth >>= 8; // Sign extend down to 24 bits
if (m_zeusbase[0x58] != m_zeusbase[0x59])
logerror("zeus2_register_update: Warning! Different fill colors are set.\n");
else if (code == 0x8) {
// Fast fill
// Unknown what the exact bit fields are, this is a just a guess
// Atlantis: 0x00983FFF => clear entire frame buffer, 0x00981FFF => clear one frame
// crusnexo: 0x007831FF => clear one frame
// thegrid: 0x008831FF => clear one frame
// thegrid: 0x0079FFFF => clear entire frame buffer at 51=0 then 51=00800000, only seen at initial tests in thegrid
uint32_t addr = frame_addr_from_phys_addr(m_zeusbase[0x51]);
uint32_t numBytes = (m_zeusbase[0x50] & 0xffff) + 1;
numBytes *= 0x40;
if (m_zeusbase[0x50] & 0x10000) {
addr = 0x0;
numBytes = WAVERAM1_WIDTH * WAVERAM1_HEIGHT * 8;
//printf("Clearing buffer: numBytes: %08X addr: %08X reg50: %08X\n", numBytes, addr, m_zeusbase[0x50]);
}
if (logit)
logerror(" -- Clearing buffer: numBytes: %08X addr: %08X reg51: %08X", numBytes, addr, m_zeusbase[0x51]);
memset(&m_frameColor[addr], m_fill_color, numBytes);
memset(&m_frameDepth[addr], m_fill_depth, numBytes);
}
}
//else if (1 && ((m_zeusbase[0x50] & 0x000f0000)==0x80000) && (m_zeusbase[0x50] & 0xffff)) {
else if ((m_zeusbase[0x50] & 0x80000) && (m_zeusbase[0x50] & 0xffff)) {
// Fast fill
// Unknown what the exact bit fields are, this is a just a guess
// Atlantis: 0x00983FFF => clear entire frame buffer, 0x00981FFF => clear one frame
// crusnexo: 0x007831FF => clear one frame
// thegrid: 0x008831FF => clear one frame
// thegrid: 0x0079FFFF => clear entire frame buffer at 51=0 then 51=00800000, only seen at initial tests in thegrid
uint32_t addr = frame_addr_from_phys_addr(m_zeusbase[0x51]);
uint32_t numBytes = (m_zeusbase[0x50] & 0xffff) + 1;
numBytes *= 0x40;
if (m_zeusbase[0x50] & 0x10000) {
addr = 0x0;
numBytes = WAVERAM1_WIDTH * WAVERAM1_HEIGHT * 8;
//printf("Clearing buffer: numBytes: %08X addr: %08X reg50: %08X\n", numBytes, addr, m_zeusbase[0x50]);
else if ((m_zeusbase[0x5e] >> 16) != 0xf208 && !(m_zeusbase[0x5e] & 0xffff)) {
/* If 0x5e==0xf20a0000 (atlantis) or 0xf20d0000 (the grid) then process the read/write now */
/*
m_zeusbase[0x5e]:
bit 0-1: which register triggers write through
bit 3: enable write through via these registers
bit 4: seems to be set during reads, when 0x51 is used for latching
bit 5: unknown, currently used to specify ordering, but this is suspect
bit 6: enable autoincrement on write through
*/
if (code == 0x9)
{
frame_write();
}
else if (code == 0x2) {
/* Do the read */
frame_read();
}
/* make sure we log anything else */
//else if (logit || m_zeusbase[0x50] != 0x0)
// logerror("\tw[50]=%08X [5E]=%08X\n", m_zeusbase[0x50], m_zeusbase[0x5e]);
}
if (logit)
logerror(" -- Clearing buffer: numBytes: %08X addr: %08X reg51: %08X", numBytes, addr, m_zeusbase[0x51]);
memset(&m_frameColor[addr], m_fill_color, numBytes);
memset(&m_frameDepth[addr], m_fill_depth, numBytes);
}
else if ((m_zeusbase[0x5e] >> 16) != 0xf208 && !(m_zeusbase[0x5e] & 0xffff)) {
/* If 0x5e==0xf20a0000 (atlantis) or 0xf20d0000 (the grid) then process the read/write now */
/*
m_zeusbase[0x5e]:
bit 0-1: which register triggers write through
bit 3: enable write through via these registers
bit 4: seems to be set during reads, when 0x51 is used for latching
bit 5: unknown, currently used to specify ordering, but this is suspect
bit 6: enable autoincrement on write through
*/
//if (m_zeusbase[0x50] == 0x00890000)
if ((m_zeusbase[0x50] == 0x00890000) || (m_zeusbase[0x50] == 0x00e90000))
{
frame_write();
}
else if (m_zeusbase[0x50] == 0x00720000) {
/* Do the read */
frame_read();
}
/* make sure we log anything else */
//else if (logit || m_zeusbase[0x50] != 0x0)
// logerror("\tw[50]=%08X [5E]=%08X\n", m_zeusbase[0x50], m_zeusbase[0x5e]);
}
break;
case 0x51:
@ -939,17 +960,19 @@ if (subregdata_count[which] < 256)
switch (which)
{
case 0x01:
// Limit to 16 bits
m_renderRegs[which] &= 0xffff;
// Limit to 12 bits
m_renderRegs[which] &= 0xfff;
zeus_cliprect.max_x = m_renderRegs[which];
if (logit)
logerror("\t(R%02X) = %4i Rend XClip", which & 0xffff, value);
logerror("\t(R%02X) = %4i Rend XClip", which & 0xfff, value);
break;
case 0x02:
// Limit to 16 bits
m_renderRegs[which] &= 0xffff;
// Limit to 12 bits
m_renderRegs[which] &= 0xfff;
zeus_cliprect.max_y = m_renderRegs[which];
if (logit)
logerror("\t(R%02X) = %4i Rend YClip", which & 0xffff, value);
logerror("\t(R%02X) = %4i Rend YClip", which & 0xfff, value);
break;
case 0x03:
@ -970,7 +993,7 @@ if (subregdata_count[which] < 256)
case 0x07:
if (logit)
logerror("\t(R%02X) texel mask = %06x", which, zeus_texbase);
logerror("\t(R%02X) Texel Mask = %06x", which, value);
break;
case 0x08:
@ -980,72 +1003,61 @@ if (subregdata_count[which] < 256)
void *dataPtr = (void *)(&waveram[blockNum * 2]);
if (logit)
logerror("\t(R%02X) = %06x PAL Control Load Table Byte Addr = %08X", which, value, blockNum * 8);
m_curPalTableSrc = m_renderRegs[0x9];
load_pal_table(dataPtr, m_renderRegs[0x8], 0, logit);
}
break;
case 0x09:
if (logit)
logerror("\t(R%02X) = %06x PAL Addr", which, value);
if (logit) logerror("\t(R%02X) = %06x PAL Addr", which, value);
break;
case 0x0a:
if (logit)
logerror("\t(R%02X) = %4i Pixel ALU IntA", which, value);
if (logit) logerror("\t(R%02X) = %4i Pixel ALU IntA", which, value);
break;
case 0x0b:
if (logit)
logerror("\t(R%02X) = %4i Pixel ALU IntB", which, value);
if (logit) logerror("\t(R%02X) = %4i Pixel ALU IntB", which, value);
break;
case 0x0c:
if (logit)
logerror("\t(R%02X) = %4i Pixel ALU IntC (Translucency FG)", which, value);
if (logit) logerror("\t(R%02X) = %4i Pixel ALU IntC (Translucency FG)", which, value);
break;
case 0x0d:
if (logit)
logerror("\t(R%02X) = %4i Pixel ALU IntD (Translucency BG)", which, value);
if (logit) logerror("\t(R%02X) = %4i Pixel ALU IntD (Translucency BG)", which, value);
break;
case 0x11:
if (logit)
logerror("\t(R%02X) Texel Setup = %06x", which, zeus_texbase);
if (logit) logerror("\t(R%02X) Texel Setup = %06x", which, value);
break;
case 0x12:
if (logit)
logerror("\t(R%02X) Pixel FIFO Setup = %06x", which, value);
if (logit) logerror("\t(R%02X) Pixel FIFO Setup = %06x", which, value);
break;
case 0x14:
if (logit)
logerror("\t(R%02X) = %06x ZBuf Control", which, value);
if (logit) logerror("\t(R%02X) = %06x ZBuf Control", which, value);
break;
case 0x15:
m_zbufmin = int32_t((value & 0xffffff) << 8) >> 8;
if (logit)
logerror("\t(R%02X) = %d zbufmin", which, m_zbufmin / 4096.0f);
if (logit) logerror("\t(R%02X) = %d ZBuf Min", which, m_zbufmin / 4096.0f);
break;
case 0x40:
// 0x004000 no shading
// 0x024004 gouraud shading
if (logit)
logerror("\t(R%02X) = %06x Pixel ALU Control", which, value);
if (logit) logerror("\t(R%02X) = %06x Pixel ALU Control", which, value);
break;
case 0xff:
// Reset???
if (logit)
logerror("\tRender Reset");
if (logit) logerror("\tRender Reset");
break;
default:
if (logit)
logerror("\t(R%02X) = %06x", which, value);
if (logit) logerror("\t(R%02X) = %06x", which, value);
break;
@ -1134,10 +1146,10 @@ bool zeus2_device::zeus2_fifo_process(const uint32_t *data, int numwords)
}
break;
// 0x14: ?? atlantis
/* 0x15: set point only (thegrid) */
/* 0x16: set point only (crusnexo) */
case 0x14:
// 0x10: atlantis
case 0x10:
case 0x15:
case 0x16:
if (numwords < 4)
@ -1159,6 +1171,8 @@ bool zeus2_device::zeus2_fifo_process(const uint32_t *data, int numwords)
break;
// 0x1c: thegrid (3 words)
// 0x14: atlantis
case 0x14:
case 0x1c:
if (m_thegrid) {
if (numwords < 3)
@ -1169,8 +1183,6 @@ bool zeus2_device::zeus2_fifo_process(const uint32_t *data, int numwords)
}
// 0x1b: thegrid
// 0x1c: crusnexo (4 words)
// 0x10: atlantis???
case 0x10:
case 0x1b:
if (numwords < 4)
return false;
@ -1276,7 +1288,7 @@ void zeus2_device::zeus2_draw_model(uint32_t baseaddr, uint16_t count, int logit
uint32_t texdata = 0;
if (logit)
logerror(" -- model @ %08X, len %04X\n", baseaddr, count);
logerror(" -- model @ %08X, len %04X, palSrc %08x, rendSrc %08x\n", baseaddr, count, m_curPalTableSrc, m_curUCodeSrc);
if (count > 0xc800)
fatalerror("Extreme count\n");
@ -1507,26 +1519,26 @@ void zeus2_renderer::zeus2_draw_quad(const uint32_t *databuffer, uint32_t texdat
vert[0].x = (int16_t)databuffer[2];
vert[0].y = (int16_t)databuffer[3];
vert[0].p[0] = (int16_t)databuffer[4];
vert[0].p[1] = (databuffer[5] >> 0) & 0xff;
vert[0].p[2] = (databuffer[5] >> 8) & 0xff;
vert[0].p[1] = ((databuffer[5] >> 0) & 0xff) << 2;
vert[0].p[2] = ((databuffer[5] >> 8) & 0xff) << 2;
vert[1].x = (int16_t)(databuffer[2] >> 16);
vert[1].y = (int16_t)(databuffer[3] >> 16);
vert[1].p[0] = (int16_t)(databuffer[4] >> 16);
vert[1].p[1] = (databuffer[5] >> 16) & 0xff;
vert[1].p[2] = (databuffer[5] >> 24) & 0xff;
vert[1].p[1] = ((databuffer[5] >> 16) & 0xff) << 2;
vert[1].p[2] = ((databuffer[5] >> 24) & 0xff) << 2;
vert[2].x = (int16_t)databuffer[6];
vert[2].y = (int16_t)databuffer[7];
vert[2].p[0] = (int16_t)databuffer[8];
vert[2].p[1] = (databuffer[9] >> 0) & 0xff;
vert[2].p[2] = (databuffer[9] >> 8) & 0xff;
vert[2].p[1] = ((databuffer[9] >> 0) & 0xff) << 2;
vert[2].p[2] = ((databuffer[9] >> 8) & 0xff) << 2;
vert[3].x = (int16_t)(databuffer[6] >> 16);
vert[3].y = (int16_t)(databuffer[7] >> 16);
vert[3].p[0] = (int16_t)(databuffer[8] >> 16);
vert[3].p[1] = (databuffer[9] >> 16) & 0xff;
vert[3].p[2] = (databuffer[9] >> 24) & 0xff;
vert[3].p[1] = ((databuffer[9] >> 16) & 0xff) << 2;
vert[3].p[2] = ((databuffer[9] >> 24) & 0xff) << 2;
}
else {
//printf("R40: %06X\n", m_state->m_renderRegs[0x40]);
@ -1726,7 +1738,7 @@ void zeus2_renderer::zeus2_draw_quad(const uint32_t *databuffer, uint32_t texdat
//extra.texwidth = 2 << ((texmode >> 2) & 7);
extra.texwidth = 0x20 << ((texmode >> 2) & 3);
//extra.texwidth = 0x2 << ((texmode >> 2) & 0xf);
//if (m_state->m_palSize == 16) extra.texwidth *= 2;
//switch (texmode)
//{
//case 0x14d: // atlantis
@ -1779,7 +1791,7 @@ void zeus2_renderer::zeus2_draw_quad(const uint32_t *databuffer, uint32_t texdat
extra.solidcolor = 0;//m_zeusbase[0x00] & 0x7fff;
extra.zbufmin = m_state->m_zbufmin;
extra.alpha = 0;//m_zeusbase[0x4e];
extra.transcolor = 0x100; // !(texmode & 100) ? 0 : 0x100;
extra.transcolor = 0x100; // (texmode & 0x100) ? 0 : 0x100;
extra.texbase = WAVERAM_BLOCK0_EXT(m_state->zeus_texbase);
extra.palbase = m_state->waveram0_ptr_from_expanded_addr(m_state->m_zeusbase[0x41]);
//extra.depth_test_enable = !(m_state->m_renderRegs[0x40] & 0x020000);
@ -1844,12 +1856,12 @@ void zeus2_renderer::render_poly_8bit(int32_t scanline, const extent_t& extent,
int u1 = (u0 + 1);
int v1 = (v0 + 1);
uint8_t texel0 = object.get_texel(texbase, v0, u0, texwidth);
//if (texel0 == object.transcolor)
// continue;
if (texel0 == transcolor)
continue;
uint8_t texel1 = object.get_texel(texbase, v0, u1, texwidth);
uint8_t texel2 = object.get_texel(texbase, v1, u0, texwidth);
uint8_t texel3 = object.get_texel(texbase, v1, u1, texwidth);
if (texel0 != transcolor)
//if (texel0 != transcolor)
{
uint32_t color0 = m_state->m_pal_table[texel0];
uint32_t color1 = m_state->m_pal_table[texel1];

View File

@ -145,6 +145,8 @@ public:
std::unique_ptr<uint32_t[]> m_frameDepth;
uint32_t m_pal_table[0x100];
uint32_t m_ucode[0x200];
uint32_t m_curUCodeSrc;
uint32_t m_curPalTableSrc;
emu_timer *int_timer;
emu_timer *vblank_timer;
@ -353,6 +355,7 @@ public:
static inline uint8_t get_texel_4bit(const void *base, int y, int x, int width)
{
uint32_t byteoffs = (y / 2) * (width * 2) + ((x / 8) << 3) + ((y & 1) << 2) + ((x / 2) & 3);
//uint32_t byteoffs = (y / 4) * (width * 4) + ((x / 4) << 3) + ((y & 3) << 1) + ((x / 2) & 1);
return (WAVERAM_READ8(base, byteoffs) >> (4 * (x & 1))) & 0x0f;
}

View File

@ -39,7 +39,7 @@ bookkeeping_manager::bookkeeping_manager(running_machine &machine)
machine.save().save_item(NAME(m_dispensed_tickets));
// register for configuration
machine.configuration().config_register("counters", config_saveload_delegate(&bookkeeping_manager::config_load, this), config_saveload_delegate(&bookkeeping_manager::config_save, this));
machine.configuration().config_register("counters", config_load_delegate(&bookkeeping_manager::config_load, this), config_save_delegate(&bookkeeping_manager::config_save, this));
}
@ -80,19 +80,19 @@ void bookkeeping_manager::increment_dispensed_tickets(int delta)
and tickets
-------------------------------------------------*/
void bookkeeping_manager::config_load(config_type cfg_type, xml_data_node *parentnode)
void bookkeeping_manager::config_load(config_type cfg_type, util::xml::data_node const *parentnode)
{
xml_data_node const *coinnode, *ticketnode;
util::xml::data_node const *coinnode, *ticketnode;
/* on init, reset the counters */
if (cfg_type == config_type::CONFIG_TYPE_INIT)
if (cfg_type == config_type::INIT)
{
memset(m_coin_count, 0, sizeof(m_coin_count));
m_dispensed_tickets = 0;
}
/* only care about game-specific data */
if (cfg_type != config_type::CONFIG_TYPE_GAME)
if (cfg_type != config_type::GAME)
return;
/* might not have any data */
@ -119,30 +119,32 @@ void bookkeeping_manager::config_load(config_type cfg_type, xml_data_node *paren
and tickets
-------------------------------------------------*/
void bookkeeping_manager::config_save(config_type cfg_type, xml_data_node *parentnode)
void bookkeeping_manager::config_save(config_type cfg_type, util::xml::data_node *parentnode)
{
int i;
/* only care about game-specific data */
if (cfg_type != config_type::CONFIG_TYPE_GAME)
if (cfg_type != config_type::GAME)
return;
/* iterate over coin counters */
for (i = 0; i < COIN_COUNTERS; i++)
{
if (m_coin_count[i] != 0)
{
xml_data_node *coinnode = parentnode->add_child("coins", nullptr);
util::xml::data_node *coinnode = parentnode->add_child("coins", nullptr);
if (coinnode != nullptr)
{
coinnode->set_attribute_int("index", i);
coinnode->set_attribute_int("number", m_coin_count[i]);
}
}
}
/* output tickets */
if (m_dispensed_tickets != 0)
{
xml_data_node *tickets = parentnode->add_child("tickets", nullptr);
util::xml::data_node *tickets = parentnode->add_child("tickets", nullptr);
if (tickets != nullptr)
tickets->set_attribute_int("number", m_dispensed_tickets);
}

View File

@ -59,8 +59,8 @@ public:
// getters
running_machine &machine() const { return m_machine; }
private:
void config_load(config_type cfg_type, xml_data_node *parentnode);
void config_save(config_type cfg_type, xml_data_node *parentnode);
void config_load(config_type cfg_type, util::xml::data_node const *parentnode);
void config_save(config_type cfg_type, util::xml::data_node *parentnode);
// internal state
running_machine & m_machine; // reference to our machine

View File

@ -36,7 +36,7 @@ configuration_manager::configuration_manager(running_machine &machine)
*
*************************************/
void configuration_manager::config_register(const char* nodename, config_saveload_delegate load, config_saveload_delegate save)
void configuration_manager::config_register(const char* nodename, config_load_delegate load, config_save_delegate save)
{
config_element element;
element.name = nodename;
@ -61,7 +61,7 @@ int configuration_manager::load_settings()
/* loop over all registrants and call their init function */
for (auto type : m_typelist)
type.load(config_type::CONFIG_TYPE_INIT, nullptr);
type.load(config_type::INIT, nullptr);
/* now load the controller file */
if (controller[0] != 0)
@ -74,7 +74,7 @@ int configuration_manager::load_settings()
throw emu_fatalerror("Could not load controller file %s.cfg", controller);
/* load the XML */
if (!load_xml(file, config_type::CONFIG_TYPE_CONTROLLER))
if (!load_xml(file, config_type::CONTROLLER))
throw emu_fatalerror("Could not load controller file %s.cfg", controller);
}
@ -82,16 +82,16 @@ int configuration_manager::load_settings()
emu_file file(machine().options().cfg_directory(), OPEN_FLAG_READ);
osd_file::error filerr = file.open("default.cfg");
if (filerr == osd_file::error::NONE)
load_xml(file, config_type::CONFIG_TYPE_DEFAULT);
load_xml(file, config_type::DEFAULT);
/* finally, load the game-specific file */
filerr = file.open(machine().basename(), ".cfg");
if (filerr == osd_file::error::NONE)
loaded = load_xml(file, config_type::CONFIG_TYPE_GAME);
loaded = load_xml(file, config_type::GAME);
/* loop over all registrants and call their final function */
for (auto type : m_typelist)
type.load(config_type::CONFIG_TYPE_FINAL, nullptr);
type.load(config_type::FINAL, nullptr);
/* if we didn't find a saved config, return 0 so the main core knows that it */
/* is the first time the game is run and it should diplay the disclaimer. */
@ -103,22 +103,22 @@ void configuration_manager::save_settings()
{
/* loop over all registrants and call their init function */
for (auto type : m_typelist)
type.save(config_type::CONFIG_TYPE_INIT, nullptr);
type.save(config_type::INIT, nullptr);
/* save the defaults file */
emu_file file(machine().options().cfg_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
osd_file::error filerr = file.open("default.cfg");
if (filerr == osd_file::error::NONE)
save_xml(file, config_type::CONFIG_TYPE_DEFAULT);
save_xml(file, config_type::DEFAULT);
/* finally, save the game-specific file */
filerr = file.open(machine().basename(), ".cfg");
if (filerr == osd_file::error::NONE)
save_xml(file, config_type::CONFIG_TYPE_GAME);
save_xml(file, config_type::GAME);
/* loop over all registrants and call their final function */
for (auto type : m_typelist)
type.save(config_type::CONFIG_TYPE_FINAL, nullptr);
type.save(config_type::FINAL, nullptr);
}
@ -131,27 +131,25 @@ void configuration_manager::save_settings()
int configuration_manager::load_xml(emu_file &file, config_type which_type)
{
xml_data_node *root, *confignode, *systemnode;
const char *srcfile;
int version, count;
/* read the file */
root = xml_data_node::file_read(file, nullptr);
std::unique_ptr<util::xml::data_node, void (*)(util::xml::data_node *)> const root(
util::xml::data_node::file_read(file, nullptr),
[] (util::xml::data_node *node) { node->file_free(); });
if (!root)
goto error;
return 0;
/* find the config node */
confignode = root->get_child("mameconfig");
util::xml::data_node const *const confignode = root->get_child("mameconfig");
if (!confignode)
goto error;
return 0;
/* validate the config data version */
version = confignode->get_attribute_int("version", 0);
int const version = confignode->get_attribute_int("version", 0);
if (version != CONFIG_VERSION)
goto error;
return 0;
/* strip off all the path crap from the source filename */
srcfile = strrchr(machine().system().source_file, '/');
const char *srcfile = strrchr(machine().system().source_file, '/');
if (!srcfile)
srcfile = strrchr(machine().system().source_file, '\\');
if (!srcfile)
@ -162,8 +160,8 @@ int configuration_manager::load_xml(emu_file &file, config_type which_type)
srcfile++;
/* loop over all system nodes in the file */
count = 0;
for (systemnode = confignode->get_child("system"); systemnode; systemnode = systemnode->get_next_sibling("system"))
int count = 0;
for (util::xml::data_node const *systemnode = confignode->get_child("system"); systemnode; systemnode = systemnode->get_next_sibling("system"))
{
/* look up the name of the system here; skip if none */
const char *name = systemnode->get_attribute_string("name", "");
@ -171,19 +169,19 @@ int configuration_manager::load_xml(emu_file &file, config_type which_type)
/* based on the file type, determine whether we have a match */
switch (which_type)
{
case config_type::CONFIG_TYPE_GAME:
/* only match on the specific game name */
if (strcmp(name, machine().system().name) != 0)
continue;
break;
case config_type::GAME:
/* only match on the specific game name */
if (strcmp(name, machine().system().name) != 0)
continue;
break;
case config_type::CONFIG_TYPE_DEFAULT:
/* only match on default */
if (strcmp(name, "default") != 0)
continue;
break;
case config_type::DEFAULT:
/* only match on default */
if (strcmp(name, "default") != 0)
continue;
break;
case config_type::CONFIG_TYPE_CONTROLLER:
case config_type::CONTROLLER:
{
int clone_of;
/* match on: default, game name, source file name, parent name, grandparent name */
@ -195,8 +193,9 @@ int configuration_manager::load_xml(emu_file &file, config_type which_type)
continue;
break;
}
default:
break;
default:
break;
}
/* log that we are processing this entry */
@ -211,16 +210,9 @@ int configuration_manager::load_xml(emu_file &file, config_type which_type)
/* error if this isn't a valid game match */
if (count == 0)
goto error;
return 0;
/* free the parser */
root->file_free();
return 1;
error:
if (root)
root->file_free();
return 0;
}
@ -233,32 +225,33 @@ error:
int configuration_manager::save_xml(emu_file &file, config_type which_type)
{
xml_data_node *const root = xml_data_node::file_create();
xml_data_node *confignode, *systemnode;
std::unique_ptr<util::xml::data_node, void (*)(util::xml::data_node *)> const root(
util::xml::data_node::file_create(),
[] (util::xml::data_node *node) { node->file_free(); });
/* if we don't have a root, bail */
if (!root)
return 0;
/* create a config node */
confignode = root->add_child("mameconfig", nullptr);
util::xml::data_node *const confignode = root->add_child("mameconfig", nullptr);
if (!confignode)
goto error;
return 0;
confignode->set_attribute_int("version", CONFIG_VERSION);
/* create a system node */
systemnode = confignode->add_child("system", nullptr);
util::xml::data_node *const systemnode = confignode->add_child("system", nullptr);
if (!systemnode)
goto error;
systemnode->set_attribute("name", (which_type == config_type::CONFIG_TYPE_DEFAULT) ? "default" : machine().system().name);
return 0;
systemnode->set_attribute("name", (which_type == config_type::DEFAULT) ? "default" : machine().system().name);
/* create the input node and write it out */
/* loop over all registrants and call their save function */
for (auto type : m_typelist)
{
xml_data_node *curnode = systemnode->add_child(type.name.c_str(), nullptr);
util::xml::data_node *const curnode = systemnode->add_child(type.name.c_str(), nullptr);
if (!curnode)
goto error;
return 0;
type.save(which_type, curnode);
/* if nothing was added, just nuke the node */
@ -270,10 +263,5 @@ int configuration_manager::save_xml(emu_file &file, config_type which_type)
root->file_write(file);
/* free and get out of here */
root->file_free();
return 1;
error:
root->file_free();
return 0;
}

View File

@ -7,10 +7,10 @@
Wrappers for handling MAME configuration files
***************************************************************************/
#pragma once
#ifndef MAME_EMU_CONFIG_H
#define MAME_EMU_CONFIG_H
#ifndef __CONFIG_H__
#define __CONFIG_H__
#pragma once
#include "xmlfile.h"
@ -24,11 +24,11 @@
enum class config_type
{
CONFIG_TYPE_INIT = 0, /* opportunity to initialize things first */
CONFIG_TYPE_CONTROLLER, /* loading from controller file */
CONFIG_TYPE_DEFAULT, /* loading from default.cfg */
CONFIG_TYPE_GAME, /* loading from game.cfg */
CONFIG_TYPE_FINAL /* opportunity to finish initialization */
INIT = 0, // opportunity to initialize things first
CONTROLLER, // loading from controller file
DEFAULT, // loading from default.cfg
GAME, // loading from game.cfg
FINAL // opportunity to finish initialization
};
/*************************************
@ -37,7 +37,8 @@ enum class config_type
*
*************************************/
typedef delegate<void (config_type, xml_data_node *)> config_saveload_delegate;
typedef delegate<void (config_type, util::xml::data_node const *)> config_load_delegate;
typedef delegate<void (config_type, util::xml::data_node *)> config_save_delegate;
// ======================> configuration_manager
@ -45,16 +46,16 @@ class configuration_manager
{
struct config_element
{
std::string name; /* node name */
config_saveload_delegate load; /* load callback */
config_saveload_delegate save; /* save callback */
std::string name; // node name
config_load_delegate load; // load callback
config_save_delegate save; // save callback
};
public:
// construction/destruction
configuration_manager(running_machine &machine);
void config_register(const char* nodename, config_saveload_delegate load, config_saveload_delegate save);
void config_register(const char* nodename, config_load_delegate load, config_save_delegate save);
int load_settings();
void save_settings();
@ -69,4 +70,4 @@ private:
std::vector<config_element> m_typelist;
};
#endif /* __CONFIG_H__ */
#endif /* MAME_EMU_CONFIG_H */

View File

@ -311,7 +311,7 @@ crosshair_manager::crosshair_manager(running_machine &machine)
/* register callbacks for when we load/save configurations */
if (m_usage)
machine.configuration().config_register("crosshairs", config_saveload_delegate(&crosshair_manager::config_load, this), config_saveload_delegate(&crosshair_manager::config_save, this));
machine.configuration().config_register("crosshairs", config_load_delegate(&crosshair_manager::config_load, this), config_save_delegate(&crosshair_manager::config_save, this));
/* register the animation callback */
if (machine.first_screen() != nullptr)
@ -381,15 +381,12 @@ void crosshair_manager::render(screen_device &screen)
configuration file
-------------------------------------------------*/
void crosshair_manager::config_load(config_type cfg_type, xml_data_node *parentnode)
void crosshair_manager::config_load(config_type cfg_type, util::xml::data_node const *parentnode)
{
/* Note: crosshair_load() is only registered if croshairs are used */
xml_data_node const *crosshairnode;
int auto_time;
/* we only care about game files */
if (cfg_type != config_type::CONFIG_TYPE_GAME)
if (cfg_type != config_type::GAME)
return;
/* might not have any data */
@ -397,11 +394,9 @@ void crosshair_manager::config_load(config_type cfg_type, xml_data_node *parentn
return;
/* loop and get player crosshair info */
for (crosshairnode = parentnode->get_child("crosshair"); crosshairnode; crosshairnode = crosshairnode->get_next_sibling("crosshair"))
for (util::xml::data_node const *crosshairnode = parentnode->get_child("crosshair"); crosshairnode; crosshairnode = crosshairnode->get_next_sibling("crosshair"))
{
int player, mode;
player = crosshairnode->get_attribute_int("player", -1);
int const player = crosshairnode->get_attribute_int("player", -1);
// check to make sure we have a valid player
if (player >= 0 && player < MAX_PLAYERS)
@ -411,7 +406,7 @@ void crosshair_manager::config_load(config_type cfg_type, xml_data_node *parentn
if (crosshair.is_used())
{
// get, check, and store visibility mode
mode = crosshairnode->get_attribute_int("mode", CROSSHAIR_VISIBILITY_DEFAULT);
int const mode = crosshairnode->get_attribute_int("mode", CROSSHAIR_VISIBILITY_DEFAULT);
if (mode >= CROSSHAIR_VISIBILITY_OFF && mode <= CROSSHAIR_VISIBILITY_AUTO)
{
crosshair.set_mode(u8(mode));
@ -427,10 +422,10 @@ void crosshair_manager::config_load(config_type cfg_type, xml_data_node *parentn
}
/* get, check, and store auto visibility time */
crosshairnode = parentnode->get_child("autotime");
if (crosshairnode != nullptr)
util::xml::data_node const *crosshairnode = parentnode->get_child("autotime");
if (crosshairnode)
{
auto_time = crosshairnode->get_attribute_int("val", CROSSHAIR_VISIBILITY_AUTOTIME_DEFAULT);
int const auto_time = crosshairnode->get_attribute_int("val", CROSSHAIR_VISIBILITY_AUTOTIME_DEFAULT);
if ((auto_time >= CROSSHAIR_VISIBILITY_AUTOTIME_MIN) && (auto_time <= CROSSHAIR_VISIBILITY_AUTOTIME_MAX))
m_auto_time = u8(auto_time);
}
@ -442,25 +437,22 @@ void crosshair_manager::config_load(config_type cfg_type, xml_data_node *parentn
configuration file
-------------------------------------------------*/
void crosshair_manager::config_save(config_type cfg_type, xml_data_node *parentnode)
void crosshair_manager::config_save(config_type cfg_type, util::xml::data_node *parentnode)
{
/* Note: crosshair_save() is only registered if crosshairs are used */
xml_data_node *crosshairnode;
int player;
/* we only care about game files */
if (cfg_type != config_type::CONFIG_TYPE_GAME)
if (cfg_type != config_type::GAME)
return;
for (player = 0; player < MAX_PLAYERS; player++)
for (int player = 0; player < MAX_PLAYERS; player++)
{
const render_crosshair &crosshair = *m_crosshair[player];
if (crosshair.is_used())
{
/* create a node */
crosshairnode = parentnode->add_child("crosshair", nullptr);
util::xml::data_node *const crosshairnode = parentnode->add_child("crosshair", nullptr);
if (crosshairnode != nullptr)
{
@ -492,7 +484,7 @@ void crosshair_manager::config_save(config_type cfg_type, xml_data_node *parentn
if (m_auto_time != CROSSHAIR_VISIBILITY_AUTOTIME_DEFAULT)
{
/* create a node */
crosshairnode = parentnode->add_child("autotime", nullptr);
util::xml::data_node *const crosshairnode = parentnode->add_child("autotime", nullptr);
if (crosshairnode != nullptr)
crosshairnode->set_attribute_int("val", m_auto_time);

View File

@ -116,8 +116,8 @@ private:
void exit();
void animate(screen_device &device, bool vblank_state);
void config_load(config_type cfg_type, xml_data_node *parentnode);
void config_save(config_type cfg_type, xml_data_node *parentnode);
void config_load(config_type cfg_type, util::xml::data_node const *parentnode);
void config_save(config_type cfg_type, util::xml::data_node *parentnode);
// internal state
running_machine & m_machine; // reference to our machine

View File

@ -220,7 +220,7 @@ bool debugger_cpu::comment_save()
bool comments_saved = false;
// if we don't have a root, bail
xml_data_node *const root = xml_data_node::file_create();
util::xml::data_node *const root = util::xml::data_node::file_create();
if (root == nullptr)
return false;
@ -228,13 +228,13 @@ bool debugger_cpu::comment_save()
try
{
// create a comment node
xml_data_node *const commentnode = root->add_child("mamecommentfile", nullptr);
util::xml::data_node *const commentnode = root->add_child("mamecommentfile", nullptr);
if (commentnode == nullptr)
throw emu_exception();
commentnode->set_attribute_int("version", COMMENT_VERSION);
// create a system node
xml_data_node *const systemnode = commentnode->add_child("system", nullptr);
util::xml::data_node *const systemnode = commentnode->add_child("system", nullptr);
if (systemnode == nullptr)
throw emu_exception();
systemnode->set_attribute("name", m_machine.system().name);
@ -245,7 +245,7 @@ bool debugger_cpu::comment_save()
if (device.debug() && device.debug()->comment_count() > 0)
{
// create a node for this device
xml_data_node *const curnode = systemnode->add_child("cpu", nullptr);
util::xml::data_node *const curnode = systemnode->add_child("cpu", nullptr);
if (curnode == nullptr)
throw emu_exception();
curnode->set_attribute("tag", device.tag());
@ -295,7 +295,7 @@ bool debugger_cpu::comment_load(bool is_inline)
return false;
// wrap in a try/catch to handle errors
xml_data_node *const root = xml_data_node::file_read(file, nullptr);
util::xml::data_node *const root = util::xml::data_node::file_read(file, nullptr);
try
{
// read the file
@ -303,7 +303,7 @@ bool debugger_cpu::comment_load(bool is_inline)
throw emu_exception();
// find the config node
xml_data_node const *const commentnode = root->get_child("mamecommentfile");
util::xml::data_node const *const commentnode = root->get_child("mamecommentfile");
if (commentnode == nullptr)
throw emu_exception();
@ -313,13 +313,13 @@ bool debugger_cpu::comment_load(bool is_inline)
throw emu_exception();
// check to make sure the file is applicable
xml_data_node const *const systemnode = commentnode->get_child("system");
util::xml::data_node const *const systemnode = commentnode->get_child("system");
const char *const name = systemnode->get_attribute_string("name", "");
if (strcmp(name, m_machine.system().name) != 0)
throw emu_exception();
// iterate over devices
for (xml_data_node const *cpunode = systemnode->get_child("cpu"); cpunode; cpunode = cpunode->get_next_sibling("cpu"))
for (util::xml::data_node const *cpunode = systemnode->get_child("cpu"); cpunode; cpunode = cpunode->get_next_sibling("cpu"))
{
const char *cputag_name = cpunode->get_attribute_string("tag", "");
device_t *device = m_machine.device(cputag_name);
@ -369,16 +369,11 @@ u8 debugger_cpu::read_byte(address_space &space, offs_t address, bool apply_tran
space.set_debugger_access(true);
/* translate if necessary; if not mapped, return 0xff */
u64 custom;
u8 result;
if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_READ_DEBUG, address))
{
result = 0xff;
}
else if (memory.read(space.spacenum(), address, 1, custom))
{ /* if there is a custom read handler, and it returns true, use that value */
result = custom;
}
else
{ /* otherwise, call the byte reading function for the translated address */
result = space.read_byte(address);
@ -422,15 +417,10 @@ u16 debugger_cpu::read_word(address_space &space, offs_t address, bool apply_tra
space.set_debugger_access(true);
/* translate if necessary; if not mapped, return 0xffff */
u64 custom;
if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_READ_DEBUG, address))
{
result = 0xffff;
}
else if (memory.read(space.spacenum(), address, 2, custom))
{ /* if there is a custom read handler, and it returns true, use that value */
result = custom;
}
else
{ /* otherwise, call the byte reading function for the translated address */
result = space.read_word(address);
@ -475,15 +465,10 @@ u32 debugger_cpu::read_dword(address_space &space, offs_t address, bool apply_tr
m_debugger_access = true;
space.set_debugger_access(true);
u64 custom;
if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_READ_DEBUG, address))
{ /* translate if necessary; if not mapped, return 0xffffffff */
result = 0xffffffff;
}
else if (memory.read(space.spacenum(), address, 4, custom))
{ /* if there is a custom read handler, and it returns true, use that value */
result = custom;
}
else
{ /* otherwise, call the byte reading function for the translated address */
result = space.read_dword(address);
@ -529,15 +514,10 @@ u64 debugger_cpu::read_qword(address_space &space, offs_t address, bool apply_tr
space.set_debugger_access(true);
/* translate if necessary; if not mapped, return 0xffffffffffffffff */
u64 custom;
if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_READ_DEBUG, address))
{
result = ~u64(0);
}
else if (memory.read(space.spacenum(), address, 8, custom))
{ /* if there is a custom read handler, and it returns true, use that value */
result = custom;
}
else
{ /* otherwise, call the byte reading function for the translated address */
result = space.read_qword(address);
@ -591,10 +571,6 @@ void debugger_cpu::write_byte(address_space &space, offs_t address, u8 data, boo
if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_WRITE_DEBUG, address))
;
/* if there is a custom write handler, and it returns true, use that */
else if (memory.write(space.spacenum(), address, 1, data))
;
/* otherwise, call the byte reading function for the translated address */
else
space.write_byte(address, data);
@ -645,10 +621,6 @@ void debugger_cpu::write_word(address_space &space, offs_t address, u16 data, bo
if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_WRITE_DEBUG, address))
;
/* if there is a custom write handler, and it returns true, use that */
else if (memory.write(space.spacenum(), address, 2, data))
;
/* otherwise, call the byte reading function for the translated address */
else
space.write_word(address, data);
@ -699,10 +671,6 @@ void debugger_cpu::write_dword(address_space &space, offs_t address, u32 data, b
if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_WRITE_DEBUG, address))
;
/* if there is a custom write handler, and it returns true, use that */
else if (memory.write(space.spacenum(), address, 4, data))
;
/* otherwise, call the byte reading function for the translated address */
else
space.write_dword(address, data);
@ -754,10 +722,6 @@ void debugger_cpu::write_qword(address_space &space, offs_t address, u64 data, b
if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_WRITE_DEBUG, address))
;
/* if there is a custom write handler, and it returns true, use that */
else if (memory.write(space.spacenum(), address, 8, data))
;
/* otherwise, call the byte reading function for the translated address */
else
space.write_qword(address, data);
@ -802,15 +766,8 @@ u64 debugger_cpu::read_opcode(address_space &space, offs_t address, int size)
/* keep in logical range */
address &= space.logbytemask();
/* return early if we got the result directly */
m_debugger_access = true;
space.set_debugger_access(true);
if (memory.readop(address, size, result2))
{
m_debugger_access = false;
space.set_debugger_access(false);
return result2;
}
/* if we're bigger than the address bus, break into smaller pieces */
if (size > space.data_width() / 8)
@ -878,6 +835,7 @@ u64 debugger_cpu::read_opcode(address_space &space, offs_t address, int size)
/* dump opcodes in qwords from a qword-sized bus */
case 88:
case 86: // sharc case, 48-bits opcodes
break;
default:
@ -925,6 +883,7 @@ u64 debugger_cpu::read_opcode(address_space &space, offs_t address, int size)
break;
case 8:
case 6:
result = space.direct().read_qword(address & ~7, addrxor);
if (!QWORD_ALIGNED(address))
{
@ -2580,12 +2539,12 @@ const char *device_debug::comment_text(offs_t addr) const
// given XML data node
//-------------------------------------------------
bool device_debug::comment_export(xml_data_node &curnode)
bool device_debug::comment_export(util::xml::data_node &curnode)
{
// iterate through the comments
for (const auto & elem : m_comment_set)
{
xml_data_node *datanode = curnode.add_child("comment", xml_normalize_string(elem.m_text.c_str()));
util::xml::data_node *datanode = curnode.add_child("comment", util::xml::normalize_string(elem.m_text.c_str()));
if (datanode == nullptr)
return false;
datanode->set_attribute_int("address", elem.m_address);
@ -2601,10 +2560,10 @@ bool device_debug::comment_export(xml_data_node &curnode)
// given XML data node
//-------------------------------------------------
bool device_debug::comment_import(xml_data_node const &cpunode, bool is_inline)
bool device_debug::comment_import(util::xml::data_node const &cpunode, bool is_inline)
{
// iterate through nodes
for (xml_data_node const *datanode = cpunode.get_child("comment"); datanode; datanode = datanode->get_next_sibling("comment"))
for (util::xml::data_node const *datanode = cpunode.get_child("comment"); datanode; datanode = datanode->get_next_sibling("comment"))
{
// extract attributes
offs_t address = datanode->get_attribute_int("address", 0);
@ -3426,6 +3385,7 @@ void device_debug::tracer::update(offs_t pc)
// log this PC
m_nextdex = (m_nextdex + 1) % TRACE_LOOPS;
m_history[m_nextdex] = pc;
fflush(&m_file);
}
@ -3437,6 +3397,7 @@ void device_debug::tracer::vprintf(const char *format, va_list va)
{
// pass through to the file
vfprintf(&m_file, format, va);
fflush(&m_file);
}

View File

@ -18,6 +18,9 @@
#include <set>
namespace util { namespace xml { class data_node; } }
//**************************************************************************
// CONSTANTS
//**************************************************************************
@ -37,9 +40,6 @@ constexpr int COMMENT_VERSION = 1;
typedef int (*debug_instruction_hook_func)(device_t &device, offs_t curpc);
class xml_data_node;
// ======================> device_debug
// [TODO] This whole thing is terrible.
@ -242,8 +242,8 @@ public:
const char *comment_text(offs_t addr) const;
u32 comment_count() const { return m_comment_set.size(); }
u32 comment_change_count() const { return m_comment_change; }
bool comment_export(xml_data_node &node);
bool comment_import(xml_data_node const &node, bool is_inline);
bool comment_export(util::xml::data_node &node);
bool comment_import(util::xml::data_node const &node, bool is_inline);
u32 compute_opcode_crc32(offs_t pc) const;
// history

View File

@ -181,52 +181,6 @@ bool device_memory_interface::memory_translate(address_spacenum spacenum, int in
}
//-------------------------------------------------
// memory_read - perform internal memory
// operations that bypass the memory system;
// designed to be overridden by the actual device
// implementation if internal read operations are
// handled by bypassing the memory system
//-------------------------------------------------
bool device_memory_interface::memory_read(address_spacenum spacenum, offs_t offset, int size, u64 &value)
{
// by default, we don't do anything
return false;
}
//-------------------------------------------------
// memory_write - perform internal memory
// operations that bypass the memory system;
// designed to be overridden by the actual device
// implementation if internal write operations are
// handled by bypassing the memory system
//-------------------------------------------------
bool device_memory_interface::memory_write(address_spacenum spacenum, offs_t offset, int size, u64 value)
{
// by default, we don't do anything
return false;
}
//-------------------------------------------------
// memory_readop - perform internal memory
// operations that bypass the memory system;
// designed to be overridden by the actual device
// implementation if internal opcode fetching
// operations are handled by bypassing the memory
// system
//-------------------------------------------------
bool device_memory_interface::memory_readop(offs_t offset, int size, u64 &value)
{
// by default, we don't do anything
return false;
}
//-------------------------------------------------
// interface_validity_check - perform validity
// checks on the memory configuration

View File

@ -99,11 +99,6 @@ public:
// address translation
bool translate(address_spacenum spacenum, int intention, offs_t &address) { return memory_translate(spacenum, intention, address); }
// read/write access
bool read(address_spacenum spacenum, offs_t offset, int size, u64 &value) { return memory_read(spacenum, offset, size, value); }
bool write(address_spacenum spacenum, offs_t offset, int size, u64 value) { return memory_write(spacenum, offset, size, value); }
bool readop(offs_t offset, int size, u64 &value) { return memory_readop(offset, size, value); }
// deliberately ambiguous functions; if you have the memory interface
// just use it
device_memory_interface &memory() { return *this; }
@ -114,9 +109,6 @@ protected:
// optional operation overrides
virtual bool memory_translate(address_spacenum spacenum, int intention, offs_t &address);
virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, u64 &value);
virtual bool memory_write(address_spacenum spacenum, offs_t offset, int size, u64 value);
virtual bool memory_readop(offs_t offset, int size, u64 &value);
// interface-level overrides
virtual void interface_validity_check(validity_checker &valid) const override;

View File

@ -76,7 +76,7 @@ image_manager::image_manager(running_machine &machine)
}
}
machine.configuration().config_register("image_directories", config_saveload_delegate(&image_manager::config_load, this), config_saveload_delegate(&image_manager::config_save, this));
machine.configuration().config_register("image_directories", config_load_delegate(&image_manager::config_load, this), config_save_delegate(&image_manager::config_save, this));
}
//-------------------------------------------------
@ -95,24 +95,21 @@ void image_manager::unload_all()
}
}
void image_manager::config_load(config_type cfg_type, xml_data_node *parentnode)
void image_manager::config_load(config_type cfg_type, util::xml::data_node const *parentnode)
{
xml_data_node const *node;
const char *dev_instance;
const char *working_directory;
if ((cfg_type == config_type::CONFIG_TYPE_GAME) && (parentnode != nullptr))
if ((cfg_type == config_type::GAME) && (parentnode != nullptr))
{
for (node = parentnode->get_child("device"); node; node = node->get_next_sibling("device"))
for (util::xml::data_node const *node = parentnode->get_child("device"); node; node = node->get_next_sibling("device"))
{
dev_instance = node->get_attribute_string("instance", nullptr);
const char *const dev_instance = node->get_attribute_string("instance", nullptr);
if ((dev_instance != nullptr) && (dev_instance[0] != '\0'))
{
for (device_image_interface &image : image_interface_iterator(machine().root_device()))
{
if (!strcmp(dev_instance, image.instance_name())) {
working_directory = node->get_attribute_string("directory", nullptr);
if (!strcmp(dev_instance, image.instance_name()))
{
const char *const working_directory = node->get_attribute_string("directory", nullptr);
if (working_directory != nullptr)
image.set_working_directory(working_directory);
}
@ -127,19 +124,16 @@ void image_manager::config_load(config_type cfg_type, xml_data_node *parentnode)
directories to the configuration file
-------------------------------------------------*/
void image_manager::config_save(config_type cfg_type, xml_data_node *parentnode)
void image_manager::config_save(config_type cfg_type, util::xml::data_node *parentnode)
{
xml_data_node *node;
const char *dev_instance;
/* only care about game-specific data */
if (cfg_type == config_type::CONFIG_TYPE_GAME)
if (cfg_type == config_type::GAME)
{
for (device_image_interface &image : image_interface_iterator(machine().root_device()))
{
dev_instance = image.instance_name();
const char *const dev_instance = image.instance_name();
node = parentnode->add_child("device", nullptr);
util::xml::data_node *const node = parentnode->add_child("device", nullptr);
if (node != nullptr)
{
node->set_attribute("instance", dev_instance);

View File

@ -8,10 +8,10 @@
***************************************************************************/
#pragma once
#ifndef MAME_EMU_IMAGE_H
#define MAME_EMU_IMAGE_H
#ifndef __IMAGE_H__
#define __IMAGE_H__
#pragma once
// ======================> image_manager
@ -27,8 +27,8 @@ public:
// getters
running_machine &machine() const { return m_machine; }
private:
void config_load(config_type cfg_type, xml_data_node *parentnode);
void config_save(config_type cfg_type, xml_data_node *parentnode);
void config_load(config_type cfg_type, util::xml::data_node const *parentnode);
void config_save(config_type cfg_type, util::xml::data_node *parentnode);
void options_extract();
int write_config(emu_options &options, const char *filename, const game_driver *gamedrv);
@ -37,4 +37,4 @@ private:
running_machine & m_machine; // reference to our machine
};
#endif /* __IMAGE_H__ */
#endif /* MAME_EMU_IMAGE_H */

View File

@ -1747,7 +1747,7 @@ time_t ioport_manager::initialize()
m_natkeyboard = std::make_unique<natural_keyboard>(machine());
// register callbacks for when we load configurations
machine().configuration().config_register("input", config_saveload_delegate(&ioport_manager::load_config, this), config_saveload_delegate(&ioport_manager::save_config, this));
machine().configuration().config_register("input", config_load_delegate(&ioport_manager::load_config, this), config_save_delegate(&ioport_manager::save_config, this));
// open playback and record files if specified
time_t basetime = playback_init();
@ -2080,10 +2080,10 @@ s32 ioport_manager::frame_interpolate(s32 oldval, s32 newval)
// data from the XML nodes
//-------------------------------------------------
void ioport_manager::load_config(config_type cfg_type, xml_data_node *parentnode)
void ioport_manager::load_config(config_type cfg_type, util::xml::data_node const *parentnode)
{
// in the completion phase, we finish the initialization with the final ports
if (cfg_type == config_type::CONFIG_TYPE_FINAL)
if (cfg_type == config_type::FINAL)
{
m_safe_to_read = true;
frame_update();
@ -2094,14 +2094,14 @@ void ioport_manager::load_config(config_type cfg_type, xml_data_node *parentnode
return;
// iterate over all the remap nodes for controller configs only
if (cfg_type == config_type::CONFIG_TYPE_CONTROLLER)
if (cfg_type == config_type::CONTROLLER)
load_remap_table(parentnode);
// load device map table for controller configs only
if (cfg_type == config_type::CONFIG_TYPE_CONTROLLER)
if (cfg_type == config_type::CONTROLLER)
{
std::unique_ptr<devicemap_table_type> devicemap_table = std::make_unique<devicemap_table_type>();
for (xml_data_node const *mapdevice_node = parentnode->get_child("mapdevice"); mapdevice_node != nullptr; mapdevice_node = mapdevice_node->get_next_sibling("mapdevice"))
for (util::xml::data_node const *mapdevice_node = parentnode->get_child("mapdevice"); mapdevice_node != nullptr; mapdevice_node = mapdevice_node->get_next_sibling("mapdevice"))
{
const char *devicename = mapdevice_node->get_attribute_string("device", nullptr);
const char *controllername = mapdevice_node->get_attribute_string("controller", nullptr);
@ -2119,7 +2119,7 @@ void ioport_manager::load_config(config_type cfg_type, xml_data_node *parentnode
}
// iterate over all the port nodes
for (xml_data_node const *portnode = parentnode->get_child("port"); portnode; portnode = portnode->get_next_sibling("port"))
for (util::xml::data_node const *portnode = parentnode->get_child("port"); portnode; portnode = portnode->get_next_sibling("port"))
{
// get the basic port info from the attributes
int player;
@ -2131,7 +2131,7 @@ void ioport_manager::load_config(config_type cfg_type, xml_data_node *parentnode
newseq[seqtype].set(INPUT_CODE_INVALID);
// loop over new sequences
for (xml_data_node const *seqnode = portnode->get_child("newseq"); seqnode; seqnode = seqnode->get_next_sibling("newseq"))
for (util::xml::data_node const *seqnode = portnode->get_child("newseq"); seqnode; seqnode = seqnode->get_next_sibling("newseq"))
{
// with a valid type, parse out the new sequence
input_seq_type seqtype = token_to_seq_type(seqnode->get_attribute_string("type", ""));
@ -2145,7 +2145,7 @@ void ioport_manager::load_config(config_type cfg_type, xml_data_node *parentnode
}
// if we're loading default ports, apply to the defaults
if (cfg_type != config_type::CONFIG_TYPE_GAME)
if (cfg_type != config_type::GAME)
load_default_config(portnode, type, player, newseq);
else
load_game_config(portnode, type, player, newseq);
@ -2153,7 +2153,7 @@ void ioport_manager::load_config(config_type cfg_type, xml_data_node *parentnode
// after applying the controller config, push that back into the backup, since that is
// what we will diff against
if (cfg_type == config_type::CONFIG_TYPE_CONTROLLER)
if (cfg_type == config_type::CONTROLLER)
for (input_type_entry &entry : m_typelist)
for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype)
entry.defseq(seqtype) = entry.seq(seqtype);
@ -2165,11 +2165,11 @@ void ioport_manager::load_config(config_type cfg_type, xml_data_node *parentnode
// global remapping table
//-------------------------------------------------
void ioport_manager::load_remap_table(xml_data_node const *parentnode)
void ioport_manager::load_remap_table(util::xml::data_node const *parentnode)
{
// count items first so we can allocate
int count = 0;
for (xml_data_node const *remapnode = parentnode->get_child("remap"); remapnode != nullptr; remapnode = remapnode->get_next_sibling("remap"))
for (util::xml::data_node const *remapnode = parentnode->get_child("remap"); remapnode != nullptr; remapnode = remapnode->get_next_sibling("remap"))
count++;
// if we have some, deal with them
@ -2181,7 +2181,7 @@ void ioport_manager::load_remap_table(xml_data_node const *parentnode)
// build up the remap table
count = 0;
for (xml_data_node const *remapnode = parentnode->get_child("remap"); remapnode != nullptr; remapnode = remapnode->get_next_sibling("remap"))
for (util::xml::data_node const *remapnode = parentnode->get_child("remap"); remapnode != nullptr; remapnode = remapnode->get_next_sibling("remap"))
{
input_code origcode = machine().input().code_from_token(remapnode->get_attribute_string("origcode", ""));
input_code newcode = machine().input().code_from_token(remapnode->get_attribute_string("newcode", ""));
@ -2207,7 +2207,7 @@ void ioport_manager::load_remap_table(xml_data_node const *parentnode)
// data to the default mappings
//-------------------------------------------------
bool ioport_manager::load_default_config(xml_data_node const *portnode, int type, int player, const input_seq *newseq)
bool ioport_manager::load_default_config(util::xml::data_node const *portnode, int type, int player, const input_seq *newseq)
{
// find a matching port in the list
for (input_type_entry &entry : m_typelist)
@ -2228,7 +2228,7 @@ bool ioport_manager::load_default_config(xml_data_node const *portnode, int type
// data to the current set of input ports
//-------------------------------------------------
bool ioport_manager::load_game_config(xml_data_node const *portnode, int type, int player, const input_seq *newseq)
bool ioport_manager::load_game_config(util::xml::data_node const *portnode, int type, int player, const input_seq *newseq)
{
// read the mask, index, and defvalue attributes
const char *tag = portnode->get_attribute_string("tag", nullptr);
@ -2292,17 +2292,17 @@ bool ioport_manager::load_game_config(xml_data_node const *portnode, int type, i
// port configuration
//-------------------------------------------------
void ioport_manager::save_config(config_type cfg_type, xml_data_node *parentnode)
void ioport_manager::save_config(config_type cfg_type, util::xml::data_node *parentnode)
{
// if no parentnode, ignore
if (parentnode == nullptr)
return;
// default ports save differently
if (cfg_type == config_type::CONFIG_TYPE_DEFAULT)
save_default_inputs(parentnode);
if (cfg_type == config_type::DEFAULT)
save_default_inputs(*parentnode);
else
save_game_inputs(parentnode);
save_game_inputs(*parentnode);
}
@ -2311,7 +2311,7 @@ void ioport_manager::save_config(config_type cfg_type, xml_data_node *parentnode
// sequence
//-------------------------------------------------
void ioport_manager::save_sequence(xml_data_node *parentnode, input_seq_type type, ioport_type porttype, const input_seq &seq)
void ioport_manager::save_sequence(util::xml::data_node &parentnode, input_seq_type type, ioport_type porttype, const input_seq &seq)
{
// get the string for the sequence
std::string seqstring;
@ -2321,7 +2321,7 @@ void ioport_manager::save_sequence(xml_data_node *parentnode, input_seq_type typ
seqstring = machine().input().seq_to_tokens(seq);
// add the new node
xml_data_node *const seqnode = parentnode->add_child("newseq", seqstring.c_str());
util::xml::data_node *const seqnode = parentnode.add_child("newseq", seqstring.c_str());
if (seqnode != nullptr)
seqnode->set_attribute("type", seqtypestrings[type]);
}
@ -2354,7 +2354,7 @@ bool ioport_manager::save_this_input_field_type(ioport_type type)
// mappings that have changed
//-------------------------------------------------
void ioport_manager::save_default_inputs(xml_data_node *parentnode)
void ioport_manager::save_default_inputs(util::xml::data_node &parentnode)
{
// iterate over ports
for (input_type_entry &entry : m_typelist)
@ -2372,7 +2372,7 @@ void ioport_manager::save_default_inputs(xml_data_node *parentnode)
if (seqtype < SEQ_TYPE_TOTAL)
{
// add a new port node
xml_data_node *const portnode = parentnode->add_child("port", nullptr);
util::xml::data_node *const portnode = parentnode.add_child("port", nullptr);
if (portnode != nullptr)
{
// add the port information and attributes
@ -2381,7 +2381,7 @@ void ioport_manager::save_default_inputs(xml_data_node *parentnode)
// add only the sequences that have changed from the defaults
for (input_seq_type type = SEQ_TYPE_STANDARD; type < SEQ_TYPE_TOTAL; ++type)
if (entry.seq(type) != entry.defseq(type))
save_sequence(portnode, type, entry.type(), entry.seq(type));
save_sequence(*portnode, type, entry.type(), entry.seq(type));
}
}
}
@ -2394,7 +2394,7 @@ void ioport_manager::save_default_inputs(xml_data_node *parentnode)
// mappings that have changed
//-------------------------------------------------
void ioport_manager::save_game_inputs(xml_data_node *parentnode)
void ioport_manager::save_game_inputs(util::xml::data_node &parentnode)
{
// iterate over ports
for (auto &port : m_portlist)
@ -2426,7 +2426,7 @@ void ioport_manager::save_game_inputs(xml_data_node *parentnode)
if (changed)
{
// add a new port node
xml_data_node *portnode = parentnode->add_child("port", nullptr);
util::xml::data_node *const portnode = parentnode.add_child("port", nullptr);
if (portnode != nullptr)
{
// add the identifying information and attributes
@ -2438,7 +2438,7 @@ void ioport_manager::save_game_inputs(xml_data_node *parentnode)
// add sequences if changed
for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype)
if (field.seq(seqtype) != field.defseq(seqtype))
save_sequence(portnode, seqtype, field.type(), field.seq(seqtype));
save_sequence(*portnode, seqtype, field.type(), field.seq(seqtype));
// write out non-analog changes
if (!field.is_analog())

View File

@ -654,6 +654,7 @@ enum
//**************************************************************************
// forward declarations
namespace util { namespace xml { class data_node; } }
class ioport_list;
class ioport_port;
struct ioport_port_live;
@ -661,7 +662,6 @@ class ioport_field;
struct ioport_field_live;
class ioport_manager;
class natural_keyboard;
class xml_data_node;
class analog_field;
// constructor function pointer
@ -1436,16 +1436,16 @@ private:
input_seq_type token_to_seq_type(const char *string);
static const char *const seqtypestrings[];
void load_config(config_type cfg_type, xml_data_node *parentnode);
void load_remap_table(xml_data_node const *parentnode);
bool load_default_config(xml_data_node const *portnode, int type, int player, const input_seq *newseq);
bool load_game_config(xml_data_node const *portnode, int type, int player, const input_seq *newseq);
void load_config(config_type cfg_type, util::xml::data_node const *parentnode);
void load_remap_table(util::xml::data_node const *parentnode);
bool load_default_config(util::xml::data_node const *portnode, int type, int player, const input_seq *newseq);
bool load_game_config(util::xml::data_node const *portnode, int type, int player, const input_seq *newseq);
void save_config(config_type cfg_type, xml_data_node *parentnode);
void save_sequence(xml_data_node *parentnode, input_seq_type type, ioport_type porttype, const input_seq &seq);
void save_config(config_type cfg_type, util::xml::data_node *parentnode);
void save_sequence(util::xml::data_node &parentnode, input_seq_type type, ioport_type porttype, const input_seq &seq);
bool save_this_input_field_type(ioport_type type);
void save_default_inputs(xml_data_node *parentnode);
void save_game_inputs(xml_data_node *parentnode);
void save_default_inputs(util::xml::data_node &parentnode);
void save_game_inputs(util::xml::data_node &parentnode);
template<typename _Type> _Type playback_read(_Type &result);
time_t playback_init();

View File

@ -59,7 +59,7 @@ public:
static void draw_user_interface(running_machine& machine);
static void periodic_check();
static bool frame_hook();
static void layout_file_cb(xml_data_node &layout);
static void layout_file_cb(util::xml::data_node &layout);
static bool standalone();
};

View File

@ -24,7 +24,7 @@
network_manager::network_manager(running_machine &machine)
: m_machine(machine)
{
machine.configuration().config_register("network", config_saveload_delegate(&network_manager::config_load, this), config_saveload_delegate(&network_manager::config_save, this));
machine.configuration().config_register("network", config_load_delegate(&network_manager::config_load, this), config_save_delegate(&network_manager::config_save, this));
}
//-------------------------------------------------
@ -32,12 +32,11 @@ network_manager::network_manager(running_machine &machine)
// configuration file
//-------------------------------------------------
void network_manager::config_load(config_type cfg_type, xml_data_node *parentnode)
void network_manager::config_load(config_type cfg_type, util::xml::data_node const *parentnode)
{
xml_data_node const *node;
if ((cfg_type == config_type::CONFIG_TYPE_GAME) && (parentnode != nullptr))
if ((cfg_type == config_type::GAME) && (parentnode != nullptr))
{
for (node = parentnode->get_child("device"); node; node = node->get_next_sibling("device"))
for (util::xml::data_node const *node = parentnode->get_child("device"); node; node = node->get_next_sibling("device"))
{
const char *tag = node->get_attribute_string("tag", nullptr);
@ -68,16 +67,14 @@ void network_manager::config_load(config_type cfg_type, xml_data_node *parentnod
// file
//-------------------------------------------------
void network_manager::config_save(config_type cfg_type, xml_data_node *parentnode)
void network_manager::config_save(config_type cfg_type, util::xml::data_node *parentnode)
{
xml_data_node *node;
/* only care about game-specific data */
if (cfg_type == config_type::CONFIG_TYPE_GAME)
if (cfg_type == config_type::GAME)
{
for (device_network_interface &network : network_interface_iterator(machine().root_device()))
{
node = parentnode->add_child("device", nullptr);
util::xml::data_node *const node = parentnode->add_child("device", nullptr);
if (node != nullptr)
{
node->set_attribute("tag", network.device().tag());

View File

@ -9,8 +9,8 @@
#pragma once
#ifndef __NETWORK_H__
#define __NETWORK_H__
#ifndef MAME_EMU_NETWORK_H
#define MAME_EMU_NETWORK_H
// ======================> network_manager
@ -23,11 +23,11 @@ public:
// getters
running_machine &machine() const { return m_machine; }
private:
void config_load(config_type cfg_type, xml_data_node *parentnode);
void config_save(config_type cfg_type, xml_data_node *parentnode);
void config_load(config_type cfg_type, util::xml::data_node const *parentnode);
void config_save(config_type cfg_type, util::xml::data_node *parentnode);
// internal state
running_machine & m_machine; // reference to our machine
};
#endif /* __NETWORK_H__ */
#endif /* MAME_EMU_NETWORK_H */

View File

@ -1701,9 +1701,9 @@ bool render_target::load_layout_file(const char *dirname, const internal_layout
bool render_target::load_layout_file(const char *dirname, const char *filename)
{
// if the first character of the "file" is an open brace, assume it is an XML string
xml_data_node *rootnode;
util::xml::data_node *rootnode;
if (filename[0] == '<')
rootnode = xml_data_node::string_read(filename, nullptr);
rootnode = util::xml::data_node::string_read(filename, nullptr);
// otherwise, assume it is a file
else
@ -1720,7 +1720,7 @@ bool render_target::load_layout_file(const char *dirname, const char *filename)
return false;
// read the file
rootnode = xml_data_node::file_read(layoutfile, nullptr);
rootnode = util::xml::data_node::file_read(layoutfile, nullptr);
}
// if we didn't get a properly-formatted XML file, record a warning and exit
@ -2215,7 +2215,7 @@ int render_target::view_index(layout_view &targetview) const
// config_load - process config information
//-------------------------------------------------
void render_target::config_load(xml_data_node const &targetnode)
void render_target::config_load(util::xml::data_node const &targetnode)
{
// find the view
const char *viewname = targetnode.get_attribute_string("view", nullptr);
@ -2290,7 +2290,7 @@ void render_target::config_load(xml_data_node const &targetnode)
// return false if we are the same as the default
//-------------------------------------------------
bool render_target::config_save(xml_data_node &targetnode)
bool render_target::config_save(util::xml::data_node &targetnode)
{
bool changed = false;
@ -2618,7 +2618,7 @@ render_manager::render_manager(running_machine &machine)
m_ui_container(global_alloc(render_container(*this)))
{
// register callbacks
machine.configuration().config_register("video", config_saveload_delegate(&render_manager::config_load, this), config_saveload_delegate(&render_manager::config_save, this));
machine.configuration().config_register("video", config_load_delegate(&render_manager::config_load, this), config_save_delegate(&render_manager::config_save, this));
// create one container per screen
for (screen_device &screen : screen_device_iterator(machine.root_device()))
@ -2870,10 +2870,10 @@ void render_manager::container_free(render_container *container)
// configuration file
//-------------------------------------------------
void render_manager::config_load(config_type cfg_type, xml_data_node *parentnode)
void render_manager::config_load(config_type cfg_type, util::xml::data_node const *parentnode)
{
// we only care about game files
if (cfg_type != config_type::CONFIG_TYPE_GAME)
if (cfg_type != config_type::GAME)
return;
// might not have any data
@ -2881,7 +2881,7 @@ void render_manager::config_load(config_type cfg_type, xml_data_node *parentnode
return;
// check the UI target
xml_data_node const *const uinode = parentnode->get_child("interface");
util::xml::data_node const *const uinode = parentnode->get_child("interface");
if (uinode != nullptr)
{
render_target *target = target_by_index(uinode->get_attribute_int("target", 0));
@ -2890,7 +2890,7 @@ void render_manager::config_load(config_type cfg_type, xml_data_node *parentnode
}
// iterate over target nodes
for (xml_data_node const *targetnode = parentnode->get_child("target"); targetnode; targetnode = targetnode->get_next_sibling("target"))
for (util::xml::data_node const *targetnode = parentnode->get_child("target"); targetnode; targetnode = targetnode->get_next_sibling("target"))
{
render_target *target = target_by_index(targetnode->get_attribute_int("index", -1));
if (target != nullptr)
@ -2898,7 +2898,7 @@ void render_manager::config_load(config_type cfg_type, xml_data_node *parentnode
}
// iterate over screen nodes
for (xml_data_node const *screennode = parentnode->get_child("screen"); screennode; screennode = screennode->get_next_sibling("screen"))
for (util::xml::data_node const *screennode = parentnode->get_child("screen"); screennode; screennode = screennode->get_next_sibling("screen"))
{
int index = screennode->get_attribute_int("index", -1);
render_container *container = m_screen_container_list.find(index);
@ -2929,17 +2929,17 @@ void render_manager::config_load(config_type cfg_type, xml_data_node *parentnode
// file
//-------------------------------------------------
void render_manager::config_save(config_type cfg_type, xml_data_node *parentnode)
void render_manager::config_save(config_type cfg_type, util::xml::data_node *parentnode)
{
// we only care about game files
if (cfg_type != config_type::CONFIG_TYPE_GAME)
if (cfg_type != config_type::GAME)
return;
// write out the interface target
if (m_ui_target->index() != 0)
{
// create a node for it
xml_data_node *const uinode = parentnode->add_child("interface", nullptr);
util::xml::data_node *const uinode = parentnode->add_child("interface", nullptr);
if (uinode != nullptr)
uinode->set_attribute_int("target", m_ui_target->index());
}
@ -2953,7 +2953,7 @@ void render_manager::config_save(config_type cfg_type, xml_data_node *parentnode
break;
// create a node
xml_data_node *const targetnode = parentnode->add_child("target", nullptr);
util::xml::data_node *const targetnode = parentnode->add_child("target", nullptr);
if (targetnode != nullptr && !target->config_save(*targetnode))
targetnode->delete_node();
}
@ -2963,7 +2963,7 @@ void render_manager::config_save(config_type cfg_type, xml_data_node *parentnode
for (render_container *container = m_screen_container_list.first(); container != nullptr; container = container->next(), scrnum++)
{
// create a node
xml_data_node *const screennode = parentnode->add_child("screen", nullptr);
util::xml::data_node *const screennode = parentnode->add_child("screen", nullptr);
if (screennode != nullptr)
{
bool changed = false;

View File

@ -163,11 +163,11 @@ constexpr u32 PRIMFLAG_PACKABLE = 1 << PRIMFLAG_PACKABLE_SHIFT;
//**************************************************************************
// forward definitions
namespace util { namespace xml { class data_node; } }
class device_t;
class screen_device;
class render_container;
class render_manager;
class xml_data_node;
class render_font;
struct object_transform;
class layout_element;
@ -645,7 +645,7 @@ class layout_element
public:
// construction/destruction
layout_element(running_machine &machine, xml_data_node const &elemnode, const char *dirname);
layout_element(running_machine &machine, util::xml::data_node const &elemnode, const char *dirname);
virtual ~layout_element();
// getters
@ -664,7 +664,7 @@ private:
typedef std::unique_ptr<component> ptr;
// construction/destruction
component(running_machine &machine, xml_data_node const &compnode, const char *dirname);
component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname);
virtual ~component() = default;
// setup
@ -704,7 +704,7 @@ private:
{
public:
// construction/destruction
image_component(running_machine &machine, xml_data_node const &compnode, const char *dirname);
image_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname);
protected:
// overrides
@ -728,7 +728,7 @@ private:
{
public:
// construction/destruction
rect_component(running_machine &machine, xml_data_node const &compnode, const char *dirname);
rect_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname);
protected:
// overrides
@ -740,7 +740,7 @@ private:
{
public:
// construction/destruction
disk_component(running_machine &machine, xml_data_node const &compnode, const char *dirname);
disk_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname);
protected:
// overrides
@ -752,7 +752,7 @@ private:
{
public:
// construction/destruction
text_component(running_machine &machine, xml_data_node const &compnode, const char *dirname);
text_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname);
protected:
// overrides
@ -769,7 +769,7 @@ private:
{
public:
// construction/destruction
led7seg_component(running_machine &machine, xml_data_node const &compnode, const char *dirname);
led7seg_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname);
protected:
// overrides
@ -782,7 +782,7 @@ private:
{
public:
// construction/destruction
led8seg_gts1_component(running_machine &machine, xml_data_node const &compnode, const char *dirname);
led8seg_gts1_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname);
protected:
// overrides
@ -795,7 +795,7 @@ private:
{
public:
// construction/destruction
led14seg_component(running_machine &machine, xml_data_node const &compnode, const char *dirname);
led14seg_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname);
protected:
// overrides
@ -808,7 +808,7 @@ private:
{
public:
// construction/destruction
led16seg_component(running_machine &machine, xml_data_node const &compnode, const char *dirname);
led16seg_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname);
protected:
// overrides
@ -821,7 +821,7 @@ private:
{
public:
// construction/destruction
led14segsc_component(running_machine &machine, xml_data_node const &compnode, const char *dirname);
led14segsc_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname);
protected:
// overrides
@ -834,7 +834,7 @@ private:
{
public:
// construction/destruction
led16segsc_component(running_machine &machine, xml_data_node const &compnode, const char *dirname);
led16segsc_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname);
protected:
// overrides
@ -847,7 +847,7 @@ private:
{
public:
// construction/destruction
dotmatrix_component(int dots, running_machine &machine, xml_data_node const &compnode, const char *dirname);
dotmatrix_component(int dots, running_machine &machine, util::xml::data_node const &compnode, const char *dirname);
protected:
// overrides
@ -864,7 +864,7 @@ private:
{
public:
// construction/destruction
simplecounter_component(running_machine &machine, xml_data_node const &compnode, const char *dirname);
simplecounter_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname);
protected:
// overrides
@ -885,7 +885,7 @@ private:
public:
// construction/destruction
reel_component(running_machine &machine, xml_data_node const &compnode, const char *dirname);
reel_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname);
protected:
// overrides
@ -932,13 +932,13 @@ private:
int m_state; // associated state number
};
typedef component::ptr (*make_component_func)(running_machine &machine, xml_data_node const &compnode, const char *dirname);
typedef component::ptr (*make_component_func)(running_machine &machine, util::xml::data_node const &compnode, const char *dirname);
typedef std::map<std::string, make_component_func> make_component_map;
// internal helpers
static void element_scale(bitmap_argb32 &dest, bitmap_argb32 &source, const rectangle &sbounds, void *param);
template <typename T> static component::ptr make_component(running_machine &machine, xml_data_node const &compnode, const char *dirname);
template <int D> static component::ptr make_dotmatrix_component(running_machine &machine, xml_data_node const &compnode, const char *dirname);
template <typename T> static component::ptr make_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname);
template <int D> static component::ptr make_dotmatrix_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname);
static make_component_map const s_make_component; // maps component XML names to creator functions
@ -969,7 +969,7 @@ public:
public:
// construction/destruction
item(running_machine &machine, xml_data_node const &itemnode, simple_list<layout_element> &elemlist);
item(running_machine &machine, util::xml::data_node const &itemnode, simple_list<layout_element> &elemlist);
virtual ~item();
// getters
@ -1005,7 +1005,7 @@ public:
};
// construction/destruction
layout_view(running_machine &machine, xml_data_node const &viewnode, simple_list<layout_element> &elemlist);
layout_view(running_machine &machine, util::xml::data_node const &viewnode, simple_list<layout_element> &elemlist);
virtual ~layout_view();
// getters
@ -1058,7 +1058,7 @@ class layout_file
public:
// construction/destruction
layout_file(running_machine &machine, xml_data_node const &rootnode, const char *dirname);
layout_file(running_machine &machine, util::xml::data_node const &rootnode, const char *dirname);
virtual ~layout_file();
// getters
@ -1171,8 +1171,8 @@ private:
bool map_point_internal(s32 target_x, s32 target_y, render_container *container, float &mapped_x, float &mapped_y, ioport_port *&mapped_input_port, ioport_value &mapped_input_mask);
// config callbacks
void config_load(xml_data_node const &targetnode);
bool config_save(xml_data_node &targetnode);
void config_load(util::xml::data_node const &targetnode);
bool config_save(util::xml::data_node &targetnode);
// view lookups
layout_view *view_by_index(int index) const;
@ -1277,8 +1277,8 @@ private:
void container_free(render_container *container);
// config callbacks
void config_load(config_type cfg_type, xml_data_node *parentnode);
void config_save(config_type cfg_type, xml_data_node *parentnode);
void config_load(config_type cfg_type, util::xml::data_node const *parentnode);
void config_save(config_type cfg_type, util::xml::data_node *parentnode);
// internal state
running_machine & m_machine; // reference back to the machine

View File

@ -222,7 +222,7 @@ static int get_variable_value(running_machine &machine, const char *string, char
// substitution
//-------------------------------------------------
static const char *xml_get_attribute_string_with_subst(running_machine &machine, xml_data_node const &node, const char *attribute, const char *defvalue)
static const char *xml_get_attribute_string_with_subst(running_machine &machine, util::xml::data_node const &node, const char *attribute, const char *defvalue)
{
const char *str = node.get_attribute_string(attribute, nullptr);
static char buffer[1000];
@ -259,7 +259,7 @@ static const char *xml_get_attribute_string_with_subst(running_machine &machine,
// substitution
//-------------------------------------------------
static int xml_get_attribute_int_with_subst(running_machine &machine, xml_data_node const &node, const char *attribute, int defvalue)
static int xml_get_attribute_int_with_subst(running_machine &machine, util::xml::data_node const &node, const char *attribute, int defvalue)
{
const char *string = xml_get_attribute_string_with_subst(machine, node, attribute, nullptr);
int value;
@ -283,7 +283,7 @@ static int xml_get_attribute_int_with_subst(running_machine &machine, xml_data_n
// substitution
//-------------------------------------------------
static float xml_get_attribute_float_with_subst(running_machine &machine, xml_data_node const &node, const char *attribute, float defvalue)
static float xml_get_attribute_float_with_subst(running_machine &machine, util::xml::data_node const &node, const char *attribute, float defvalue)
{
const char *string = xml_get_attribute_string_with_subst(machine, node, attribute, nullptr);
float value;
@ -298,7 +298,7 @@ static float xml_get_attribute_float_with_subst(running_machine &machine, xml_da
// parse_bounds - parse a bounds XML node
//-------------------------------------------------
void parse_bounds(running_machine &machine, xml_data_node const *boundsnode, render_bounds &bounds)
void parse_bounds(running_machine &machine, util::xml::data_node const *boundsnode, render_bounds &bounds)
{
// skip if nothing
if (boundsnode == nullptr)
@ -339,7 +339,7 @@ void parse_bounds(running_machine &machine, xml_data_node const *boundsnode, ren
// parse_color - parse a color XML node
//-------------------------------------------------
void parse_color(running_machine &machine, xml_data_node const *colornode, render_color &color)
void parse_color(running_machine &machine, util::xml::data_node const *colornode, render_color &color)
{
// skip if nothing
if (colornode == nullptr)
@ -367,7 +367,7 @@ void parse_color(running_machine &machine, xml_data_node const *colornode, rende
// node
//-------------------------------------------------
static void parse_orientation(running_machine &machine, xml_data_node const *orientnode, int &orientation)
static void parse_orientation(running_machine &machine, util::xml::data_node const *orientnode, int &orientation)
{
// skip if nothing
if (orientnode == nullptr)
@ -422,7 +422,7 @@ layout_element::make_component_map const layout_element::s_make_component{
// layout_element - constructor
//-------------------------------------------------
layout_element::layout_element(running_machine &machine, xml_data_node const &elemnode, const char *dirname)
layout_element::layout_element(running_machine &machine, util::xml::data_node const &elemnode, const char *dirname)
: m_next(nullptr),
m_machine(machine),
m_defstate(0),
@ -440,7 +440,7 @@ layout_element::layout_element(running_machine &machine, xml_data_node const &el
// parse components in order
bool first = true;
render_bounds bounds = { 0 };
for (xml_data_node const *compnode = elemnode.get_first_child(); compnode; compnode = compnode->get_next_sibling())
for (util::xml::data_node const *compnode = elemnode.get_first_child(); compnode; compnode = compnode->get_next_sibling())
{
make_component_map::const_iterator const make_func(s_make_component.find(compnode->get_name()));
if (make_func == s_make_component.end())
@ -539,7 +539,7 @@ void layout_element::element_scale(bitmap_argb32 &dest, bitmap_argb32 &source, c
//-------------------------------------------------
template <typename T>
layout_element::component::ptr layout_element::make_component(running_machine &machine, xml_data_node const &compnode, const char *dirname)
layout_element::component::ptr layout_element::make_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname)
{
return std::make_unique<T>(machine, compnode, dirname);
}
@ -551,7 +551,7 @@ layout_element::component::ptr layout_element::make_component(running_machine &m
//-------------------------------------------------
template <int D>
layout_element::component::ptr layout_element::make_dotmatrix_component(running_machine &machine, xml_data_node const &compnode, const char *dirname)
layout_element::component::ptr layout_element::make_dotmatrix_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname)
{
return std::make_unique<dotmatrix_component>(D, machine, compnode, dirname);
}
@ -614,7 +614,7 @@ layout_element::texture &layout_element::texture::operator=(texture &&that)
// component - constructor
//-------------------------------------------------
layout_element::component::component(running_machine &machine, xml_data_node const &compnode, const char *dirname)
layout_element::component::component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname)
: m_state(0)
{
// fetch common data
@ -641,7 +641,7 @@ void layout_element::component::normalize_bounds(float xoffs, float yoffs, float
// image_component - constructor
//-------------------------------------------------
layout_element::image_component::image_component(running_machine &machine, xml_data_node const &compnode, const char *dirname)
layout_element::image_component::image_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname)
: component(machine, compnode, dirname)
, m_hasalpha(false)
{
@ -709,7 +709,7 @@ void layout_element::image_component::load_bitmap()
// text_component - constructor
//-------------------------------------------------
layout_element::text_component::text_component(running_machine &machine, xml_data_node const &compnode, const char *dirname)
layout_element::text_component::text_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname)
: component(machine, compnode, dirname)
{
m_string = xml_get_attribute_string_with_subst(machine, compnode, "string", "");
@ -733,7 +733,7 @@ void layout_element::text_component::draw(running_machine &machine, bitmap_argb3
// dotmatrix_component - constructor
//-------------------------------------------------
layout_element::dotmatrix_component::dotmatrix_component(int dots, running_machine &machine, xml_data_node const &compnode, const char *dirname)
layout_element::dotmatrix_component::dotmatrix_component(int dots, running_machine &machine, util::xml::data_node const &compnode, const char *dirname)
: component(machine, compnode, dirname),
m_dots(dots)
{
@ -769,7 +769,7 @@ void layout_element::dotmatrix_component::draw(running_machine &machine, bitmap_
// simplecounter_component - constructor
//-------------------------------------------------
layout_element::simplecounter_component::simplecounter_component(running_machine &machine, xml_data_node const &compnode, const char *dirname)
layout_element::simplecounter_component::simplecounter_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname)
: component(machine, compnode, dirname)
{
m_digits = xml_get_attribute_int_with_subst(machine, compnode, "digits", 2);
@ -795,7 +795,7 @@ void layout_element::simplecounter_component::draw(running_machine &machine, bit
// reel_component - constructor
//-------------------------------------------------
layout_element::reel_component::reel_component(running_machine &machine, xml_data_node const &compnode, const char *dirname)
layout_element::reel_component::reel_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname)
: component(machine, compnode, dirname)
{
for (auto & elem : m_hasalpha)
@ -1203,7 +1203,7 @@ void layout_element::reel_component::load_reel_bitmap(int number)
// led7seg_component - constructor
//-------------------------------------------------
layout_element::led7seg_component::led7seg_component(running_machine &machine, xml_data_node const &compnode, const char *dirname)
layout_element::led7seg_component::led7seg_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname)
: component(machine, compnode, dirname)
{
}
@ -1264,7 +1264,7 @@ void layout_element::led7seg_component::draw(running_machine &machine, bitmap_ar
// led8seg_gts1_component - constructor
//-------------------------------------------------
layout_element::led8seg_gts1_component::led8seg_gts1_component(running_machine &machine, xml_data_node const &compnode, const char *dirname)
layout_element::led8seg_gts1_component::led8seg_gts1_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname)
: component(machine, compnode, dirname)
{
}
@ -1331,7 +1331,7 @@ void layout_element::led8seg_gts1_component::draw(running_machine &machine, bitm
// led14seg_component - constructor
//-------------------------------------------------
layout_element::led14seg_component::led14seg_component(running_machine &machine, xml_data_node const &compnode, const char *dirname)
layout_element::led14seg_component::led14seg_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname)
: component(machine, compnode, dirname)
{
}
@ -1442,7 +1442,7 @@ void layout_element::led14seg_component::draw(running_machine &machine, bitmap_a
// led14segsc_component - constructor
//-------------------------------------------------
layout_element::led14segsc_component::led14segsc_component(running_machine &machine, xml_data_node const &compnode, const char *dirname)
layout_element::led14segsc_component::led14segsc_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname)
: component(machine, compnode, dirname)
{
}
@ -1562,7 +1562,7 @@ void layout_element::led14segsc_component::draw(running_machine &machine, bitmap
// led16seg_component - constructor
//-------------------------------------------------
layout_element::led16seg_component::led16seg_component(running_machine &machine, xml_data_node const &compnode, const char *dirname)
layout_element::led16seg_component::led16seg_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname)
: component(machine, compnode, dirname)
{
}
@ -1683,7 +1683,7 @@ void layout_element::led16seg_component::draw(running_machine &machine, bitmap_a
// led16segsc_component - constructor
//-------------------------------------------------
layout_element::led16segsc_component::led16segsc_component(running_machine &machine, xml_data_node const &compnode, const char *dirname)
layout_element::led16segsc_component::led16segsc_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname)
: component(machine, compnode, dirname)
{
}
@ -1813,7 +1813,7 @@ void layout_element::led16segsc_component::draw(running_machine &machine, bitmap
// rect_component - constructor
//-------------------------------------------------
layout_element::rect_component::rect_component(running_machine &machine, xml_data_node const &compnode, const char *dirname)
layout_element::rect_component::rect_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname)
: component(machine, compnode, dirname)
{
}
@ -1859,7 +1859,7 @@ void layout_element::rect_component::draw(running_machine &machine, bitmap_argb3
// disk_component - constructor
//-------------------------------------------------
layout_element::disk_component::disk_component(running_machine &machine, xml_data_node const &compnode, const char *dirname)
layout_element::disk_component::disk_component(running_machine &machine, util::xml::data_node const &compnode, const char *dirname)
: component(machine, compnode, dirname)
{
}
@ -2213,7 +2213,7 @@ const simple_list<layout_view::item> layout_view::s_null_list;
// layout_view - constructor
//-------------------------------------------------
layout_view::layout_view(running_machine &machine, xml_data_node const &viewnode, simple_list<layout_element> &elemlist)
layout_view::layout_view(running_machine &machine, util::xml::data_node const &viewnode, simple_list<layout_element> &elemlist)
: m_next(nullptr)
, m_aspect(1.0f)
, m_scraspect(1.0f)
@ -2222,33 +2222,33 @@ layout_view::layout_view(running_machine &machine, xml_data_node const &viewnode
m_name = xml_get_attribute_string_with_subst(machine, viewnode, "name", "");
// if we have a bounds item, load it
xml_data_node const *const boundsnode = viewnode.get_child("bounds");
util::xml::data_node const *const boundsnode = viewnode.get_child("bounds");
m_expbounds.x0 = m_expbounds.y0 = m_expbounds.x1 = m_expbounds.y1 = 0;
if (boundsnode != nullptr)
parse_bounds(machine, boundsnode, m_expbounds);
// load backdrop items
for (xml_data_node const *itemnode = viewnode.get_child("backdrop"); itemnode != nullptr; itemnode = itemnode->get_next_sibling("backdrop"))
for (util::xml::data_node const *itemnode = viewnode.get_child("backdrop"); itemnode != nullptr; itemnode = itemnode->get_next_sibling("backdrop"))
m_backdrop_list.append(*global_alloc(item(machine, *itemnode, elemlist)));
// load screen items
for (xml_data_node const *itemnode = viewnode.get_child("screen"); itemnode != nullptr; itemnode = itemnode->get_next_sibling("screen"))
for (util::xml::data_node const *itemnode = viewnode.get_child("screen"); itemnode != nullptr; itemnode = itemnode->get_next_sibling("screen"))
m_screen_list.append(*global_alloc(item(machine, *itemnode, elemlist)));
// load overlay items
for (xml_data_node const *itemnode = viewnode.get_child("overlay"); itemnode != nullptr; itemnode = itemnode->get_next_sibling("overlay"))
for (util::xml::data_node const *itemnode = viewnode.get_child("overlay"); itemnode != nullptr; itemnode = itemnode->get_next_sibling("overlay"))
m_overlay_list.append(*global_alloc(item(machine, *itemnode, elemlist)));
// load bezel items
for (xml_data_node const *itemnode = viewnode.get_child("bezel"); itemnode != nullptr; itemnode = itemnode->get_next_sibling("bezel"))
for (util::xml::data_node const *itemnode = viewnode.get_child("bezel"); itemnode != nullptr; itemnode = itemnode->get_next_sibling("bezel"))
m_bezel_list.append(*global_alloc(item(machine, *itemnode, elemlist)));
// load cpanel items
for (xml_data_node const *itemnode = viewnode.get_child("cpanel"); itemnode != nullptr; itemnode = itemnode->get_next_sibling("cpanel"))
for (util::xml::data_node const *itemnode = viewnode.get_child("cpanel"); itemnode != nullptr; itemnode = itemnode->get_next_sibling("cpanel"))
m_cpanel_list.append(*global_alloc(item(machine, *itemnode, elemlist)));
// load marquee items
for (xml_data_node const *itemnode = viewnode.get_child("marquee"); itemnode != nullptr; itemnode = itemnode->get_next_sibling("marquee"))
for (util::xml::data_node const *itemnode = viewnode.get_child("marquee"); itemnode != nullptr; itemnode = itemnode->get_next_sibling("marquee"))
m_marquee_list.append(*global_alloc(item(machine, *itemnode, elemlist)));
// recompute the data for the view based on a default layer config
@ -2410,7 +2410,7 @@ void layout_view::resolve_tags()
// item - constructor
//-------------------------------------------------
layout_view::item::item(running_machine &machine, xml_data_node const &itemnode, simple_list<layout_element> &elemlist)
layout_view::item::item(running_machine &machine, util::xml::data_node const &itemnode, simple_list<layout_element> &elemlist)
: m_next(nullptr)
, m_element(nullptr)
, m_input_port(nullptr)
@ -2542,11 +2542,11 @@ void layout_view::item::resolve_tags()
// layout_file - constructor
//-------------------------------------------------
layout_file::layout_file(running_machine &machine, xml_data_node const &rootnode, const char *dirname)
layout_file::layout_file(running_machine &machine, util::xml::data_node const &rootnode, const char *dirname)
: m_next(nullptr)
{
// find the layout node
xml_data_node const *const mamelayoutnode = rootnode.get_child("mamelayout");
util::xml::data_node const *const mamelayoutnode = rootnode.get_child("mamelayout");
if (mamelayoutnode == nullptr)
throw emu_fatalerror("Invalid XML file: missing mamelayout node");
@ -2556,11 +2556,11 @@ layout_file::layout_file(running_machine &machine, xml_data_node const &rootnode
throw emu_fatalerror("Invalid XML file: unsupported version");
// parse all the elements
for (xml_data_node const *elemnode = mamelayoutnode->get_child("element"); elemnode != nullptr; elemnode = elemnode->get_next_sibling("element"))
for (util::xml::data_node const *elemnode = mamelayoutnode->get_child("element"); elemnode != nullptr; elemnode = elemnode->get_next_sibling("element"))
m_elemlist.append(*global_alloc(layout_element(machine, *elemnode, dirname)));
// parse all the views
for (xml_data_node const *viewnode = mamelayoutnode->get_child("view"); viewnode != nullptr; viewnode = viewnode->get_next_sibling("view"))
for (util::xml::data_node const *viewnode = mamelayoutnode->get_child("view"); viewnode != nullptr; viewnode = viewnode->get_next_sibling("view"))
m_viewlist.append(*global_alloc(layout_view(machine, *viewnode, m_elemlist)));
}

View File

@ -835,7 +835,7 @@ sound_manager::sound_manager(running_machine &machine)
#endif
// register callbacks
machine.configuration().config_register("mixer", config_saveload_delegate(&sound_manager::config_load, this), config_saveload_delegate(&sound_manager::config_save, this));
machine.configuration().config_register("mixer", config_load_delegate(&sound_manager::config_load, this), config_save_delegate(&sound_manager::config_save, this));
machine.add_notifier(MACHINE_NOTIFY_PAUSE, machine_notify_delegate(&sound_manager::pause, this));
machine.add_notifier(MACHINE_NOTIFY_RESUME, machine_notify_delegate(&sound_manager::resume, this));
machine.add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(&sound_manager::reset, this));
@ -988,10 +988,10 @@ void sound_manager::resume()
// configuration file
//-------------------------------------------------
void sound_manager::config_load(config_type cfg_type, xml_data_node *parentnode)
void sound_manager::config_load(config_type cfg_type, util::xml::data_node const *parentnode)
{
// we only care about game files
if (cfg_type != config_type::CONFIG_TYPE_GAME)
if (cfg_type != config_type::GAME)
return;
// might not have any data
@ -999,7 +999,7 @@ void sound_manager::config_load(config_type cfg_type, xml_data_node *parentnode)
return;
// iterate over channel nodes
for (xml_data_node const *channelnode = parentnode->get_child("channel"); channelnode != nullptr; channelnode = channelnode->get_next_sibling("channel"))
for (util::xml::data_node const *channelnode = parentnode->get_child("channel"); channelnode != nullptr; channelnode = channelnode->get_next_sibling("channel"))
{
mixer_input info;
if (indexed_mixer_input(channelnode->get_attribute_int("index", -1), info))
@ -1018,10 +1018,10 @@ void sound_manager::config_load(config_type cfg_type, xml_data_node *parentnode)
// file
//-------------------------------------------------
void sound_manager::config_save(config_type cfg_type, xml_data_node *parentnode)
void sound_manager::config_save(config_type cfg_type, util::xml::data_node *parentnode)
{
// we only care about game files
if (cfg_type != config_type::CONFIG_TYPE_GAME)
if (cfg_type != config_type::GAME)
return;
// iterate over mixer channels
@ -1035,7 +1035,7 @@ void sound_manager::config_save(config_type cfg_type, xml_data_node *parentnode)
if (newvol != 1.0f)
{
xml_data_node *const channelnode = parentnode->add_child("channel", nullptr);
util::xml::data_node *const channelnode = parentnode->add_child("channel", nullptr);
if (channelnode != nullptr)
{
channelnode->set_attribute_int("index", mixernum);

View File

@ -223,8 +223,8 @@ private:
void reset();
void pause();
void resume();
void config_load(config_type cfg_type, xml_data_node *parentnode);
void config_save(config_type cfg_type, xml_data_node *parentnode);
void config_load(config_type cfg_type, util::xml::data_node const *parentnode);
void config_save(config_type cfg_type, util::xml::data_node *parentnode);
void update(void *ptr = nullptr, s32 param = 0);

View File

@ -263,7 +263,14 @@ g_profiler.start(PROFILER_INPUT);
/* if this is an autorepeat case, set a 1x delay and leave pressed = 1 */
else if (speed > 0 && (osd_ticks() + tps - m_next_repeat[code]) >= tps)
m_next_repeat[code] += 1 * speed * tps / 60;
{
// In the autorepeatcase, we need to double check the key is still pressed
// as there can be a delay between the key polling and our processing of the event
m_seqpressed[code] = machine().ioport().type_pressed(ioport_type(code));
pressed = (m_seqpressed[code] == SEQ_PRESSED_TRUE);
if (pressed)
m_next_repeat[code] += 1 * speed * tps / 60;
}
/* otherwise, reset pressed = 0 */
else

View File

@ -108,16 +108,16 @@ inline std::string number_and_format::format() const
switch (m_format)
{
default:
case xml_data_node::int_format::DECIMAL:
case util::xml::data_node::int_format::DECIMAL:
return string_format("%d", uint32_t(m_value));
case xml_data_node::int_format::DECIMAL_HASH:
case util::xml::data_node::int_format::DECIMAL_HASH:
return string_format("#%d", uint32_t(m_value));
case xml_data_node::int_format::HEX_DOLLAR:
case util::xml::data_node::int_format::HEX_DOLLAR:
return string_format("$%X", uint32_t(m_value));
case xml_data_node::int_format::HEX_C:
case util::xml::data_node::int_format::HEX_C:
return string_format("0x%X", uint32_t(m_value));
}
}
@ -132,7 +132,7 @@ inline std::string number_and_format::format() const
// cheat_parameter - constructor
//-------------------------------------------------
cheat_parameter::cheat_parameter(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node const &paramnode)
cheat_parameter::cheat_parameter(cheat_manager &manager, symbol_table &symbols, const char *filename, util::xml::data_node const &paramnode)
: m_value(0)
{
// read the core attributes
@ -141,7 +141,7 @@ cheat_parameter::cheat_parameter(cheat_manager &manager, symbol_table &symbols,
m_stepval = number_and_format(paramnode.get_attribute_int("step", 1), paramnode.get_attribute_int_format("step"));
// iterate over items
for (xml_data_node const *itemnode = paramnode.get_child("item"); itemnode != nullptr; itemnode = itemnode->get_next_sibling("item"))
for (util::xml::data_node const *itemnode = paramnode.get_child("item"); itemnode != nullptr; itemnode = itemnode->get_next_sibling("item"))
{
// check for nullptr text
if (itemnode->get_value() == nullptr || itemnode->get_value()[0] == 0)
@ -153,7 +153,7 @@ cheat_parameter::cheat_parameter(cheat_manager &manager, symbol_table &symbols,
// extract the parameters
uint64_t const value = itemnode->get_attribute_int("value", 0);
xml_data_node::int_format const format = itemnode->get_attribute_int_format("value");
util::xml::data_node::int_format const format = itemnode->get_attribute_int_format("value");
// allocate and append a new item
auto curitem = std::make_unique<item>(itemnode->get_value(), value, format);
@ -317,7 +317,7 @@ bool cheat_parameter::set_next_state()
// cheat_script - constructor
//-------------------------------------------------
cheat_script::cheat_script(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node const &scriptnode)
cheat_script::cheat_script(cheat_manager &manager, symbol_table &symbols, const char *filename, util::xml::data_node const &scriptnode)
: m_state(SCRIPT_STATE_RUN)
{
// read the core attributes
@ -332,7 +332,7 @@ cheat_script::cheat_script(cheat_manager &manager, symbol_table &symbols, const
throw emu_fatalerror("%s.xml(%d): invalid script state '%s'\n", filename, scriptnode.line, state);
// iterate over nodes within the script
for (xml_data_node const *entrynode = scriptnode.get_first_child(); entrynode != nullptr; entrynode = entrynode->get_next_sibling())
for (util::xml::data_node const *entrynode = scriptnode.get_first_child(); entrynode != nullptr; entrynode = entrynode->get_next_sibling())
{
// handle action nodes
if (strcmp(entrynode->get_name(), "action") == 0)
@ -399,7 +399,7 @@ void cheat_script::save(emu_file &cheatfile) const
// script_entry - constructor
//-------------------------------------------------
cheat_script::script_entry::script_entry(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node const &entrynode, bool isaction)
cheat_script::script_entry::script_entry(cheat_manager &manager, symbol_table &symbols, const char *filename, util::xml::data_node const &entrynode, bool isaction)
: m_condition(&symbols),
m_expression(&symbols)
{
@ -442,7 +442,7 @@ cheat_script::script_entry::script_entry(cheat_manager &manager, symbol_table &s
// then parse arguments
int totalargs = 0;
for (xml_data_node const *argnode = entrynode.get_child("argument"); argnode != nullptr; argnode = argnode->get_next_sibling("argument"))
for (util::xml::data_node const *argnode = entrynode.get_child("argument"); argnode != nullptr; argnode = argnode->get_next_sibling("argument"))
{
auto curarg = std::make_unique<output_argument>(manager, symbols, filename, *argnode);
// verify we didn't overrun the argument count
@ -608,7 +608,7 @@ void cheat_script::script_entry::validate_format(const char *filename, int line)
// output_argument - constructor
//-------------------------------------------------
cheat_script::script_entry::output_argument::output_argument(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node const &argnode)
cheat_script::script_entry::output_argument::output_argument(cheat_manager &manager, symbol_table &symbols, const char *filename, util::xml::data_node const &argnode)
: m_expression(&symbols),
m_count(0)
{
@ -676,7 +676,7 @@ void cheat_script::script_entry::output_argument::save(emu_file &cheatfile) cons
// cheat_entry - constructor
//-------------------------------------------------
cheat_entry::cheat_entry(cheat_manager &manager, symbol_table &globaltable, const char *filename, xml_data_node const &cheatnode)
cheat_entry::cheat_entry(cheat_manager &manager, symbol_table &globaltable, const char *filename, util::xml::data_node const &cheatnode)
: m_manager(manager)
, m_symbols(&manager.machine(), &globaltable)
, m_state(SCRIPT_STATE_OFF)
@ -707,7 +707,7 @@ cheat_entry::cheat_entry(cheat_manager &manager, symbol_table &globaltable, cons
}
// read the first comment node
xml_data_node const *commentnode = cheatnode.get_child("comment");
util::xml::data_node const *commentnode = cheatnode.get_child("comment");
if (commentnode != nullptr)
{
// set the value if not nullptr
@ -721,7 +721,7 @@ cheat_entry::cheat_entry(cheat_manager &manager, symbol_table &globaltable, cons
}
// read the first parameter node
xml_data_node const *paramnode = cheatnode.get_child("parameter");
util::xml::data_node const *paramnode = cheatnode.get_child("parameter");
if (paramnode != nullptr)
{
// load this parameter
@ -734,7 +734,7 @@ cheat_entry::cheat_entry(cheat_manager &manager, symbol_table &globaltable, cons
}
// read the script nodes
for (xml_data_node const *scriptnode = cheatnode.get_child("script"); scriptnode != nullptr; scriptnode = scriptnode->get_next_sibling("script"))
for (util::xml::data_node const *scriptnode = cheatnode.get_child("script"); scriptnode != nullptr; scriptnode = scriptnode->get_next_sibling("script"))
{
// load this entry
auto curscript = global_alloc(cheat_script(manager, m_symbols, filename, *scriptnode));
@ -1397,17 +1397,17 @@ void cheat_manager::load_cheats(const char *filename)
osd_printf_verbose("Loading cheats file from %s\n", cheatfile.fullpath());
// read the XML file into internal data structures
xml_parse_options options = { nullptr };
xml_parse_error error;
util::xml::parse_options options = { nullptr };
util::xml::parse_error error;
options.error = &error;
std::unique_ptr<xml_data_node, void (*)(xml_data_node *)> rootnode(xml_data_node::file_read(cheatfile, &options), [] (xml_data_node *node) { node->file_free(); });
std::unique_ptr<util::xml::data_node, void (*)(util::xml::data_node *)> rootnode(util::xml::data_node::file_read(cheatfile, &options), [] (util::xml::data_node *node) { node->file_free(); });
// if unable to parse the file, just bail
if (rootnode == nullptr)
throw emu_fatalerror("%s.xml(%d): error parsing XML (%s)\n", filename, error.error_line, error.error_message);
// find the layout node
xml_data_node *mamecheatnode = rootnode->get_child("mamecheat");
util::xml::data_node const *const mamecheatnode = rootnode->get_child("mamecheat");
if (mamecheatnode == nullptr)
throw emu_fatalerror("%s.xml: missing mamecheatnode node", filename);
@ -1417,7 +1417,7 @@ void cheat_manager::load_cheats(const char *filename)
throw emu_fatalerror("%s.xml(%d): Invalid cheat XML file: unsupported version", filename, mamecheatnode->line);
// parse all the elements
for (xml_data_node const *cheatnode = mamecheatnode->get_child("cheat"); cheatnode != nullptr; cheatnode = cheatnode->get_next_sibling("cheat"))
for (util::xml::data_node const *cheatnode = mamecheatnode->get_child("cheat"); cheatnode != nullptr; cheatnode = cheatnode->get_next_sibling("cheat"))
{
// load this entry
auto curcheat = std::make_unique<cheat_entry>(*this, m_symtable, filename, *cheatnode);

View File

@ -50,7 +50,7 @@ class number_and_format
{
public:
// construction/destruction
number_and_format(uint64_t value = 0, xml_data_node::int_format format = xml_data_node::int_format::DECIMAL)
number_and_format(uint64_t value = 0, util::xml::data_node::int_format format = util::xml::data_node::int_format::DECIMAL)
: m_value(value)
, m_format(format)
{
@ -65,8 +65,8 @@ public:
private:
// internal state
uint64_t m_value;
xml_data_node::int_format m_format;
uint64_t m_value;
util::xml::data_node::int_format m_format;
};
@ -77,7 +77,7 @@ class cheat_parameter
{
public:
// construction/destruction
cheat_parameter(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node const &paramnode);
cheat_parameter(cheat_manager &manager, symbol_table &symbols, const char *filename, util::xml::data_node const &paramnode);
// queries
const char *text();
@ -99,7 +99,7 @@ private:
{
public:
// construction/destruction
item(const char *text, uint64_t value, xml_data_node::int_format valformat)
item(const char *text, uint64_t value, util::xml::data_node::int_format valformat)
: m_text(text)
, m_value(value, valformat)
{ }
@ -131,7 +131,7 @@ class cheat_script
{
public:
// construction/destruction
cheat_script(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node const &scriptnode);
cheat_script(cheat_manager &manager, symbol_table &symbols, const char *filename, util::xml::data_node const &scriptnode);
// getters
script_state state() const { return m_state; }
@ -146,7 +146,7 @@ private:
{
public:
// construction/destruction
script_entry(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node const &entrynode, bool isaction);
script_entry(cheat_manager &manager, symbol_table &symbols, const char *filename, util::xml::data_node const &entrynode, bool isaction);
// actions
void execute(cheat_manager &manager, uint64_t &argindex);
@ -158,7 +158,7 @@ private:
{
public:
// construction/destruction
output_argument(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node const &argnode);
output_argument(cheat_manager &manager, symbol_table &symbols, const char *filename, util::xml::data_node const &argnode);
// getters
int count() const { return m_count; }
@ -201,7 +201,7 @@ class cheat_entry
{
public:
// construction/destruction
cheat_entry(cheat_manager &manager, symbol_table &globaltable, const char *filename, xml_data_node const &cheatnode);
cheat_entry(cheat_manager &manager, symbol_table &globaltable, const char *filename, util::xml::data_node const &cheatnode);
~cheat_entry();
// getters

View File

@ -1101,7 +1101,7 @@ void cli_frontend::verifysamples(const char *gamename)
void cli_frontend::output_single_softlist(FILE *out, software_list_device &swlistdev)
{
fprintf(out, "\t<softwarelist name=\"%s\" description=\"%s\">\n", swlistdev.list_name().c_str(), xml_normalize_string(swlistdev.description().c_str()));
fprintf(out, "\t<softwarelist name=\"%s\" description=\"%s\">\n", swlistdev.list_name().c_str(), util::xml::normalize_string(swlistdev.description().c_str()));
for (const software_info &swinfo : swlistdev.get_info())
{
fprintf(out, "\t\t<software name=\"%s\"", swinfo.shortname().c_str());
@ -1112,12 +1112,12 @@ void cli_frontend::output_single_softlist(FILE *out, software_list_device &swlis
if (swinfo.supported() == SOFTWARE_SUPPORTED_NO)
fprintf(out, " supported=\"no\"");
fprintf(out, ">\n" );
fprintf(out, "\t\t\t<description>%s</description>\n", xml_normalize_string(swinfo.longname().c_str()));
fprintf(out, "\t\t\t<year>%s</year>\n", xml_normalize_string(swinfo.year().c_str()));
fprintf(out, "\t\t\t<publisher>%s</publisher>\n", xml_normalize_string(swinfo.publisher().c_str()));
fprintf(out, "\t\t\t<description>%s</description>\n", util::xml::normalize_string(swinfo.longname().c_str()));
fprintf(out, "\t\t\t<year>%s</year>\n", util::xml::normalize_string(swinfo.year().c_str()));
fprintf(out, "\t\t\t<publisher>%s</publisher>\n", util::xml::normalize_string(swinfo.publisher().c_str()));
for (const feature_list_item &flist : swinfo.other_info())
fprintf( out, "\t\t\t<info name=\"%s\" value=\"%s\"/>\n", flist.name().c_str(), xml_normalize_string( flist.value().c_str()) );
fprintf( out, "\t\t\t<info name=\"%s\" value=\"%s\"/>\n", flist.name().c_str(), util::xml::normalize_string( flist.value().c_str()) );
for (const software_part &part : swinfo.parts())
{
@ -1128,7 +1128,7 @@ void cli_frontend::output_single_softlist(FILE *out, software_list_device &swlis
fprintf(out, ">\n");
for (const feature_list_item &flist : part.featurelist())
fprintf(out, "\t\t\t\t<feature name=\"%s\" value=\"%s\" />\n", flist.name().c_str(), xml_normalize_string(flist.value().c_str()));
fprintf(out, "\t\t\t\t<feature name=\"%s\" value=\"%s\" />\n", flist.name().c_str(), util::xml::normalize_string(flist.value().c_str()));
/* TODO: display rom region information */
for (const rom_entry *region = part.romdata().data(); region; region = rom_next_region(region))
@ -1145,9 +1145,9 @@ void cli_frontend::output_single_softlist(FILE *out, software_list_device &swlis
if ( ROMENTRY_ISFILE(rom) )
{
if (!is_disk)
fprintf( out, "\t\t\t\t\t<rom name=\"%s\" size=\"%d\"", xml_normalize_string(ROM_GETNAME(rom)), rom_file_size(rom) );
fprintf( out, "\t\t\t\t\t<rom name=\"%s\" size=\"%d\"", util::xml::normalize_string(ROM_GETNAME(rom)), rom_file_size(rom) );
else
fprintf( out, "\t\t\t\t\t<disk name=\"%s\"", xml_normalize_string(ROM_GETNAME(rom)) );
fprintf( out, "\t\t\t\t\t<disk name=\"%s\"", util::xml::normalize_string(ROM_GETNAME(rom)) );
/* dump checksum information only if there is a known dump */
util::hash_collection hashes(ROM_GETHASHDATA(rom));

View File

@ -216,7 +216,7 @@ void info_xml_creator::output(FILE *out, bool nodevices)
#endif
"\" mameconfig=\"%d\">\n",
XML_ROOT,
xml_normalize_string(emulator_info::get_build_version()),
util::xml::normalize_string(emulator_info::get_build_version()),
CONFIG_VERSION
);
@ -283,7 +283,7 @@ void info_xml_creator::output_one()
// print the header and the game name
fprintf(m_output, "\t<%s",XML_TOP);
fprintf(m_output, " name=\"%s\"", xml_normalize_string(driver.name));
fprintf(m_output, " name=\"%s\"", util::xml::normalize_string(driver.name));
// strip away any path information from the source_file and output it
const char *start = strrchr(driver.source_file, '/');
@ -291,7 +291,7 @@ void info_xml_creator::output_one()
start = strrchr(driver.source_file, '\\');
if (start == nullptr)
start = driver.source_file - 1;
fprintf(m_output, " sourcefile=\"%s\"", xml_normalize_string(start + 1));
fprintf(m_output, " sourcefile=\"%s\"", util::xml::normalize_string(start + 1));
// append bios and runnable flags
if (driver.flags & MACHINE_IS_BIOS_ROOT)
@ -304,9 +304,9 @@ void info_xml_creator::output_one()
// display clone information
int clone_of = m_drivlist.find(driver.parent);
if (clone_of != -1 && !(m_drivlist.driver(clone_of).flags & MACHINE_IS_BIOS_ROOT))
fprintf(m_output, " cloneof=\"%s\"", xml_normalize_string(m_drivlist.driver(clone_of).name));
fprintf(m_output, " cloneof=\"%s\"", util::xml::normalize_string(m_drivlist.driver(clone_of).name));
if (clone_of != -1)
fprintf(m_output, " romof=\"%s\"", xml_normalize_string(m_drivlist.driver(clone_of).name));
fprintf(m_output, " romof=\"%s\"", util::xml::normalize_string(m_drivlist.driver(clone_of).name));
// display sample information and close the game tag
output_sampleof();
@ -314,15 +314,15 @@ void info_xml_creator::output_one()
// output game description
if (driver.description != nullptr)
fprintf(m_output, "\t\t<description>%s</description>\n", xml_normalize_string(driver.description));
fprintf(m_output, "\t\t<description>%s</description>\n", util::xml::normalize_string(driver.description));
// print the year only if is a number or another allowed character (? or +)
if (driver.year != nullptr && strspn(driver.year, "0123456789?+") == strlen(driver.year))
fprintf(m_output, "\t\t<year>%s</year>\n", xml_normalize_string(driver.year));
fprintf(m_output, "\t\t<year>%s</year>\n", util::xml::normalize_string(driver.year));
// print the manufacturer information
if (driver.manufacturer != nullptr)
fprintf(m_output, "\t\t<manufacturer>%s</manufacturer>\n", xml_normalize_string(driver.manufacturer));
fprintf(m_output, "\t\t<manufacturer>%s</manufacturer>\n", util::xml::normalize_string(driver.manufacturer));
// now print various additional information
output_bios();
@ -376,15 +376,15 @@ void info_xml_creator::output_one_device(device_t &device, const char *devtag)
// start to output info
fprintf(m_output, "\t<%s", XML_TOP);
fprintf(m_output, " name=\"%s\"", xml_normalize_string(device.shortname()));
fprintf(m_output, " name=\"%s\"", util::xml::normalize_string(device.shortname()));
std::string src(device.source());
strreplace(src,"../", "");
fprintf(m_output, " sourcefile=\"%s\"", xml_normalize_string(src.c_str()));
fprintf(m_output, " sourcefile=\"%s\"", util::xml::normalize_string(src.c_str()));
fprintf(m_output, " isdevice=\"yes\"");
fprintf(m_output, " runnable=\"no\"");
output_sampleof();
fprintf(m_output, ">\n");
fprintf(m_output, "\t\t<description>%s</description>\n", xml_normalize_string(device.name()));
fprintf(m_output, "\t\t<description>%s</description>\n", util::xml::normalize_string(device.name()));
output_rom(device);
@ -478,7 +478,7 @@ void info_xml_creator::output_device_roms()
{
for (device_t &device : device_iterator(m_drivlist.config().root_device()))
if (device.owner() != nullptr && device.shortname() != nullptr && device.shortname()[0] != '\0')
fprintf(m_output, "\t\t<device_ref name=\"%s\"/>\n", xml_normalize_string(device.shortname()));
fprintf(m_output, "\t\t<device_ref name=\"%s\"/>\n", util::xml::normalize_string(device.shortname()));
}
@ -495,7 +495,7 @@ void info_xml_creator::output_sampleof()
samples_iterator sampiter(device);
if (sampiter.altbasename() != nullptr)
{
fprintf(m_output, " sampleof=\"%s\"", xml_normalize_string(sampiter.altbasename()));
fprintf(m_output, " sampleof=\"%s\"", util::xml::normalize_string(sampiter.altbasename()));
// must stop here, as there can only be one attribute of the same name
return;
@ -529,8 +529,8 @@ void info_xml_creator::output_bios()
{
// output extracted name and descriptions
fprintf(m_output, "\t\t<biosset");
fprintf(m_output, " name=\"%s\"", xml_normalize_string(ROM_GETNAME(&rom)));
fprintf(m_output, " description=\"%s\"", xml_normalize_string(ROM_GETHASHDATA(&rom)));
fprintf(m_output, " name=\"%s\"", util::xml::normalize_string(ROM_GETNAME(&rom)));
fprintf(m_output, " description=\"%s\"", util::xml::normalize_string(ROM_GETHASHDATA(&rom)));
if (defaultname == ROM_GETNAME(&rom))
fprintf(m_output, " default=\"yes\"");
fprintf(m_output, "/>\n");
@ -597,11 +597,11 @@ void info_xml_creator::output_rom(device_t &device)
// add name, merge, bios, and size tags */
if (name != nullptr && name[0] != 0)
util::stream_format(output, " name=\"%s\"", xml_normalize_string(name));
util::stream_format(output, " name=\"%s\"", util::xml::normalize_string(name));
if (merge_name != nullptr)
util::stream_format(output, " merge=\"%s\"", xml_normalize_string(merge_name));
util::stream_format(output, " merge=\"%s\"", util::xml::normalize_string(merge_name));
if (bios_name[0] != 0)
util::stream_format(output, " bios=\"%s\"", xml_normalize_string(bios_name));
util::stream_format(output, " bios=\"%s\"", util::xml::normalize_string(bios_name));
if (!is_disk)
util::stream_format(output, " size=\"%d\"", rom_file_size(rom));
@ -659,7 +659,7 @@ void info_xml_creator::output_sample(device_t &device)
continue;
// output the sample name
fprintf(m_output, "\t\t<sample name=\"%s\"/>\n", xml_normalize_string(samplename));
fprintf(m_output, "\t\t<sample name=\"%s\"/>\n", util::xml::normalize_string(samplename));
}
}
}
@ -682,8 +682,8 @@ void info_xml_creator::output_chips(device_t &device, const char *root_tag)
fprintf(m_output, "\t\t<chip");
fprintf(m_output, " type=\"cpu\"");
fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag.c_str()));
fprintf(m_output, " name=\"%s\"", xml_normalize_string(exec.device().name()));
fprintf(m_output, " tag=\"%s\"", util::xml::normalize_string(newtag.c_str()));
fprintf(m_output, " name=\"%s\"", util::xml::normalize_string(exec.device().name()));
fprintf(m_output, " clock=\"%d\"", exec.device().clock());
fprintf(m_output, "/>\n");
}
@ -699,8 +699,8 @@ void info_xml_creator::output_chips(device_t &device, const char *root_tag)
fprintf(m_output, "\t\t<chip");
fprintf(m_output, " type=\"audio\"");
fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag.c_str()));
fprintf(m_output, " name=\"%s\"", xml_normalize_string(sound.device().name()));
fprintf(m_output, " tag=\"%s\"", util::xml::normalize_string(newtag.c_str()));
fprintf(m_output, " name=\"%s\"", util::xml::normalize_string(sound.device().name()));
if (sound.device().clock() != 0)
fprintf(m_output, " clock=\"%d\"", sound.device().clock());
fprintf(m_output, "/>\n");
@ -725,7 +725,7 @@ void info_xml_creator::output_display(device_t &device, const char *root_tag)
newtag = newtag.substr(newtag.find(oldtag.append(root_tag)) + oldtag.length());
fprintf(m_output, "\t\t<display");
fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag.c_str()));
fprintf(m_output, " tag=\"%s\"", util::xml::normalize_string(newtag.c_str()));
switch (screendev.screen_type())
{
@ -1230,7 +1230,7 @@ void info_xml_creator::output_input(const ioport_list &portlist)
//printf("type %s - player %d - buttons %d\n", elem.type, elem.player, elem.nbuttons);
if (elem.analog)
{
fprintf(m_output, "\t\t\t<control type=\"%s\"", xml_normalize_string(elem.type));
fprintf(m_output, "\t\t\t<control type=\"%s\"", util::xml::normalize_string(elem.type));
if (nplayer > 1)
fprintf(m_output, " player=\"%d\"", elem.player);
if (elem.nbuttons > 0)
@ -1259,7 +1259,7 @@ void info_xml_creator::output_input(const ioport_list &portlist)
if (elem.helper[0] == 0 && elem.helper[1] != 0) { elem.helper[0] = elem.helper[1]; elem.helper[1] = 0; }
if (elem.helper[1] == 0 && elem.helper[2] != 0) { elem.helper[1] = elem.helper[2]; elem.helper[2] = 0; }
const char *joys = (elem.helper[2] != 0) ? "triple" : (elem.helper[1] != 0) ? "double" : "";
fprintf(m_output, "\t\t\t<control type=\"%s%s\"", joys, xml_normalize_string(elem.type));
fprintf(m_output, "\t\t\t<control type=\"%s%s\"", joys, util::xml::normalize_string(elem.type));
if (nplayer > 1)
fprintf(m_output, " player=\"%d\"", elem.player);
if (elem.nbuttons > 0)
@ -1329,14 +1329,14 @@ void info_xml_creator::output_switches(const ioport_list &portlist, const char *
newtag = newtag.substr(newtag.find(oldtag.append(root_tag)) + oldtag.length());
// output the switch name information
std::string normalized_field_name(xml_normalize_string(field.name()));
std::string normalized_newtag(xml_normalize_string(newtag.c_str()));
std::string normalized_field_name(util::xml::normalize_string(field.name()));
std::string normalized_newtag(util::xml::normalize_string(newtag.c_str()));
util::stream_format(output,"\t\t<%s name=\"%s\" tag=\"%s\" mask=\"%u\">\n", outertag, normalized_field_name.c_str(), normalized_newtag.c_str(), field.mask());
// loop over settings
for (ioport_setting &setting : field.settings())
{
util::stream_format(output,"\t\t\t<%s name=\"%s\" value=\"%u\"%s/>\n", innertag, xml_normalize_string(setting.name()), setting.value(), setting.value() == field.defvalue() ? " default=\"yes\"" : "");
util::stream_format(output,"\t\t\t<%s name=\"%s\" value=\"%u\"%s/>\n", innertag, util::xml::normalize_string(setting.name()), setting.value(), setting.value() == field.defvalue() ? " default=\"yes\"" : "");
}
// terminate the switch entry
@ -1355,7 +1355,7 @@ void info_xml_creator::output_ports(const ioport_list &portlist)
// cycle through ports
for (auto &port : portlist)
{
fprintf(m_output,"\t\t<port tag=\"%s\">\n", xml_normalize_string(port.second->tag()));
fprintf(m_output,"\t\t<port tag=\"%s\">\n", util::xml::normalize_string(port.second->tag()));
for (ioport_field &field : port.second->fields())
{
if(field.is_analog())
@ -1378,7 +1378,7 @@ void info_xml_creator::output_adjusters(const ioport_list &portlist)
for (auto &port : portlist)
for (ioport_field &field : port.second->fields())
if (field.type() == IPT_ADJUSTER)
fprintf(m_output, "\t\t<adjuster name=\"%s\" default=\"%d\"/>\n", xml_normalize_string(field.name()), field.defvalue());
fprintf(m_output, "\t\t<adjuster name=\"%s\" default=\"%d\"/>\n", util::xml::normalize_string(field.name()), field.defvalue());
}
@ -1460,11 +1460,11 @@ void info_xml_creator::output_images(device_t &device, const char *root_tag)
newtag = newtag.substr(newtag.find(oldtag.append(root_tag)) + oldtag.length());
// print m_output device type
fprintf(m_output, "\t\t<device type=\"%s\"", xml_normalize_string(imagedev.image_type_name()));
fprintf(m_output, "\t\t<device type=\"%s\"", util::xml::normalize_string(imagedev.image_type_name()));
// does this device have a tag?
if (imagedev.device().tag())
fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag.c_str()));
fprintf(m_output, " tag=\"%s\"", util::xml::normalize_string(newtag.c_str()));
// is this device available as media switch?
if (!loadable)
@ -1475,7 +1475,7 @@ void info_xml_creator::output_images(device_t &device, const char *root_tag)
fprintf(m_output, " mandatory=\"1\"");
if (imagedev.image_interface() && imagedev.image_interface()[0])
fprintf(m_output, " interface=\"%s\"", xml_normalize_string(imagedev.image_interface()));
fprintf(m_output, " interface=\"%s\"", util::xml::normalize_string(imagedev.image_interface()));
// close the XML tag
fprintf(m_output, ">\n");
@ -1486,8 +1486,8 @@ void info_xml_creator::output_images(device_t &device, const char *root_tag)
const char *shortname = imagedev.brief_instance_name();
fprintf(m_output, "\t\t\t<instance");
fprintf(m_output, " name=\"%s\"", xml_normalize_string(name));
fprintf(m_output, " briefname=\"%s\"", xml_normalize_string(shortname));
fprintf(m_output, " name=\"%s\"", util::xml::normalize_string(name));
fprintf(m_output, " briefname=\"%s\"", util::xml::normalize_string(shortname));
fprintf(m_output, "/>\n");
std::string extensions(imagedev.file_extensions());
@ -1496,7 +1496,7 @@ void info_xml_creator::output_images(device_t &device, const char *root_tag)
while (ext != nullptr)
{
fprintf(m_output, "\t\t\t<extension");
fprintf(m_output, " name=\"%s\"", xml_normalize_string(ext));
fprintf(m_output, " name=\"%s\"", util::xml::normalize_string(ext));
fprintf(m_output, "/>\n");
ext = strtok(nullptr, ",");
}
@ -1523,11 +1523,11 @@ void info_xml_creator::output_slots(device_t &device, const char *root_tag)
newtag = newtag.substr(newtag.find(oldtag.append(root_tag)) + oldtag.length());
// print m_output device type
fprintf(m_output, "\t\t<slot name=\"%s\">\n", xml_normalize_string(newtag.c_str()));
fprintf(m_output, "\t\t<slot name=\"%s\">\n", util::xml::normalize_string(newtag.c_str()));
/*
if (slot.slot_interface()[0])
fprintf(m_output, " interface=\"%s\"", xml_normalize_string(slot.slot_interface()));
fprintf(m_output, " interface=\"%s\"", util::xml::normalize_string(slot.slot_interface()));
*/
for (auto &option : slot.option_list())
@ -1539,8 +1539,8 @@ void info_xml_creator::output_slots(device_t &device, const char *root_tag)
dev->config_complete();
fprintf(m_output, "\t\t\t<slotoption");
fprintf(m_output, " name=\"%s\"", xml_normalize_string(option.second->name()));
fprintf(m_output, " devname=\"%s\"", xml_normalize_string(dev->shortname()));
fprintf(m_output, " name=\"%s\"", util::xml::normalize_string(option.second->name()));
fprintf(m_output, " devname=\"%s\"", util::xml::normalize_string(dev->shortname()));
if (slot.default_option() != nullptr && strcmp(slot.default_option(), option.second->name())==0)
fprintf(m_output, " default=\"yes\"");
fprintf(m_output, "/>\n");

View File

@ -339,12 +339,12 @@ bool emulator_info::frame_hook()
return mame_machine_manager::instance()->lua()->frame_hook();
}
void emulator_info::layout_file_cb(xml_data_node &layout)
void emulator_info::layout_file_cb(util::xml::data_node &layout)
{
xml_data_node const *const mamelayout = layout.get_child("mamelayout");
util::xml::data_node const *const mamelayout = layout.get_child("mamelayout");
if (mamelayout)
{
xml_data_node const *const script = mamelayout->get_child("script");
util::xml::data_node const *const script = mamelayout->get_child("script");
if(script)
mame_machine_manager::instance()->lua()->call_plugin_set("layout", script->get_value());
}

View File

@ -552,7 +552,7 @@ public:
bool is_mfp() const { return !m_raw_mfp.isnull(); }
// late binding
void late_bind(delegate_late_bind &object) { bind((*m_latebinder)(object)); }
void late_bind(delegate_late_bind &object) { if(m_latebinder) bind((*m_latebinder)(object)); }
protected:
// return the actual object (not the one we use for calling)

View File

@ -20,6 +20,8 @@
#include <cstring>
namespace util { namespace xml {
/***************************************************************************
CONSTANTS
***************************************************************************/
@ -32,12 +34,12 @@
TYPE DEFINITIONS
***************************************************************************/
struct xml_parse_info
struct parse_info
{
XML_Parser parser;
xml_data_node * rootnode;
xml_data_node * curnode;
uint32_t flags;
XML_Parser parser;
data_node * rootnode;
data_node * curnode;
uint32_t flags;
};
@ -47,7 +49,7 @@ struct xml_parse_info
***************************************************************************/
/* expat interfaces */
static bool expat_setup_parser(xml_parse_info &info, xml_parse_options const *opts);
static bool expat_setup_parser(parse_info &info, parse_options const *opts);
static void expat_element_start(void *data, const XML_Char *name, const XML_Char **attributes);
static void expat_data(void *data, const XML_Char *s, int len);
static void expat_element_end(void *data, const XML_Char *name);
@ -59,25 +61,25 @@ static void expat_element_end(void *data, const XML_Char *name);
***************************************************************************/
/*-------------------------------------------------
xml_file_create - create a new xml file
file_create - create a new xml file
object
-------------------------------------------------*/
xml_data_node *xml_data_node::file_create()
data_node *data_node::file_create()
{
try { return new xml_data_node(); }
try { return new data_node(); }
catch (...) { return nullptr; }
}
/*-------------------------------------------------
xml_file_read - parse an XML file into its
file_read - parse an XML file into its
nodes
-------------------------------------------------*/
xml_data_node *xml_data_node::file_read(util::core_file &file, xml_parse_options const *opts)
data_node *data_node::file_read(util::core_file &file, parse_options const *opts)
{
xml_parse_info info;
parse_info info;
int done;
/* set up the parser */
@ -119,13 +121,13 @@ xml_data_node *xml_data_node::file_read(util::core_file &file, xml_parse_options
/*-------------------------------------------------
xml_string_read - parse an XML string into its
string_read - parse an XML string into its
nodes
-------------------------------------------------*/
xml_data_node *xml_data_node::string_read(const char *string, xml_parse_options const *opts)
data_node *data_node::string_read(const char *string, parse_options const *opts)
{
xml_parse_info info;
parse_info info;
int length = (int)strlen(string);
/* set up the parser */
@ -156,10 +158,10 @@ xml_data_node *xml_data_node::string_read(const char *string, xml_parse_options
/*-------------------------------------------------
xml_file_write - write an XML tree to a file
file_write - write an XML tree to a file
-------------------------------------------------*/
void xml_data_node::file_write(util::core_file &file) const
void data_node::file_write(util::core_file &file) const
{
/* ensure this is a root node */
if (get_name())
@ -170,16 +172,16 @@ void xml_data_node::file_write(util::core_file &file) const
file.printf("<!-- This file is autogenerated; comments and unknown tags will be stripped -->\n");
/* loop over children of the root and output */
for (xml_data_node const *node = get_first_child(); node; node = node->get_next_sibling())
for (data_node const *node = get_first_child(); node; node = node->get_next_sibling())
node->write_recursive(0, file);
}
/*-------------------------------------------------
xml_file_free - free an XML file object
file_free - free an XML file object
-------------------------------------------------*/
void xml_data_node::file_free()
void data_node::file_free()
{
/* ensure this is a root node */
if (get_name())
@ -194,7 +196,7 @@ void xml_data_node::file_free()
XML NODE MANAGEMENT
***************************************************************************/
xml_data_node::xml_data_node()
data_node::data_node()
: line(0)
, m_next(nullptr)
, m_first_child(nullptr)
@ -205,7 +207,7 @@ xml_data_node::xml_data_node()
{
}
xml_data_node::xml_data_node(xml_data_node *parent, const char *name, const char *value)
data_node::data_node(data_node *parent, const char *name, const char *value)
: line(0)
, m_next(nullptr)
, m_first_child(nullptr)
@ -223,10 +225,10 @@ xml_data_node::xml_data_node(xml_data_node *parent, const char *name, const char
the data allocated to an XML node
-------------------------------------------------*/
xml_data_node::~xml_data_node()
data_node::~data_node()
{
/* free the children */
for (xml_data_node *nchild = nullptr; m_first_child; m_first_child = nchild)
for (data_node *nchild = nullptr; m_first_child; m_first_child = nchild)
{
/* note the next node and free this node */
nchild = m_first_child->get_next_sibling();
@ -235,19 +237,19 @@ xml_data_node::~xml_data_node()
}
void xml_data_node::set_value(char const *value)
void data_node::set_value(char const *value)
{
m_value.assign(value ? value : "");
}
void xml_data_node::append_value(char const *value, int length)
void data_node::append_value(char const *value, int length)
{
m_value.append(value, length);
}
void xml_data_node::trim_whitespace()
void data_node::trim_whitespace()
{
/* first strip leading spaces */
std::string::iterator start = m_value.begin();
@ -264,99 +266,99 @@ void xml_data_node::trim_whitespace()
/*-------------------------------------------------
xml_data_node::count_children - count the
data_node::count_children - count the
number of child nodes
-------------------------------------------------*/
int xml_data_node::count_children() const
int data_node::count_children() const
{
int count = 0;
/* loop over children and count */
for (xml_data_node const *node = get_first_child(); node; node = node->get_next_sibling())
for (data_node const *node = get_first_child(); node; node = node->get_next_sibling())
count++;
return count;
}
/*-------------------------------------------------
xml_data_node::get_child - find the first
data_node::get_child - find the first
child of the specified node with the specified
tag
-------------------------------------------------*/
xml_data_node *xml_data_node::get_child(const char *name)
data_node *data_node::get_child(const char *name)
{
return m_first_child ? m_first_child->get_sibling(name) : nullptr;
}
xml_data_node const *xml_data_node::get_child(const char *name) const
data_node const *data_node::get_child(const char *name) const
{
return m_first_child ? m_first_child->get_sibling(name) : nullptr;
}
/*-------------------------------------------------
xml_find_first_matching_child - find the first
find_first_matching_child - find the first
child of the specified node with the
specified tag or attribute/value pair
-------------------------------------------------*/
xml_data_node *xml_data_node::find_first_matching_child(const char *name, const char *attribute, const char *matchval)
data_node *data_node::find_first_matching_child(const char *name, const char *attribute, const char *matchval)
{
return m_first_child ? m_first_child->find_matching_sibling(name, attribute, matchval) : nullptr;
}
xml_data_node const *xml_data_node::find_first_matching_child(const char *name, const char *attribute, const char *matchval) const
data_node const *data_node::find_first_matching_child(const char *name, const char *attribute, const char *matchval) const
{
return m_first_child ? m_first_child->find_matching_sibling(name, attribute, matchval) : nullptr;
}
/*-------------------------------------------------
xml_data_node::get_next_sibling - find the
data_node::get_next_sibling - find the
next sibling of the specified node with the
specified tag
-------------------------------------------------*/
xml_data_node *xml_data_node::get_next_sibling(const char *name)
data_node *data_node::get_next_sibling(const char *name)
{
return m_next ? m_next->get_sibling(name) : nullptr;
}
xml_data_node const *xml_data_node::get_next_sibling(const char *name) const
data_node const *data_node::get_next_sibling(const char *name) const
{
return m_next ? m_next->get_sibling(name) : nullptr;
}
/*-------------------------------------------------
xml_find_next_matching_sibling - find the next
find_next_matching_sibling - find the next
sibling of the specified node with the
specified tag or attribute/value pair
-------------------------------------------------*/
xml_data_node *xml_data_node::find_next_matching_sibling(const char *name, const char *attribute, const char *matchval)
data_node *data_node::find_next_matching_sibling(const char *name, const char *attribute, const char *matchval)
{
return m_next ? m_next->find_matching_sibling(name, attribute, matchval) : nullptr;
}
xml_data_node const *xml_data_node::find_next_matching_sibling(const char *name, const char *attribute, const char *matchval) const
data_node const *data_node::find_next_matching_sibling(const char *name, const char *attribute, const char *matchval) const
{
return m_next ? m_next->find_matching_sibling(name, attribute, matchval) : nullptr;
}
/*-------------------------------------------------
xml_add_child - add a new child node to the
add_child - add a new child node to the
given node
-------------------------------------------------*/
xml_data_node *xml_data_node::add_child(const char *name, const char *value)
data_node *data_node::add_child(const char *name, const char *value)
{
/* new element: create a new node */
xml_data_node *node;
try { node = new xml_data_node(this, name, value); }
data_node *node;
try { node = new data_node(this, name, value); }
catch (...) { return nullptr; }
if (!node->get_name() || (!node->get_value() && value))
@ -366,7 +368,7 @@ xml_data_node *xml_data_node::add_child(const char *name, const char *value)
}
/* add us to the end of the list of siblings */
xml_data_node **pnode;
data_node **pnode;
for (pnode = &m_first_child; *pnode; pnode = &(*pnode)->m_next) { }
*pnode = node;
@ -375,14 +377,14 @@ xml_data_node *xml_data_node::add_child(const char *name, const char *value)
/*-------------------------------------------------
xml_get_or_add_child - find a child node of
get_or_add_child - find a child node of
the specified type; if not found, add one
-------------------------------------------------*/
xml_data_node *xml_data_node::get_or_add_child(const char *name, const char *value)
data_node *data_node::get_or_add_child(const char *name, const char *value)
{
/* find the child first */
xml_data_node *const child = m_first_child->get_sibling(name);
data_node *const child = m_first_child->get_sibling(name);
if (child)
return child;
@ -392,16 +394,16 @@ xml_data_node *xml_data_node::get_or_add_child(const char *name, const char *val
/*-------------------------------------------------
xml_delete_node - delete a node and its
delete_node - delete a node and its
children
-------------------------------------------------*/
void xml_data_node::delete_node()
void data_node::delete_node()
{
/* first unhook us from the list of children of our parent */
if (m_parent)
{
for (xml_data_node **pnode = &m_parent->m_first_child; *pnode; pnode = &(*pnode)->m_next)
for (data_node **pnode = &m_parent->m_first_child; *pnode; pnode = &(*pnode)->m_next)
{
if (*pnode == this)
{
@ -417,23 +419,23 @@ void xml_data_node::delete_node()
/*-------------------------------------------------
xml_get_next_sibling - find the next sibling of
get_next_sibling - find the next sibling of
the specified node with the specified tag
-------------------------------------------------*/
xml_data_node *xml_data_node::get_sibling(const char *name)
data_node *data_node::get_sibling(const char *name)
{
/* loop over siblings and find a matching name */
for (xml_data_node *node = this; node; node = node->get_next_sibling())
for (data_node *node = this; node; node = node->get_next_sibling())
if (strcmp(node->get_name(), name) == 0)
return node;
return nullptr;
}
xml_data_node const *xml_data_node::get_sibling(const char *name) const
data_node const *data_node::get_sibling(const char *name) const
{
/* loop over siblings and find a matching name */
for (xml_data_node const *node = this; node; node = node->get_next_sibling())
for (data_node const *node = this; node; node = node->get_next_sibling())
if (strcmp(node->get_name(), name) == 0)
return node;
return nullptr;
@ -441,15 +443,15 @@ xml_data_node const *xml_data_node::get_sibling(const char *name) const
/*-------------------------------------------------
xml_find_matching_sibling - find the next
find_matching_sibling - find the next
sibling of the specified node with the
specified tag or attribute/value pair
-------------------------------------------------*/
xml_data_node *xml_data_node::find_matching_sibling(const char *name, const char *attribute, const char *matchval)
data_node *data_node::find_matching_sibling(const char *name, const char *attribute, const char *matchval)
{
/* loop over siblings and find a matching attribute */
for (xml_data_node *node = this; node; node = node->get_next_sibling())
for (data_node *node = this; node; node = node->get_next_sibling())
{
/* can pass nullptr as a wildcard for the node name */
if (!name || !strcmp(name, node->get_name()))
@ -463,10 +465,10 @@ xml_data_node *xml_data_node::find_matching_sibling(const char *name, const char
return nullptr;
}
xml_data_node const *xml_data_node::find_matching_sibling(const char *name, const char *attribute, const char *matchval) const
data_node const *data_node::find_matching_sibling(const char *name, const char *attribute, const char *matchval) const
{
/* loop over siblings and find a matching attribute */
for (xml_data_node const *node = this; node; node = node->get_next_sibling())
for (data_node const *node = this; node; node = node->get_next_sibling())
{
/* can pass nullptr as a wildcard for the node name */
if (!name || !strcmp(name, node->get_name()))
@ -486,18 +488,18 @@ xml_data_node const *xml_data_node::find_matching_sibling(const char *name, cons
XML ATTRIBUTE MANAGEMENT
***************************************************************************/
bool xml_data_node::has_attribute(const char *attribute) const
bool data_node::has_attribute(const char *attribute) const
{
return get_attribute(attribute) != nullptr;
}
/*-------------------------------------------------
xml_get_attribute - get the value of the
get_attribute - get the value of the
specified attribute, or nullptr if not found
-------------------------------------------------*/
xml_data_node::attribute_node *xml_data_node::get_attribute(const char *attribute)
data_node::attribute_node *data_node::get_attribute(const char *attribute)
{
/* loop over attributes and find a match */
for (attribute_node &anode : m_attributes)
@ -506,7 +508,7 @@ xml_data_node::attribute_node *xml_data_node::get_attribute(const char *attribut
return nullptr;
}
xml_data_node::attribute_node const *xml_data_node::get_attribute(const char *attribute) const
data_node::attribute_node const *data_node::get_attribute(const char *attribute) const
{
/* loop over attributes and find a match */
for (attribute_node const &anode : m_attributes)
@ -517,12 +519,12 @@ xml_data_node::attribute_node const *xml_data_node::get_attribute(const char *at
/*-------------------------------------------------
xml_get_attribute_string - get the string
get_attribute_string - get the string
value of the specified attribute; if not
found, return = the provided default
-------------------------------------------------*/
const char *xml_data_node::get_attribute_string(const char *attribute, const char *defvalue) const
const char *data_node::get_attribute_string(const char *attribute, const char *defvalue) const
{
attribute_node const *attr = get_attribute(attribute);
return attr ? attr->value.c_str() : defvalue;
@ -530,12 +532,12 @@ const char *xml_data_node::get_attribute_string(const char *attribute, const cha
/*-------------------------------------------------
xml_get_attribute_int - get the integer
get_attribute_int - get the integer
value of the specified attribute; if not
found, return = the provided default
-------------------------------------------------*/
int xml_data_node::get_attribute_int(const char *attribute, int defvalue) const
int data_node::get_attribute_int(const char *attribute, int defvalue) const
{
char const *const string = get_attribute_string(attribute, nullptr);
int value;
@ -554,11 +556,11 @@ int xml_data_node::get_attribute_int(const char *attribute, int defvalue) const
/*-------------------------------------------------
xml_get_attribute_int_format - return the
get_attribute_int_format - return the
format of the given integer attribute
-------------------------------------------------*/
xml_data_node::int_format xml_data_node::get_attribute_int_format(const char *attribute) const
data_node::int_format data_node::get_attribute_int_format(const char *attribute) const
{
char const *const string = get_attribute_string(attribute, nullptr);
@ -576,12 +578,12 @@ xml_data_node::int_format xml_data_node::get_attribute_int_format(const char *at
/*-------------------------------------------------
xml_get_attribute_float - get the float
get_attribute_float - get the float
value of the specified attribute; if not
found, return = the provided default
-------------------------------------------------*/
float xml_data_node::get_attribute_float(const char *attribute, float defvalue) const
float data_node::get_attribute_float(const char *attribute, float defvalue) const
{
char const *const string = get_attribute_string(attribute, nullptr);
float value;
@ -593,11 +595,11 @@ float xml_data_node::get_attribute_float(const char *attribute, float defvalue)
/*-------------------------------------------------
xml_set_attribute - set a new attribute and
set_attribute - set a new attribute and
string value on the node
-------------------------------------------------*/
void xml_data_node::set_attribute(const char *name, const char *value)
void data_node::set_attribute(const char *name, const char *value)
{
attribute_node *anode;
@ -618,11 +620,11 @@ void xml_data_node::set_attribute(const char *name, const char *value)
/*-------------------------------------------------
xml_set_attribute_int - set a new attribute and
set_attribute_int - set a new attribute and
integer value on the node
-------------------------------------------------*/
void xml_data_node::set_attribute_int(const char *name, int value)
void data_node::set_attribute_int(const char *name, int value)
{
char buffer[100];
sprintf(buffer, "%d", value);
@ -631,11 +633,11 @@ void xml_data_node::set_attribute_int(const char *name, int value)
/*-------------------------------------------------
xml_set_attribute_int - set a new attribute and
set_attribute_int - set a new attribute and
float value on the node
-------------------------------------------------*/
void xml_data_node::set_attribute_float(const char *name, float value)
void data_node::set_attribute_float(const char *name, float value)
{
char buffer[100];
sprintf(buffer, "%f", (double) value);
@ -649,11 +651,11 @@ void xml_data_node::set_attribute_float(const char *name, float value)
***************************************************************************/
/*-------------------------------------------------
xml_normalize_string - normalize a string
normalize_string - normalize a string
to ensure it doesn't contain embedded tags
-------------------------------------------------*/
const char *xml_normalize_string(const char *string)
const char *normalize_string(const char *string)
{
static char buffer[1024];
char *d = &buffer[0];
@ -723,7 +725,7 @@ static void *expat_realloc(void *ptr, size_t size)
expat_setup_parser - set up expat for parsing
-------------------------------------------------*/
static bool expat_setup_parser(xml_parse_info &info, xml_parse_options const *opts)
static bool expat_setup_parser(parse_info &info, parse_options const *opts)
{
XML_Memory_Handling_Suite memcallbacks;
@ -741,7 +743,7 @@ static bool expat_setup_parser(xml_parse_info &info, xml_parse_options const *op
}
/* create a root node */
info.rootnode = xml_data_node::file_create();
info.rootnode = data_node::file_create();
if (info.rootnode == nullptr)
return false;
info.curnode = info.rootnode;
@ -776,9 +778,9 @@ static bool expat_setup_parser(xml_parse_info &info, xml_parse_options const *op
static void expat_element_start(void *data, const XML_Char *name, const XML_Char **attributes)
{
xml_parse_info *parse_info = (xml_parse_info *) data;
xml_data_node **curnode = &parse_info->curnode;
xml_data_node *newnode;
parse_info *info = (parse_info *) data;
data_node **curnode = &info->curnode;
data_node *newnode;
int attr;
/* add a new child node to the current node */
@ -787,7 +789,7 @@ static void expat_element_start(void *data, const XML_Char *name, const XML_Char
return;
/* remember the line number */
newnode->line = XML_GetCurrentLineNumber(parse_info->parser);
newnode->line = XML_GetCurrentLineNumber(info->parser);
/* add all the attributes as well */
for (attr = 0; attributes[attr]; attr += 2)
@ -805,8 +807,8 @@ static void expat_element_start(void *data, const XML_Char *name, const XML_Char
static void expat_data(void *data, const XML_Char *s, int len)
{
xml_parse_info *parse_info = (xml_parse_info *) data;
xml_data_node **curnode = &parse_info->curnode;
parse_info *info = (parse_info *) data;
data_node **curnode = &info->curnode;
(*curnode)->append_value(s, len);
}
@ -818,11 +820,11 @@ static void expat_data(void *data, const XML_Char *s, int len)
static void expat_element_end(void *data, const XML_Char *name)
{
xml_parse_info *parse_info = (xml_parse_info *) data;
xml_data_node **curnode = &parse_info->curnode;
parse_info *info = (parse_info *) data;
data_node **curnode = &info->curnode;
/* strip leading/trailing spaces from the value data */
if (!(parse_info->flags & XML_PARSE_FLAG_WHITESPACE_SIGNIFICANT))
if (!(info->flags & PARSE_FLAG_WHITESPACE_SIGNIFICANT))
(*curnode)->trim_whitespace();
/* back us up a node */
@ -840,7 +842,7 @@ static void expat_element_end(void *data, const XML_Char *name)
given node
-------------------------------------------------*/
void xml_data_node::add_attribute(const char *name, const char *value)
void data_node::add_attribute(const char *name, const char *value)
{
try
{
@ -863,7 +865,7 @@ void xml_data_node::add_attribute(const char *name, const char *value)
an XML node and its children to a file
-------------------------------------------------*/
void xml_data_node::write_recursive(int indent, util::core_file &file) const
void data_node::write_recursive(int indent, util::core_file &file) const
{
/* output this tag */
file.printf("%*s<%s", indent, "", get_name());
@ -889,7 +891,7 @@ void xml_data_node::write_recursive(int indent, util::core_file &file) const
/* loop over children and output them as well */
if (get_first_child())
{
for (xml_data_node const *child = this->get_first_child(); child; child = child->get_next_sibling())
for (data_node const *child = this->get_first_child(); child; child = child->get_next_sibling())
child->write_recursive(indent + 4, file);
}
@ -897,3 +899,6 @@ void xml_data_node::write_recursive(int indent, util::core_file &file) const
file.printf("%*s</%s>\n", indent, "", get_name());
}
}
} } // namespace util::xml

View File

@ -21,26 +21,29 @@
#include <utility>
// forward type declarations
struct XML_ParserStruct;
namespace util { namespace xml {
/***************************************************************************
CONSTANTS
***************************************************************************/
enum
{
XML_PARSE_FLAG_WHITESPACE_SIGNIFICANT = 1
PARSE_FLAG_WHITESPACE_SIGNIFICANT = 1
};
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
// forward type declarations
struct XML_ParserStruct;
/* extended error information from parsing */
struct xml_parse_error
struct parse_error
{
const char * error_message;
int error_line;
@ -49,16 +52,16 @@ struct xml_parse_error
// parsing options
struct xml_parse_options
struct parse_options
{
xml_parse_error * error;
void (*init_parser)(struct XML_ParserStruct *parser);
uint32_t flags;
parse_error * error;
void (*init_parser)(XML_ParserStruct *parser);
uint32_t flags;
};
// a node representing a data item and its relationships
class xml_data_node
class data_node
{
public:
enum class int_format
@ -74,13 +77,13 @@ public:
/* ----- XML file objects ----- */
// create a new empty xml file object
static xml_data_node *file_create();
static data_node *file_create();
// parse an XML file into its nodes */
static xml_data_node *file_read(util::core_file &file, xml_parse_options const *opts);
static data_node *file_read(util::core_file &file, parse_options const *opts);
/* parse an XML string into its nodes */
static xml_data_node *string_read(const char *string, xml_parse_options const *opts);
static data_node *string_read(const char *string, parse_options const *opts);
// write an XML tree to a file
void file_write(util::core_file &file) const;
@ -98,41 +101,41 @@ public:
void append_value(char const *value, int length);
void trim_whitespace();
xml_data_node *get_parent() { return m_parent; }
xml_data_node const *get_parent() const { return m_parent; }
data_node *get_parent() { return m_parent; }
data_node const *get_parent() const { return m_parent; }
// count the number of child nodes
int count_children() const;
// get the first child
xml_data_node *get_first_child() { return m_first_child; }
xml_data_node const *get_first_child() const { return m_first_child; }
data_node *get_first_child() { return m_first_child; }
data_node const *get_first_child() const { return m_first_child; }
// find the first child with the given tag
xml_data_node *get_child(const char *name);
xml_data_node const *get_child(const char *name) const;
data_node *get_child(const char *name);
data_node const *get_child(const char *name) const;
// find the first child with the given tag and/or attribute/value pair
xml_data_node *find_first_matching_child(const char *name, const char *attribute, const char *matchval);
xml_data_node const *find_first_matching_child(const char *name, const char *attribute, const char *matchval) const;
data_node *find_first_matching_child(const char *name, const char *attribute, const char *matchval);
data_node const *find_first_matching_child(const char *name, const char *attribute, const char *matchval) const;
// get the next sibling
xml_data_node *get_next_sibling() { return m_next; }
xml_data_node const *get_next_sibling() const { return m_next; }
data_node *get_next_sibling() { return m_next; }
data_node const *get_next_sibling() const { return m_next; }
// find the next sibling with the given tag
xml_data_node *get_next_sibling(const char *name);
xml_data_node const *get_next_sibling(const char *name) const;
data_node *get_next_sibling(const char *name);
data_node const *get_next_sibling(const char *name) const;
// find the next sibling with the given tag and/or attribute/value pair
xml_data_node *find_next_matching_sibling(const char *name, const char *attribute, const char *matchval);
xml_data_node const *find_next_matching_sibling(const char *name, const char *attribute, const char *matchval) const;
data_node *find_next_matching_sibling(const char *name, const char *attribute, const char *matchval);
data_node const *find_next_matching_sibling(const char *name, const char *attribute, const char *matchval) const;
// add a new child node
xml_data_node *add_child(const char *name, const char *value);
data_node *add_child(const char *name, const char *value);
// either return an existing child node or create one if it doesn't exist
xml_data_node *get_or_add_child(const char *name, const char *value);
data_node *get_or_add_child(const char *name, const char *value);
// delete a node and its children
void delete_node();
@ -184,19 +187,19 @@ private:
};
xml_data_node();
xml_data_node(xml_data_node *parent, const char *name, const char *value);
~xml_data_node();
data_node();
data_node(data_node *parent, const char *name, const char *value);
~data_node();
xml_data_node(xml_data_node const &) = delete;
xml_data_node(xml_data_node &&) = delete;
xml_data_node &operator=(xml_data_node &&) = delete;
xml_data_node &operator=(xml_data_node const &) = delete;
data_node(data_node const &) = delete;
data_node(data_node &&) = delete;
data_node &operator=(data_node &&) = delete;
data_node &operator=(data_node const &) = delete;
xml_data_node *get_sibling(const char *name);
xml_data_node const *get_sibling(const char *name) const;
xml_data_node *find_matching_sibling(const char *name, const char *attribute, const char *matchval);
xml_data_node const *find_matching_sibling(const char *name, const char *attribute, const char *matchval) const;
data_node *get_sibling(const char *name);
data_node const *get_sibling(const char *name) const;
data_node *find_matching_sibling(const char *name, const char *attribute, const char *matchval);
data_node const *find_matching_sibling(const char *name, const char *attribute, const char *matchval) const;
attribute_node *get_attribute(const char *attribute);
attribute_node const *get_attribute(const char *attribute) const;
@ -204,11 +207,11 @@ private:
void write_recursive(int indent, util::core_file &file) const;
xml_data_node * m_next;
xml_data_node * m_first_child;
data_node * m_next;
data_node * m_first_child;
std::string m_name;
std::string m_value;
xml_data_node * m_parent;
data_node * m_parent;
std::list<attribute_node> m_attributes;
};
@ -221,6 +224,8 @@ private:
/* ----- miscellaneous interfaces ----- */
/* normalize a string into something that can be written to an XML file */
const char *xml_normalize_string(const char *string);
const char *normalize_string(const char *string);
} } // namespace util::xml
#endif /* MAME_LIB_UTIL_XMLFILE_H */

View File

@ -850,6 +850,7 @@ peplus.cpp
peyper.cpp
pgm.cpp
pgm2.cpp
pgm3.cpp
phoenix.cpp
photon.cpp
photon2.cpp

View File

@ -66,6 +66,7 @@ WRITE8_MEMBER(_8080bw_state::invadpt2_sh_port_2_w)
if (rising_bits & 0x10) m_samples->start(3, 7); /* SAUCER HIT */
m_flip_screen = BIT(data, 5) & ioport(CABINET_PORT_TAG)->read();
m_color_map = BIT(data, 5);
m_port_2_last_extra = data;
}

View File

@ -1,482 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Mathis Rosenhauer
/*************************************************************************
Beezer 6522+6840 audio hardware
driver based on exidy audio hardware which it shares some similarity to
Original driver by ? (Nicola or Aaron, I think)
Preliminary, partially functional driver by Jonathan Gevaryahu
AKA Lord Nightmare
TODO:
* Several inexplicable things on the schematic are not handled, such as the
'VCO' input for 6840 channel 2 external clock whose source does not appear
anywhere on the schematic, nor does it handle the 'DMOD DATA' and 'DMOD
CLR' outputs for some sort of digital modulator (perhaps an hc55516?)
from the VIA, which also does not appear anywhere on schematic.
The latter the VIA *DOES* seem to write something to, but it may be just
a silence waveform for 55516, alternating zeroes and ones.
* The channel mixing is done additively at the moment rather than
emulating the original multiplexer, which is actually not that hard to do
but adds a bit of complexity to the render loop.
* The 'FM OR AM' output of the audio via (pb1) appears to control some sort
of suppression or filtering change of the post-DAC amplifier when enabled,
only during the TIMER1 OUT time-slot of the multiplexer, see page 1B 3-3
of schematics. This will be a MESS to emulate since theres a lot of analog
crap involved.
* The /INT line and related logic of the 6840 is not emulated, and should
be hooked to the audio 6809.
* Convert this to a modern device instead of a deprecated old style device
Notes on multiplexer:
The sound output is from a DAC76xx 8-bit dac; driving this dac is a pair
of 74ls670 4x4 register files wired up as four 8-bit words;
The four words are used as the volumes for four 1-bit channels by inversion
of the MSB of the 8 bit value.
NOISE is the output of an MM5837 whitenoise generator, a self-clocked (at
around 100khz) LFSR with taps on bits (base-0) 16 and 13.
The four channels are:
CNT1 CNT0
0 0 6522 pin 7 output (squarewave); 'FM or AM' affects this slot only
0 1 6840 channel 1 clocked by E1(int) OR by 6522 PB7-latched NOISE
1 0 6840 channel 2 clocked by E1(int) OR by "VCO" ext (Huh?)
1 1 6840 channel 3 clocked by E1(int) OR by channel 2-latched NOISE
The four slots determine which address is selected of the 8-bit words and
which source will XOR against the MSB of the 8-bit word before it goes
to the DAC (effectively making the 8-bit word be a 7-bit volume control
plus optional wave invert). The speed which cnt0 and cnt1 count at is
E1/16 or 62500Hz.
*************************************************************************/
#include "emu.h"
#include "machine/rescap.h"
#include "includes/beezer.h"
/*************************************
*
* Constants
*
*************************************/
#define CRYSTAL_OSC (XTAL_12MHz)
#define SH6840_CLOCK (CRYSTAL_OSC / 12)
#define MULTIPLEX_FREQ (SH6840_CLOCK / 16)
const device_type BEEZER = &device_creator<beezer_sound_device>;
beezer_sound_device::beezer_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, BEEZER, "beezer SFX", tag, owner, clock, "beezer_sound", __FILE__),
device_sound_interface(mconfig, *this),
//m_ptm_irq_state(0),
m_sh6840_MSB_latch(0),
m_sh6840_LSB_latch(0),
m_sh6840_LFSR(0),
m_sh6840_LFSR_clocks(0),
m_sh6840_clocks_per_sample(0),
m_sh6840_clock_count(0),
m_sh6840_latchwrite(0),
m_sh6840_latchwriteold(0),
m_sh6840_noiselatch1(0),
m_sh6840_noiselatch3(0),
m_stream(nullptr)/*,
m_freq_to_step(0)*/
{
memset(m_sh6840_timer, 0, sizeof(m_sh6840_timer));
m_sh6840_volume[0] = 0;
m_sh6840_volume[1] = 0;
m_sh6840_volume[2] = 0;
m_sh6840_volume[3] = 0;
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void beezer_sound_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void beezer_sound_device::device_start()
{
int sample_rate = MULTIPLEX_FREQ;
m_sh6840_clocks_per_sample = (int)(((double)SH6840_CLOCK / (double)sample_rate) * (double)(1 << 24));
/* allocate the stream */
m_stream = machine().sound().stream_alloc(*this, 0, 1, sample_rate);
m_maincpu = machine().device<cpu_device>("maincpu");
save_item(NAME(m_sh6840_volume));
save_item(NAME(m_sh6840_MSB_latch));
save_item(NAME(m_sh6840_LSB_latch));
save_item(NAME(m_sh6840_LFSR));
save_item(NAME(m_sh6840_LFSR_clocks));
save_item(NAME(m_sh6840_clock_count));
save_item(NAME(m_sh6840_latchwrite));
save_item(NAME(m_sh6840_latchwriteold));
save_item(NAME(m_sh6840_noiselatch1));
save_item(NAME(m_sh6840_noiselatch3));
save_item(NAME(m_sh6840_timer[0].cr));
save_item(NAME(m_sh6840_timer[0].state));
save_item(NAME(m_sh6840_timer[0].leftovers));
save_item(NAME(m_sh6840_timer[0].timer));
save_item(NAME(m_sh6840_timer[0].clocks));
save_item(NAME(m_sh6840_timer[0].counter.w));
save_item(NAME(m_sh6840_timer[1].cr));
save_item(NAME(m_sh6840_timer[1].state));
save_item(NAME(m_sh6840_timer[1].leftovers));
save_item(NAME(m_sh6840_timer[1].timer));
save_item(NAME(m_sh6840_timer[1].clocks));
save_item(NAME(m_sh6840_timer[1].counter.w));
save_item(NAME(m_sh6840_timer[2].cr));
save_item(NAME(m_sh6840_timer[2].state));
save_item(NAME(m_sh6840_timer[2].leftovers));
save_item(NAME(m_sh6840_timer[2].timer));
save_item(NAME(m_sh6840_timer[2].clocks));
save_item(NAME(m_sh6840_timer[2].counter.w));
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void beezer_sound_device::device_reset()
{
/* 6840 */
memset(m_sh6840_timer, 0, sizeof(m_sh6840_timer));
m_sh6840_MSB_latch = 0;
m_sh6840_LSB_latch = 0;
m_sh6840_volume[0] = 0;
m_sh6840_volume[1] = 0;
m_sh6840_volume[2] = 0;
m_sh6840_volume[3] = 0;
m_sh6840_clock_count = 0;
m_sh6840_latchwrite = 0;
m_sh6840_latchwriteold = 0;
m_sh6840_noiselatch1 = 0;
m_sh6840_noiselatch3 = 0;
/* LFSR */
m_sh6840_LFSR = 0xffffffff;
m_sh6840_LFSR_clocks = 0;
}
/*************************************
*
* Interrupt generation helper
* TODO: make this actually do something useful
*************************************/
/*WRITE_LINE_MEMBER( beezer_sound_device::update_irq_state )
{
m_audiocpu->set_input_line(M6809_IRQ_LINE, (sndptm_irq_state) ? ASSERT_LINE : CLEAR_LINE);
}*/
/*************************************
*
* 6840 clock counting helper
*
*************************************/
// need to set int_flag properly here
static inline void sh6840_apply_clock(struct sh6840_timer_channel_beez *t, int clocks)
{
/* dual 8-bit case */
if (t->cr & 0x04)
{
/* handle full decrements */
while (clocks > t->counter.b.l)
{
clocks -= t->counter.b.l + 1;
t->counter.b.l = t->timer;
/* decrement MSB */
if (!t->counter.b.h--)
{
t->state = 0;
t->counter.w = t->timer;
}
/* state goes high when MSB is 0 */
else if (!t->counter.b.h)
{
t->state = 1;
t->clocks++;
}
}
/* subtract off the remainder */
t->counter.b.l -= clocks;
}
/* 16-bit case */
else
{
/* handle full decrements */
while (clocks > t->counter.w)
{
clocks -= t->counter.w + 1;
t->state ^= 1;
t->clocks += t->state;
t->counter.w = t->timer;
}
/* subtract off the remainder */
t->counter.w -= clocks;
}
}
/*************************************
*
* Noise generation helper
*
*************************************/
int beezer_sound_device::sh6840_update_noise(int clocks)
{
uint32_t newxor;
int noise_clocks = 0;
int i;
/* loop over clocks */
for (i = 0; i < clocks; i++)
{
m_sh6840_LFSR_clocks++;
if (m_sh6840_LFSR_clocks >= 10) // about 10 clocks per 6840 clock, as MM5837 runs at around 100kHz, while clock is 1MHz
{
m_sh6840_LFSR_clocks = 0;
/* shift the LFSR. finally or in the result and see if we've
* had a 0->1 transition */
newxor = (((m_sh6840_LFSR&0x10000)?1:0) ^ ((m_sh6840_LFSR&0x2000)?1:0))?1:0;
m_sh6840_LFSR <<= 1;
m_sh6840_LFSR |= newxor;
/*printf("LFSR: %4x, %4x, %4x, %4x\n", sh6840_LFSR_3, sh6840_LFSR_2, sh6840_LFSR_1, sh6840_LFSR_0);*/
/* if we clocked 0->1, that will serve as an external clock */
if ((m_sh6840_LFSR & 0x01) == 0x01) /* tap is at bit 0, GUESSED */
{
noise_clocks++;
}
}
}
return noise_clocks;
}
/*************************************
*
* 6840 timer handlers
*
*************************************/
READ8_MEMBER( beezer_sound_device::sh6840_r )
{
/* force an update of the stream */
m_stream->update();
switch (offset)
{
/* offset 0: Motorola datasheet says it isn't used, Hitachi datasheet says it reads as 0s always*/
case 0:
return 0;
/* offset 1 reads the status register: bits 2 1 0 correspond to ints on channels 2,1,0, and bit 7 is an 'OR' of bits 2,1,0 */
case 1:
logerror("%04X:beezer_sh6840_r - unexpected read, status register is TODO!\n", m_maincpu->pc());
return 0;
/* offsets 2,4,6 read channel 0,1,2 MSBs and latch the LSB*/
case 2: case 4: case 6:
m_sh6840_LSB_latch = m_sh6840_timer[((offset>>1)-1)].counter.b.l;
return m_sh6840_timer[((offset>>1)-1)].counter.b.h;
/* offsets 3,5,7 read the LSB latch*/
default: /* case 3,5,7 */
return m_sh6840_LSB_latch;
}
}
WRITE8_MEMBER( beezer_sound_device::timer1_w )
{
/* force an update of the stream */
m_stream->update();
m_sh6840_latchwriteold = m_sh6840_latchwrite;
m_sh6840_latchwrite = data&0x80;
if ((!m_sh6840_latchwriteold) && (m_sh6840_latchwrite)) // rising edge
{
m_sh6840_noiselatch1 = (m_sh6840_LFSR&0x1);
}
}
READ8_MEMBER( beezer_sound_device::noise_r )
{
/* force an update of the stream */
m_stream->update();
return (m_sh6840_LFSR&0x1);
}
WRITE8_MEMBER( beezer_sound_device::sh6840_w )
{
struct sh6840_timer_channel_beez *sh6840_timer = m_sh6840_timer;
/* force an update of the stream */
m_stream->update();
switch (offset)
{
/* offset 0 writes to either channel 0 control or channel 2 control */
case 0:
if (sh6840_timer[1].cr & 0x01)
sh6840_timer[0].cr = data;
else
sh6840_timer[2].cr = data;
/* only support mode 0 and 2 */
if (((data >> 3) & 5) != 0)
fprintf(stderr,"beezer_sh6840_w - channel %d configured for mode %d (write was %02x to offset 0)", (sh6840_timer[1].cr & 0x01) ? 0 : 2, (data >> 3) & 7, data);
break;
/* offset 1 writes to channel 1 control */
case 1:
sh6840_timer[1].cr = data;
/* only support mode 0 and 2 */
if (((data >> 3) & 5) != 0)
fprintf(stderr,"beezer_sh6840_w - channel 1 configured for mode %d (write was %02x to offset 1)", (data >> 3) & 7, data);
break;
/* offsets 2/4/6 write to the common MSB latch */
case 2:
case 4:
case 6:
m_sh6840_MSB_latch = data;
break;
/* offsets 3/5/7 write to the LSB controls */
case 3:
case 5:
case 7:
{
/* latch the timer value */
int ch = (offset - 3) / 2;
sh6840_timer[ch].timer = (m_sh6840_MSB_latch << 8) | (data & 0xff);
/* if CR4 is clear, the value is loaded immediately */
if (!(sh6840_timer[ch].cr & 0x10))
sh6840_timer[ch].counter.w = sh6840_timer[ch].timer;
break;
}
}
}
/*************************************
*
* DAC write handler
*
*************************************/
WRITE8_MEMBER( beezer_sound_device::sfxctrl_w )
{
m_stream->update();
m_sh6840_volume[offset] = data;
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void beezer_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
struct sh6840_timer_channel_beez *sh6840_timer = m_sh6840_timer;
/* hack to skip the expensive lfsr noise generation unless at least one of the 2 channels which actually depend on it are set to use it as a source */
int noisy = ((sh6840_timer[0].cr & sh6840_timer[2].cr & 0x02) == 0);
stream_sample_t *buffer = outputs[0];
/* loop over samples */
while (samples--)
{
struct sh6840_timer_channel_beez *t;
int clocks_this_sample;
int clocks;
int16_t sample1, sample2, sample3, sample0;
int16_t sample = 0;
sample1 = sample2 = sample3 = sample0 = 0;
/* determine how many 6840 clocks this sample */
m_sh6840_clock_count += m_sh6840_clocks_per_sample;
clocks_this_sample = m_sh6840_clock_count >> 24;
m_sh6840_clock_count &= (1 << 24) - 1;
/* skip if nothing enabled */
if ((sh6840_timer[0].cr & 0x01) == 0) // if we're not in reset...
{
// int noise_clocks_this_sample = 0;
uint32_t chan1_clocks;
/* generate noise if configured to do so */
if (noisy != 0)
sh6840_update_noise(clocks_this_sample);
/* handle timer 0 if enabled */
t = &sh6840_timer[0];
clocks = (t->cr & 0x02) ? clocks_this_sample : m_sh6840_noiselatch1;
sh6840_apply_clock(t, clocks);
sample1 = (t->state && (t->cr & 0x80))?1:0;
/* handle timer 1 if enabled */
t = &sh6840_timer[1];
chan1_clocks = t->clocks;
clocks = (t->cr & 0x02) ? clocks_this_sample : 0; // TODO: this is WRONG: channel 1 is clocked by a mystery "VCO CLOCK" signal if not set to E clock. it may not even be connected to anything!
sh6840_apply_clock(t, clocks);
sample2 = (t->state && (t->cr & 0x80))?1:0;
/* generate channel 1-clocked noise if configured to do so */
if (noisy != 0)
{
sh6840_update_noise(t->clocks - chan1_clocks);
if (clocks) m_sh6840_noiselatch3 = (m_sh6840_LFSR&0x1);
}
/* handle timer 2 if enabled */
t = &sh6840_timer[2];
clocks = (t->cr & 0x02) ? clocks_this_sample : m_sh6840_noiselatch3;
/* prescale */
if (t->cr & 0x01)
{
clocks += t->leftovers;
t->leftovers = clocks % 8;
clocks /= 8;
}
sh6840_apply_clock(t, clocks);
sample3 = (t->state && (t->cr & 0x80))?1:0;
}
sample0 = m_sh6840_latchwrite?1:0;
/* stash */
/* each sample feeds an xor bit on the sign bit of a sign-magnitude (NOT 2'S COMPLEMENT)
* DAC. This requires some rather convoluted processing:
* samplex*0x80 brings the sample to the sign bit
* m_sh6840_volume[x]&0x80 pulls the sign bit from the dac sample
* m_sh6840_volume[x]&0x7F pulls the magnitude from the dac sample
*/
sample += (((sample0*0x80)^(m_sh6840_volume[0]&0x80))?-1:1)*(m_sh6840_volume[0]&0x7F);
sample += (((sample1*0x80)^(m_sh6840_volume[1]&0x80))?-1:1)*(m_sh6840_volume[1]&0x7F);
sample += (((sample2*0x80)^(m_sh6840_volume[2]&0x80))?-1:1)*(m_sh6840_volume[2]&0x7F);
sample += (((sample3*0x80)^(m_sh6840_volume[3]&0x80))?-1:1)*(m_sh6840_volume[3]&0x7F);
*buffer++ = sample*64; // adding 4 numbers ranging from -128 to 127 yields a range of -512 to 508; to scale that to '-32768 to 32767' we multiply by 64
}
}

View File

@ -3815,8 +3815,8 @@ ROM_START( moonbase )
ROM_LOAD( "ze3-10.f5", 0x4400, 0x0400, CRC(1e7c22a4) SHA1(b34173375494ffbf5400dd4014a683a9807f4f08) )
ROM_REGION( 0x0800, "proms", 0 ) /* color maps player 1/player 2 */
ROM_LOAD( "cv02.h7", 0x0000, 0x0400, CRC(2bdf83a0) SHA1(01ffbd43964c41987e7d44816271308f9a70802b) ) /* NEC B406 or compatible BPROM, like the 82S137 */
ROM_LOAD( "cv01.g7", 0x0400, 0x0400, CRC(aac24f34) SHA1(ad110e776547fb48baac568bb50d61854537ca34) ) /* NEC B406 or compatible BPROM, like the 82S137 */
ROM_LOAD( "cv02.h7", 0x0400, 0x0400, CRC(2bdf83a0) SHA1(01ffbd43964c41987e7d44816271308f9a70802b) ) /* NEC B406 or compatible BPROM, like the 82S137 */
ROM_LOAD( "cv01.g7", 0x0000, 0x0400, CRC(aac24f34) SHA1(ad110e776547fb48baac568bb50d61854537ca34) ) /* NEC B406 or compatible BPROM, like the 82S137 */
ROM_END
ROM_START( moonbasea )
@ -3833,8 +3833,8 @@ ROM_START( moonbasea )
ROM_LOAD( "ze3-10.f5", 0x4400, 0x0400, CRC(1e7c22a4) SHA1(b34173375494ffbf5400dd4014a683a9807f4f08) )
ROM_REGION( 0x0800, "proms", 0 ) /* color maps player 1/player 2 */
ROM_LOAD( "cv02.h7", 0x0000, 0x0400, CRC(2bdf83a0) SHA1(01ffbd43964c41987e7d44816271308f9a70802b) ) /* NEC B406 or compatible BPROM, like the 82S137 */
ROM_LOAD( "cv01.g7", 0x0400, 0x0400, CRC(aac24f34) SHA1(ad110e776547fb48baac568bb50d61854537ca34) ) /* NEC B406 or compatible BPROM, like the 82S137 */
ROM_LOAD( "cv02.h7", 0x0400, 0x0400, CRC(2bdf83a0) SHA1(01ffbd43964c41987e7d44816271308f9a70802b) ) /* NEC B406 or compatible BPROM, like the 82S137 */
ROM_LOAD( "cv01.g7", 0x0000, 0x0400, CRC(aac24f34) SHA1(ad110e776547fb48baac568bb50d61854537ca34) ) /* NEC B406 or compatible BPROM, like the 82S137 */
ROM_END

View File

@ -991,7 +991,23 @@ MACHINE_CONFIG_END
ROM_REGION16_BE( 0x100, "eeprom0", ROMREGION_ERASEFF ) \
ROM_REGION16_BE( 0x100, "eeprom1", ROMREGION_ERASEFF ) \
#define ARISTOCRAT_MK5_BIOS_HAVE_EEPROMS \
ROM_REGION( 0x400000, "set_4.04.09", ROMREGION_ERASEFF ) /* setchip v4.04.08 4meg */ \
ROM_LOAD32_WORD( "setchip v4.04.09.u7", 0x000000, 0x80000, CRC(e8e8dc75) SHA1(201fe95256459ce34fdb6f7498135ab5016d07f3) ) \
ROM_LOAD32_WORD( "setchip v4.04.09.u11", 0x000002, 0x80000, CRC(ff7a9035) SHA1(4352c4336e61947c555fdc80c61f944076f64b64) ) \
ROM_REGION( 0x400000, "set_4.04.00", ROMREGION_ERASEFF ) /* setchip v4.04.00 4meg 42pin */ \
ROM_LOAD32_WORD( "setchip v4.04.00.u7", 0x000000, 0x80000, CRC(2453137e) SHA1(b59998e75ae3924da16faf47b9cfe9afd60d810c) ) \
ROM_LOAD32_WORD( "setchip v4.04.00.u11", 0x000002, 0x80000, CRC(82dfa12a) SHA1(86fd0f0ad8d5d1bc503392a40bbcdadb055b2765) ) \
ROM_REGION( 0x400000, "set_4.02.04", ROMREGION_ERASEFF ) /* setchip v4.02.04 */ \
ROM_LOAD32_WORD( "setchip v4.02.04.u7", 0x000000, 0x80000, CRC(5a254b22) SHA1(8444f237b392df2a3cb42ea349e7af32f47dd544) ) \
ROM_LOAD32_WORD( "setchip v4.02.04.u11", 0x000002, 0x80000, CRC(def36617) SHA1(c7ba5b08e884a8fb36c9fb51c08e243e32c81f89) ) \
/* GALs */ \
ROM_REGION( 0x600, "gals", 0 ) \
ROM_LOAD( "a562837.u36", 0x000000, 0x000157, CRC(1f269234) SHA1(29940dd50fb55c632935f62ff44ca724379c7a43) ) \
ROM_LOAD( "a562838.u65", 0x000200, 0x000157, CRC(f2f3c40a) SHA1(b795dfa5cc4e8127c3f3a0906664910d1325ec92) ) \
ROM_LOAD( "a562840.u22", 0x000400, 0x000157, CRC(941d4cdb) SHA1(1ca091fba69e92f262dbb3d40f515703c8981793) ) \
ROM_START( aristmk5 )
ARISTOCRAT_MK5_BIOS
@ -1545,23 +1561,16 @@ ROM_END
// All devices are 27c4002 instead of 27c4096.
ROM_START( chickna5u )
ARISTOCRAT_MK5_BIOS
/*
Checksum code found at 0x000d08
0x000000-0x0a6917 is the Checksummed Range (excluding 0x000020-0x000027 where Checksum is stored)
Expected Checksum 0x0d44c6b0
Calculated Checksum 0xc47bc6b0 (BAD)
0x0a6918-0x35040b is the non-Checksummed range (unusual endpoint)
*/
ROM_REGION( 0x400000, "game_prg", ROMREGION_ERASEFF )
// the checksum only covers part of the first 2 roms, marked all as BAD_DUMP because it can't be trusted without a full redump.
ROM_LOAD32_WORD( "rhg073003.u7", 0x000000, 0x80000, BAD_DUMP CRC(ca196b37) SHA1(6b204204c1574439ccea1b6145d867a73bad304f) ) // 92.588%
ROM_LOAD32_WORD( "rhg073003.u11", 0x000002, 0x80000, BAD_DUMP CRC(b0d7be28) SHA1(6998dce808bf7970500b9e1ce6efed3940ee2d63) ) // 92.588%
ROM_LOAD32_WORD( "rhg073003.u8", 0x100000, 0x80000, BAD_DUMP CRC(80e3e34c) SHA1(3ad73c5fc21c4d9647ea514bf367073bbeb981a9) ) // base
ROM_LOAD32_WORD( "rhg073003.u12", 0x100002, 0x80000, BAD_DUMP CRC(63d5ec8e) SHA1(dca76342ecee6843e6fc656aafc8ee2e4d19fd65) ) // base
ROM_LOAD32_WORD( "rhg073003.u9", 0x200000, 0x80000, BAD_DUMP CRC(662ff210) SHA1(bbd2410fa2cd67e327981c3b2e16342fb9393401) ) // base
ROM_LOAD32_WORD( "rhg073003.u13", 0x200002, 0x80000, BAD_DUMP CRC(c3cef8ae) SHA1(4e65787d61387b511972e514047528495e1de11c) ) // base
ROM_LOAD32_WORD( "rhg073003.u10", 0x300000, 0x80000, BAD_DUMP CRC(8b3f7d6b) SHA1(7f1a04556c448976145652b05b690142376764d4) ) // base
ROM_LOAD32_WORD( "rhg073003.u14", 0x300002, 0x80000, BAD_DUMP CRC(240f7759) SHA1(1fa5ba0185b027101dae207ec5d28b07d3d73fc2) ) // base
ROM_LOAD32_WORD( "rhg073003.u7", 0x000000, 0x080000, CRC(06558129) SHA1(be726c0d35776faf1ecd20eb0a193e68a1fb1a84) )
ROM_LOAD32_WORD( "rhg073003.u11", 0x000002, 0x080000, CRC(0eadf5d4) SHA1(b783f6e1911fc098d1b4d1d8c75862e031078e5b) )
ROM_LOAD32_WORD( "rhg073003.u8", 0x100000, 0x080000, CRC(683e96bc) SHA1(bca8e87bea9f7044fa29dc4518e2ac5b429e3313) )
ROM_LOAD32_WORD( "rhg073003.u12", 0x100002, 0x080000, CRC(8313b03b) SHA1(d2a91bae8063d89ec9a1edab6df3e6711719d2c2) )
ROM_LOAD32_WORD( "rhg073003.u9", 0x200000, 0x080000, CRC(9c08aefa) SHA1(fe3ffa8eb308ab216cc08dd2ce51113b4ef74c4a) )
ROM_LOAD32_WORD( "rhg073003.u13", 0x200002, 0x080000, CRC(69fd4f89) SHA1(4e0469caecf9293197a4a5de960eb9dcfee39ca3) )
ROM_LOAD32_WORD( "rhg073003.u10", 0x300000, 0x080000, CRC(9aae49d7) SHA1(5cf87b747ea7561766fe0ffc15967fea657b252b) )
ROM_LOAD32_WORD( "rhg073003.u14", 0x300002, 0x080000, CRC(240f7759) SHA1(1fa5ba0185b027101dae207ec5d28b07d3d73fc2) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
@ -1642,7 +1651,7 @@ ROM_END
// CUCKOO - Export C - 02/02/00.
// All devices are 27c4002 instead of 27c4096.
ROM_START( cuckoou )
ARISTOCRAT_MK5_BIOS
ARISTOCRAT_MK5_BIOS_HAVE_EEPROMS
/*
Checksum code found at 0x000d18
0x000000-0x0a588b is the Checksummed Range (excluding 0x000020-0x000027 where Checksum is stored)
@ -1660,6 +1669,19 @@ ROM_START( cuckoou )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_REGION16_BE( 0x100, "eeprom0", 0 )
ROM_LOAD16_WORD_SWAP( "eeprom0", 0x000000, 0x000100, CRC(fea8a821) SHA1(c744cac6af7621524fc3a2b0a9a135a32b33c81b) )
ROM_REGION16_BE( 0x100, "eeprom1", 0 )
ROM_LOAD16_WORD_SWAP( "eeprom1", 0x000000, 0x000100, CRC(415b9c77) SHA1(86a3b3aabd81f5fcf767dd53f7034f7d58f2020e) )
ROM_REGION( 0x80000, "nvram", 0 )
ROM_LOAD( "nvram", 0x000000, 0x080000, CRC(64c895fe) SHA1(12c75338dd1b2260d0581744cef1b705c718727f) )
ROM_REGION( 0x20, "rtc", 0 )
ROM_LOAD( "rtc", 0x000000, 0x00001f, CRC(6909acb0) SHA1(6a4589599cd1c477e916474e7b029e9a4e92019b) )
ROM_END
@ -1808,7 +1830,7 @@ ROM_END
// Dolphin Treasure - Export B - 06/12/96.
// All devices are 27c4002 instead of 27c4096.
ROM_START( dolphntru )
ARISTOCRAT_MK5_BIOS
ARISTOCRAT_MK5_BIOS_HAVE_EEPROMS
/*
Checksum code found at 0x000d08
0x000000-0x08ec8b is the Checksummed Range (excluding 0x000020-0x000027 where Checksum is stored)
@ -1826,6 +1848,18 @@ ROM_START( dolphntru )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_REGION16_BE( 0x100, "eeprom0", 0 )
ROM_LOAD16_WORD_SWAP( "eeprom0", 0x000000, 0x000100, CRC(fea8a821) SHA1(c744cac6af7621524fc3a2b0a9a135a32b33c81b) )
ROM_REGION16_BE( 0x100, "eeprom1", 0 )
ROM_LOAD16_WORD_SWAP( "eeprom1", 0x000000, 0x000100, CRC(1fc27753) SHA1(7e5008faaf115dc506481430272285117c989d8e) )
ROM_REGION( 0x80000, "nvram", 0 )
ROM_LOAD( "nvram", 0x000000, 0x080000, CRC(0063e5ca) SHA1(a3d7b636bc9d792e93d11cb2babf24fbdd6d7776) )
ROM_REGION( 0x20, "rtc", 0 )
ROM_LOAD( "rtc", 0x000000, 0x00001f, CRC(6909acb0) SHA1(6a4589599cd1c477e916474e7b029e9a4e92019b) )
ROM_END
@ -2127,7 +2161,7 @@ ROM_START( incasun )
ROM_END
ROM_START( incasunu )
ARISTOCRAT_MK5_BIOS
ARISTOCRAT_MK5_BIOS_HAVE_EEPROMS
ROM_REGION( 0x400000, "game_prg", ROMREGION_ERASEFF )
ROM_LOAD32_WORD("chg1458.u7", 0x0000000, 0x0080000, CRC(20c78b79) SHA1(d7402ff89160f25c9f4f67bbf688621d4ce22205) )
@ -2140,6 +2174,18 @@ ROM_START( incasunu )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_REGION16_BE( 0x100, "eeprom0", 0 )
ROM_LOAD16_WORD_SWAP( "eeprom0", 0x000000, 0x000100, CRC(fea8a821) SHA1(c744cac6af7621524fc3a2b0a9a135a32b33c81b) )
ROM_REGION16_BE( 0x100, "eeprom1", 0 )
ROM_LOAD16_WORD_SWAP( "eeprom1", 0x000000, 0x000100, CRC(b3efdb60) SHA1(f219175019b7237f1e2d132f36803097f2a1d174) )
ROM_REGION( 0x80000, "nvram", 0 )
ROM_LOAD( "nvram", 0x000000, 0x080000, CRC(a68e890e) SHA1(8ab087a09cfee8d3e2d84b1003b6798c7223be03) )
ROM_REGION( 0x20, "rtc", 0 )
ROM_LOAD( "rtc", 0x000000, 0x00001f, CRC(6909acb0) SHA1(6a4589599cd1c477e916474e7b029e9a4e92019b) )
ROM_END
ROM_START( incasunsp )
@ -2385,7 +2431,7 @@ ROM_END
// MV4115 - 5,10,20 Credit Multiplier / 9 Line Multiline.
// Magic Mask [Reel Game] - Export A - 09/05/2000.
ROM_START( magimask )
ARISTOCRAT_MK5_BIOS
ARISTOCRAT_MK5_BIOS_HAVE_EEPROMS
/*
Checksum code found at 0x000d18
0x000000-0x0e8527 is the Checksummed Range (excluding 0x000020-0x000027 where Checksum is stored)
@ -2403,6 +2449,18 @@ ROM_START( magimask )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_REGION16_BE( 0x100, "eeprom0", 0 )
ROM_LOAD16_WORD_SWAP( "eeprom0", 0x000000, 0x000100, CRC(fea8a821) SHA1(c744cac6af7621524fc3a2b0a9a135a32b33c81b) )
ROM_REGION16_BE( 0x100, "eeprom1", 0 )
ROM_LOAD16_WORD_SWAP( "eeprom1", 0x000000, 0x000100, CRC(6e485bbc) SHA1(3d6c8d120c69ed2804f267c50681974f73e1ee51) )
ROM_REGION( 0x80000, "nvram", 0 )
ROM_LOAD( "nvram", 0x000000, 0x080000, CRC(538c7523) SHA1(1e6516b77daf855e397c1ec590e73637ce3b8406) )
ROM_REGION( 0x20, "rtc", 0 )
ROM_LOAD( "rtc", 0x000000, 0x00001f, CRC(6909acb0) SHA1(6a4589599cd1c477e916474e7b029e9a4e92019b) )
ROM_END
@ -2418,7 +2476,7 @@ ROM_END
// dhg1309.u11 ahg1548.u11 17.786026%
// dhg1309.u7 ahg1548.u7 16.893578%
ROM_START( magimaska )
ARISTOCRAT_MK5_BIOS
ARISTOCRAT_MK5_BIOS_HAVE_EEPROMS
/*
Checksum code found at 0x000d18
0x000000-0x0e9597 is the Checksummed Range (excluding 0x000020-0x000027 where Checksum is stored)
@ -2436,6 +2494,18 @@ ROM_START( magimaska )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_REGION16_BE( 0x100, "eeprom0", 0 )
ROM_LOAD16_WORD_SWAP( "eeprom0", 0x000000, 0x000100, CRC(fea8a821) SHA1(c744cac6af7621524fc3a2b0a9a135a32b33c81b) )
ROM_REGION16_BE( 0x100, "eeprom1", 0 )
ROM_LOAD16_WORD_SWAP( "eeprom1", 0x000000, 0x000100, CRC(a10501f9) SHA1(34fdcd16bd7dc474baadc0836e2083abaf589549) )
ROM_REGION( 0x80000, "nvram", 0 )
ROM_LOAD( "nvram", 0x000000, 0x080000, CRC(5365446b) SHA1(9ae7a72d0ed3e7f7523a2e0a8f0dc014c6490438) )
ROM_REGION( 0x20, "rtc", 0 )
ROM_LOAD( "rtc", 0x000000, 0x00001f, CRC(6909acb0) SHA1(6a4589599cd1c477e916474e7b029e9a4e92019b) )
ROM_END
@ -2514,7 +2584,7 @@ ROM_END
// Mine, Mine, Mine - Export E - 14/02/96.
// All devices are 27c4002 instead of 27c4096.
ROM_START( minemine )
ARISTOCRAT_MK5_BIOS
ARISTOCRAT_MK5_BIOS_HAVE_EEPROMS
/*
Checksum code found at 0x000d10
0x000000-0x0a7203 is the Checksummed Range (excluding 0x000020-0x000027 where Checksum is stored)
@ -2532,6 +2602,18 @@ ROM_START( minemine )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_REGION16_BE( 0x100, "eeprom0", 0 )
ROM_LOAD16_WORD_SWAP( "eeprom0", 0x000000, 0x000100, CRC(fea8a821) SHA1(c744cac6af7621524fc3a2b0a9a135a32b33c81b) )
ROM_REGION16_BE( 0x100, "eeprom1", 0 )
ROM_LOAD16_WORD_SWAP( "eeprom1", 0x000000, 0x000100, CRC(8421e7c2) SHA1(fc1b07d5b7aadafc4a0f2e4dfa698e7c72340717) )
ROM_REGION( 0x80000, "nvram", 0 )
ROM_LOAD( "nvram", 0x000000, 0x080000, CRC(883f5023) SHA1(e526e337b5b0fc77091b4946b503b56307c390e9) )
ROM_REGION( 0x20, "rtc", 0 )
ROM_LOAD( "rtc", 0x000000, 0x00001f, CRC(6909acb0) SHA1(6a4589599cd1c477e916474e7b029e9a4e92019b) )
ROM_END
@ -2704,7 +2786,7 @@ ROM_END
// Party Gras [Reel Game] - Export A - 10/11/2001.
// All devices are 27c4002 instead of 27c4096.
ROM_START( partygrs )
ARISTOCRAT_MK5_BIOS
ARISTOCRAT_MK5_BIOS_HAVE_EEPROMS
/*
Checksum code found at 0x000d18
0x000000-0x0e9b47 is the Checksummed Range (excluding 0x000020-0x000027 where Checksum is stored)
@ -2722,6 +2804,18 @@ ROM_START( partygrs )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_REGION16_BE( 0x100, "eeprom0", 0 )
ROM_LOAD16_WORD_SWAP( "eeprom0", 0x000000, 0x000100, CRC(fea8a821) SHA1(c744cac6af7621524fc3a2b0a9a135a32b33c81b) )
ROM_REGION16_BE( 0x100, "eeprom1", 0 )
ROM_LOAD16_WORD_SWAP( "eeprom1", 0x000000, 0x000100, CRC(a10501f9) SHA1(34fdcd16bd7dc474baadc0836e2083abaf589549) )
ROM_REGION( 0x80000, "nvram", 0 )
ROM_LOAD( "nvram", 0x000000, 0x080000, CRC(fec1b1df) SHA1(5981e2961692d4c8633afea4ecb4828eabba65bd) )
ROM_REGION( 0x20, "rtc", 0 )
ROM_LOAD( "rtc", 0x000000, 0x00001f, CRC(6909acb0) SHA1(6a4589599cd1c477e916474e7b029e9a4e92019b) )
ROM_END
@ -2843,7 +2937,7 @@ ROM_END
// Penguin Pays - Export B - 14/07/97.
// All devices are 27c4002 instead of 27c4096.
ROM_START( pengpayu )
ARISTOCRAT_MK5_BIOS
ARISTOCRAT_MK5_BIOS_HAVE_EEPROMS
/*
Checksum code found at 0x000d08
0x000000-0x0cd21b is the Checksummed Range (excluding 0x000020-0x000027 where Checksum is stored)
@ -2861,6 +2955,18 @@ ROM_START( pengpayu )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_REGION16_BE( 0x100, "eeprom0", 0 )
ROM_LOAD16_WORD_SWAP( "eeprom0", 0x000000, 0x000100, CRC(fea8a821) SHA1(c744cac6af7621524fc3a2b0a9a135a32b33c81b) )
ROM_REGION16_BE( 0x100, "eeprom1", 0 )
ROM_LOAD16_WORD_SWAP( "eeprom1", 0x000000, 0x000100, CRC(8421e7c2) SHA1(fc1b07d5b7aadafc4a0f2e4dfa698e7c72340717) )
ROM_REGION( 0x80000, "nvram", 0 )
ROM_LOAD( "nvram", 0x000000, 0x080000, CRC(4e5b9702) SHA1(b2b645db80c4ece24fae8ce6fb660e77ac8e5810) )
ROM_REGION( 0x20, "rtc", 0 )
ROM_LOAD( "rtc", 0x000000, 0x00001f, CRC(6909acb0) SHA1(6a4589599cd1c477e916474e7b029e9a4e92019b) )
ROM_END
@ -3020,7 +3126,7 @@ ROM_END
// All devices are 27c4002 instead of 27c4096.
// Even when it's a NSW/ACT, the program seems to be for US-Export platforms...
ROM_START( qnileu )
ARISTOCRAT_MK5_BIOS
ARISTOCRAT_MK5_BIOS_HAVE_EEPROMS
/*
Checksum code found at 0x000d08
0x000000-0x08ec87 is the Checksummed Range (excluding 0x000020-0x000027 where Checksum is stored)
@ -3038,6 +3144,18 @@ ROM_START( qnileu )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_REGION16_BE( 0x100, "eeprom0", 0 )
ROM_LOAD16_WORD_SWAP( "eeprom0", 0x000000, 0x000100, CRC(fea8a821) SHA1(c744cac6af7621524fc3a2b0a9a135a32b33c81b) )
ROM_REGION16_BE( 0x100, "eeprom1", 0 )
ROM_LOAD16_WORD_SWAP( "eeprom1", 0x000000, 0x000100, CRC(1fc27753) SHA1(7e5008faaf115dc506481430272285117c989d8e) )
ROM_REGION( 0x80000, "nvram", 0 )
ROM_LOAD( "nvram", 0x000000, 0x080000, CRC(5a7bb53a) SHA1(cdac900925d0ee8f98209a377b9f8760de0c2883) )
ROM_REGION( 0x20, "rtc", 0 )
ROM_LOAD( "rtc", 0x000000, 0x00001f, CRC(6909acb0) SHA1(6a4589599cd1c477e916474e7b029e9a4e92019b) )
ROM_END
@ -3309,10 +3427,9 @@ ROM_END
ROM_START( topbana )
ARISTOCRAT_MK5_BIOS
// checksum code not found (due to bad rom)
ROM_REGION( 0x400000, "game_prg", ROMREGION_ERASEFF )
ROM_LOAD32_WORD("0100550v.u7", 0x0000000, 0x0080000, CRC(1f60241c) SHA1(3a6207d9c919319fc10b6de63bc030f8d335588e) )
ROM_LOAD32_WORD("0100550v.u11", 0x0000002, 0x007fffa, BAD_DUMP CRC(140a73bc) SHA1(3fd88797b6310f5849e901d032fbeb8a2d8604fb) ) // This is a bad .u8 from Indian Dream, not proper Top Banana .u11!!
ROM_LOAD32_WORD( "0100550v.u11", 0x000002, 0x080000, CRC(1c64b3b6) SHA1(80bbc6e3f47ab932e9c07e0c6063197a2d8e81f7) )
ROM_LOAD32_WORD( "0100550v.u7", 0x000000, 0x080000, CRC(9c5e2d66) SHA1(658143706c0e1f3b43b3ec301da1052363fe5244) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
@ -3561,7 +3678,7 @@ ROM_END
// Wild Cougar - Export D - 19/05/97.
// All devices are 27c4002 instead of 27c4096.
ROM_START( wcougaru )
ARISTOCRAT_MK5_BIOS
ARISTOCRAT_MK5_BIOS_HAVE_EEPROMS
/*
Checksum code found at 0x000d08
0x000000-0x0b0d5b is the Checksummed Range (excluding 0x000020-0x000027 where Checksum is stored)
@ -3579,6 +3696,18 @@ ROM_START( wcougaru )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_REGION16_BE( 0x100, "eeprom0", 0 )
ROM_LOAD16_WORD_SWAP( "eeprom0", 0x000000, 0x000100, CRC(fea8a821) SHA1(c744cac6af7621524fc3a2b0a9a135a32b33c81b) )
ROM_REGION16_BE( 0x100, "eeprom1", 0 )
ROM_LOAD16_WORD_SWAP( "eeprom1", 0x000000, 0x000100, CRC(8421e7c2) SHA1(fc1b07d5b7aadafc4a0f2e4dfa698e7c72340717) )
ROM_REGION( 0x80000, "nvram", 0 )
ROM_LOAD( "nvram", 0x000000, 0x080000, CRC(dfe52286) SHA1(db31fb64e2fff8aa5ba0cc6d3d73860e8019406c) )
ROM_REGION( 0x20, "rtc", 0 )
ROM_LOAD( "rtc", 0x000000, 0x00001f, CRC(6909acb0) SHA1(6a4589599cd1c477e916474e7b029e9a4e92019b) )
ROM_END

View File

@ -39,7 +39,8 @@ enum
SND_FLEET2,
SND_FLEET3,
SND_FLEET4,
SND_UFOHIT
SND_UFOHIT,
SND_BONUS
};
@ -53,31 +54,15 @@ public:
};
astinvad_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_ppi8255_0(*this, "ppi8255_0"),
m_ppi8255_1(*this, "ppi8255_1"),
m_palette(*this, "palette"),
m_videoram(*this, "videoram"),
m_samples(*this, "samples"),
m_screen(*this, "screen"){ }
required_device<cpu_device> m_maincpu;
optional_device<i8255_device> m_ppi8255_0;
optional_device<i8255_device> m_ppi8255_1;
required_device<palette_device> m_palette;
required_shared_ptr<uint8_t> m_videoram;
std::unique_ptr<uint8_t[]> m_colorram;
emu_timer *m_int_timer;
uint8_t m_sound_state[2];
uint8_t m_screen_flip;
uint8_t m_screen_red;
uint8_t m_flip_yoffs;
uint8_t m_color_latch;
required_device<samples_device> m_samples;
required_device<screen_device> m_screen;
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_ppi8255_0(*this, "ppi8255_0")
, m_ppi8255_1(*this, "ppi8255_1")
, m_palette(*this, "palette")
, m_videoram(*this, "videoram")
, m_samples(*this, "samples")
, m_screen(*this, "screen")
{ }
DECLARE_WRITE8_MEMBER(color_latch_w);
DECLARE_WRITE8_MEMBER(spaceint_videoram_w);
@ -99,13 +84,31 @@ public:
DECLARE_MACHINE_RESET(spaceint);
DECLARE_VIDEO_START(spaceint);
uint32_t screen_update_astinvad(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
uint32_t screen_update_spcking2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
uint32_t screen_update_spaceint(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(kamikaze_int_off);
TIMER_CALLBACK_MEMBER(kamizake_int_gen);
private:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
void plot_byte( bitmap_rgb32 &bitmap, uint8_t y, uint8_t x, uint8_t data, uint8_t color );
protected:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
std::unique_ptr<uint8_t[]> m_colorram;
emu_timer *m_int_timer;
uint8_t m_sound_state[2];
uint8_t m_screen_flip;
uint8_t m_screen_red;
uint8_t m_flip_yoffs;
uint8_t m_color_latch;
bool m_player;
required_device<cpu_device> m_maincpu;
optional_device<i8255_device> m_ppi8255_0;
optional_device<i8255_device> m_ppi8255_1;
required_device<palette_device> m_palette;
required_shared_ptr<uint8_t> m_videoram;
required_device<samples_device> m_samples;
required_device<screen_device> m_screen;
};
@ -178,6 +181,25 @@ uint32_t astinvad_state::screen_update_astinvad(screen_device &screen, bitmap_rg
}
uint32_t astinvad_state::screen_update_spcking2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
const uint8_t *color_prom = memregion("proms")->base();
uint8_t yoffs = m_flip_yoffs & m_screen_flip;
int x, y;
/* render the visible pixels */
for (y = cliprect.min_y; y <= cliprect.max_y; y++)
for (x = cliprect.min_x & ~7; x <= cliprect.max_x; x += 8)
{
uint8_t color = color_prom[(((y & 0xf8) << 2) | (x >> 3)) ^ (m_screen_flip ? 0x3ff : m_player ? 0 : 0x3ff)] >> (m_player ? 4 : 0);
uint8_t data = m_videoram[(((y ^ m_screen_flip) + yoffs) << 5) | ((x ^ m_screen_flip) >> 3)];
plot_byte(bitmap, y, x, data, m_screen_red ? 1 : color & 0x07);
}
return 0;
}
uint32_t astinvad_state::screen_update_spaceint(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
const uint8_t *color_prom = memregion("proms")->base();
@ -349,7 +371,7 @@ WRITE8_MEMBER(astinvad_state::kamikaze_sound1_w)
if (bits_gone_hi & 0x02) m_samples->start(1, SND_SHOT);
if (bits_gone_hi & 0x04) m_samples->start(2, SND_BASEHIT);
if (bits_gone_hi & 0x08) m_samples->start(3, SND_INVADERHIT);
if (bits_gone_hi & 0x10) m_samples->start(3, SND_INVADERHIT);
if (bits_gone_hi & 0x10) m_samples->start(2, SND_BONUS);
machine().sound().system_enable(data & 0x20);
}
@ -383,7 +405,7 @@ WRITE8_MEMBER(astinvad_state::spcking2_sound1_w)
if (bits_gone_hi & 0x02) m_samples->start(1, SND_SHOT);
if (bits_gone_hi & 0x04) m_samples->start(2, SND_BASEHIT);
if (bits_gone_hi & 0x08) m_samples->start(3, SND_INVADERHIT);
if (bits_gone_hi & 0x10) m_samples->start(2, SND_BONUS);
machine().sound().system_enable(data & 0x20);
m_screen_red = data & 0x04; // ?
}
@ -400,6 +422,7 @@ WRITE8_MEMBER(astinvad_state::spcking2_sound2_w)
if (bits_gone_hi & 0x10) m_samples->start(4, SND_UFOHIT);
m_screen_flip = (ioport("CABINET")->read() & data & 0x20) ? 0xff : 0x00;
m_player = BIT(data, 5);
}
WRITE8_MEMBER(astinvad_state::spcking2_sound3_w)
@ -618,6 +641,7 @@ static const char *const astinvad_sample_names[] =
"6",
"7",
"8",
"9",
nullptr
};
@ -675,6 +699,7 @@ static MACHINE_CONFIG_DERIVED( spcking2, kamikaze )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK, 320, 0, 256, 256, 16, 240)
MCFG_SCREEN_UPDATE_DRIVER(astinvad_state, screen_update_spcking2)
MACHINE_CONFIG_END

View File

@ -371,7 +371,7 @@ WRITE32_MEMBER(atlantis_state::status_leds_w)
}
//popmessage("LED: %c", digit);
osd_printf_debug("%06X: status_leds_w digit: %c %08x = %02x\n", machine().device("maincpu")->safe_pc(), digit, offset, data);
logerror("%06X: status_leds_w digit: %c %08x = %02x\n", machine().device("maincpu")->safe_pc(), digit, offset, data);
if (0) logerror("%06X: status_leds_w digit: %c %08x = %02x\n", machine().device("maincpu")->safe_pc(), digit, offset, data);
}
}
}

View File

@ -1,57 +1,186 @@
// license:BSD-3-Clause
// copyright-holders:Mathis Rosenhauer
/*
// license: BSD-3-Clause
// copyright-holders: Mathis Rosenhauer, Dirk Best
// thanks-to: Jonathan Gevaryahu
/***************************************************************************
Beezer - (c) 1982 Tong Electronic
Beezer
Written by Mathis Rosenhauer
(c) 1982 Tong Electronic
TODO:
- what's really wrong with the sound? Any reference available?
Notes:
- To enter test mode, hold down 1P Start and 2P Start, then reset
- One of the ROMs contains a message that this game was created
by "Pacific Polytechnical Corporation, Santa Cruz"
*/
TODO:
- Improve sound (filters? A reference recording would be nice)
- Schematics in the sound area seem incomplete, there are
several unknown connections
- Watchdog timing (controlled by a 555)
- Figure out differences between the two sets (test mode isn't
working in beezer1, instruction screen is different)
- Verify accuracy of colors
***************************************************************************/
#include "emu.h"
#include "machine/6522via.h"
#include "cpu/m6809/m6809.h"
#include "includes/beezer.h"
#include "machine/input_merger.h"
#include "machine/watchdog.h"
#include "machine/bankdev.h"
#include "machine/6522via.h"
#include "machine/6840ptm.h"
#include "sound/mm5837.h"
#include "sound/dac76.h"
#include "video/resnet.h"
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
class beezer_state : public driver_device
{
public:
beezer_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_sysbank(*this, "sysbank"),
m_banked_roms(*this, "banked"),
m_rombank{ {*this, "rombank_f1"}, {*this, "rombank_f3"}, {*this, "rombank_e1"}, {*this, "rombank_e3"}, {*this, "rombank_e5"}, {*this, "rombank_f5"}, {*this, "rombank_f7"} },
m_via_system(*this, "via_u6"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_videoram(*this, "videoram"),
m_audiocpu(*this, "audiocpu"),
m_via_audio(*this, "via_u18"),
m_ptm(*this, "ptm"),
m_dac(*this, "dac"),
m_timer_count(nullptr),
m_count(0), m_noise(0),
m_pbus(0xff), m_x(0), m_y(0), m_z(0)
{
m_ch_sign[0] = m_ch_sign[1] = m_ch_sign[2] = m_ch_sign[3] = 0;
m_dac_data[0] = m_dac_data[1] = m_dac_data[2] = m_dac_data[3] = 0;
}
TIMER_DEVICE_CALLBACK_MEMBER(scanline_cb);
uint32_t screen_update_beezer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_PALETTE_INIT(beezer);
DECLARE_WRITE8_MEMBER(palette_w);
DECLARE_READ8_MEMBER(line_r);
DECLARE_WRITE_LINE_MEMBER(noise_w);
DECLARE_WRITE8_MEMBER(dac_w);
DECLARE_READ8_MEMBER(via_audio_pa_r);
DECLARE_WRITE8_MEMBER(via_audio_pa_w);
DECLARE_WRITE8_MEMBER(via_audio_pb_w);
DECLARE_WRITE_LINE_MEMBER(ptm_out0_w);
DECLARE_WRITE_LINE_MEMBER(ptm_out1_w);
DECLARE_WRITE_LINE_MEMBER(ptm_out2_w);
DECLARE_WRITE_LINE_MEMBER(dmod_clr_w);
DECLARE_WRITE_LINE_MEMBER(dmod_data_w);
DECLARE_READ8_MEMBER(via_system_pa_r);
DECLARE_READ8_MEMBER(via_system_pb_r);
DECLARE_WRITE8_MEMBER(via_system_pa_w);
DECLARE_WRITE8_MEMBER(via_system_pb_w);
DECLARE_WRITE8_MEMBER(bankswitch_w);
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
private:
required_device<cpu_device> m_maincpu;
required_device<address_map_bank_device> m_sysbank;
required_memory_region m_banked_roms;
required_memory_bank m_rombank[7];
required_device<via6522_device> m_via_system;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
required_shared_ptr<uint8_t> m_videoram;
required_device<cpu_device> m_audiocpu;
required_device<via6522_device> m_via_audio;
required_device<ptm6840_device> m_ptm;
required_device<dac76_device> m_dac;
double m_weights_r[3];
double m_weights_g[3];
double m_weights_b[2];
emu_timer *m_timer_count;
int m_ch_sign[4];
uint8_t m_dac_data[4];
int m_count;
int m_noise;
uint8_t m_pbus;
int m_x, m_y, m_z;
};
//**************************************************************************
// ADDRESS MAPS
//**************************************************************************
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, beezer_state )
AM_RANGE(0x0000, 0xbfff) AM_RAM AM_SHARE("videoram")
AM_RANGE(0xc000, 0xcfff) AM_ROMBANK("bank1")
AM_RANGE(0xd000, 0xdfff) AM_ROM AM_WRITE(beezer_bankswitch_w) // ROM at G1, bankswitch
AM_RANGE(0xe000, 0xffff) AM_ROM // ROMS at G3, G5
AM_RANGE(0xc000, 0xcfff) AM_DEVICE("sysbank", address_map_bank_device, amap8)
AM_RANGE(0xd000, 0xdfff) AM_ROM AM_REGION("maincpu", 0x0000) AM_WRITE(bankswitch_w) // g1
AM_RANGE(0xe000, 0xefff) AM_ROM AM_REGION("maincpu", 0x1000) // g3
AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION("maincpu", 0x2000) // g5
ADDRESS_MAP_END
static ADDRESS_MAP_START( banked_map, AS_PROGRAM, 8, beezer_state )
AM_RANGE(0x0600, 0x0600) AM_MIRROR(0x1ff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x0800, 0x080f) AM_MIRROR(0x1f0) AM_WRITE(palette_w)
AM_RANGE(0x0a00, 0x0a00) AM_MIRROR(0x1ff) AM_READ(line_r)
AM_RANGE(0x0e00, 0x0e0f) AM_MIRROR(0x1f0) AM_DEVREADWRITE("via_u6", via6522_device, read, write)
AM_RANGE(0x1000, 0x1fff) AM_ROMBANK("rombank_f1")
AM_RANGE(0x2000, 0x2fff) AM_ROMBANK("rombank_f3")
AM_RANGE(0x3000, 0x3fff) AM_ROMBANK("rombank_e1")
AM_RANGE(0x4000, 0x4fff) AM_ROMBANK("rombank_e3")
AM_RANGE(0x5000, 0x5fff) AM_ROMBANK("rombank_e5")
AM_RANGE(0x6000, 0x6fff) AM_ROMBANK("rombank_f5")
AM_RANGE(0x7000, 0x7fff) AM_ROMBANK("rombank_f7")
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, beezer_state )
AM_RANGE(0x0000, 0x07ff) AM_RAM // RAM at 0D
AM_RANGE(0x0800, 0x0fff) AM_RAM // optional RAM at 2D (can be rom here instead)
AM_RANGE(0x1000, 0x1007) AM_MIRROR(0x07f8) AM_DEVREADWRITE("custom", beezer_sound_device, sh6840_r, sh6840_w)
AM_RANGE(0x1800, 0x180F) AM_MIRROR(0x07f0) AM_DEVREADWRITE("via6522_1", via6522_device, read, write)
AM_RANGE(0x8000, 0x8003) AM_MIRROR(0x1ffc) AM_DEVWRITE("custom", beezer_sound_device, sfxctrl_w)
//AM_RANGE(0xa000, 0xbfff) AM_ROM // ROM at 2D (can be ram here instead), unpopulated
//AM_RANGE(0xc000, 0xdfff) AM_ROM // ROM at 4D, unpopulated
AM_RANGE(0xe000, 0xffff) AM_ROM // ROM at 6D
AM_RANGE(0x0000, 0x07ff) AM_RAM // 0d
AM_RANGE(0x0800, 0x0fff) AM_RAM // 2d, optional (can be rom)
AM_RANGE(0x1000, 0x1007) AM_MIRROR(0x07f8) AM_DEVREADWRITE("ptm", ptm6840_device, read, write)
AM_RANGE(0x1800, 0x180f) AM_MIRROR(0x07f0) AM_DEVREADWRITE("via_u18", via6522_device, read, write)
AM_RANGE(0x8000, 0x8003) AM_MIRROR(0x1ffc) AM_WRITE(dac_w)
// AM_RANGE(0xa000, 0xbfff) AM_ROM // 2d (can be ram, unpopulated)
// AM_RANGE(0xc000, 0xdfff) AM_ROM // 4d (unpopulated)
AM_RANGE(0xe000, 0xffff) AM_ROM AM_REGION("audiocpu", 0) // 6d
ADDRESS_MAP_END
//**************************************************************************
// INPUTS
//**************************************************************************
static INPUT_PORTS_START( beezer )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN1")
PORT_BIT( 0x0f, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_REVERSE
PORT_START("IN2")
PORT_BIT( 0x0f, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_REVERSE
/* Manual says "Dip Switch A" is not used. */
// DSWA isn't populated on the board and is pulled to 0xff with a resistor pack
PORT_START("DSWA")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
@ -78,23 +207,281 @@ static INPUT_PORTS_START( beezer )
PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
INPUT_PORTS_END
void beezer_state::machine_start()
//**************************************************************************
// VIDEO EMULATION
//**************************************************************************
TIMER_DEVICE_CALLBACK_MEMBER( beezer_state::scanline_cb )
{
// TDISP, each 32 lines
m_via_system->write_ca2((param & 32) ? 1 : 0);
// actually unused by the game (points to a tight loop)
if (param == 240)
m_maincpu->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
else
m_maincpu->set_input_line(M6809_FIRQ_LINE, CLEAR_LINE);
}
uint32_t beezer_state::screen_update_beezer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
{
for (int x = cliprect.min_x; x <= cliprect.max_x; x += 2)
{
bitmap.pix16(y, x + 1) = m_videoram[0x80 * x + y] & 0x0f;
bitmap.pix16(y, x + 0) = m_videoram[0x80 * x + y] >> 4;
}
}
return 0;
}
PALETTE_INIT_MEMBER(beezer_state, beezer)
{
const int resistances_rg[3] = { 1200, 560, 330 };
const int resistances_b[2] = { 560, 330 };
// calculate coefficients for later use
compute_resistor_weights(0, 255, -1.0,
3, resistances_rg, m_weights_r, 680, 150,
3, resistances_rg, m_weights_g, 680, 150,
2, resistances_b, m_weights_b, 680, 150);
}
WRITE8_MEMBER( beezer_state::palette_w )
{
int r = combine_3_weights(m_weights_r, BIT(data, 0), BIT(data, 1), BIT(data, 2));
int g = combine_3_weights(m_weights_g, BIT(data, 3), BIT(data, 4), BIT(data, 5));
int b = combine_2_weights(m_weights_b, BIT(data, 6), BIT(data, 7));
m_palette->set_pen_color(offset, rgb_t(r, g, b));
}
READ8_MEMBER( beezer_state::line_r )
{
// d2 to d7 connected to hex buffer u34
return m_screen->vpos() & 0xfc;
}
//**************************************************************************
// AUDIO
//**************************************************************************
void beezer_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
// channel multiplexer at u52
int ch = m_count++ & 3;
m_dac->update();
m_dac->b1_w(BIT(m_dac_data[ch], 6));
m_dac->b2_w(BIT(m_dac_data[ch], 5));
m_dac->b3_w(BIT(m_dac_data[ch], 4));
m_dac->b4_w(BIT(m_dac_data[ch], 3));
m_dac->b5_w(BIT(m_dac_data[ch], 2));
m_dac->b6_w(BIT(m_dac_data[ch], 1));
m_dac->b7_w(BIT(m_dac_data[ch], 0));
m_dac->sb_w(m_ch_sign[ch] ^ BIT(m_dac_data[ch], 7));
}
WRITE_LINE_MEMBER( beezer_state::noise_w )
{
m_noise = state;
m_via_audio->write_pb6(m_noise);
}
WRITE8_MEMBER( beezer_state::dac_w )
{
m_dac_data[offset] = data;
}
READ8_MEMBER( beezer_state::via_audio_pa_r )
{
return m_pbus;
}
WRITE8_MEMBER( beezer_state::via_audio_pa_w )
{
m_pbus = data;
}
WRITE8_MEMBER( beezer_state::via_audio_pb_w )
{
// bit 0 - dmod disable
// bit 1 - fm or am
// bit 2 - am
// bit 3 - fmsel0
// bit 4 - fmsel1
// -- above bits not handled and only partially visible on the schematic
// bit 7 - noise gate on rising edge to ptm c1
if (m_ch_sign[0] == 0 && (BIT(data, 7) == 1))
m_ptm->set_c1(m_noise);
m_ch_sign[0] = BIT(data, 7);
}
WRITE_LINE_MEMBER( beezer_state::ptm_out0_w )
{
m_ch_sign[1] = state;
}
WRITE_LINE_MEMBER( beezer_state::ptm_out1_w )
{
// on rising edge, enable noise input to ptm c3
if (m_ch_sign[2] == 0 && state == 1)
m_ptm->set_c3(m_noise);
m_ch_sign[2] = state;
}
WRITE_LINE_MEMBER( beezer_state::ptm_out2_w )
{
m_ch_sign[3] = state;
}
WRITE_LINE_MEMBER( beezer_state::dmod_clr_w )
{
// schematics don't show where this is connected
}
WRITE_LINE_MEMBER( beezer_state::dmod_data_w )
{
// schematics don't show where this is connected
}
//**************************************************************************
// MACHINE EMULATION
//**************************************************************************
READ8_MEMBER( beezer_state::via_system_pa_r )
{
uint8_t data = 0;
data |= 1 << 4; // N/C
data |= m_z << 5;
data |= m_y << 6;
data |= m_x << 7;
return data;
}
WRITE8_MEMBER(beezer_state::via_system_pa_w)
{
// bit 3, audio cpu reset line
m_audiocpu->set_input_line(INPUT_LINE_RESET, BIT(data, 3) ? CLEAR_LINE : ASSERT_LINE);
// bit 2, enable for ls139
if (BIT(data, 2) == 0)
{
// bit 0-1, input selection
switch (data & 0x03)
{
case 0:
m_pbus = ioport("IN0")->read();
break;
case 1:
m_pbus = ioport("IN1")->read() | (ioport("IN2")->read() << 4);
break;
case 2:
m_pbus = ioport("DSWB")->read();
break;
case 3:
m_pbus = ioport("DSWA")->read();
break;
}
}
}
READ8_MEMBER( beezer_state::via_system_pb_r )
{
return m_pbus;
}
WRITE8_MEMBER( beezer_state::via_system_pb_w )
{
m_pbus = data;
}
WRITE8_MEMBER( beezer_state::bankswitch_w )
{
m_x = BIT(data, 3);
m_y = BIT(data, 4);
m_z = BIT(data, 5);
m_sysbank->set_bank(data & 0x07);
for (int i = 0; i < 7; i++)
m_rombank[i]->set_entry(m_x);
}
void beezer_state::machine_start()
{
// configure rom banks
for (int i = 0; i < 7; i++)
m_rombank[i]->configure_entries(0, 2, m_banked_roms->base() + (i * 0x2000), 0x1000);
// allocate timers
m_timer_count = timer_alloc(0);
// register for state saving
save_pointer(NAME(m_ch_sign), 4);
save_pointer(NAME(m_dac_data), 4);
save_item(NAME(m_count));
save_item(NAME(m_noise));
save_item(NAME(m_pbus));
save_item(NAME(m_x));
save_item(NAME(m_y));
save_item(NAME(m_z));
}
void beezer_state::machine_reset()
{
m_pbus = 0xff;
// initialize memory banks
bankswitch_w(machine().dummy_space(), 0, 0);
// start timer
m_timer_count->adjust(attotime::zero, 0, attotime::from_hz((XTAL_12MHz / 12) / 16));
}
//**************************************************************************
// MACHINE DEFINTIONS
//**************************************************************************
static MACHINE_CONFIG_START( beezer, beezer_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6809, 1000000) /* 1 MHz */
// basic machine hardware
MCFG_CPU_ADD("maincpu", M6809, XTAL_12MHz / 12)
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", beezer_state, beezer_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", M6809, 1000000) /* 1 MHz */
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_DEVICE_ADD("sysbank", ADDRESS_MAP_BANK, 0)
MCFG_DEVICE_PROGRAM_MAP(banked_map)
MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_BIG)
MCFG_ADDRESS_MAP_BANK_DATABUS_WIDTH(8)
MCFG_ADDRESS_MAP_BANK_ADDRBUS_WIDTH(15)
MCFG_ADDRESS_MAP_BANK_STRIDE(0x1000)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", beezer_state, scanline_cb, "screen", 0, 1)
MCFG_DEVICE_ADD("via_u6", VIA6522, 0)
MCFG_VIA6522_READPA_HANDLER(READ8(beezer_state, via_system_pa_r))
MCFG_VIA6522_READPB_HANDLER(READ8(beezer_state, via_system_pb_r))
MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(beezer_state, via_system_pa_w))
MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(beezer_state, via_system_pb_w))
MCFG_VIA6522_CB1_HANDLER(DEVWRITELINE("via_u18", via6522_device, write_ca2))
MCFG_VIA6522_CB2_HANDLER(DEVWRITELINE("via_u18", via6522_device, write_ca1))
MCFG_VIA6522_IRQ_HANDLER(INPUTLINE("maincpu", M6809_IRQ_LINE))
MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
// video hardware
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
@ -104,81 +491,109 @@ static MACHINE_CONFIG_START( beezer, beezer_state )
MCFG_SCREEN_PALETTE("palette")
MCFG_PALETTE_ADD("palette", 16)
MCFG_PALETTE_INIT_OWNER(beezer_state, beezer)
// sound hardware
MCFG_CPU_ADD("audiocpu", M6809, XTAL_12MHz / 12)
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_INPUT_MERGER_ACTIVE_HIGH("audio_irqs")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", M6809_IRQ_LINE))
MCFG_DEVICE_ADD("via_u18", VIA6522, 0)
MCFG_VIA6522_READPA_HANDLER(READ8(beezer_state, via_audio_pa_r))
MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(beezer_state, via_audio_pa_w))
MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(beezer_state, via_audio_pb_w))
MCFG_VIA6522_CA2_HANDLER(DEVWRITELINE("via_u6", via6522_device, write_cb1))
MCFG_VIA6522_CB1_HANDLER(WRITELINE(beezer_state, dmod_clr_w))
MCFG_VIA6522_CB2_HANDLER(WRITELINE(beezer_state, dmod_data_w))
MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE("audio_irqs", input_merger_active_high_device, in0_w))
MCFG_DEVICE_ADD("ptm", PTM6840, XTAL_12MHz / 12)
MCFG_PTM6840_OUT0_CB(WRITELINE(beezer_state, ptm_out0_w))
MCFG_PTM6840_OUT1_CB(WRITELINE(beezer_state, ptm_out1_w))
MCFG_PTM6840_OUT2_CB(WRITELINE(beezer_state, ptm_out2_w))
MCFG_PTM6840_IRQ_CB(DEVWRITELINE("audio_irqs", input_merger_active_high_device, in1_w))
// schematics show an input labeled VCO to channel 2, but the source is unknown
MCFG_MM5837_ADD("noise")
MCFG_MM5837_VDD(12)
MCFG_MM5837_OUTPUT_CB(WRITELINE(beezer_state, noise_w))
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("custom", BEEZER, 0)
MCFG_SOUND_ADD("dac", DAC76, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
/* via */
MCFG_DEVICE_ADD("via6522_0", VIA6522, 0)
MCFG_VIA6522_READPA_HANDLER(READ8(beezer_state, b_via_0_pa_r))
MCFG_VIA6522_READPB_HANDLER(READ8(beezer_state, b_via_0_pb_r))
MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(beezer_state, b_via_0_pa_w))
MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(beezer_state, b_via_0_pb_w))
MCFG_VIA6522_CB2_HANDLER(DEVWRITELINE("via6522_1", via6522_device, write_ca1))
MCFG_VIA6522_IRQ_HANDLER(INPUTLINE("maincpu", M6809_IRQ_LINE))
MCFG_DEVICE_ADD("via6522_1", VIA6522, 0)
MCFG_VIA6522_READPA_HANDLER(READ8(beezer_state, b_via_1_pa_r))
MCFG_VIA6522_READPB_HANDLER(READ8(beezer_state, b_via_1_pb_r))
MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(beezer_state, b_via_1_pa_w))
MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(beezer_state, b_via_1_pb_w))
MCFG_VIA6522_CA2_HANDLER(DEVWRITELINE("via6522_0", via6522_device, write_cb1))
MCFG_VIA6522_IRQ_HANDLER(INPUTLINE("audiocpu", M6809_IRQ_LINE))
MACHINE_CONFIG_END
/***************************************************************************
Game driver(s)
***************************************************************************/
//**************************************************************************
// ROM DEFINITIONS
//**************************************************************************
ROM_START( beezer )
ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "g1", 0x0d000, 0x1000, CRC(3467a0ec) SHA1(0b094a9bf772b101acd26cf09009c67dd4785ed2) )
ROM_LOAD( "g3", 0x0e000, 0x1000, CRC(9950cdf2) SHA1(b2b59cc1080357de6ba297392881d626157df809) )
ROM_LOAD( "g5", 0x0f000, 0x1000, CRC(a4b09879) SHA1(69739dd1d3c88ee6ab310ca3c71b3b50d8ec618f) )
ROM_REGION(0xc000, "maincpu", 0)
ROM_LOAD("g1", 0x0000, 0x1000, CRC(3467a0ec) SHA1(0b094a9bf772b101acd26cf09009c67dd4785ed2))
ROM_LOAD("g3", 0x1000, 0x1000, CRC(9950cdf2) SHA1(b2b59cc1080357de6ba297392881d626157df809))
ROM_LOAD("g5", 0x2000, 0x1000, CRC(a4b09879) SHA1(69739dd1d3c88ee6ab310ca3c71b3b50d8ec618f))
ROM_LOAD( "f1", 0x12000, 0x2000, CRC(ce1b0b8b) SHA1(8ed1d793928bb7afa041a4f61e0c2f78b4442f2f) )
ROM_LOAD( "f3", 0x14000, 0x2000, CRC(6a11072a) SHA1(9700beaec669849da4d0e39d6dbf0b872d7f1b7f) )
ROM_LOAD( "e1", 0x16000, 0x1000, CRC(21e4ca9b) SHA1(4024678a4006614051675858ba65db655931a539) )
ROM_LOAD( "e3", 0x18000, 0x1000, CRC(a4f735d7) SHA1(110061d1c63a331384729951f93a31e62744d0d7) )
ROM_LOAD( "e5", 0x1a000, 0x1000, CRC(0485575b) SHA1(c3be070541459fad4da4a71604883b2f3043374a) )
ROM_LOAD( "f5", 0x1c000, 0x1000, CRC(4b11f572) SHA1(4f283c98a7f1bcf534921b4a54cf564335c53e37) )
ROM_LOAD( "f7", 0x1e000, 0x1000, CRC(bef67473) SHA1(5759ceeca0bb677cee97b74f1a1087d53c25463a) )
// rom type can be either 2732 or 2764 in all locations
ROM_REGION(0xe000, "banked", 0)
ROM_LOAD("f1", 0x0000, 0x2000, CRC(ce1b0b8b) SHA1(8ed1d793928bb7afa041a4f61e0c2f78b4442f2f))
ROM_LOAD("f3", 0x2000, 0x2000, CRC(6a11072a) SHA1(9700beaec669849da4d0e39d6dbf0b872d7f1b7f))
ROM_LOAD("e1", 0x4000, 0x1000, CRC(21e4ca9b) SHA1(4024678a4006614051675858ba65db655931a539))
ROM_RELOAD(0x5000, 0x1000)
ROM_LOAD("e3", 0x6000, 0x1000, CRC(a4f735d7) SHA1(110061d1c63a331384729951f93a31e62744d0d7))
ROM_RELOAD(0x7000, 0x1000)
ROM_LOAD("e5", 0x8000, 0x1000, CRC(0485575b) SHA1(c3be070541459fad4da4a71604883b2f3043374a))
ROM_RELOAD(0x9000, 0x1000)
ROM_LOAD("f5", 0xa000, 0x1000, CRC(4b11f572) SHA1(4f283c98a7f1bcf534921b4a54cf564335c53e37))
ROM_RELOAD(0xb000, 0x1000)
ROM_LOAD("f7", 0xc000, 0x1000, CRC(bef67473) SHA1(5759ceeca0bb677cee97b74f1a1087d53c25463a))
ROM_RELOAD(0xd000, 0x1000)
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "d7", 0xf000, 0x1000, CRC(23b0782e) SHA1(7751327b84235a2e2700e4bdd21adec205c54f0e) )
ROM_REGION(0x2000, "audiocpu", 0)
ROM_LOAD("d7", 0x1000, 0x1000, CRC(23b0782e) SHA1(7751327b84235a2e2700e4bdd21adec205c54f0e))
ROM_REGION( 0x0300, "proms", 0 )
ROM_LOAD( "d1.cpu", 0x000, 0x0100, CRC(8db17a40) SHA1(0e04a4f5f99b302dbbbfda438808d549f8680fe2) )
ROM_LOAD( "e1.cpu", 0x100, 0x0100, CRC(3c775c5e) SHA1(ac86f45938c0c9d5fec1245bf86718442baf445b) )
ROM_REGION(0x200, "proms", 0)
ROM_LOAD("d1.cpu", 0x000, 0x100, CRC(8db17a40) SHA1(0e04a4f5f99b302dbbbfda438808d549f8680fe2))
ROM_LOAD("e1.cpu", 0x100, 0x100, CRC(3c775c5e) SHA1(ac86f45938c0c9d5fec1245bf86718442baf445b))
ROM_END
ROM_START( beezer1 )
ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "g1.32", 0x0d000, 0x1000, CRC(3134cb93) SHA1(7d4a484378b66ccf2fded31885d6dfb2abae9317) )
ROM_LOAD( "g3.32", 0x0e000, 0x1000, CRC(a3cb2c2d) SHA1(1e17eb0eaf02f86865845a065a5f714fc51aa7d6) )
ROM_LOAD( "g5.32", 0x0f000, 0x1000, CRC(5e559bf9) SHA1(cd3713f3ed1215ea5c5640474ba6f005242cd093) )
ROM_REGION(0x3000, "maincpu", 0)
ROM_LOAD("g1.32", 0x0000, 0x1000, CRC(3134cb93) SHA1(7d4a484378b66ccf2fded31885d6dfb2abae9317))
ROM_LOAD("g3.32", 0x1000, 0x1000, CRC(a3cb2c2d) SHA1(1e17eb0eaf02f86865845a065a5f714fc51aa7d6))
ROM_LOAD("g5.32", 0x2000, 0x1000, CRC(5e559bf9) SHA1(cd3713f3ed1215ea5c5640474ba6f005242cd093))
ROM_LOAD( "f1.64", 0x12000, 0x2000, CRC(b8a78cca) SHA1(4218ef8c4c8e10d7cc47d6de4c4d189ef3c0f0a1) )
ROM_LOAD( "f3.32", 0x14000, 0x1000, CRC(bfa023f5) SHA1(56fb15e2db61197e1aec5a5825beff7c788a4ba3) )
ROM_LOAD( "e1", 0x16000, 0x1000, CRC(21e4ca9b) SHA1(4024678a4006614051675858ba65db655931a539) )
ROM_LOAD( "e3", 0x18000, 0x1000, CRC(a4f735d7) SHA1(110061d1c63a331384729951f93a31e62744d0d7) )
ROM_LOAD( "e5", 0x1a000, 0x1000, CRC(0485575b) SHA1(c3be070541459fad4da4a71604883b2f3043374a) )
ROM_LOAD( "f5", 0x1c000, 0x1000, CRC(4b11f572) SHA1(4f283c98a7f1bcf534921b4a54cf564335c53e37) )
ROM_LOAD( "f7", 0x1e000, 0x1000, CRC(bef67473) SHA1(5759ceeca0bb677cee97b74f1a1087d53c25463a) )
// rom type can be either 2732 or 2764 in all locations
ROM_REGION(0xe000, "banked", 0)
ROM_LOAD("f1.64", 0x0000, 0x2000, CRC(b8a78cca) SHA1(4218ef8c4c8e10d7cc47d6de4c4d189ef3c0f0a1))
ROM_LOAD("f3.32", 0x2000, 0x1000, CRC(bfa023f5) SHA1(56fb15e2db61197e1aec5a5825beff7c788a4ba3))
ROM_RELOAD(0x3000, 0x1000)
ROM_LOAD("e1", 0x4000, 0x1000, CRC(21e4ca9b) SHA1(4024678a4006614051675858ba65db655931a539))
ROM_RELOAD(0x5000, 0x1000)
ROM_LOAD("e3", 0x6000, 0x1000, CRC(a4f735d7) SHA1(110061d1c63a331384729951f93a31e62744d0d7))
ROM_RELOAD(0x7000, 0x1000)
ROM_LOAD("e5", 0x8000, 0x1000, CRC(0485575b) SHA1(c3be070541459fad4da4a71604883b2f3043374a))
ROM_RELOAD(0x9000, 0x1000)
ROM_LOAD("f5", 0xa000, 0x1000, CRC(4b11f572) SHA1(4f283c98a7f1bcf534921b4a54cf564335c53e37))
ROM_RELOAD(0xb000, 0x1000)
ROM_LOAD("f7", 0xc000, 0x1000, CRC(bef67473) SHA1(5759ceeca0bb677cee97b74f1a1087d53c25463a))
ROM_RELOAD(0xd000, 0x1000)
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "d7.32", 0xf000, 0x1000, CRC(b11028b5) SHA1(db8958f0bb12e333ce056da3338f1a824dda36e0) )
ROM_REGION(0x2000, "audiocpu", 0)
ROM_LOAD("d7.32", 0x1000, 0x1000, CRC(b11028b5) SHA1(db8958f0bb12e333ce056da3338f1a824dda36e0))
ROM_REGION( 0x0300, "proms", 0 )
ROM_LOAD( "d1.cpu", 0x000, 0x0100, CRC(8db17a40) SHA1(0e04a4f5f99b302dbbbfda438808d549f8680fe2) )
ROM_LOAD( "e1.cpu", 0x100, 0x0100, CRC(3c775c5e) SHA1(ac86f45938c0c9d5fec1245bf86718442baf445b) )
ROM_REGION(0x200, "proms", 0)
ROM_LOAD("d1.cpu", 0x000, 0x100, CRC(8db17a40) SHA1(0e04a4f5f99b302dbbbfda438808d549f8680fe2))
ROM_LOAD("e1.cpu", 0x100, 0x100, CRC(3c775c5e) SHA1(ac86f45938c0c9d5fec1245bf86718442baf445b))
ROM_END
GAME( 1982, beezer, 0, beezer, beezer, beezer_state, beezer, ROT90, "Tong Electronic", "Beezer (set 1)", MACHINE_IMPERFECT_SOUND )
GAME( 1982, beezer1, beezer, beezer, beezer, beezer_state, beezer, ROT90, "Tong Electronic", "Beezer (set 2)", MACHINE_IMPERFECT_SOUND )
//**************************************************************************
// SYSTEM DRIVERS
//**************************************************************************
// YEAR NAME PARENT MACHINE INPUT CLASS INIT ROTATION COMPANY FULLNAME FLAGS
GAME( 1982, beezer, 0, beezer, beezer, driver_device, 0, ROT90, "Tong Electronic", "Beezer (set 1)", MACHINE_IMPERFECT_SOUND )
GAME( 1982, beezer1, beezer, beezer, beezer, driver_device, 0, ROT90, "Tong Electronic", "Beezer (set 2)", MACHINE_IMPERFECT_SOUND )

View File

@ -2523,6 +2523,24 @@ ROM_START( gldncrwn )
ROM_LOAD("gcrpal.bin", 0, 8 , CRC(4edd5a1d) SHA1(d6fe38377d5f2291d33ee8ed808548871e63c4d7))
ROM_END
ROM_START( gldncrwnhop )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD("95752007.gam", 0x00000, 0x10000, CRC(ba009ab7) SHA1(df58f5ff4e9fdf8db5931833b909fb0e4ba8e23d))
ROM_REGION( 0x20000, "adder2", 0 )
ROM_LOAD("95770146.vid", 0x00000, 0x20000, CRC(f3109cd5) SHA1(8da5207c07015d6f5a72397eaa6ab70800785f7f))
ROM_REGION( 0x20000, "upd", 0 )
ROM_LOAD("95770139.snd", 0x00000, 0x20000, CRC(e76ca414) SHA1(2c441e3369e374c033b5585e8f6a9c34a4c5ec0f))
ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF )
ROM_LOAD("95770147.chr", 0x00000, 0x20000, CRC(5a4d2b79) SHA1(c2f2f39ef6816e0da1b2ff4b723612c671c6215f))
ROM_REGION( 0x10, "proms", 0 )
ROM_LOAD("gcrpal.bin", 0, 8 , BAD_DUMP CRC(4edd5a1d) SHA1(d6fe38377d5f2291d33ee8ed808548871e63c4d7)) // This was missing with dump, using gldncrwn
ROM_END
// ROM definition Dutch Paradice //////////////////////////////////////////
ROM_START( paradice )
@ -7646,6 +7664,7 @@ GAMEL( 1996, sltblgpo, 0, scorpion2_vid, sltblgpo, bfm_sc2_state, sltsb
GAMEL( 1996, sltblgp1, sltblgpo, scorpion2_vid, sltblgpo, bfm_sc2_state, sltsbelg, 0, "BFM/ELAM", "Slots (Belgian Cash, Game Card 95-752-008)", MACHINE_SUPPORTS_SAVE,layout_sltblgpo )
GAMEL( 1997, gldncrwn, 0, scorpion2_vid, gldncrwn, bfm_sc2_state, gldncrwn, 0, "BFM/ELAM", "Golden Crown (Dutch, Game Card 95-752-011)", MACHINE_SUPPORTS_SAVE,layout_gldncrwn )
GAMEL( 1997, gldncrwnhop,gldncrwn,scorpion2_vid, gldncrwn, bfm_sc2_state, gldncrwn, 0, "BFM/ELAM", "Golden Crown Hopper (Dutch, Game Card)", MACHINE_SUPPORTS_SAVE,layout_gldncrwn )
/* Non-Video */

View File

@ -361,8 +361,10 @@ static INPUT_PORTS_START( ccastles )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT )
PORT_SERVICE( 0x10, IP_ACTIVE_LOW )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ccastles_state,get_vblank, nullptr)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* 1p Jump, non-cocktail start1 */
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) /* 2p Jump, non-cocktail start2 */
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Left Jump/1P Start Upright") PORT_CONDITION("IN1",0x20,EQUALS,0x00) /* left Jump, non-cocktail start1 */
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("1P Jump") PORT_CONDITION("IN1",0x20,EQUALS,0x20) /* 1p Jump, cocktail */
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Right Jump/2P Start Upright") PORT_CONDITION("IN1",0x20,EQUALS,0x00) /* right Jump, non-cocktail start2 */
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL PORT_NAME("2P Jump") PORT_CONDITION("IN1",0x20,EQUALS,0x20) /* 2p Jump, cocktail */
PORT_START("IN1") /* IN1 */
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
@ -374,8 +376,8 @@ static INPUT_PORTS_START( ccastles )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) /* cocktail only */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) /* cocktail only */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("1P Start Cocktail") /* cocktail only */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("2P Start Cocktail") /* cocktail only */
PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x20, DEF_STR( Cocktail ) )
@ -388,10 +390,10 @@ static INPUT_PORTS_START( ccastles )
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(10) PORT_KEYDELTA(30)
PORT_START("LETA2")
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_COCKTAIL PORT_SENSITIVITY(10) PORT_KEYDELTA(30) PORT_REVERSE
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_COCKTAIL PORT_SENSITIVITY(10) PORT_KEYDELTA(30) PORT_REVERSE /* cocktail only */
PORT_START("LETA3")
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_COCKTAIL PORT_SENSITIVITY(10) PORT_KEYDELTA(30)
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_COCKTAIL PORT_SENSITIVITY(10) PORT_KEYDELTA(30) /* cocktail only */
INPUT_PORTS_END

View File

@ -39,19 +39,20 @@ cha3 $10d8
#include "includes/tnzs.h"
#include "sound/ay8910.h"
class cchance_state : public tnzs_state
class cchance_state : public tnzs_base_state
{
public:
cchance_state(const machine_config &mconfig, device_type type, const char *tag)
: tnzs_state(mconfig, type, tag) { }
: tnzs_base_state(mconfig, type, tag) { }
void machine_reset() override;
void machine_start() override;
uint8_t m_hop_io;
uint8_t m_bell_io;
DECLARE_WRITE8_MEMBER(output_0_w);
DECLARE_READ8_MEMBER(input_1_r);
DECLARE_WRITE8_MEMBER(output_1_w);
DECLARE_MACHINE_START(cchance);
DECLARE_MACHINE_RESET(cchance);
};
@ -191,18 +192,17 @@ static GFXDECODE_START( cchance )
GFXDECODE_ENTRY( "gfx1", 0, cchance_layout, 0x0, 32 )
GFXDECODE_END
MACHINE_START_MEMBER(cchance_state,cchance)
void cchance_state::machine_start()
{
save_item(NAME(m_hop_io));
save_item(NAME(m_bell_io));
}
MACHINE_RESET_MEMBER(cchance_state,cchance)
void cchance_state::machine_reset()
{
m_mcu_type = -1;
tnzs_base_state::machine_reset();
m_hop_io = 0;
m_bell_io = 0;
}
static MACHINE_CONFIG_START( cchance, cchance_state )
@ -211,9 +211,6 @@ static MACHINE_CONFIG_START( cchance, cchance_state )
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", cchance_state, irq0_line_hold)
MCFG_MACHINE_START_OVERRIDE(cchance_state,cchance)
MCFG_MACHINE_RESET_OVERRIDE(cchance_state,cchance)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", cchance)
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
@ -230,7 +227,7 @@ static MACHINE_CONFIG_START( cchance, cchance_state )
MCFG_SCREEN_PALETTE("palette")
MCFG_PALETTE_ADD("palette", 512)
MCFG_PALETTE_INIT_OWNER(cchance_state,arknoid2)
MCFG_PALETTE_INIT_OWNER(tnzs_base_state, prompalette)
MCFG_SPEAKER_STANDARD_MONO("mono")

View File

@ -385,7 +385,7 @@ Thanks to Alex, Mr Mudkips, and Philip Burke for this info.
#include "debug/debugcon.h"
#include "debug/debugcmd.h"
#include "debugger.h"
#include "includes/chihiro.h"
#include "includes/xbox_nv2a.h"
#include "includes/xbox.h"
#include "includes/xbox_usb.h"
#include "machine/jvshost.h"

View File

@ -134,32 +134,25 @@ public:
uint8_t *font = m_lcd_char_rom->base();
if (m_lcd_mode & LCD_MODE_ALT)
{
font += 1024;
font += 2048;
}
int chrw = (m_lcd_size & LCD_SIZE_CHRW) ? 8 : 6;
for (int y = 0; y < 16; y++)
for (int y = 0; y < 128; y++)
{
int offset = (m_lcd_scrolly * 128) + (m_lcd_scrollx & 0x7f) + (y * 128);
int offset = (m_lcd_scrolly * 128) + (m_lcd_scrollx & 0x7f) + ((y / 8) * 128);
for (int x = 0; x < 480; x++)
{
uint8_t ch = m_ram->pointer()[offset + (x / chrw)];
uint8_t bit = font[((ch & 0x7f) * chrw) + (x % chrw)];
uint8_t bit = font[((ch & 0x7f) * 8) + (y % 8)];
if (ch & 0x80)
{
bit = ~bit;
}
bitmap.pix16((y * 8) + 0, x) = (bit >> 0) & 1;
bitmap.pix16((y * 8) + 1, x) = (bit >> 1) & 1;
bitmap.pix16((y * 8) + 2, x) = (bit >> 2) & 1;
bitmap.pix16((y * 8) + 3, x) = (bit >> 3) & 1;
bitmap.pix16((y * 8) + 4, x) = (bit >> 4) & 1;
bitmap.pix16((y * 8) + 5, x) = (bit >> 5) & 1;
bitmap.pix16((y * 8) + 6, x) = (bit >> 6) & 1;
bitmap.pix16((y * 8) + 7, x) = (bit >> 7) & 1;
bitmap.pix16(y, x) = (bit >> (7 - (x % chrw))) & 1;
}
}
}
@ -838,8 +831,8 @@ ROM_START( clcd )
ROM_LOAD( "sizapr.u103", 0x10000, 0x8000, CRC(0aa91d9f) SHA1(f0842f370607f95d0a0ec6afafb81bc063c32745))
ROM_LOAD( "kizapr.u102", 0x18000, 0x8000, CRC(59103d52) SHA1(e49c20b237a78b54c2cb26b133d5903bb60bd8ef))
ROM_REGION( 0x20000, "lcd_char_rom", 0 )
ROM_LOAD( "lcd_char_rom", 0x000000, 0x000800, BAD_DUMP CRC(7db9d225) SHA1(0a8835fa182efa55d027828b42aa554608795274) )
ROM_REGION( 0x1000, "lcd_char_rom", 0 )
ROM_LOAD( "lcd-char-rom.u16", 0x00000, 0x1000, CRC(7b6d3867) SHA1(cb594801438849f933ddc3e64b03b56f42f59f09))
ROM_END

View File

@ -9,7 +9,7 @@
Appears to be a down-grade of the nmk16 HW
TODO:
-When you use the "gun card" the game gives "minus" points,but points are always added,inaccurate protection?
-When you use the "gun card" the game gives "minus" points, but points are always added, inaccurate protection?
-Understand better the video emulation and convert it to tilemaps;
-Coinage settings based on those listed at www.crazykong.com/dips/DoubleDealer.txt - coin/credit simulation need fixing;
-Decap + emulate MCU, required if the random number generation is going to be accurate;
@ -51,10 +51,10 @@
- There's also MCU response (write/read/test) test just after these writes.
(probably data used in the check depends on above writes). It's similar to
jalmah.c tests, but num of responses is different, and shared ram is
jalmah.cpp tests, but num of responses is different, and shared ram is
used to communicate with MCU
- After last check (or maybe durning tests ... no idea)
- After last check (or maybe during tests ... no idea)
MCU writes $4ef900000604 (jmp $604) to $fe000 and game jumps to this address.
- code at $604 writes $20.w to $fe018 and $1.w to $fe01e.
@ -144,38 +144,40 @@ public:
required_shared_ptr<uint16_t> m_work_ram;
required_shared_ptr<uint16_t> m_mcu_shared_ram;
/* devices */
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
/* video-related */
tilemap_t *m_back_tilemap;
int m_respcount;
int m_flipscreen;
/* misc */
uint8_t m_input_pressed;
uint16_t m_coin_input;
DECLARE_WRITE16_MEMBER(ddealer_flipscreen_w);
DECLARE_WRITE16_MEMBER(flipscreen_w);
DECLARE_WRITE16_MEMBER(back_vram_w);
DECLARE_WRITE16_MEMBER(ddealer_vregs_w);
DECLARE_WRITE16_MEMBER(ddealer_mcu_shared_w);
DECLARE_READ16_MEMBER(ddealer_mcu_r);
DECLARE_WRITE16_MEMBER(mcu_shared_w);
DECLARE_READ16_MEMBER(mcu_r);
DECLARE_DRIVER_INIT(ddealer);
TILE_GET_INFO_MEMBER(get_back_tile_info);
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void video_start() override;
uint32_t screen_update_ddealer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(ddealer_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(ddealer_mcu_sim);
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
void ddealer_draw_video_layer( uint16_t* vreg_base, uint16_t* top, uint16_t* bottom, bitmap_ind16 &bitmap, const rectangle &cliprect, int flipy);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(mcu_sim);
void draw_video_layer(uint16_t* vreg_base, uint16_t* top, uint16_t* bottom, bitmap_ind16 &bitmap, const rectangle &cliprect, int flipy);
};
WRITE16_MEMBER(ddealer_state::ddealer_flipscreen_w)
WRITE16_MEMBER(ddealer_state::flipscreen_w)
{
m_flipscreen = data & 0x01;
flip_screen_set(data & 0x01);
}
TILE_GET_INFO_MEMBER(ddealer_state::get_back_tile_info)
@ -189,11 +191,10 @@ TILE_GET_INFO_MEMBER(ddealer_state::get_back_tile_info)
void ddealer_state::video_start()
{
m_flipscreen = 0;
m_back_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(ddealer_state::get_back_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 64, 32);
}
void ddealer_state::ddealer_draw_video_layer( uint16_t* vreg_base, uint16_t* top, uint16_t* bottom, bitmap_ind16 &bitmap, const rectangle &cliprect, int flipy)
void ddealer_state::draw_video_layer(uint16_t* vreg_base, uint16_t* top, uint16_t* bottom, bitmap_ind16 &bitmap, const rectangle &cliprect, int flipy)
{
gfx_element *gfx = m_gfxdecode->gfx(1);
@ -276,40 +277,40 @@ void ddealer_state::ddealer_draw_video_layer( uint16_t* vreg_base, uint16_t* top
}
uint32_t ddealer_state::screen_update_ddealer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
uint32_t ddealer_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_back_tilemap->set_scrollx(0, m_flipscreen ? -192 : -64);
m_back_tilemap->set_flip(m_flipscreen ? TILEMAP_FLIPY | TILEMAP_FLIPX : 0);
m_back_tilemap->set_scrollx(0, -64);
m_back_tilemap->draw(screen, bitmap, cliprect, 0, 0);
/* the fg tilemap handling is a little hacky right now,
i'm not sure if it should be a single tilemap with
I'm not sure if it should be a single tilemap with
rowscroll / linescroll, or two tilemaps which can be
combined, the flipscreen case makes things more
difficult to understand */
if (!m_flipscreen)
bool const flip = flip_screen();
if (!flip)
{
if (m_vregs[0xcc / 2] & 0x80)
{
ddealer_draw_video_layer(&m_vregs[0x1e0 / 2], m_left_fg_vram_top, m_left_fg_vram_bottom, bitmap, cliprect, m_flipscreen);
ddealer_draw_video_layer(&m_vregs[0xcc / 2], m_right_fg_vram_top, m_right_fg_vram_bottom, bitmap, cliprect, m_flipscreen);
draw_video_layer(&m_vregs[0x1e0 / 2], m_left_fg_vram_top, m_left_fg_vram_bottom, bitmap, cliprect, flip);
draw_video_layer(&m_vregs[0xcc / 2], m_right_fg_vram_top, m_right_fg_vram_bottom, bitmap, cliprect, flip);
}
else
{
ddealer_draw_video_layer(&m_vregs[0x1e0 / 2], m_left_fg_vram_top, m_left_fg_vram_bottom, bitmap, cliprect, m_flipscreen);
draw_video_layer(&m_vregs[0x1e0 / 2], m_left_fg_vram_top, m_left_fg_vram_bottom, bitmap, cliprect, flip);
}
}
else
{
if (m_vregs[0xcc / 2] & 0x80)
{
ddealer_draw_video_layer(&m_vregs[0xcc / 2], m_left_fg_vram_top, m_left_fg_vram_bottom, bitmap, cliprect, m_flipscreen);
ddealer_draw_video_layer(&m_vregs[0x1e0 / 2], m_right_fg_vram_top, m_right_fg_vram_bottom, bitmap, cliprect, m_flipscreen);
draw_video_layer(&m_vregs[0xcc / 2], m_left_fg_vram_top, m_left_fg_vram_bottom, bitmap, cliprect, flip);
draw_video_layer(&m_vregs[0x1e0 / 2], m_right_fg_vram_top, m_right_fg_vram_bottom, bitmap, cliprect, flip);
}
else
{
ddealer_draw_video_layer(&m_vregs[0x1e0 / 2], m_left_fg_vram_top, m_left_fg_vram_bottom, bitmap, cliprect, m_flipscreen);
draw_video_layer(&m_vregs[0x1e0 / 2], m_left_fg_vram_top, m_left_fg_vram_bottom, bitmap, cliprect, flip);
}
}
@ -317,7 +318,7 @@ uint32_t ddealer_state::screen_update_ddealer(screen_device &screen, bitmap_ind1
return 0;
}
TIMER_DEVICE_CALLBACK_MEMBER(ddealer_state::ddealer_mcu_sim)
TIMER_DEVICE_CALLBACK_MEMBER(ddealer_state::mcu_sim)
{
/*coin/credit simulation*/
/*$fe002 is used,might be for multiple coins for one credit settings.*/
@ -351,7 +352,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(ddealer_state::ddealer_mcu_sim)
m_input_pressed = (m_input_pressed & 0xfb);
/*0x104/2 is some sort of "start-lock",i.e. used on the girl selection.
Without it,the game "steals" one credit if you press the start button on that.*/
Without it, the game "steals" one credit if you press the start button on that.*/
if (m_mcu_shared_ram[0x000 / 2] > 0 && m_work_ram[0x104 / 2] & 1)
{
if (m_coin_input & 0x08)//start 1
@ -373,7 +374,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(ddealer_state::ddealer_mcu_sim)
m_input_pressed = (m_input_pressed & 0xef);
}
/*random number generators,controls order of cards*/
/*random number generators, controls order of cards*/
m_mcu_shared_ram[0x10 / 2] = machine().rand() & 0xffff;
m_mcu_shared_ram[0x12 / 2] = machine().rand() & 0xffff;
m_mcu_shared_ram[0x14 / 2] = machine().rand() & 0xffff;
@ -389,14 +390,9 @@ WRITE16_MEMBER(ddealer_state::back_vram_w)
}
WRITE16_MEMBER(ddealer_state::ddealer_vregs_w)
{
COMBINE_DATA(&m_vregs[offset]);
}
/******************************************************************************************************
Protection handling,identical to Hacha Mecha Fighter / Thunder Dragon with different vectors.
Protection handling, identical to Hacha Mecha Fighter / Thunder Dragon with different vectors.
******************************************************************************************************/
@ -415,7 +411,7 @@ Protection handling,identical to Hacha Mecha Fighter / Thunder Dragon with diffe
m_mcu_shared_ram[_protinput_+1] = (_input_ & 0x0000ffff);\
}
WRITE16_MEMBER(ddealer_state::ddealer_mcu_shared_w)
WRITE16_MEMBER(ddealer_state::mcu_shared_w)
{
COMBINE_DATA(&m_mcu_shared_ram[offset]);
@ -425,7 +421,7 @@ WRITE16_MEMBER(ddealer_state::ddealer_mcu_shared_w)
case 0x164/2: PROT_INPUT(0x164/2,0x5678,0x104/2,0x80002); break;
case 0x62e/2: PROT_INPUT(0x62e/2,0x9ca3,0x108/2,0x80008); break;
case 0x734/2: PROT_INPUT(0x734/2,0xaba2,0x10c/2,0x8000a); break;
/*These enables something for sure,maybe the random number generator?*/
/*These enables something for sure, maybe the random number generator?*/
//00054C: 33FC B891 000F E828 move.w #$b891, $fe828.l
//000554: 33FC C760 000F E950 move.w #$c760, $fe950.l
//00055C: 33FC D45F 000F EA7C move.w #$d45f, $fea7c.l
@ -447,7 +443,7 @@ WRITE16_MEMBER(ddealer_state::ddealer_mcu_shared_w)
case 0x4de/2: PROT_JSR(0x4de,0x803b,0x96c2); break;
case 0x4ee/2: PROT_JSR(0x4ee,0x800c,0x5ca4); break;//palette ram buffer
case 0x4fe/2: PROT_JSR(0x4fe,0x8018,0x9818); break;
/*Start-up vector,I think that only the first ram address can be written by the main CPU,or it is a whole sequence.*/
/*Start-up vector, I think that only the first ram address can be written by the main CPU, or it is a whole sequence.*/
case 0x000/2:
if (m_mcu_shared_ram[0x000 / 2] == 0x60fe)
{
@ -480,7 +476,7 @@ static ADDRESS_MAP_START( ddealer, AS_PROGRAM, 16, ddealer_state )
AM_RANGE(0x08000a, 0x08000b) AM_READ_PORT("UNK")
AM_RANGE(0x084000, 0x084003) AM_DEVWRITE8("ymsnd", ym2203_device, write, 0x00ff) // ym ?
AM_RANGE(0x088000, 0x0887ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x08c000, 0x08cfff) AM_RAM_WRITE(ddealer_vregs_w) AM_SHARE("vregs") // palette ram
AM_RANGE(0x08c000, 0x08cfff) AM_RAM AM_SHARE("vregs") // palette ram
/* this might actually be 1 tilemap with some funky rowscroll / columnscroll enabled, I'm not sure */
AM_RANGE(0x090000, 0x090fff) AM_RAM AM_SHARE("left_fg_vratop")
@ -488,10 +484,10 @@ static ADDRESS_MAP_START( ddealer, AS_PROGRAM, 16, ddealer_state )
AM_RANGE(0x092000, 0x092fff) AM_RAM AM_SHARE("left_fg_vrabot")
AM_RANGE(0x093000, 0x093fff) AM_RAM AM_SHARE("right_fg_vrabot")
//AM_RANGE(0x094000, 0x094001) AM_NOP // always 0?
AM_RANGE(0x098000, 0x098001) AM_WRITE(ddealer_flipscreen_w)
AM_RANGE(0x098000, 0x098001) AM_WRITE(flipscreen_w)
AM_RANGE(0x09c000, 0x09cfff) AM_RAM_WRITE(back_vram_w) AM_SHARE("back_vram") // bg tilemap
AM_RANGE(0x0f0000, 0x0fdfff) AM_RAM AM_SHARE("work_ram")
AM_RANGE(0x0fe000, 0x0fefff) AM_RAM_WRITE(ddealer_mcu_shared_w) AM_SHARE("mcu_shared_ram")
AM_RANGE(0x0fe000, 0x0fefff) AM_RAM_WRITE(mcu_shared_w) AM_SHARE("mcu_shared_ram")
AM_RANGE(0x0ff000, 0x0fffff) AM_RAM
ADDRESS_MAP_END
@ -502,7 +498,7 @@ static INPUT_PORTS_START( ddealer )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) //used,"test" in service mode,unknown purpose
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) //used, "test" in service mode, unknown purpose
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
@ -601,7 +597,6 @@ GFXDECODE_END
void ddealer_state::machine_start()
{
save_item(NAME(m_respcount));
save_item(NAME(m_flipscreen));
save_item(NAME(m_input_pressed));
save_item(NAME(m_coin_input));
}
@ -609,12 +604,11 @@ void ddealer_state::machine_start()
void ddealer_state::machine_reset()
{
m_respcount = 0;
m_flipscreen = 0;
m_input_pressed = 0;
m_coin_input = 0;
}
INTERRUPT_GEN_MEMBER(ddealer_state::ddealer_interrupt)
INTERRUPT_GEN_MEMBER(ddealer_state::interrupt)
{
device.execute().set_input_line(4, HOLD_LINE);
}
@ -623,8 +617,8 @@ static MACHINE_CONFIG_START( ddealer, ddealer_state )
MCFG_CPU_ADD("maincpu" , M68000, XTAL_16MHz/2) /* 8MHz */
MCFG_CPU_PROGRAM_MAP(ddealer)
MCFG_CPU_VBLANK_INT_DRIVER("screen", ddealer_state, ddealer_interrupt)
MCFG_CPU_PERIODIC_INT_DRIVER(ddealer_state, irq1_line_hold, 90)//guess,controls music tempo,112 is way too fast
MCFG_CPU_VBLANK_INT_DRIVER("screen", ddealer_state, interrupt)
MCFG_CPU_PERIODIC_INT_DRIVER(ddealer_state, irq1_line_hold, 90)//guess, controls music tempo, 112 is way too fast
// M50747 or NMK-110 8131 MCU
@ -636,13 +630,13 @@ static MACHINE_CONFIG_START( ddealer, ddealer_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(512, 256)
MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1)
MCFG_SCREEN_UPDATE_DRIVER(ddealer_state, screen_update_ddealer)
MCFG_SCREEN_UPDATE_DRIVER(ddealer_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_PALETTE_ADD("palette", 0x400)
MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx)
MCFG_TIMER_DRIVER_ADD_PERIODIC("coinsim", ddealer_state, ddealer_mcu_sim, attotime::from_hz(10000))
MCFG_TIMER_DRIVER_ADD_PERIODIC("coinsim", ddealer_state, mcu_sim, attotime::from_hz(10000))
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_6MHz / 8) /* 7.5KHz */
@ -651,7 +645,7 @@ MACHINE_CONFIG_END
READ16_MEMBER(ddealer_state::ddealer_mcu_r)
READ16_MEMBER(ddealer_state::mcu_r)
{
static const int resp[] =
{
@ -674,7 +668,7 @@ READ16_MEMBER(ddealer_state::ddealer_mcu_r)
DRIVER_INIT_MEMBER(ddealer_state,ddealer)
{
m_maincpu->space(AS_PROGRAM).install_read_handler(0xfe01c, 0xfe01d, read16_delegate(FUNC(ddealer_state::ddealer_mcu_r), this));
m_maincpu->space(AS_PROGRAM).install_read_handler(0xfe01c, 0xfe01d, read16_delegate(FUNC(ddealer_state::mcu_r), this));
}
ROM_START( ddealer )

View File

@ -43,7 +43,8 @@ Original Service Manuals and Service Mode (when available).
ToDo:
- Fix protection simulation in Birdie Try (that part needs at least comparison with a real board);
- graphics are completely broken in Automat and Secret Agent (bootleg);
- Fix remaining graphical problems in Automat (bootleg);
- graphics and sound are completely broken in Secret Agent (bootleg);
- Fighting Fantasy (bootleg) doesn't boot at all;
- Hook up the 68705 in Midnight Resistance (bootleg) (it might not be used, leftover from the Fighting Fantasy bootleg on the same PCB?)
- Get rid of ROM patches in Sly Spy and Hippodrome;
@ -531,9 +532,14 @@ ADDRESS_MAP_END
void dec0_automat_state::machine_start()
{
save_item(NAME(m_automat_adpcm_byte));
save_item(NAME(m_automat_msm5205_vclk_toggle));
m_adpcm_toggle1 = false;
m_adpcm_toggle2 = false;
save_item(NAME(m_adpcm_toggle1));
save_item(NAME(m_adpcm_toggle2));
save_item(NAME(m_automat_scroll_regs));
m_soundbank->configure_entries(0, 4, memregion("audiocpu")->base(), 0x4000);
m_soundbank->set_entry(0);
}
@ -584,6 +590,8 @@ static ADDRESS_MAP_START( automat_map, AS_PROGRAM, 16, dec0_automat_state )
AM_RANGE(0x400000, 0x400007) AM_WRITE(automat_scroll_w)
AM_RANGE(0x400008, 0x400009) AM_WRITE(dec0_priority_w)
AM_RANGE(0x500000, 0x500001) AM_WRITENOP // ???
AM_RANGE(0xff8000, 0xffbfff) AM_RAM AM_SHARE("ram") /* Main ram */
AM_RANGE(0xffc000, 0xffcfff) AM_RAM AM_SHARE("spriteram") /* Sprites */
ADDRESS_MAP_END
@ -616,19 +624,16 @@ static ADDRESS_MAP_START( secretab_map, AS_PROGRAM, 16, dec0_automat_state )
ADDRESS_MAP_END
WRITE8_MEMBER(dec0_automat_state::automat_adpcm_w)
{
m_automat_adpcm_byte = data;
}
static ADDRESS_MAP_START( automat_s_map, AS_PROGRAM, 8, dec0_automat_state )
AM_RANGE(0x0103, 0x0103) AM_WRITENOP
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("soundbank")
AM_RANGE(0xc000, 0xc7ff) AM_RAM
AM_RANGE(0xc800, 0xc801) AM_DEVWRITE("2203a", ym2203_device, write)
AM_RANGE(0xd800, 0xd800) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xd000, 0xd001) AM_DEVWRITE("2203b", ym2203_device, write)
AM_RANGE(0xf000, 0xf000) AM_WRITE(automat_adpcm_w)
AM_RANGE(0x0000, 0xffff) AM_ROM
AM_RANGE(0xc800, 0xc801) AM_DEVREADWRITE("2203a", ym2203_device, read, write)
AM_RANGE(0xd000, 0xd001) AM_DEVREADWRITE("2203b", ym2203_device, read, write)
AM_RANGE(0xd800, 0xd800) AM_READ(sound_command_r)
AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("adpcm_select2", ls157_device, ba_w)
AM_RANGE(0xe800, 0xe800) AM_WRITE(sound_bankswitch_w)
AM_RANGE(0xf000, 0xf000) AM_DEVWRITE("adpcm_select1", ls157_device, ba_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8, dec0_state )
@ -1358,19 +1363,37 @@ static MACHINE_CONFIG_DERIVED( dec1, dec0_base )
MACHINE_CONFIG_END
WRITE_LINE_MEMBER(dec0_automat_state::automat_vclk_cb)
READ8_MEMBER(dec0_automat_state::sound_command_r)
{
if (m_automat_msm5205_vclk_toggle == 0)
{
m_msm->data_w(m_automat_adpcm_byte & 0xf);
}
else
{
m_msm->data_w(m_automat_adpcm_byte >> 4);
//device->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); // gives some scratch samples but breaks other sounds too
}
m_audiocpu->set_input_line(0, CLEAR_LINE);
return m_soundlatch->read(space, 0);
}
m_automat_msm5205_vclk_toggle ^= 1;
WRITE8_MEMBER(dec0_automat_state::sound_bankswitch_w)
{
m_msm1->reset_w(BIT(data, 3));
m_msm2->reset_w(BIT(data, 4));
m_soundbank->set_entry(data & 3);
}
WRITE_LINE_MEMBER(dec0_automat_state::msm1_vclk_cb)
{
if (!state)
return;
m_adpcm_toggle1 = !m_adpcm_toggle1;
m_adpcm_select1->select_w(m_adpcm_toggle1);
m_audiocpu->set_input_line(INPUT_LINE_NMI, m_adpcm_toggle1);
}
WRITE_LINE_MEMBER(dec0_automat_state::msm2_vclk_cb)
{
if (!state)
return;
m_adpcm_toggle2 = !m_adpcm_toggle2;
m_adpcm_select2->select_w(m_adpcm_toggle2);
}
@ -1418,21 +1441,32 @@ static MACHINE_CONFIG_START( automat, dec0_automat_state )
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("2203a", YM2203, 1500000)
MCFG_SOUND_ADD("2203a", YM2203, 1250000)
MCFG_SOUND_ROUTE(0, "mono", 0.90)
MCFG_SOUND_ROUTE(1, "mono", 0.90)
MCFG_SOUND_ROUTE(2, "mono", 0.90)
MCFG_SOUND_ROUTE(3, "mono", 0.35)
MCFG_SOUND_ADD("2203b", YM2203, 1500000)
MCFG_SOUND_ADD("2203b", YM2203, 1250000)
MCFG_SOUND_ROUTE(0, "mono", 0.90)
MCFG_SOUND_ROUTE(1, "mono", 0.90)
MCFG_SOUND_ROUTE(2, "mono", 0.90)
MCFG_SOUND_ROUTE(3, "mono", 0.35)
MCFG_SOUND_ADD("msm", MSM5205, 384000/2)
MCFG_MSM5205_VCLK_CB(WRITELINE(dec0_automat_state, automat_vclk_cb))
MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B)
MCFG_DEVICE_ADD("adpcm_select1", LS157, 0)
MCFG_74LS157_OUT_CB(DEVWRITE8("msm1", msm5205_device, data_w))
MCFG_DEVICE_ADD("adpcm_select2", LS157, 0)
MCFG_74LS157_OUT_CB(DEVWRITE8("msm2", msm5205_device, data_w))
MCFG_SOUND_ADD("msm1", MSM5205, 384000)
MCFG_MSM5205_VCLK_CB(WRITELINE(dec0_automat_state, msm1_vclk_cb))
MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S96_4B)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_SOUND_ADD("msm2", MSM5205, 384000)
MCFG_MSM5205_VCLK_CB(WRITELINE(dec0_automat_state, msm2_vclk_cb))
MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S96_4B)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@ -1481,23 +1515,33 @@ static MACHINE_CONFIG_START( secretab, dec0_automat_state )
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("2203a", YM2203, 1500000)
MCFG_SOUND_ADD("2203a", YM2203, 1250000)
MCFG_SOUND_ROUTE(0, "mono", 0.90)
MCFG_SOUND_ROUTE(1, "mono", 0.90)
MCFG_SOUND_ROUTE(2, "mono", 0.90)
MCFG_SOUND_ROUTE(3, "mono", 0.35)
MCFG_SOUND_ADD("2203b", YM2203, 1500000)
MCFG_SOUND_ADD("2203b", YM2203, 1250000)
MCFG_SOUND_ROUTE(0, "mono", 0.90)
MCFG_SOUND_ROUTE(1, "mono", 0.90)
MCFG_SOUND_ROUTE(2, "mono", 0.90)
MCFG_SOUND_ROUTE(3, "mono", 0.35)
MCFG_SOUND_ADD("msm", MSM5205, 384000/2)
MCFG_MSM5205_VCLK_CB(WRITELINE(dec0_automat_state, automat_vclk_cb))
MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B)
MCFG_DEVICE_ADD("adpcm_select1", LS157, 0)
MCFG_74LS157_OUT_CB(DEVWRITE8("msm1", msm5205_device, data_w))
MCFG_DEVICE_ADD("adpcm_select2", LS157, 0)
MCFG_74LS157_OUT_CB(DEVWRITE8("msm2", msm5205_device, data_w))
MCFG_SOUND_ADD("msm1", MSM5205, 384000)
MCFG_MSM5205_VCLK_CB(WRITELINE(dec0_automat_state, msm1_vclk_cb))
MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S96_4B)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_SOUND_ADD("msm2", MSM5205, 384000)
MCFG_MSM5205_VCLK_CB(WRITELINE(dec0_automat_state, msm2_vclk_cb))
MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S96_4B)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@ -3331,5 +3375,5 @@ GAME( 1989, ffantasybl, hippodrm, ffantasybl, ffantasybl, dec0_state, ffantasybl
GAME( 1988, drgninjab2, baddudes, baddudes, drgninja, dec0_state, baddudes, ROT0, "bootleg", "Dragonninja (bootleg with 68705)", MACHINE_SUPPORTS_SAVE ) // is this the same board as above? (region warning hacked to World, but still shows Japanese text)
// these are different to the above but quite similar to each other
GAME( 1988, automat, robocop, automat, robocop, dec0_state, robocop, ROT0, "bootleg", "Automat (bootleg of Robocop)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // sound rom / music from section z with mods for ADPCM?
GAME( 1989, secretab, secretag, secretab, slyspy, dec0_state, slyspy, ROT0, "bootleg", "Secret Agent (bootleg)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
GAME( 1988, automat, robocop, automat, robocop, dec0_state, robocop, ROT0, "bootleg", "Automat (bootleg of Robocop)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // sound rom / music from section z with mods for ADPCM?
GAME( 1989, secretab, secretag, secretab, slyspy, driver_device, 0, ROT0, "bootleg", "Secret Agent (bootleg)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )

View File

@ -44,6 +44,7 @@ Notes:
#include "emu.h"
#include "cpu/z80/z80.h"
#include "machine/gen_latch.h"
#include "machine/74157.h"
#include "sound/msm5205.h"
#include "sound/3812intf.h"
@ -57,6 +58,7 @@ public:
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_msm(*this, "msm"),
m_adpcm_select(*this, "adpcm_select"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch") { }
@ -65,13 +67,14 @@ public:
uint8_t m_ram_bank;
uint8_t m_gfxbank;
uint8_t m_port_00;
int m_adpcm;
uint8_t m_toggle;
bool m_toggle;
/* devices */
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<msm5205_device> m_msm;
required_device<ls157_device> m_adpcm_select;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
@ -94,7 +97,6 @@ public:
DECLARE_READ8_MEMBER(discoboy_ram_att_r);
DECLARE_WRITE8_MEMBER(discoboy_ram_att_w);
DECLARE_READ8_MEMBER(discoboy_port_06_r);
DECLARE_WRITE8_MEMBER(yunsung8_adpcm_w);
DECLARE_WRITE8_MEMBER(yunsung8_sound_bankswitch_w);
DECLARE_DRIVER_INIT(discoboy);
virtual void machine_start() override;
@ -350,17 +352,11 @@ WRITE8_MEMBER(discoboy_state::yunsung8_sound_bankswitch_w)
logerror("%s: Bank %02X\n", machine().describe_context(), data);
}
WRITE8_MEMBER(discoboy_state::yunsung8_adpcm_w)
{
/* Swap the nibbles */
m_adpcm = ((data & 0xf) << 4) | ((data >> 4) & 0xf);
}
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, discoboy_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("sndbank")
AM_RANGE(0xe000, 0xe000) AM_WRITE(yunsung8_sound_bankswitch_w)
AM_RANGE(0xe400, 0xe400) AM_WRITE(yunsung8_adpcm_w)
AM_RANGE(0xe400, 0xe400) AM_DEVWRITE("adpcm_select", ls157_device, ba_w)
AM_RANGE(0xec00, 0xec01) AM_DEVWRITE("ymsnd", ym3812_device, write)
AM_RANGE(0xf000, 0xf7ff) AM_RAM
AM_RANGE(0xf800, 0xf800) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
@ -467,7 +463,6 @@ void discoboy_state::machine_start()
save_item(NAME(m_ram_bank));
save_item(NAME(m_port_00));
save_item(NAME(m_gfxbank));
save_item(NAME(m_adpcm));
save_item(NAME(m_toggle));
}
@ -476,16 +471,17 @@ void discoboy_state::machine_reset()
m_ram_bank = 0;
m_port_00 = 0;
m_gfxbank = 0;
m_adpcm = 0x80;
m_toggle = 0;
m_toggle = false;
}
WRITE_LINE_MEMBER(discoboy_state::yunsung8_adpcm_int)
{
m_msm->data_w(m_adpcm >> 4);
m_adpcm <<= 4;
if (!state)
return;
m_toggle ^= 1;
m_toggle = !m_toggle;
m_adpcm_select->select_w(m_toggle);
m_audiocpu->set_input_line(INPUT_LINE_NMI, m_toggle);
}
static MACHINE_CONFIG_START( discoboy, discoboy_state )
@ -498,8 +494,6 @@ static MACHINE_CONFIG_START( discoboy, discoboy_state )
MCFG_CPU_ADD("audiocpu", Z80, XTAL_10MHz/2) /* 5 MHz? */
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_CPU_PERIODIC_INT_DRIVER(discoboy_state, nmi_line_pulse, 32*60)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@ -523,6 +517,9 @@ static MACHINE_CONFIG_START( discoboy, discoboy_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.6)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.6)
MCFG_DEVICE_ADD("adpcm_select", LS157, 0)
MCFG_74LS157_OUT_CB(DEVWRITE8("msm", msm5205_device, data_w))
MCFG_SOUND_ADD("msm", MSM5205, XTAL_400kHz)
MCFG_MSM5205_VCLK_CB(WRITELINE(discoboy_state, yunsung8_adpcm_int)) /* interrupt function */
MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S96_4B) /* 4KHz, 4 Bits */

View File

@ -169,8 +169,6 @@ TODO:
- bassline imperfect. This is just the square wave output of the 5232 at the moment.
It should go through analog stages.
- properly emulate the 8155 on the sound board.
- implement low-pass filters on the DAC output
- the purpose of the sound PROM is unclear. From the schematics, it seems it
@ -365,6 +363,7 @@ D
#include "cpu/alph8201/alph8201.h"
#include "cpu/i8085/i8085.h"
#include "cpu/m68000/m68000.h"
#include "machine/i8155.h"
#include "machine/nvram.h"
#include "machine/watchdog.h"
#include "sound/ay8910.h"
@ -385,9 +384,10 @@ D
/******************************************************************************/
// Sound
TIMER_CALLBACK_MEMBER(equites_state::equites_nmi_callback)
WRITE_LINE_MEMBER(equites_state::equites_8155_timer_pulse)
{
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
if (!state) // active low
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
}
TIMER_CALLBACK_MEMBER(equites_state::equites_frq_adjuster_callback)
@ -518,12 +518,35 @@ WRITE8_MEMBER(equites_state::equites_dac_latch_w)
equites_update_dac();
}
WRITE8_MEMBER(equites_state::equites_8155_porta_w)
{
m_eq8155_port_a = data;
m_msm->set_output_gain(0, (data >> 4) / 15.0); /* group1 from msm5232 */
m_msm->set_output_gain(1, (data >> 4) / 15.0); /* group1 from msm5232 */
m_msm->set_output_gain(2, (data >> 4) / 15.0); /* group1 from msm5232 */
m_msm->set_output_gain(3, (data >> 4) / 15.0); /* group1 from msm5232 */
m_msm->set_output_gain(4, (data & 0x0f) / 15.0); /* group2 from msm5232 */
m_msm->set_output_gain(5, (data & 0x0f) / 15.0); /* group2 from msm5232 */
m_msm->set_output_gain(6, (data & 0x0f) / 15.0); /* group2 from msm5232 */
m_msm->set_output_gain(7, (data & 0x0f) / 15.0); /* group2 from msm5232 */
}
WRITE8_MEMBER(equites_state::equites_8155_portb_w)
{
m_eq8155_port_b = data;
equites_update_dac();
}
WRITE8_MEMBER(equites_state::equites_8155_portc_w)
{
m_eq8155_port_c = data;
m_msm->set_output_gain(8, (data & 0x0f) / 15.0); /* SOLO 8' from msm5232 */
if (data & 0x20)
m_msm->set_output_gain(9, (data & 0x0f) / 15.0); /* SOLO 16' from msm5232 */
else
m_msm->set_output_gain(9, 0); /* SOLO 16' from msm5232 */
}
WRITE_LINE_MEMBER(equites_state::equites_msm5232_gate)
{
}
@ -555,47 +578,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(equites_state::splndrbt_scanline)
m_maincpu->set_input_line(2, HOLD_LINE);
}
WRITE8_MEMBER(equites_state::equites_8155_w)
{
// FIXME proper 8155 emulation must be implemented
switch( offset )
{
case 0: //logerror( "8155 Command register write %x, timer command = %x, interrupt enable = %x, ports = %x\n", data, (data >> 6) & 3, (data >> 4) & 3, data & 0xf );
if (((data >> 6) & 3) == 3)
m_nmi_timer->adjust(attotime::from_hz(XTAL_6_144MHz/2 / m_timer_count), 0, attotime::from_hz(XTAL_6_144MHz/2 / m_timer_count));
break;
case 1: //logerror( "8155 I/O Port A write %x\n", data );
m_eq8155_port_a = data;
m_msm->set_output_gain(0, (data >> 4) / 15.0); /* group1 from msm5232 */
m_msm->set_output_gain(1, (data >> 4) / 15.0); /* group1 from msm5232 */
m_msm->set_output_gain(2, (data >> 4) / 15.0); /* group1 from msm5232 */
m_msm->set_output_gain(3, (data >> 4) / 15.0); /* group1 from msm5232 */
m_msm->set_output_gain(4, (data & 0x0f) / 15.0); /* group2 from msm5232 */
m_msm->set_output_gain(5, (data & 0x0f) / 15.0); /* group2 from msm5232 */
m_msm->set_output_gain(6, (data & 0x0f) / 15.0); /* group2 from msm5232 */
m_msm->set_output_gain(7, (data & 0x0f) / 15.0); /* group2 from msm5232 */
break;
case 2: //logerror( "8155 I/O Port B write %x\n", data );
equites_8155_portb_w(space, 0, data);
break;
case 3: //logerror( "8155 I/O Port C (or control) write %x\n", data );
m_eq8155_port_c = data;
m_msm->set_output_gain(8, (data & 0x0f) / 15.0); /* SOLO 8' from msm5232 */
if (data & 0x20)
m_msm->set_output_gain(9, (data & 0x0f) / 15.0); /* SOLO 16' from msm5232 */
else
m_msm->set_output_gain(9, 0); /* SOLO 16' from msm5232 */
break;
case 4: //logerror( "8155 Timer low 8 bits write %x\n", data );
m_timer_count = (m_timer_count & 0xff00) | data;
break;
case 5: //logerror( "8155 Timer high 6 bits write %x, timer mode %x\n", data & 0x3f, (data >> 6) & 3);
m_timer_count = (m_timer_count & 0x00ff) | ((data & 0x3f) << 8);
break;
}
}
/******************************************************************************/
@ -717,11 +699,11 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, equites_state )
AM_RANGE(0xc0d0, 0xc0d0) AM_WRITE(equites_dac_latch_w) // followed by 1 (and usually 0) on 8155 port B
AM_RANGE(0xc0e0, 0xc0e0) AM_WRITE(equites_dac_latch_w) // followed by 2 (and usually 0) on 8155 port B
AM_RANGE(0xc0f8, 0xc0ff) AM_WRITE(equites_c0f8_w)
AM_RANGE(0xe000, 0xe0ff) AM_RAM
AM_RANGE(0xe000, 0xe0ff) AM_DEVREADWRITE("audio8155", i8155_device, memory_r, memory_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, equites_state )
AM_RANGE(0x00e0, 0x00e5) AM_WRITE(equites_8155_w)
AM_RANGE(0x00e0, 0x00e7) AM_DEVREADWRITE("audio8155", i8155_device, io_r, io_w)
ADDRESS_MAP_END
@ -1056,6 +1038,12 @@ static MACHINE_CONFIG_FRAGMENT( common_sound )
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_CPU_IO_MAP(sound_portmap)
MCFG_DEVICE_ADD("audio8155", I8155, XTAL_6_144MHz/2)
MCFG_I8155_OUT_PORTA_CB(WRITE8(equites_state, equites_8155_porta_w))
MCFG_I8155_OUT_PORTB_CB(WRITE8(equites_state, equites_8155_portb_w))
MCFG_I8155_OUT_PORTC_CB(WRITE8(equites_state, equites_8155_portc_w))
MCFG_I8155_OUT_TIMEROUT_CB(WRITELINE(equites_state, equites_8155_timer_pulse))
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("speaker")
@ -1133,8 +1121,6 @@ void equites_state::machine_start()
save_item(NAME(m_timer_count));
save_item(NAME(m_gekisou_unknown_bit));
m_nmi_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(equites_state::equites_nmi_callback), this));
m_adjuster_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(equites_state::equites_frq_adjuster_callback), this));
m_adjuster_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60));
}

View File

@ -491,7 +491,8 @@ void cps_state::fcrash_render_sprites( screen_device &screen, bitmap_ind16 &bitm
int num_sprites = m_gfxdecode->gfx(2)->elements();
int last_sprite_offset = 0x1ffc;
uint16_t *sprite_ram = m_gfxram;
uint16_t tileno,flipx,flipy,colour,xpos,ypos;
uint16_t tileno,colour,xpos,ypos;
bool flipx, flipy;
/* if we have separate sprite ram, use it */
if (m_bootleg_sprite_ram) sprite_ram = m_bootleg_sprite_ram.get();
@ -509,13 +510,16 @@ void cps_state::fcrash_render_sprites( screen_device &screen, bitmap_ind16 &bitm
if (tileno >= num_sprites) continue; /* don't render anything outside our tiles */
xpos = sprite_ram[base + pos + 2] & 0x1ff;
ypos = sprite_ram[base + pos - 1] & 0x1ff;
flipx = sprite_ram[base + pos + 1] & 0x20;
flipy = sprite_ram[base + pos + 1] & 0x40;
flipx = BIT(sprite_ram[base + pos + 1], 5);
flipy = BIT(sprite_ram[base + pos + 1], 6);
colour = sprite_ram[base + pos + 1] & 0x1f;
ypos = 256 - ypos - 16;
xpos = xpos + m_sprite_x_offset + 49;
m_gfxdecode->gfx(2)->prio_transpen(bitmap,cliprect, tileno, colour, flipx, flipy, xpos, ypos, screen.priority(), 0x02, 15);
if (flip_screen())
m_gfxdecode->gfx(2)->prio_transpen(bitmap, cliprect, tileno, colour, !flipx, !flipy, 512-16-xpos, 256-16-ypos, screen.priority(), 2, 15);
else
m_gfxdecode->gfx(2)->prio_transpen(bitmap, cliprect, tileno, colour, flipx, flipy, xpos, ypos, screen.priority(), 2, 15);
}
}
}

View File

@ -1801,6 +1801,13 @@ static MACHINE_CONFIG_START( fdes2100d, fidel6502_state )
MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( fdes2000d, fdes2100d )
/* basic machine hardware */
MCFG_CPU_REPLACE("maincpu", R65C02, XTAL_3MHz) // R65C02P3
MCFG_CPU_PROGRAM_MAP(fdesdis_map)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( chesster, fidel6502_state )
/* basic machine hardware */
@ -2129,7 +2136,7 @@ ROM_START( fscc12 )
ROM_END
ROM_START( fexcel ) // PCB label 510.1117A02
ROM_START( fexcel ) // model 6080(B), PCB label 510.1117A02
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD("101-1080a01.ic5", 0x8000, 0x8000, CRC(846f8e40) SHA1(4e1d5b08d5ff3422192b54fa82cb3f505a69a971) ) // same as fexcelv
ROM_END
@ -2144,12 +2151,12 @@ ROM_START( fexcelv ) // model 6092, PCB label 510.1117A02, sound PCB 510.1117A01
ROM_LOAD("101-1081a01.ic2", 0x0000, 0x8000, CRC(c8ae1607) SHA1(6491ce6be60ed77f3dd931c0ca17616f13af943e) ) // PCB2, M27256
ROM_END
ROM_START( fexcela ) // PCB label 510-1099A01
ROM_START( fexcela ) // model 6080, PCB label 510-1099A01(manuf.1985) or 510-1099B01(manuf.1986)
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD("101-1072a01.ic5", 0xc000, 0x4000, CRC(212b006d) SHA1(242ff851b0841cbec66bbada6a730da021010e2c) )
ROM_END
ROM_START( fexcelb ) // PCB label 510-1099A01
ROM_START( fexcelb ) // model EP12, PCB label 510-1099A01
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD("101-1072b01.ic5", 0xc000, 0x4000, CRC(fd2f6064) SHA1(f84bb98bdb9565a04891eb6820597d7aecc90c21) ) // RCA
ROM_END
@ -2173,6 +2180,13 @@ ROM_START( fdes2100d ) // model 6106, PCB label 510.1130A01. The 'rev B' dump ca
ROM_LOAD("bk3_white.ic10", 0x0000, 0x8000, CRC(3857cc35) SHA1(f073dafb9fd885c7ddb7fbff10e3653f343ef1c6) ) // WSI 27C256L-12
ROM_END
ROM_START( fdes2000d ) // model 6105, PCB label 510.1130A01
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD("27c256.ic9", 0x8000, 0x8000, CRC(b136d1a1) SHA1(8438790a62f45284ff33a0255c5c89f526726d3e) ) // 27C256, no label
ROM_REGION( 0x8000, "user1", ROMREGION_ERASEFF ) // no rom in ic10
ROM_END
ROM_START( chesster ) // model 6120, PCB label 510.1141C01
ROM_REGION( 0x10000, "maincpu", 0 )
@ -2226,10 +2240,11 @@ CONS( 1987, fexcelv, fexcel, 0, fexcelv, fexcelv, driver_device, 0
CONS( 1987, fexceld, fexcel, 0, fexceld, fexcelb, driver_device, 0, "Fidelity Electronics", "Excel Display", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
CONS( 1985, fexcela, fexcel, 0, fexcel, fexcel, driver_device, 0, "Fidelity Electronics", "The Excellence (model EP12)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 1st version of The Excellence
CONS( 1985, fexcelb, fexcel, 0, fexcel, fexcel, driver_device, 0, "Fidelity Electronics", "The Excellence (model 6080)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
CONS( 1986, fexcelp, 0, 0, fexcelp, fexcel, driver_device, 0, "Fidelity Electronics", "The Par Excellence", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
CONS( 1986, fexcelp, fexcel, 0, fexcelp, fexcel, driver_device, 0, "Fidelity Electronics", "The Par Excellence", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
CONS( 1989, fdes2000, 0, 0, fdes2000, fdes, driver_device, 0, "Fidelity Electronics", "Designer 2000", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // Excellence series hardware
CONS( 1988, fdes2100d, 0, 0, fdes2100d, fdesdis, fidel6502_state, fdesdis, "Fidelity Electronics", "Designer 2100 Display (rev. B)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
CONS( 1988, fdes2000d, fdes2100d,0, fdes2000d, fdesdis, fidel6502_state, fdesdis, "Fidelity Electronics", "Designer 2000 Display", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
CONS( 1990, chesster, 0, 0, chesster, chesster, fidel6502_state, chesster, "Fidelity Electronics", "Chesster Challenger", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

View File

@ -774,7 +774,7 @@ static MACHINE_CONFIG_START( shadoww, gaiden_state )
MCFG_TECMO_MIXER_SHIFTS(10,9,4)
MCFG_TECMO_MIXER_BLENDCOLS( 0x0400 + 0x300, 0x0400 + 0x200, 0x0400 + 0x100, 0x0400 + 0x000 )
MCFG_TECMO_MIXER_REGULARCOLS( 0x0000 + 0x300, 0x0000 + 0x200, 0x0000 + 0x100, 0x0000 + 0x000 )
MCFG_TECMO_MIXER_BLENDSOUCE( 0x0800 + 0x000, 0x0800 + 0x200)
MCFG_TECMO_MIXER_BLENDSOURCE( 0x0800 + 0x000, 0x0800 + 0x200)
MCFG_TECMO_MIXER_REVSPRITETILE
MCFG_TECMO_MIXER_BGPEN(0x000 + 0x200)

View File

@ -31,7 +31,6 @@ Additional CD-ROM games: "99 Bottles of Beer"
#include "emu.h"
#include "cpu/i386/i386.h"
#include "machine/cr589.h"
//#include "machine/i82371sb.h"
//#include "machine/i82439tx.h"
#include "machine/lpci.h"

View File

@ -77,7 +77,7 @@ Custom: EXCELLENT SYSTEM ES-9208 347102 (QFP160)
* Denotes unpopulated components
NOTE: Mask roms from Power Flipper Shooting Pinball have not been dumped, but assumed to
NOTE: Mask roms from Power Flipper Pinball Shooting have not been dumped, but assumed to
be the same data.
***************************************************************************/

View File

@ -78,8 +78,9 @@ PCB board that connects to 044 boards via J6 & J7
Adds the abillity to use legacy 038 EPROM based software
or 039 EPROM + SIMM software
More chips (from eBay auction):
2x Phillips / NXT 28C94 quad UART (8 serial channels total)
ADV476 256 color RAMDAC
*/
#include "emu.h"
@ -90,9 +91,12 @@ class igt_gameking_state : public driver_device
{
public:
igt_gameking_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
: driver_device(mconfig, type, tag),
m_palette(*this, "palette")
{ }
required_device<palette_device> m_palette;
virtual void video_start() override;
uint32_t screen_update_igt_gameking(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@ -101,7 +105,7 @@ public:
DECLARE_READ32_MEMBER(igt_gk_28010008_r)
{
return rand();
return rand(); // don't quite understand this one
};
DECLARE_READ32_MEMBER(igt_gk_28030000_r)
@ -109,13 +113,57 @@ public:
return rand();
};
DECLARE_READ32_MEMBER(uart_status_r);
DECLARE_WRITE32_MEMBER(uart_w);
DECLARE_WRITE32_MEMBER(clut_w);
DECLARE_WRITE32_MEMBER(clut_mask_w);
private:
int m_offset, m_r, m_g, m_b, m_state;
bool m_bToggle;
u8 m_clut_mask;
};
static INPUT_PORTS_START( igt_gameking )
INPUT_PORTS_END
WRITE32_MEMBER(igt_gameking_state::clut_w)
{
if (mem_mask == 0x000000ff)
{
m_offset = data & 0xff;
m_state = 0;
}
else if (mem_mask == 0x00ff0000)
{
switch (m_state)
{
case 0: m_r = (data>>16) & 0xff; m_state++; break;
case 1: m_g = (data>>16) & 0xff; m_state++; break;
case 2:
m_b = (data>>16) & 0xff;
//printf("CLUT: color %d = R %d G %d B %d\n", m_offset, m_r, m_g, m_b);
m_palette->set_pen_color(m_offset, m_r<<18 | m_g<<10 | m_b<<2);
m_state = 0;
break;
}
}
}
WRITE32_MEMBER(igt_gameking_state::clut_mask_w)
{
m_clut_mask = data & 0xff;
}
READ32_MEMBER(igt_gameking_state::uart_status_r)
{
return 0x00040000;
}
WRITE32_MEMBER(igt_gameking_state::uart_w)
{
printf("%c", (data>>16) & 0x7f);
}
void igt_gameking_state::machine_start()
{
@ -123,6 +171,9 @@ void igt_gameking_state::machine_start()
void igt_gameking_state::machine_reset()
{
m_bToggle = false;
m_offset = m_state = m_r = m_g = m_b = 0;
m_clut_mask = 0xff;
}
void igt_gameking_state::video_start()
@ -140,14 +191,22 @@ static ADDRESS_MAP_START( igt_gameking_mem, AS_PROGRAM, 32, igt_gameking_state )
AM_RANGE(0x00000000, 0x0007ffff) AM_ROM
AM_RANGE(0x08000000, 0x081fffff) AM_ROM AM_REGION("game", 0)
AM_RANGE(0x10000000, 0x1000001f) AM_RAM
AM_RANGE(0x10000020, 0x1000021f) AM_RAM // strange range to test, correct or CPU issue?
AM_RANGE(0x10000220, 0x1003ffff) AM_RAM
AM_RANGE(0x10000000, 0x10ffffff) AM_RAM
AM_RANGE(0x18000000, 0x181fffff) AM_RAM // igtsc writes from 18000000 to 1817ffff, ms3 all the way to 181fffff.
// 28010000-2801007f: first 28C94 QUART
AM_RANGE(0x28010008, 0x2801000b) AM_READ(igt_gk_28010008_r)
AM_RANGE(0x28010030, 0x28010033) AM_READ(uart_status_r) // channel D
AM_RANGE(0x28010034, 0x28010037) AM_WRITE(uart_w) // channel D
// 28020000-2802007f: second 28C94 QUART
AM_RANGE(0x28030000, 0x28030003) AM_READ(igt_gk_28030000_r)
AM_RANGE(0x28040000, 0x2804ffff) AM_RAM
AM_RANGE(0x28050000, 0x28050003) AM_DEVREADWRITE8("ymz", ymz280b_device, read, write, 0x00ff00ff)
AM_RANGE(0x28060000, 0x28060003) AM_WRITE(clut_w)
AM_RANGE(0x28060004, 0x28060007) AM_WRITE(clut_mask_w)
AM_RANGE(0xa1000000, 0xa1011fff) AM_RAM // used by gkkey for restart IAC
ADDRESS_MAP_END
@ -198,6 +257,25 @@ static MACHINE_CONFIG_START( igt_gameking, igt_gameking_state )
MACHINE_CONFIG_END
ROM_START( ms3 )
ROM_REGION( 0x80000, "maincpu", 0 )
ROM_LOAD( "3b5060ax.u8", 0x000000, 0x080000, CRC(aff8d874) SHA1(1cb972759ee12c944a1cfdbe68848c9b2e64a4d3) )
ROM_REGION32_LE( 0x200000, "game", 0 )
ROM_LOAD16_BYTE( "ea5006ax.u21", 0x000000, 0x080000, CRC(9109b2e2) SHA1(daa1f01315caf6e08c3cf8b0e4925c86d2cd8dc3) )
ROM_LOAD16_BYTE( "ea5006ax.u5", 0x000001, 0x080000, CRC(66c33cf6) SHA1(600f75ab112348f43b38cafd6f871559372f2807) )
ROM_REGION( 0x100000, "cg", 0 )
ROM_LOAD16_BYTE( "1g5032ax.u48", 0x000000, 0x040000, CRC(aba6002f) SHA1(2ed51aa8bbc1e703cd63f633d745dfa4fa7f3dd0) )
ROM_LOAD16_BYTE( "1g5032ax.u47", 0x000001, 0x040000, CRC(605a71ec) SHA1(13fe64c611c0903a7b79d8680de3ac81f3226a67) )
ROM_REGION( 0x200000, "plx", 0 )
ROM_LOAD16_BYTE( "1g5032ax.u20", 0x000000, 0x100000, CRC(517e7478) SHA1(316a8e48ad6502f9508b06f900555d53ef40b464) )
ROM_LOAD16_BYTE( "1g5032ax.u4", 0x000001, 0x100000, CRC(e67c878f) SHA1(b03f8d28924351e96bb9f24d32f0e4a40a51910c) )
ROM_REGION( 0x200000, "snd", 0 )
ROM_LOAD( "1h5053xx.u6", 0x000000, 0x080000, CRC(6735c65a) SHA1(198cacec5441aa615c0de63a0b4e47265636bcee) )
ROM_END
ROM_START( ms72c )
ROM_REGION( 0x80000, "maincpu", 0 )
@ -389,7 +467,7 @@ ROM_START( gkkey )
ROM_REGION( 0x200000, "snd", ROMREGION_ERASEFF )
ROM_END
GAME( 1994, ms3, 0, igt_gameking, igt_gameking, driver_device, 0, ROT0, "IGT", "Multistar 3", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
GAME( 1994, ms72c, 0, igt_gameking, igt_gameking, driver_device, 0, ROT0, "IGT", "Multistar 7 2c", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
GAME( 2003, gkigt4, 0, igt_gameking, igt_gameking, driver_device, 0, ROT0, "IGT", "Game King (v4.x)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
GAME( 2003, gkigt4ms, gkigt4, igt_gameking, igt_gameking, driver_device, 0, ROT0, "IGT", "Game King (v4.x, MS)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )

View File

@ -337,7 +337,7 @@ MACHINE_CONFIG_END
ROM_START( wildfire )
ROM_REGION( 0x0800, "maincpu", ROMREGION_ERASE00 )
ROM_LOAD( "us4341385", 0x0000, 0x0400, CRC(84ac0f1f) SHA1(1e00ddd402acfc2cc267c34eed4b89d863e2144f) ) // from patent US4334679, data should be correct (it included checksums)
ROM_LOAD( "us4341385", 0x0000, 0x0400, CRC(84ac0f1f) SHA1(1e00ddd402acfc2cc267c34eed4b89d863e2144f) ) // from patent US4334679, data should be correct (it included checksums). 1st half was dumped/verfied too.
ROM_CONTINUE( 0x0600, 0x0200 )
ROM_END

View File

@ -2139,8 +2139,8 @@ ROM_END
ROM_START( pairs ) /* Version 1.2 (3-tier board set: P/N 1059 Rev 3, P/N 1061 Rev 1 & P/N 1060 Rev 0) */
ROM_REGION16_BE( 0x80000, "user1", 0 )
ROM_LOAD16_BYTE( "pair0_u83_v1.2.u83", 0x00000, 0x20000, CRC(a9c761d8) SHA1(2618c9c3f336cf30f760fd88f12c09985cfd4ee7) )
ROM_LOAD16_BYTE( "pair1_u88_v1.2.u88", 0x00001, 0x20000, CRC(5141eb86) SHA1(3bb10d588e6334a33e5c2c468651699e84f46cdc) )
ROM_LOAD16_BYTE( "pair0_u83_x_v1.2.u83", 0x00000, 0x20000, CRC(a9c761d8) SHA1(2618c9c3f336cf30f760fd88f12c09985cfd4ee7) )
ROM_LOAD16_BYTE( "pair1_u88_x_v1.2.u88", 0x00001, 0x20000, CRC(5141eb86) SHA1(3bb10d588e6334a33e5c2c468651699e84f46cdc) )
ROM_REGION( 0x28000, "soundcpu", 0 )
ROM_LOAD( "pairsnd_u17_v1.u17", 0x10000, 0x18000, CRC(7a514cfd) SHA1(ef5bc74c9560d2c058298051070fa748e58f07e1) )

View File

@ -6,6 +6,7 @@
// http://www.eevblog.com/forum/blog/eevblog-949-vintage-australian-made-laptop-teardown/msg1080508/#msg1080508
#include "emu.h"
#include "rendlay.h"
#include "cpu/i86/i186.h"
#include "machine/cdp1879.h"
#include "sound/beep.h"
@ -151,6 +152,8 @@ static MACHINE_CONFIG_START( magnum, magnum_state )
MCFG_SCREEN_SIZE(6*80, 9*16)
MCFG_SCREEN_VISIBLE_AREA(0, 6*80-1, 0, 9*16-1)
MCFG_DEFAULT_LAYOUT(layout_lcd)
MCFG_PALETTE_ADD_MONOCHROME("palette")
MCFG_SPEAKER_STANDARD_MONO("speaker")

View File

@ -1796,22 +1796,22 @@ DRIVER_INIT_MEMBER(polgar_state,polgar)
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */
CONS( 1986, polgar, 0, 0, polgar, polgar, polgar_state, polgar, "Hegener & Glaser", "Mephisto Polgar Schachcomputer", MACHINE_NOT_WORKING | MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK)
CONS( 1987, sfortea, 0, 0, sfortea, sfortea, driver_device, 0, "Novag", "Novag Super Forte Chess Computer (version A)", MACHINE_NO_SOUND|MACHINE_NOT_WORKING|MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1987, sfortea, 0, 0, sfortea, sfortea, driver_device, 0, "Novag", "Novag Super Forte Chess Computer (version A)", MACHINE_NO_SOUND|MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1988, alm16, van16, 0, alm16, van16, driver_device, 0, "Hegener & Glaser Muenchen", "Mephisto Almeria 68000", MACHINE_NOT_WORKING|MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK )
CONS( 1988, alm32, van16, 0, alm32, van32, driver_device, 0, "Hegener & Glaser Muenchen", "Mephisto Alimera 68020", MACHINE_NOT_WORKING|MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK )
CONS( 1988, sforteb, sfortea, 0, sfortea, sfortea, driver_device, 0, "Novag", "Novag Super Forte Chess Computer (version B)", MACHINE_NO_SOUND|MACHINE_NOT_WORKING|MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1988, sforteba, sfortea, 0, sfortea, sfortea, driver_device, 0, "Novag", "Novag Super Forte Chess Computer (version B, alt)", MACHINE_NO_SOUND|MACHINE_NOT_WORKING|MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1988, sexpertb, sfortea, 0, sfortea, sfortea, driver_device, 0, "Novag", "Novag Super Expert B Chess Computer", MACHINE_NO_SOUND|MACHINE_NOT_WORKING|MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1988, sforteb, sfortea, 0, sfortea, sfortea, driver_device, 0, "Novag", "Novag Super Forte Chess Computer (version B)", MACHINE_NO_SOUND|MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1988, sforteba, sfortea, 0, sfortea, sfortea, driver_device, 0, "Novag", "Novag Super Forte Chess Computer (version B, alt)", MACHINE_NO_SOUND|MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1988, sexpertb, sfortea, 0, sfortea, sfortea, driver_device, 0, "Novag", "Novag Super Expert B Chess Computer", MACHINE_NO_SOUND|MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1989, academy, 0, 0, academy, academy, driver_device, 0, "Hegener & Glaser", "Mephisto Academy Schachcomputer", MACHINE_REQUIRES_ARTWORK|MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1989, megaiv, 0, 0, megaiv, megaiv, driver_device, 0, "Hegener & Glaser", "Mephisto Mega IV Schachcomputer", MACHINE_NOT_WORKING|MACHINE_NOT_WORKING|MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK )
CONS( 1989, megaiv, 0, 0, megaiv, megaiv, driver_device, 0, "Hegener & Glaser", "Mephisto Mega IV Schachcomputer", MACHINE_NOT_WORKING|MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK )
CONS( 1989, milano, polgar, 0, milano, polgar, polgar_state, polgar, "Hegener & Glaser", "Mephisto Milano Schachcomputer", MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK )
//CONS( 1989, montec4, 0, 0, monteciv, monteciv, driver_device, 0, "Hegener & Glaser", "Mephisto Monte Carlo IV", MACHINE_NOT_WORKING|MACHINE_NOT_WORKING|MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK )
CONS( 1989, sfortec, sfortea, 0, sfortea, sfortea, driver_device, 0, "Novag", "Novag Super Forte Chess Computer (version C)", MACHINE_NO_SOUND|MACHINE_NOT_WORKING|MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1989, sexpertc, sfortea, 0, sfortea, sfortea, driver_device, 0, "Novag", "Novag Super Expert C Chess Computer", MACHINE_NO_SOUND|MACHINE_NOT_WORKING|MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
//CONS( 1989, montec4, 0, 0, monteciv, monteciv, driver_device, 0, "Hegener & Glaser", "Mephisto Monte Carlo IV", MACHINE_NOT_WORKING|MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK )
CONS( 1989, sfortec, sfortea, 0, sfortea, sfortea, driver_device, 0, "Novag", "Novag Super Forte Chess Computer (version C)", MACHINE_NO_SOUND|MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1989, sexpertc, sfortea, 0, sfortea, sfortea, driver_device, 0, "Novag", "Novag Super Expert C Chess Computer", MACHINE_NO_SOUND|MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1990, lyon16, van16, 0, alm16, van16, driver_device, 0, "Hegener & Glaser Muenchen", "Mephisto Lyon 68000", MACHINE_NOT_WORKING|MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK )
CONS( 1990, lyon32, van16, 0, alm32, van32, driver_device, 0, "Hegener & Glaser Muenchen", "Mephisto Lyon 68020", MACHINE_NOT_WORKING|MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK )
CONS( 1990, monteciv, 0, 0, monteciv, monteciv, driver_device, 0, "Hegener & Glaser", "Mephisto Monte Carlo IV LE Schachcomputer", MACHINE_NOT_WORKING|MACHINE_NOT_WORKING|MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK )
CONS( 1991, diablo68, 0, 0, diablo68, sfortea, driver_device, 0, "Novag", "Novag Diablo 68000 Chess Computer", MACHINE_NO_SOUND|MACHINE_NOT_WORKING|MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1990, monteciv, 0, 0, monteciv, monteciv, driver_device, 0, "Hegener & Glaser", "Mephisto Monte Carlo IV LE Schachcomputer", MACHINE_NOT_WORKING|MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK )
CONS( 1991, diablo68, 0, 0, diablo68, sfortea, driver_device, 0, "Novag", "Novag Diablo 68000 Chess Computer", MACHINE_NO_SOUND|MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1991, van16, 0, 0, van16, van16, driver_device, 0, "Hegener & Glaser Muenchen", "Mephisto Vancouver 68000", MACHINE_NOT_WORKING|MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK )
CONS( 1991, van32, van16, 0, van32, van32, driver_device, 0, "Hegener & Glaser Muenchen", "Mephisto Vancouver 68020", MACHINE_NOT_WORKING|MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK )
CONS( 1993, gen32, van16, 0, gen32, gen32, driver_device, 0, "Hegener & Glaser Muenchen", "Mephisto Genius030 V4.00", MACHINE_NOT_WORKING|MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK )

View File

@ -92,25 +92,25 @@ static INPUT_PORTS_START( mustache )
PORT_BIT( 0xf9, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("DSWA")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW 2:!1")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW 2:1")
PORT_DIPSETTING( 0x01, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
PORT_DIPNAME( 0x06, 0x04, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW 2:!2,!3")
PORT_DIPNAME( 0x06, 0x04, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW 2:2,3")
PORT_DIPSETTING( 0x06, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x04, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x02, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
PORT_DIPNAME( 0x18, 0x18, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW 2:!4,!5")
PORT_DIPNAME( 0x18, 0x18, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW 2:4,5")
PORT_DIPSETTING( 0x10, "1" )
PORT_DIPSETTING( 0x18, "3" )
PORT_DIPSETTING( 0x08, "4" )
PORT_DIPSETTING( 0x00, "5" )
PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW 2:!6")
PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW 2:6")
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("DSWB")
PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW 1:!1,!2,!3")
PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW 1:1,2,3")
PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) )
@ -119,16 +119,18 @@ static INPUT_PORTS_START( mustache )
PORT_DIPSETTING( 0x03, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x01, DEF_STR( 1C_5C ) )
PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW 1:!4,!5")
PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW 1:4,5")
PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x18, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) )
PORT_SERVICE( 0x20, IP_ACTIVE_LOW ) PORT_DIPLOCATION("SW 1:!6")
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW 1:!7")
PORT_SERVICE( 0x20, IP_ACTIVE_LOW ) PORT_DIPLOCATION("SW 1:6")
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW 1:7")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
// There is an 8th dipswitch here, which controls screen flip, but the operator sheet implies it does it via hardware, i.e. not readable by cpu. May need further investigation.
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW 1:8")
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END

View File

@ -8730,7 +8730,7 @@ GAME( 1998, rbff2, neogeo, neobase, neogeo, neogeo_state, neogeo, R
GAME( 1998, rbff2h, rbff2, neobase, neogeo, neogeo_state, neogeo, ROT0, "SNK", "Real Bout Fatal Fury 2 - The Newcomers / Real Bout Garou Densetsu 2 - The Newcomers (NGH-2400)", MACHINE_SUPPORTS_SAVE )
GAME( 1998, rbff2k, rbff2, neobase, neogeo, neogeo_state, neogeo, ROT0, "SNK", "Real Bout Fatal Fury 2 - The Newcomers (Korean release)", MACHINE_SUPPORTS_SAVE ) // no Japanese title / mode
GAME( 1998, mslug2, neogeo, neobase, neogeo, neogeo_state, neogeo, ROT0, "SNK", "Metal Slug 2 - Super Vehicle-001/II (NGM-2410 ~ NGH-2410)", MACHINE_SUPPORTS_SAVE )
GAME( 2015, mslug2t, mslug2, neobase, neogeo, neogeo_state, neogeo, ROT0, "Hack", "Metal Slug 2 Turbo (NGM-9410)", MACHINE_SUPPORTS_SAVE )
GAME( 2015, mslug2t, mslug2, neobase, neogeo, neogeo_state, neogeo, ROT0, "hack (trap15)", "Metal Slug 2 Turbo (NGM-9410) (hack)", MACHINE_SUPPORTS_SAVE )
GAME( 1998, kof98, neogeo, kof98, neogeo, neogeo_state, neogeo, ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - Dream Match Never Ends (NGM-2420)", MACHINE_SUPPORTS_SAVE )
GAME( 1998, kof98a, kof98, kof98, neogeo, neogeo_state, neogeo, ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - Dream Match Never Ends (NGM-2420, alt board)", MACHINE_SUPPORTS_SAVE )
GAME( 1998, kof98k, kof98, kof98, neogeo, neogeo_state, neogeo, ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - Dream Match Never Ends (Korean board)", MACHINE_SUPPORTS_SAVE )

View File

@ -105,7 +105,10 @@ public:
m_maincpu(*this, "maincpu"),
m_vram(*this, "framebuffer"),
m_vram16(*this, "framebuffer16"),
m_fontram(*this, "charcopy")
m_fontram(*this, "charcopy"),
m_fdc(*this, "fdc"),
m_floppy0(*this, "fdc:0"),
m_floppy1(*this, "fdc:1")
{ }
MC6845_UPDATE_ROW(crtc_update_row);
@ -122,6 +125,8 @@ public:
DECLARE_READ8_MEMBER(f9f78_r);
DECLARE_WRITE8_MEMBER(f9f78_w);
DECLARE_WRITE8_MEMBER(f9f79_w);
DECLARE_WRITE_LINE_MEMBER(fdc_drq_w);
DECLARE_WRITE_LINE_MEMBER(fdc_intrq_w);
private:
virtual void machine_reset() override;
@ -130,6 +135,9 @@ private:
optional_shared_ptr<uint8_t> m_vram;
optional_shared_ptr<uint16_t> m_vram16;
optional_shared_ptr<uint8_t> m_fontram;
required_device<fd1797_t> m_fdc;
required_device<floppy_connector> m_floppy0;
optional_device<floppy_connector> m_floppy1;
};
//**************************************************************************
@ -147,7 +155,7 @@ static ADDRESS_MAP_START(pg675_mem, AS_PROGRAM, 8, pg685_state)
AM_RANGE(0xf9f06, 0xf9f07) AM_DEVREADWRITE("mainpic", pic8259_device, read, write)
AM_RANGE(0xf9f08, 0xf9f08) AM_DEVREADWRITE("mainuart", i8251_device, data_r, data_w)
AM_RANGE(0xf9f09, 0xf9f09) AM_DEVREADWRITE("mainuart", i8251_device, status_r, control_w)
AM_RANGE(0xf9f20, 0xf9f23) AM_DEVREADWRITE("fdc", wd2797_t, read, write)
AM_RANGE(0xf9f20, 0xf9f23) AM_DEVREADWRITE("fdc", fd1797_t, read, write)
AM_RANGE(0xf9f24, 0xf9f24) AM_READWRITE(f9f24_r, f9f24_w)
AM_RANGE(0xf9f28, 0xf9f2b) AM_DEVREADWRITE("modppi1", i8255_device, read, write)
AM_RANGE(0xf9f2c, 0xf9f2f) AM_DEVREADWRITE("modppi2", i8255_device, read, write)
@ -183,7 +191,7 @@ static ADDRESS_MAP_START(pg685oua12_mem, AS_PROGRAM, 16, pg685_state)
AM_RANGE(0xf9f06, 0xf9f07) AM_DEVREADWRITE8("mainpic", pic8259_device, read, write, 0xffff)
AM_RANGE(0xf9f08, 0xf9f09) AM_DEVREADWRITE8("mainuart", i8251_device, data_r, data_w, 0x00ff)
AM_RANGE(0xf9f08, 0xf9f09) AM_DEVREADWRITE8("mainuart", i8251_device, status_r, control_w, 0xff00)
AM_RANGE(0xf9f20, 0xf9f23) AM_DEVREADWRITE8("fdc", wd2797_t, read, write, 0xffff)
AM_RANGE(0xf9f20, 0xf9f23) AM_DEVREADWRITE8("fdc", fd1797_t, read, write, 0xffff)
AM_RANGE(0xf9f24, 0xf9f25) AM_READWRITE8(f9f24_r, f9f24_w, 0x00ff)
AM_RANGE(0xf9f28, 0xf9f2b) AM_DEVREADWRITE8("modppi1", i8255_device, read, write, 0xffff)
AM_RANGE(0xf9f2c, 0xf9f2f) AM_DEVREADWRITE8("modppi2", i8255_device, read, write, 0xffff)
@ -256,6 +264,15 @@ READ8_MEMBER(pg685_state::f9f3f_r)
// FLOPPY
//**************************************************************************
static SLOT_INTERFACE_START( pg675_floppies )
SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
SLOT_INTERFACE_END
static SLOT_INTERFACE_START( pg685_floppies )
SLOT_INTERFACE( "525qd", FLOPPY_525_QD )
SLOT_INTERFACE_END
READ8_MEMBER(pg685_state::f9f24_r)
{
logerror("Reading from F9F24\n");
@ -267,6 +284,7 @@ WRITE8_MEMBER(pg685_state::f9f24_w)
logerror("Writing %02X to F9F24\n", data);
}
//**************************************************************************
// HARDDISK
//**************************************************************************
@ -370,7 +388,7 @@ static MACHINE_CONFIG_FRAGMENT(pg685_backplane)
MACHINE_CONFIG_END
static MACHINE_CONFIG_FRAGMENT(pg685_module)
MCFG_DEVICE_ADD("fdc", WD2797, XTAL_4MHz / 2) // divider guessed
MCFG_DEVICE_ADD("fdc", FD1797, XTAL_4MHz / 2) // divider guessed
MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE("mainpic", pic8259_device, ir4_w))
MCFG_DEVICE_ADD("modppi1", I8255, 0)
@ -379,6 +397,7 @@ static MACHINE_CONFIG_FRAGMENT(pg685_module)
MCFG_DEVICE_ADD("moduart", I8251, XTAL_4MHz / 2) // divider guessed
MCFG_DEVICE_ADD("rtc", MM58167, XTAL_32_768kHz)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( pg675, pg685_state )
@ -419,6 +438,12 @@ static MACHINE_CONFIG_START( pg675, pg685_state )
// printer
// floppy
// MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(zorba_state, fdc_intrq_w))
// MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(zorba_state, fdc_drq_w))
MCFG_FLOPPY_DRIVE_ADD("fdc:0", pg675_floppies, "525dd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", pg675_floppies, "525dd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_SOUND(true)
MACHINE_CONFIG_END
@ -462,6 +487,10 @@ static MACHINE_CONFIG_START( pg685, pg685_state )
// floppy
// MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(zorba_state, fdc_drq_w))
MCFG_FLOPPY_DRIVE_ADD("fdc:0", pg685_floppies, "525qd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_SOUND(true)
// harddisk
MCFG_DEVICE_ADD("hdc", WD2010, XTAL_10MHz / 2) // divider guessed
MCFG_WD2010_OUT_INTRQ_CB(DEVWRITELINE("mainpic", pic8259_device, ir3_w))
@ -507,6 +536,10 @@ static MACHINE_CONFIG_START( pg685oua12, pg685_state )
// floppy
// MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(zorba_state, fdc_drq_w))
MCFG_FLOPPY_DRIVE_ADD("fdc:0", pg685_floppies, "525qd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_SOUND(true)
// harddisk
MCFG_DEVICE_ADD("hdc", WD2010, XTAL_10MHz / 2) // divider guessed
MCFG_WD2010_OUT_INTRQ_CB(DEVWRITELINE("mainpic", pic8259_device, ir3_w))

View File

@ -550,18 +550,18 @@ DRIVER_INIT_MEMBER(pgm2_state,kov3)
GAME( 2007, orleg2, 0, pgm2, pgm2, pgm2_state, orleg2, ROT0, "IGS", "Oriental Legend 2 (V104, China)", MACHINE_IS_SKELETON )
GAME( 2007, orleg2o, orleg2, pgm2, pgm2, pgm2_state, orleg2, ROT0, "IGS", "Oriental Legend 2 (V103, China)", MACHINE_IS_SKELETON )
GAME( 2007, orleg2oa, orleg2, pgm2, pgm2, pgm2_state, orleg2, ROT0, "IGS", "Oriental Legend 2 (V101, China)", MACHINE_IS_SKELETON )
// should be earlier verisons too.
// should be earlier versions too.
GAME( 2008, kov2nl, 0, pgm2, pgm2, pgm2_state, kov2nl, ROT0, "IGS", "Knights of Valour 2 New Legend (V302, China)", MACHINE_IS_SKELETON )
GAME( 2008, kov2nlo, kov2nl, pgm2, pgm2, pgm2_state, kov2nl, ROT0, "IGS", "Knights of Valour 2 New Legend (V301, China)", MACHINE_IS_SKELETON )
GAME( 2008, kov2nloa, kov2nl, pgm2, pgm2, pgm2_state, kov2nl, ROT0, "IGS", "Knights of Valour 2 New Legend (V300, Taiwan)", MACHINE_IS_SKELETON )
// should be earlier verisons too.
// should be earlier versions too.
GAME( 2010, ddpdojh, 0, pgm2, pgm2, pgm2_state, ddpdojh, ROT270, "IGS", "Dodonpachi Daioujou Tamashii (V201, China)", MACHINE_IS_SKELETON )
// should be earlier verisons too.
// should be earlier versions too.
GAME( 2011, kov3, 0, pgm2, pgm2, pgm2_state, kov3, ROT0, "IGS", "Knights of Valour 3 (V102, China)", MACHINE_IS_SKELETON )
// should be earlier verisons too.
// should be earlier versions too.
// The King of Fighters '98 - Ultimate Match - Hero
// Jigsaw World Arena

174
src/mame/drivers/pgm3.cpp Normal file
View File

@ -0,0 +1,174 @@
// license:BSD-3-Clause
// copyright-holders:Xing Xing
/* PGM 3 hardware.
Games on this platform
Knights of Valour 3 HD
according to Xing Xing
"The main cpu of PGM3 whiched coded as 'SOC38' is an ARM1176@800M designed by SOCLE(http://www.socle-tech.com/). Not much infomation is available on this asic"
there is likely a 512KBytes encrypted bootloader(u-boot?) inside the cpu which load the kernel&initrd from the external SD card.
however, according to
http://www.arcadebelgium.net/t4958-knights-of-valour-3-hd-sangoku-senki-3-hd
the CPU is an Intel Atom D525 CPU with 2GB of RAM (but based on hardware images this is incorrect, they clearly show the CPU Xing Xing states is used)
the card images (except v105) seem to have encrypted data up to the C2000000 mark, then
some text string about a non-bootable disk followed by mostly blank data
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
0C2000000 EB 3C 90 6D 6B 64 6F 73 66 73 00 00 02 04 04 00 ë<.mkdosfs......
0C2000010 02 00 02 00 00 F8 00 01 3F 00 FF 00 00 00 00 00 .....ø..?.ÿ.....
0C2000020 00 00 04 00 00 00 29 4C 88 BA 7C 20 20 20 20 20 ......)Lˆº|
0C2000030 20 20 20 20 20 20 46 41 54 31 36 20 20 20 0E 1F FAT16 ..
0C2000040 BE 5B 7C AC 22 C0 74 0B 56 B4 0E BB 07 00 CD 10 ¾[|¬"Àt.V´.»..Í.
0C2000050 5E EB F0 32 E4 CD 16 CD 19 EB FE 54 68 69 73 20 ^ëð2äÍ.Í.ëþThis
0C2000060 69 73 20 6E 6F 74 20 61 20 62 6F 6F 74 61 62 6C is not a bootabl
0C2000070 65 20 64 69 73 6B 2E 20 20 50 6C 65 61 73 65 20 e disk. Please
0C2000080 69 6E 73 65 72 74 20 61 20 62 6F 6F 74 61 62 6C insert a bootabl
0C2000090 65 20 66 6C 6F 70 70 79 20 61 6E 64 0D 0A 70 72 e floppy and..pr
0C20000A0 65 73 73 20 61 6E 79 20 6B 65 79 20 74 6F 20 74 ess any key to t
0C20000B0 72 79 20 61 67 61 69 6E 20 2E 2E 2E 20 0D 0A 00 ry again ... ...
the v105 image has the encrypted data starting at 400000 and the above at C2400000
and is overall slightly shorter. it was probably dumped using a different method?
assuming one is the correct method the others will need adjusting.
DSW:
1: OFF = Game mode / ON = Test mode
2: OFF = JAMMA / ON = JVS
3: OFF = 16/9 (1280x720) / ON = 4/3 (800x600)
4: NO USE
todo: add other hardware details?
*/
#include "emu.h"
#include "cpu/arm7/arm7.h"
#include "cpu/arm7/arm7core.h"
class pgm3_state : public driver_device
{
public:
pgm3_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu") { }
DECLARE_DRIVER_INIT(kov3hd);
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void video_start() override;
uint32_t screen_update_pgm3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_pgm3(screen_device &screen, bool state);
required_device<cpu_device> m_maincpu;
};
static ADDRESS_MAP_START( pgm3_map, AS_PROGRAM, 32, pgm3_state )
AM_RANGE(0x00000000, 0x00003fff) AM_ROM
ADDRESS_MAP_END
static INPUT_PORTS_START( pgm3 )
INPUT_PORTS_END
uint32_t pgm3_state::screen_update_pgm3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
return 0;
}
void pgm3_state::screen_eof_pgm3(screen_device &screen, bool state)
{
}
void pgm3_state::video_start()
{
}
void pgm3_state::machine_start()
{
}
void pgm3_state::machine_reset()
{
}
static MACHINE_CONFIG_START( pgm3, pgm3_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", ARM9, 800000000) // wrong, see notes at top of driver
MCFG_CPU_PROGRAM_MAP(pgm3_map)
MCFG_DEVICE_DISABLE()
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(1280, 720)
MCFG_SCREEN_VISIBLE_AREA(0, 1280-1, 0, 720-1)
MCFG_SCREEN_UPDATE_DRIVER(pgm3_state, screen_update_pgm3)
MCFG_SCREEN_VBLANK_DRIVER(pgm3_state, screen_eof_pgm3)
MCFG_SCREEN_PALETTE("palette")
MCFG_PALETTE_ADD("palette", 0x1000)
MACHINE_CONFIG_END
ROM_START( kov3hd )
ROM_REGION( 0x04000, "maincpu", ROMREGION_ERASE00 )
// does it boot from the card, or is there an internal rom?
DISK_REGION( "card" )
DISK_IMAGE( "kov3hd_v105", 0, SHA1(c185888c59880805bb76b5c0a42b05c614dcff37) )
ROM_END
ROM_START( kov3hd104 )
ROM_REGION( 0x04000, "maincpu", ROMREGION_ERASE00 )
// does it boot from the card, or is there an internal rom?
DISK_REGION( "card" )
DISK_IMAGE( "kov3hd_m104", 0, SHA1(899b3b81825e6f23ae8f39aa67ad5b019f387cf9) )
ROM_END
ROM_START( kov3hd103 )
ROM_REGION( 0x04000, "maincpu", ROMREGION_ERASE00 )
// does it boot from the card, or is there an internal rom?
DISK_REGION( "card" )
DISK_IMAGE( "kov3hd_m103", 0, SHA1(0d4fd981f477cd5ed62609b875f4ddec939a2bb0) )
ROM_END
ROM_START( kov3hd102 )
ROM_REGION( 0x04000, "maincpu", ROMREGION_ERASE00 )
// does it boot from the card, or is there an internal rom?
DISK_REGION( "card" )
DISK_IMAGE( "kov3hd_m102", 0, SHA1(a5a872f9add5527b94019ec77ff1cd0f167f040f) )
ROM_END
ROM_START( kov3hd101 )
ROM_REGION( 0x04000, "maincpu", ROMREGION_ERASE00 )
// does it boot from the card, or is there an internal rom?
DISK_REGION( "card" )
DISK_IMAGE( "kov3hd_m101", 0, SHA1(086d6f1b8b2c01a8670fd6480da44b9c507f6e08) )
ROM_END
DRIVER_INIT_MEMBER(pgm3_state,kov3hd)
{
}
// all dumped sets might be China region, unless region info comes from elsewhere
GAME( 2011, kov3hd, 0, pgm3, pgm3, pgm3_state, kov3hd, ROT0, "IGS", "Knights of Valour 3 HD (V105)", MACHINE_IS_SKELETON )
GAME( 2011, kov3hd104, kov3hd, pgm3, pgm3, pgm3_state, kov3hd, ROT0, "IGS", "Knights of Valour 3 HD (V104)", MACHINE_IS_SKELETON )
GAME( 2011, kov3hd103, kov3hd, pgm3, pgm3, pgm3_state, kov3hd, ROT0, "IGS", "Knights of Valour 3 HD (V103)", MACHINE_IS_SKELETON )
GAME( 2011, kov3hd102, kov3hd, pgm3, pgm3, pgm3_state, kov3hd, ROT0, "IGS", "Knights of Valour 3 HD (V102)", MACHINE_IS_SKELETON )
GAME( 2011, kov3hd101, kov3hd, pgm3, pgm3, pgm3_state, kov3hd, ROT0, "IGS", "Knights of Valour 3 HD (V101)", MACHINE_IS_SKELETON )

View File

@ -55,6 +55,7 @@ public:
m_brg(*this, "brg"),
m_fdc (*this, "fdc"),
m_floppy0(*this, "fdc:0"),
m_floppy1(*this, "fdc:1"),
m_rtc(*this, "rtc")
{
}
@ -77,6 +78,7 @@ private:
required_device<com8116_device> m_brg;
required_device<fd1797_t> m_fdc;
required_device<floppy_connector> m_floppy0;
required_device<floppy_connector> m_floppy1;
required_device<msm5832_device> m_rtc;
};
@ -138,41 +140,46 @@ d7 XMEMEX line (for external memory, not emulated)
WRITE8_MEMBER( pulsar_state::ppi_pa_w )
{
m_floppy = nullptr;
if (BIT(data, 0)) m_floppy = m_floppy0->get_device();
if (BIT(data, 0))
m_floppy = m_floppy0->get_device();
else
if (BIT(data, 1))
m_floppy = m_floppy1->get_device();
m_fdc->set_floppy(m_floppy);
m_fdc->dden_w(BIT(data, 5));
if (m_floppy)
m_floppy->mon_w(0);
}
/*
d0..d3 RTC address
d4 RTC read line (inverted in emulation)
d5 RTC write line (inverted in emulation)
d4 RTC read line
d5 RTC write line
d6 RTC hold line
d7 Allow 64k of ram
*/
WRITE8_MEMBER( pulsar_state::ppi_pb_w )
{
m_rtc->address_w(data & 0x0f);
m_rtc->read_w(!BIT(data, 4));
m_rtc->write_w(!BIT(data, 5));
m_rtc->read_w(BIT(data, 4));
m_rtc->write_w(BIT(data, 5));
m_rtc->hold_w(BIT(data, 6));
membank("bankr1")->set_entry(BIT(data, 7));
}
/*
d0..d3 Data lines to rtc
d7 /2 SIDES (assumed to be side select)
*/
// d0..d3 Data lines to rtc
WRITE8_MEMBER( pulsar_state::ppi_pc_w )
{
m_rtc->data_w(space, 0, data & 15);
if (m_floppy)
m_floppy->ss_w(BIT(data, 7));
}
// d7 /2 SIDES
READ8_MEMBER( pulsar_state::ppi_pc_r )
{
return m_rtc->data_r(space, 0);
uint8_t data = 0;
if (m_floppy)
data = m_floppy->twosid_r() << 7;
return m_rtc->data_r(space, 0) | data;
}
static DEVICE_INPUT_DEFAULTS_START( terminal )
@ -185,7 +192,8 @@ static DEVICE_INPUT_DEFAULTS_START( terminal )
DEVICE_INPUT_DEFAULTS_END
static SLOT_INTERFACE_START( pulsar_floppies )
SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
SLOT_INTERFACE( "drive0", FLOPPY_525_HD )
SLOT_INTERFACE( "drive1", FLOPPY_525_HD )
SLOT_INTERFACE_END
/* Input ports */
@ -248,7 +256,10 @@ static MACHINE_CONFIG_START( pulsar, pulsar_state )
MCFG_COM8116_FT_HANDLER(WRITELINE(pulsar_state, ft_w))
MCFG_FD1797_ADD("fdc", XTAL_4MHz / 2)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", pulsar_floppies, "525dd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", pulsar_floppies, "drive0", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", pulsar_floppies, "drive1", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_SOUND(true)
MACHINE_CONFIG_END
/* ROM definition */

View File

@ -2,7 +2,7 @@
// ENABLE BY UNCOMMENTING. ADDITIONALLY, SET SMOOTH SCROLL IN EMULATION (DISABLE BY SETTING JUMP SCROLL. To enter SETUP hit ScrollLock)-
//#define BOOST_DEBUG_PERFORMANCE
/* GDC COLOR EMULATION
//-------------------- Differences to VT240: ---------------------------------------------------
// - Registers of graphics option not directly mapped (indirect access via mode register)
@ -754,24 +754,23 @@ UPD7220_DISPLAY_PIXELS_MEMBER( rainbow_state::hgdc_display_pixels )
return; // no output from graphics option
}
address = ( m_GDC_SCROLL_BUFFER[ ((address & 0x7FC0) >> 7) & 0xff ] << 7) | (address & 0x7F);
// ********************* GET BITMAP DATA FOR 4 PLANES ***************************************
// _READ_ BIT MAP from 2 or 4 planes (plane 0 is least, plane 3 most significant). See page 42 / 43
if(m_GDC_MODE_REGISTER & GDC_MODE_HIGHRES)
{
plane0 = m_video_ram[((address & 0x7fff) + 0x00000) >> 1];
plane1 = m_video_ram[((address & 0x7fff) + 0x10000) >> 1];
plane2 = plane3 = 0;
address = ( m_GDC_SCROLL_BUFFER[ ((address & 0x7FC0) >> 7) & 0xff ] << 7) | (address & 0x7F);
plane0 = m_video_ram[((address & 0x7fff) + 0x00000) >> 1];
plane1 = m_video_ram[((address & 0x7fff) + 0x10000) >> 1];
plane2 = plane3 = 0;
}
else
else
{
// MED.RESOLUTION (4 planes, 4 color bits, 16 color map entries / 16 (4) MONOCHROME SHADES)
// MANUAL SAYS: (GDC "sees" 4 planes X 16 bits X 8K words)!
plane0 = m_video_ram[((address & 0x3fff) + 0x00000) >> 1];
plane1 = m_video_ram[((address & 0x3fff) + 0x10000) >> 1];
plane2 = m_video_ram[((address & 0x3fff) + 0x20000) >> 1];
plane3 = m_video_ram[((address & 0x3fff) + 0x30000) >> 1];
address = ( m_GDC_SCROLL_BUFFER[ ((address & 0x3FC0) >> 7) & 0xff ] << 7) | (address & 0x7F);
// MED.RESOLUTION (4 planes, 4 color bits, 16 color map entries / 16 -or 4- MONOCHROME SHADES)
plane0 = m_video_ram[((address & 0x3fff) + 0x00000) >> 1];
plane1 = m_video_ram[((address & 0x3fff) + 0x10000) >> 1];
plane2 = m_video_ram[((address & 0x3fff) + 0x20000) >> 1];
plane3 = m_video_ram[((address & 0x3fff) + 0x30000) >> 1];
}
bool mono = (m_inp13->read() == MONO_MONITOR) ? true : false; // 1 = MONO, 2 = COLOR, 3 = DUAL MONITOR
@ -829,7 +828,7 @@ void rainbow_state::machine_start()
if (rom[0xf4000 + 0x3ffc] == 0x31) // 100-B (5.01) 0x35 would test for V5.05
{
rom[0xf4000 + 0x0303] = 0x00; // disable CRC check
rom[0xf4000 + 0x135e] = 0x00; // FLOPPY / RX-50 WORKAROUND: in case of Z80 RESPONSE FAILURE ($80 bit set in AL), do not block floppy access.
rom[0xf4000 + 0x135e] = 0x00; // Floppy / RX-50 workaround: in case of Z80 RESPONSE FAILURE ($80 bit set in AL), do not block floppy access.
rom[0xf4000 + 0x198F] = 0xeb; // cond.JMP to uncond.JMP (disables error message 60...)
}
@ -844,7 +843,7 @@ AM_RANGE(0x10000, END_OF_RAM) AM_RAM
// There is a 2212 (256 x 4 bit) NVRAM from 0xed000 to 0xed0ff (*)
// shadowed at $ec000 - $ecfff and from $ed100 - $edfff.
// (*) ED000 - ED0FF is the area the DEC-100-B BIOS accesses and checks
// (*) ED000 - ED0FF is the area the DEC-100-B Bios accesses and checks
// - Specs say that the CPU has direct access to volatile RAM only.
// So NVRAM is hidden and loads & saves are triggered within the
@ -2727,36 +2726,32 @@ READ16_MEMBER(rainbow_state::vram_r)
// NOTE: Rainbow has separate registers for fore and background.
WRITE16_MEMBER(rainbow_state::vram_w)
{
if(!(m_GDC_MODE_REGISTER & GDC_MODE_VECTOR))
{
// SCROLL_MAP IN BITMAP MODE ONLY...?
if(m_GDC_MODE_REGISTER & GDC_MODE_HIGHRES)
offset = ( m_GDC_SCROLL_BUFFER[ (offset & 0x3FC0) >> 6 ] << 6) | (offset & 0x3F);
else
offset = ( m_GDC_SCROLL_BUFFER[ (offset & 0x1FC0) >> 6 ] << 6) | (offset & 0x3F);
}
if(m_GDC_MODE_REGISTER & GDC_MODE_HIGHRES)
offset = ( m_GDC_SCROLL_BUFFER[ (offset & 0x3FC0) >> 6 ] << 6) | (offset & 0x3F);
else
offset = ( m_GDC_SCROLL_BUFFER[ (offset & 0x1FC0) >> 6 ] << 6) | (offset & 0x3F);
offset &= 0xffff; // same as in VT240?
uint16_t chr = data; // VT240 : uint8_t
if(m_GDC_MODE_REGISTER & GDC_MODE_VECTOR) // VT240 : if(SELECT_VECTOR_PATTERN_REGISTER)
{
chr = BITSWAP8(m_vpat, m_patidx, m_patidx, m_patidx, m_patidx, m_patidx, m_patidx, m_patidx, m_patidx);
chr |= (chr << 8);
if(m_patcnt-- == 0)
{
m_patcnt = m_patmult;
if(m_patidx-- == 0)
m_patidx = 7;
}
chr = BITSWAP8(m_vpat, m_patidx, m_patidx, m_patidx, m_patidx, m_patidx, m_patidx, m_patidx, m_patidx);
chr |= (chr << 8);
if(m_patcnt-- == 0)
{
m_patcnt = m_patmult;
if(m_patidx-- == 0)
m_patidx = 7;
}
}
else
else
{
chr = m_GDC_WRITE_BUFFER[ m_GDC_write_buffer_index++ ];
m_GDC_write_buffer_index &= 0xf;
chr = m_GDC_WRITE_BUFFER[ m_GDC_write_buffer_index++ ];
m_GDC_write_buffer_index &= 0xf;
chr |= (m_GDC_WRITE_BUFFER[m_GDC_write_buffer_index++] << 8);
m_GDC_write_buffer_index &= 0xf;
chr |= (m_GDC_WRITE_BUFFER[m_GDC_write_buffer_index++] << 8);
m_GDC_write_buffer_index &= 0xf;
}
if(m_GDC_MODE_REGISTER & GDC_MODE_ENABLE_WRITES) // 0x10
@ -2791,10 +2786,10 @@ WRITE16_MEMBER(rainbow_state::vram_w)
break;
}
if(!(m_GDC_MODE_REGISTER & GDC_MODE_VECTOR)) // 0 : (NOT VECTOR MODE) Text Mode and Write Mask Batch
if(!(m_GDC_MODE_REGISTER & GDC_MODE_VECTOR)) // 0 : Text Mode and Write Mask Batch
out = (out & ~m_GDC_WRITE_MASK) | (mem & m_GDC_WRITE_MASK); // // M_MASK (1st use)
else
out = (out & ~data) | (mem & data); // VECTOR MODE !
out = (out & ~data) | (mem & data); // vector mode
if(m_GDC_MODE_REGISTER & GDC_MODE_ENABLE_WRITES) // 0x10
m_video_ram[(offset & 0xffff) + (0x8000 * i)] = out;
@ -2845,13 +2840,13 @@ WRITE8_MEMBER(rainbow_state::GDC_EXTRA_REGISTER_w)
if(offset > 0) // Port $50 reset done @ boot ROM 1EB4/8 regardless if option present.
if (m_inp7->read() != 1)
{
if(last_message != 1)
{
printf("\nCOLOR GRAPHICS ADAPTER INVOKED. PLEASE TURN ON THE APPROPRIATE DIP SWITCH, THEN RESTART.\n");
printf("OFFSET: %x (PC=%x)\n", 0x50 +offset , machine().device("maincpu")->safe_pc());
last_message = 1;
}
return;
if(last_message != 1)
{
printf("\nCOLOR GRAPHICS ADAPTER INVOKED. PLEASE TURN ON THE APPROPRIATE DIP SWITCH, THEN RESTART.\n");
printf("OFFSET: %x (PC=%x)\n", 0x50 +offset , machine().device("maincpu")->safe_pc());
last_message = 1;
}
return;
}
switch(offset)
@ -2860,15 +2855,12 @@ WRITE8_MEMBER(rainbow_state::GDC_EXTRA_REGISTER_w)
// FIXME: "Any write to this port also resynchronizes the
// read/modify/write memory cycles of the Graphics Option to those of the GDC." (?)
//if( (!(m_PORT50 & 1)) && (data & 1)) // PDF QV069 suggests 1 -> 0 -> 1
if( data & 1 ) // ; most programs just set bit 0 (PACMAN).
if( data & 1 ) // PDF QV069 suggests 1 -> 0 -> 1. Most programs just set bit 0 (PACMAN).
{
// Graphics option software reset (separate from GDC reset...)
OPTION_GRFX_RESET
OPTION_RESET_PATTERNS
}
m_PORT50 = data;
break;
case 1: // 51h - DATA loaded into register previously written to 53h.

View File

@ -880,8 +880,8 @@ GAME( 1982, vrkon_l1, 0, s7, s7, s7_state, s7, ROT0, "Williams", "Varkon
GAME( 1982, tmfnt_l5, 0, s7, s7, s7_state, s7, ROT0, "Williams", "Time Fantasy (L-5)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING )
GAME( 1982, wrlok_l3, 0, s7, s7, s7_state, s7, ROT0, "Williams", "Warlok (L-3)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING )
GAME( 1982, dfndr_l4, 0, s7, s7, s7_state, s7, ROT0, "Williams", "Defender (L-4)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING )
GAME( 1983, jst_l2, 0, s7, s7, s7_state, s7, ROT0, "Williams", "Joust (L-2)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_NOT_WORKING )
GAME( 1983, jst_l1, jst_l2, s7, s7, s7_state, s7, ROT0, "Williams", "Joust (L-1)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING | MACHINE_NOT_WORKING )
GAME( 1983, jst_l2, 0, s7, s7, s7_state, s7, ROT0, "Williams", "Joust (L-2)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING )
GAME( 1983, jst_l1, jst_l2, s7, s7, s7_state, s7, ROT0, "Williams", "Joust (L-1)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING )
GAME( 1983, lsrcu_l2, 0, s7, s7, s7_state, s7, ROT0, "Williams", "Laser Cue (L-2)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING )
GAME( 1983, fpwr2_l2, 0, s7, s7, s7_state, s7, ROT0, "Williams", "Firepower II (L-2)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING )
GAME( 1984, strlt_l1, 0, s7, s7, s7_state, s7, ROT0, "Williams", "Star Light (L-1)", MACHINE_MECHANICAL | MACHINE_NOT_WORKING )

Some files were not shown because too many files have changed in this diff Show More