This commit is contained in:
angelosa 2024-03-08 01:26:30 +01:00
commit d9424d92b4
115 changed files with 4818 additions and 4230 deletions

View File

@ -7607,6 +7607,17 @@ MOS Atari-made game NTSC ROMs had a CO16xxx number and PAL ROMs had CO17xxx numb
</part>
</software>
<software name="hobo" supported="no">
<description>Hobo (prototype)</description>
<year>1983</year>
<publisher>UA Limited</publisher>
<part name="cart" interface="a2600_cart">
<dataarea name="rom" size="8192">
<rom name="Hobo.bin" size="8192" crc="01650b7c" sha1="f204ce7bc637a0338e6fdd91f2bff77dd70d3e0b"/>
</dataarea>
</part>
</software>
<software name="holehunt">
<description>Hole Hunter</description>
<year>19??</year>
@ -12453,6 +12464,17 @@ MOS Atari-made game NTSC ROMs had a CO16xxx number and PAL ROMs had CO17xxx numb
</part>
</software>
<software name="r2dtank">
<description>R2D Tank (prototype)</description>
<year>1983</year>
<publisher>UA Limited</publisher>
<part name="cart" interface="a2600_cart">
<dataarea name="rom" size="4096">
<rom name="R2D Tank.bin" size="4096" crc="f1c824e5" sha1="e2f651e134da86853bf7e20fcdbc6517ae3cc57c"/>
</dataarea>
</part>
</software>
<software name="rabbittr">
<description>Rabbit Transit (prototype 19830829)</description>
<year>1983</year>
@ -15110,6 +15132,17 @@ MOS Atari-made game NTSC ROMs had a CO16xxx number and PAL ROMs had CO17xxx numb
</part>
</software>
<software name="spiders">
<description>Spiders (prototype)</description>
<year>1983</year>
<publisher>UA Limited</publisher>
<part name="cart" interface="a2600_cart">
<dataarea name="rom" size="4096">
<rom name="Spiders.bin" size="4096" crc="12445c9e" sha1="cc4a3ee2970e3bf853a5ab7900dcc8c23672864b"/>
</dataarea>
</part>
</software>
<software name="spidfght">
<description>Spider Fighter</description>
<year>1982</year>

View File

@ -33,7 +33,7 @@ license:CC0-1.0
<software name="condemc">
<description>O Conde de Monte Cristo (Brazil)</description>
<year>1988</year>
<publisher>Nemesis Informatica</publisher>
<publisher>Nemesis Informática</publisher>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="184320">
<rom name="o conde de monte cristo - nemesis informatica.dsk" size="184320" crc="7c8bf6be" sha1="ae11b322736943e3a7068c1f5fb56fbecbc2a241" />
@ -44,7 +44,7 @@ license:CC0-1.0
<software name="diskmec2">
<description>Disk Mechanic v2.0 (Brazil)</description>
<year>1990</year>
<publisher>Discovery Informatica</publisher>
<publisher>Discovery Informática</publisher>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="368640">
<rom name="disk mechanic v2.0 - discovery informatica.dsk" size="368640" crc="48d7c1d0" sha1="03b80134729235c0febc77becf353a7fd294ad32" />
@ -52,10 +52,35 @@ license:CC0-1.0
</part>
</software>
<software name="gsystem" supported="no">
<description>Gradius System (Brazil)</description>
<year>1990</year>
<publisher>Nemesis Informática</publisher>
<notes>Some menu options ask for other disks named G-COPY or G-CALC; part of this package or other products from Nemesis Informática?</notes>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="368640">
<rom name="gradius system - nemesis informatica.dsk" size="368640" crc="b06b588d" sha1="66d244adebb62c87c342e3230bc8ca600e189d36" />
</dataarea>
</part>
<part name="flop2" interface="floppy_5_25">
<feature name="part_id" value="G-COPY"/>
<dataarea name="flop" size="368640">
<rom name="gradius system - nemesis informatica (g-copy).dsk" size="368640" status="nodump" />
</dataarea>
</part>
<part name="flop3" interface="floppy_5_25">
<feature name="part_id" value="G-CALC"/>
<dataarea name="flop" size="368640">
<rom name="gradius system - nemesis informatica (g-calc).dsk" size="368640" status="nodump" />
</dataarea>
</part>
</software>
<software name="graphicv">
<description>Graphic View (Brazil)</description>
<year>1989</year>
<publisher>Paulisoft Informatica</publisher>
<publisher>Paulisoft Informática</publisher>
<info name="usage" value="Requires a Brazilian system."/>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="368640">
<rom name="graphic view - paulisoft informatica.dsk" size="368640" crc="9b6365af" sha1="69fb0677a955669fbf229936e820683700b472c3" />
@ -77,7 +102,7 @@ license:CC0-1.0
<software name="msxdostb">
<description>MSX-DOS Tools (Brazil, v4.3)</description>
<year>1991</year>
<publisher>Nemesis Informatica</publisher>
<publisher>Nemesis Informática</publisher>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="184320">
<rom name="msx-dos tools v4.3 (1991)(nemesis informatica)(br).dsk" size="184320" crc="e93070dd" sha1="f78578bf88fa08d0268d7ed2f3cb62406527c500" />
@ -96,10 +121,23 @@ license:CC0-1.0
</part>
</software>
<software name="postmkr">
<description>Poster Maker (Brazil)</description>
<year>1989</year>
<publisher>Discovery Informática</publisher>
<info name="usage" value="Hold CTRL at boot until the beep. Requires a Brazilian system."/>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="368640">
<rom name="professonal cards - discovery informatica.dsk" size="368640" crc="5c794568" sha1="6a0d422e604000d1c1110c7aab9100f334e8f09b" />
</dataarea>
</part>
</software>
<software name="profcard">
<description>Professional Cards (Brazil)</description>
<year>1990</year>
<publisher>Discovery Informatica</publisher>
<publisher>Discovery Informática</publisher>
<info name="usage" value="Requires a Brazilian system."/>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="368640">
<rom name="professonal cards - discovery informatica.dsk" size="368640" crc="88b10895" sha1="8f3ba18e72d25a8dae360f318d6ab4d3e60d1957" />
@ -107,11 +145,22 @@ license:CC0-1.0
</part>
</software>
<software name="propaint">
<description>Professional Paint (Brazil)</description>
<year>19??</year>
<publisher>Hitek</publisher>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="368640">
<rom name="professonal paint - hitek.dsk" size="368640" crc="ea839104" sha1="c19f872b4739b2ce976da48016c77f509be6c59c"/>
</dataarea>
</part>
</software>
<software name="profpubl">
<description>Professional Publisher (Brazil)</description>
<year>1990</year>
<publisher>Discovery Informatica</publisher>
<info name="usage" value="Requires the instructions to enter password." />
<publisher>Discovery Informática</publisher>
<info name="usage" value="Requires the instructions to enter password. Requires a Brazilian system." />
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="368640">
<rom name="professonal publisher - discovery informatica.dsk" size="368640" crc="ebf4ca7a" sha1="e85ff831a494d7569b24dda18c28de052246c299" />
@ -119,6 +168,30 @@ license:CC0-1.0
</part>
</software>
<software name="profstrp">
<description>Professional Stripes (Brazil)</description>
<year>1990</year>
<publisher>Discovery Informática</publisher>
<info name="usage" value="Requires a Brazilian system."/>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="368640">
<rom name="professonal stripes - discovery informatica.dsk" size="368640" crc="145c1508" sha1="05aabdc54a1e39603f103c7c149292e73aaf9a35"/>
</dataarea>
</part>
</software>
<software name="retrafal">
<description>Retrato Falado (Brazil)</description>
<year>19??</year>
<publisher>MSX Shop</publisher>
<info name="usage" value="Requires a Brazilian system."/>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="368640">
<rom name="retrato falado - msx shop.dsk" size="368640" crc="a5287f7d" sha1="b7ae32e83e5febc47365188f38aa9ee3064bd45e"/>
</dataarea>
</part>
</software>
<software name="serrapel">
<description>Serra Pelada (Brazil)</description>
<year>1987</year>
@ -131,4 +204,15 @@ license:CC0-1.0
</part>
</software>
<software name="supercalc2">
<description>SuperCalc 2 (Brazil)</description>
<year>1985</year>
<publisher>Compucenter Informática</publisher>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="368640">
<rom name="supercalc2 - compucenter informatica.dsk" size="368640" crc="8fbc99a1" sha1="4f6d34519afa7617350100881bb25ddbcb1ec947"/>
</dataarea>
</part>
</software>
</softwarelist>

View File

@ -651,14 +651,14 @@ if CPUS["G65816"] then
files {
MAME_DIR .. "src/devices/cpu/g65816/g65816.cpp",
MAME_DIR .. "src/devices/cpu/g65816/g65816.h",
MAME_DIR .. "src/devices/cpu/g65816/g65816cm.h",
MAME_DIR .. "src/devices/cpu/g65816/g65816ds.h",
MAME_DIR .. "src/devices/cpu/g65816/g65816o0.cpp",
MAME_DIR .. "src/devices/cpu/g65816/g65816o1.cpp",
MAME_DIR .. "src/devices/cpu/g65816/g65816o2.cpp",
MAME_DIR .. "src/devices/cpu/g65816/g65816o3.cpp",
MAME_DIR .. "src/devices/cpu/g65816/g65816o4.cpp",
MAME_DIR .. "src/devices/cpu/g65816/g65816cm.h",
MAME_DIR .. "src/devices/cpu/g65816/g65816ds.h",
MAME_DIR .. "src/devices/cpu/g65816/g65816op.h",
MAME_DIR .. "src/devices/cpu/g65816/g65816op.ipp",
}
end

View File

@ -4,6 +4,8 @@
Atari CX85 Numeric Keypad
Normal Atari 400/800 usage has this connect to controller port 2.
**********************************************************************/
#include "emu.h"
@ -119,5 +121,6 @@ u8 atari_cx85_device::vcs_joy_r()
u8 atari_cx85_device::vcs_pot_x_r()
{
return BIT(m_encoder->read(), 4) ? 0 : 0xff;
// Schematics suggests this should also be inverted through 4049B, but drivers seem to work the opposite way
return BIT(m_encoder->read(), 4) ? 0xff : 0;
}

View File

@ -9,6 +9,19 @@
#include "emu.h"
#include "amis2000d.h"
// common lookup tables
enum amis2000_disassembler::e_mnemonics : unsigned
{
mLAB = 0, mLAE, mLAI, mLBE, mLBEP, mLBF, mLBZ, mXAB, mXABU, mXAE,
mLAM, mXC, mXCI, mXCD, mSTM, mRSM,
mADD, mADCS, mADIS, mAND, mXOR, mCMA, mSTC, mRSC, mSF1, mRF1, mSF2, mRF2,
mSAM, mSZM, mSBE, mSZC, mSOS, mSZK, mSZI, mTF1, mTF2,
mPP, mJMP, mJMS, mRT, mRTS, mNOP, mHALT,
mINP, mOUT, mDISB, mDISN, mMVS, mPSH, mPSL, mEUR
};
const char *const amis2000_disassembler::s_mnemonics[] =
{
"LAB", "LAE", "LAI", "LBE", "LBEP", "LBF", "LBZ", "XAB", "XABU", "XAE",
@ -83,6 +96,9 @@ const u8 amis2000_disassembler::s2000_mnemonic[0x100] =
mJMP, mJMP, mJMP, mJMP, mJMP, mJMP, mJMP, mJMP
};
// disasm
offs_t amis2000_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer &params)
{
u8 op = opcodes.r8(pc);
@ -112,8 +128,3 @@ offs_t amis2000_disassembler::disassemble(std::ostream &stream, offs_t pc, const
return 1 | s_flags[instr] | SUPPORTED;
}
u32 amis2000_disassembler::opcode_alignment() const
{
return 1;
}

View File

@ -17,20 +17,11 @@ public:
amis2000_disassembler() = default;
virtual ~amis2000_disassembler() = default;
virtual u32 opcode_alignment() const override;
virtual u32 opcode_alignment() const override { return 1; }
virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer &params) override;
private:
enum e_mnemonics
{
mLAB = 0, mLAE, mLAI, mLBE, mLBEP, mLBF, mLBZ, mXAB, mXABU, mXAE,
mLAM, mXC, mXCI, mXCD, mSTM, mRSM,
mADD, mADCS, mADIS, mAND, mXOR, mCMA, mSTC, mRSC, mSF1, mRF1, mSF2, mRF2,
mSAM, mSZM, mSBE, mSZC, mSOS, mSZK, mSZI, mTF1, mTF2,
mPP, mJMP, mJMS, mRT, mRTS, mNOP, mHALT,
mINP, mOUT, mDISB, mDISN, mMVS, mPSH, mPSL, mEUR
};
enum e_mnemonics : unsigned;
static const char *const s_mnemonics[];
static const s8 s_bits[];
static const u32 s_flags[];

View File

@ -32,6 +32,18 @@ offs_t cops1_common_disassembler::increment_pc(offs_t pc)
// common lookup tables
enum cops1_common_disassembler::e_mnemonics : unsigned
{
mILL,
mAD, mADD, mSUB, mCOMP, m0TA, mADX, mHXA, mTAM, mSC, mRSC, mTC,
mTIN, mTF, mTKB, mTIR,
mBTD, mDSPA, mDSPS, mAXO, mLDF, mREAD,
mGO, mCALL, mRET, mRETS, mLG, mLGCALL, mNOP,
mEXC, mEXCM, mEXCP, mMTA, mLM,
mSM1, mSM2, mSM4, mSM8, mRSM1, mRSM2, mRSM4, mRSM8, mTM,
mLB, mLBL, mATB, mBTA, mHXBR
};
const char *const cops1_common_disassembler::s_name[] =
{
"?",

View File

@ -25,19 +25,7 @@ public:
virtual offs_t pc_real_to_linear(offs_t pc) const override { return (pc & ~0x3f) | m_r2l[pc & 0x3f]; }
protected:
// opcode mnemonics
enum e_mnemonics
{
mILL,
mAD, mADD, mSUB, mCOMP, m0TA, mADX, mHXA, mTAM, mSC, mRSC, mTC,
mTIN, mTF, mTKB, mTIR,
mBTD, mDSPA, mDSPS, mAXO, mLDF, mREAD,
mGO, mCALL, mRET, mRETS, mLG, mLGCALL, mNOP,
mEXC, mEXCM, mEXCP, mMTA, mLM,
mSM1, mSM2, mSM4, mSM8, mRSM1, mRSM2, mRSM4, mRSM8, mTM,
mLB, mLBL, mATB, mBTA, mHXBR
};
enum e_mnemonics : unsigned;
static const char *const s_name[];
static const u8 s_bits[];
static const u32 s_flags[];

View File

@ -9,6 +9,27 @@
#include "emu.h"
#include "e0c6200d.h"
// common lookup tables
enum e0c6200_disassembler::e_mnemonics : unsigned
{
em_JP, em_RETD, em_CALL, em_CALZ,
em_LD, em_LBPX, em_ADC, em_CP, em_ADD, em_SUB, em_SBC, em_AND, em_OR, em_XOR,
em_RLC, em_FAN, em_PSET, em_LDPX, em_LDPY, em_SET, em_RST, em_INC, em_DEC,
em_RRC, em_ACPX, em_ACPY, em_SCPX, em_SCPY, em_PUSH, em_POP,
em_RETS, em_RET, em_JPBA, em_HALT, em_SLP, em_NOP5, em_NOP7,
em_NOT, em_SCF, em_SZF, em_SDF, em_EI, em_DI, em_RDF, em_RZF, em_RCF, em_ILL
};
enum e0c6200_disassembler::e_params : unsigned
{
ep_S, ep_E, ep_I, ep_R0, ep_R2, ep_R4, ep_Q,
ep_cC, ep_cNC, ep_cZ, ep_cNZ,
ep_A, ep_B, ep_X, ep_Y, ep_MX, ep_MY, ep_XP, ep_XH, ep_XL, ep_YP, ep_YH, ep_YL,
ep_P, ep_F, ep_MN, ep_SP, ep_SPH, ep_SPL
};
const char *const e0c6200_disassembler::em_name[] =
{
"JP", "RETD", "CALL", "CALZ",
@ -53,6 +74,8 @@ const char *const e0c6200_disassembler::ep_name[] =
};
// disasm
std::string e0c6200_disassembler::decode_param(u16 opcode, int param)
{
int bits = ep_bits[param] & 0xf;
@ -671,23 +694,3 @@ offs_t e0c6200_disassembler::disassemble(std::ostream &stream, offs_t pc, const
return 1 | ((op & 0xf00) == 0 ? 0 : em_flags[m]) | SUPPORTED;
}
u32 e0c6200_disassembler::opcode_alignment() const
{
return 1;
}
u32 e0c6200_disassembler::interface_flags() const
{
return PAGED2LEVEL;
}
u32 e0c6200_disassembler::page_address_bits() const
{
return 8;
}
u32 e0c6200_disassembler::page2_address_bits() const
{
return 4;
}

View File

@ -17,32 +17,16 @@ public:
e0c6200_disassembler() = default;
virtual ~e0c6200_disassembler() = default;
virtual u32 opcode_alignment() const override;
virtual u32 interface_flags() const override;
virtual u32 page_address_bits() const override;
virtual u32 page2_address_bits() const override;
virtual u32 opcode_alignment() const override { return 1; }
virtual u32 interface_flags() const override { return PAGED2LEVEL; }
virtual u32 page_address_bits() const override { return 8; }
virtual u32 page2_address_bits() const override { return 4; }
virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer &params) override;
private:
enum e_mnemonics
{
em_JP, em_RETD, em_CALL, em_CALZ,
em_LD, em_LBPX, em_ADC, em_CP, em_ADD, em_SUB, em_SBC, em_AND, em_OR, em_XOR,
em_RLC, em_FAN, em_PSET, em_LDPX, em_LDPY, em_SET, em_RST, em_INC, em_DEC,
em_RRC, em_ACPX, em_ACPY, em_SCPX, em_SCPY, em_PUSH, em_POP,
em_RETS, em_RET, em_JPBA, em_HALT, em_SLP, em_NOP5, em_NOP7,
em_NOT, em_SCF, em_SZF, em_SDF, em_EI, em_DI, em_RDF, em_RZF, em_RCF, em_ILL
};
enum e_params
{
ep_S, ep_E, ep_I, ep_R0, ep_R2, ep_R4, ep_Q,
ep_cC, ep_cNC, ep_cZ, ep_cNZ,
ep_A, ep_B, ep_X, ep_Y, ep_MX, ep_MY, ep_XP, ep_XH, ep_XL, ep_YP, ep_YH, ep_YL,
ep_P, ep_F, ep_MN, ep_SP, ep_SPH, ep_SPL
};
enum e_mnemonics : unsigned;
enum e_params : unsigned;
static const char *const em_name[];
static const u32 em_flags[];
static const u16 ep_bits[];

View File

@ -100,6 +100,8 @@ TODO general:
#include "emu.h"
#include "g65816.h"
#include "g65816cm.h"
DEFINE_DEVICE_TYPE(G65816, g65816_device, "w65c816", "WDC W65C816")
DEFINE_DEVICE_TYPE(G65802, g65802_device, "w65c802", "WDC W65C802")
@ -307,19 +309,19 @@ void g65816_device::g65816i_write_8_direct(unsigned address, unsigned value)
unsigned g65816_device::g65816i_read_16_normal(unsigned address)
{
return g65816i_read_8_normal(address) |
(g65816i_read_8_normal(address+1)<<8);
(g65816i_read_8_normal(address + 1) << 8);
}
unsigned g65816_device::g65816i_read_16_immediate(unsigned address)
{
return g65816i_read_8_immediate(address) |
(g65816i_read_8_immediate(address+1)<<8);
(g65816i_read_8_immediate(address + 1) << 8);
}
unsigned g65816_device::g65816i_read_16_direct(unsigned address)
{
return g65816i_read_8_direct(address) |
(g65816i_read_8_direct(address+1)<<8);
(g65816i_read_8_direct(address + 1) << 8);
}
unsigned g65816_device::g65816i_read_16_direct_x(unsigned address)
@ -329,8 +331,8 @@ unsigned g65816_device::g65816i_read_16_direct_x(unsigned address)
// The (direct,X) addressing mode has a bug in which the high byte is
// wrapped within the page if E = 1 and D&0xFF != 0.
uint8_t lo = g65816i_read_8_direct(address);
uint8_t hi = g65816i_read_8_direct((address & 0xFFFF00) |
MAKE_UINT_8(address+1));
uint8_t hi = g65816i_read_8_direct((address & 0xffff00) |
MAKE_UINT_8(address + 1));
return lo | (hi<<8);
}
else
@ -342,33 +344,33 @@ unsigned g65816_device::g65816i_read_16_direct_x(unsigned address)
unsigned g65816_device::g65816i_read_16_vector(unsigned address)
{
return g65816i_read_8_vector(address) |
(g65816i_read_8_vector(address+1)<<8);
(g65816i_read_8_vector(address + 1) << 8);
}
void g65816_device::g65816i_write_16_normal(unsigned address, unsigned value)
{
g65816i_write_8_normal(address, value&0xff);
g65816i_write_8_normal(address+1, value>>8);
g65816i_write_8_normal(address, value & 0xff);
g65816i_write_8_normal(address + 1, value >> 8);
}
void g65816_device::g65816i_write_16_direct(unsigned address, unsigned value)
{
g65816i_write_8_direct(address, value&0xff);
g65816i_write_8_direct(address+1, value>>8);
g65816i_write_8_direct(address, value & 0xff);
g65816i_write_8_direct(address + 1, value >> 8);
}
unsigned g65816_device::g65816i_read_24_normal(unsigned address)
{
return g65816i_read_8_normal(address) |
(g65816i_read_8_normal(address+1)<<8) |
(g65816i_read_8_normal(address+2)<<16);
(g65816i_read_8_normal(address + 1) << 8) |
(g65816i_read_8_normal(address + 2) << 16);
}
unsigned g65816_device::g65816i_read_24_immediate(unsigned address)
{
return g65816i_read_8_immediate(address) |
(g65816i_read_8_immediate(address+1)<<8) |
(g65816i_read_8_immediate(address+2)<<16);
(g65816i_read_8_immediate(address + 1) << 8) |
(g65816i_read_8_immediate(address + 2) << 16);
}
@ -381,11 +383,11 @@ void g65816_device::g65816i_push_8(unsigned value)
g65816i_write_8_normal(REGISTER_S, value);
if (FLAG_E)
{
REGISTER_S = MAKE_UINT_8(REGISTER_S-1) | 0x100;
REGISTER_S = MAKE_UINT_8(REGISTER_S - 1) | 0x100;
}
else
{
REGISTER_S = MAKE_UINT_16(REGISTER_S-1);
REGISTER_S = MAKE_UINT_16(REGISTER_S - 1);
}
}
@ -393,19 +395,19 @@ unsigned g65816_device::g65816i_pull_8()
{
if (FLAG_E)
{
REGISTER_S = MAKE_UINT_8(REGISTER_S+1) | 0x100;
REGISTER_S = MAKE_UINT_8(REGISTER_S + 1) | 0x100;
}
else
{
REGISTER_S = MAKE_UINT_16(REGISTER_S+1);
REGISTER_S = MAKE_UINT_16(REGISTER_S + 1);
}
return g65816i_read_8_normal(REGISTER_S);
}
void g65816_device::g65816i_push_16(unsigned value)
{
g65816i_push_8(value>>8);
g65816i_push_8(value&0xff);
g65816i_push_8(value >> 8);
g65816i_push_8(value & 0xff);
}
unsigned g65816_device::g65816i_pull_16()
@ -416,9 +418,9 @@ unsigned g65816_device::g65816i_pull_16()
void g65816_device::g65816i_push_24(unsigned value)
{
g65816i_push_8(value>>16);
g65816i_push_8((value>>8)&0xff);
g65816i_push_8(value&0xff);
g65816i_push_8(value >> 16);
g65816i_push_8((value >> 8) & 0xff);
g65816i_push_8(value & 0xff);
}
unsigned g65816_device::g65816i_pull_24()
@ -431,19 +433,19 @@ unsigned g65816_device::g65816i_pull_24()
void g65816_device::g65816i_push_8_native(unsigned value)
{
g65816i_write_8_normal(REGISTER_S, value);
REGISTER_S = MAKE_UINT_16(REGISTER_S-1);
REGISTER_S = MAKE_UINT_16(REGISTER_S - 1);
}
unsigned g65816_device::g65816i_pull_8_native()
{
REGISTER_S = MAKE_UINT_16(REGISTER_S+1);
REGISTER_S = MAKE_UINT_16(REGISTER_S + 1);
return g65816i_read_8_normal(REGISTER_S);
}
void g65816_device::g65816i_push_16_native(unsigned value)
{
g65816i_push_8_native(value>>8);
g65816i_push_8_native(value&0xff);
g65816i_push_8_native(value >> 8);
g65816i_push_8_native(value & 0xff);
}
unsigned g65816_device::g65816i_pull_16_native()
@ -454,9 +456,9 @@ unsigned g65816_device::g65816i_pull_16_native()
void g65816_device::g65816i_push_24_native(unsigned value)
{
g65816i_push_8_native(value>>16);
g65816i_push_8_native((value>>8)&0xff);
g65816i_push_8_native(value&0xff);
g65816i_push_8_native(value >> 16);
g65816i_push_8_native((value >> 8) & 0xff);
g65816i_push_8_native(value & 0xff);
}
unsigned g65816_device::g65816i_pull_24_native()
@ -486,7 +488,7 @@ void g65816_device::g65816i_jump_16(unsigned address)
void g65816_device::g65816i_jump_24(unsigned address)
{
REGISTER_PB = address&0xff0000;
REGISTER_PB = address & 0xff0000;
REGISTER_PC = MAKE_UINT_16(address);
g65816i_jumping(REGISTER_PC);
}
@ -497,7 +499,7 @@ void g65816_device::g65816i_branch_8(unsigned offset)
{
unsigned old_pc = REGISTER_PC;
REGISTER_PC = MAKE_UINT_16(REGISTER_PC + MAKE_INT_8(offset));
if((REGISTER_PC^old_pc)&0xff00)
if ((REGISTER_PC ^ old_pc) & 0xff00)
CLK(1);
}
else
@ -522,7 +524,7 @@ void g65816_device::g65816i_set_flag_mx(unsigned value)
{
if (FLAG_M)
{
if(!(value & FLAGPOS_M))
if (!(value & FLAGPOS_M))
{
REGISTER_A |= REGISTER_B;
REGISTER_B = 0;
@ -531,7 +533,7 @@ void g65816_device::g65816i_set_flag_mx(unsigned value)
}
else
{
if(value & FLAGPOS_M)
if (value & FLAGPOS_M)
{
REGISTER_B = REGISTER_A & 0xff00;
REGISTER_A = MAKE_UINT_8(REGISTER_A);
@ -540,28 +542,28 @@ void g65816_device::g65816i_set_flag_mx(unsigned value)
}
if (FLAG_X)
{
if(!(value & FLAGPOS_X))
if (!(value & FLAGPOS_X))
{
FLAG_X = XFLAG_CLEAR;
}
}
else
{
if(value & FLAGPOS_X)
if (value & FLAGPOS_X)
{
REGISTER_X = MAKE_UINT_8(REGISTER_X);
REGISTER_Y = MAKE_UINT_8(REGISTER_Y);
FLAG_X = XFLAG_SET;
}
}
g65816i_set_execution_mode((FLAG_M>>4) | (FLAG_X>>4));
g65816i_set_execution_mode((FLAG_M >> 4) | (FLAG_X >> 4));
}
void g65816_device::g65816i_set_flag_e(unsigned value)
{
if (FLAG_E)
{
if(!value)
if (!value)
{
FLAG_E = EFLAG_CLEAR;
g65816i_set_execution_mode(EXECUTION_MODE_M1X1);
@ -604,7 +606,7 @@ void g65816_device::g65816i_set_flag_i(unsigned value)
/* Get the Processor Status Register */
unsigned g65816_device::g65816i_get_reg_p()
{
return (FLAG_N&0x80) |
return (FLAG_N & 0x80) |
((FLAG_V>>1)&0x40) |
FLAG_M |
FLAG_X |
@ -683,7 +685,7 @@ void g65816_device::g65816i_interrupt_software(unsigned vector)
else
{
CLK(8);
g65816i_push_8(REGISTER_PB>>16);
g65816i_push_8(REGISTER_PB >> 16);
g65816i_push_16(REGISTER_PC);
g65816i_push_8(g65816i_get_reg_p());
FLAG_D = DFLAG_CLEAR;
@ -708,7 +710,7 @@ void g65816_device::g65816i_interrupt_nmi()
else
{
CLK(8);
g65816i_push_8(REGISTER_PB>>16);
g65816i_push_8(REGISTER_PB >> 16);
g65816i_push_16(REGISTER_PC);
g65816i_push_8(g65816i_get_reg_p());
FLAG_D = DFLAG_CLEAR;
@ -822,7 +824,7 @@ unsigned g65816_device::g65816_get_pc()
void g65816_device::g65816_set_pc(unsigned val)
{
REGISTER_PC = MAKE_UINT_16(val);
REGISTER_PB = (val >> 16) & 0xFF;
REGISTER_PB = (val >> 16) & 0xff;
g65816_jumping(REGISTER_PB | REGISTER_PC);
}
@ -842,7 +844,7 @@ void g65816_device::g65816_set_sp(unsigned val)
unsigned g65816_device::g65816_get_reg(int regnum)
{
/* Set the function tables to emulation mode if the FTABLE is nullptr */
if( FTABLE_GET_REG == nullptr )
if (FTABLE_GET_REG == nullptr)
g65816i_set_execution_mode(EXECUTION_MODE_E);
return (this->*FTABLE_GET_REG)(regnum);
@ -878,7 +880,7 @@ bool g65816_device::get_x_flag() const
void g65816_device::g65816_restore_state()
{
// restore proper function pointers
g65816i_set_execution_mode((FLAG_M>>4) | (FLAG_X>>4));
g65816i_set_execution_mode((FLAG_M >> 4) | (FLAG_X >> 4));
// make sure the memory system can keep up
g65816i_jumping(REGISTER_PB | REGISTER_PC);
@ -1039,14 +1041,14 @@ void g65816_device::state_export(const device_state_entry &entry)
m_debugger_temp = m_db>>16;
break;
case G65816_P:
m_debugger_temp = (m_flag_n&0x80) |
((m_flag_v>>1)&0x40) |
m_debugger_temp = (m_flag_n & 0x80) |
((m_flag_v >> 1)&0x40) |
m_flag_m |
m_flag_x |
m_flag_d |
m_flag_i |
((!m_flag_z)<<1) |
((m_flag_c>>8)&1);
((!m_flag_z) << 1) |
((m_flag_c >> 8) & 1);
break;
case G65816_A:
m_debugger_temp = m_a | m_b;

View File

@ -6,7 +6,6 @@
#pragma once
#include "g65816ds.h"
#include "g65816cm.h"
/* ======================================================================== */
/* =============================== COPYRIGHT ============================== */

View File

@ -1,16 +1,22 @@
// license:BSD-3-Clause
// copyright-holders:Karl Stenerud
#ifndef MAME_CPU_G65816_G65816CM_H
#define MAME_CPU_G65816_G65816CM_H
#pragma once
#ifndef __G65816CM_H__
#define __G65816CM_H__
/* ======================================================================== */
/* ================================ INCLUDES ============================== */
/* ======================================================================== */
#include <climits>
#define g65816i_branching(A)
#define g65816i_jumping(A)
#undef G65816_CALL_DEBUGGER
#define G65816_CALL_DEBUGGER(x) debugger_instruction_hook(x)
#define g65816_read_8(addr) m_data.read_byte(addr)
@ -21,13 +27,6 @@
#define g65816_branching(A)
/* ======================================================================== */
/* ================================ INCLUDES ============================== */
/* ======================================================================== */
#include <climits>
/* ======================================================================== */
/* ================================ GENERAL =============================== */
/* ======================================================================== */
@ -242,4 +241,4 @@
/* ======================================================================== */
/* ================================== CPU ================================= */
/* ======================================================================== */
#endif /* __G65816CM_H__ */
#endif // MAME_CPU_G65816_G65816CM_H

View File

@ -15,7 +15,33 @@ All rights reserved.
#include "emu.h"
#include "g65816ds.h"
g65816_disassembler::g65816_disassembler(config *conf) : m_config(conf)
enum class g65816_disassembler::op : unsigned
{
ADC, AND, ASL, BCC, BCS, BEQ, BIT, BMI, BNE, BPL, BRA,
BRK, BRL, BVC, BVS, CLC, CLD, CLI, CLV, CMP, COP, CPX,
CPY, DEA, DEC, DEX, DEY, EOR, INA, INC, INX, INY, JML,
JMP, JSL, JSR, LDA, LDX, LDY, LSR, MVN, MVP, NOP, ORA,
PEA, PEI, PER, PHA, PHB, PHD, PHK, PHP, PHX, PHY, PLA,
PLB, PLD, PLP, PLX, PLY, REP, ROL, ROR, RTI, RTL, RTS,
SBC, SEC, SED, SEI, SEP, STA, STP, STX, STY, STZ, TAX,
TAY, TCS, TCD, TDC, TRB, TSB, TSC, TSX, TXA, TXS, TXY,
TYA, TYX, WAI, WDM, XBA, XCE
};
class g65816_disassembler::opcode_struct {
public:
op m_name;
u8 flag;
u8 ea;
opcode_struct(op n, u8 f, u8 e);
const char *name() const;
bool is_call() const;
bool is_return() const;
bool is_cond() const;
};
g65816_disassembler::g65816_disassembler(const config *conf) : m_config(conf)
{
}

View File

@ -1,9 +1,10 @@
// license:BSD-3-Clause
// copyright-holders:Karl Stenerud
#ifndef MAME_CPU_G65816_G65816DS_H
#define MAME_CPU_G65816_G65816DS_H
#pragma once
#ifndef __G65816DS_H__
#define __G65816DS_H__
/* ======================================================================== */
/* =============================== COPYRIGHT ============================== */
/* ======================================================================== */
@ -25,13 +26,14 @@ class g65816_disassembler : public util::disasm_interface
{
public:
class config {
protected:
~config() = default;
public:
virtual ~config() = default;
virtual bool get_m_flag() const = 0;
virtual bool get_x_flag() const = 0;
};
g65816_disassembler(config *conf);
g65816_disassembler(const config *conf);
virtual u32 opcode_alignment() const override;
virtual u32 interface_flags() const override;
@ -39,18 +41,7 @@ public:
virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer &params) override;
private:
enum class op : unsigned
{
ADC , AND , ASL , BCC , BCS , BEQ , BIT , BMI , BNE , BPL , BRA ,
BRK , BRL , BVC , BVS , CLC , CLD , CLI , CLV , CMP , COP , CPX ,
CPY , DEA , DEC , DEX , DEY , EOR , INA , INC , INX , INY , JML ,
JMP , JSL , JSR , LDA , LDX , LDY , LSR , MVN , MVP , NOP , ORA ,
PEA , PEI , PER , PHA , PHB , PHD , PHK , PHP , PHX , PHY , PLA ,
PLB , PLD , PLP , PLX , PLY , REP , ROL , ROR , RTI , RTL , RTS ,
SBC , SEC , SED , SEI , SEP , STA , STP , STX , STY , STZ , TAX ,
TAY , TCS , TCD , TDC , TRB , TSB , TSC , TSX , TXA , TXS , TXY ,
TYA , TYX , WAI , WDM , XBA , XCE
};
enum class op : unsigned;
enum
{
@ -66,26 +57,15 @@ private:
X /* check x bit */
};
class opcode_struct {
public:
op m_name;
u8 flag;
u8 ea;
opcode_struct(op n, u8 f, u8 e);
const char *name() const;
bool is_call() const;
bool is_return() const;
bool is_cond() const;
};
class opcode_struct;
static const char *const s_opnames[];
static const opcode_struct s_opcodes[256];
config *m_config;
const config *m_config;
std::string int_8_str(u8 val);
std::string int_16_str(u16 val);
};
#endif /* __G65816DS_H__ */
#endif // MAME_CPU_G65816_G65816DS_H

View File

@ -4,4 +4,4 @@
#include "g65816.h"
#include "g65816cm.h"
#define EXECUTION_MODE EXECUTION_MODE_M0X0
#include "g65816op.h"
#include "g65816op.ipp"

View File

@ -4,4 +4,4 @@
#include "g65816.h"
#include "g65816cm.h"
#define EXECUTION_MODE EXECUTION_MODE_M0X1
#include "g65816op.h"
#include "g65816op.ipp"

View File

@ -4,4 +4,4 @@
#include "g65816.h"
#include "g65816cm.h"
#define EXECUTION_MODE EXECUTION_MODE_M1X0
#include "g65816op.h"
#include "g65816op.ipp"

View File

@ -4,4 +4,4 @@
#include "g65816.h"
#include "g65816cm.h"
#define EXECUTION_MODE EXECUTION_MODE_M1X1
#include "g65816op.h"
#include "g65816op.ipp"

View File

@ -4,4 +4,4 @@
#include "g65816.h"
#include "g65816cm.h"
#define EXECUTION_MODE EXECUTION_MODE_E
#include "g65816op.h"
#include "g65816op.ipp"

View File

@ -9,6 +9,8 @@
TODO:
- use logmacro and be quiet by default, same for H8 peripherals that
currently have "static constexpr int V"
- Verify H8H opcode map, some opcodes currently for H8H are H8S-only.
Base H8/300 (eg. H8/325) opcode map is correct.
- NVRAM won't work properly when it goes into SSBY (software standby
mode) and the power button triggers an IRQ to wake up instead of RES.
Obviously, MAME always starts at reset-phase at power-on, so it's more

View File

@ -353,9 +353,9 @@ macro jsr32 %opc %spreg
m_TMP2 = r32_r(m_IR[1] >> 4);
m_TMP2 -= 4;
r32_w(m_IR[1] >> 4, m_TMP2);
set_nzv32(m_TMP1);
write16(m_TMP2, m_TMP1 >> 16);
write16(m_TMP2+2, m_TMP1);
set_nzv32(m_TMP1);
prefetch_done();
01006f00 ffffff88 0 mov.l r32d16h r32l h
@ -1295,18 +1295,14 @@ macro jsr32 %opc %spreg
prefetch
1750 fff0 0 extu.w r16l - h
m_CCR &= ~(F_N|F_Z|F_V);
m_TMP1 = u8(r16_r(m_IR[0]));
if(!m_TMP1)
m_CCR |= F_Z;
set_nzv16(m_TMP1);
r16_w(m_IR[0], m_TMP1);
prefetch
1770 fff8 0 extu.l r32l - h
m_CCR &= ~(F_N|F_Z|F_V);
m_TMP1 = u16(r32_r(m_IR[0]));
if(!m_TMP1)
m_CCR |= F_Z;
set_nzv32(m_TMP1);
r32_w(m_IR[0], m_TMP1);
prefetch
@ -1323,18 +1319,14 @@ macro jsr32 %opc %spreg
prefetch
17d0 fff0 0 exts.w r16l - h
m_CCR &= ~(F_N|F_Z|F_V);
m_TMP1 = s8(r16_r(m_IR[0]));
if(!m_TMP1)
m_CCR |= F_Z;
set_nzv16(m_TMP1);
r16_w(m_IR[0], m_TMP1);
prefetch
17f0 fff8 0 exts.l r32l - h
m_CCR &= ~(F_N|F_Z|F_V);
m_TMP1 = s16(r32_r(m_IR[0]));
if(!m_TMP1)
m_CCR |= F_Z;
set_nzv32(m_TMP1);
r32_w(m_IR[0], m_TMP1);
prefetch
@ -1584,20 +1576,19 @@ macro jsr32 %opc %spreg
5670 ffff 0 rte - - h
fetch
m_TMP1 = r32_r(7);
if(exr_in_stack()) {
m_EXR = (read16(m_TMP1) >> 8) | EXR_NC;
m_TMP1 += 2;
}
m_TMP2 = read16(m_TMP1);
m_CCR = m_TMP2 >> 8;
if(m_mode_advanced) {
if(exr_in_stack()) {
m_EXR = (read16(m_TMP1) >> 8) | EXR_NC;
m_TMP1 += 2;
}
m_TMP2 = read16(m_TMP1);
m_CCR = m_TMP2 >> 8;
m_TMP2 = (m_TMP2 & 0xff) << 16;
m_TMP2 |= read16(m_TMP1+2);
r32_w(7, m_TMP1+4);
} else {
m_TMP2 = read16(m_TMP1);
r32_w(7, m_TMP1+2);
m_TMP2 = read16(m_TMP1+2);
}
r32_w(7, m_TMP1+4);
internal(1);
m_PC = m_TMP2;
update_irq_filter();
@ -1753,7 +1744,7 @@ macro jsr32 %opc %spreg
5f00 ff00 0 jsr abs8i - h
fetch_noinc
m_TMP2 = m_PPC;
m_TMP2 = m_PC;
if(m_mode_advanced) {
m_TMP1 = read16(m_IR[0] & 0xff) << 16;
m_TMP1 |= read16((m_IR[0] & 0xff) + 2);
@ -1879,67 +1870,67 @@ macro jsr32 %opc %spreg
r8_w(m_IR[0], m_TMP1);
prefetch_done();
6a106300 ffffff0f 1 btst r8h abs16 h
6a106300 ffffff0f 1 btst r8h abs16 s20
m_TMP2 = s16(m_IR[1]);
m_TMP1 = read8(m_TMP2);
btst r8_r(m_IR[2] >> 4)
prefetch
6a107300 ffffff8f 1 btst imm3 abs16 h
6a107300 ffffff8f 1 btst imm3 abs16 s20
m_TMP2 = s16(m_IR[1]);
m_TMP1 = read8(m_TMP2);
btst m_IR[2] >> 4
prefetch
6a107400 ffffff8f 1 bor imm3 abs16 h
6a107400 ffffff8f 1 bor imm3 abs16 s20
m_TMP2 = s16(m_IR[1]);
m_TMP1 = read8(m_TMP2);
bor m_IR[2] >> 4
prefetch
6a107480 ffffff8f 1 bior imm3 abs16 h
6a107480 ffffff8f 1 bior imm3 abs16 s20
m_TMP2 = s16(m_IR[1]);
m_TMP1 = read8(m_TMP2);
bior m_IR[2] >> 4
prefetch
6a107500 ffffff8f 1 bxor imm3 abs16 h
6a107500 ffffff8f 1 bxor imm3 abs16 s20
m_TMP2 = s16(m_IR[1]);
m_TMP1 = read8(m_TMP2);
bxor m_IR[2] >> 4
prefetch
6a107580 ffffff8f 1 bixor imm3 abs16 h
6a107580 ffffff8f 1 bixor imm3 abs16 s20
m_TMP2 = s16(m_IR[1]);
m_TMP1 = read8(m_TMP2);
bixor m_IR[2] >> 4
prefetch
6a107600 ffffff8f 1 band imm3 abs16 h
6a107600 ffffff8f 1 band imm3 abs16 s20
m_TMP2 = s16(m_IR[1]);
m_TMP1 = read8(m_TMP2);
band m_IR[2] >> 4
prefetch
6a107680 ffffff8f 1 biand imm3 abs16 h
6a107680 ffffff8f 1 biand imm3 abs16 s20
m_TMP2 = s16(m_IR[1]);
m_TMP1 = read8(m_TMP2);
biand m_IR[2] >> 4
prefetch
6a107700 ffffff8f 1 bld imm3 abs16 h
6a107700 ffffff8f 1 bld imm3 abs16 s20
m_TMP2 = s16(m_IR[1]);
m_TMP1 = read8(m_TMP2);
bld m_IR[2] >> 4
prefetch
6a107780 ffffff8f 1 bild imm3 abs16 h
6a107780 ffffff8f 1 bild imm3 abs16 s20
m_TMP2 = s16(m_IR[1]);
m_TMP1 = read8(m_TMP2);
bild m_IR[2] >> 4
prefetch
6a186000 ffffff0f 1 bset r8h abs16 h
6a186000 ffffff0f 1 bset r8h abs16 s20
m_TMP2 = s16(m_IR[1]);
m_TMP1 = read8(m_TMP2);
prefetch_start
@ -1947,7 +1938,7 @@ macro jsr32 %opc %spreg
write8(m_TMP2, m_TMP1);
prefetch_done();
6a186100 ffffff0f 1 bnot r8h abs16 h
6a186100 ffffff0f 1 bnot r8h abs16 s20
m_TMP2 = s16(m_IR[1]);
m_TMP1 = read8(m_TMP2);
prefetch_start
@ -1955,7 +1946,7 @@ macro jsr32 %opc %spreg
write8(m_TMP2, m_TMP1);
prefetch_done();
6a186200 ffffff0f 1 bclr r8h abs16 h
6a186200 ffffff0f 1 bclr r8h abs16 s20
m_TMP2 = s16(m_IR[1]);
m_TMP1 = read8(m_TMP2);
prefetch_start
@ -1963,15 +1954,15 @@ macro jsr32 %opc %spreg
write8(m_TMP2, m_TMP1);
prefetch_done();
6a186700 ffffff8f 1 bst imm3 abs16 h
m_TMP2 = s16(m_IR[2]);
6a186700 ffffff8f 1 bst imm3 abs16 s20
m_TMP2 = s16(m_IR[1]);
m_TMP1 = read8(m_TMP2);
prefetch_start
bst m_IR[2] >> 4
write8(m_TMP2, m_TMP1);
prefetch_done();
6a186780 ffffff8f 1 bist imm3 abs16 h
6a186780 ffffff8f 1 bist imm3 abs16 s20
m_TMP2 = s16(m_IR[1]);
m_TMP1 = read8(m_TMP2);
prefetch_start
@ -1979,7 +1970,7 @@ macro jsr32 %opc %spreg
write8(m_TMP2, m_TMP1);
prefetch_done();
6a187000 ffffff8f 1 bset imm3 abs16 h
6a187000 ffffff8f 1 bset imm3 abs16 s20
m_TMP2 = s16(m_IR[1]);
m_TMP1 = read8(m_TMP2);
prefetch_start
@ -1987,7 +1978,7 @@ macro jsr32 %opc %spreg
write8(m_TMP2, m_TMP1);
prefetch_done();
6a187100 ffffff8f 1 bnot imm3 abs16 h
6a187100 ffffff8f 1 bnot imm3 abs16 s20
m_TMP2 = s16(m_IR[1]);
m_TMP1 = read8(m_TMP2);
prefetch_start
@ -1995,7 +1986,7 @@ macro jsr32 %opc %spreg
write8(m_TMP2, m_TMP1);
prefetch_done();
6a187200 ffffff8f 1 bclr imm3 abs16 h
6a187200 ffffff8f 1 bclr imm3 abs16 s20
m_TMP2 = s16(m_IR[1]);
m_TMP1 = read8(m_TMP2);
prefetch_start
@ -2010,67 +2001,67 @@ macro jsr32 %opc %spreg
r8_w(m_IR[0], m_TMP1);
prefetch_done();
6a306300 ffffff0f 2 btst r8h abs32 h
6a306300 ffffff0f 2 btst r8h abs32 s20
m_TMP2 = (m_IR[1] << 16) | m_IR[2];
m_TMP1 = read8(m_TMP2);
btst r8_r(m_IR[3] >> 4)
prefetch
6a307300 ffffff8f 2 btst imm3 abs32 h
6a307300 ffffff8f 2 btst imm3 abs32 s20
m_TMP2 = (m_IR[1] << 16) | m_IR[2];
m_TMP1 = read8(m_TMP2);
btst m_IR[3] >> 4
prefetch
6a307400 ffffff8f 2 bor imm3 abs32 h
6a307400 ffffff8f 2 bor imm3 abs32 s20
m_TMP2 = (m_IR[1] << 16) | m_IR[2];
m_TMP1 = read8(m_TMP2);
bor m_IR[3] >> 4
prefetch
6a307480 ffffff8f 2 bior imm3 abs32 h
6a307480 ffffff8f 2 bior imm3 abs32 s20
m_TMP2 = (m_IR[1] << 16) | m_IR[2];
m_TMP1 = read8(m_TMP2);
bior m_IR[3] >> 4
prefetch
6a307500 ffffff8f 2 bxor imm3 abs32 h
6a307500 ffffff8f 2 bxor imm3 abs32 s20
m_TMP2 = (m_IR[1] << 16) | m_IR[2];
m_TMP1 = read8(m_TMP2);
bxor m_IR[3] >> 4
prefetch
6a307580 ffffff8f 2 bixor imm3 abs32 h
6a307580 ffffff8f 2 bixor imm3 abs32 s20
m_TMP2 = (m_IR[1] << 16) | m_IR[2];
m_TMP1 = read8(m_TMP2);
bixor m_IR[3] >> 4
prefetch
6a307600 ffffff8f 2 band imm3 abs32 h
6a307600 ffffff8f 2 band imm3 abs32 s20
m_TMP2 = (m_IR[1] << 16) | m_IR[2];
m_TMP1 = read8(m_TMP2);
band m_IR[3] >> 4
prefetch
6a307680 ffffff8f 2 biand imm3 abs32 h
6a307680 ffffff8f 2 biand imm3 abs32 s20
m_TMP2 = (m_IR[1] << 16) | m_IR[2];
m_TMP1 = read8(m_TMP2);
biand m_IR[3] >> 4
prefetch
6a307700 ffffff8f 2 bld imm3 abs32 h
6a307700 ffffff8f 2 bld imm3 abs32 s20
m_TMP2 = (m_IR[1] << 16) | m_IR[2];
m_TMP1 = read8(m_TMP2);
bld m_IR[3] >> 4
prefetch
6a307780 ffffff8f 2 bild imm3 abs32 h
6a307780 ffffff8f 2 bild imm3 abs32 s20
m_TMP2 = (m_IR[1] << 16) | m_IR[2];
m_TMP1 = read8(m_TMP2);
bild m_IR[3] >> 4
prefetch
6a386000 ffffff0f 2 bset r8h abs32 h
6a386000 ffffff0f 2 bset r8h abs32 s20
m_TMP2 = (m_IR[1] << 16) | m_IR[2];
m_TMP1 = read8(m_TMP2);
prefetch_start
@ -2078,7 +2069,7 @@ macro jsr32 %opc %spreg
write8(m_TMP2, m_TMP1);
prefetch_done();
6a386100 ffffff0f 2 bnot r8h abs32 h
6a386100 ffffff0f 2 bnot r8h abs32 s20
m_TMP2 = (m_IR[1] << 16) | m_IR[2];
m_TMP1 = read8(m_TMP2);
prefetch_start
@ -2086,7 +2077,7 @@ macro jsr32 %opc %spreg
write8(m_TMP2, m_TMP1);
prefetch_done();
6a386200 ffffff0f 2 bclr r8h abs32 h
6a386200 ffffff0f 2 bclr r8h abs32 s20
m_TMP2 = (m_IR[1] << 16) | m_IR[2];
m_TMP1 = read8(m_TMP2);
prefetch_start
@ -2094,7 +2085,7 @@ macro jsr32 %opc %spreg
write8(m_TMP2, m_TMP1);
prefetch_done();
6a386700 ffffff8f 2 bst imm3 abs32 h
6a386700 ffffff8f 2 bst imm3 abs32 s20
m_TMP2 = (m_IR[1] << 16) | m_IR[2];
m_TMP1 = read8(m_TMP2);
prefetch_start
@ -2102,7 +2093,7 @@ macro jsr32 %opc %spreg
write8(m_TMP2, m_TMP1);
prefetch_done();
6a386780 ffffff8f 2 bist imm3 abs32 h
6a386780 ffffff8f 2 bist imm3 abs32 s20
m_TMP2 = (m_IR[1] << 16) | m_IR[2];
m_TMP1 = read8(m_TMP2);
prefetch_start
@ -2110,7 +2101,7 @@ macro jsr32 %opc %spreg
write8(m_TMP2, m_TMP1);
prefetch_done();
6a387000 ffffff8f 2 bset imm3 abs32 h
6a387000 ffffff8f 2 bset imm3 abs32 s20
m_TMP2 = (m_IR[1] << 16) | m_IR[2];
m_TMP1 = read8(m_TMP2);
prefetch_start
@ -2118,7 +2109,7 @@ macro jsr32 %opc %spreg
write8(m_TMP2, m_TMP1);
prefetch_done();
6a387100 ffffff8f 2 bnot imm3 abs32 h
6a387100 ffffff8f 2 bnot imm3 abs32 s20
m_TMP2 = (m_IR[1] << 16) | m_IR[2];
m_TMP1 = read8(m_TMP2);
prefetch_start
@ -2126,7 +2117,7 @@ macro jsr32 %opc %spreg
write8(m_TMP2, m_TMP1);
prefetch_done();
6a387200 ffffff8f 2 bclr imm3 abs32 h
6a387200 ffffff8f 2 bclr imm3 abs32 s20
m_TMP2 = (m_IR[1] << 16) | m_IR[2];
m_TMP1 = read8(m_TMP2);
prefetch_start

View File

@ -30,7 +30,7 @@ DEFINE_DEVICE_TYPE(H83212, h83212_device, "h83212", "Hitachi H8/3212")
DEFINE_DEVICE_TYPE(H83202, h83202_device, "h83202", "Hitachi H8/3202")
h83217_device::h83217_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 start) :
h83217_device::h83217_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 rom_size, u32 ram_size) :
h8_device(mconfig, type, tag, owner, clock, address_map_constructor(FUNC(h83217_device::map), this)),
m_intc(*this, "intc"),
m_port(*this, "port%u", 1),
@ -39,40 +39,44 @@ h83217_device::h83217_device(const machine_config &mconfig, device_type type, co
m_timer16_0(*this, "timer16:0"),
m_watchdog(*this, "watchdog"),
m_ram_view(*this, "ram_view"),
m_ram_start(start),
m_rom_size(rom_size),
m_ram_size(ram_size),
m_md(3)
{
}
h83217_device::h83217_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h83217_device(mconfig, H83217, tag, owner, clock, 0xf780)
h83217_device(mconfig, H83217, tag, owner, clock, 0xf000, 0x800)
{
}
h83216_device::h83216_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h83217_device(mconfig, H83216, tag, owner, clock, 0xf780)
h83217_device(mconfig, H83216, tag, owner, clock, 0xc000, 0x800)
{
}
h83214_device::h83214_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h83217_device(mconfig, H83214, tag, owner, clock, 0xfb80)
h83217_device(mconfig, H83214, tag, owner, clock, 0x8000, 0x400)
{
}
h83212_device::h83212_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h83217_device(mconfig, H83212, tag, owner, clock, 0xfd80)
h83217_device(mconfig, H83212, tag, owner, clock, 0x4000, 0x200)
{
}
h83202_device::h83202_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h83217_device(mconfig, H83202, tag, owner, clock, 0xfd80)
h83217_device(mconfig, H83202, tag, owner, clock, 0x4000, 0x200)
{
}
void h83217_device::map(address_map &map)
{
map(m_ram_start, 0xff7f).view(m_ram_view);
m_ram_view[0](m_ram_start, 0xff7f).ram().share(m_internal_ram);
if(m_md >= 2)
map(0x0000, m_rom_size - 1).rom();
map(0xff80 - m_ram_size, 0xff7f).view(m_ram_view);
m_ram_view[0](0xff80 - m_ram_size, 0xff7f).ram().share(m_internal_ram);
map(0xff90, 0xff90).rw(m_timer16_0, FUNC(h8325_timer16_channel_device::tcr_r), FUNC(h8325_timer16_channel_device::tcr_w));
map(0xff91, 0xff91).rw(m_timer16_0, FUNC(h8325_timer16_channel_device::tsr_r), FUNC(h8325_timer16_channel_device::tsr_w));
@ -254,7 +258,7 @@ void h83217_device::syscr_w(u8 data)
logerror("syscr = %02x\n", data);
// RAME
if (data & 1)
if(data & 1)
m_ram_view.select(0);
else
m_ram_view.disable();

View File

@ -61,7 +61,7 @@ public:
u8 mdcr_r();
protected:
h83217_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 start);
h83217_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 rom_size, u32 ram_size);
required_device<h8_intc_device> m_intc;
required_device_array<h8_port_device, 7> m_port;
@ -72,7 +72,8 @@ protected:
memory_view m_ram_view;
u32 m_ram_start;
u32 m_rom_size;
u32 m_ram_size;
u8 m_md;
u8 m_stcr;
u8 m_syscr;

View File

@ -25,7 +25,7 @@ DEFINE_DEVICE_TYPE(H8323, h8323_device, "h8323", "Hitachi H8/323")
DEFINE_DEVICE_TYPE(H8322, h8322_device, "h8322", "Hitachi H8/322")
h8325_device::h8325_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 start) :
h8325_device::h8325_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 rom_size, u32 ram_size) :
h8_device(mconfig, type, tag, owner, clock, address_map_constructor(FUNC(h8325_device::map), this)),
m_intc(*this, "intc"),
m_port(*this, "port%u", 1),
@ -33,45 +33,49 @@ h8325_device::h8325_device(const machine_config &mconfig, device_type type, cons
m_timer16(*this, "timer16"),
m_timer16_0(*this, "timer16:0"),
m_ram_view(*this, "ram_view"),
m_ram_start(start),
m_rom_size(rom_size),
m_ram_size(ram_size),
m_md(3)
{
}
h83257_device::h83257_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8325_device(mconfig, H83257, tag, owner, clock, 0xf780)
h8325_device(mconfig, H83257, tag, owner, clock, 0xf000, 0x800)
{
}
h83256_device::h83256_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8325_device(mconfig, H83256, tag, owner, clock, 0xf780)
h8325_device(mconfig, H83256, tag, owner, clock, 0xc000, 0x800)
{
}
h8325_device::h8325_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8325_device(mconfig, H8325, tag, owner, clock, 0xfb80)
h8325_device(mconfig, H8325, tag, owner, clock, 0x8000, 0x400)
{
}
h8324_device::h8324_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8325_device(mconfig, H8324, tag, owner, clock, 0xfb80)
h8325_device(mconfig, H8324, tag, owner, clock, 0x6000, 0x400)
{
}
h8323_device::h8323_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8325_device(mconfig, H8323, tag, owner, clock, 0xfd80)
h8325_device(mconfig, H8323, tag, owner, clock, 0x4000, 0x200)
{
}
h8322_device::h8322_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8325_device(mconfig, H8322, tag, owner, clock, 0xfe80)
h8325_device(mconfig, H8322, tag, owner, clock, 0x2000, 0x100)
{
}
void h8325_device::map(address_map &map)
{
map(m_ram_start, 0xff7f).view(m_ram_view);
m_ram_view[0](m_ram_start, 0xff7f).ram().share(m_internal_ram);
if(m_md >= 2)
map(0x0000, m_rom_size - 1).rom();
map(0xff80 - m_ram_size, 0xff7f).view(m_ram_view);
m_ram_view[0](0xff80 - m_ram_size, 0xff7f).ram().share(m_internal_ram);
map(0xff90, 0xff90).rw(m_timer16_0, FUNC(h8325_timer16_channel_device::tcr_r), FUNC(h8325_timer16_channel_device::tcr_w));
map(0xff91, 0xff91).rw(m_timer16_0, FUNC(h8325_timer16_channel_device::tsr_r), FUNC(h8325_timer16_channel_device::tsr_w));
@ -221,7 +225,7 @@ void h8325_device::syscr_w(u8 data)
logerror("syscr = %02x\n", data);
// RAME
if (data & 1)
if(data & 1)
m_ram_view.select(0);
else
m_ram_view.disable();

View File

@ -59,7 +59,7 @@ public:
u8 mdcr_r();
protected:
h8325_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 start);
h8325_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 rom_size, u32 ram_size);
virtual u64 execute_clocks_to_cycles(u64 clocks) const noexcept override { return (clocks + 2 - 1) / 2; }
virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 2); }
@ -72,7 +72,8 @@ protected:
memory_view m_ram_view;
u32 m_ram_start;
u32 m_rom_size;
u32 m_ram_size;
u8 m_md;
u8 m_mds;
u8 m_syscr;

View File

@ -148,7 +148,7 @@ void h8_disassembler::disassemble_am(std::ostream &stream, int am, offs_t pc, co
break;
case DASM_abs16:
if(slot == 3)
if(slot == 2)
{
if(m_advanced)
util::stream_format(stream, "@h'%06x", s32(s16(opcodes.r16(epc-4))) & 0xffffff);

View File

@ -38,37 +38,37 @@ protected:
O(add_w_imm16_r16l); O(add_l_r32h_r32l); O(add_l_imm32_r32l);
O(adds_l_four_r32l); O(adds_l_one_r32l); O(adds_l_two_r32l);
O(and_w_imm16_r16l); O(and_l_r32h_r32l); O(and_l_imm32_r32l); O(and_w_r16h_r16l);
O(band_imm3_abs16); O(band_imm3_abs32); O(band_imm3_r32ihh);
O(band_imm3_r32ihh);
O(bcc_rel16);
O(bclr_imm3_abs16); O(bclr_r8h_abs16); O(bclr_imm3_abs32); O(bclr_imm3_r32ihh); O(bclr_r8h_abs32); O(bclr_r8h_r32ihh);
O(bclr_imm3_r32ihh); O(bclr_r8h_r32ihh);
O(bcs_rel16);
O(beq_rel16);
O(bf_rel16);
O(bge_rel16);
O(bgt_rel16);
O(bhi_rel16);
O(biand_imm3_abs16); O(biand_imm3_abs32); O(biand_imm3_r32ihh);
O(bild_imm3_abs16); O(bild_imm3_abs32); O(bild_imm3_r32ihh);
O(bior_imm3_abs16); O(bior_imm3_abs32); O(bior_imm3_r32ihh);
O(bist_imm3_abs16); O(bist_imm3_abs32); O(bist_imm3_r32ihh);
O(bixor_imm3_abs16); O(bixor_imm3_abs32); O(bixor_imm3_r32ihh);
O(bld_imm3_abs16); O(bld_imm3_abs32); O(bld_imm3_r32ihh);
O(biand_imm3_r32ihh);
O(bild_imm3_r32ihh);
O(bior_imm3_r32ihh);
O(bist_imm3_r32ihh);
O(bixor_imm3_r32ihh);
O(bld_imm3_r32ihh);
O(ble_rel16);
O(bls_rel16);
O(blt_rel16);
O(bmi_rel16);
O(bne_rel16);
O(bnot_imm3_abs16); O(bnot_r8h_abs16); O(bnot_imm3_abs32); O(bnot_imm3_r32ihh); O(bnot_r8h_abs32); O(bnot_r8h_r32ihh);
O(bor_imm3_abs16); O(bor_imm3_abs32); O(bor_imm3_r32ihh);
O(bnot_imm3_r32ihh); O(bnot_r8h_r32ihh);
O(bor_imm3_r32ihh);
O(bpl_rel16);
O(bset_imm3_abs16); O(bset_r8h_abs16); O(bset_imm3_abs32); O(bset_imm3_r32ihh); O(bset_r8h_abs32); O(bset_r8h_r32ihh);
O(bset_imm3_r32ihh); O(bset_r8h_r32ihh);
O(bsr_rel16); O(bsr_rel8);
O(bst_imm3_abs16); O(bst_imm3_abs32); O(bst_imm3_r32ihh);
O(bst_imm3_r32ihh);
O(bt_rel16);
O(btst_imm3_abs16); O(btst_r8h_abs16); O(btst_imm3_abs32); O(btst_imm3_r32ihh); O(btst_r8h_abs32); O(btst_r8h_r32ihh);
O(btst_imm3_r32ihh); O(btst_r8h_r32ihh);
O(bvc_rel16);
O(bvs_rel16);
O(bxor_imm3_abs16); O(bxor_imm3_abs32); O(bxor_imm3_r32ihh);
O(bxor_imm3_r32ihh);
O(cmp_w_imm16_r16l); O(cmp_l_r32h_r32l); O(cmp_l_imm32_r32l);
O(dec_w_one_r16l); O(dec_w_two_r16l); O(dec_l_one_r32l); O(dec_l_two_r32l);
O(divxs_b_r8h_r16l); O(divxs_w_r16h_r32l);

View File

@ -33,7 +33,22 @@ protected:
virtual void do_exec_partial() override;
#define O(o) void o ## _full(); void o ## _partial()
O(andc_imm8_exr);
O(band_imm3_abs16); O(band_imm3_abs32);
O(bclr_imm3_abs16); O(bclr_r8h_abs16); O(bclr_imm3_abs32); O(bclr_r8h_abs32);
O(biand_imm3_abs16); O(biand_imm3_abs32);
O(bild_imm3_abs16); O(bild_imm3_abs32);
O(bior_imm3_abs16); O(bior_imm3_abs32);
O(bist_imm3_abs16); O(bist_imm3_abs32);
O(bixor_imm3_abs16); O(bixor_imm3_abs32);
O(bld_imm3_abs16); O(bld_imm3_abs32);
O(bnot_imm3_abs16); O(bnot_r8h_abs16); O(bnot_imm3_abs32); O(bnot_r8h_abs32);
O(bor_imm3_abs16); O(bor_imm3_abs32);
O(bset_imm3_abs16); O(bset_r8h_abs16); O(bset_imm3_abs32); O(bset_r8h_abs32);
O(bst_imm3_abs16); O(bst_imm3_abs32);
O(btst_imm3_abs16); O(btst_r8h_abs16); O(btst_imm3_abs32); O(btst_r8h_abs32);
O(bxor_imm3_abs16); O(bxor_imm3_abs32);
O(ldc_imm8_exr); O(ldc_r8l_exr); O(ldc_w_abs16_exr); O(ldc_w_abs32_exr); O(ldc_w_r32d16h_exr); O(ldc_w_r32d32hh_exr); O(ldc_w_r32ih_exr); O(ldc_w_r32ph_exr);
O(ldm_l_spp_r32n2l); O(ldm_l_spp_r32n3l); O(ldm_l_spp_r32n4l);
O(orc_imm8_exr);

View File

@ -22,7 +22,7 @@ DEFINE_DEVICE_TYPE(H8S2318, h8s2318_device, "h8s2318", "Hitachi H8S/2318")
DEFINE_DEVICE_TYPE(H8S2319, h8s2319_device, "h8s2319", "Hitachi H8S/2319")
h8s2319_device::h8s2319_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor map_delegate, u32 start) :
h8s2319_device::h8s2319_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor map_delegate, u32 rom_size, u32 ram_size) :
h8s2000_device(mconfig, type, tag, owner, clock, map_delegate),
m_intc(*this, "intc"),
m_adc(*this, "adc"),
@ -34,64 +34,69 @@ h8s2319_device::h8s2319_device(const machine_config &mconfig, device_type type,
m_timer16c(*this, "timer16:%u", 0),
m_watchdog(*this, "watchdog"),
m_ram_view(*this, "ram_view"),
m_ram_start(start)
m_rom_size(rom_size),
m_ram_size(ram_size),
m_md(rom_size ? 7 : 4)
{
}
h8s2319_device::h8s2319_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 start) :
h8s2319_device(mconfig, type, tag, owner, clock, address_map_constructor(FUNC(h8s2319_device::map), this), start)
h8s2319_device::h8s2319_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 rom_size, u32 ram_size) :
h8s2319_device(mconfig, type, tag, owner, clock, address_map_constructor(FUNC(h8s2319_device::map), this), rom_size, ram_size)
{
}
h8s2319_device::h8s2319_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8s2319_device(mconfig, H8S2319, tag, owner, clock, 0xffdc00)
h8s2319_device(mconfig, H8S2319, tag, owner, clock, 0x80000, 0x2000)
{
}
h8s2310_device::h8s2310_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8s2319_device(mconfig, H8S2310, tag, owner, clock, 0xfff400)
h8s2319_device(mconfig, H8S2310, tag, owner, clock, 0, 0x800)
{
}
h8s2311_device::h8s2311_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8s2319_device(mconfig, H8S2311, tag, owner, clock, 0xfff400)
h8s2319_device(mconfig, H8S2311, tag, owner, clock, 0x8000, 0x800)
{
}
h8s2312_device::h8s2312_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8s2319_device(mconfig, H8S2312, tag, owner, clock, 0xffdc00)
h8s2319_device(mconfig, H8S2312, tag, owner, clock, 0, 0x2000)
{
}
h8s2313_device::h8s2313_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8s2319_device(mconfig, H8S2313, tag, owner, clock, 0xfff400)
h8s2319_device(mconfig, H8S2313, tag, owner, clock, 0x10000, 0x800)
{
}
h8s2315_device::h8s2315_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8s2319_device(mconfig, H8S2315, tag, owner, clock, 0xffdc00)
h8s2319_device(mconfig, H8S2315, tag, owner, clock, 0x60000, 0x2000)
{
}
h8s2316_device::h8s2316_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8s2319_device(mconfig, H8S2316, tag, owner, clock, 0xffdc00)
h8s2319_device(mconfig, H8S2316, tag, owner, clock, 0x10000, 0x2000)
{
}
h8s2317_device::h8s2317_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8s2319_device(mconfig, H8S2317, tag, owner, clock, 0xffdc00)
h8s2319_device(mconfig, H8S2317, tag, owner, clock, 0x20000, 0x2000)
{
}
h8s2318_device::h8s2318_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8s2319_device(mconfig, H8S2318, tag, owner, clock, 0xffdc00)
h8s2319_device(mconfig, H8S2318, tag, owner, clock, 0x40000, 0x2000)
{
}
void h8s2319_device::map(address_map &map)
{
map(m_ram_start, 0xfffbff).view(m_ram_view);
m_ram_view[0](m_ram_start, 0xfffbff).ram().share(m_internal_ram);
if(m_rom_size && m_md >= 6)
map(0x000000, m_rom_size - 1).rom();
map(0xfffc00 - m_ram_size, 0xfffbff).view(m_ram_view);
m_ram_view[0](0xfffc00 - m_ram_size, 0xfffbff).ram().share(m_internal_ram);
map(0xfffe80, 0xfffe80).rw(m_timer16c[3], FUNC(h8_timer16_channel_device::tcr_r), FUNC(h8_timer16_channel_device::tcr_w));
map(0xfffe81, 0xfffe81).rw(m_timer16c[3], FUNC(h8_timer16_channel_device::tmdr_r), FUNC(h8_timer16_channel_device::tmdr_w));
@ -135,6 +140,7 @@ void h8s2319_device::map(address_map &map)
map(0xffff37, 0xffff37).rw(m_dtc, FUNC(h8_dtc_device::dtvecr_r), FUNC(h8_dtc_device::dtvecr_w));
map(0xffff38, 0xffff38).rw(FUNC(h8s2319_device::sbycr_r), FUNC(h8s2319_device::sbycr_w));
map(0xffff39, 0xffff39).rw(FUNC(h8s2319_device::syscr_r), FUNC(h8s2319_device::syscr_w));
map(0xffff3b, 0xffff3b).r(FUNC(h8s2319_device::mdcr_r));
map(0xffff50, 0xffff50).r(m_portn[0], FUNC(h8_port_device::port_r));
map(0xffff51, 0xffff51).r(m_portn[1], FUNC(h8_port_device::port_r));
@ -369,7 +375,7 @@ void h8s2319_device::internal_update(u64 current_time)
add_event(event_time, m_sci[1]->internal_update(current_time));
// SCI2 used by H8S-2329
if (m_sci[2])
if(m_sci[2])
add_event(event_time, m_sci[2]->internal_update(current_time));
add_event(event_time, m_timer8[0]->internal_update(current_time));
@ -407,6 +413,7 @@ void h8s2319_device::device_start()
m_sbycr = 0;
m_syscr = 0;
save_item(NAME(m_md));
save_item(NAME(m_sbycr));
save_item(NAME(m_syscr));
}
@ -445,7 +452,7 @@ void h8s2319_device::syscr_w(u8 data)
logerror("syscr = %02x\n", data);
// RAME
if (data & 1)
if(data & 1)
m_ram_view.select(0);
else
m_ram_view.disable();
@ -456,3 +463,10 @@ void h8s2319_device::syscr_w(u8 data)
m_syscr = data;
update_irq_filter();
}
u8 h8s2319_device::mdcr_r()
{
if(!machine().side_effects_disabled())
logerror("mdcr_r\n");
return (m_md & 0x07) | 0x80;
}

View File

@ -64,10 +64,14 @@ public:
auto read_portg() { return m_read_port [PORT_G].bind(); }
auto write_portg() { return m_write_port[PORT_G].bind(); }
// MD pins, default mode 7 (single chip), or mode 4 (ROMless)
void set_mode(u8 mode) { m_md = mode & 7; }
u8 sbycr_r();
void sbycr_w(u8 data);
u8 syscr_r();
void syscr_w(u8 data);
u8 mdcr_r();
protected:
required_device<h8s_intc_device> m_intc;
@ -82,12 +86,14 @@ protected:
memory_view m_ram_view;
u32 m_ram_start;
u32 m_rom_size;
u32 m_ram_size;
u8 m_md;
u8 m_sbycr;
u8 m_syscr;
h8s2319_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor map_delegate, u32 start);
h8s2319_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 start);
h8s2319_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor map_delegate, u32 rom_size, u32 ram_size);
h8s2319_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 rom_size, u32 ram_size);
virtual bool exr_in_stack() const override;
virtual void update_irq_filter() override;

View File

@ -23,21 +23,21 @@ DEFINE_DEVICE_TYPE(H8S2328, h8s2328_device, "h8s2328", "Hitachi H8S/2328")
DEFINE_DEVICE_TYPE(H8S2329, h8s2329_device, "h8s2329", "Hitachi H8S/2329")
h8s2321_device::h8s2321_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor map_delegate, u32 start) :
h8s2319_device(mconfig, type, tag, owner, clock, map_delegate, start),
h8s2321_device::h8s2321_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor map_delegate, u32 rom_size, u32 ram_size) :
h8s2319_device(mconfig, type, tag, owner, clock, map_delegate, rom_size, ram_size),
m_port5(*this, "port5"),
m_port6(*this, "port6")
{
}
h8s2321_device::h8s2321_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8s2321_device(mconfig, H8S2321, tag, owner, clock, address_map_constructor(FUNC(h8s2321_device::map_2321), this), 0xffec00)
h8s2321_device(mconfig, H8S2321, tag, owner, clock, address_map_constructor(FUNC(h8s2321_device::map_2321), this), 0, 0x1000)
{
}
h8s2320_device::h8s2320_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 start) :
h8s2321_device(mconfig, type, tag, owner, clock, address_map_constructor(FUNC(h8s2320_device::map_2320), this), start),
h8s2320_device::h8s2320_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 rom_size, u32 ram_size) :
h8s2321_device(mconfig, type, tag, owner, clock, address_map_constructor(FUNC(h8s2320_device::map_2320), this), rom_size, ram_size),
m_dma(*this, "dma"),
m_dmac(*this, "dma:%u", 0),
m_tend_cb(*this)
@ -45,43 +45,43 @@ h8s2320_device::h8s2320_device(const machine_config &mconfig, device_type type,
}
h8s2320_device::h8s2320_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8s2320_device(mconfig, H8S2320, tag, owner, clock, 0xffec00)
h8s2320_device(mconfig, H8S2320, tag, owner, clock, 0, 0x1000)
{
}
h8s2322_device::h8s2322_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8s2320_device(mconfig, H8S2322, tag, owner, clock, 0xffdc00)
h8s2320_device(mconfig, H8S2322, tag, owner, clock, 0, 0x2000)
{
}
h8s2323_device::h8s2323_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8s2320_device(mconfig, H8S2323, tag, owner, clock, 0xffdc00)
h8s2320_device(mconfig, H8S2323, tag, owner, clock, 0x8000, 0x2000)
{
}
h8s2324_device::h8s2324_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8s2320_device(mconfig, H8S2324, tag, owner, clock, 0xff7c00)
h8s2320_device(mconfig, H8S2324, tag, owner, clock, 0, 0x8000)
{
}
h8s2326_device::h8s2326_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8s2320_device(mconfig, H8S2326, tag, owner, clock, 0xffdc00)
h8s2320_device(mconfig, H8S2326, tag, owner, clock, 0x80000, 0x2000)
{
}
h8s2327_device::h8s2327_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8s2320_device(mconfig, H8S2327, tag, owner, clock, 0xffdc00)
h8s2320_device(mconfig, H8S2327, tag, owner, clock, 0x20000, 0x2000)
{
}
h8s2328_device::h8s2328_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8s2320_device(mconfig, H8S2328, tag, owner, clock, 0xffdc00)
h8s2320_device(mconfig, H8S2328, tag, owner, clock, 0x40000, 0x2000)
{
}
h8s2329_device::h8s2329_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h8s2320_device(mconfig, H8S2329, tag, owner, clock, 0xff7c00)
h8s2320_device(mconfig, H8S2329, tag, owner, clock, 0x60000, 0x8000)
{
}

View File

@ -41,7 +41,7 @@ public:
auto write_port6() { return m_write_port[PORT_6].bind(); }
protected:
h8s2321_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor map_delegate, u32 start);
h8s2321_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor map_delegate, u32 rom_size, u32 ram_size);
required_device<h8_port_device> m_port5;
required_device<h8_port_device> m_port6;
@ -64,7 +64,7 @@ protected:
devcb_write_line::array<2> m_tend_cb;
h8s2320_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 start);
h8s2320_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 rom_size, u32 ram_size);
virtual void device_add_mconfig(machine_config &config) override;
void map_2320(address_map &map);

View File

@ -38,6 +38,22 @@ hmcs40_disassembler::hmcs40_disassembler()
// common lookup tables
enum hmcs40_disassembler::e_mnemonics : unsigned
{
mILL,
mLAB, mLBA, mLAY, mLASPX, mLASPY, mXAMR,
mLXA, mLYA, mLXI, mLYI, mIY, mDY, mAYY, mSYY, mXSP,
mLAM, mLBM, mXMA, mXMB, mLMAIY, mLMADY,
mLMIIY, mLAI, mLBI,
mAI, mIB, mDB, mAMC, mSMC, mAM, mDAA, mDAS, mNEGA, mCOMB, mSEC, mREC, mTC, mROTL, mROTR, mOR,
mMNEI, mYNEI, mANEM, mBNEM, mALEI, mALEM, mBLEM,
mSEM, mREM, mTM,
mBR, mCAL, mLPU, mTBR, mRTN,
mSEIE, mSEIF0, mSEIF1, mSETF, mSECF, mREIE, mREIF0, mREIF1, mRETF, mRECF, mTI0, mTI1, mTIF0, mTIF1, mTTF, mLTI, mLTA, mLAT, mRTNI,
mSED, mRED, mTD, mSEDD, mREDD, mLAR, mLBR, mLRA, mLRB, mP,
mNOP
};
const char *const hmcs40_disassembler::s_mnemonics[] =
{
"?",

View File

@ -25,22 +25,7 @@ public:
virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer &params) override;
private:
enum e_mnemonics
{
mILL,
mLAB, mLBA, mLAY, mLASPX, mLASPY, mXAMR,
mLXA, mLYA, mLXI, mLYI, mIY, mDY, mAYY, mSYY, mXSP,
mLAM, mLBM, mXMA, mXMB, mLMAIY, mLMADY,
mLMIIY, mLAI, mLBI,
mAI, mIB, mDB, mAMC, mSMC, mAM, mDAA, mDAS, mNEGA, mCOMB, mSEC, mREC, mTC, mROTL, mROTR, mOR,
mMNEI, mYNEI, mANEM, mBNEM, mALEI, mALEM, mBLEM,
mSEM, mREM, mTM,
mBR, mCAL, mLPU, mTBR, mRTN,
mSEIE, mSEIF0, mSEIF1, mSETF, mSECF, mREIE, mREIF0, mREIF1, mRETF, mRECF, mTI0, mTI1, mTIF0, mTIF1, mTTF, mLTI, mLTA, mLAT, mRTNI,
mSED, mRED, mTD, mSEDD, mREDD, mLAR, mLBR, mLRA, mLRB, mP,
mNOP
};
enum e_mnemonics : unsigned;
static const char *const s_mnemonics[];
static const s8 s_bits[];
static const u32 s_flags[];

View File

@ -12,6 +12,24 @@
#include "emu.h"
#include "melps4d.h"
// common lookup tables
enum melps4_disassembler::e_mnemonics : unsigned
{
mILL,
mTAB, mTBA, mTAY, mTYA, mTEAB, mTABE, mTEPA, mTXA, mTAX,
mLXY, mLZ, mINY, mDEY, mLCPS, mSADR,
mTAM, mXAM, mXAMD, mXAMI,
mLA, mAM, mAMC, mAMCS, mA, mSC, mRC, mSZC, mCMA, mRL, mRR,
mSB, mRB, mSZB, mSEAM, mSEY,
mTLA, mTHA, mTAJ, mXAL, mXAH, mLC7, mDEC, mSHL, mRHL, mCPA, mCPAS, mCPAE, mSZJ,
mT1AB, mTRAB, mT2AB, mTAB1, mTABR, mTAB2, mTVA, mTWA, mSNZ1, mSNZ2,
mBA, mSP, mB, mBM, mRT, mRTS, mRTI,
mCLD, mCLS, mCLDS, mSD, mRD, mSZD, mOSAB, mOSPA, mOSE, mIAS, mOFA, mIAF, mOGA, mIAK, mSZK, mSU, mRU,
mEI, mDI, mINTH, mINTL, mNOP
};
const char *const melps4_disassembler::s_name[] =
{
"?",
@ -124,18 +142,3 @@ offs_t melps4_disassembler::disassemble(std::ostream &stream, offs_t pc, const d
return 1 | flags | SUPPORTED;
}
u32 melps4_disassembler::opcode_alignment() const
{
return 1;
}
u32 melps4_disassembler::interface_flags() const
{
return PAGED;
}
u32 melps4_disassembler::page_address_bits() const
{
return 7;
}

View File

@ -17,28 +17,13 @@ public:
melps4_disassembler() = default;
virtual ~melps4_disassembler() = default;
virtual u32 opcode_alignment() const override;
virtual u32 interface_flags() const override;
virtual u32 page_address_bits() const override;
virtual u32 opcode_alignment() const override { return 1; }
virtual u32 interface_flags() const override { return PAGED; }
virtual u32 page_address_bits() const override { return 7; }
virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer &params) override;
private:
// opcode mnemonics
enum e_mnemonics
{
mILL,
mTAB, mTBA, mTAY, mTYA, mTEAB, mTABE, mTEPA, mTXA, mTAX,
mLXY, mLZ, mINY, mDEY, mLCPS, mSADR,
mTAM, mXAM, mXAMD, mXAMI,
mLA, mAM, mAMC, mAMCS, mA, mSC, mRC, mSZC, mCMA, mRL, mRR,
mSB, mRB, mSZB, mSEAM, mSEY,
mTLA, mTHA, mTAJ, mXAL, mXAH, mLC7, mDEC, mSHL, mRHL, mCPA, mCPAS, mCPAE, mSZJ,
mT1AB, mTRAB, mT2AB, mTAB1, mTABR, mTAB2, mTVA, mTWA, mSNZ1, mSNZ2,
mBA, mSP, mB, mBM, mRT, mRTS, mRTI,
mCLD, mCLS, mCLDS, mSD, mRD, mSZD, mOSAB, mOSPA, mOSE, mIAS, mOFA, mIAF, mOGA, mIAK, mSZK, mSU, mRU,
mEI, mDI, mINTH, mINTL, mNOP
};
enum e_mnemonics : unsigned;
static const char *const s_name[];
static const u8 s_bits[];
static const u32 s_flags[];

View File

@ -9,6 +9,24 @@
#include "emu.h"
#include "mn1400d.h"
// common lookup tables
enum mn1400_disassembler::e_mnemonics : unsigned
{
mILL, mILL2,
mL, mLD, mLI, mLIC, mLDC, mST, mSTD, mSTIC, mSTDC,
mLX, mLY, mTAX, mTAY, mTYA, mTACU, mTACL, mTCAU, mTCAL,
mNOP, mAND, mANDI, mOR, mXOR, mA, mAI, mCPL, mC, mCI, mCY,
mSL, mICY, mDCY, mICM, mDCM, mSM, mRM, mTB,
mINA, mINB, mOTD, mOTMD, mOTE, mOTIE, mRCO, mSCO, mCCO,
mRC, mRP, mSC, mSP,
mBS0, mBS1, mBS01, mBSN0, mBSN1, mBSN01,
mBP, mBC, mBZ, mBPC, mBPZ, mBCZ, mBPCZ,
mBNP, mBNC, mBNZ, mBNPC, mBNPZ, mBNCZ, mBNPCZ,
mJMP, mCAL, mRET, mEC, mDC
};
const char *const mn1400_disassembler::s_mnemonics[] =
{
"?", "?",
@ -81,6 +99,8 @@ const u8 mn1400_disassembler::mn1400_mnemonic[0x100] =
};
// disasm
offs_t mn1400_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer &params)
{
offs_t pos = pc;

View File

@ -23,21 +23,7 @@ public:
virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer &params) override;
private:
enum e_mnemonics
{
mILL, mILL2,
mL, mLD, mLI, mLIC, mLDC, mST, mSTD, mSTIC, mSTDC,
mLX, mLY, mTAX, mTAY, mTYA, mTACU, mTACL, mTCAU, mTCAL,
mNOP, mAND, mANDI, mOR, mXOR, mA, mAI, mCPL, mC, mCI, mCY,
mSL, mICY, mDCY, mICM, mDCM, mSM, mRM, mTB,
mINA, mINB, mOTD, mOTMD, mOTE, mOTIE, mRCO, mSCO, mCCO,
mRC, mRP, mSC, mSP,
mBS0, mBS1, mBS01, mBSN0, mBSN1, mBSN01,
mBP, mBC, mBZ, mBPC, mBPZ, mBCZ, mBPCZ,
mBNP, mBNC, mBNZ, mBNPC, mBNPZ, mBNCZ, mBNPCZ,
mJMP, mCAL, mRET, mEC, mDC
};
enum e_mnemonics : unsigned;
static const char *const s_mnemonics[];
static const u8 s_bits[];
static const u32 s_flags[];

View File

@ -32,6 +32,25 @@ offs_t pps41_common_disassembler::increment_pc(offs_t pc)
// common lookup tables
enum pps41_common_disassembler::e_mnemonics : unsigned
{
// MM76/shared
mILL /* 0! */,
mXAB, mLBA, mLB, mEOB2,
mSB, mRB, mSKBF,
mXAS, mLSA,
mL, mX, mXDSK, mXNSK,
mA, mAC, mACSK, mASK, mCOM, mRC, mSC, mSKNC, mLAI, mAISK,
mRT, mRTSK, mT, mNOP, mTL, mTM, mTML, mTR,
mSKMEA, mSKBEI, mSKAEI,
mSOS, mROS, mSKISL, mIBM, mOB, mIAM, mOA, mIOS, mI1, mI2C, mINT1H, mDIN1, mINT0L, mDIN0, mSEG1, mSEG2,
// MM78 differences
mINT0H, mINT1L, mSAG, mEOB3, mTAB,
mI1SK, mIX, mOX, mLXA, mXAX, mIOA,
mTLB, mTMLB
};
const char *const pps41_common_disassembler::s_name[] =
{
// MM76

View File

@ -25,26 +25,7 @@ public:
virtual offs_t pc_real_to_linear(offs_t pc) const override { return (pc & ~0x3f) | m_r2l[pc & 0x3f]; }
protected:
// opcode mnemonics
enum e_mnemonics
{
// MM76/shared
mILL /* 0! */,
mXAB, mLBA, mLB, mEOB2,
mSB, mRB, mSKBF,
mXAS, mLSA,
mL, mX, mXDSK, mXNSK,
mA, mAC, mACSK, mASK, mCOM, mRC, mSC, mSKNC, mLAI, mAISK,
mRT, mRTSK, mT, mNOP, mTL, mTM, mTML, mTR,
mSKMEA, mSKBEI, mSKAEI,
mSOS, mROS, mSKISL, mIBM, mOB, mIAM, mOA, mIOS, mI1, mI2C, mINT1H, mDIN1, mINT0L, mDIN0, mSEG1, mSEG2,
// MM78 differences
mINT0H, mINT1L, mSAG, mEOB3, mTAB,
mI1SK, mIX, mOX, mLXA, mXAX, mIOA,
mTLB, mTMLB
};
enum e_mnemonics : unsigned;
static const char *const s_name[];
static const u8 s_bits[];
static const u32 s_flags[];

View File

@ -32,6 +32,18 @@ offs_t rw5000_common_disassembler::increment_pc(offs_t pc)
// common lookup tables
enum rw5000_common_disassembler::e_mnemonics : unsigned
{
mILL,
mNOP, mRSC, mSC, mTC, mTAM,
mLAX, mADX, mCOMP, mATB, mATBZ,
mLDA, mEXC0, mEXCP, mEXCM, mADD,
mLB0, mLB7, mLB8, mLB9, mLB10, mLB11,
mRSM, mSM, mTM,
mTL, mTRA0, mTRA1, mRET,
mTKB, mTKBS, mTDIN, mREAD, mKSEG, mMTD
};
const char *const rw5000_common_disassembler::s_name[] =
{
"?",

View File

@ -25,19 +25,7 @@ public:
virtual offs_t pc_real_to_linear(offs_t pc) const override { return (pc & ~0x3f) | m_r2l[pc & 0x3f]; }
protected:
// opcode mnemonics
enum e_mnemonics
{
mILL,
mNOP, mRSC, mSC, mTC, mTAM,
mLAX, mADX, mCOMP, mATB, mATBZ,
mLDA, mEXC0, mEXCP, mEXCM, mADD,
mLB0, mLB7, mLB8, mLB9, mLB10, mLB11,
mRSM, mSM, mTM,
mTL, mTRA0, mTRA1, mRET,
mTKB, mTKBS, mTDIN, mREAD, mKSEG, mMTD
};
enum e_mnemonics : unsigned;
static const char *const s_name[];
static const u8 s_bits[];
static const u32 s_flags[];

View File

@ -46,6 +46,38 @@ offs_t sm510_common_disassembler::increment_pc(offs_t pc, u8 pclen)
// common lookup tables
enum sm510_common_disassembler::e_mnemonics : unsigned
{
// SM510 common
mILL /* 0! */, mEXT,
mLB, mLBL, mSBM, mEXBLA, mINCB, mDECB,
mATPL, mRTN0, mRTN1, mTL, mTML, mTM, mT,
mEXC, mBDC, mEXCI, mEXCD, mLDA, mLAX, mPTW, mWR, mWS,
mKTA, mATBP, mATX, mATL, mATFC, mATR,
mADD, mADD11, mADX, mCOMA, mROT, mRC, mSC,
mTB, mTC, mTAM, mTMI, mTA0, mTABL, mTIS, mTAL, mTF1, mTF4,
mRM, mSM,
mPRE, mSME, mRME, mTMEL,
mSKIP, mCEND, mIDIV, mDR, mDTA, mCLKLO, mCLKHI,
// SM500 common
mCOMCB, mRTN, mRTNS, mSSR, mTR, mTRS, mRBM,
mADDC, mPDTW, mTW, mDTW,
mATS, mEXKSA, mEXKFA,
mRMF, mSMF, mCOMCN,
mTA, mTM2, mTG,
// SM530 common
mSABM, mSABL, mEXBL,
mTG2, mTBA,
mKETA, mATF, mSDS, mRDS,
mINIS,
// SM590 common
mTAX, mLBLX, mMTR, mSTR, mINBM, mDEBM, mRTA, mBLTA, mEXAX, mTBA2, mADS, mADC, mLBMX, mTLS,
mNOP, mCCTRL, mINBL, mDEBL, mXBLA, mADCS, mTR7 // aliases
};
const char *const sm510_common_disassembler::s_mnemonics[] =
{
// SM510

View File

@ -25,38 +25,7 @@ public:
virtual offs_t pc_real_to_linear(offs_t pc) const override { return (pc & ~0x3f) | m_r2l6[pc & 0x3f]; }
protected:
enum e_mnemonics
{
// SM510 common
mILL /* 0! */, mEXT,
mLB, mLBL, mSBM, mEXBLA, mINCB, mDECB,
mATPL, mRTN0, mRTN1, mTL, mTML, mTM, mT,
mEXC, mBDC, mEXCI, mEXCD, mLDA, mLAX, mPTW, mWR, mWS,
mKTA, mATBP, mATX, mATL, mATFC, mATR,
mADD, mADD11, mADX, mCOMA, mROT, mRC, mSC,
mTB, mTC, mTAM, mTMI, mTA0, mTABL, mTIS, mTAL, mTF1, mTF4,
mRM, mSM,
mPRE, mSME, mRME, mTMEL,
mSKIP, mCEND, mIDIV, mDR, mDTA, mCLKLO, mCLKHI,
// SM500 common
mCOMCB, mRTN, mRTNS, mSSR, mTR, mTRS, mRBM,
mADDC, mPDTW, mTW, mDTW,
mATS, mEXKSA, mEXKFA,
mRMF, mSMF, mCOMCN,
mTA, mTM2, mTG,
// SM530 common
mSABM, mSABL, mEXBL,
mTG2, mTBA,
mKETA, mATF, mSDS, mRDS,
mINIS,
// SM590 common
mTAX, mLBLX, mMTR, mSTR, mINBM, mDEBM, mRTA, mBLTA, mEXAX, mTBA2, mADS, mADC, mLBMX, mTLS,
mNOP, mCCTRL, mINBL, mDEBL, mXBLA, mADCS, mTR7 // aliases
};
enum e_mnemonics : unsigned;
static const char *const s_mnemonics[];
static const u8 s_bits[];
static const u32 s_flags[];

View File

@ -84,6 +84,22 @@ offs_t tms1000_base_disassembler::pc_real_to_linear(offs_t pc) const
// common lookup tables
enum tms1000_base_disassembler::e_mnemonics : unsigned
{
mILL = 0,
mAC0AC, mAC1AC, mACACC, mACNAA, mALEC, mALEM, mAMAAC, mBRANCH,
mCALL, mCCLA, mCLA, mCLO, mCOMC, mCOMX, mCOMX8, mCPAIZ, mCTMDYN,
mDAN, mDMAN, mDMEA, mDNAA, mDYN, mHALT,
mIA, mIMAC, mINTDIS, mINTEN, mINTRTN, mIYC,
mKNEZ, mLDP, mLDX2, mLDX3, mLDX4, mMNEA, mMNEZ,
mNDMEA, mOFF, mRBIT, mREAC, mRETN, mRSTR,
mSAL, mSAMAN, mSBIT, mSBL, mSEAC, mSELIN, mSETR,
mTAC, mTADM, mTAM, mTAMACS, mTAMDYN, mTAMIY, mTAMIYC, mTAMZA,
mTASR, mTAX, mTAY, mTBIT, mTCA, mTCMIY, mTCY, mTDO, mTKA,
mTKM, mTMA, mTMSET, mTMY, mTPC, mTRA, mTSG, mTXA, mTYA,
mXDA, mXMA, mYMCY, mYNEA, mYNEC
};
const char *const tms1000_base_disassembler::s_mnemonic[] =
{
"?",

View File

@ -25,22 +25,7 @@ public:
virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer &params) override;
protected:
enum e_mnemonics
{
mILL = 0,
mAC0AC, mAC1AC, mACACC, mACNAA, mALEC, mALEM, mAMAAC, mBRANCH,
mCALL, mCCLA, mCLA, mCLO, mCOMC, mCOMX, mCOMX8, mCPAIZ, mCTMDYN,
mDAN, mDMAN, mDMEA, mDNAA, mDYN, mHALT,
mIA, mIMAC, mINTDIS, mINTEN, mINTRTN, mIYC,
mKNEZ, mLDP, mLDX2, mLDX3, mLDX4, mMNEA, mMNEZ,
mNDMEA, mOFF, mRBIT, mREAC, mRETN, mRSTR,
mSAL, mSAMAN, mSBIT, mSBL, mSEAC, mSELIN, mSETR,
mTAC, mTADM, mTAM, mTAMACS, mTAMDYN, mTAMIY, mTAMIYC, mTAMZA,
mTASR, mTAX, mTAY, mTBIT, mTCA, mTCMIY, mTCY, mTDO, mTKA,
mTKM, mTMA, mTMSET, mTMY, mTPC, mTRA, mTSG, mTXA, mTYA,
mXDA, mXMA, mYMCY, mYNEA, mYNEC
};
enum e_mnemonics : unsigned;
static const char *const s_mnemonic[];
static const u32 s_flags[];
static const u8 s_bits[];

View File

@ -9,6 +9,22 @@
#include "emu.h"
#include "ucom4d.h"
// common lookup tables
enum ucom4_disassembler::e_mnemonics : unsigned
{
mILL,
mLI, mL, mLM, mLDI, mLDZ, mS, mTAL, mTLA,
mX, mXI, mXD, mXM, mXMI, mXMD, mAD, mADC, mADS, mDAA, mDAS,
mEXL, mCLA, mCMA, mCIA, mCLC, mSTC, mTC, mINC, mDEC, mIND, mDED,
mRMB, mSMB, mREB, mSEB, mRPB, mSPB, mJMP, mJCP, mJPA, mCAL, mCZP, mRT, mRTS,
mCI, mCM, mCMB, mTAB, mCLI, mTMB, mTPA, mTPB,
mTIT, mIA, mIP, mOE, mOP, mOCD, mNOP,
mTAW, mTAZ, mTHX, mTLY, mXAW, mXAZ, mXHR, mXHX, mXLS, mXLY, mXC,
mSFB, mRFB, mFBT, mFBF, mRAR, mINM, mDEM, mSTM, mTTM, mEI, mDI
};
const char *const ucom4_disassembler::s_mnemonics[] =
{
"?",
@ -75,6 +91,8 @@ const u8 ucom4_disassembler::ucom4_mnemonic[0x100] =
};
// disasm
offs_t ucom4_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer &params)
{
offs_t pos = pc;

View File

@ -6,7 +6,6 @@
*/
#ifndef MAME_CPU_UCOM4_UCOM4D_H
#define MAME_CPU_UCOM4_UCOM4D_H
@ -25,19 +24,7 @@ public:
virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer &params) override;
private:
enum e_mnemonics
{
mILL,
mLI, mL, mLM, mLDI, mLDZ, mS, mTAL, mTLA,
mX, mXI, mXD, mXM, mXMI, mXMD, mAD, mADC, mADS, mDAA, mDAS,
mEXL, mCLA, mCMA, mCIA, mCLC, mSTC, mTC, mINC, mDEC, mIND, mDED,
mRMB, mSMB, mREB, mSEB, mRPB, mSPB, mJMP, mJCP, mJPA, mCAL, mCZP, mRT, mRTS,
mCI, mCM, mCMB, mTAB, mCLI, mTMB, mTPA, mTPB,
mTIT, mIA, mIP, mOE, mOP, mOCD, mNOP,
mTAW, mTAZ, mTHX, mTLY, mXAW, mXAZ, mXHR, mXHX, mXLS, mXLY, mXC,
mSFB, mRFB, mFBT, mFBF, mRAR, mINM, mDEM, mSTM, mTTM, mEI, mDI
};
enum e_mnemonics : unsigned;
static const char *const s_mnemonics[];
static const u8 s_bits[];
static const u32 s_flags[];

View File

@ -226,8 +226,10 @@ void device_serial_interface::rx_w(int state)
{
LOGMASKED(LOG_RX, "Receiver is synchronized\n");
if (m_rcv_clock && !(m_rcv_rate.is_never()))
{
// make start delay just a bit longer to make sure we are called after the sender
m_rcv_clock->adjust(((m_rcv_rate*3)/2), 0, m_rcv_rate);
m_rcv_clock->adjust(((m_rcv_rate*5)/3), 0, m_rcv_rate);
}
else if (m_start_bit_hack_for_external_clocks)
m_rcv_bit_count_received--;
}

View File

@ -192,7 +192,7 @@ cdrom_file::cdrom_file(std::string_view inputfile)
logofs += track.frames;
if (EXTRA_VERBOSE)
printf("Track %02d is format %d subtype %d datasize %d subsize %d frames %d extraframes %d pregap %d pgmode %d presize %d postgap %d logofs %d physofs %d chdofs %d logframes %d\n", i+1,
printf("Track %02d is format %d subtype %d datasize %d subsize %d frames %d extraframes %d pregap %d pgmode %d presize %d postgap %d logofs %d physofs %d chdofs %d logframes %d pad %d\n", i+1,
track.trktype,
track.subtype,
track.datasize,
@ -206,7 +206,8 @@ cdrom_file::cdrom_file(std::string_view inputfile)
track.logframeofs,
track.physframeofs,
track.chdframeofs,
track.logframes);
track.logframes,
track.padframes);
}
// fill out dummy entries for the last track to help our search
@ -289,7 +290,7 @@ cdrom_file::cdrom_file(chd_file *_chd)
logofs += track.frames;
if (EXTRA_VERBOSE)
printf("Track %02d is format %d subtype %d datasize %d subsize %d frames %d extraframes %d pregap %d pgmode %d presize %d postgap %d logofs %d physofs %d chdofs %d logframes %d\n", i+1,
printf("Track %02d is format %d subtype %d datasize %d subsize %d frames %d extraframes %d pregap %d pgmode %d presize %d postgap %d logofs %d physofs %d chdofs %d logframes %d pad %d\n", i+1,
track.trktype,
track.subtype,
track.datasize,
@ -303,7 +304,8 @@ cdrom_file::cdrom_file(chd_file *_chd)
track.logframeofs,
track.physframeofs,
track.chdframeofs,
track.logframes);
track.logframes,
track.padframes);
}
// fill out dummy entries for the last track to help our search
@ -1412,14 +1414,14 @@ void cdrom_file::ecc_clear(uint8_t *sector)
*
* @brief A macro that defines tokenize.
*
* @param linebuffer The linebuffer.
* @param i Zero-based index of the.
* @param sizeof(linebuffer) The sizeof(linebuffer)
* @param token The token.
* @param sizeof(token) The sizeof(token)
* @param linebuffer The linebuffer.
* @param i Zero-based index of the.
* @param std::size(linebuffer) The std::size(linebuffer)
* @param token The token.
* @param std::size(token) The std::size(token)
*/
#define TOKENIZE i = tokenize( linebuffer, i, sizeof(linebuffer), token, sizeof(token) );
#define TOKENIZE i = tokenize( linebuffer, i, std::size(linebuffer), token, std::size(token) );
/***************************************************************************
@ -1493,17 +1495,17 @@ uint64_t cdrom_file::get_file_size(std::string_view filename)
int cdrom_file::tokenize( const char *linebuffer, int i, int linebuffersize, char *token, int tokensize )
{
int j = 0;
int singlequote = 0;
int doublequote = 0;
bool singlequote = false;
bool doublequote = false;
while ((i < linebuffersize) && isspace((uint8_t)linebuffer[i]))
{
i++;
}
while ((i < linebuffersize) && (j < tokensize))
while ((i < linebuffersize) && (j < tokensize) && (linebuffer[i] != '\0'))
{
if (!singlequote && linebuffer[i] == '"' )
if (!singlequote && linebuffer[i] == '"')
{
doublequote = !doublequote;
}
@ -2094,6 +2096,8 @@ std::error_condition cdrom_file::parse_gdi(std::string_view tocfname, toc &outto
outtoc.flags = CD_FLAG_GDROM;
char linebuffer[512];
memset(linebuffer, 0, sizeof(linebuffer));
fgets(linebuffer,511,infile);
numtracks=atoi(linebuffer);
@ -2189,7 +2193,7 @@ std::error_condition cdrom_file::parse_gdi(std::string_view tocfname, toc &outto
}
/*-------------------------------------------------
parse_cue - parse a CDRWin format CUE file
parse_cue - parse a .CUE file
-------------------------------------------------*/
/**
@ -2202,15 +2206,21 @@ std::error_condition cdrom_file::parse_gdi(std::string_view tocfname, toc &outto
* @param [in,out] outinfo The outinfo.
*
* @return A std::error_condition.
*
* Redump multi-CUE for Dreamcast GDI:
* Dreamcast discs have two images on a single disc. The first image is SINGLE-DENSITY and the second image
* is HIGH-DENSITY. The SINGLE-DENSITY area starts 0 LBA and HIGH-DENSITY area starts 45000 LBA.
*/
std::error_condition cdrom_file::parse_cue(std::string_view tocfname, toc &outtoc, track_input_info &outinfo)
{
int i, trknum;
static char token[512];
char token[512];
std::string lastfname;
uint32_t wavlen, wavoffs;
std::string path = std::string(tocfname);
const bool is_gdrom = is_gdicue(tocfname);
enum gdi_area current_area = SINGLE_DENSITY;
FILE *infile = fopen(path.c_str(), "rt");
if (!infile)
@ -2227,11 +2237,19 @@ std::error_condition cdrom_file::parse_cue(std::string_view tocfname, toc &outto
trknum = -1;
wavoffs = wavlen = 0;
if (is_gdrom)
{
outtoc.flags = CD_FLAG_GDROM;
}
char linebuffer[512];
memset(linebuffer, 0, sizeof(linebuffer));
while (!feof(infile))
{
/* get the next line */
fgets(linebuffer, 511, infile);
if (!fgets(linebuffer, 511, infile))
break;
/* if EOF didn't hit, keep going */
if (!feof(infile))
@ -2240,7 +2258,26 @@ std::error_condition cdrom_file::parse_cue(std::string_view tocfname, toc &outto
TOKENIZE
if (!strcmp(token, "FILE"))
if (!strcmp(token, "REM"))
{
/* TODO: sessions are notated using REM commands: "REM SESSION 01" */
/* skip to actual data of REM command */
while (i < std::size(linebuffer) && isspace((uint8_t)linebuffer[i]))
i++;
if (is_gdrom && !strncmp(linebuffer+i, "SINGLE-DENSITY AREA", 19))
{
/* single-density area starts LBA = 0 */
current_area = SINGLE_DENSITY;
}
else if (is_gdrom && !strncmp(linebuffer+i, "HIGH-DENSITY AREA", 17))
{
/* high-density area starts LBA = 45000 */
current_area = HIGH_DENSITY;
}
}
else if (!strcmp(token, "FILE"))
{
/* found the data file for a track */
TOKENIZE
@ -2285,30 +2322,37 @@ std::error_condition cdrom_file::parse_cue(std::string_view tocfname, toc &outto
/* next token on the line is the track type */
TOKENIZE
if (wavlen != 0)
{
outtoc.tracks[trknum].trktype = CD_TRACK_AUDIO;
outtoc.tracks[trknum].frames = wavlen/2352;
outinfo.track[trknum].offset = wavoffs;
wavoffs = wavlen = 0;
}
else
{
outtoc.tracks[trknum].trktype = CD_TRACK_MODE1;
outtoc.tracks[trknum].datasize = 0;
outinfo.track[trknum].offset = 0;
}
outtoc.tracks[trknum].subtype = CD_SUB_NONE;
outtoc.tracks[trknum].subsize = 0;
outtoc.tracks[trknum].pgsub = CD_SUB_NONE;
outtoc.tracks[trknum].pregap = 0;
outtoc.tracks[trknum].padframes = 0;
outtoc.tracks[trknum].datasize = 0;
outtoc.tracks[trknum].multicuearea = is_gdrom ? current_area : 0;
outinfo.track[trknum].idx0offs = -1;
outinfo.track[trknum].idx1offs = 0;
outinfo.track[trknum].offset = 0;
if (wavlen != 0)
{
outtoc.tracks[trknum].frames = wavlen/2352;
outinfo.track[trknum].offset = wavoffs;
wavoffs = wavlen = 0;
}
outinfo.track[trknum].fname.assign(lastfname); // default filename to the last one
// printf("trk %d: fname %s offset %d\n", trknum, outinfo.track[trknum].fname.c_str(), outinfo.track[trknum].offset);
if (EXTRA_VERBOSE)
{
if (is_gdrom)
{
printf("trk %d: fname %s offset %d area %d\n", trknum, outinfo.track[trknum].fname.c_str(), outinfo.track[trknum].offset, outtoc.tracks[trknum].multicuearea);
}
else
{
printf("trk %d: fname %s offset %d\n", trknum, outinfo.track[trknum].fname.c_str(), outinfo.track[trknum].offset);
}
}
convert_type_string_to_track_info(token, &outtoc.tracks[trknum]);
if (outtoc.tracks[trknum].datasize == 0)
@ -2346,28 +2390,7 @@ std::error_condition cdrom_file::parse_cue(std::string_view tocfname, toc &outto
{
outtoc.tracks[trknum].pregap = frames - outinfo.track[trknum].idx0offs;
outtoc.tracks[trknum].pgtype = outtoc.tracks[trknum].trktype;
switch (outtoc.tracks[trknum].pgtype)
{
case CD_TRACK_MODE1:
case CD_TRACK_MODE2_FORM1:
outtoc.tracks[trknum].pgdatasize = 2048;
break;
case CD_TRACK_MODE1_RAW:
case CD_TRACK_MODE2_RAW:
case CD_TRACK_AUDIO:
outtoc.tracks[trknum].pgdatasize = 2352;
break;
case CD_TRACK_MODE2:
case CD_TRACK_MODE2_FORM_MIX:
outtoc.tracks[trknum].pgdatasize = 2336;
break;
case CD_TRACK_MODE2_FORM2:
outtoc.tracks[trknum].pgdatasize = 2324;
break;
}
outtoc.tracks[trknum].pgdatasize = outtoc.tracks[trknum].datasize;
}
else // pregap sectors not in file, but we're always using idx0ofs for track length calc now
{
@ -2482,9 +2505,67 @@ std::error_condition cdrom_file::parse_cue(std::string_view tocfname, toc &outto
}
}
}
//printf("trk %d: %d frames @ offset %d\n", trknum+1, outtoc.tracks[trknum].frames, outinfo.track[trknum].offset);
}
if (is_gdrom)
{
/*
* Strip pregaps from Redump tracks and adjust the LBA offset to match TOSEC layout
*/
for (trknum = 1; trknum < outtoc.numtrks; trknum++)
{
uint32_t this_pregap = outtoc.tracks[trknum].pregap;
uint32_t this_offset = this_pregap * (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize);
outtoc.tracks[trknum-1].frames += this_pregap;
outtoc.tracks[trknum-1].splitframes += this_pregap;
outinfo.track[trknum].offset += this_offset;
outtoc.tracks[trknum].frames -= this_pregap;
outinfo.track[trknum].idx1offs -= this_pregap;
outtoc.tracks[trknum].pregap = 0;
outtoc.tracks[trknum].pgtype = 0;
}
/*
* TOC now matches TOSEC layout, set LBA for every track with HIGH-DENSITY area @ LBA 45000
*/
for (trknum = 1; trknum < outtoc.numtrks; trknum++)
{
if (outtoc.tracks[trknum].multicuearea == HIGH_DENSITY && outtoc.tracks[trknum-1].multicuearea == SINGLE_DENSITY)
{
outtoc.tracks[trknum].physframeofs = 45000;
int dif=outtoc.tracks[trknum].physframeofs-(outtoc.tracks[trknum-1].frames+outtoc.tracks[trknum-1].physframeofs);
outtoc.tracks[trknum-1].frames += dif;
outtoc.tracks[trknum-1].padframes = dif;
}
else
{
outtoc.tracks[trknum].physframeofs = outtoc.tracks[trknum-1].physframeofs + outtoc.tracks[trknum-1].frames;
}
}
}
if (EXTRA_VERBOSE)
for (trknum = 0; trknum < outtoc.numtrks; trknum++)
{
printf("trk %d: %d frames @ offset %d, pad=%d, split=%d, area=%d, phys=%d, pregap=%d, pgtype=%d, pgdatasize=%d, idx0=%d, idx1=%d, dataframes=%d\n",
trknum+1,
outtoc.tracks[trknum].frames,
outinfo.track[trknum].offset,
outtoc.tracks[trknum].padframes,
outtoc.tracks[trknum].splitframes,
outtoc.tracks[trknum].multicuearea,
outtoc.tracks[trknum].physframeofs,
outtoc.tracks[trknum].pregap,
outtoc.tracks[trknum].pgtype,
outtoc.tracks[trknum].pgdatasize,
outinfo.track[trknum].idx0offs,
outinfo.track[trknum].idx1offs,
outtoc.tracks[trknum].frames - outtoc.tracks[trknum].padframes);
}
return std::error_condition();
}
@ -2506,6 +2587,7 @@ std::error_condition cdrom_file::parse_cue(std::string_view tocfname, toc &outto
bool cdrom_file::is_gdicue(std::string_view tocfname)
{
char token[512];
bool has_rem_singledensity = false;
bool has_rem_highdensity = false;
std::string path = std::string(tocfname);
@ -2519,15 +2601,31 @@ bool cdrom_file::is_gdicue(std::string_view tocfname)
path = get_file_path(path);
char linebuffer[512];
memset(linebuffer, 0, sizeof(linebuffer));
while (!feof(infile))
{
fgets(linebuffer, 511, infile);
if (!fgets(linebuffer, 511, infile))
break;
/* if EOF didn't hit, keep going */
if (!feof(infile))
{
has_rem_singledensity = has_rem_singledensity || !strncmp(linebuffer, "REM SINGLE-DENSITY AREA", 23);
has_rem_highdensity = has_rem_highdensity || !strncmp(linebuffer, "REM HIGH-DENSITY AREA", 21);
int i = 0;
TOKENIZE
if (!strcmp(token, "REM"))
{
/* skip to actual data of REM command */
while (i < std::size(linebuffer) && isspace((uint8_t)linebuffer[i]))
i++;
if (!strncmp(linebuffer+i, "SINGLE-DENSITY AREA", 19))
has_rem_singledensity = true;
else if (!strncmp(linebuffer+i, "HIGH-DENSITY AREA", 17))
has_rem_highdensity = true;
}
}
}
@ -2536,413 +2634,6 @@ bool cdrom_file::is_gdicue(std::string_view tocfname)
return has_rem_singledensity && has_rem_highdensity;
}
/*-----------------------------------------------------------------
parse_gdicue - parse a Redump multi-CUE for Dreamcast GDI
------------------------------------------------------------------*/
/**
* @fn std::error_condition parse_gdicue(std::string_view tocfname, toc &outtoc, track_input_info &outinfo)
*
* @brief Chdcd parse cue.
*
* @param tocfname The tocfname.
* @param [in,out] outtoc The outtoc.
* @param [in,out] outinfo The outinfo.
*
* @return A std::error_condition.
*
* Dreamcast discs have two images on a single disc. The first image is SINGLE-DENSITY and the second image
* is HIGH-DENSITY. The SINGLE-DENSITY area starts 0 LBA and HIGH-DENSITY area starts 45000 LBA.
*
* There are three Dreamcast disc patterns.
*
* Pattern I - (SD) DATA + AUDIO, (HD) DATA
* Pattern II - (SD) DATA + AUDIO, (HD) DATA + ... + AUDIO
* Pattern III - (SD) DATA + AUDIO, (HD) DATA + ... + DATA
*
* TOSEC layout is preferred and this code adjusts the TOC and INFO generated by a Redump .cue to match the
* layout from a TOSEC .gdi.
*/
std::error_condition cdrom_file::parse_gdicue(std::string_view tocfname, toc &outtoc, track_input_info &outinfo)
{
int i, trknum;
static char token[512];
std::string lastfname;
uint32_t wavlen, wavoffs;
std::string path = std::string(tocfname);
enum gdi_area current_area = SINGLE_DENSITY;
enum gdi_pattern disc_pattern = TYPE_UNKNOWN;
FILE *infile = fopen(path.c_str(), "rt");
if (!infile)
{
return std::error_condition(errno, std::generic_category());
}
path = get_file_path(path);
/* clear structures */
memset(&outtoc, 0, sizeof(outtoc));
outinfo.reset();
trknum = -1;
wavoffs = wavlen = 0;
outtoc.flags = CD_FLAG_GDROM;
char linebuffer[512];
while (!feof(infile))
{
/* get the next line */
fgets(linebuffer, 511, infile);
/* if EOF didn't hit, keep going */
if (!feof(infile))
{
/* single-density area starts LBA = 0 */
if (!strncmp(linebuffer, "REM SINGLE-DENSITY AREA", 23))
{
current_area = SINGLE_DENSITY;
continue;
}
/* high-density area starts LBA = 45000 */
if (!strncmp(linebuffer, "REM HIGH-DENSITY AREA", 21))
{
current_area = HIGH_DENSITY;
continue;
}
i = 0;
TOKENIZE
if (!strcmp(token, "FILE"))
{
/* found the data file for a track */
TOKENIZE
/* keep the filename */
lastfname.assign(path).append(token);
/* get the file type */
TOKENIZE
if (!strcmp(token, "BINARY"))
{
outinfo.track[trknum+1].swap = false;
}
else if (!strcmp(token, "MOTOROLA"))
{
outinfo.track[trknum+1].swap = true;
}
else if (!strcmp(token, "WAVE"))
{
wavlen = parse_wav_sample(lastfname, &wavoffs);
if (!wavlen)
{
fclose(infile);
printf("ERROR: couldn't read [%s] or not a valid .WAV\n", lastfname.c_str());
return chd_file::error::INVALID_DATA;
}
}
else
{
fclose(infile);
printf("ERROR: Unhandled track type %s\n", token);
return chd_file::error::UNSUPPORTED_FORMAT;
}
}
else if (!strcmp(token, "TRACK"))
{
/* get the track number */
TOKENIZE
trknum = strtoul(token, nullptr, 10) - 1;
/* next token on the line is the track type */
TOKENIZE
if (wavlen != 0)
{
outtoc.tracks[trknum].trktype = CD_TRACK_AUDIO;
outtoc.tracks[trknum].frames = wavlen/2352;
outinfo.track[trknum].offset = wavoffs;
wavoffs = wavlen = 0;
}
else
{
outtoc.tracks[trknum].trktype = CD_TRACK_MODE1;
outtoc.tracks[trknum].datasize = 0;
outinfo.track[trknum].offset = 0;
}
outtoc.tracks[trknum].subtype = CD_SUB_NONE;
outtoc.tracks[trknum].subsize = 0;
outtoc.tracks[trknum].pgsub = CD_SUB_NONE;
outtoc.tracks[trknum].pregap = 0;
outtoc.tracks[trknum].padframes = 0;
outtoc.tracks[trknum].multicuearea = current_area;
outinfo.track[trknum].idx0offs = -1;
outinfo.track[trknum].idx1offs = 0;
outinfo.track[trknum].fname.assign(lastfname); // default filename to the last one
if (EXTRA_VERBOSE)
printf("trk %d: fname %s offset %d area %d\n", trknum, outinfo.track[trknum].fname.c_str(), outinfo.track[trknum].offset, outtoc.tracks[trknum].multicuearea);
convert_type_string_to_track_info(token, &outtoc.tracks[trknum]);
if (outtoc.tracks[trknum].datasize == 0)
{
fclose(infile);
printf("ERROR: Unknown track type [%s]. Contact MAMEDEV.\n", token);
return chd_file::error::UNSUPPORTED_FORMAT;
}
/* next (optional) token on the line is the subcode type */
TOKENIZE
convert_subtype_string_to_track_info(token, &outtoc.tracks[trknum]);
}
else if (!strcmp(token, "INDEX")) /* only in bin/cue files */
{
int idx, frames;
/* get index number */
TOKENIZE
idx = strtoul(token, nullptr, 10);
/* get index */
TOKENIZE
frames = msf_to_frames( token );
if (idx == 0)
{
outinfo.track[trknum].idx0offs = frames;
}
else if (idx == 1)
{
outinfo.track[trknum].idx1offs = frames;
if ((outtoc.tracks[trknum].pregap == 0) && (outinfo.track[trknum].idx0offs != -1))
{
outtoc.tracks[trknum].pregap = frames - outinfo.track[trknum].idx0offs;
outtoc.tracks[trknum].pgtype = outtoc.tracks[trknum].trktype;
switch (outtoc.tracks[trknum].pgtype)
{
case CD_TRACK_MODE1:
case CD_TRACK_MODE2_FORM1:
outtoc.tracks[trknum].pgdatasize = 2048;
break;
case CD_TRACK_MODE1_RAW:
case CD_TRACK_MODE2_RAW:
case CD_TRACK_AUDIO:
outtoc.tracks[trknum].pgdatasize = 2352;
break;
case CD_TRACK_MODE2:
case CD_TRACK_MODE2_FORM_MIX:
outtoc.tracks[trknum].pgdatasize = 2336;
break;
case CD_TRACK_MODE2_FORM2:
outtoc.tracks[trknum].pgdatasize = 2324;
break;
}
}
else // pregap sectors not in file, but we're always using idx0ofs for track length calc now
{
outinfo.track[trknum].idx0offs = frames;
}
}
}
else if (!strcmp(token, "PREGAP"))
{
int frames;
/* get index */
TOKENIZE
frames = msf_to_frames( token );
outtoc.tracks[trknum].pregap = frames;
}
else if (!strcmp(token, "POSTGAP"))
{
int frames;
/* get index */
TOKENIZE
frames = msf_to_frames( token );
outtoc.tracks[trknum].postgap = frames;
}
}
}
/* close the input CUE */
fclose(infile);
/* store the number of tracks found */
outtoc.numtrks = trknum + 1;
/* now go over the files again and set the lengths */
for (trknum = 0; trknum < outtoc.numtrks; trknum++)
{
uint64_t tlen = 0;
// this is true for cue/bin and cue/iso, and we need it for cue/wav since .WAV is little-endian
if (outtoc.tracks[trknum].trktype == CD_TRACK_AUDIO)
{
outinfo.track[trknum].swap = true;
}
// don't do this for .WAV tracks, we already have their length and offset filled out
if (outinfo.track[trknum].offset == 0)
{
// is this the last track?
if (trknum == (outtoc.numtrks-1))
{
/* if we have the same filename as the last track, do it that way */
if (trknum != 0 && (outinfo.track[trknum].fname.compare(outinfo.track[trknum-1].fname)==0))
{
tlen = get_file_size(outinfo.track[trknum].fname);
if (tlen == 0)
{
printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum-1].fname.c_str());
return std::errc::no_such_file_or_directory;
}
outinfo.track[trknum].offset = outinfo.track[trknum-1].offset + outtoc.tracks[trknum-1].frames * (outtoc.tracks[trknum-1].datasize + outtoc.tracks[trknum-1].subsize);
outtoc.tracks[trknum].frames = (tlen - outinfo.track[trknum].offset) / (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize);
}
else /* data files are different */
{
tlen = get_file_size(outinfo.track[trknum].fname);
if (tlen == 0)
{
printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum-1].fname.c_str());
return std::errc::no_such_file_or_directory;
}
tlen /= (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize);
outtoc.tracks[trknum].frames = tlen;
outinfo.track[trknum].offset = 0;
}
}
else
{
/* if we have the same filename as the next track, do it that way */
if (outinfo.track[trknum].fname.compare(outinfo.track[trknum+1].fname)==0)
{
outtoc.tracks[trknum].frames = outinfo.track[trknum+1].idx0offs - outinfo.track[trknum].idx0offs;
if (trknum == 0) // track 0 offset is 0
{
outinfo.track[trknum].offset = 0;
}
else
{
outinfo.track[trknum].offset = outinfo.track[trknum-1].offset + outtoc.tracks[trknum-1].frames * (outtoc.tracks[trknum-1].datasize + outtoc.tracks[trknum-1].subsize);
}
if (!outtoc.tracks[trknum].frames)
{
printf("ERROR: unable to determine size of track %d, missing INDEX 01 markers?\n", trknum+1);
return chd_file::error::INVALID_DATA;
}
}
else /* data files are different */
{
tlen = get_file_size(outinfo.track[trknum].fname);
if (tlen == 0)
{
printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum].fname.c_str());
return std::errc::no_such_file_or_directory;
}
tlen /= (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize);
outtoc.tracks[trknum].frames = tlen;
outinfo.track[trknum].offset = 0;
}
}
}
}
/*
* Dreamcast patterns are identified by track types and number of tracks
*/
if (outtoc.numtrks > 4 && outtoc.tracks[outtoc.numtrks-1].pgtype == CD_TRACK_MODE1_RAW)
{
if (outtoc.tracks[outtoc.numtrks-2].pgtype == CD_TRACK_AUDIO)
disc_pattern = TYPE_III_SPLIT;
else
disc_pattern = TYPE_III;
}
else if (outtoc.numtrks > 3)
{
if (outtoc.tracks[outtoc.numtrks-1].pgtype == CD_TRACK_AUDIO)
disc_pattern = TYPE_II;
else
disc_pattern = TYPE_III;
}
else if (outtoc.numtrks == 3)
{
disc_pattern = TYPE_I;
}
/*
* Special handling for TYPE_III_SPLIT, pregap in last track contains 75 frames audio and 150 frames data
*/
if (disc_pattern == TYPE_III_SPLIT)
{
assert(outtoc.tracks[outtoc.numtrks-1].pregap == 225);
// grow the AUDIO track into DATA track by 75 frames as per Pattern III
outtoc.tracks[outtoc.numtrks-2].frames += 225;
outtoc.tracks[outtoc.numtrks-2].padframes += 150;
outinfo.track[outtoc.numtrks-2].offset = 150 * (outtoc.tracks[outtoc.numtrks-2].datasize+outtoc.tracks[outtoc.numtrks-2].subsize);
outtoc.tracks[outtoc.numtrks-2].splitframes = 75;
// skip the pregap when reading the DATA track
outtoc.tracks[outtoc.numtrks-1].frames -= 225;
outinfo.track[outtoc.numtrks-1].offset += 225 * (outtoc.tracks[outtoc.numtrks-1].datasize+outtoc.tracks[outtoc.numtrks-1].subsize);
}
/*
* Set LBA for every track with HIGH-DENSITY area @ LBA 45000
*/
for (trknum = 1; trknum < outtoc.numtrks; trknum++)
{
if (outtoc.tracks[trknum].multicuearea == HIGH_DENSITY && outtoc.tracks[trknum-1].multicuearea == SINGLE_DENSITY)
{
outtoc.tracks[trknum].physframeofs = 45000;
int dif=outtoc.tracks[trknum].physframeofs-(outtoc.tracks[trknum-1].frames+outtoc.tracks[trknum-1].physframeofs);
outtoc.tracks[trknum-1].frames += dif;
outtoc.tracks[trknum-1].padframes = dif;
}
else
{
outtoc.tracks[trknum].physframeofs = outtoc.tracks[trknum-1].physframeofs + outtoc.tracks[trknum-1].frames;
}
}
if (EXTRA_VERBOSE)
for (trknum = 0; trknum < outtoc.numtrks; trknum++)
{
printf("trk %d: %d frames @ offset %d, pad=%d, split=%d, area=%d, phys=%d, pregap=%d, pgtype=%d, idx0=%d, idx1=%d, (true %d)\n",
trknum+1,
outtoc.tracks[trknum].frames,
outinfo.track[trknum].offset,
outtoc.tracks[trknum].padframes,
outtoc.tracks[trknum].splitframes,
outtoc.tracks[trknum].multicuearea,
outtoc.tracks[trknum].physframeofs,
outtoc.tracks[trknum].pregap,
outtoc.tracks[trknum].pgtype,
outinfo.track[trknum].idx0offs,
outinfo.track[trknum].idx1offs,
outtoc.tracks[trknum].frames - outtoc.tracks[trknum].padframes);
}
return std::error_condition();
}
/*-------------------------------------------------
parse_toc - parse a CDRDAO format TOC file
-------------------------------------------------*/
@ -2961,7 +2652,7 @@ std::error_condition cdrom_file::parse_gdicue(std::string_view tocfname, toc &ou
std::error_condition cdrom_file::parse_toc(std::string_view tocfname, toc &outtoc, track_input_info &outinfo)
{
static char token[512];
char token[512];
auto pos = tocfname.rfind('.');
std::string tocfext = pos == std::string_view::npos ? std::string() : strmakelower(tocfname.substr(pos + 1));
@ -2973,10 +2664,7 @@ std::error_condition cdrom_file::parse_toc(std::string_view tocfname, toc &outto
if (tocfext == "cue")
{
if (is_gdicue(tocfname))
return parse_gdicue(tocfname, outtoc, outinfo);
else
return parse_cue(tocfname, outtoc, outinfo);
return parse_cue(tocfname, outtoc, outinfo);
}
if (tocfext == "nrg")
@ -3006,10 +2694,13 @@ std::error_condition cdrom_file::parse_toc(std::string_view tocfname, toc &outto
int trknum = -1;
char linebuffer[512];
memset(linebuffer, 0, sizeof(linebuffer));
while (!feof(infile))
{
/* get the next line */
fgets(linebuffer, 511, infile);
if (!fgets(linebuffer, 511, infile))
break;
/* if EOF didn't hit, keep going */
if (!feof(infile))

View File

@ -75,7 +75,7 @@ public:
/* fields used in CHDMAN only */
uint32_t padframes; /* number of frames of padding to add to the end of the track; needed for GDI */
uint32_t splitframes; /* number of frames to read from the next file; needed for Redump split-bin GDI */
uint32_t splitframes; /* number of frames from the next file to add to the end of the current track after padding; needed for Redump split-bin GDI */
/* fields used in MAME/MESS only */
uint32_t logframeofs; /* logical frame of actual track data - offset by pregap size if pregap not physically present */
@ -135,7 +135,6 @@ public:
static std::error_condition parse_gdi(std::string_view tocfname, toc &outtoc, track_input_info &outinfo);
static std::error_condition parse_cue(std::string_view tocfname, toc &outtoc, track_input_info &outinfo);
static bool is_gdicue(std::string_view tocfname);
static std::error_condition parse_gdicue(std::string_view tocfname, toc &outtoc, track_input_info &outinfo);
static std::error_condition parse_toc(std::string_view tocfname, toc &outtoc, track_input_info &outinfo);
int get_last_track() const { return cdtoc.numtrks; }
int get_adr_control(int track) const { return track == 0xaa || cdtoc.tracks[track].trktype == CD_TRACK_AUDIO ? 0x10 : 0x14; }

View File

@ -505,6 +505,6 @@ ROM_END
SYST( 1977, cmpchess, 0, 0, cmpchess, cmpchess, cmpchess_state, empty_init, "DataCash Systems / Staid", "CompuChess", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // aka CompuChess I
SYST( 1978, cmpchess2, 0, 0, cmpchess2, cmpchess, cmpchess_state, empty_init, "DataCash Systems / Staid", "CompuChess: The Second Edition", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1978, ccmk1, cmpchess, 0, mk1, mk1, cmpchess_state, empty_init, "bootleg (Novag)", "Chess Champion: MK I", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1978, ccmk1, cmpchess, 0, mk1, mk1, cmpchess_state, empty_init, "bootleg (Novag Industries)", "Chess Champion: MK I", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1979, cncchess, 0, 0, cncchess, cncchess, cmpchess_state, empty_init, "Conic", "Computer Chess (Conic, model 7011)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

View File

@ -320,5 +320,5 @@ ROM_END
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1978, chmate, 0, 0, chmate, chmate, chmate_state, empty_init, "Commodore", "Chessmate", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1979, ccmk2, chmate, 0, mk2, mk2, chmate_state, empty_init, "Novag", "Chess Champion: MK II (ver. 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 1st version (jukebox model), aka version B
SYST( 1979, ccmk2a, chmate, 0, mk2a, mk2a, chmate_state, empty_init, "Novag", "Chess Champion: MK II (ver. 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1979, ccmk2, chmate, 0, mk2, mk2, chmate_state, empty_init, "Novag Industries", "Chess Champion: MK II (ver. 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 1st version (jukebox model), aka version B
SYST( 1979, ccmk2a, chmate, 0, mk2a, mk2a, chmate_state, empty_init, "Novag Industries", "Chess Champion: MK II (ver. 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

View File

@ -239,8 +239,8 @@ ROM_START( scprof )
ROM_REGION( 0x4000, "maincpu", 0 )
ROM_LOAD("1988_107_newcrest_hd6301y0j76p", 0x0000, 0x4000, CRC(681456c7) SHA1(99f8ab7369dbc2c93335affc38838295a8a2c5f3) )
ROM_REGION( 61763, "screen", 0 )
ROM_LOAD("scprof.svg", 0, 61763, CRC(2c26e603) SHA1(028b6406ff2aa89af75dc4133d3cb9a1bbcb846d) )
ROM_REGION( 61580, "screen", 0 )
ROM_LOAD("scprof.svg", 0, 61580, CRC(6ebdf57c) SHA1(b0c01f1f251a569a2503a1053d7e676b1e6d9b0a) )
ROM_END
} // anonymous namespace

View File

@ -12825,7 +12825,7 @@ ROM_START( ckongis )
ROM_REGION( 0x0020, "proms", 0 ) // wasn't in the dump
ROM_LOAD( "6l.bin", 0x0000, 0x0020, CRC(fd81e715) SHA1(eadafe88f26405e6540d4b248b940974e8c31145) )
ROM_REGION( 0x0020, "proms2", 0 ) // NOT the colour prom?
ROM_REGION( 0x0020, "proms2", 0 ) // NOT the colour PROM?
ROM_LOAD( "dkp.bin", 0x0000, 0x0020, CRC(97c473cc) SHA1(1bbb7f17b8d6a3a621e8c22d473eb26d4c1a750b) )
ROM_END
@ -12847,7 +12847,7 @@ ROM_START( bagmanmc )
ROM_COPY("gfx1",0x3800,0x2800,0x0800)
ROM_COPY("gfx1",0x1800,0x0800,0x0800)
ROM_REGION( 0x0020, "proms", 0 ) // not dumped, but the standard moon cresta prom works
ROM_REGION( 0x0020, "proms", 0 ) // not dumped, but the standard Moon Cresta PROM works
ROM_LOAD( "bagmanmc.clr", 0x0000, 0x0020, BAD_DUMP CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
ROM_END
@ -12865,6 +12865,33 @@ ROM_START( bagmanm2 )
ROM_LOAD( "bagmanmc.clr", 0x0000, 0x0020, BAD_DUMP CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
ROM_END
// Found on a Moon Cresta PCB made by CIRSA
ROM_START( bagmanm3 )
ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "1-2-tms2564.bin", 0x0000, 0x2000, CRC(90e5ae76) SHA1(d572eee43476c689d0d958ac23e2277a2ce077cb) )
ROM_LOAD( "3-4-tms2564.bin", 0x2000, 0x2000, CRC(f68fc60d) SHA1(c10aef39cf33c87974fefd347185ea7342470022) )
ROM_LOAD( "5a.bin", 0x4000, 0x0800, CRC(99992ffb) SHA1(33e34143bc515e645030fd3cf6e926225c1e6e00) )
ROM_LOAD( "5b.bin", 0x4800, 0x0800, CRC(838c1462) SHA1(e430b185c51b7b50fcf8ec1f56d46db21d4b1eb5) )
ROM_LOAD( "5c.bin", 0x5000, 0x0800, CRC(df4139fe) SHA1(840d3f15a667679ed7ba031fc8d0b0efee5bc382) )
ROM_LOAD( "5d.bin", 0x5800, 0x0800, CRC(d07a1fcb) SHA1(1cd4150eda53d164dacc0c6e9eb7bd30f646bd00) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "bottom-tms2532.bin", 0x0000, 0x0800, CRC(c26409b5) SHA1(7d6a309f26ad6cd8790f6a4b383a00c2a06bbe05) )
ROM_IGNORE( 0x800 ) // Second half unused
ROM_LOAD( "top-tms2532.bin", 0x1000, 0x1000, CRC(a2790089) SHA1(7eb8634f26f6af52fb79bf90ec90b4e258c7c79f) )
ROM_LOAD( "c3-bottom-tms2532.bin", 0x2000, 0x0800, CRC(4fdd460f) SHA1(b3d69676be9cd60b201a1c0573eaa3d7121a68b9) )
ROM_IGNORE( 0x800 ) // Second half unused
ROM_LOAD( "c3-top-tms2532.bin", 0x3000, 0x1000, CRC(b63cfae4) SHA1(3e0cb3dbeec8ad790bc482176ca599721bac31ee) )
ROM_COPY( "gfx1", 0x3800, 0x2800, 0x0800 )
ROM_COPY( "gfx1", 0x1800, 0x0800, 0x0800 )
ROM_REGION( 0x0020, "proms", 0 )
ROM_LOAD( "82s123.bin", 0x0000, 0x0020, CRC(9fe412ff) SHA1(eea54dbf60f3661f24da732c4a479d552734a592) )
ROM_REGION( 0x0020, "proms2", 0 ) // Extra PROM attached to a 74157
ROM_LOAD( "82s123-74157.bin", 0x0000, 0x0020, CRC(66bb08a3) SHA1(f02700b651c3f840ad00844bb716d334f1f36637) )
ROM_END
ROM_START( mooncmw )
ROM_REGION( 0x8000, "maincpu", 0 )
@ -16441,10 +16468,12 @@ GAME( 1982, ckongis, ckong, ckongg, ckonggx, galaxian_state, init_
GAME( 1981, bigkonggx, ckong, bigkonggx, ckongg, galaxian_state, init_bigkonggx, ROT90, "bootleg", "Big Kong (bootleg of Crazy Kong on Galaxian hardware)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
GAME( 1982, bagmanmc, bagman, bagmanmc, bagmanmc, bagmanmc_state, init_bagmanmc, ROT90, "bootleg", "Bagman (bootleg on Moon Cresta hardware, set 1)", MACHINE_IMPERFECT_COLORS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
GAME( 1984, bagmanm2, bagman, bagmanmc, bagmanmc, bagmanmc_state, init_bagmanmc, ROT90, "bootleg (GIB)", "Bagman (bootleg on Moon Cresta hardware, set 2)", MACHINE_IMPERFECT_COLORS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
GAME( 1982, bagmanm3, bagman, bagmanmc, bagmanmc, bagmanmc_state, init_bagmanmc, ROT90, "bootleg", "Bagman (bootleg on Moon Cresta hardware, set 3)", MACHINE_IMPERFECT_COLORS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
// Other games on basic mooncrst hardware
GAME( 1982, porter, dockman, porter, porter, pisces_state, init_pisces, ROT90, "bootleg", "Port Man (bootleg on Moon Cresta hardware)", MACHINE_IMPERFECT_COLORS | MACHINE_NO_COCKTAIL )
GAME( 1982, portera, dockman, porter, portera, pisces_state, init_pisces, ROT90, "bootleg", "El Estivador (Spanish bootleg of Port Man on Galaxian hardware)", MACHINE_IMPERFECT_COLORS | MACHINE_NO_COCKTAIL )
GAME( 1982, portera, dockman, porter, portera, pisces_state, init_pisces, ROT90, "bootleg", "El Estivador (Spanish bootleg of Port Man on Galaxian hardware)", MACHINE_IMPERFECT_COLORS | MACHINE_NO_COCKTAIL ) // May be Portuguese, not Spanish
GAME( 1982, skybase, 0, skybase, skybase, pisces_state, init_pisces, ROT90, "Omori Electric Co., Ltd.", "Sky Base", MACHINE_SUPPORTS_SAVE )
GAME( 198?, kong, 0, kong, kong, galaxian_state, init_kong, ROT90, "Taito do Brasil", "Kong (Donkey Kong conversion on Galaxian hardware)", MACHINE_SUPPORTS_SAVE | MACHINE_WRONG_COLORS ) // rewrite of Donkey Kong (!) not a clone

View File

@ -2923,8 +2923,8 @@ ROM_START( chimerab )
ROM_LOAD16_BYTE( "prg8.bin", 0x000000, 0x010000, CRC(a682b1ca) SHA1(66f5d5a73f5e8cba87eac09c55eee59117d94f7b) )
ROM_LOAD16_BYTE( "prg7.bin", 0x000001, 0x010000, CRC(83b9982d) SHA1(68e7d344ebfffe19822c4cf9f7b13cb51f23537a) )
ROM_REGION( 0x4000, "iomcu", 0 ) /* TMP91640 Internal Code */
ROM_LOAD( "chimerab.mcu", 0x00000, 0x04000, NO_DUMP )
ROM_REGION( 0x4000, "iomcu", 0 ) /* TMP91640 Internal Code - using Cybattler program, label not confirmed */
ROM_LOAD( "mo-91028.mcu", 0x00000, 0x04000, BAD_DUMP CRC(a72e04a7) SHA1(0bd96272e37b0e23793ca47b98a966540e2e2df9) )
ROM_REGION( 0x080000, "scroll0", 0 ) /* Scroll 0 */
ROM_LOAD( "s1.bin", 0x000000, 0x080000, CRC(e4c2ac77) SHA1(db4bff3c02f22cc59a67b103fd176f4d88531f93) )
@ -3046,7 +3046,7 @@ ROM_START( cybattlr )
ROM_LOAD16_BYTE( "cb_07.rom", 0x000001, 0x010000, CRC(85d219d7) SHA1(a9628efc5eddefad739363ff0b2f37a2d095df86) )
ROM_REGION( 0x4000, "iomcu", 0 ) /* TMP91640 Internal Code */
ROM_LOAD( "mo-91028.mcu", 0x00000, 0x04000, NO_DUMP )
ROM_LOAD( "mo-91028.mcu", 0x00000, 0x04000, CRC(a72e04a7) SHA1(0bd96272e37b0e23793ca47b98a966540e2e2df9) )
ROM_REGION( 0x080000, "scroll0", 0 ) /* Scroll 0 */
ROM_LOAD( "cb_m01.rom", 0x000000, 0x080000, CRC(1109337f) SHA1(ab294d87c9b4eb54401da5ad6ea171e4c0a700b5) )
@ -5179,11 +5179,6 @@ void megasys1_bc_iosim_state::init_chimeraba() // Type C
m_ip_select_values = chimeraba_seq;
}
void megasys1_bc_iosim_state::init_cybattlr() // Type C
{
m_ip_select_values = cybattler_seq;
}
// Type D
void megasys1_typed_state::init_peekaboo()
{
@ -5276,9 +5271,9 @@ GAME( 1991, 64street, 0, system_C_iomcu, 64street, megasys1_bc
GAME( 1991, 64streetj, 64street, system_C_iomcu, 64street, megasys1_bc_iomcu_state, empty_init, ROT0, "Jaleco", "64th. Street - A Detective Story (Japan, set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, 64streetja, 64street, system_C_iomcu, 64street, megasys1_bc_iomcu_state, empty_init, ROT0, "Jaleco", "64th. Street - A Detective Story (Japan, set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1992, bigstrik, 0, system_C_iomcu, bigstrik, megasys1_bc_iomcu_state, empty_init, ROT0, "Jaleco", "Big Striker", MACHINE_SUPPORTS_SAVE )
GAME( 1993, chimerab, 0, system_C_iosim, chimerab, megasys1_bc_iosim_state, init_cybattlr, ROT0, "Jaleco", "Chimera Beast (Japan, prototype, set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1993, chimerab, 0, system_C_iomcu, chimerab, megasys1_bc_iomcu_state, empty_init, ROT0, "Jaleco", "Chimera Beast (Japan, prototype, set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1993, chimeraba, chimerab, system_C_iosim, chimerab, megasys1_bc_iosim_state, init_chimeraba,ROT0, "Jaleco", "Chimera Beast (Japan, prototype, set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1993, cybattlr, 0, system_C_iosim, cybattlr, megasys1_bc_iosim_state, init_cybattlr, ROT90, "Jaleco", "Cybattler", MACHINE_SUPPORTS_SAVE )
GAME( 1993, cybattlr, 0, system_C_iomcu, cybattlr, megasys1_bc_iomcu_state, empty_init, ROT90, "Jaleco", "Cybattler", MACHINE_SUPPORTS_SAVE )
// Type D
GAME( 1993, peekaboo, 0, system_D, peekaboo, megasys1_typed_state, init_peekaboo, ROT0, "Jaleco", "Peek-a-Boo! (Japan, ver. 1.1)", MACHINE_SUPPORTS_SAVE )

View File

@ -271,7 +271,6 @@ public:
void init_avspirit();
void init_chimeraba();
void init_cybattlr();
void init_hayaosi1();
void init_edf();
@ -291,7 +290,6 @@ protected:
static constexpr u8 edf_seq[7] = { 0x20,0x21,0x22,0x23,0x24, 0xf0,0x06 };
static constexpr u8 hayaosi1_seq[7] = { 0x51,0x52,0x53,0x54,0x55, 0xfc,0x06 };
static constexpr u8 chimeraba_seq[7] = { 0x56,0x52,0x53,0x55,0x54, 0xfa,0x06 };
static constexpr u8 cybattler_seq[7] = { 0x56,0x52,0x53,0x54,0x55, 0xf2,0x06 };
void megasys1B_iosim_map(address_map &map);
void megasys1C_iosim_map(address_map &map);

View File

@ -18450,6 +18450,7 @@ atlantis2 // (c) 1981 Comsoft
atlantisb // bootleg
azurian // (c) 1982 Rait Electronics Ltd
bagmanm2 // (c) 1984 Valadon Automation / GIB
bagmanm3 // bootleg
bagmanmc // bootleg
batman2 // bootleg
bigkonggx // bootleg
@ -34890,6 +34891,9 @@ robotadv
savant //
savant2 //
@source:novag/sdiamond.cpp
sdiamond
@source:novag/sexpert.cpp
sexperta //
sexperta1 //
@ -38367,11 +38371,12 @@ rc702 // 1979 RC702
rc759 // 1984 RC759
@source:rm/rm380z.cpp
rm380z //
rm380z34d //
rm380z34e //
rm480z //
rm480za //
rm380z // 1978 RM380z with COS 4.0 firmware
rm380zhrg // 1978 RM380z with COS 4.0 and HRG
rm380z34d // 1978 RM380z with COS 3.4 firmware and casette
rm380z34e // 1978 RM380z with COS 3.4 firmware and casette
rm480z // 1981 RM480z
rm480za // 1981 RM480z
@source:rm/rmnimbus.cpp
nimbus // RM Nimbus 186
@ -40352,6 +40357,7 @@ chopliftu // 834-5795 (c) 1985, (c) 1982 Dan Gorlin (S2)
dakkochn // 836-6483 (S2)
flicky // (c) 1984 (S1)
flickya // (c) 1984 (S1)
flickyb // (c) 1984 (S1)
flickyo // (c) 1984 (S1)
flickys1 // (c) 1984 (S1)
flickys2 // (c) 1984 (S1)
@ -42840,6 +42846,7 @@ tabe22 // (c) Tab Products
@source:taito/2mindril.cpp
2mindril // (c) 1993 Taito
2mindrila // (c) 1993 Taito
@source:taito/40love.cpp
40love // A30 (c) 1984 Taito
@ -46163,6 +46170,9 @@ psr500 // 1991 PSR-500
@source:yamaha/ympsr540.cpp
psr540 // 1999 PSR-540
@source:yamaha/ympsr2000.cpp
psr2000
@source:yamaha/ymqy70.cpp
qy70 // 1997 QY-70

View File

@ -4897,7 +4897,7 @@ ROM_START( comg079 ) // Cal Omega v7.9 (Arcade Poker)
ROM_LOAD( "pkcga.u68", 0x1000, 0x0800, CRC(6e3e9b1d) SHA1(14eb8d14ce16719a6ad7d13db01e47c8f05955f0) )
ROM_REGION( 0x100, "proms", 0 )
ROM_LOAD( "pokclr.u28", 0x0000, 0x0100, CRC(a8191ef7) SHA1(d6f777980179ab091e2713ee815d46bf9c0ac486) )
ROM_LOAD( "clrprom_7.9.u28", 0x0000, 0x0100,CRC(a26a8fae) SHA1(d570fe9443a0912bd34b81ac4c3e4c5f8901f523) )
ROM_END
ROM_START( comg080 ) // Cal Omega v8.0 (Arcade Black Jack)

View File

@ -252,14 +252,15 @@ ROM_START( odyssey )
// boot image? Contains valid x86 code at $f50, login info to a network at $000
ROM_LOAD( "sgi_u5_165_0030_0_at28c010.bin", 0x80000, 0x20000, CRC(75a80169) SHA1(a8ece0f82a49f721fb178dbe25fc859bd65ce44f) ) // U5 - 165-0030 CONFIG (Atmel 28C010-12PC EEPROM)
ROM_REGION( 0x300000, "other", 0 ) // remaining BIOS
ROM_REGION( 0x380000, "other", 0 ) // remaining BIOS
// doesn't seem to have valid x86 boot vectors, may be reused later.
ROM_LOAD( "sgi_bios_76.bin", 0x000000, 0x80000, CRC(00592222) SHA1(29281d25aaf2051e0794dece8be146bb63d5c488) )
ROM_LOAD( "sgi_bios_65.bin", 0x080000, 0x80000, CRC(af970c2a) SHA1(0fb49bca34dbd0725b5abb9c876bb849be31b3ed) )
ROM_LOAD( "sgi_bios_55.bin", 0x100000, 0x80000, CRC(0138ef08) SHA1(fad1c0edf37042fffcb5a4006fd69ac59b55ab33) )
ROM_LOAD( "sgi_bios_46.bin", 0x180000, 0x80000, CRC(37090b87) SHA1(431c0a1954d5bf7fd4fa6f2b983010fbf3c8ce13) )
ROM_LOAD( "sgi_bios_31.bin", 0x200000, 0x80000, CRC(0954278b) SHA1(dc04a0604159ddd3d24bdd292b2947cc443054f8) )
ROM_LOAD( "sgi_bios_00.bin", 0x280000, 0x80000, CRC(41480fb5) SHA1(073596d3ba40ae67e3be3f410d7b29c77988df47) )
ROM_LOAD( "sgi_bios_62.bin", 0x100000, 0x80000, CRC(e76b0ec1) SHA1(e537a8592759e34c6c039f2d4cb77c9b58459841) )
ROM_LOAD( "sgi_bios_55.bin", 0x180000, 0x80000, CRC(0138ef08) SHA1(fad1c0edf37042fffcb5a4006fd69ac59b55ab33) )
ROM_LOAD( "sgi_bios_46.bin", 0x200000, 0x80000, CRC(37090b87) SHA1(431c0a1954d5bf7fd4fa6f2b983010fbf3c8ce13) )
ROM_LOAD( "sgi_bios_31.bin", 0x280000, 0x80000, CRC(0954278b) SHA1(dc04a0604159ddd3d24bdd292b2947cc443054f8) )
ROM_LOAD( "sgi_bios_00.bin", 0x300000, 0x80000, CRC(41480fb5) SHA1(073596d3ba40ae67e3be3f410d7b29c77988df47) )
ROM_REGION32_LE( 0x100000, "pci:07.0", 0 )
ROM_COPY( "other", 0x00000, 0x00000, 0x80000 )
@ -283,5 +284,5 @@ ROM_END
* Game Driver(s) *
**************************************/
/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */
/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */
GAME( 1998, odyssey, 0, odyssey, odyssey, odyssey_state, empty_init, ROT270, "Silicon Gaming", "Odyssey", MACHINE_IS_SKELETON )

View File

@ -1240,7 +1240,7 @@ void armedf_state::kozure(machine_config &config)
MCFG_VIDEO_START_OVERRIDE(armedf_state,terraf)
/* sound hardware */
sound_config(config);
sound_config_3812(config);
}
void armedf_state::armedf(machine_config &config)

View File

@ -213,9 +213,9 @@ void gomoku_sound_device::sound2_w(offs_t offset, uint8_t data)
// oneshot frequency is hand tune...
if ((m_soundregs2[0x1d] & 0x0f) < 0x0c)
voice->frequency = 3000 / 16; // ichi, ni, san, yon, go
voice->frequency = (18'432'000 / 96000); // ichi, ni, san, yon, go
else
voice->frequency = 8000 / 16; // shoot
voice->frequency = (18'432'000 / 48000); // shoot
voice->volume = 8;
voice->counter = 0;

View File

@ -232,4 +232,4 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1987, accord, 0, 0, accord, accord, accord_state, empty_init, "Novag", "Accord", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1987, accord, 0, 0, accord, accord, accord_state, empty_init, "Novag Industries", "Accord", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

View File

@ -264,4 +264,4 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1985, cexpert, 0, 0, cexpert, cexpert, cexpert_state, empty_init, "Novag", "Constellation Expert", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1985, cexpert, 0, 0, cexpert, cexpert, cexpert_state, empty_init, "Novag Industries", "Constellation Expert", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

View File

@ -293,5 +293,5 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1986, cfortea, 0, 0, cforte, cforte, cforte_state, empty_init, "Novag", "Constellation Forte (version A)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1986, cforteb, cfortea, 0, cforte, cforte, cforte_state, empty_init, "Novag", "Constellation Forte (version B)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1986, cfortea, 0, 0, cforte, cforte, cforte_state, empty_init, "Novag Industries", "Constellation Forte (version A)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1986, cforteb, cfortea, 0, cforte, cforte, cforte_state, empty_init, "Novag Industries", "Constellation Forte (version B)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

View File

@ -513,11 +513,11 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1981, ssensor4, 0, 0, ssensor4, ssensor4, const_state, empty_init, "Novag", "Super Sensor IV", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1981, ssensor4, 0, 0, ssensor4, ssensor4, const_state, empty_init, "Novag Industries", "Super Sensor IV", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1983, const, 0, 0, nconst, nconst, const_state, init_const, "Novag", "Constellation", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1984, const36, const, 0, nconst36, nconst, const_state, init_const, "Novag", "Constellation 3.6MHz (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1986, const36a, const, 0, nconst36a, nconst, const_state, init_const, "Novag", "Constellation 3.6MHz (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1986, constq, const, 0, nconstq, nconstq, const_state, init_const, "Novag", "Constellation Quattro", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1983, const, 0, 0, nconst, nconst, const_state, init_const, "Novag Industries", "Constellation", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1984, const36, const, 0, nconst36, nconst, const_state, init_const, "Novag Industries", "Constellation 3.6MHz (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1986, const36a, const, 0, nconst36a, nconst, const_state, init_const, "Novag Industries", "Constellation 3.6MHz (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1986, constq, const, 0, nconstq, nconstq, const_state, init_const, "Novag Industries", "Constellation Quattro", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1984, supercon, 0, 0, sconst, sconst, const_state, empty_init, "Novag", "Super Constellation", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1984, supercon, 0, 0, sconst, sconst, const_state, empty_init, "Novag Industries", "Super Constellation", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

View File

@ -237,4 +237,4 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1985, constjr, 0, 0, constjr, constjr, constjr_state, empty_init, "Novag", "Constellation Junior", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1985, constjr, 0, 0, constjr, constjr, constjr_state, empty_init, "Novag Industries", "Constellation Junior", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

View File

@ -375,7 +375,7 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1991, diablo68, 0, 0, diablo68k, diablo68k, diablo_state, empty_init, "Novag", "Diablo 68000 (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1991, diablo68a, diablo68, 0, diablo68k, diablo68k, diablo_state, empty_init, "Novag", "Diablo 68000 (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1991, diablo68, 0, 0, diablo68k, diablo68k, diablo_state, empty_init, "Novag Industries", "Diablo 68000 (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1991, diablo68a, diablo68, 0, diablo68k, diablo68k, diablo_state, empty_init, "Novag Industries", "Diablo 68000 (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1991, scorpio68, 0, 0, scorpio68k, diablo68k, diablo_state, empty_init, "Novag", "Scorpio 68000", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1991, scorpio68, 0, 0, scorpio68k, diablo68k, diablo_state, empty_init, "Novag Industries", "Scorpio 68000", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

View File

@ -312,4 +312,4 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1989, mentor16, 0, 0, mentor16, mentor16, mentor16_state, empty_init, "Novag", "Mentor 16", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1989, mentor16, 0, 0, mentor16, mentor16, mentor16_state, empty_init, "Novag Industries", "Mentor 16", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

View File

@ -242,4 +242,4 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1981, nmicro, 0, 0, micro, micro, micro_state, empty_init, "Novag", "Micro Chess", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1981, nmicro, 0, 0, micro, micro, micro_state, empty_init, "Novag Industries", "Micro Chess", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

View File

@ -237,4 +237,4 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1982, nmicro2, 0, 0, micro2, micro2, micro2_state, empty_init, "Novag", "Micro II (Novag)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1982, nmicro2, 0, 0, micro2, micro2, micro2_state, empty_init, "Novag Industries", "Micro II (Novag)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

View File

@ -469,8 +469,8 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1987, nprimo, 0, 0, primo, primo, primo_state, empty_init, "Novag", "Primo (Novag)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1987, nprimo, 0, 0, primo, primo, primo_state, empty_init, "Novag Industries", "Primo (Novag)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1988, supremo, 0, 0, supremo, supremo, primo_state, empty_init, "Novag", "Supremo", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1988, supremo, 0, 0, supremo, supremo, primo_state, empty_init, "Novag Industries", "Supremo", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1990, nsnova, 0, 0, snova, snova, primo_state, empty_init, "Novag", "Super Nova (Novag, v1.05)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1990, nsnova, 0, 0, snova, snova, primo_state, empty_init, "Novag Industries", "Super Nova (Novag, v1.05)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

View File

@ -555,4 +555,4 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1982, robotadv, 0, 0, robotadv, robotadv, robotadv_state, empty_init, "Novag", "Chess Robot Adversary", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_MECHANICAL | MACHINE_IMPERFECT_CONTROLS )
SYST( 1982, robotadv, 0, 0, robotadv, robotadv, robotadv_state, empty_init, "Novag Industries", "Chess Robot Adversary", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_MECHANICAL | MACHINE_IMPERFECT_CONTROLS )

View File

@ -436,5 +436,5 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1981, savant, 0, 0, savant, savant, savant_state, empty_init, "Novag", "Savant", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1982, savant2, savant, 0, savant, savant, savant_state, empty_init, "Novag", "Savant II", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1981, savant, 0, 0, savant, savant, savant_state, empty_init, "Novag Industries", "Savant", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1982, savant2, savant, 0, savant, savant, savant_state, empty_init, "Novag Industries", "Savant II", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

371
src/mame/novag/sdiamond.cpp Normal file
View File

@ -0,0 +1,371 @@
// license:BSD-3-Clause
// copyright-holders:hap
// thanks-to:Berger
/*******************************************************************************
Novag (Perfect Technology*) Star Diamond
*: Novag Industries dissolved in 2000. The Novag brand continued for a few years
under Perfect Technology, Ltd., established by the daughter of Novag's founder.
The main programmer (David Kittinger) also moved to the new company.
Hardware notes:
- PCB label: TF-05 94V0Δ
- Hitachi H8S/2312 12312VTE25V, 25MHz XTAL
- 512KB Flash ROM (SST 39VF400A), only 192KB used
- 256KB RAM (2*Hynix HY62V8100B)
- LCD with custom segments
- piezo, 16 LEDs, button sensors chessboard
TODO:
- add internal artwork
- it does a cold boot at every reset, so nvram won't work properly unless MAME
adds some kind of auxillary autosave state feature at power-off
*******************************************************************************/
#include "emu.h"
#include "bus/rs232/rs232.h"
#include "cpu/h8/h8s2319.h"
#include "machine/nvram.h"
#include "machine/sensorboard.h"
#include "sound/dac.h"
#include "video/pwm.h"
#include "screen.h"
#include "speaker.h"
// internal artwork
//#include "novag_sdiamond.lh"
namespace {
class sdiamond_state : public driver_device
{
public:
sdiamond_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_board(*this, "board"),
m_led_pwm(*this, "led_pwm"),
m_lcd_pwm(*this, "lcd_pwm"),
m_dac(*this, "dac"),
m_rs232(*this, "rs232"),
m_inputs(*this, "IN.%u", 0),
m_out_lcd(*this, "s%u.%u", 0U, 0U)
{ }
void sdiamond(machine_config &config);
DECLARE_INPUT_CHANGED_MEMBER(power_switch);
protected:
virtual void machine_reset() override { set_power(true); }
virtual void machine_start() override;
private:
// devices/pointers
required_device<h8s2312_device> m_maincpu;
required_device<sensorboard_device> m_board;
required_device<pwm_display_device> m_led_pwm;
required_device<pwm_display_device> m_lcd_pwm;
required_device<dac_bit_interface> m_dac;
required_device<rs232_port_device> m_rs232;
required_ioport_array<4> m_inputs;
output_finder<4, 16> m_out_lcd;
bool m_power = false;
u8 m_inp_mux = 0;
u8 m_lcd_sclk = 0;
u16 m_lcd_segs = 0;
u8 m_lcd_com = 0;
void main_map(address_map &map);
// I/O handlers
void lcd_pwm_w(offs_t offset, u8 data);
void update_lcd();
void lcd_segs_w(u8 data);
void lcd_com_w(offs_t offset, u8 data, u8 mem_mask);
void standby(int state);
void set_power(bool power);
void p1_w(u8 data);
u8 p2_r();
u8 p4_r();
u8 pf_r();
void pg_w(u8 data);
};
void sdiamond_state::machine_start()
{
m_out_lcd.resolve();
// register for savestates
save_item(NAME(m_power));
save_item(NAME(m_inp_mux));
save_item(NAME(m_lcd_sclk));
save_item(NAME(m_lcd_segs));
save_item(NAME(m_lcd_com));
}
/*******************************************************************************
I/O
*******************************************************************************/
// power
void sdiamond_state::standby(int state)
{
// clear display
if (state)
{
m_lcd_pwm->clear();
m_led_pwm->clear();
}
}
void sdiamond_state::set_power(bool power)
{
// power switch is tied to NMI
m_maincpu->set_input_line(INPUT_LINE_NMI, power ? ASSERT_LINE : CLEAR_LINE);
m_power = power;
}
INPUT_CHANGED_MEMBER(sdiamond_state::power_switch)
{
if (newval)
set_power(bool(param));
}
// LCD
void sdiamond_state::lcd_pwm_w(offs_t offset, u8 data)
{
m_out_lcd[offset & 0x3f][offset >> 6] = data;
}
void sdiamond_state::update_lcd()
{
for (int i = 0; i < 4; i++)
{
// LCD common is 0/1/Hi-Z
const u32 data = BIT(m_lcd_com, i + 4) ? (BIT(m_lcd_com, i) ? ~m_lcd_segs : m_lcd_segs) : 0;
m_lcd_pwm->write_row(i, data);
}
}
void sdiamond_state::lcd_com_w(offs_t offset, u8 data, u8 mem_mask)
{
// P20-P23: LCD common
m_lcd_com = mem_mask << 4 | (data & 0xf);
update_lcd();
}
void sdiamond_state::lcd_segs_w(u8 data)
{
// P35: 2*14015B C (chained)
if (data & 0x20 && !m_lcd_sclk)
{
// P34: 14015B D, outputs to LCD segments
m_lcd_segs = m_lcd_segs << 1 | BIT(data, 4);
update_lcd();
}
m_lcd_sclk = BIT(data, 5);
}
// misc
void sdiamond_state::p1_w(u8 data)
{
// P10-P17: input mux, led data
m_inp_mux = ~data;
m_led_pwm->write_mx(~data);
}
u8 sdiamond_state::p2_r()
{
u8 data = 0;
// P26: power switch
if (!m_power)
data |= 0x40;
// P27: battery status
data |= m_inputs[3]->read() << 7;
return data | 0xf;
}
u8 sdiamond_state::p4_r()
{
u8 data = 0;
// P40-P47: read chessboard
for (int i = 0; i < 8; i++)
if (BIT(m_inp_mux, i))
data |= m_board->read_rank(i ^ 7);
return ~data;
}
u8 sdiamond_state::pf_r()
{
u8 data = 0;
// PF0-PF2: read buttons
for (int i = 0; i < 3; i++)
if (m_inp_mux & m_inputs[i]->read())
data |= 1 << i;
return ~data;
}
void sdiamond_state::pg_w(u8 data)
{
// PG0,PG1: led select
m_led_pwm->write_my(~data & 3);
}
/*******************************************************************************
Address Maps
*******************************************************************************/
void sdiamond_state::main_map(address_map &map)
{
map(0x000000, 0x07ffff).rom();
map(0x400000, 0x43ffff).ram().share("nvram");
}
/*******************************************************************************
Input Ports
*******************************************************************************/
static INPUT_PORTS_START( sdiamond )
PORT_START("IN.0")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("Next Best / Take Back / Print Board")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_NAME("Trace Forward / Print Game")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_NAME("Easy / Replay")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_NAME("Random / Video")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("Restore / Human")
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("Book Select / Auto/Demo")
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("Sound / Auto Clock")
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("Referee / Print Moves")
PORT_START("IN.1")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("Color")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Verify / Setup / Rating")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Pro-op Print / King")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("Pro-op Priority / Queen")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Pro-op Delete / Rook")
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Pro-op Save / Bishop")
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME("Load Game / Knight")
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("Save Game / Pawn")
PORT_START("IN.2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_NAME("Go")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Info")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_NAME("Hint")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_NAME("Training")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_NAME("Option 1/2")
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_H) PORT_NAME("Set Level")
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_J) PORT_NAME("Clear / Clear Board")
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_K) PORT_NAME("New Game")
PORT_START("IN.3")
PORT_CONFNAME( 0x01, 0x00, "Battery Status" )
PORT_CONFSETTING( 0x01, "Low" )
PORT_CONFSETTING( 0x00, DEF_STR( Normal ) )
PORT_START("POWER")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_ON) PORT_CHANGED_MEMBER(DEVICE_SELF, sdiamond_state, power_switch, 1)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, sdiamond_state, power_switch, 0)
INPUT_PORTS_END
/*******************************************************************************
Machine Configs
*******************************************************************************/
void sdiamond_state::sdiamond(machine_config &config)
{
// basic machine hardware
H8S2312(config, m_maincpu, 25_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &sdiamond_state::main_map);
m_maincpu->nvram_enable_backup(true);
m_maincpu->standby_cb().set(m_maincpu, FUNC(h8s2312_device::nvram_set_battery));
m_maincpu->standby_cb().append(FUNC(sdiamond_state::standby));
m_maincpu->write_sci_tx<0>().set(m_rs232, FUNC(rs232_port_device::write_txd));
m_maincpu->write_port1().set(FUNC(sdiamond_state::p1_w));
m_maincpu->read_port2().set(FUNC(sdiamond_state::p2_r));
m_maincpu->write_port2().set(FUNC(sdiamond_state::lcd_com_w));
m_maincpu->write_port3().set(FUNC(sdiamond_state::lcd_segs_w));
m_maincpu->read_port4().set(FUNC(sdiamond_state::p4_r));
m_maincpu->read_portf().set(FUNC(sdiamond_state::pf_r));
m_maincpu->write_portf().set(m_dac, FUNC(dac_1bit_device::write)).bit(6);
m_maincpu->write_portg().set(FUNC(sdiamond_state::pg_w));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
SENSORBOARD(config, m_board).set_type(sensorboard_device::BUTTONS);
m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess));
m_board->set_delay(attotime::from_msec(150));
//m_board->set_nvram_enable(true);
// video hardware
PWM_DISPLAY(config, m_lcd_pwm).set_size(4, 16);
m_lcd_pwm->output_x().set(FUNC(sdiamond_state::lcd_pwm_w));
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_refresh_hz(60);
screen.set_size(1920/5, 671/5);
screen.set_visarea_full();
PWM_DISPLAY(config, m_led_pwm).set_size(2, 8);
//config.set_default_layout(layout_novag_sdiamond);
// rs232 (configure after video)
RS232_PORT(config, m_rs232, default_rs232_devices, nullptr);
m_rs232->rxd_handler().set(m_maincpu, FUNC(h8s2312_device::sci_rx_w<0>));
// sound hardware
SPEAKER(config, "speaker").front_center();
DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25);
}
/*******************************************************************************
ROM Definitions
*******************************************************************************/
ROM_START( sdiamond ) // ID = H8S/SD V1.04
ROM_REGION16_BE( 0x80000, "maincpu", 0 )
ROM_LOAD16_WORD_SWAP("39vf400a.ic3", 0x00000, 0x80000, CRC(ee9a4fee) SHA1(b86e5efa5b7b9ddbe9fe1dabfe8cbc2bc40809b8) )
ROM_REGION( 72533, "screen", 0 )
ROM_LOAD("sdiamond.svg", 0, 72533, CRC(34944b61) SHA1(4a0536ac07790cced9f9bf15522b17ebc375ff8a) )
ROM_END
} // anonymous namespace
/*******************************************************************************
Drivers
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 2003, sdiamond, 0, 0, sdiamond, sdiamond, sdiamond_state, empty_init, "Perfect Technology", "Star Diamond", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_NOT_WORKING )

View File

@ -598,17 +598,17 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1988, sexperta, 0, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag", "Super Expert (version A, set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 886
SYST( 1987, sexperta1, sexperta, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag", "Super Expert (version A, set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 878
SYST( 1987, sexperta2, sexperta, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag", "Super Expert (version A, set 3)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 878
SYST( 1988, sexpertb, sexperta, 0, sexpertb, sexpertb, sexpert_state, init_sexpert, "Novag", "Super Expert (version B)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 887
SYST( 1990, sexpertc, sexperta, 0, sexpertb, sexpertb, sexpert_state, init_sexpert, "Novag", "Super Expert (version C, v3.6)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 902
SYST( 1990, sexpertc1, sexperta, 0, sexpertb, sexpertb, sexpert_state, init_sexpert, "Novag", "Super Expert (version C, v3.0)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 902
SYST( 1990, sexpertc2, sexperta, 0, sexpertb, sexpertb, sexpert_state, init_sexpert, "Novag", "Super Expert (version C, v1.2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 902
SYST( 1988, sexperta, 0, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag Industries", "Super Expert (version A, set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 886
SYST( 1987, sexperta1, sexperta, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag Industries", "Super Expert (version A, set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 878
SYST( 1987, sexperta2, sexperta, 0, sexpert, sexpert, sexpert_state, init_sexpert, "Novag Industries", "Super Expert (version A, set 3)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 878
SYST( 1988, sexpertb, sexperta, 0, sexpertb, sexpertb, sexpert_state, init_sexpert, "Novag Industries", "Super Expert (version B)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 887
SYST( 1990, sexpertc, sexperta, 0, sexpertb, sexpertb, sexpert_state, init_sexpert, "Novag Industries", "Super Expert (version C, v3.6)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 902
SYST( 1990, sexpertc1, sexperta, 0, sexpertb, sexpertb, sexpert_state, init_sexpert, "Novag Industries", "Super Expert (version C, v3.0)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 902
SYST( 1990, sexpertc2, sexperta, 0, sexpertb, sexpertb, sexpert_state, init_sexpert, "Novag Industries", "Super Expert (version C, v1.2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // 902
SYST( 1987, sfortea, 0, 0, sforte, sexpert, sforte_state, init_sexpert, "Novag", "Super Forte (version A, set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1987, sfortea1, sfortea, 0, sforte, sexpert, sforte_state, init_sexpert, "Novag", "Super Forte (version A, set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1987, sfortea2, sfortea, 0, sforte, sexpert, sforte_state, init_sexpert, "Novag", "Super Forte (version A, set 3)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1988, sforteb, sfortea, 0, sforteb, sexpertb, sforte_state, init_sexpert, "Novag", "Super Forte (version B)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1990, sfortec, sfortea, 0, sforteb, sexpertb, sforte_state, init_sexpert, "Novag", "Super Forte (version C, v3.6)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1990, sfortec1, sfortea, 0, sforteb, sexpertb, sforte_state, init_sexpert, "Novag", "Super Forte (version C, v1.2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1987, sfortea, 0, 0, sforte, sexpert, sforte_state, init_sexpert, "Novag Industries", "Super Forte (version A, set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1987, sfortea1, sfortea, 0, sforte, sexpert, sforte_state, init_sexpert, "Novag Industries", "Super Forte (version A, set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1987, sfortea2, sfortea, 0, sforte, sexpert, sforte_state, init_sexpert, "Novag Industries", "Super Forte (version A, set 3)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1988, sforteb, sfortea, 0, sforteb, sexpertb, sforte_state, init_sexpert, "Novag Industries", "Super Forte (version B)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1990, sfortec, sfortea, 0, sforteb, sexpertb, sforte_state, init_sexpert, "Novag Industries", "Super Forte (version C, v3.6)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1990, sfortec1, sfortea, 0, sforteb, sexpertb, sforte_state, init_sexpert, "Novag Industries", "Super Forte (version C, v1.2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

View File

@ -420,9 +420,9 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1987, nvip, 0, 0, vip, vip, vip_state, empty_init, "Novag", "VIP (Novag)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1987, nvip, 0, 0, vip, vip, vip_state, empty_init, "Novag Industries", "VIP (Novag)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1989, nsvip, 0, 0, svip, svip, vip_state, empty_init, "Novag", "Super VIP (v3.7)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1989, nsvipa, nsvip, 0, svip, svip, vip_state, empty_init, "Novag", "Super VIP (v3.6)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1989, nsvipb, nsvip, 0, svip, svip, vip_state, empty_init, "Novag", "Super VIP (v1.03)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1989, nsvipc, nsvip, 0, svip, svip, vip_state, empty_init, "Novag", "Super VIP (v1.01)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1989, nsvip, 0, 0, svip, svip, vip_state, empty_init, "Novag Industries", "Super VIP (v3.7)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1989, nsvipa, nsvip, 0, svip, svip, vip_state, empty_init, "Novag Industries", "Super VIP (v3.6)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1989, nsvipb, nsvip, 0, svip, svip, vip_state, empty_init, "Novag Industries", "Super VIP (v1.03)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1989, nsvipc, nsvip, 0, svip, svip, vip_state, empty_init, "Novag Industries", "Super VIP (v1.01)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

View File

@ -168,7 +168,6 @@ Module timer tag static_vblank_timer name m_expire.seconds
#include "rm380z.h"
#include "speaker.h"
#include "emupal.h"
#include "screen.h"
@ -191,14 +190,14 @@ void rm380z_state::rm380z_io(address_map &map)
map(0xc5, 0xff).rw(FUNC(rm380z_state::rm380z_porthi_r), FUNC(rm380z_state::rm380z_porthi_w));
}
void rm380z_state::rm480z_mem(address_map &map)
void rm480z_state::rm480z_mem(address_map &map)
{
map(0x0000, 0xe7ff).ram();
map(0xe800, 0xf7ff).rom().region(RM380Z_MAINCPU_TAG, 0);
map(0xf800, 0xffff).ram();
}
void rm380z_state::rm480z_io(address_map &map)
void rm480z_state::rm480z_io(address_map &map)
{
//map(0x00, 0x17).ram(); // videoram
//map(0x18, 0x18).mirror(0xff00); // control port 0
@ -215,8 +214,19 @@ void rm380z_state::rm480z_io(address_map &map)
}
INPUT_PORTS_START( rm380z )
// PORT_START("additional_chars")
// PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Escape") PORT_CODE(KEYCODE_ESC) PORT_CODE(KEYCODE_ESC)
INPUT_PORTS_END
INPUT_PORTS_START( rm380zhrg )
PORT_START("display_type")
PORT_CONFNAME( 0x01, 0x00, "Monitor" ) PORT_CHANGED_MEMBER(DEVICE_SELF, rm380z_state_cos40_hrg, monitor_changed, 0)
PORT_CONFSETTING( 0x00, "Colour Monitor" )
PORT_CONFSETTING( 0x01, "Monochrome b/w Monitor" )
INPUT_PORTS_END
//
@ -230,18 +240,15 @@ static void rm380z_floppies(device_slot_interface &device)
uint32_t rm380z_state::screen_update_rm380z(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
if (screen.width() > 240)
{
update_screen_vdu80(bitmap);
}
else
{
update_screen_vdu40(bitmap);
}
// blank screen
bitmap.fill(0);
update_screen(bitmap);
return 0;
}
void rm380z_state::rm380z(machine_config &config)
void rm380z_state::configure(machine_config &config)
{
/* basic machine hardware */
Z80(config, m_maincpu, 16_MHz_XTAL / 4);
@ -250,23 +257,11 @@ void rm380z_state::rm380z(machine_config &config)
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_refresh_hz(50);
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
m_screen->set_size(640, 240);
m_screen->set_visarea_full();
m_screen->set_screen_update(FUNC(rm380z_state::screen_update_rm380z));
m_screen->set_palette("palette");
PALETTE(config, "palette", palette_device::MONOCHROME);
SPEAKER(config, "mono").front_center();
/* cassette */
CASSETTE(config, m_cassette);
// m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED);
m_cassette->set_default_state(CASSETTE_PLAY | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED);
m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05);
/* RAM configurations */
RAM(config, RAM_TAG).set_default_size("56K");
@ -281,14 +276,43 @@ void rm380z_state::rm380z(machine_config &config)
keyboard.set_keyboard_callback(FUNC(rm380z_state::keyboard_put));
}
void rm380z_state::rm480z(machine_config &config)
void rm380z_state_cos34::configure(machine_config &config)
{
rm380z_state::configure(config);
/* cassette */
CASSETTE(config, m_cassette);
// m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED);
m_cassette->set_default_state(CASSETTE_PLAY | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED);
m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05);
m_screen->set_raw(8_MHz_XTAL, 512, 0, 320, 312, 0, 240);
PALETTE(config, "palette", palette_device::MONOCHROME_HIGHLIGHT);
}
void rm380z_state_cos40::configure(machine_config &config)
{
rm380z_state::configure(config);
m_screen->set_raw(16_MHz_XTAL, 1024, 0, 640, 312, 0, 240);
PALETTE(config, "palette", palette_device::MONOCHROME_HIGHLIGHT);
}
void rm380z_state_cos40_hrg::configure(machine_config &config)
{
rm380z_state::configure(config);
m_screen->set_raw(16_MHz_XTAL, 1024, 0, 640, 312, 0, 240);
PALETTE(config, m_palette, FUNC(rm380z_state_cos40_hrg::palette_init), 19);
}
void rm480z_state::configure(machine_config &config)
{
/* basic machine hardware */
Z80(config, m_maincpu, 16_MHz_XTAL / 4);
m_maincpu->set_addrmap(AS_PROGRAM, &rm380z_state::rm480z_mem);
m_maincpu->set_addrmap(AS_IO, &rm380z_state::rm480z_io);
m_maincpu->set_addrmap(AS_PROGRAM, &rm480z_state::rm480z_mem);
m_maincpu->set_addrmap(AS_IO, &rm480z_state::rm480z_io);
MCFG_MACHINE_RESET_OVERRIDE(rm380z_state, rm480z)
/* video hardware */
// screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
// screen.set_refresh_hz(50);
@ -309,7 +333,7 @@ void rm380z_state::rm480z(machine_config &config)
/* ROM definitions */
ROM_START( rm380z34d ) // COS 3.4D/F
ROM_REGION( 0x10000, RM380Z_MAINCPU_TAG, 0 )
ROM_REGION( 0x10000, RM380Z_MAINCPU_TAG, ROMREGION_ERASEFF )
ROM_LOAD( "cos34d-f.bin", 0x0000, 0x1000, CRC(eb128b40) SHA1(c46f358fb76459987e41750d052995563f2f7d53))
// chargen ROM is undumped, afaik
ROM_REGION( 0x1680, "chargen", 0 )
@ -317,7 +341,7 @@ ROM_START( rm380z34d ) // COS 3.4D/F
ROM_END
ROM_START( rm380z34e ) // COS 3.4E/M
ROM_REGION( 0x10000, RM380Z_MAINCPU_TAG, 0 )
ROM_REGION( 0x10000, RM380Z_MAINCPU_TAG, ROMREGION_ERASEFF )
ROM_LOAD( "cos34e-m.bin", 0x0000, 0x1000, CRC(20e2ddf4) SHA1(3177b28793d5a348c94fd0ae6393d74e2e9a8662))
// chargen ROM is undumped, afaik
ROM_REGION( 0x1680, "chargen", 0 )
@ -334,6 +358,16 @@ ROM_START( rm380z ) // COS 4.0B/M
ROM_LOAD( "c-gen-22.bin", 0x0000, 0x0800, CRC(1b67127f) SHA1(289a919871d30c5e832d22244bcac1dcfd544baa) )
ROM_END
ROM_START( rm380zhrg ) // COS 4.0B/M
ROM_REGION( 0x10000, RM380Z_MAINCPU_TAG, 0 )
// I'm not sure of how those ROMs have been dumped. I don't know if those are good dumps or not.
ROM_LOAD( "cos40b-m.bin", 0x0000, 0x1000, BAD_DUMP CRC(1f0b3a5c) SHA1(0b29cb2a3b7eaa3770b34f08c4fd42844f42700f) )
ROM_LOAD( "cos40b-m_f600-f9ff.bin", 0x1000, 0x0400, BAD_DUMP CRC(e3397d9d) SHA1(490a0c834b0da392daf782edc7d51ca8f0668b1a) )
ROM_LOAD( "cos40b-m_1c00-1dff.bin", 0x1400, 0x0200, BAD_DUMP CRC(0f759f44) SHA1(9689c1c1faa62c56def999cbedbbb0c8d928dcff) )
ROM_REGION( 0x0800, "chargen", 0 )
ROM_LOAD( "c-gen-22.bin", 0x0000, 0x0800, CRC(1b67127f) SHA1(289a919871d30c5e832d22244bcac1dcfd544baa) )
ROM_END
// RM480Z is quite different, might be better off in its own driver
ROM_START( rm480z )
ROM_REGION( 0x10000, RM380Z_MAINCPU_TAG, 0 )
@ -358,9 +392,10 @@ ROM_END
/* Driver */
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
COMP(1978, rm380z, 0, 0, rm380z, rm380z, rm380z_state, init_rm380z, "Research Machines", "RM-380Z, COS 4.0B", MACHINE_NO_SOUND_HW)
COMP(1978, rm380z34d, rm380z, 0, rm380z, rm380z, rm380z_state, init_rm380z34d, "Research Machines", "RM-380Z, COS 3.4D", MACHINE_NO_SOUND_HW)
COMP(1978, rm380z34e, rm380z, 0, rm380z, rm380z, rm380z_state, init_rm380z34e, "Research Machines", "RM-380Z, COS 3.4E", MACHINE_NO_SOUND_HW)
COMP(1981, rm480z, rm380z, 0, rm480z, rm380z, rm380z_state, init_rm480z, "Research Machines", "LINK RM-480Z (set 1)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND)
COMP(1981, rm480za, rm380z, 0, rm480z, rm380z, rm380z_state, init_rm480z, "Research Machines", "LINK RM-480Z (set 2)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND)
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
COMP(1978, rm380z, 0, 0, configure, rm380z, rm380z_state_cos40, driver_device::empty_init, "Research Machines", "RM-380Z, COS 4.0B", MACHINE_NO_SOUND_HW)
COMP(1978, rm380zhrg, rm380z, 0, configure, rm380zhrg, rm380z_state_cos40_hrg, driver_device::empty_init, "Research Machines", "RM-380Z, COS 4.0B with HRG", MACHINE_NO_SOUND_HW)
COMP(1978, rm380z34d, rm380z, 0, configure, rm380z, rm380z_state_cos34, driver_device::empty_init, "Research Machines", "RM-380Z, COS 3.4D", MACHINE_NO_SOUND_HW)
COMP(1978, rm380z34e, rm380z, 0, configure, rm380z, rm380z_state_cos34, driver_device::empty_init, "Research Machines", "RM-380Z, COS 3.4E", MACHINE_NO_SOUND_HW)
COMP(1981, rm480z, rm380z, 0, configure, rm380z, rm480z_state, driver_device::empty_init, "Research Machines", "LINK RM-480Z (set 1)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND)
COMP(1981, rm480za, rm380z, 0, configure, rm380z, rm480z_state, driver_device::empty_init, "Research Machines", "LINK RM-480Z (set 2)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND)

View File

@ -19,6 +19,8 @@ Research Machines RM 380Z
#include "machine/ram.h"
#include "machine/wd_fdc.h"
#include "emupal.h"
//
//
//
@ -29,16 +31,15 @@ Research Machines RM 380Z
//
//
// abstract base class
class rm380z_state : public driver_device
{
public:
protected:
rm380z_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_chargen(*this, "chargen"),
m_maincpu(*this, RM380Z_MAINCPU_TAG),
m_screen(*this, "screen"),
m_cassette(*this, "cassette"),
m_messram(*this, RAM_TAG),
m_fdc(*this, "wd1771"),
m_floppy0(*this, "wd1771:0"),
@ -46,19 +47,115 @@ public:
{
}
void rm480z(machine_config &config);
void rm380z(machine_config &config);
static inline constexpr int RM380Z_SCREENROWS = 24;
static inline constexpr int RM380Z_SCREENCOLS = 40;
void init_rm380z();
void init_rm380z34d();
void init_rm380z34e();
void init_rm480z();
void configure(machine_config &config);
void machine_reset() override;
bool ports_enabled_high() const { return bool(m_port0 & 0x80); }
bool ports_enabled_low() const { return !(m_port0 & 0x80); }
virtual bool get_rowcol_from_offset(int &row, int &col, offs_t offset) const;
virtual void port_write(offs_t offset, uint8_t data);
virtual uint8_t port_read(offs_t offset);
void port_write_1b00(offs_t offset, uint8_t data);
uint8_t port_read_1b00(offs_t offset);
virtual uint8_t videoram_read(offs_t offset) = 0;
virtual void videoram_write(offs_t offset, uint8_t data) = 0;
uint8_t rm380z_portlow_r();
void rm380z_portlow_w(offs_t offset, uint8_t data);
uint8_t rm380z_porthi_r();
void rm380z_porthi_w(offs_t offset, uint8_t data);
void disk_0_control(uint8_t data);
void keyboard_put(u8 data);
void config_memory_map();
virtual void update_screen(bitmap_ind16 &bitmap) const = 0;
uint32_t screen_update_rm380z(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void rm380z_io(address_map &map);
void rm380z_mem(address_map &map);
uint8_t m_port0 = 0;
uint8_t m_port0_kbd = 0;
uint8_t m_port1 = 0;
uint8_t m_fbfe = 0;
required_region_ptr<u8> m_chargen;
required_device<cpu_device> m_maincpu;
optional_device<screen_device> m_screen;
optional_device<ram_device> m_messram;
optional_device<fd1771_device> m_fdc;
optional_device<floppy_connector> m_floppy0;
optional_device<floppy_connector> m_floppy1;
};
// COS 3.4 machine with cassette and VDU-40 display
class rm380z_state_cos34 : public rm380z_state
{
public:
rm380z_state_cos34(const machine_config &mconfig, device_type type, const char *tag) :
rm380z_state(mconfig, type, tag),
m_cassette(*this, "cassette")
{
}
void configure(machine_config &config);
protected:
virtual void machine_reset() override;
virtual void machine_start() override;
void machine_reset() override;
void port_write(offs_t offset, uint8_t data) override;
uint8_t port_read(offs_t offset) override;
void update_screen(bitmap_ind16 &bitmap) const override;
uint8_t videoram_read(offs_t offset) override;
void videoram_write(offs_t offset, uint8_t data) override;
private:
template <int ROWS, int COLS>
class rm380z_vram
{
public:
void set_char(int row, int col, uint8_t data) { m_chars[row][col] = data; }
void reset() { memset(m_chars, 0x80, sizeof(m_chars)); }
uint8_t get_char(int row, int col) const { return m_chars[row][col]; }
private:
uint8_t m_chars[ROWS][COLS];
};
static inline constexpr int RM380Z_CHDIMX = 5;
static inline constexpr int RM380Z_CHDIMY = 9;
static inline constexpr int RM380Z_NCX = 8;
static inline constexpr int RM380Z_NCY = 16;
void putChar_vdu40(int charnum, int x, int y, bitmap_ind16 &bitmap) const;
rm380z_vram<RM380Z_SCREENROWS, RM380Z_SCREENCOLS> m_vram;
required_device<cassette_image_device> m_cassette;
};
// COS 4.0 machine with VDU-80 display
class rm380z_state_cos40 : public rm380z_state
{
public:
rm380z_state_cos40(const machine_config &mconfig, device_type type, const char *tag) :
rm380z_state(mconfig, type, tag)
{
}
void configure(machine_config &config);
protected:
template <int ROWS, int COLS>
class rm380z_vram
{
@ -79,89 +176,105 @@ private:
uint8_t m_scroll_reg = 0;
};
static inline constexpr int RM380Z_SCREENCOLS = 80;
static inline constexpr int RM380Z_VIDEOMODE_40COL = 0x01;
static inline constexpr int RM380Z_VIDEOMODE_80COL = 0x02;
static inline constexpr int RM380Z_CHDIMX = 5;
static inline constexpr int RM380Z_CHDIMY = 9;
static inline constexpr int RM380Z_NCX = 8;
static inline constexpr int RM380Z_NCY = 16;
static inline constexpr int RM380Z_SCREENCOLS = 80;
static inline constexpr int RM380Z_SCREENROWS = 24;
void machine_reset() override;
bool ports_enabled_high() const { return ( m_port0 & 0x80 ); }
bool ports_enabled_low() const { return !( m_port0 & 0x80 ); }
void port_write(offs_t offset, uint8_t data) override;
uint8_t port_read(offs_t offset) override;
void update_screen(bitmap_ind16 &bitmap) const override;
uint8_t videoram_read(offs_t offset) override;
void videoram_write(offs_t offset, uint8_t data) override;
bool get_rowcol_from_offset(int &row, int &col, offs_t offset) const;
void put_point(int charnum, int x, int y, int col);
void init_graphic_chars();
int m_videomode = RM380Z_VIDEOMODE_80COL;
rm380z_vram<RM380Z_SCREENROWS, RM380Z_SCREENCOLS> m_vram;
void putChar_vdu80(int charnum, int attribs, int x, int y, bitmap_ind16 &bitmap);
void putChar_vdu40(int charnum, int x, int y, bitmap_ind16 &bitmap);
void decode_videoram_char(int row, int col, uint8_t &chr, uint8_t &attrib);
private:
void config_videomode();
void port_write(offs_t offset, uint8_t data);
uint8_t port_read(offs_t offset);
void port_write_1b00(offs_t offset, uint8_t data);
uint8_t port_read_1b00(offs_t offset);
uint8_t videoram_read(offs_t offset);
void videoram_write(offs_t offset, uint8_t data);
uint8_t rm380z_portlow_r();
void rm380z_portlow_w(offs_t offset, uint8_t data);
uint8_t rm380z_porthi_r();
void rm380z_porthi_w(offs_t offset, uint8_t data);
void disk_0_control(uint8_t data);
void keyboard_put(u8 data);
DECLARE_MACHINE_RESET(rm480z);
void config_memory_map();
void update_screen_vdu80(bitmap_ind16 &bitmap);
void update_screen_vdu40(bitmap_ind16 &bitmap);
uint32_t screen_update_rm380z(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_rm480z(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(static_vblank_timer);
void rm380z_io(address_map &map);
void rm380z_mem(address_map &map);
void rm480z_io(address_map &map);
void rm480z_mem(address_map &map);
uint8_t m_port0 = 0;
uint8_t m_port0_mask = 0;
uint8_t m_port0_kbd = 0;
uint8_t m_port1 = 0;
uint8_t m_fbfd_mask = 0;
uint8_t m_fbfe = 0;
void putChar_vdu80(int charnum, int attribs, int x, int y, bitmap_ind16 &bitmap) const;
bool get_rowcol_from_offset(int &row, int &col, offs_t offset) const override;
uint8_t m_character_row = 0;
uint8_t m_character = 0;
uint8_t m_graphic_chars[0x80][(RM380Z_CHDIMX+1)*(RM380Z_CHDIMY+1)];
uint8_t m_user_defined_chars[2048];
};
rm380z_vram<RM380Z_SCREENROWS, RM380Z_SCREENCOLS> m_vram;
// COS 4.0 machine with VDU-80 display, HRG and colour
class rm380z_state_cos40_hrg : public rm380z_state_cos40
{
public:
rm380z_state_cos40_hrg(const machine_config &mconfig, device_type type, const char *tag) :
rm380z_state_cos40(mconfig, type, tag),
m_palette(*this, "palette"),
m_io_display_type(*this, "display_type")
{
}
int m_rasterlineCtr = 0;
emu_timer* m_vblankTimer = nullptr;
void configure(machine_config &config);
int m_videomode = 0;
DECLARE_INPUT_CHANGED_MEMBER(monitor_changed);
emu_timer *m_static_vblank_timer = nullptr;
protected:
void machine_reset() override;
required_region_ptr<u8> m_chargen;
required_device<cpu_device> m_maincpu;
optional_device<screen_device> m_screen;
optional_device<cassette_image_device> m_cassette;
optional_device<ram_device> m_messram;
optional_device<fd1771_device> m_fdc;
optional_device<floppy_connector> m_floppy0;
optional_device<floppy_connector> m_floppy1;
void port_write(offs_t offset, uint8_t data) override;
uint8_t port_read(offs_t offset) override;
void update_screen(bitmap_ind16 &bitmap) const override;
uint8_t videoram_read(offs_t offset) override;
void videoram_write(offs_t offset, uint8_t data) override;
private:
enum class hrg_display_mode : uint8_t
{
none = 0,
high = 1,
medium_0 = 2,
medium_1 = 3
};
static inline constexpr int RM380Z_HRG_RAM_SIZE = 16384; // 16k
static inline constexpr int RM380Z_HRG_SCRATCHPAD_SIZE = 16;
void palette_init(palette_device &palette);
void change_hrg_scratchpad(int index, uint8_t value, uint8_t mask);
void change_palette(int index, uint8_t value);
int calculate_hrg_vram_index(offs_t offset) const;
void draw_high_res_graphics(bitmap_ind16 &bitmap) const;
void draw_medium_res_graphics(bitmap_ind16 &bitmap) const;
uint8_t m_hrg_ram[RM380Z_HRG_RAM_SIZE];
uint8_t m_hrg_scratchpad[RM380Z_HRG_SCRATCHPAD_SIZE];
uint8_t m_hrg_port0 = 0;
uint8_t m_hrg_port1 = 0;
hrg_display_mode m_hrg_display_mode = hrg_display_mode::none;
required_device<palette_device> m_palette;
required_ioport m_io_display_type;
};
// partially implemented non working RM480z
class rm480z_state : public rm380z_state_cos40
{
public:
rm480z_state(const machine_config &mconfig, device_type type, const char *tag) :
rm380z_state_cos40(mconfig, type, tag)
{
}
void configure(machine_config &config);
protected:
void machine_reset() override;
void update_screen(bitmap_ind16 &bitmap) const override;
private:
void rm480z_io(address_map &map);
void rm480z_mem(address_map &map);
};
#endif // MAME_RM_RM380Z_H

View File

@ -31,25 +31,41 @@ void rm380z_state::port_write(offs_t offset, uint8_t data)
switch (offset)
{
case 0xfc: // PORT0
//printf("%s FBFCw[%2.2x] FBFD [%2.2x] FBFE [%2.2x] writenum [%4.4x]\n", machine().describe_context().c_str(), data, m_fbfd, m_fbfe,writenum);
if ((data & 0x01) && !(m_port0 & 0x01))
{
// only clear keyboard latch if bit has changed value
m_port0_kbd = 0;
m_port1 &= ~0x01;
}
m_port0 = data;
m_cassette->output((m_port0 & 0xef) ? +1.0 : -1.0); // set 2400hz, bit 4
if (data & 0x01)
{
//printf("WARNING: bit0 of port0 reset\n");
m_port0_kbd = 0;
}
m_port1 &= ~0x01; //?
config_videomode();
config_memory_map();
break;
case 0xfd: // screen line counter (?)
//printf("%s FBFC [%2.2x] FBFDw[%2.2x] FBFE [%2.2x] writenum [%4.4x]\n",machine().describe_context().c_str(),m_port0,data,m_fbfe,writenum);
case 0xff: // user I/O port
break;
default:
logerror("unknown port [%2.2x] write of [%2.2x]\n", offset, data);
}
}
void rm380z_state_cos34::port_write(offs_t offset, uint8_t data)
{
if (offset == 0xfc)
{
m_cassette->output((data & 0xef) ? +1.0 : -1.0); // set 2400hz, bit 4
}
rm380z_state::port_write(offset, data);
}
void rm380z_state_cos40::port_write(offs_t offset, uint8_t data)
{
switch (offset)
{
case 0xfd:
if (m_port0 & 0x08)
{
// update user defined character data
@ -63,15 +79,11 @@ void rm380z_state::port_write(offs_t offset, uint8_t data)
else if (!(m_port0 & 0x10))
{
// set scroll register (used to verticaly scroll the screen and effect vram addressing)
m_vram.set_scroll_register(data & m_fbfd_mask);
m_vram.set_scroll_register(data & 0x1f);
}
break;
// port 1
case 0xfe: // line on screen to write to divided by 2
//printf("%s FBFC [%2.2x] FBFD [%2.2x] FBFEw[%2.2x] writenum [%4.4x]\n",machine().describe_context().c_str(),m_port0,m_fbfd,data,writenum);
case 0xfe:
if (!(m_port0 & 0x04))
{
m_character_row = data;
@ -84,13 +96,57 @@ void rm380z_state::port_write(offs_t offset, uint8_t data)
m_fbfe = data;
break;
case 0xff: // user I/O port
//printf("write of [%x] to FBFF\n",data);
//logerror("%s: Write %02X to user I/O port\n", machine().describe_context(), data);
case 0xfc:
rm380z_state::port_write(offset, data);
config_videomode();
break;
default:
printf("unknown port [%2.2x] write of [%2.2x]\n", offset, data);
rm380z_state::port_write(offset, data);
break;
}
}
void rm380z_state_cos40_hrg::port_write(offs_t offset, uint8_t data)
{
switch (offset)
{
case 0x00:
if ((m_hrg_port0 & 0x01) && !(data & 0x01))
{
// set low nibble of scratchpad (palette data) when bit 0 toggled
change_hrg_scratchpad(m_hrg_port1 >> 4, m_hrg_port1 & 0x0f, 0xf0);
}
else if ((m_hrg_port0 & 0x02) && !(data & 0x02))
{
// set high nibble of scratchpad (palette data) when bit 1 toggled
change_hrg_scratchpad(m_hrg_port1 >> 4, m_hrg_port1 << 4, 0x0f);
}
switch (data)
{
case 0x03:
m_hrg_display_mode = hrg_display_mode::high;
break;
case 0xa3:
m_hrg_display_mode = hrg_display_mode::medium_0;
break;
case 0xc3:
m_hrg_display_mode = hrg_display_mode::medium_1;
break;
}
m_hrg_port0 = data;
break;
case 0x01:
// video ram page number (for subsequent read/write) or scratchpad data
m_hrg_port1 = data;
break;
default:
rm380z_state_cos40::port_write(offset, data);
break;
}
}
@ -101,15 +157,55 @@ uint8_t rm380z_state::port_read(offs_t offset)
switch (offset)
{
case 0xfc: // PORT0
//m_port0_kbd=getKeyboard();
data = m_port0_kbd;
//if (m_port0_kbd!=0) m_port0_kbd = 0;
//m_port0_kbd=0;
//printf("%s read of port0 (kbd)\n",machine().describe_context().c_str());
break;
case 0xfd: // "counter" (?)
//printf("%s: Read from counter FBFD\n", machine().describe_context().c_str());
case 0xfe: // PORT1
data = m_port1;
if (m_screen->vblank())
{
data |= 0x40;
}
if (m_screen->hblank())
{
data |= 0x80;
}
break;
case 0xff: // user port
break;
default:
logerror("read from unknown port [%2.2x]\n", offset);
}
return data;
}
uint8_t rm380z_state_cos34::port_read(offs_t offset)
{
if (offset == 0xfe)
{
if (m_cassette->input() < +0.0)
{
m_port1 &= 0xdf; // bit 5 off
}
else
{
m_port1 |= 0x20; // bit 5 on
}
}
return rm380z_state::port_read(offset);
}
uint8_t rm380z_state_cos40::port_read(offs_t offset)
{
uint8_t data;
switch (offset)
{
case 0xfd:
if (m_port0 & 0x08)
{
// return character data for requested character and row
@ -128,22 +224,36 @@ uint8_t rm380z_state::port_read(offs_t offset)
}
break;
case 0xfe: // PORT1
if (m_cassette->input() < +0.0)
m_port1 &= 0xdf; // bit 5 off
else
m_port1 |= 0x20; // bit 5 on
data = m_port1;
//printf("%s read of port1\n", machine().describe_context().c_str());
default:
data = rm380z_state::port_read(offset);
break;
}
case 0xff: // user port
//printf("%s: Read from user port\n", machine().describe_context().c_str());
return data;
}
uint8_t rm380z_state_cos40_hrg::port_read(offs_t offset)
{
uint8_t data = 0xff;
switch (offset)
{
case 0x00:
// bit 0 is low during HRG frame blanking
// bit 1 is low duing HRG line blanking
if (m_screen->vblank())
{
data ^= 0x01;
}
if (m_screen->hblank())
{
data ^= 0x02;
}
break;
default:
printf("read from unknown port [%2.2x]\n", offset);
data = rm380z_state_cos40::port_read(offset);
break;
}
return data;
@ -166,7 +276,7 @@ uint8_t rm380z_state::rm380z_portlow_r()
void rm380z_state::rm380z_portlow_w(offs_t offset, uint8_t data)
{
//printf("%s port write [%x] [%x]\n",machine().describe_context().c_str(),offset,data);
//logerror("%s port write [%x] [%x]\n",machine().describe_context().c_str(),offset,data);
}
uint8_t rm380z_state::rm380z_porthi_r()
@ -176,47 +286,7 @@ uint8_t rm380z_state::rm380z_porthi_r()
void rm380z_state::rm380z_porthi_w(offs_t offset, uint8_t data)
{
//printf("port write [%x] [%x]\n",offset+0xc5,data);
}
#define LINE_SUBDIVISION 82
#define HORZ_LINES 100
#define TIMER_SPEED 50*HORZ_LINES*LINE_SUBDIVISION
//
// this simulates line+frame blanking
// according to the System manual, "frame blanking bit (bit 6) of port1 becomes high
// for about 4.5 milliseconds every 20 milliseconds"
//
TIMER_CALLBACK_MEMBER(rm380z_state::static_vblank_timer)
{
//printf("timer callback called at [%f]\n",machine().time().as_double());
m_rasterlineCtr++;
m_rasterlineCtr %= HORZ_LINES * LINE_SUBDIVISION;
// frame blanking
if (m_rasterlineCtr >= ((HORZ_LINES - 22) * LINE_SUBDIVISION))
{
m_port1 |= 0x40;
}
else
{
m_port1 &= ~0x40;
}
// line blanking
if ((m_rasterlineCtr % LINE_SUBDIVISION) > 80)
{
m_port1 |= 0x80;
}
else
{
m_port1 &= ~0x80;
}
//logerror("port write [%x] [%x]\n",offset+0xc5,data);
}
void rm380z_state::keyboard_put(u8 data)
@ -255,40 +325,6 @@ void rm380z_state::disk_0_control(uint8_t data)
}
}
void rm380z_state::machine_start()
{
m_static_vblank_timer = timer_alloc(FUNC(rm380z_state::static_vblank_timer), this);
m_static_vblank_timer->adjust(attotime::from_hz(TIMER_SPEED), 0, attotime::from_hz(TIMER_SPEED));
}
void rm380z_state::init_rm380z()
{
m_videomode = RM380Z_VIDEOMODE_80COL;
m_port0_mask = 0xff;
m_fbfd_mask = 0x1f; // enable hw scrolling (uses lower 5 bits of counter)
}
void rm380z_state::init_rm380z34d()
{
m_videomode = RM380Z_VIDEOMODE_40COL;
m_port0_mask = 0xdf; // disable 80 column mode
m_screen->set_size(240, 240);
m_screen->set_visarea_full();
}
void rm380z_state::init_rm380z34e()
{
m_videomode = RM380Z_VIDEOMODE_40COL;
m_port0_mask = 0xdf; // disable 80 column mode
m_screen->set_size(240, 240);
m_screen->set_visarea_full();
}
void rm380z_state::init_rm480z()
{
// machine not working so do nothing
}
void rm380z_state::machine_reset()
{
m_port0 = 0x00;
@ -296,15 +332,39 @@ void rm380z_state::machine_reset()
m_port1 = 0x00;
m_fbfe = 0x00;
m_rasterlineCtr = 0;
// note: from COS 4.0 videos, screen seems to show garbage at the beginning
m_vram.reset();
config_memory_map();
m_fdc->reset();
}
init_graphic_chars();
void rm380z_state_cos34::machine_reset()
{
rm380z_state::machine_reset();
m_vram.reset();
}
void rm380z_state_cos40::machine_reset()
{
rm380z_state::machine_reset();
m_vram.reset();
memset(m_user_defined_chars, 0, sizeof(m_user_defined_chars));
}
void rm380z_state_cos40_hrg::machine_reset()
{
rm380z_state_cos40::machine_reset();
m_hrg_port0 = 0x00;
m_hrg_port1 = 0x00;
m_hrg_display_mode = hrg_display_mode::none;
memset(m_hrg_ram, 0, sizeof(m_hrg_ram));
memset(m_hrg_scratchpad, 0, sizeof(m_hrg_scratchpad));
}
void rm480z_state::machine_reset()
{
}
void rm380z_state::config_memory_map()
@ -325,7 +385,3 @@ void rm380z_state::config_memory_map()
program.install_ram(0x4000, 0xdfff, m_ram_p);
}
}
MACHINE_RESET_MEMBER( rm380z_state, rm480z )
{
}

View File

@ -10,65 +10,112 @@ RM 380Z video code
#include "emu.h"
#include "rm380z.h"
bool rm380z_state::get_rowcol_from_offset(int& row, int& col, offs_t offset) const
INPUT_CHANGED_MEMBER(rm380z_state_cos40_hrg::monitor_changed)
{
if (m_videomode == RM380Z_VIDEOMODE_40COL)
// re-calculate HRG palette values from scratchpad
for (int c=0; c < RM380Z_HRG_SCRATCHPAD_SIZE; c++)
{
col = offset & 0x3f; // the 6 least significant bits give the column (0-39)
row = offset >> 6; // next 5 bits give the row (0-23)
change_palette(c, m_hrg_scratchpad[c]);
}
}
void rm380z_state_cos40_hrg::change_palette(int index, uint8_t value)
{
rgb_t new_colour;
if (m_io_display_type->read() & 0x01)
{
// value is intensity for a b/w monochrome display
new_colour = rgb_t(value, value, value);
}
else
{
col = offset & 0x7f; // the 7 least significant bits give the column (0-79)
row = offset >> 7; // next bit gives bit 0 of row
row |= (m_fbfe & 0x0f) << 1; // the remaining 4 row bits come from the lower half of PORT 1
// for colour displays value is in the format GRGBRGBR
uint8_t red = (BIT(value, 6) << 7) | (BIT(value, 3) << 6) | (BIT(value, 0) << 5);
uint8_t green = (BIT(value, 7) << 4) | (BIT(value, 5) << 3) | (BIT(value, 2) << 2);
uint8_t blue = (BIT(value, 4) << 1) | BIT(value, 1);
new_colour = raw_to_rgb_converter::standard_rgb_decoder<3, 3, 2, 5, 2, 0>(red | green | blue);
}
m_palette->set_pen_color(index + 3, new_colour);
}
void rm380z_state_cos40_hrg::palette_init(palette_device &palette)
{
// text display palette (black, grey (dim), and white)
palette.set_pen_color(0, rgb_t::black());
palette.set_pen_color(1, rgb_t(0xc0, 0xc0, 0xc0));
palette.set_pen_color(2, rgb_t::white());
// HRG palette (initialise to all black)
for (int c=3; c < 19; c++)
{
palette.set_pen_color(c, rgb_t::black());
}
}
void rm380z_state_cos40_hrg::change_hrg_scratchpad(int index, uint8_t value, uint8_t mask)
{
if (index < RM380Z_HRG_SCRATCHPAD_SIZE)
{
m_hrg_scratchpad[index] &= mask;
m_hrg_scratchpad[index] |= value;
change_palette(index, m_hrg_scratchpad[index]);
}
}
int rm380z_state_cos40_hrg::calculate_hrg_vram_index(offs_t offset) const
{
int index;
int page = m_hrg_port1 & 0x0f;
if (page < 12)
{
// the first 15k is addressed using twelve 1280 byte pages
// this is used to store pixel data
index = (page * 1280) + (offset % 1280);
}
else
{
// the remaining 1k is addressed using four 256 byte pages
// this is used to store 128 user defined HRG characters
page &= 0x03;
index = 15360 + (page * 256) + (offset & 0xff);
}
return index;
}
bool rm380z_state::get_rowcol_from_offset(int& row, int& col, offs_t offset) const
{
col = offset & 0x3f; // the 6 least significant bits give the column (0-39)
row = offset >> 6; // next 5 bits give the row (0-23)
return ((row < RM380Z_SCREENROWS) && (col < RM380Z_SCREENCOLS));
}
bool rm380z_state_cos40::get_rowcol_from_offset(int& row, int& col, offs_t offset) const
{
if (m_videomode == RM380Z_VIDEOMODE_80COL)
{
col = offset & 0x7f; // the 7 least significant bits give the column (0-79)
row = offset >> 7; // next bit gives bit 0 of row
row |= (m_fbfe & 0x0f) << 1; // the remaining 4 row bits come from the lower half of PORT 1
}
else
{
(void)rm380z_state::get_rowcol_from_offset(row, col, offset);
}
return ((row < RM380Z_SCREENROWS) && (col < RM380Z_SCREENCOLS));
}
void rm380z_state::put_point(int charnum, int x, int y, int col)
{
const int mx = (y == 6) ? 4 : 3;
for (unsigned int r = y; r< (y + mx); r++)
{
for (unsigned int c = x; c < (x + 3); c++)
{
m_graphic_chars[charnum][c + (r * (RM380Z_CHDIMX + 1))] = col;
}
}
}
void rm380z_state::init_graphic_chars()
{
for (int c=0;c<0x3f;c++)
{
if (c&0x01) put_point(c,0,0,1);
else put_point(c,0,0,0);
if (c&0x02) put_point(c,3,0,1);
else put_point(c,3,0,0);
if (c&0x04) put_point(c,0,3,1);
else put_point(c,0,3,0);
if (c&0x08) put_point(c,3,3,1);
else put_point(c,3,3,0);
if (c&0x10) put_point(c,0,6,1);
else put_point(c,0,6,0);
if (c&0x20) put_point(c,3,6,1);
else put_point(c,3,6,0);
}
}
void rm380z_state::config_videomode()
void rm380z_state_cos40::config_videomode()
{
int old_mode = m_videomode;
if (m_port0 & 0x20 & m_port0_mask)
if (m_port0 & 0x20)
{
// 80 cols
m_videomode = RM380Z_VIDEOMODE_80COL;
@ -83,64 +130,12 @@ void rm380z_state::config_videomode()
{
if (m_videomode == RM380Z_VIDEOMODE_80COL)
{
m_screen->set_size(640, 240);
m_screen->set_raw(16_MHz_XTAL, 1024, 0, 640, 312, 0, 240);
}
else
{
m_screen->set_size(320, 240);
m_screen->set_raw(8_MHz_XTAL, 512, 0, 320, 312, 0, 240);
}
m_screen->set_visarea_full();
}
}
// char attribute bits in COS 4.0
// 0=alternate charset
// 1=underline
// 2=dim
// 3=reverse
void rm380z_state::decode_videoram_char(int row, int col, uint8_t& chr, uint8_t &attrib)
{
uint8_t ch1 = m_vram.get_char(row, col);
uint8_t ch2 = m_vram.get_attrib(row, col);
// "special" (unknown) cases first
if ((ch1 == 0x80) && (ch2 == 0x04))
{
// blank out
chr = 0x20;
attrib = 0;
return;
}
else if ((ch1 == 0) && (ch2 == 8))
{
// cursor
chr = 0x20;
attrib = 8;
return;
}
else if ((ch1 == 4) && (ch2 == 4))
{
// reversed cursor?
chr = 0x20;
attrib = 0;
return;
}
else if ((ch1 == 4) && (ch2 == 8))
{
// normal cursor
chr = 0x20;
attrib = 8;
return;
}
else
{
chr = ch1;
attrib = ch2;
//printf("unhandled character combination [%x][%x]\n", ch1, ch2);
}
}
@ -152,7 +147,17 @@ void rm380z_state::decode_videoram_char(int row, int col, uint8_t& chr, uint8_t
// 20e2: prints "Ready:"
// 0195: prints "\n"
void rm380z_state::videoram_write(offs_t offset, uint8_t data)
void rm380z_state_cos34::videoram_write(offs_t offset, uint8_t data)
{
int row, col;
if (get_rowcol_from_offset(row, col, offset))
{
m_vram.set_char(row, col, data);
}
// else out of bounds write had no effect (see VTOUT description in firmware guide)
}
void rm380z_state_cos40::videoram_write(offs_t offset, uint8_t data)
{
int row, col;
if (get_rowcol_from_offset(row, col, offset))
@ -171,27 +176,73 @@ void rm380z_state::videoram_write(offs_t offset, uint8_t data)
// else out of bounds write had no effect (see VTOUT description in firmware guide)
}
uint8_t rm380z_state::videoram_read(offs_t offset)
void rm380z_state_cos40_hrg::videoram_write(offs_t offset, uint8_t data)
{
if (m_hrg_port0 & 0x04)
{
// write to HRG memory
m_hrg_ram[calculate_hrg_vram_index(offset)] = data;
}
else
{
rm380z_state_cos40::videoram_write(offset, data);
}
}
uint8_t rm380z_state_cos34::videoram_read(offs_t offset)
{
uint8_t data = 0; // return 0 if out of bounds (see VTIN description in firmware guide)
int row, col;
if (get_rowcol_from_offset(row, col, offset))
{
data = m_vram.get_char(row, col);
}
return data;
}
uint8_t rm380z_state_cos40::videoram_read(offs_t offset)
{
uint8_t data = 0; // return 0 if out of bounds (see VTIN description in firmware guide)
int row, col;
if (get_rowcol_from_offset(row, col, offset))
{
if (m_port0 & 0x40)
{
return m_vram.get_attrib(row, col);
data = m_vram.get_attrib(row, col);
}
else
{
return m_vram.get_char(row, col);
data = m_vram.get_char(row, col);
}
}
return 0; // return 0 if out of bounds (see VTIN description in firmware guide)
return data;
}
void rm380z_state::putChar_vdu80(int charnum, int attribs, int x, int y, bitmap_ind16 &bitmap)
uint8_t rm380z_state_cos40_hrg::videoram_read(offs_t offset)
{
uint8_t data;
if (m_hrg_port0 & 0x04)
{
// read from HRG memory
data = m_hrg_ram[calculate_hrg_vram_index(offset)];
}
else
{
data = rm380z_state_cos40::videoram_read(offset);
}
return data;
}
void rm380z_state_cos40::putChar_vdu80(int charnum, int attribs, int x, int y, bitmap_ind16 &bitmap) const
{
const bool attrUnder = attribs & 0x02;
const bool attrDim = attribs & 0x04;
const bool attrRev = attribs & 0x08;
int data_pos = (charnum % 128) * 16;
@ -217,17 +268,24 @@ void rm380z_state::putChar_vdu80(int charnum, int attribs, int x, int y, bitmap_
for (int c=0; c < 8; c++, data <<= 1)
{
uint8_t pixel_value = (data & 0x80) ? 1 : 0;
uint8_t pixel_value = (data & 0x80) ? 2 : 0;
if (attrRev)
{
pixel_value = !pixel_value;
}
bitmap.pix(y * 10 + r, x * 8 + c) = pixel_value;
if (attrDim && pixel_value)
{
pixel_value = 1;
}
if (pixel_value)
{
bitmap.pix(y * 10 + r, x * 8 + c) = pixel_value;
}
}
}
}
void rm380z_state::putChar_vdu40(int charnum, int x, int y, bitmap_ind16 &bitmap)
void rm380z_state_cos34::putChar_vdu40(int charnum, int x, int y, bitmap_ind16 &bitmap) const
{
if ((charnum > 0) && (charnum <= 0x7f))
{
@ -235,53 +293,126 @@ void rm380z_state::putChar_vdu40(int charnum, int x, int y, bitmap_ind16 &bitmap
int basex=RM380Z_CHDIMX*(charnum/RM380Z_NCY);
int basey=RM380Z_CHDIMY*(charnum%RM380Z_NCY);
// 5x9 characters are drawn in 8x10 grid
// with 1 pixel gap to the left, 2 pixel gap to the right, and 1 pixel gap at the bottom
for (int r=0;r<RM380Z_CHDIMY;r++)
{
for (int c=0;c<RM380Z_CHDIMX;c++)
{
uint8_t chval = (m_chargen[((basey + r) * RM380Z_CHDIMX * RM380Z_NCX) + basex + c] == 0xff) ? 0 : 1;
bitmap.pix(y * (RM380Z_CHDIMY+1) + r, x * (RM380Z_CHDIMX+1) + c) = chval;
uint8_t chval = (m_chargen[((basey + r) * RM380Z_CHDIMX * RM380Z_NCX) + basex + c] == 0xff) ? 0 : 2;
bitmap.pix(y * (RM380Z_CHDIMY+1) + r, x * (RM380Z_CHDIMX+3) + c + 1) = chval;
}
}
}
else
{
// graphic chars
for (int r=0;r<RM380Z_CHDIMY;r++)
// graphic chars (chars 0x80 to 0xbf are grey, chars 0xc0 to 0xff are white)
uint8_t colour = (charnum >= 0xc0) ? 2 : 1;
// discrete logic gates were used to produce a full 8x10 grid of pixels
// the top block is 4 pixels high, and the two lower two blocks are 3 pixels high
if (charnum & 0x01)
{
for (int c=0;c<RM380Z_CHDIMX;c++)
bitmap.plot_box(x * 8, y * 10, 4, 4, colour);
}
if (charnum & 0x02)
{
bitmap.plot_box(x * 8 + 4, y * 10, 4, 4, colour);
}
if (charnum & 0x04)
{
bitmap.plot_box(x * 8, y * 10 + 4, 4, 3, colour);
}
if (charnum & 0x08)
{
bitmap.plot_box(x * 8 + 4, y * 10 + 4, 4, 3, colour);
}
if (charnum & 0x10)
{
bitmap.plot_box(x * 8, y * 10 + 7, 4, 3, colour);
}
if (charnum & 0x20)
{
bitmap.plot_box(x * 8 + 4, y * 10 + 7, 4, 3, colour);
}
}
}
void rm380z_state_cos40_hrg::draw_high_res_graphics(bitmap_ind16 &bitmap) const
{
const int pw = (m_videomode == RM380Z_VIDEOMODE_40COL) ? 1 : 2;
const int ph = 1;
// see section C.3 of HRG reference manual for ram layout
// (2-bits per pixel, 4 pixels per byte)
for (int y = 0; y < 192; y++)
{
for (int x = 0; x < 320; x+= 4)
{
int index = ((y / 16) * 1280) + ((x / 4) << 4) + (y % 16);
uint8_t data = m_hrg_ram[index];
for (int c=0; c < 4; c++, data >>= 2)
{
bitmap.pix(y * (RM380Z_CHDIMY+1) + r, x * (RM380Z_CHDIMX+1) +c) = m_graphic_chars[charnum&0x3f][c + r * (RM380Z_CHDIMX+1)];
bitmap.plot_box((x+c)*pw, y*ph, pw, ph, (data & 0x03) + 3);
}
}
}
}
void rm380z_state::update_screen_vdu80(bitmap_ind16 &bitmap)
void rm380z_state_cos40_hrg::draw_medium_res_graphics(bitmap_ind16 &bitmap) const
{
const int page = (m_hrg_display_mode == hrg_display_mode::medium_0) ? 0 : 1;
const int pw = (m_videomode == RM380Z_VIDEOMODE_40COL) ? 2 : 4;
const int ph = 2;
// see section C.5 of HRG reference manual for ram layout
// (4-bits per pixel, 2 pixels per byte)
for (int y = 0; y < 96; y++)
{
for (int x = 0; x < 160; x+= 2)
{
int index = ((y / 8) * 1280) + ((x / 2) << 4) + ((y % 8) << 1) + page;
uint8_t data = m_hrg_ram[index];
bitmap.plot_box(x*pw, y*ph, pw, ph, ((data & 0x03) | ((data >> 2) & 0x0c)) + 3);
bitmap.plot_box((x+1)*pw, y*ph, pw, ph, (((data >> 2) & 0x03) | ((data >> 4) & 0x0c)) + 3);
}
}
}
void rm380z_state_cos40_hrg::update_screen(bitmap_ind16 &bitmap) const
{
if (m_hrg_display_mode == hrg_display_mode::high)
{
draw_high_res_graphics(bitmap);
}
else if ((m_hrg_display_mode == hrg_display_mode::medium_0) || (m_hrg_display_mode == hrg_display_mode::medium_1))
{
draw_medium_res_graphics(bitmap);
}
rm380z_state_cos40::update_screen(bitmap);
}
void rm380z_state_cos40::update_screen(bitmap_ind16 &bitmap) const
{
const int ncols = (m_videomode == RM380Z_VIDEOMODE_40COL) ? 40 : 80;
// blank screen
bitmap.fill(0);
for (int row = 0; row < RM380Z_SCREENROWS; row++)
{
for (int col = 0; col < ncols; col++)
{
uint8_t curch,attribs;
decode_videoram_char(row, col, curch, attribs);
curch = m_vram.get_char(row, col);
attribs = m_vram.get_attrib(row, col);
putChar_vdu80(curch, attribs, col, row, bitmap);
}
}
}
void rm380z_state::update_screen_vdu40(bitmap_ind16 &bitmap)
void rm380z_state_cos34::update_screen(bitmap_ind16 &bitmap) const
{
const int ncols = 40;
// blank screen
bitmap.fill(0);
for (int row = 0; row < RM380Z_SCREENROWS; row++)
{
for (int col = 0; col < ncols; col++)
@ -300,8 +431,8 @@ void rm380z_state::update_screen_vdu40(bitmap_ind16 &bitmap)
}
}
// This needs the attributes etc from above to be added
uint32_t rm380z_state::screen_update_rm480z(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
// only partially implemented and non working
void rm480z_state::update_screen(bitmap_ind16 &bitmap) const
{
uint16_t sy = 0, ma = 0;
@ -332,5 +463,4 @@ uint32_t rm380z_state::screen_update_rm480z(screen_device &screen, bitmap_ind16
}
ma += 64;
}
return 0;
}

View File

@ -7,9 +7,10 @@ Saitek Kasparov Chess Academy / Mephisto Schachakademie (both were later rebrand
to Mephisto Talking Chess Academy)
The chess engine is by Frans Morsch, similar to the one in GK 2000. Other features,
such as the tutorials, were supposedly added by Craig Barnes.
such as the speech and tutorial lessons, were supposedly added by Craig Barnes.
Hardware notes:
- PCB label: SCH RT33-PE-041 Rev 3.0
- Hitachi H8/3214 MCU, 16MHz XTAL
- same LCD as GK 2000
- OKI MSM6588 ADPCM Recorder @ 4MHz, small daughterboard with 4MB ROM under epoxy
@ -17,7 +18,7 @@ Hardware notes:
TODO:
- it does a cold boot at every reset, so nvram won't work properly unless MAME
has some kind of auxillary autosave state feature at power-off
adds some kind of auxillary autosave state feature at power-off
- dump/add German speech ROM (Mephisto Schachakademie, MCU is same)
- does a French speech version exist?
@ -83,8 +84,6 @@ private:
u8 m_port5 = 0;
u8 m_port7 = 0;
void main_map(address_map &map);
// I/O handlers
void lcd_pwm_w(offs_t offset, u8 data);
void update_lcd();
@ -286,17 +285,6 @@ void chessac_state::p7_w(u8 data)
/*******************************************************************************
Address Maps
*******************************************************************************/
void chessac_state::main_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
}
/*******************************************************************************
Input Ports
*******************************************************************************/
@ -340,7 +328,6 @@ void chessac_state::chessac(machine_config &config)
{
// basic machine hardware
H83214(config, m_maincpu, 16_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &chessac_state::main_map);
m_maincpu->nvram_enable_backup(true);
m_maincpu->standby_cb().set(m_maincpu, FUNC(h83214_device::nvram_set_battery));
m_maincpu->standby_cb().append(FUNC(chessac_state::standby));

View File

@ -313,5 +313,5 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1980, chesstrv, 0, 0, chesstrv, chesstrv, chesstrv_state, empty_init, "SciSys / Novag", "Chess Traveler", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1980, chesstrv, 0, 0, chesstrv, chesstrv, chesstrv_state, empty_init, "SciSys / Novag Industries", "Chess Traveler", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1982, chesstrvi, 0, 0, chesstrvi, chesstrvi, chesstrv_state, empty_init, "SciSys", "Chess Intercontinental Traveler", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

View File

@ -258,4 +258,4 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1980, cp2000, 0, 0, cp2000, cp2000, cp2000_state, empty_init, "SciSys / Novag", "Chess Partner 2000", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1980, cp2000, 0, 0, cp2000, cp2000, cp2000_state, empty_init, "SciSys / Novag Industries", "Chess Partner 2000", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

View File

@ -253,4 +253,4 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1980, ccdelta1, 0, 0, delta1, delta1, delta1_state, empty_init, "SciSys / Novag", "Chess Champion: Delta-1", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW | MACHINE_CLICKABLE_ARTWORK )
SYST( 1980, ccdelta1, 0, 0, delta1, delta1, delta1_state, empty_init, "SciSys / Novag Industries", "Chess Champion: Delta-1", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW | MACHINE_CLICKABLE_ARTWORK )

View File

@ -23,7 +23,7 @@ A13 MCU is used in:
TODO:
- it does a cold boot at every reset, so nvram won't work properly unless MAME
has some kind of auxillary autosave state feature at power-off
adds some kind of auxillary autosave state feature at power-off
*******************************************************************************/
@ -79,8 +79,6 @@ private:
u32 m_lcd_segs = 0;
u8 m_lcd_com = 0;
void main_map(address_map &map);
// I/O handlers
void lcd_pwm_w(offs_t offset, u8 data);
void update_lcd();
@ -216,17 +214,6 @@ void gk2000_state::p5_w(offs_t offset, u8 data, u8 mem_mask)
/*******************************************************************************
Address Maps
*******************************************************************************/
void gk2000_state::main_map(address_map &map)
{
map(0x0000, 0x3fff).rom();
}
/*******************************************************************************
Input Ports
*******************************************************************************/
@ -272,7 +259,6 @@ void gk2000_state::gk2000(machine_config &config)
{
// basic machine hardware
H8323(config, m_maincpu, 20_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &gk2000_state::main_map);
m_maincpu->nvram_enable_backup(true);
m_maincpu->standby_cb().set(m_maincpu, FUNC(h8325_device::nvram_set_battery));
m_maincpu->standby_cb().append(FUNC(gk2000_state::standby));

View File

@ -81,8 +81,6 @@ private:
u8 m_led_select = 0;
u8 m_led_direct = 0;
void main_map(address_map &map);
// I/O handlers
void lcd_pwm_w(offs_t offset, u8 data);
void lcd_output_w(offs_t offset, u64 data);
@ -255,17 +253,6 @@ u8 prisma_state::p7_r()
/*******************************************************************************
Address Maps
*******************************************************************************/
void prisma_state::main_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
}
/*******************************************************************************
Input Ports
*******************************************************************************/
@ -321,7 +308,6 @@ void prisma_state::prisma(machine_config &config)
{
// basic machine hardware
H8325(config, m_maincpu, 20_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &prisma_state::main_map);
m_maincpu->nvram_enable_backup(true);
m_maincpu->nvram_set_default_value(~0);
m_maincpu->standby_cb().set(m_maincpu, FUNC(h8325_device::nvram_set_battery));

View File

@ -568,5 +568,5 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
SYST( 1979, ssystem3, 0, 0, ssystem3, ssystem3, ssystem3_state, init_ssystem3, "SciSys / Novag", "Chess Champion: Super System III", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1979, ssystem3, 0, 0, ssystem3, ssystem3, ssystem3_state, init_ssystem3, "SciSys / Novag Industries", "Chess Champion: Super System III", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
SYST( 1980, ssystem4, 0, 0, ssystem4, ssystem4, ssystem3_state, empty_init, "SciSys", "Chess Champion: Super System IV", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

View File

@ -13,7 +13,6 @@ NVRAM won't save properly.
TODO:
- dump/add other MCU revisions, SX8 for tmate/conquist is known to exist
- verify if QFP SX5A has the same ROM contents as DIP SX5A
- what is t1850's official title? "1850 Deluxe Table Chess" is from the back of
the computer. The manual can't make up its mind and says "1850 Chess Computer",
"1850 Chess: 16 Level Program", or "1850 Sensory Chess Game". The box disagrees
@ -47,6 +46,8 @@ SX5(A) program is used in:
- Tandy (Radio Shack) 1850 60-2201A (8MHz, ST5A-PE-002 PCB)
- Mephisto Monaco (H+G brand Express 16K)
SX5A 6301Y0A97F (QFP) has the same ROM contents as 6301Y0A96P.
SX8(A) program is used in:
- Saitek Team-Mate aka Team-Mate Advanced Trainer (8MHz, ST8B-PE-017 PCB)
- Saitek Cavalier aka Portable Advanced Trainer (suspected, 8MHz, ? PCB)

View File

@ -1119,6 +1119,17 @@ static INPUT_PORTS_START( flicky )
PORT_DIPSETTING( 0x00, DEF_STR( Hard ) )
INPUT_PORTS_END
static INPUT_PORTS_START( flickyb )
PORT_INCLUDE( flicky )
PORT_MODIFY("SWB")
PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
PORT_DIPSETTING( 0x0c, "1" )
PORT_DIPSETTING( 0x08, "2" )
PORT_DIPSETTING( 0x04, "3" )
PORT_DIPSETTING( 0x00, DEF_STR( Infinite ) )
INPUT_PORTS_END
static INPUT_PORTS_START( flickys1 )
PORT_INCLUDE( flicky )
@ -2962,6 +2973,27 @@ ROM_START( flickya ) /* Sega game ID# 834-5411-11 FLICKY */
ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
ROM_END
ROM_START( flickyb ) /* Sega game ID# 834-5411-11 FLICKY, only the two program ROMs differ from flickya. Legit or hack? */
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "e-2_0.116", 0x0000, 0x4000, CRC(ec94fdbb) SHA1(a3289dd59a4cede1aeed8898cc38cfb82da3b778) ) // white, non original, handwritten label
ROM_LOAD( "109", 0x4000, 0x4000, CRC(aa11b394) SHA1(538b28b194162c04ed7a46e3a4fa97760201405d) ) // blue, non original, blank label
ROM_REGION( 0x10000, "soundcpu", 0 )
ROM_LOAD( "epr-5869.120", 0x0000, 0x2000, CRC(6d220d4e) SHA1(fe02a7a94a1ad046fc775a7f67f460c8d0f6dca6) )
ROM_REGION( 0xc000, "tiles", 0 )
ROM_LOAD( "epr-6001.62", 0x0000, 0x4000, CRC(f1a75200) SHA1(47e57b5dbd687d0fa91de91f35f199e88d5a5d99) )
ROM_LOAD( "epr-6000.64", 0x4000, 0x4000, CRC(299aefb7) SHA1(d0301f0bf706807891845f090e4e1f1c38dbbd54) )
ROM_LOAD( "epr-5999.66", 0x8000, 0x4000, CRC(1ca53157) SHA1(46b4b9dac3f0506edc3957cee768e41c4754b0f4) )
ROM_REGION( 0x8000, "sprites", 0 )
ROM_LOAD( "epr-5855.117", 0x0000, 0x4000, CRC(b5f894a1) SHA1(2c72dc16739dad155fcd572e1add067a7647f5bd) )
ROM_LOAD( "epr-5856.110", 0x4000, 0x4000, CRC(266af78f) SHA1(dcbfce550d10a1f2b3ce3e7e081fc008cb575708) )
ROM_REGION( 0x0100, "lookup_proms", 0 )
ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
ROM_END
ROM_START( flickys2 )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "epr-6621.bin", 0x0000, 0x4000, CRC(b21ff546) SHA1(e1d5438eaf0efeaeb4687dcfc12bf325e804182f) )
@ -5689,10 +5721,10 @@ GAME( 1983, regulusu, regulus, sys1ppi, regulus, system1_state, e
GAME( 1984, mrviking, 0, sys1ppisx_315_5041,mrviking, system1_state, empty_init, ROT270, "Sega", "Mister Viking (315-5041)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, mrvikingj, mrviking, sys1ppisx_315_5041,mrvikingj, system1_state, empty_init, ROT270, "Sega", "Mister Viking (315-5041, Japan)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, swat, 0, sys1ppix_315_5048, swat, system1_state, empty_init, ROT270, "Coreland / Sega", "SWAT (315-5048)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, flickyo, flicky, sys1ppix_315_5051, flicky, system1_state, empty_init, ROT0, "Sega", "Flicky (64k Version, 315-5051, set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, flickys1, flicky, sys1ppix_315_5051, flickys1, system1_state, empty_init, ROT0, "Sega", "Flicky (64k Version, 315-5051, set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, flickyup, flicky, sys1ppix_315_5051, flicky, system1_state, empty_init, ROT0, "Sega", "Flicky (64k Version, on Up'n Down boardset, set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, flickyupa, flicky, sys1ppix_315_5051, flicky, system1_state, empty_init, ROT0, "bootleg", "Flicky (64k Version, on Up'n Down boardset, set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, flickyo, flicky, sys1ppix_315_5051, flicky, system1_state, empty_init, ROT0, "Sega", "Flicky (64k Version, 315-5051, set 1)", MACHINE_SUPPORTS_SAVE ) // 84/5/24
GAME( 1984, flickys1, flicky, sys1ppix_315_5051, flickys1, system1_state, empty_init, ROT0, "Sega", "Flicky (64k Version, 315-5051, set 2)", MACHINE_SUPPORTS_SAVE ) // 84/11/26
GAME( 1984, flickyup, flicky, sys1ppix_315_5051, flicky, system1_state, empty_init, ROT0, "Sega", "Flicky (64k Version, on Up'n Down boardset, set 1)", MACHINE_SUPPORTS_SAVE ) // 84/5/17
GAME( 1984, flickyupa, flicky, sys1ppix_315_5051, flicky, system1_state, empty_init, ROT0, "bootleg", "Flicky (64k Version, on Up'n Down boardset, set 2)", MACHINE_SUPPORTS_SAVE ) // 84/7/05
GAME( 1984, wmatch, 0, sys1ppisx_315_5064,wmatch, system1_state, empty_init, ROT270, "Sega", "Water Match (315-5064)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, bullfgt, 0, sys1ppix_315_5065, bullfgt, system1_state, empty_init, ROT0, "Coreland / Sega", "Bullfight (315-5065)", MACHINE_SUPPORTS_SAVE )
GAME( 1985, nprinces, seganinj, sys1ppix_315_5051, seganinj, system1_state, empty_init, ROT0, "bootleg?", "Ninja Princess (315-5051, 64k Ver. bootleg?)", MACHINE_SUPPORTS_SAVE )
@ -5706,8 +5738,9 @@ GAME( 1986, nobb, nob, nob, nob, system1_state, i
GAME( 1986, raflesiau, raflesia, sys1ppi, raflesia, system1_state, empty_init, ROT270, "Coreland / Sega", "Rafflesia (not encrypted)", MACHINE_SUPPORTS_SAVE )
/* PIO-based System 1 */
GAME( 1984, flicky, 0, sys1piox_315_5051, flicky, system1_state, empty_init, ROT0, "Sega", "Flicky (128k Version, 315-5051)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, flickya, flicky, sys1piox_315_5051, flicky, system1_state, empty_init, ROT0, "Sega", "Flicky (128k Version, 315-5051, larger roms)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, flicky, 0, sys1piox_315_5051, flicky, system1_state, empty_init, ROT0, "Sega", "Flicky (128k Version, 315-5051)", MACHINE_SUPPORTS_SAVE ) // 1984/05/24
GAME( 1984, flickya, flicky, sys1piox_315_5051, flicky, system1_state, empty_init, ROT0, "Sega", "Flicky (128k Version, 315-5051, larger roms)", MACHINE_SUPPORTS_SAVE ) // 1984/05/24
GAME( 1984, flickyb, flicky, sys1piox_315_5051, flickyb, system1_state, empty_init, ROT0, "Sega", "Flicky (128k Version, 315-5051, larger roms, newer)", MACHINE_SUPPORTS_SAVE ) // 1984/10/07
GAME( 1984, flickys2, flicky, sys1pio, flickys2, system1_state, empty_init, ROT0, "Sega", "Flicky (128k Version, not encrypted)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, thetogyu, bullfgt, sys1piox_315_5065, bullfgt, system1_state, empty_init, ROT0, "Coreland / Sega", "The Togyu (315-5065, Japan)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, spatter, 0, sys1piosx_315_5096,spatter, system1_state, empty_init, ROT0, "Sega", "Spatter (315-5096)", MACHINE_SUPPORTS_SAVE )

View File

@ -1,5 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:Carlos A. Lozano
// copyright-holders: Carlos A. Lozano
/**************************************************************************
Blood Bros, West Story & Sky Smasher
@ -8,11 +9,6 @@ TAD Corporation 1990
driver by Carlos A. Lozano Baides
TODO:
West Story:
- sound (still has IRQ problems) - seems way too fast but using actual
measurements from a real PCB
Blood Bros (c) 1990 Nihon System [Seibu hardware]
-----------
The manual states:
@ -37,7 +33,7 @@ is undoubtedly capable of flipscreen and layer priority flipping
however.(which is why we have MACHINE_NO_COCKTAIL despite the games
being upright)
If the word at 0x488 in the maincpu ROM is set to any value other than 1, the
If the word at 0x488 in the main CPU ROM is set to any value other than 1, the
attract mode will include the "Winners Don't Use Drugs" screen. The only other
change this effects is reducing the first "NIHON SYSTEM INC." on the title
screen to the initials NSI. The string "US LICENSEE FABTEC INC" appears twice
@ -110,7 +106,7 @@ Stephh's notes (based on the games M68000 code and some tests) :
Also note that when "Starting Coin" Dip Switch is set to "x2", SERVICE1
adds 2 credits instead of 1.
- Bit 6 of DSW was previouly used as a "Cabinet" Dip Switch (OFF = Upright
- Bit 6 of DSW was previously used as a "Cabinet" Dip Switch (OFF = Upright
and ON = Cocktail), but it isn't tested outside of the "test mode".
Check code from 0x021abe to 0x021afc (and the "rts" instruction at 0x021adc)
- Bit 7 of DSW is only tested at 0x02035e and writes a value to 0x0c0100.
@ -138,27 +134,347 @@ Video:
**************************************************************************/
#include "emu.h"
#include "bloodbro.h"
#include "sei021x_sei0220_spr.h"
#include "seibu_crtc.h"
#include "seibusound.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
#include "sound/okim6295.h"
#include "seibu_crtc.h"
#include "sound/ymopl.h"
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
#include "tilemap.h"
/* Memory Maps */
namespace {
class bloodbro_state : public driver_device, public seibu_sound_common
{
public:
bloodbro_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_spritegen(*this, "spritegen"),
m_seibu_sound(*this, "seibu_sound"),
m_ymsnd(*this, "ymsnd"),
m_spriteram(*this, "spriteram"),
m_bgvideoram(*this, "bgvideoram"),
m_fgvideoram(*this, "fgvideoram"),
m_txvideoram(*this, "txvideoram")
{ }
void bloodbro(machine_config &config);
void skysmash(machine_config &config);
protected:
virtual void video_start() override;
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
optional_device<sei0210_device> m_spritegen;
required_device<seibu_sound_device> m_seibu_sound;
required_device<ym3812_device> m_ymsnd;
required_shared_ptr<uint16_t> m_spriteram;
required_shared_ptr<uint16_t> m_bgvideoram;
required_shared_ptr<uint16_t> m_fgvideoram;
required_shared_ptr<uint16_t> m_txvideoram;
uint16_t m_scrollram[6]{};
uint16_t m_layer_en = 0U;
tilemap_t *m_bg_tilemap = nullptr;
tilemap_t *m_fg_tilemap = nullptr;
tilemap_t *m_tx_tilemap = nullptr;
void bgvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void fgvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void txvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void layer_en_w(uint16_t data);
void layer_scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILE_GET_INFO_MEMBER(get_fg_tile_info);
TILE_GET_INFO_MEMBER(get_tx_tile_info);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t pri_cb(uint8_t pri, uint8_t ext);
void bloodbro_map(address_map &map);
void common_map(address_map &map);
void skysmash_map(address_map &map);
};
class weststry_state : public bloodbro_state
{
public:
weststry_state(const machine_config &mconfig, device_type type, const char *tag) :
bloodbro_state(mconfig, type, tag)
{ }
void init_weststry();
void weststry(machine_config &config);
private:
bool m_opl_irq = false;
bool m_soundnmi_mask = false;
void layer_scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void soundlatch_w(offs_t offset, u8 data);
void opl_irq_w(int state);
void opl_w(offs_t offset, uint8_t data);
void soundnmi_ack_w(uint8_t data);
void soundnmi_update();
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void main_map(address_map &map);
void sound_map(address_map &map);
};
// video
/***************************************************************************
Video Hardware for Blood Brothers
Note:
- An extra layer is currently disabled via the layer enable register
in Seibu CRTC device (bit 2). Is it even tied to any RAM portion?
***************************************************************************/
/***************************************************************************
Callbacks for the TileMap code
***************************************************************************/
TILE_GET_INFO_MEMBER(bloodbro_state::get_bg_tile_info)
{
int const code = m_bgvideoram[tile_index];
tileinfo.set(1, code & 0xfff, (code >> 12), 0);
}
TILE_GET_INFO_MEMBER(bloodbro_state::get_fg_tile_info)
{
int const code = m_fgvideoram[tile_index];
tileinfo.set(2, (code & 0xfff) + 0x1000, (code >> 12), 0);
}
TILE_GET_INFO_MEMBER(bloodbro_state::get_tx_tile_info)
{
int const code = m_txvideoram[tile_index];
tileinfo.set(0, code & 0xfff, code >> 12, 0);
}
/***************************************************************************
Start the video hardware emulation.
***************************************************************************/
void bloodbro_state::video_start()
{
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(bloodbro_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 16);
m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(bloodbro_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 16);
m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(bloodbro_state::get_tx_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_fg_tilemap->set_transparent_pen(15);
m_tx_tilemap->set_transparent_pen(15);
save_item(NAME(m_scrollram));
save_item(NAME(m_layer_en));
}
/***************************************************************************
Memory handlers
***************************************************************************/
void bloodbro_state::bgvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_bgvideoram[offset]);
m_bg_tilemap->mark_tile_dirty(offset);
}
void bloodbro_state::fgvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_fgvideoram[offset]);
m_fg_tilemap->mark_tile_dirty(offset);
}
void bloodbro_state::txvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_txvideoram[offset]);
m_tx_tilemap->mark_tile_dirty(offset);
}
/***************************************************************************
Display refresh
Blood Bros / Skysmash Spriteram
-------------------------------
Slightly more sophisticated successor to the Toki sprite chip.
It has "big sprites" created by setting width or height >0. Tile
numbers are read consecutively.
+0 x....... ........ sprite disabled if set
+0 .x...... ........ Flip y (no evidence for this!!)
+0 ..x..... ........ Flip x
+0 ....x... ........ Priority (1=high)
+0 ......xx x....... Width: do this many tiles horizontally
+0 ........ .xxx.... Height: do this many tiles vertically
+0 ........ ....xxxx Color bank
+1 ...xxxxx xxxxxxxx Tile number
+2 .......x xxxxxxxx X coordinate
+3 .......x xxxxxxxx Y coordinate
Weststry Bootleg Spriteram
--------------------------
Lacks the "big sprite" feature of the original. Needs some
tile number remapping for some reason.
+0 .......x xxxxxxxx Sprite Y coordinate
+1 ...xxxxx xxxxxxxx Sprite tile number
+2 xxxx.... ........ Sprite color bank
+2 ......x. ........ Sprite flip x
+2 ........ x....... Priority ??
+3 .......x xxxxxxxx Sprite X coordinate
***************************************************************************/
/* SPRITE INFO (8 bytes)
D-F?P?SS SSSSCCCC
---TTTTT TTTTTTTT
-------X XXXXXXXX
-------- YYYYYYYY */
uint32_t bloodbro_state::pri_cb(uint8_t pri, uint8_t ext)
{
return pri ? 0x02 : 0;
}
/* SPRITE INFO (8 bytes)
D------- YYYYYYYY
---TTTTT TTTTTTTT
CCCC--F? -?--???? Priority??
-------X XXXXXXXX
*/
void weststry_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
for (int offs = m_spriteram.bytes() / 2 - 4; offs >= 0; offs -= 4)
{
int const data = m_spriteram[offs + 2];
int const data0 = m_spriteram[offs + 0];
int code = m_spriteram[offs + 1] & 0x1fff;
int sx = m_spriteram[offs + 3] & 0x1ff;
int const sy = 0xf0 - (data0 & 0xff);
int const flipx = data & 0x200;
int const flipy = data & 0x400; // ???
int const color = (data & 0xf000) >> 12;
int const pri_mask = (data & 0x0080) ? 0x02 : 0;
if (sx >= 256) sx -= 512;
if (data0 & 0x8000) continue; // disabled
// Remap code 0x800 <-> 0x1000
code = (code & 0x7ff) | ((code & 0x800) << 1) | ((code & 0x1000) >> 1);
m_gfxdecode->gfx(3)->prio_transpen(bitmap, cliprect,
code,
color,
flipx, flipy,
sx, sy,
screen.priority(),
pri_mask, 15);
}
}
uint32_t bloodbro_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->set_scrollx(0, m_scrollram[0]);
m_bg_tilemap->set_scrolly(0, m_scrollram[1]);
m_fg_tilemap->set_scrollx(0, m_scrollram[2]);
m_fg_tilemap->set_scrolly(0, m_scrollram[3]);
screen.priority().fill(0, cliprect);
if(BIT(~m_layer_en, 0))
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
if(BIT(~m_layer_en, 1))
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 1);
if(BIT(~m_layer_en, 4))
m_spritegen->draw_sprites(screen, bitmap, cliprect, m_spriteram, m_spriteram.bytes());
if(BIT(~m_layer_en, 3))
m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
uint32_t weststry_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// The bootleg video hardware probably also allows BG scrolling, but weststry doesn't use it
m_fg_tilemap->set_scrollx(0, (int8_t)m_scrollram[1] - 13);
m_fg_tilemap->set_scrolly(0, (int8_t)m_scrollram[0] + 1);
screen.priority().fill(0, cliprect);
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 1);
draw_sprites(screen, bitmap, cliprect);
m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
// machine
// Memory Maps
void bloodbro_state::common_map(address_map &map)
{
map(0x000000, 0x07ffff).rom();
map(0x080000, 0x08afff).ram();
map(0x08b000, 0x08bfff).ram().share("spriteram");
map(0x08c000, 0x08c3ff).ram().w(FUNC(bloodbro_state::bgvideoram_w)).share("bgvideoram");
map(0x08b000, 0x08bfff).ram().share(m_spriteram);
map(0x08c000, 0x08c3ff).ram().w(FUNC(bloodbro_state::bgvideoram_w)).share(m_bgvideoram);
map(0x08c400, 0x08cfff).ram();
map(0x08d000, 0x08d3ff).ram().w(FUNC(bloodbro_state::fgvideoram_w)).share("fgvideoram");
map(0x08d000, 0x08d3ff).ram().w(FUNC(bloodbro_state::fgvideoram_w)).share(m_fgvideoram);
map(0x08d400, 0x08d7ff).ram();
map(0x08d800, 0x08dfff).ram().w(FUNC(bloodbro_state::txvideoram_w)).share("txvideoram");
map(0x08d800, 0x08dfff).ram().w(FUNC(bloodbro_state::txvideoram_w)).share(m_txvideoram);
map(0x08e000, 0x08e7ff).ram();
map(0x08e800, 0x08f7ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
map(0x08f800, 0x08ffff).ram();
@ -184,7 +500,7 @@ void bloodbro_state::skysmash_map(address_map &map)
map(0xc0000, 0xc004f).rw("crtc", FUNC(seibu_crtc_device::read_alt), FUNC(seibu_crtc_device::write_alt));
}
void weststry_state::weststry_soundlatch_w(offs_t offset, u8 data)
void weststry_state::soundlatch_w(offs_t offset, u8 data)
{
m_seibu_sound->main_w(offset, data);
@ -192,59 +508,59 @@ void weststry_state::weststry_soundlatch_w(offs_t offset, u8 data)
m_audiocpu->set_input_line(0, ASSERT_LINE);
}
void weststry_state::weststry_map(address_map &map)
void weststry_state::main_map(address_map &map)
{
map(0x000000, 0x07ffff).rom();
map(0x080000, 0x08ffff).ram(); // old VRAM areas still used, but bootleg code copies them to higher addresses
map(0x0c1000, 0x0c1001).portr("DSW");
map(0x0c1002, 0x0c1003).portr("IN0");
map(0x0c1004, 0x0c1005).portr("IN1");
map(0x0c1000, 0x0c1003).w(FUNC(weststry_state::weststry_soundlatch_w)).umask16(0xff00);
map(0x0c1004, 0x0c100b).w(FUNC(weststry_state::weststry_layer_scroll_w));
map(0x0c1000, 0x0c1003).w(FUNC(weststry_state::soundlatch_w)).umask16(0xff00);
map(0x0c1004, 0x0c100b).w(FUNC(weststry_state::layer_scroll_w));
map(0x0e0002, 0x0e0003).nopr(); // remnant of old code
map(0x122800, 0x122bff).ram(); // cleared at startup
map(0x122c00, 0x122fff).ram().w(FUNC(weststry_state::fgvideoram_w)).share("fgvideoram");
map(0x123000, 0x1233ff).ram().w(FUNC(weststry_state::bgvideoram_w)).share("bgvideoram");
map(0x122c00, 0x122fff).ram().w(FUNC(weststry_state::fgvideoram_w)).share(m_fgvideoram);
map(0x123000, 0x1233ff).ram().w(FUNC(weststry_state::bgvideoram_w)).share(m_bgvideoram);
map(0x123400, 0x1237ff).ram(); // cleared at startup
map(0x123800, 0x123fff).ram().w(FUNC(weststry_state::txvideoram_w)).share("txvideoram");
map(0x123800, 0x123fff).ram().w(FUNC(weststry_state::txvideoram_w)).share(m_txvideoram);
map(0x124000, 0x124005).ram();
map(0x124006, 0x1247fd).ram().share("spriteram");
map(0x124006, 0x1247fd).ram().share(m_spriteram);
map(0x128000, 0x1287ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
}
void weststry_state::weststry_opl_irq_w(int state)
void weststry_state::opl_irq_w(int state)
{
m_weststry_opl_irq = state;
weststry_soundnmi_update();
m_opl_irq = state;
soundnmi_update();
}
void weststry_state::weststry_opl_w(offs_t offset, uint8_t data)
void weststry_state::opl_w(offs_t offset, uint8_t data)
{
// NMI cannot be accepted between address and data writes, or else registers get corrupted
m_weststry_soundnmi_mask = BIT(offset, 0);
m_soundnmi_mask = BIT(offset, 0);
m_ymsnd->write(offset, data);
weststry_soundnmi_update();
soundnmi_update();
}
void weststry_state::weststry_soundnmi_ack_w(uint8_t data)
void weststry_state::soundnmi_ack_w(uint8_t data)
{
m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
weststry_soundnmi_update();
soundnmi_update();
}
void weststry_state::weststry_soundnmi_update()
void weststry_state::soundnmi_update()
{
if (m_weststry_opl_irq && m_weststry_soundnmi_mask)
if (m_opl_irq && m_soundnmi_mask)
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
}
void weststry_state::weststry_sound_map(address_map &map)
void weststry_state::sound_map(address_map &map)
{
seibu_sound_map(map);
map(0x4002, 0x4002).w(FUNC(weststry_state::weststry_soundnmi_ack_w));
map(0x4002, 0x4002).w(FUNC(weststry_state::soundnmi_ack_w));
}
/* Input Ports */
// Input Ports
#define BLOODBRO_COINAGE \
PORT_DIPNAME( 0x0001, 0x0001, "Coin Mode" ) PORT_DIPLOCATION("SW1:1") \
@ -336,7 +652,7 @@ static INPUT_PORTS_START( bloodbro_base )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) // "Fire"
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) // "Roll"
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) // "Dynamite"
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* tested when "continue" - check code at 0x000598 */
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested when "continue" - check code at 0x000598
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
@ -344,7 +660,7 @@ static INPUT_PORTS_START( bloodbro_base )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) // "Fire"
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) // "Roll"
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) // "Dynamite"
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* tested - check code at 0x0005fe - VBLANK ? (probably not) */
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested - check code at 0x0005fe - VBLANK ? (probably not)
PORT_START("IN1")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
@ -360,7 +676,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( weststry )
PORT_INCLUDE( bloodbro_base )
SEIBU_COIN_INPUTS /* coin inputs read through sound cpu */
SEIBU_COIN_INPUTS // coin inputs read through sound CPU
INPUT_PORTS_END
@ -372,19 +688,19 @@ static INPUT_PORTS_START( bloodbro )
PORT_BIT( 0x000e, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x00e0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* tested - check code at 0x000800 */
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested - check code at 0x000800
PORT_BIT( 0x0e00, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0xe000, IP_ACTIVE_LOW, IPT_UNKNOWN )
SEIBU_COIN_INPUTS /* coin inputs read through sound cpu */
SEIBU_COIN_INPUTS // coin inputs read through sound CPU
INPUT_PORTS_END
static INPUT_PORTS_START( skysmash )
PORT_START("DSW")
BLOODBRO_COINAGE
PORT_DIPUNUSED_DIPLOC( 0x0040, IP_ACTIVE_LOW, "SW1:7" ) /* see notes */
PORT_DIPUNUSED_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" ) /* see notes */
PORT_DIPUNUSED_DIPLOC( 0x0040, IP_ACTIVE_LOW, "SW1:7" ) // see notes
PORT_DIPUNUSED_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" ) // see notes
PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2")
PORT_DIPSETTING( 0x0200, "2" )
PORT_DIPSETTING( 0x0300, "3" )
@ -435,70 +751,70 @@ static INPUT_PORTS_START( skysmash )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0xe000, IP_ACTIVE_LOW, IPT_UNKNOWN )
SEIBU_COIN_INPUTS /* coin inputs read through sound cpu */
SEIBU_COIN_INPUTS // coin inputs read through sound CPU
INPUT_PORTS_END
/* Graphics Layouts */
// Graphics Layouts
static const gfx_layout textlayout =
{
8,8, /* 8*8 characters */
RGN_FRAC(1,2), /* 4096 characters */
4, /* 4 bits per pixel */
8,8, // 8*8 characters
RGN_FRAC(1,2), // 4096 characters
4, // 4 bits per pixel
{ 0, 4, RGN_FRAC(1,2)+0, RGN_FRAC(1,2)+4 },
{ 3, 2, 1, 0, 8+3, 8+2, 8+1, 8+0},
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
16*8 /* every char takes 16 consecutive bytes */
16*8 // every char takes 16 consecutive bytes
};
static const gfx_layout spritelayout =
{
16,16, /* 16*16 sprites */
16,16, // 16*16 sprites
RGN_FRAC(1,1),
4, /* 4 bits per pixel */
4, // 4 bits per pixel
{ 8, 12, 0, 4 },
{ 3, 2, 1, 0, 16+3, 16+2, 16+1, 16+0,
3+32*16, 2+32*16, 1+32*16, 0+32*16, 16+3+32*16, 16+2+32*16, 16+1+32*16, 16+0+32*16 },
{ 0*16, 2*16, 4*16, 6*16, 8*16, 10*16, 12*16, 14*16,
16*16, 18*16, 20*16, 22*16, 24*16, 26*16, 28*16, 30*16 },
128*8 /* every sprite takes 128 consecutive bytes */
128*8 // every sprite takes 128 consecutive bytes
};
static const gfx_layout weststry_textlayout =
{
8,8, /* 8*8 sprites */
RGN_FRAC(1,4), /* 4096 sprites */
4, /* 4 bits per pixel */
8,8, // 8*8 sprites
RGN_FRAC(1,4), // 4096 sprites
4, // 4 bits per pixel
{ RGN_FRAC(0,4), RGN_FRAC(1,4), RGN_FRAC(2,4), RGN_FRAC(3,4) },
{ 0, 1, 2, 3, 4, 5, 6, 7 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
8*8 /* every sprite takes 8 consecutive bytes */
8*8 // every sprite takes 8 consecutive bytes
};
static const gfx_layout weststry_spritelayout =
{
16,16, /* 16*16 sprites */
RGN_FRAC(1,4), /* 8192 sprites */
4, /* 4 bits per pixel */
16,16, // 16*16 sprites
RGN_FRAC(1,4), // 8192 sprites
4, // 4 bits per pixel
{ RGN_FRAC(0,4), RGN_FRAC(1,4), RGN_FRAC(2,4), RGN_FRAC(3,4) },
{ 0, 1, 2, 3, 4, 5, 6, 7,
16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
32*8 /* every sprite takes 32 consecutive bytes */
32*8 // every sprite takes 32 consecutive bytes
};
/* Graphics Decode Info */
// Graphics Decode Info
static GFXDECODE_START( gfx_bloodbro )
GFXDECODE_ENTRY( "txtiles", 0x00000, textlayout, 0x70*16, 0x10 ) /* Text */
GFXDECODE_ENTRY( "bgtiles", 0x00000, spritelayout, 0x40*16, 0x10 ) /* Background */
GFXDECODE_ENTRY( "bgtiles", 0x00000, spritelayout, 0x50*16, 0x10 ) /* Foreground */
GFXDECODE_ENTRY( "txtiles", 0x00000, textlayout, 0x70*16, 0x10 )
GFXDECODE_ENTRY( "bgtiles", 0x00000, spritelayout, 0x40*16, 0x10 )
GFXDECODE_ENTRY( "bgtiles", 0x00000, spritelayout, 0x50*16, 0x10 )
GFXDECODE_END
static GFXDECODE_START( gfx_bloodbro_spr )
GFXDECODE_ENTRY( "sprites", 0x00000, spritelayout, 0x00*16, 0x10 ) /* Sprites */
GFXDECODE_ENTRY( "sprites", 0x00000, spritelayout, 0x00*16, 0x10 )
GFXDECODE_END
static GFXDECODE_START( gfx_weststry )
@ -518,31 +834,31 @@ void bloodbro_state::layer_scroll_w(offs_t offset, uint16_t data, uint16_t mem_m
COMBINE_DATA(&m_scrollram[offset]);
}
void weststry_state::weststry_layer_scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask)
void weststry_state::layer_scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_scrollram[offset]);
}
/* Machine Drivers */
// Machine Drivers
void bloodbro_state::bloodbro(machine_config &config)
{
// basic machine hardware
M68000(config, m_maincpu, XTAL(20'000'000)/2); /* verified on pcb */
M68000(config, m_maincpu, XTAL(20'000'000) / 2); // verified on PCB
m_maincpu->set_addrmap(AS_PROGRAM, &bloodbro_state::bloodbro_map);
m_maincpu->set_vblank_int("screen", FUNC(bloodbro_state::irq4_line_hold));
Z80(config, m_audiocpu, XTAL(7'159'090)/2); /* verified on pcb */
Z80(config, m_audiocpu, XTAL(7'159'090) / 2); // verified on PCB
m_audiocpu->set_addrmap(AS_PROGRAM, &bloodbro_state::seibu_sound_map);
m_audiocpu->set_irq_acknowledge_callback("seibu_sound", FUNC(seibu_sound_device::im0_vector_cb));
// video hardware
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_refresh_hz(59.39); /* verified on pcb */
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
m_screen->set_refresh_hz(59.39); // verified on PCB
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate
m_screen->set_size(32*8, 32*8);
m_screen->set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
m_screen->set_screen_update(FUNC(bloodbro_state::screen_update_bloodbro));
m_screen->set_screen_update(FUNC(bloodbro_state::screen_update));
m_screen->set_palette(m_palette);
seibu_crtc_device &crtc(SEIBU_CRTC(config, "crtc", 0));
@ -559,11 +875,11 @@ void bloodbro_state::bloodbro(machine_config &config)
// sound hardware
SPEAKER(config, "mono").front_center();
YM3812(config, m_ymsnd, XTAL(7'159'090)/2);
YM3812(config, m_ymsnd, XTAL(7'159'090) / 2);
m_ymsnd->irq_handler().set("seibu_sound", FUNC(seibu_sound_device::fm_irqhandler));
m_ymsnd->add_route(ALL_OUTPUTS, "mono", 1.0);
okim6295_device &oki(OKIM6295(config, "oki", XTAL(12'000'000)/12, okim6295_device::PIN7_HIGH));
okim6295_device &oki(OKIM6295(config, "oki", XTAL(12'000'000) / 12, okim6295_device::PIN7_HIGH));
oki.add_route(ALL_OUTPUTS, "mono", 1.0);
SEIBU_SOUND(config, m_seibu_sound, 0);
@ -578,32 +894,32 @@ void weststry_state::weststry(machine_config &config)
{
bloodbro(config);
m_maincpu->set_addrmap(AS_PROGRAM, &weststry_state::weststry_map);
m_maincpu->set_addrmap(AS_PROGRAM, &weststry_state::main_map);
m_maincpu->set_vblank_int("screen", FUNC(weststry_state::irq6_line_hold));
m_audiocpu->set_clock(XTAL(20'000'000)/4); /* 5MHz - verified on PCB */
m_audiocpu->set_addrmap(AS_PROGRAM, &weststry_state::weststry_sound_map);
m_audiocpu->set_clock(XTAL(20'000'000) / 4); // 5MHz - verified on PCB
m_audiocpu->set_addrmap(AS_PROGRAM, &weststry_state::sound_map);
m_audiocpu->remove_irq_acknowledge_callback();
m_gfxdecode->set_info(gfx_weststry);
m_palette->set_format(palette_device::xBGR_444, 1024);
// Bootleg video hardware is non-Seibu
m_screen->set_refresh_hz(59); /* verified on PCB */
m_screen->set_screen_update(FUNC(weststry_state::screen_update_weststry));
m_screen->set_refresh_hz(59); // verified on PCB
m_screen->set_screen_update(FUNC(weststry_state::screen_update));
config.device_remove("spritegen");
config.device_remove("crtc");
// Bootleg sound hardware is close copy of Seibu, but uses different interrupts
okim6295_device &oki(OKIM6295(config.replace(), "oki", XTAL(20'000'000)/16, okim6295_device::PIN7_HIGH)); /* 1.25MHz - verified on PCB */
okim6295_device &oki(OKIM6295(config.replace(), "oki", XTAL(20'000'000) / 16, okim6295_device::PIN7_HIGH)); // 1.25MHz - verified on PCB
oki.add_route(ALL_OUTPUTS, "mono", 1.0);
YM3812(config.replace(), m_ymsnd, XTAL(20'000'000)/4); /* ~4.9MHz - see notes at top */
m_ymsnd->irq_handler().set(FUNC(weststry_state::weststry_opl_irq_w));
YM3812(config.replace(), m_ymsnd, XTAL(20'000'000)/4); // ~4.9MHz
m_ymsnd->irq_handler().set(FUNC(weststry_state::opl_irq_w));
m_ymsnd->add_route(ALL_OUTPUTS, "mono", 1.0);
m_seibu_sound->ym_write_callback().set(FUNC(weststry_state::weststry_opl_w));
m_seibu_sound->ym_write_callback().set(FUNC(weststry_state::opl_w));
}
void bloodbro_state::skysmash(machine_config &config)
@ -615,7 +931,7 @@ void bloodbro_state::skysmash(machine_config &config)
}
/* ROMs */
// ROMs
ROM_START( bloodbro )
ROM_REGION( 0x80000, "maincpu", 0 )
@ -630,16 +946,16 @@ ROM_START( bloodbro )
ROM_COPY( "audiocpu", 0x000000, 0x018000, 0x08000 )
ROM_REGION( 0x20000, "txtiles", 0 )
ROM_LOAD( "bb_05.u061.6f", 0x00000, 0x10000, CRC(04ba6d19) SHA1(7333075c3323756d51917418b5234d785a9bee00) ) /* characters */
ROM_LOAD( "bb_05.u061.6f", 0x00000, 0x10000, CRC(04ba6d19) SHA1(7333075c3323756d51917418b5234d785a9bee00) )
ROM_LOAD( "bb_06.u063.6d", 0x10000, 0x10000, CRC(7092e35b) SHA1(659d30b2e2fd9ffa34a47e98193c8f0a87ac1315) )
ROM_REGION( 0x100000, "bgtiles", 0 )
ROM_LOAD( "blood_bros_bk__=c=1990_tad_corp.u064.4d", 0x00000, 0x100000, CRC(1aa87ee6) SHA1(e7843c1e8a0f3a685f0b5d6e3a2eb3176c410847) ) /* Background+Foreground */
ROM_LOAD( "blood_bros_bk__=c=1990_tad_corp.u064.4d", 0x00000, 0x100000, CRC(1aa87ee6) SHA1(e7843c1e8a0f3a685f0b5d6e3a2eb3176c410847) )
ROM_REGION( 0x100000, "sprites", 0 )
ROM_LOAD( "blood_bros_obj__=c=1990_tad_corp.u078.2n", 0x00000, 0x100000, CRC(d27c3952) SHA1(de7306432b682f238b911507ad7aa2fa8acbee80) ) /* sprites */
ROM_LOAD( "blood_bros_obj__=c=1990_tad_corp.u078.2n", 0x00000, 0x100000, CRC(d27c3952) SHA1(de7306432b682f238b911507ad7aa2fa8acbee80) )
ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */
ROM_REGION( 0x40000, "oki", 0 )
ROM_LOAD( "bb_08.u095.5a", 0x00000, 0x20000, CRC(deb1b975) SHA1(08f2e9a0a23171201b71d381d091edcd3787c287) )
ROM_REGION( 0x0100, "proms", 0 )
@ -659,16 +975,16 @@ ROM_START( bloodbroj )
ROM_COPY( "audiocpu", 0x000000, 0x018000, 0x08000 )
ROM_REGION( 0x20000, "txtiles", 0 )
ROM_LOAD( "bb_05.u061.6f", 0x00000, 0x10000, CRC(04ba6d19) SHA1(7333075c3323756d51917418b5234d785a9bee00) ) /* characters */
ROM_LOAD( "bb_05.u061.6f", 0x00000, 0x10000, CRC(04ba6d19) SHA1(7333075c3323756d51917418b5234d785a9bee00) )
ROM_LOAD( "bb_06.u063.6d", 0x10000, 0x10000, CRC(7092e35b) SHA1(659d30b2e2fd9ffa34a47e98193c8f0a87ac1315) )
ROM_REGION( 0x100000, "bgtiles", 0 )
ROM_LOAD( "blood_bros_bk__=c=1990_tad_corp.u064.4d", 0x00000, 0x100000, CRC(1aa87ee6) SHA1(e7843c1e8a0f3a685f0b5d6e3a2eb3176c410847) ) /* Background+Foreground */
ROM_LOAD( "blood_bros_bk__=c=1990_tad_corp.u064.4d", 0x00000, 0x100000, CRC(1aa87ee6) SHA1(e7843c1e8a0f3a685f0b5d6e3a2eb3176c410847) )
ROM_REGION( 0x100000, "sprites", 0 )
ROM_LOAD( "blood_bros_obj__=c=1990_tad_corp.u078.2n", 0x00000, 0x100000, CRC(d27c3952) SHA1(de7306432b682f238b911507ad7aa2fa8acbee80) ) /* sprites */
ROM_LOAD( "blood_bros_obj__=c=1990_tad_corp.u078.2n", 0x00000, 0x100000, CRC(d27c3952) SHA1(de7306432b682f238b911507ad7aa2fa8acbee80) )
ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */
ROM_REGION( 0x40000, "oki", 0 )
ROM_LOAD( "bb_08.u095.5a", 0x00000, 0x20000, CRC(deb1b975) SHA1(08f2e9a0a23171201b71d381d091edcd3787c287) )
ROM_REGION( 0x0100, "proms", 0 )
@ -688,16 +1004,16 @@ ROM_START( bloodbroja )
ROM_COPY( "audiocpu", 0x000000, 0x018000, 0x08000 )
ROM_REGION( 0x20000, "txtiles", 0 )
ROM_LOAD( "bb_05.u061.6f", 0x00000, 0x10000, CRC(04ba6d19) SHA1(7333075c3323756d51917418b5234d785a9bee00) ) /* characters */
ROM_LOAD( "bb_05.u061.6f", 0x00000, 0x10000, CRC(04ba6d19) SHA1(7333075c3323756d51917418b5234d785a9bee00) )
ROM_LOAD( "bb_06.u063.6d", 0x10000, 0x10000, CRC(7092e35b) SHA1(659d30b2e2fd9ffa34a47e98193c8f0a87ac1315) )
ROM_REGION( 0x100000, "bgtiles", 0 )
ROM_LOAD( "blood_bros_bk__=c=1990_tad_corp.u064.4d", 0x00000, 0x100000, CRC(1aa87ee6) SHA1(e7843c1e8a0f3a685f0b5d6e3a2eb3176c410847) ) /* Background+Foreground */
ROM_LOAD( "blood_bros_bk__=c=1990_tad_corp.u064.4d", 0x00000, 0x100000, CRC(1aa87ee6) SHA1(e7843c1e8a0f3a685f0b5d6e3a2eb3176c410847) )
ROM_REGION( 0x100000, "sprites", 0 )
ROM_LOAD( "blood_bros_obj__=c=1990_tad_corp.u078.2n", 0x00000, 0x100000, CRC(d27c3952) SHA1(de7306432b682f238b911507ad7aa2fa8acbee80) ) /* sprites */
ROM_LOAD( "blood_bros_obj__=c=1990_tad_corp.u078.2n", 0x00000, 0x100000, CRC(d27c3952) SHA1(de7306432b682f238b911507ad7aa2fa8acbee80) )
ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */
ROM_REGION( 0x40000, "oki", 0 )
ROM_LOAD( "bb_08.u095.5a", 0x00000, 0x20000, CRC(deb1b975) SHA1(08f2e9a0a23171201b71d381d091edcd3787c287) )
ROM_REGION( 0x0100, "proms", 0 )
@ -717,16 +1033,16 @@ ROM_START( bloodbrou )
ROM_COPY( "audiocpu", 0x000000, 0x018000, 0x08000 )
ROM_REGION( 0x20000, "txtiles", 0 )
ROM_LOAD( "bb_05.u061.6f", 0x00000, 0x10000, CRC(04ba6d19) SHA1(7333075c3323756d51917418b5234d785a9bee00) ) /* characters */
ROM_LOAD( "bb_05.u061.6f", 0x00000, 0x10000, CRC(04ba6d19) SHA1(7333075c3323756d51917418b5234d785a9bee00) )
ROM_LOAD( "bb_06.u063.6d", 0x10000, 0x10000, CRC(7092e35b) SHA1(659d30b2e2fd9ffa34a47e98193c8f0a87ac1315) )
ROM_REGION( 0x100000, "bgtiles", 0 )
ROM_LOAD( "blood_bros_bk__=c=1990_tad_corp.u064.4d", 0x00000, 0x100000, CRC(1aa87ee6) SHA1(e7843c1e8a0f3a685f0b5d6e3a2eb3176c410847) ) /* Background+Foreground */
ROM_LOAD( "blood_bros_bk__=c=1990_tad_corp.u064.4d", 0x00000, 0x100000, CRC(1aa87ee6) SHA1(e7843c1e8a0f3a685f0b5d6e3a2eb3176c410847) )
ROM_REGION( 0x100000, "sprites", 0 )
ROM_LOAD( "blood_bros_obj__=c=1990_tad_corp.u078.2n", 0x00000, 0x100000, CRC(d27c3952) SHA1(de7306432b682f238b911507ad7aa2fa8acbee80) ) /* sprites */
ROM_LOAD( "blood_bros_obj__=c=1990_tad_corp.u078.2n", 0x00000, 0x100000, CRC(d27c3952) SHA1(de7306432b682f238b911507ad7aa2fa8acbee80) )
ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */
ROM_REGION( 0x40000, "oki", 0 )
ROM_LOAD( "bb_08.u095.5a", 0x00000, 0x20000, CRC(deb1b975) SHA1(08f2e9a0a23171201b71d381d091edcd3787c287) )
ROM_REGION( 0x0100, "proms", 0 )
@ -746,16 +1062,16 @@ ROM_START( bloodbrok )
ROM_COPY( "audiocpu", 0x000000, 0x018000, 0x08000 )
ROM_REGION( 0x20000, "txtiles", 0 )
ROM_LOAD( "bb_05.u061.6f", 0x00000, 0x10000, CRC(04ba6d19) SHA1(7333075c3323756d51917418b5234d785a9bee00) ) /* characters */
ROM_LOAD( "bb_05.u061.6f", 0x00000, 0x10000, CRC(04ba6d19) SHA1(7333075c3323756d51917418b5234d785a9bee00) )
ROM_LOAD( "bb_06.u063.6d", 0x10000, 0x10000, CRC(7092e35b) SHA1(659d30b2e2fd9ffa34a47e98193c8f0a87ac1315) )
ROM_REGION( 0x100000, "bgtiles", 0 )
ROM_LOAD( "blood_bros_bk__=c=1990_tad_corp.u064.4d", 0x00000, 0x100000, CRC(1aa87ee6) SHA1(e7843c1e8a0f3a685f0b5d6e3a2eb3176c410847) ) /* Background+Foreground */
ROM_LOAD( "blood_bros_bk__=c=1990_tad_corp.u064.4d", 0x00000, 0x100000, CRC(1aa87ee6) SHA1(e7843c1e8a0f3a685f0b5d6e3a2eb3176c410847) )
ROM_REGION( 0x100000, "sprites", 0 )
ROM_LOAD( "blood_bros_obj__=c=1990_tad_corp.u078.2n", 0x00000, 0x100000, CRC(d27c3952) SHA1(de7306432b682f238b911507ad7aa2fa8acbee80) ) /* sprites */
ROM_LOAD( "blood_bros_obj__=c=1990_tad_corp.u078.2n", 0x00000, 0x100000, CRC(d27c3952) SHA1(de7306432b682f238b911507ad7aa2fa8acbee80) )
ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */
ROM_REGION( 0x40000, "oki", 0 )
ROM_LOAD( "bb_08.u095.5a", 0x00000, 0x20000, CRC(deb1b975) SHA1(08f2e9a0a23171201b71d381d091edcd3787c287) )
ROM_REGION( 0x0100, "proms", 0 )
@ -763,19 +1079,19 @@ ROM_START( bloodbrok )
ROM_END
ROM_START( weststry )
ROM_REGION( 0x80000, "maincpu", 0 ) /* 64k for cpu code; based on bloodbrob */
ROM_REGION( 0x80000, "maincpu", 0 ) // based on bloodbrob
ROM_LOAD16_BYTE( "ws13.bin", 0x00001, 0x20000, CRC(158e302a) SHA1(52cc1bf526424ff025a6b79f3fc7bba4b9bbfcbb) )
ROM_LOAD16_BYTE( "ws15.bin", 0x00000, 0x20000, CRC(672e9027) SHA1(71cb9fcef04edb972ba88de45d605dcff539ea2d) )
ROM_LOAD16_BYTE( "ws14.bin", 0x40001, 0x20000, CRC(fd951c2c) SHA1(f4031bf303c67c82f2f78f7456f78382d8c1ac85) )
ROM_LOAD16_BYTE( "ws16.bin", 0x40000, 0x20000, CRC(18d3c460) SHA1(93b86af1199f0fedeaf1fe64d27ffede4b819e42) )
ROM_REGION( 0x20000, "audiocpu", 0 ) /* 64k for sound cpu code; based on different revision of original Seibu code */
ROM_REGION( 0x20000, "audiocpu", 0 ) // based on different revision of original Seibu code
ROM_LOAD( "ws17.bin", 0x000000, 0x08000, CRC(e00a8f09) SHA1(e7247ce0ab99d0726f31dee5de5ba33f4ebd183e) )
ROM_CONTINUE( 0x010000, 0x08000 )
ROM_COPY( "audiocpu", 0x000000, 0x018000, 0x08000 )
ROM_COPY( "audiocpu", 0x000000, 0x18000, 0x08000 )
ROM_REGION( 0x20000, "txtiles", 0 ) // first half of these is blank
ROM_LOAD( "ws09.bin", 0x00000, 0x08000, CRC(f05b2b3e) SHA1(6570d795d68655ace9668f32dc0bf5c2d2372411) ) /* characters */
ROM_LOAD( "ws09.bin", 0x00000, 0x08000, CRC(f05b2b3e) SHA1(6570d795d68655ace9668f32dc0bf5c2d2372411) )
ROM_CONTINUE( 0x00000, 0x08000 )
ROM_LOAD( "ws11.bin", 0x08000, 0x08000, CRC(2b10e3d2) SHA1(0f5045615b44e2300745fd3afac7f1441352cca5) )
ROM_CONTINUE( 0x08000, 0x08000 )
@ -785,43 +1101,43 @@ ROM_START( weststry )
ROM_CONTINUE( 0x18000, 0x08000 )
ROM_REGION( 0x100000, "bgtiles", 0 )
ROM_LOAD( "ws01.bin", 0x20000, 0x20000, CRC(32bda4bc) SHA1(ed0c0740c7af513b341b2b7ff3e0bf6045e930e9) ) /* Foreground */
ROM_LOAD( "ws01.bin", 0x20000, 0x20000, CRC(32bda4bc) SHA1(ed0c0740c7af513b341b2b7ff3e0bf6045e930e9) ) // Foreground
ROM_LOAD( "ws03.bin", 0x60000, 0x20000, CRC(046b51f8) SHA1(25af752caebdec762582fc0130cf14546110bb54) )
ROM_LOAD( "ws02.bin", 0xa0000, 0x20000, CRC(ed9d682e) SHA1(0f79ea09a7af367d175081f72f2bc94f6caad463) )
ROM_LOAD( "ws04.bin", 0xe0000, 0x20000, CRC(75f082e5) SHA1(b29f09a3cc9a0ac3f982be3981f5e895050c49e8) )
ROM_LOAD( "ws05.bin", 0x00000, 0x20000, CRC(007c8dc0) SHA1(f44576da3b89d6a889fdb564825ac6ce3bb4cffe) ) /* Background */
ROM_LOAD( "ws05.bin", 0x00000, 0x20000, CRC(007c8dc0) SHA1(f44576da3b89d6a889fdb564825ac6ce3bb4cffe) ) // Background
ROM_LOAD( "ws07.bin", 0x40000, 0x20000, CRC(0f0c8d9a) SHA1(f5fe9b5ee4c8ffd7caf5313d13fb5f6e181ed9b6) )
ROM_LOAD( "ws06.bin", 0x80000, 0x20000, CRC(459d075e) SHA1(24cd0bffe7c5bbccf653ced0b73579059603d187) )
ROM_LOAD( "ws08.bin", 0xc0000, 0x20000, CRC(4d6783b3) SHA1(9870fe9570afeff179b6080581fd6bb187898ff0) )
ROM_REGION( 0x100000, "sprites", ROMREGION_INVERT )
ROM_LOAD( "ws25.bin", 0x00000, 0x20000, CRC(8092e8e9) SHA1(eabe58ac0f88234b0dddf361f56aad509a83012e) ) /* sprites */
ROM_LOAD( "ws25.bin", 0x00000, 0x20000, CRC(8092e8e9) SHA1(eabe58ac0f88234b0dddf361f56aad509a83012e) )
ROM_LOAD( "ws26.bin", 0x20000, 0x20000, CRC(f6a1f42c) SHA1(6d5503e1a9b00104970292d22301ed28893c5223) )
ROM_LOAD( "ws23.bin", 0x40000, 0x20000, CRC(43d58e24) SHA1(99e255faa9716d9102a1223419084fc209ab4024) )
ROM_LOAD( "ws24.bin", 0x60000, 0x20000, CRC(20a867ea) SHA1(d3985002931fd4180fc541d61a94371871f3709d) ) /* if the original MASK rom is converted then offset 1ECFE = 06 not 02, confirmed on 2 bootlegs, maybe original mask dump is bad? */
ROM_LOAD( "ws24.bin", 0x60000, 0x20000, CRC(20a867ea) SHA1(d3985002931fd4180fc541d61a94371871f3709d) ) // if the original mask ROM is converted then offset 1ECFE = 06 not 02, confirmed on 2 bootlegs, maybe original mask dump is bad?
ROM_LOAD( "ws21.bin", 0x80000, 0x20000, CRC(5ef55779) SHA1(8ca786ef56173305a01452defc2be6e775bef374) )
ROM_LOAD( "ws22.bin", 0xa0000, 0x20000, CRC(7150a060) SHA1(73bdd7d6752f7fe9e23073d835dbc468d57865fa) )
ROM_LOAD( "ws19.bin", 0xc0000, 0x20000, CRC(c5dd0a96) SHA1(4696ab1b02d40c54a7dacf0bdf90b624b7d6812e) )
ROM_LOAD( "ws20.bin", 0xe0000, 0x20000, CRC(f1245c16) SHA1(f3941bf5830995f65a5378326fdb72687fbbddcf) )
ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */
ROM_REGION( 0x40000, "oki", 0 )
ROM_LOAD( "ws18.bin", 0x00000, 0x20000, CRC(deb1b975) SHA1(08f2e9a0a23171201b71d381d091edcd3787c287) )
ROM_END
ROM_START( weststrya )
ROM_REGION( 0x80000, "maincpu", 0 ) /* 64k for cpu code; based on bloodbrob */
ROM_REGION( 0x80000, "maincpu", 0 ) // based on bloodbrob
ROM_LOAD16_BYTE( "13.bin", 0x00001, 0x20000, CRC(d50e1dfd) SHA1(b0ed90a602ae079c897de6d4cbed61f389f4b220) )
ROM_LOAD16_BYTE( "15.bin", 0x00000, 0x20000, CRC(fd419c7b) SHA1(f3b23a3f1d550b1739059aeb0fa92076d2b86f69) )
ROM_LOAD16_BYTE( "ws14.bin", 0x40001, 0x20000, CRC(fd951c2c) SHA1(f4031bf303c67c82f2f78f7456f78382d8c1ac85) )
ROM_LOAD16_BYTE( "ws16.bin", 0x40000, 0x20000, CRC(18d3c460) SHA1(93b86af1199f0fedeaf1fe64d27ffede4b819e42) )
ROM_REGION( 0x20000, "audiocpu", 0 ) /* 64k for sound cpu code; based on different revision of original Seibu code */
ROM_REGION( 0x20000, "audiocpu", 0 ) // based on different revision of original Seibu code
ROM_LOAD( "ws17.bin", 0x000000, 0x08000, CRC(e00a8f09) SHA1(e7247ce0ab99d0726f31dee5de5ba33f4ebd183e) )
ROM_CONTINUE( 0x010000, 0x08000 )
ROM_COPY( "audiocpu", 0x000000, 0x018000, 0x08000 )
ROM_COPY( "audiocpu", 0x000000, 0x18000, 0x08000 )
ROM_REGION( 0x20000, "txtiles", 0 ) // first half of these is blank
ROM_LOAD( "ws09.bin", 0x00000, 0x08000, CRC(f05b2b3e) SHA1(6570d795d68655ace9668f32dc0bf5c2d2372411) ) /* characters */
ROM_LOAD( "ws09.bin", 0x00000, 0x08000, CRC(f05b2b3e) SHA1(6570d795d68655ace9668f32dc0bf5c2d2372411) )
ROM_CONTINUE( 0x00000, 0x08000 )
ROM_LOAD( "ws11.bin", 0x08000, 0x08000, CRC(2b10e3d2) SHA1(0f5045615b44e2300745fd3afac7f1441352cca5) )
ROM_CONTINUE( 0x08000, 0x08000 )
@ -831,26 +1147,26 @@ ROM_START( weststrya )
ROM_CONTINUE( 0x18000, 0x08000 )
ROM_REGION( 0x100000, "bgtiles", 0 )
ROM_LOAD( "ws01.bin", 0x20000, 0x20000, CRC(32bda4bc) SHA1(ed0c0740c7af513b341b2b7ff3e0bf6045e930e9) ) /* Foreground */
ROM_LOAD( "ws01.bin", 0x20000, 0x20000, CRC(32bda4bc) SHA1(ed0c0740c7af513b341b2b7ff3e0bf6045e930e9) ) // Foreground
ROM_LOAD( "ws03.bin", 0x60000, 0x20000, CRC(046b51f8) SHA1(25af752caebdec762582fc0130cf14546110bb54) )
ROM_LOAD( "ws02.bin", 0xa0000, 0x20000, CRC(ed9d682e) SHA1(0f79ea09a7af367d175081f72f2bc94f6caad463) )
ROM_LOAD( "ws04.bin", 0xe0000, 0x20000, CRC(75f082e5) SHA1(b29f09a3cc9a0ac3f982be3981f5e895050c49e8) )
ROM_LOAD( "ws05.bin", 0x00000, 0x20000, CRC(007c8dc0) SHA1(f44576da3b89d6a889fdb564825ac6ce3bb4cffe) ) /* Background */
ROM_LOAD( "ws05.bin", 0x00000, 0x20000, CRC(007c8dc0) SHA1(f44576da3b89d6a889fdb564825ac6ce3bb4cffe) ) // Background
ROM_LOAD( "ws07.bin", 0x40000, 0x20000, CRC(0f0c8d9a) SHA1(f5fe9b5ee4c8ffd7caf5313d13fb5f6e181ed9b6) )
ROM_LOAD( "ws06.bin", 0x80000, 0x20000, CRC(459d075e) SHA1(24cd0bffe7c5bbccf653ced0b73579059603d187) )
ROM_LOAD( "ws08.bin", 0xc0000, 0x20000, CRC(4d6783b3) SHA1(9870fe9570afeff179b6080581fd6bb187898ff0) )
ROM_REGION( 0x100000, "sprites", ROMREGION_INVERT )
ROM_LOAD( "ws25.bin", 0x00000, 0x20000, CRC(8092e8e9) SHA1(eabe58ac0f88234b0dddf361f56aad509a83012e) ) /* sprites */
ROM_LOAD( "ws25.bin", 0x00000, 0x20000, CRC(8092e8e9) SHA1(eabe58ac0f88234b0dddf361f56aad509a83012e) )
ROM_LOAD( "ws26.bin", 0x20000, 0x20000, CRC(f6a1f42c) SHA1(6d5503e1a9b00104970292d22301ed28893c5223) )
ROM_LOAD( "ws23.bin", 0x40000, 0x20000, CRC(43d58e24) SHA1(99e255faa9716d9102a1223419084fc209ab4024) )
ROM_LOAD( "ws24.bin", 0x60000, 0x20000, CRC(20a867ea) SHA1(d3985002931fd4180fc541d61a94371871f3709d) ) /* if the original MASK rom is converted then offset 1ECFE = 06 not 02, confirmed on 2 bootlegs, maybe original mask dump is bad? */
ROM_LOAD( "ws24.bin", 0x60000, 0x20000, CRC(20a867ea) SHA1(d3985002931fd4180fc541d61a94371871f3709d) ) // if the original mask ROM is converted then offset 1ECFE = 06 not 02, confirmed on 2 bootlegs, maybe original mask dump is bad?
ROM_LOAD( "ws21.bin", 0x80000, 0x20000, CRC(5ef55779) SHA1(8ca786ef56173305a01452defc2be6e775bef374) )
ROM_LOAD( "ws22.bin", 0xa0000, 0x20000, CRC(7150a060) SHA1(73bdd7d6752f7fe9e23073d835dbc468d57865fa) )
ROM_LOAD( "ws19.bin", 0xc0000, 0x20000, CRC(c5dd0a96) SHA1(4696ab1b02d40c54a7dacf0bdf90b624b7d6812e) )
ROM_LOAD( "ws20.bin", 0xe0000, 0x20000, CRC(f1245c16) SHA1(f3941bf5830995f65a5378326fdb72687fbbddcf) )
ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */
ROM_REGION( 0x40000, "oki", 0 )
ROM_LOAD( "ws18.bin", 0x00000, 0x20000, CRC(deb1b975) SHA1(08f2e9a0a23171201b71d381d091edcd3787c287) )
ROM_END
@ -867,16 +1183,16 @@ ROM_START( skysmash )
ROM_COPY( "audiocpu", 0x000000, 0x018000, 0x08000 )
ROM_REGION( 0x20000, "txtiles", 0 )
ROM_LOAD( "rom3", 0x00000, 0x10000, CRC(fbb241be) SHA1(cd94c328891538bbd8c062d90a47ddf3d7d05bb0) ) /* characters */
ROM_LOAD( "rom3", 0x00000, 0x10000, CRC(fbb241be) SHA1(cd94c328891538bbd8c062d90a47ddf3d7d05bb0) )
ROM_LOAD( "rom4", 0x10000, 0x10000, CRC(ad3cde81) SHA1(2bd0c707e5b67d3699a743d989cb5384cbe37ff7) )
ROM_REGION( 0x100000, "bgtiles", 0 )
ROM_LOAD( "rom9", 0x00000, 0x100000, CRC(b0a5eecf) SHA1(9e8191c7ae4a32dc16aebc37fa942afc531eddd4) ) /* Background + Foreground */
ROM_LOAD( "rom9", 0x00000, 0x100000, CRC(b0a5eecf) SHA1(9e8191c7ae4a32dc16aebc37fa942afc531eddd4) )
ROM_REGION( 0x80000, "sprites", 0 )
ROM_LOAD( "rom10", 0x00000, 0x080000, CRC(1bbcda5d) SHA1(63915221f70a7dfda6a4d8ac7f5c663c9316610a) ) /* sprites */
ROM_LOAD( "rom10", 0x00000, 0x080000, CRC(1bbcda5d) SHA1(63915221f70a7dfda6a4d8ac7f5c663c9316610a) )
ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */
ROM_REGION( 0x40000, "oki", 0 )
ROM_LOAD( "rom1", 0x00000, 0x20000, CRC(e69986f6) SHA1(de38bf2d5638cb40740882e1abccf7928e43a5a6) )
ROM_REGION( 0x0100, "proms", 0 )
@ -894,18 +1210,20 @@ void weststry_state::init_weststry()
uint8_t *sprites = memregion("sprites")->base();
for (int i = 0; i < 0x40000; i++)
{
/* sprite roms ws25 and ws26 have 2 bits swapped
/* sprite ROMs ws25 and ws26 have 2 bits swapped
there is also an address swap but that is currently handled in the video implementation */
sprites[i] = bitswap<8>(sprites[i],7,6,4,5,3,2,1,0);
sprites[i] = bitswap<8>(sprites[i], 7, 6, 4, 5, 3, 2, 1, 0);
}
m_weststry_opl_irq = false;
m_weststry_soundnmi_mask = true;
m_opl_irq = false;
m_soundnmi_mask = true;
save_item(NAME(m_weststry_opl_irq));
save_item(NAME(m_weststry_soundnmi_mask));
save_item(NAME(m_opl_irq));
save_item(NAME(m_soundnmi_mask));
}
} // anonymous namespace
/* Game Drivers */

View File

@ -1,112 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Carlos A. Lozano
#ifndef MAME_SEIBU_BLOODBRO_H
#define MAME_SEIBU_BLOODBRO_H
#pragma once
#include "sei021x_sei0220_spr.h"
#include "seibusound.h"
#include "sound/ymopl.h"
#include "emupal.h"
#include "screen.h"
#include "tilemap.h"
class bloodbro_state : public driver_device, public seibu_sound_common
{
public:
bloodbro_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_spritegen(*this, "spritegen"),
m_seibu_sound(*this, "seibu_sound"),
m_ymsnd(*this, "ymsnd"),
m_spriteram(*this, "spriteram"),
m_bgvideoram(*this, "bgvideoram"),
m_fgvideoram(*this, "fgvideoram"),
m_txvideoram(*this, "txvideoram")
{ }
void bloodbro(machine_config &config);
void skysmash(machine_config &config);
protected:
virtual void video_start() override;
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
optional_device<sei0210_device> m_spritegen;
required_device<seibu_sound_device> m_seibu_sound;
required_device<ym3812_device> m_ymsnd;
required_shared_ptr<uint16_t> m_spriteram;
required_shared_ptr<uint16_t> m_bgvideoram;
required_shared_ptr<uint16_t> m_fgvideoram;
required_shared_ptr<uint16_t> m_txvideoram;
uint16_t m_scrollram[6]{};
uint16_t m_layer_en = 0U;
tilemap_t *m_bg_tilemap = nullptr;
tilemap_t *m_fg_tilemap = nullptr;
tilemap_t *m_tx_tilemap = nullptr;
void bgvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void fgvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void txvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void layer_en_w(uint16_t data);
void layer_scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILE_GET_INFO_MEMBER(get_fg_tile_info);
TILE_GET_INFO_MEMBER(get_tx_tile_info);
uint32_t screen_update_bloodbro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void bloodbro_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t pri_cb(uint8_t pri, uint8_t ext);
void bloodbro_map(address_map &map);
void common_map(address_map &map);
void skysmash_map(address_map &map);
};
class weststry_state : public bloodbro_state
{
public:
weststry_state(const machine_config &mconfig, device_type type, const char *tag) :
bloodbro_state(mconfig, type, tag)
{ }
void init_weststry();
void weststry(machine_config &config);
private:
bool m_weststry_opl_irq = false;
bool m_weststry_soundnmi_mask = false;
void weststry_layer_scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void weststry_soundlatch_w(offs_t offset, u8 data);
void weststry_opl_irq_w(int state);
void weststry_opl_w(offs_t offset, uint8_t data);
void weststry_soundnmi_ack_w(uint8_t data);
void weststry_soundnmi_update();
uint32_t screen_update_weststry(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void weststry_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void weststry_map(address_map &map);
void weststry_sound_map(address_map &map);
};
#endif // MAME_SEIBU_BLOODBRO_H

View File

@ -1,231 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Carlos A. Lozano
/***************************************************************************
Video Hardware for Blood Brothers
Note:
- An extra layer is currently disabled via the layer enable register
in Seibu CRTC device (bit 2). Is it even tied to any RAM portion?
***************************************************************************/
#include "emu.h"
#include "bloodbro.h"
#include "screen.h"
/***************************************************************************
Callbacks for the TileMap code
***************************************************************************/
TILE_GET_INFO_MEMBER(bloodbro_state::get_bg_tile_info)
{
int code = m_bgvideoram[tile_index];
tileinfo.set(1,
code & 0xfff,
(code >> 12),
0);
}
TILE_GET_INFO_MEMBER(bloodbro_state::get_fg_tile_info)
{
int code = m_fgvideoram[tile_index];
tileinfo.set(2,
(code & 0xfff)+0x1000,
(code >> 12),
0);
}
TILE_GET_INFO_MEMBER(bloodbro_state::get_tx_tile_info)
{
int code = m_txvideoram[tile_index];
tileinfo.set(0,
code & 0xfff,
code >> 12,
0);
}
/***************************************************************************
Start the video hardware emulation.
***************************************************************************/
void bloodbro_state::video_start()
{
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(bloodbro_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 16);
m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(bloodbro_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 16);
m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(bloodbro_state::get_tx_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_fg_tilemap->set_transparent_pen(15);
m_tx_tilemap->set_transparent_pen(15);
save_item(NAME(m_scrollram));
save_item(NAME(m_layer_en));
}
/***************************************************************************
Memory handlers
***************************************************************************/
void bloodbro_state::bgvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_bgvideoram[offset]);
m_bg_tilemap->mark_tile_dirty(offset);
}
void bloodbro_state::fgvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_fgvideoram[offset]);
m_fg_tilemap->mark_tile_dirty(offset);
}
void bloodbro_state::txvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_txvideoram[offset]);
m_tx_tilemap->mark_tile_dirty(offset);
}
/***************************************************************************
Display refresh
Blood Bros / Skysmash Spriteram
-------------------------------
Slightly more sophisticated successor to the Toki sprite chip.
It has "big sprites" created by setting width or height >0. Tile
numbers are read consecutively.
+0 x....... ........ sprite disabled if set
+0 .x...... ........ Flip y (no evidence for this!!)
+0 ..x..... ........ Flip x
+0 ....x... ........ Priority (1=high)
+0 ......xx x....... Width: do this many tiles horizontally
+0 ........ .xxx.... Height: do this many tiles vertically
+0 ........ ....xxxx Color bank
+1 ...xxxxx xxxxxxxx Tile number
+2 .......x xxxxxxxx X coordinate
+3 .......x xxxxxxxx Y coordinate
Weststry Bootleg Spriteram
--------------------------
Lacks the "big sprite" feature of the original. Needs some
tile number remapping for some reason.
+0 .......x xxxxxxxx Sprite Y coordinate
+1 ...xxxxx xxxxxxxx Sprite tile number
+2 xxxx.... ........ Sprite color bank
+2 ......x. ........ Sprite flip x
+2 ........ x....... Priority ??
+3 .......x xxxxxxxx Sprite X coordinate
***************************************************************************/
/* SPRITE INFO (8 bytes)
D-F?P?SS SSSSCCCC
---TTTTT TTTTTTTT
-------X XXXXXXXX
-------- YYYYYYYY */
uint32_t bloodbro_state::pri_cb(uint8_t pri, uint8_t ext)
{
return pri ? 0x02 : 0;
}
/* SPRITE INFO (8 bytes)
D------- YYYYYYYY
---TTTTT TTTTTTTT
CCCC--F? -?--???? Priority??
-------X XXXXXXXX
*/
void weststry_state::weststry_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
uint16_t *spriteram16 = m_spriteram;
int offs;
for (offs = m_spriteram.bytes()/2 - 4; offs >= 0; offs -= 4)
{
int data = spriteram16[offs+2];
int data0 = spriteram16[offs+0];
int code = spriteram16[offs+1]&0x1fff;
int sx = spriteram16[offs+3]&0x1ff;
int sy = 0xf0-(data0&0xff);
int flipx = data & 0x200;
int flipy = data & 0x400; /* ??? */
int color = (data&0xf000)>>12;
int pri_mask = (data & 0x0080) ? 0x02 : 0;
if (sx >= 256) sx -= 512;
if (data0 & 0x8000) continue; /* disabled */
/* Remap code 0x800 <-> 0x1000 */
code = (code&0x7ff) | ((code&0x800)<<1) | ((code&0x1000)>>1);
m_gfxdecode->gfx(3)->prio_transpen(bitmap,cliprect,
code,
color,
flipx,flipy,
sx,sy,
screen.priority(),
pri_mask,15);
}
}
uint32_t bloodbro_state::screen_update_bloodbro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->set_scrollx(0,m_scrollram[0]);
m_bg_tilemap->set_scrolly(0,m_scrollram[1]);
m_fg_tilemap->set_scrollx(0,m_scrollram[2]);
m_fg_tilemap->set_scrolly(0,m_scrollram[3]);
screen.priority().fill(0, cliprect);
if(BIT(~m_layer_en, 0))
m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0);
if(BIT(~m_layer_en, 1))
m_fg_tilemap->draw(screen, bitmap, cliprect, 0,1);
if(BIT(~m_layer_en, 4))
m_spritegen->draw_sprites(screen, bitmap, cliprect, m_spriteram, m_spriteram.bytes());
if(BIT(~m_layer_en, 3))
m_tx_tilemap->draw(screen, bitmap, cliprect, 0,0);
return 0;
}
uint32_t weststry_state::screen_update_weststry(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// The bootleg video hardware probably also allows BG scrolling, but weststry doesn't use it
m_fg_tilemap->set_scrollx(0, (int8_t)m_scrollram[1] - 13);
m_fg_tilemap->set_scrolly(0, (int8_t)m_scrollram[0] + 1);
screen.priority().fill(0, cliprect);
m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0);
m_fg_tilemap->draw(screen, bitmap, cliprect, 0,1);
weststry_draw_sprites(screen, bitmap,cliprect);
m_tx_tilemap->draw(screen, bitmap, cliprect, 0,0);
return 0;
}

View File

@ -1,5 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:Carlos A. Lozano
// copyright-holders: Carlos A. Lozano
/******************************************************************
Cabal (c)1988/1989 Tad
@ -163,17 +164,254 @@ Notes:
******************************************************************/
#include "emu.h"
#include "cabal.h"
#include "seibusound.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
#include "machine/gen_latch.h"
#include "machine/upd4701.h"
#include "sound/msm5205.h"
#include "sound/ymopm.h"
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
#include "tilemap.h"
namespace {
class cabal_base_state : public driver_device
{
public:
cabal_base_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_msm(*this, "msm%u", 1U),
m_spriteram(*this, "spriteram"),
m_colorram(*this, "colorram"),
m_videoram(*this, "videoram")
{ }
protected:
virtual void video_start() override;
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device_array<msm5205_device, 2> m_msm;
required_shared_ptr<uint16_t> m_spriteram;
required_shared_ptr<uint16_t> m_colorram;
required_shared_ptr<uint16_t> m_videoram;
void flipscreen_w(uint8_t data);
void background_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void text_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
private:
tilemap_t *m_background_layer = nullptr;
tilemap_t *m_text_layer = nullptr;
TILE_GET_INFO_MEMBER(get_back_tile_info);
TILE_GET_INFO_MEMBER(get_text_tile_info);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
};
class cabal_state : public cabal_base_state
{
public:
cabal_state(const machine_config &mconfig, device_type type, const char *tag) :
cabal_base_state(mconfig, type, tag),
m_seibu_sound(*this, "seibu_sound"),
m_adpcm(*this, "adpcm%u", 1U)
{ }
void cabal(machine_config &config);
void cabalbl2(machine_config &config);
void cabalt(machine_config &config);
void init_cabal();
private:
required_device<seibu_sound_device> m_seibu_sound;
required_device_array<seibu_adpcm_device, 2> m_adpcm;
void sound_irq_trigger_word_w(offs_t offset, uint16_t data, uint16_t mem_mask);
void main_map(address_map &map);
void sound_decrypted_opcodes_map(address_map &map);
void sound_map(address_map &map);
void trackball_main_map(address_map &map);
void cabalbl2_predecrypted_opcodes_map(address_map &map);
void cabalbl2_sound_map(address_map &map);
};
class cabalbl_state : public cabal_base_state
{
public:
cabalbl_state(const machine_config &mconfig, device_type type, const char *tag) :
cabal_base_state(mconfig, type, tag)
{ }
void cabalbl(machine_config &config);
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
private:
int m_sound_command[2]{};
void sndcmd_w(offs_t offset, uint16_t data);
void sound_irq_trigger_word_w(uint16_t data);
template<uint8_t Which> uint8_t snd_r();
void coin_w(uint8_t data);
template<uint8_t Which> void adpcm_w(uint8_t data);
void main_map(address_map &map);
void sound_map(address_map &map);
void talk1_map(address_map &map);
void talk1_portmap(address_map &map);
void talk2_map(address_map &map);
void talk2_portmap(address_map &map);
};
// video
TILE_GET_INFO_MEMBER(cabal_base_state::get_back_tile_info)
{
int tile = m_videoram[tile_index];
int const color = (tile >> 12) & 0xf;
tile &= 0xfff;
tileinfo.set(1, tile, color, 0);
}
TILE_GET_INFO_MEMBER(cabal_base_state::get_text_tile_info)
{
int tile = m_colorram[tile_index];
int const color = (tile >> 10);
tile &= 0x3ff;
tileinfo.set(0, tile, color, 0);
}
void cabal_base_state::video_start()
{
m_background_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cabal_base_state::get_back_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
m_text_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cabal_base_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_text_layer->set_transparent_pen(3);
m_background_layer->set_transparent_pen(15);
}
/**************************************************************************/
void cabal_base_state::flipscreen_w(uint8_t data)
{
int const flip = (data & 0x20) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0;
m_background_layer->set_flip(flip);
m_text_layer->set_flip(flip);
flip_screen_set(data & 0x20);
}
void cabal_base_state::background_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_videoram[offset]);
m_background_layer->mark_tile_dirty(offset);
}
void cabal_base_state::text_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_colorram[offset]);
m_text_layer->mark_tile_dirty(offset);
}
/********************************************************************
Cabal Spriteram
---------------
+0 .......x ........ Sprite enable bit
+0 ........ xxxxxxxx Sprite Y coordinate
+1 ..??.... ........ ??? unknown ???
+1 ....xxxx xxxxxxxx Sprite tile number
+2 .xxxx... ........ Sprite color bank
+2 .....x.. ........ Sprite flip x
+2 .......x xxxxxxxx Sprite X coordinate
+3 (unused)
-------E YYYYYYYY
----BBTT TTTTTTTT
-CCCCF-X XXXXXXXX
-------- --------
********************************************************************/
void cabal_base_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
for (int offs = m_spriteram.bytes() / 2 - 4; offs >= 0; offs -= 4)
{
int const data0 = m_spriteram[offs];
int const data1 = m_spriteram[offs + 1];
int const data2 = m_spriteram[offs + 2];
if (data0 & 0x100)
{
int const tile_number = data1 & 0xfff;
int const color = (data2 & 0x7800) >> 11;
int sy = (data0 & 0xff);
int sx = (data2 & 0x1ff);
int flipx = (data2 & 0x0400);
int flipy = 0;
if (sx > 256) sx -= 512;
if (flip_screen())
{
sx = 240 - sx;
sy = 240 - sy;
flipx = !flipx;
flipy = !flipy;
}
m_gfxdecode->gfx(2)->transpen(bitmap, cliprect,
tile_number,
color,
flipx, flipy,
sx, sy, 0xf);
}
}
}
uint32_t cabal_base_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_background_layer->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
draw_sprites(bitmap, cliprect);
m_text_layer->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
// machine
void cabalbl_state::machine_start()
{
save_item(NAME(m_sound_command));
@ -203,12 +441,12 @@ void cabalbl_state::sndcmd_w(offs_t offset, uint16_t data)
void cabal_state::sound_irq_trigger_word_w(offs_t, u16 data, u16 mem_mask)
void cabal_state::sound_irq_trigger_word_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (ACCESSING_BITS_0_7)
m_seibu_sound->main_w(4, data & 0x00ff);
/* spin for a while to let the Z80 read the command, otherwise coins "stick" */
// spin for a while to let the Z80 read the command, otherwise coins "stick"
m_maincpu->spin_until_time(attotime::from_usec(50));
}
@ -223,15 +461,15 @@ void cabal_state::main_map(address_map &map)
{
map(0x00000, 0x3ffff).rom();
map(0x40000, 0x437ff).ram();
map(0x43800, 0x43fff).ram().share("spriteram");
map(0x43800, 0x43fff).ram().share(m_spriteram);
map(0x44000, 0x4ffff).ram();
map(0x60000, 0x607ff).ram().w(FUNC(cabal_state::text_videoram_w)).share("colorram");
map(0x80000, 0x801ff).ram().w(FUNC(cabal_state::background_videoram_w)).share("videoram");
map(0x60000, 0x607ff).ram().w(FUNC(cabal_state::text_videoram_w)).share(m_colorram);
map(0x80000, 0x801ff).ram().w(FUNC(cabal_state::background_videoram_w)).share(m_videoram);
map(0x80200, 0x803ff).ram();
map(0xa0000, 0xa0001).portr("DSW");
map(0xa0008, 0xa0009).portr("IN2");
map(0xa0010, 0xa0011).portr("INPUTS");
map(0xc0040, 0xc0041).nopw(); /* ??? */
map(0xc0040, 0xc0041).nopw(); // ???
map(0xc0081, 0xc0081).w(FUNC(cabal_state::flipscreen_w));
map(0xe0000, 0xe07ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
map(0xe8000, 0xe800d).rw(m_seibu_sound, FUNC(seibu_sound_device::main_r), FUNC(seibu_sound_device::main_w)).umask16(0x00ff);
@ -255,15 +493,15 @@ void cabalbl_state::main_map(address_map &map)
{
map(0x00000, 0x3ffff).rom();
map(0x40000, 0x437ff).ram();
map(0x43800, 0x43fff).ram().share("spriteram");
map(0x43800, 0x43fff).ram().share(m_spriteram);
map(0x44000, 0x4ffff).ram();
map(0x60000, 0x607ff).ram().w(FUNC(cabalbl_state::text_videoram_w)).share("colorram");
map(0x80000, 0x801ff).ram().w(FUNC(cabalbl_state::background_videoram_w)).share("videoram");
map(0x60000, 0x607ff).ram().w(FUNC(cabalbl_state::text_videoram_w)).share(m_colorram);
map(0x80000, 0x801ff).ram().w(FUNC(cabalbl_state::background_videoram_w)).share(m_videoram);
map(0x80200, 0x803ff).ram();
map(0xa0000, 0xa0001).portr("DSW");
map(0xa0008, 0xa0009).portr("JOY");
map(0xa0010, 0xa0011).portr("INPUTS");
map(0xc0040, 0xc0041).nopw(); /* ??? */
map(0xc0040, 0xc0041).nopw(); // ???
map(0xc0081, 0xc0081).w(FUNC(cabalbl_state::flipscreen_w));
map(0xe0000, 0xe07ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
map(0xe8000, 0xe8003).w(FUNC(cabalbl_state::sndcmd_w));
@ -276,7 +514,7 @@ void cabalbl_state::main_map(address_map &map)
template<uint8_t Which>
uint8_t cabalbl_state::snd_r()
{
return bitswap<8>(m_sound_command[Which], 7,2,4,5,3,6,1,0);
return bitswap<8>(m_sound_command[Which], 7, 2, 4, 5, 3, 6, 1, 0);
}
void cabalbl_state::coin_w(uint8_t data)
@ -325,7 +563,7 @@ void cabalbl_state::sound_map(address_map &map)
map(0x400a, 0x400a).r(FUNC(cabalbl_state::snd_r<0>));
map(0x400c, 0x400c).w("soundlatch", FUNC(generic_latch_8_device::write));
map(0x400e, 0x400f).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write));
map(0x6000, 0x6000).nopw(); /* ??? */
map(0x6000, 0x6000).nopw(); // ???
map(0x8000, 0xffff).rom();
}
@ -355,13 +593,13 @@ void cabal_state::cabalbl2_predecrypted_opcodes_map(address_map &map)
map(0x8000, 0xffff).rom().region("audiocpu", 0x8000);
}
/* the bootleg has 2x z80 sample players */
// the bootleg has 2x z80 sample players
template<uint8_t Which>
void cabalbl_state::adpcm_w(uint8_t data)
{
m_msm[Which]->reset_w(BIT(data, 7));
/* ?? bit 6?? */
// ?? bit 6??
m_msm[Which]->data_w(data);
m_msm[Which]->vclk_w(1);
m_msm[Which]->vclk_w(0);
@ -449,14 +687,14 @@ static INPUT_PORTS_START( common )
PORT_DIPSETTING( 0x2000, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x1000, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Very_Hard ) )
PORT_DIPUNKNOWN_DIPLOC( 0x4000, 0x4000, "SW2:7" ) /* Left blank in the manual */
PORT_DIPUNKNOWN_DIPLOC( 0x4000, 0x4000, "SW2:7" ) // Left blank in the manual
PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8")
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x8000, DEF_STR( On ) )
PORT_START("COIN")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(4) /* read through sound cpu */
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(4) /* read through sound cpu */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(4) // read through sound CPU
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(4) // read through sound CPU
INPUT_PORTS_END
static INPUT_PORTS_START( cabalt )
@ -496,7 +734,7 @@ static INPUT_PORTS_START( cabalj )
/* Since the Trackball version was produced first, and it doesn't use
the third button, Pin 24 of the JAMMA connector ('JAMMA button 3')
has no trace on the pcb. To work around this design issue the
has no trace on the PCB. To work around this design issue the
manufacturer had to use pin 15 which is usually the test / service
button
*/
@ -506,7 +744,7 @@ static INPUT_PORTS_START( cabalj )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x0ff0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) /* the 3rd button connects to the service switch */
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) // the 3rd button connects to the service switch
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START1 )
@ -601,30 +839,30 @@ static const gfx_layout sprite_layout =
static GFXDECODE_START( gfx_cabal )
GFXDECODE_ENTRY( "gfx1", 0x000000, text_layout, 0, 1024/4 )
GFXDECODE_ENTRY( "gfx2", 0x000000, tile_layout, 32*16, 16 )
GFXDECODE_ENTRY( "gfx3", 0x000000, sprite_layout, 16*16, 16 )
GFXDECODE_ENTRY( "chars", 0x000000, text_layout, 0, 1024/4 )
GFXDECODE_ENTRY( "tiles", 0x000000, tile_layout, 32*16, 16 )
GFXDECODE_ENTRY( "sprites", 0x000000, sprite_layout, 16*16, 16 )
GFXDECODE_END
void cabal_state::cabal(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, XTAL(20'000'000)/2); /* verified on pcb */
// basic machine hardware
M68000(config, m_maincpu, XTAL(20'000'000) / 2); // verified on PCB
m_maincpu->set_addrmap(AS_PROGRAM, &cabal_state::main_map);
m_maincpu->set_vblank_int("screen", FUNC(cabal_state::irq1_line_hold));
Z80(config, m_audiocpu, XTAL(3'579'545)); /* verified on pcb */
Z80(config, m_audiocpu, XTAL(3'579'545)); // verified on PCB
m_audiocpu->set_addrmap(AS_PROGRAM, &cabal_state::sound_map);
m_audiocpu->set_addrmap(AS_OPCODES, &cabal_state::sound_decrypted_opcodes_map);
m_audiocpu->set_irq_acknowledge_callback("seibu_sound", FUNC(seibu_sound_device::im0_vector_cb));
SEI80BU(config, "sei80bu", 0).set_device_rom_tag("audiocpu");
/* video hardware */
// video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(59.60); /* verified on pcb */
screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
screen.set_refresh_hz(59.60); // verified on PCB
screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate
screen.set_size(256, 256);
screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
screen.set_screen_update(FUNC(cabal_state::screen_update));
@ -633,7 +871,7 @@ void cabal_state::cabal(machine_config &config)
GFXDECODE(config, m_gfxdecode, m_palette, gfx_cabal);
PALETTE(config, m_palette).set_format(palette_device::xBGR_444, 1024);
/* sound hardware */
// sound hardware
SEIBU_SOUND(config, m_seibu_sound, 0);
m_seibu_sound->int_callback().set_inputline(m_audiocpu, 0);
m_seibu_sound->set_rom_tag("audiocpu");
@ -642,19 +880,19 @@ void cabal_state::cabal(machine_config &config)
SPEAKER(config, "mono").front_center();
ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(3'579'545))); /* verified on pcb */
ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(3'579'545))); // verified on PCB
ymsnd.irq_handler().set(m_seibu_sound, FUNC(seibu_sound_device::fm_irqhandler));
ymsnd.add_route(ALL_OUTPUTS, "mono", 0.80);
SEIBU_ADPCM(config, m_adpcm[0], XTAL(12'000'000)/32/48, m_msm[0]);
SEIBU_ADPCM(config, m_adpcm[1], XTAL(12'000'000)/32/48, m_msm[1]);
SEIBU_ADPCM(config, m_adpcm[0], XTAL(12'000'000) /32 / 48, m_msm[0]);
SEIBU_ADPCM(config, m_adpcm[1], XTAL(12'000'000) /32 / 48, m_msm[1]);
MSM5205(config, m_msm[0], XTAL(12'000'000)/32); /* verified on pcb */
MSM5205(config, m_msm[0], XTAL(12'000'000) / 32); // verified on PCB
m_msm[0]->vck_callback().set(m_adpcm[0], FUNC(seibu_adpcm_device::msm_int));
m_msm[0]->set_prescaler_selector(msm5205_device::S48_4B); /* 7.8125 kHz */
m_msm[0]->add_route(ALL_OUTPUTS, "mono", 0.40);
MSM5205(config, m_msm[1], XTAL(12'000'000)/32); /* verified on pcb */
MSM5205(config, m_msm[1], XTAL(12'000'000) / 32); // verified on PCB
m_msm[1]->vck_callback().set(m_adpcm[1], FUNC(seibu_adpcm_device::msm_int));
m_msm[1]->set_prescaler_selector(msm5205_device::S48_4B); /* 7.8125 kHz */
m_msm[1]->add_route(ALL_OUTPUTS, "mono", 0.40);
@ -684,34 +922,34 @@ void cabal_state::cabalbl2(machine_config &config)
}
/* the bootleg has different sound hardware (2 extra Z80s for ADPCM playback) */
// the bootleg has different sound hardware (2 extra Z80s for ADPCM playback)
void cabalbl_state::cabalbl(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, XTAL(20'000'000)/2); /* verified on pcb */
// basic machine hardware
M68000(config, m_maincpu, XTAL(20'000'000) / 2); // verified on PCB
m_maincpu->set_addrmap(AS_PROGRAM, &cabalbl_state::main_map);
m_maincpu->set_vblank_int("screen", FUNC(cabalbl_state::irq1_line_hold));
Z80(config, m_audiocpu, XTAL(3'579'545)); /* verified on pcb */
Z80(config, m_audiocpu, XTAL(3'579'545)); // verified on PCB
m_audiocpu->set_addrmap(AS_PROGRAM, &cabalbl_state::sound_map);
/* there are 2x z80s for the ADPCM */
z80_device &adpcm_1(Z80(config, "adpcm_1", XTAL(3'579'545))); /* verified on pcb */
// there are 2x z80s for the ADPCM
z80_device &adpcm_1(Z80(config, "adpcm_1", XTAL(3'579'545))); // verified on PCB
adpcm_1.set_addrmap(AS_PROGRAM, &cabalbl_state::talk1_map);
adpcm_1.set_addrmap(AS_IO, &cabalbl_state::talk1_portmap);
adpcm_1.set_periodic_int(FUNC(cabalbl_state::irq0_line_hold), attotime::from_hz(8000));
z80_device &adpcm_2(Z80(config, "adpcm_2", XTAL(3'579'545))); /* verified on pcb */
z80_device &adpcm_2(Z80(config, "adpcm_2", XTAL(3'579'545))); // verified on PCB
adpcm_2.set_addrmap(AS_PROGRAM, &cabalbl_state::talk2_map);
adpcm_2.set_addrmap(AS_IO, &cabalbl_state::talk2_portmap);
adpcm_2.set_periodic_int(FUNC(cabalbl_state::irq0_line_hold), attotime::from_hz(8000));
config.set_maximum_quantum(attotime::from_hz(600));
/* video hardware */
// video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(60);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate
screen.set_size(256, 256);
screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
screen.set_screen_update(FUNC(cabalbl_state::screen_update));
@ -720,43 +958,43 @@ void cabalbl_state::cabalbl(machine_config &config)
GFXDECODE(config, m_gfxdecode, m_palette, gfx_cabal);
PALETTE(config, m_palette).set_format(palette_device::xBGR_444, 1024);
/* sound hardware */
// sound hardware
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, "soundlatch");
GENERIC_LATCH_8(config, "soundlatch2");
GENERIC_LATCH_8(config, "soundlatch3");
ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(3'579'545))); /* verified on pcb */
ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(3'579'545))); // verified on PCB
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(ALL_OUTPUTS, "mono", 0.80);
MSM5205(config, m_msm[0], XTAL(12'000'000)/32); /* verified on pcb (no resonator) */
MSM5205(config, m_msm[0], XTAL(12'000'000) / 32); // verified on PCB (no resonator)
m_msm[0]->set_prescaler_selector(msm5205_device::SEX_4B);
m_msm[0]->add_route(ALL_OUTPUTS, "mono", 0.60);
MSM5205(config, m_msm[1], XTAL(12'000'000)/32); /* verified on pcb (no resonator)*/
MSM5205(config, m_msm[1], XTAL(12'000'000) / 32); // verified on PCB (no resonator)
m_msm[1]->set_prescaler_selector(msm5205_device::SEX_4B);
m_msm[1]->add_route(ALL_OUTPUTS, "mono", 0.60);
}
ROM_START( cabal )
ROM_REGION( 0x50000, "maincpu", 0 ) /* 64k for cpu code */
ROM_REGION( 0x50000, "maincpu", 0 )
ROM_LOAD16_BYTE( "13.7h", 0x00000, 0x10000, CRC(00abbe0c) SHA1(bacf17444abfb4f56248ff56e37b0aa2b1a3800d) )
ROM_LOAD16_BYTE( "11.6h", 0x00001, 0x10000, CRC(44736281) SHA1(1d6da95ef96d9c02aea70791e1cb87b70097d5ed) )
ROM_LOAD16_BYTE( "12.7j", 0x20000, 0x10000, CRC(d763a47c) SHA1(146d8082a404b6eddaf2dc9ba41a997949c17f8a) )
ROM_LOAD16_BYTE( "10.6j", 0x20001, 0x10000, CRC(96d5e8af) SHA1(ed7d854f08e87db5ae6cf526eafa029dfd2bfb9f) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound cpu code */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "4-3n", 0x0000, 0x2000, CRC(4038eff2) SHA1(0bcafc1b78c3bef9a0e9b822c482ea4a942fd180) )
ROM_LOAD( "3-3p", 0x8000, 0x8000, CRC(d9defcbf) SHA1(f26b10b1dbe5aa6446f70fd18e5f1379455578ec) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "5-6s", 0x00000, 0x04000, CRC(6a76955a) SHA1(733cb4b862b5dac97c2641b58f2362471e62fcf2) ) /* characters */
ROM_REGION( 0x4000, "chars", 0 )
ROM_LOAD( "5-6s", 0x00000, 0x04000, CRC(6a76955a) SHA1(733cb4b862b5dac97c2641b58f2362471e62fcf2) )
/* The Joystick versions use a sub-board instead of the mask roms
the content is the same as the mask roms */
ROM_REGION( 0x80000, "gfx2", 0 )
/* The Joystick versions use a sub-board instead of the mask ROMs
the content is the same as the mask ROMs */
ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD16_BYTE( "bg_rom1.bin", 0x00000, 0x10000, CRC(1023319b) SHA1(38fcc8159776b82779b3163329b07c61be939fae) )
ROM_LOAD16_BYTE( "bg_rom2.bin", 0x00001, 0x10000, CRC(3b6d2b09) SHA1(4cdcd22836dce4ee6348c4e6df7c6360d12ef912) )
ROM_LOAD16_BYTE( "bg_rom3.bin", 0x20000, 0x10000, CRC(420b0801) SHA1(175be6e3ca3cb98672e4cdbc9b5f5b007bc531c9) )
@ -766,7 +1004,7 @@ ROM_START( cabal )
ROM_LOAD16_BYTE( "bg_rom7.bin", 0x60000, 0x10000, CRC(d28d921e) SHA1(e133de5129a33ca9ff449948a959621bbfc58c11) )
ROM_LOAD16_BYTE( "bg_rom8.bin", 0x60001, 0x10000, CRC(67e4fe47) SHA1(15620fc5e985a249677da333b77331e40d2b24ab) )
ROM_REGION( 0x80000, "gfx3", 0 )
ROM_REGION( 0x80000, "sprites", 0 )
ROM_LOAD16_BYTE( "sp_rom1.bin", 0x00000, 0x10000, CRC(34d3cac8) SHA1(a6a2304fb576267db2c72cfbf0a3f66740ebe60e) )
ROM_LOAD16_BYTE( "sp_rom2.bin", 0x00001, 0x10000, CRC(4e49c28e) SHA1(ea74443a9423b14611a1f97e44692badfedd0ead) )
ROM_LOAD16_BYTE( "sp_rom3.bin", 0x20000, 0x10000, CRC(7065e840) SHA1(baa8cd28be60c678d782ecfabde6cd5e36480415) )
@ -776,19 +1014,19 @@ ROM_START( cabal )
ROM_LOAD16_BYTE( "sp_rom7.bin", 0x60000, 0x10000, CRC(55c44764) SHA1(7fad1f2084664b5b4d1384c8081371b0c79c4f5e) )
ROM_LOAD16_BYTE( "sp_rom8.bin", 0x60001, 0x10000, CRC(702735c9) SHA1(e4ac799dc85ff5b7c8e578611605989c78f9e8b3) )
ROM_REGION( 0x10000, "adpcm1", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm1", 0 )
ROM_LOAD( "2-1s", 0x00000, 0x10000, CRC(850406b4) SHA1(23ac1650c6d6f35607a5264b3aa89868401a645a) )
ROM_REGION( 0x10000, "adpcm2", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm2", 0 )
ROM_LOAD( "1-1u", 0x00000, 0x10000, CRC(8b3e0789) SHA1(b1450db1b1bada237c90930623e4def321099f13) )
ROM_REGION( 0x0200, "proms", 0 ) /* unknown */
ROM_REGION( 0x0200, "proms", 0 ) // unknown
ROM_LOAD( "prom05.8e", 0x0000, 0x0100, CRC(a94b18c2) SHA1(e7db4c1efc9e313e36eef3f53ae5b2e573a38920) )
ROM_LOAD( "prom10.4j", 0x0100, 0x0100, CRC(261c93bc) SHA1(942470198143d584d3766f28587d1879abd912c1) )
ROM_END
ROM_START( cabala )
ROM_REGION( 0x50000, "maincpu", 0 ) /* 64k for cpu code */
ROM_REGION( 0x50000, "maincpu", 0 )
ROM_LOAD16_BYTE( "epr-a-9.7h", 0x00000, 0x10000, CRC(00abbe0c) SHA1(bacf17444abfb4f56248ff56e37b0aa2b1a3800d) )
ROM_LOAD16_BYTE( "epr-a-7.6h", 0x00001, 0x10000, CRC(c89608db) SHA1(a56e77526227af5b693eea9ef74da0d9d57cc55c) )
ROM_LOAD16_BYTE( "epr-a-8.7k", 0x20000, 0x08000, CRC(fe84788a) SHA1(29c49ebbe62357c27befcdcc4c19841a8bf32b2d) )
@ -796,26 +1034,26 @@ ROM_START( cabala )
ROM_LOAD16_BYTE( "epr-a-6.6k", 0x20001, 0x08000, CRC(81eb1355) SHA1(bbf926d40164d78319e982da0e8fb8ec4d4f8b87) )
ROM_RELOAD(0x30001,0x08000)
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound cpu code */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "epr-a-4.3n", 0x0000, 0x2000, CRC(4038eff2) SHA1(0bcafc1b78c3bef9a0e9b822c482ea4a942fd180) )
ROM_LOAD( "epr-a-3.3p", 0x8000, 0x4000, CRC(c0097c55) SHA1(874f813c1b466dab2d15a707e340b9bdb200246c) )
ROM_REGION( 0x8000, "gfx1", 0 )
ROM_LOAD( "epr-a-5.6s", 0x00000, 0x08000, CRC(189033fd) SHA1(814f0cbc5f72345c04922d6d7c986f99d57335fa) ) /* characters */
ROM_REGION( 0x8000, "chars", 0 )
ROM_LOAD( "epr-a-5.6s", 0x00000, 0x08000, CRC(189033fd) SHA1(814f0cbc5f72345c04922d6d7c986f99d57335fa) )
ROM_REGION( 0x80000, "gfx2", 0 )
ROM_LOAD( "tad-2.7s", 0x00000, 0x80000, CRC(13ca7ae1) SHA1(b26bb4876a6518e3809e0fa4d442616508b3e7e8) ) /* tiles */
ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD( "tad-2.7s", 0x00000, 0x80000, CRC(13ca7ae1) SHA1(b26bb4876a6518e3809e0fa4d442616508b3e7e8) )
ROM_REGION( 0x80000, "gfx3", 0 )
ROM_LOAD( "tad-1.5e", 0x00000, 0x80000, CRC(8324a7fe) SHA1(aed4470df35ec18e65e35bddc9c217a5019fdcbf) ) /* sprites */
ROM_REGION( 0x80000, "sprites", 0 )
ROM_LOAD( "tad-1.5e", 0x00000, 0x80000, CRC(8324a7fe) SHA1(aed4470df35ec18e65e35bddc9c217a5019fdcbf) )
ROM_REGION( 0x10000, "adpcm1", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm1", 0 )
ROM_LOAD( "epr-a-2.1s", 0x00000, 0x10000, CRC(850406b4) SHA1(23ac1650c6d6f35607a5264b3aa89868401a645a) )
ROM_REGION( 0x10000, "adpcm2", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm2", 0 )
ROM_LOAD( "epr-a-1.1u", 0x00000, 0x10000, CRC(8b3e0789) SHA1(b1450db1b1bada237c90930623e4def321099f13) )
ROM_REGION( 0x0200, "proms", 0 ) /* unknown */
ROM_REGION( 0x0200, "proms", 0 ) // unknown
ROM_LOAD( "prom05.8e", 0x0000, 0x0100, CRC(a94b18c2) SHA1(e7db4c1efc9e313e36eef3f53ae5b2e573a38920) )
ROM_LOAD( "prom10.4j", 0x0100, 0x0100, CRC(261c93bc) SHA1(942470198143d584d3766f28587d1879abd912c1) )
ROM_END
@ -823,54 +1061,54 @@ ROM_END
ROM_START( cabaluk )
ROM_REGION( 0x50000, "maincpu", 0 ) /* 64k for cpu code */
ROM_REGION( 0x50000, "maincpu", 0 )
ROM_LOAD16_BYTE( "9-7h.bin", 0x00000, 0x10000, CRC(f66378e5) SHA1(b3802f24863f857506ae1aeddc4e5c2908810695) )
ROM_LOAD16_BYTE( "7-6h.bin", 0x00001, 0x10000, CRC(960991ac) SHA1(7e3ab0673585424206d791e8b0ed6af38e2ae8a9) )
ROM_LOAD16_BYTE( "8-7k.bin", 0x20000, 0x10000, CRC(82160ab0) SHA1(a486f30ec3068025b690da4c1ae7295e79e7cd74) )
ROM_LOAD16_BYTE( "6-6k.bin", 0x20001, 0x10000, CRC(7ef2ecc7) SHA1(43d621e2e7cfea8d906a968047817e23a3e4d047) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound cpu code */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "4-3n", 0x0000, 0x2000, CRC(4038eff2) SHA1(0bcafc1b78c3bef9a0e9b822c482ea4a942fd180) )
ROM_LOAD( "3-3p", 0x8000, 0x8000, CRC(d9defcbf) SHA1(f26b10b1dbe5aa6446f70fd18e5f1379455578ec) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "5-6s", 0x00000, 0x04000, CRC(6a76955a) SHA1(733cb4b862b5dac97c2641b58f2362471e62fcf2) ) /* characters */
ROM_REGION( 0x4000, "chars", 0 )
ROM_LOAD( "5-6s", 0x00000, 0x04000, CRC(6a76955a) SHA1(733cb4b862b5dac97c2641b58f2362471e62fcf2) )
ROM_REGION( 0x80000, "gfx2", 0 )
ROM_LOAD( "tad-2.7s", 0x00000, 0x80000, CRC(13ca7ae1) SHA1(b26bb4876a6518e3809e0fa4d442616508b3e7e8) ) /* tiles */
ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD( "tad-2.7s", 0x00000, 0x80000, CRC(13ca7ae1) SHA1(b26bb4876a6518e3809e0fa4d442616508b3e7e8) )
ROM_REGION( 0x80000, "gfx3", 0 )
ROM_LOAD( "tad-1.5e", 0x00000, 0x80000, CRC(8324a7fe) SHA1(aed4470df35ec18e65e35bddc9c217a5019fdcbf) ) /* sprites */
ROM_REGION( 0x80000, "sprites", 0 )
ROM_LOAD( "tad-1.5e", 0x00000, 0x80000, CRC(8324a7fe) SHA1(aed4470df35ec18e65e35bddc9c217a5019fdcbf) )
ROM_REGION( 0x10000, "adpcm1", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm1", 0 )
ROM_LOAD( "2-1s", 0x00000, 0x10000, CRC(850406b4) SHA1(23ac1650c6d6f35607a5264b3aa89868401a645a) )
ROM_REGION( 0x10000, "adpcm2", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm2", 0 )
ROM_LOAD( "1-1u", 0x00000, 0x10000, CRC(8b3e0789) SHA1(b1450db1b1bada237c90930623e4def321099f13) )
ROM_REGION( 0x0200, "proms", 0 ) /* unknown */
ROM_REGION( 0x0200, "proms", 0 ) // unknown
ROM_LOAD( "prom05.8e", 0x0000, 0x0100, CRC(a94b18c2) SHA1(e7db4c1efc9e313e36eef3f53ae5b2e573a38920) )
ROM_LOAD( "prom10.4j", 0x0100, 0x0100, CRC(261c93bc) SHA1(942470198143d584d3766f28587d1879abd912c1) )
ROM_END
ROM_START( cabalukj )
ROM_REGION( 0x50000, "maincpu", 0 ) /* 64k for cpu code */
ROM_REGION( 0x50000, "maincpu", 0 )
ROM_LOAD16_BYTE( "13.7h", 0x00000, 0x10000, CRC(00abbe0c) SHA1(bacf17444abfb4f56248ff56e37b0aa2b1a3800d) )
ROM_LOAD16_BYTE( "14.6h", 0x00001, 0x10000, CRC(5b04b101) SHA1(fc58b3a3854dbbf65251486a009035060349a66c) )
ROM_LOAD16_BYTE( "12.7j", 0x20000, 0x10000, CRC(d763a47c) SHA1(146d8082a404b6eddaf2dc9ba41a997949c17f8a) )
ROM_LOAD16_BYTE( "10.6j", 0x20001, 0x10000, CRC(96d5e8af) SHA1(ed7d854f08e87db5ae6cf526eafa029dfd2bfb9f) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound cpu code */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "4-3n", 0x0000, 0x2000, CRC(4038eff2) SHA1(0bcafc1b78c3bef9a0e9b822c482ea4a942fd180) )
ROM_LOAD( "3-3p", 0x8000, 0x8000, CRC(d9defcbf) SHA1(f26b10b1dbe5aa6446f70fd18e5f1379455578ec) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "5-6s", 0x00000, 0x04000, CRC(6a76955a) SHA1(733cb4b862b5dac97c2641b58f2362471e62fcf2) ) /* characters */
ROM_REGION( 0x4000, "chars", 0 )
ROM_LOAD( "5-6s", 0x00000, 0x04000, CRC(6a76955a) SHA1(733cb4b862b5dac97c2641b58f2362471e62fcf2) )
/* The Joystick versions use a sub-board instead of the mask roms
the content is the same as the mask roms */
ROM_REGION( 0x80000, "gfx2", 0 )
/* The Joystick versions use a sub-board instead of the mask ROMs
the content is the same as the mask ROMs */
ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD16_BYTE( "bg_rom1.bin", 0x00000, 0x10000, CRC(1023319b) SHA1(38fcc8159776b82779b3163329b07c61be939fae) )
ROM_LOAD16_BYTE( "bg_rom2.bin", 0x00001, 0x10000, CRC(3b6d2b09) SHA1(4cdcd22836dce4ee6348c4e6df7c6360d12ef912) )
ROM_LOAD16_BYTE( "bg_rom3.bin", 0x20000, 0x10000, CRC(420b0801) SHA1(175be6e3ca3cb98672e4cdbc9b5f5b007bc531c9) )
@ -880,7 +1118,7 @@ ROM_START( cabalukj )
ROM_LOAD16_BYTE( "bg_rom7.bin", 0x60000, 0x10000, CRC(d28d921e) SHA1(e133de5129a33ca9ff449948a959621bbfc58c11) )
ROM_LOAD16_BYTE( "bg_rom8.bin", 0x60001, 0x10000, CRC(67e4fe47) SHA1(15620fc5e985a249677da333b77331e40d2b24ab) )
ROM_REGION( 0x80000, "gfx3", 0 )
ROM_REGION( 0x80000, "sprites", 0 )
ROM_LOAD16_BYTE( "sp_rom1.bin", 0x00000, 0x10000, CRC(34d3cac8) SHA1(a6a2304fb576267db2c72cfbf0a3f66740ebe60e) )
ROM_LOAD16_BYTE( "sp_rom2.bin", 0x00001, 0x10000, CRC(4e49c28e) SHA1(ea74443a9423b14611a1f97e44692badfedd0ead) )
ROM_LOAD16_BYTE( "sp_rom3.bin", 0x20000, 0x10000, CRC(7065e840) SHA1(baa8cd28be60c678d782ecfabde6cd5e36480415) )
@ -890,75 +1128,75 @@ ROM_START( cabalukj )
ROM_LOAD16_BYTE( "sp_rom7.bin", 0x60000, 0x10000, CRC(55c44764) SHA1(7fad1f2084664b5b4d1384c8081371b0c79c4f5e) )
ROM_LOAD16_BYTE( "sp_rom8.bin", 0x60001, 0x10000, CRC(702735c9) SHA1(e4ac799dc85ff5b7c8e578611605989c78f9e8b3) )
ROM_REGION( 0x10000, "adpcm1", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm1", 0 )
ROM_LOAD( "2-1s", 0x00000, 0x10000, CRC(850406b4) SHA1(23ac1650c6d6f35607a5264b3aa89868401a645a) )
ROM_REGION( 0x10000, "adpcm2", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm2", 0 )
ROM_LOAD( "1-1u", 0x00000, 0x10000, CRC(8b3e0789) SHA1(b1450db1b1bada237c90930623e4def321099f13) )
ROM_REGION( 0x0200, "proms", 0 ) /* unknown */
ROM_REGION( 0x0200, "proms", 0 ) // unknown
ROM_LOAD( "prom05.8e", 0x0000, 0x0100, CRC(a94b18c2) SHA1(e7db4c1efc9e313e36eef3f53ae5b2e573a38920) )
ROM_LOAD( "prom10.4j", 0x0100, 0x0100, CRC(261c93bc) SHA1(942470198143d584d3766f28587d1879abd912c1) )
ROM_END
ROM_START( cabalus )
ROM_REGION( 0x50000, "maincpu", 0 ) /* 64k for cpu code */
ROM_REGION( 0x50000, "maincpu", 0 )
ROM_LOAD16_BYTE( "h7_512.bin", 0x00000, 0x10000, CRC(8fe16fb4) SHA1(fedb2d0c6c21516f68cfa99093772fe8fa862389) )
ROM_LOAD16_BYTE( "h6_512.bin", 0x00001, 0x10000, CRC(6968101c) SHA1(d65005ac235dae5c32bbcd182cb365e8fa067fe7) )
ROM_LOAD16_BYTE( "k7_512.bin", 0x20000, 0x10000, CRC(562031a2) SHA1(ed5ef50a66c7797a7f345e479162cf83d6777f7c) )
ROM_LOAD16_BYTE( "k6_512.bin", 0x20001, 0x10000, CRC(4fda2856) SHA1(a213cb7443cdccbad3f2610e8d42b2e149cbedb9) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound cpu code */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "4-3n", 0x0000, 0x2000, CRC(4038eff2) SHA1(0bcafc1b78c3bef9a0e9b822c482ea4a942fd180) )
ROM_LOAD( "3-3p", 0x8000, 0x8000, CRC(d9defcbf) SHA1(f26b10b1dbe5aa6446f70fd18e5f1379455578ec) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "t6_128.bin", 0x00000, 0x04000, CRC(1ccee214) SHA1(7c842bc1c6002ec90693160fd5407345092420bb) ) /* characters */
ROM_REGION( 0x4000, "chars", 0 )
ROM_LOAD( "t6_128.bin", 0x00000, 0x04000, CRC(1ccee214) SHA1(7c842bc1c6002ec90693160fd5407345092420bb) )
ROM_REGION( 0x80000, "gfx2", 0 )
ROM_LOAD( "tad-2.7s", 0x00000, 0x80000, CRC(13ca7ae1) SHA1(b26bb4876a6518e3809e0fa4d442616508b3e7e8) ) /* tiles */
ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD( "tad-2.7s", 0x00000, 0x80000, CRC(13ca7ae1) SHA1(b26bb4876a6518e3809e0fa4d442616508b3e7e8) )
ROM_REGION( 0x80000, "gfx3", 0 )
ROM_LOAD( "tad-1.5e", 0x00000, 0x80000, CRC(8324a7fe) SHA1(aed4470df35ec18e65e35bddc9c217a5019fdcbf) ) /* sprites */
ROM_REGION( 0x80000, "sprites", 0 )
ROM_LOAD( "tad-1.5e", 0x00000, 0x80000, CRC(8324a7fe) SHA1(aed4470df35ec18e65e35bddc9c217a5019fdcbf) )
ROM_REGION( 0x10000, "adpcm1", 0 ) /* Samples? */
ROM_REGION( 0x10000, "adpcm1", 0 )
ROM_LOAD( "2-1s", 0x00000, 0x10000, CRC(850406b4) SHA1(23ac1650c6d6f35607a5264b3aa89868401a645a) )
ROM_REGION( 0x10000, "adpcm2", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm2", 0 )
ROM_LOAD( "1-1u", 0x00000, 0x10000, CRC(8b3e0789) SHA1(b1450db1b1bada237c90930623e4def321099f13) )
ROM_REGION( 0x0200, "proms", 0 ) /* unknown */
ROM_REGION( 0x0200, "proms", 0 ) // unknown
ROM_LOAD( "prom05.8e", 0x0000, 0x0100, CRC(a94b18c2) SHA1(e7db4c1efc9e313e36eef3f53ae5b2e573a38920) )
ROM_LOAD( "prom10.4j", 0x0100, 0x0100, CRC(261c93bc) SHA1(942470198143d584d3766f28587d1879abd912c1) )
ROM_END
ROM_START( cabalus2 )
ROM_REGION( 0x50000, "maincpu", 0 ) /* 64k for cpu code */
ROM_REGION( 0x50000, "maincpu", 0 )
ROM_LOAD16_BYTE( "9-7h", 0x00000, 0x10000, CRC(ebbb9484) SHA1(2c77d5b4acdc37720dc7ccab526862981bf8da51) )
ROM_LOAD16_BYTE( "7-6h", 0x00001, 0x10000, CRC(51aeb49e) SHA1(df38dc58d8c6fa3d35904bf34e29111e7bd523ad) )
ROM_LOAD16_BYTE( "8-7k", 0x20000, 0x10000, CRC(4c24ed9a) SHA1(f0fc25c3e7dc8ac71fdad3e91ab618cd7a037123) )
ROM_LOAD16_BYTE( "6-6k", 0x20001, 0x10000, CRC(681620e8) SHA1(c9eacfb55059986dbecc2fae1339069a852f917b) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound cpu code */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "4-3n", 0x0000, 0x2000, CRC(4038eff2) SHA1(0bcafc1b78c3bef9a0e9b822c482ea4a942fd180) )
ROM_LOAD( "3-3p", 0x8000, 0x8000, CRC(d9defcbf) SHA1(f26b10b1dbe5aa6446f70fd18e5f1379455578ec) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "5-6s", 0x00000, 0x04000, CRC(6a76955a) SHA1(733cb4b862b5dac97c2641b58f2362471e62fcf2) ) /* characters */
ROM_REGION( 0x4000, "chars", 0 )
ROM_LOAD( "5-6s", 0x00000, 0x04000, CRC(6a76955a) SHA1(733cb4b862b5dac97c2641b58f2362471e62fcf2) )
ROM_REGION( 0x80000, "gfx2", 0 )
ROM_LOAD( "tad-2.7s", 0x00000, 0x80000, CRC(13ca7ae1) SHA1(b26bb4876a6518e3809e0fa4d442616508b3e7e8) ) /* tiles */
ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD( "tad-2.7s", 0x00000, 0x80000, CRC(13ca7ae1) SHA1(b26bb4876a6518e3809e0fa4d442616508b3e7e8) )
ROM_REGION( 0x80000, "gfx3", 0 )
ROM_LOAD( "tad-1.5e", 0x00000, 0x80000, CRC(8324a7fe) SHA1(aed4470df35ec18e65e35bddc9c217a5019fdcbf) ) /* sprites */
ROM_REGION( 0x80000, "sprites", 0 )
ROM_LOAD( "tad-1.5e", 0x00000, 0x80000, CRC(8324a7fe) SHA1(aed4470df35ec18e65e35bddc9c217a5019fdcbf) )
ROM_REGION( 0x10000, "adpcm1", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm1", 0 )
ROM_LOAD( "2-1s", 0x00000, 0x10000, CRC(850406b4) SHA1(23ac1650c6d6f35607a5264b3aa89868401a645a) )
ROM_REGION( 0x10000, "adpcm2", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm2", 0 )
ROM_LOAD( "1-1u", 0x00000, 0x10000, CRC(8b3e0789) SHA1(b1450db1b1bada237c90930623e4def321099f13) )
ROM_REGION( 0x0200, "proms", 0 ) /* unknown */
ROM_REGION( 0x0200, "proms", 0 ) // unknown
ROM_LOAD( "prom05.8e", 0x0000, 0x0100, CRC(a94b18c2) SHA1(e7db4c1efc9e313e36eef3f53ae5b2e573a38920) )
ROM_LOAD( "prom10.4j", 0x0100, 0x0100, CRC(261c93bc) SHA1(942470198143d584d3766f28587d1879abd912c1) )
ROM_END
@ -1000,21 +1238,21 @@ Note: The bootleg has *3* Z80s
*/
ROM_START( cabalbl )
ROM_REGION( 0x50000, "maincpu", 0 ) /* 64k for cpu code */
ROM_REGION( 0x50000, "maincpu", 0 )
ROM_LOAD16_BYTE( "cabal_24.bin", 0x00000, 0x10000, CRC(00abbe0c) SHA1(bacf17444abfb4f56248ff56e37b0aa2b1a3800d) )
ROM_LOAD16_BYTE( "cabal_22.bin", 0x00001, 0x10000, CRC(78c4af27) SHA1(31049d1ec76d76284682de7a0592f63d97019240) )
ROM_LOAD16_BYTE( "cabal_23.bin", 0x20000, 0x10000, CRC(d763a47c) SHA1(146d8082a404b6eddaf2dc9ba41a997949c17f8a) )
ROM_LOAD16_BYTE( "cabal_21.bin", 0x20001, 0x10000, CRC(96d5e8af) SHA1(ed7d854f08e87db5ae6cf526eafa029dfd2bfb9f) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound cpu code */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "cabal_11.bin", 0x0000, 0x10000, CRC(d308a543) SHA1(4f45db42512f83266001daee55d06f49e7908e35) )
ROM_REGION( 0x8000, "gfx1", 0 )
ROM_LOAD( "cabal_20.bin", 0x00000, 0x08000, CRC(189033fd) SHA1(814f0cbc5f72345c04922d6d7c986f99d57335fa) ) /* characters */
ROM_REGION( 0x8000, "chars", 0 )
ROM_LOAD( "cabal_20.bin", 0x00000, 0x08000, CRC(189033fd) SHA1(814f0cbc5f72345c04922d6d7c986f99d57335fa) )
/* The bootleg versions use a sub-board instead of the mask roms
the content is the same as the mask roms */
ROM_REGION( 0x80000, "gfx2", 0 )
/* The bootleg versions use a sub-board instead of the mask ROMs
the content is the same as the mask ROMs */
ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD16_BYTE( "cabal_15.bin", 0x00000, 0x10000, CRC(1023319b) SHA1(38fcc8159776b82779b3163329b07c61be939fae) )
ROM_LOAD16_BYTE( "cabal_17.bin", 0x00001, 0x10000, CRC(3b6d2b09) SHA1(4cdcd22836dce4ee6348c4e6df7c6360d12ef912) )
ROM_LOAD16_BYTE( "cabal_14.bin", 0x20000, 0x10000, CRC(420b0801) SHA1(175be6e3ca3cb98672e4cdbc9b5f5b007bc531c9) )
@ -1024,7 +1262,7 @@ ROM_START( cabalbl )
ROM_LOAD16_BYTE( "cabal_13.bin", 0x60000, 0x10000, CRC(d28d921e) SHA1(e133de5129a33ca9ff449948a959621bbfc58c11) )
ROM_LOAD16_BYTE( "cabal_19.bin", 0x60001, 0x10000, CRC(67e4fe47) SHA1(15620fc5e985a249677da333b77331e40d2b24ab) )
ROM_REGION( 0x80000, "gfx3", 0 )
ROM_REGION( 0x80000, "sprites", 0 )
ROM_LOAD16_BYTE( "cabal_04.bin", 0x00000, 0x10000, CRC(34d3cac8) SHA1(a6a2304fb576267db2c72cfbf0a3f66740ebe60e) )
ROM_LOAD16_BYTE( "cabal_05.bin", 0x00001, 0x10000, CRC(4e49c28e) SHA1(ea74443a9423b14611a1f97e44692badfedd0ead) )
ROM_LOAD16_BYTE( "cabal_03.bin", 0x20000, 0x10000, CRC(7065e840) SHA1(baa8cd28be60c678d782ecfabde6cd5e36480415) )
@ -1035,36 +1273,36 @@ ROM_START( cabalbl )
ROM_LOAD16_BYTE( "cabal_08.bin", 0x60001, 0x10000, CRC(702735c9) SHA1(e4ac799dc85ff5b7c8e578611605989c78f9e8b3) )
ROM_REGION( 0x10000, "adpcm_1", 0 )
ROM_LOAD( "cabal_09.bin", 0x00000, 0x10000, CRC(4ffa7fe3) SHA1(381d8e765a7b94678fb3308965c748bbe9f8e247) ) /* Z80 code/adpcm data */
ROM_LOAD( "cabal_09.bin", 0x00000, 0x10000, CRC(4ffa7fe3) SHA1(381d8e765a7b94678fb3308965c748bbe9f8e247) ) // Z80 code/ADPCM data
ROM_REGION( 0x10000, "adpcm_2", 0 )
ROM_LOAD( "cabal_10.bin", 0x00000, 0x10000, CRC(958789b6) SHA1(344c3ee8a1e272b56499e5c0415bb714aec0ddcf) ) /* Z80 code/adpcm data */
ROM_LOAD( "cabal_10.bin", 0x00000, 0x10000, CRC(958789b6) SHA1(344c3ee8a1e272b56499e5c0415bb714aec0ddcf) ) // Z80 code/ADPCM data
ROM_END
// alternate bootleg
// this is much closer to the original, the only real difference is the soundcpu has been pre-decrypted,
// with the encrypted/decrypted data split across the rom
// this is much closer to the original, the only real difference is the sound CPU has been pre-decrypted,
// with the encrypted/decrypted data split across the ROM
// based on stickers present on the board it appears to have been manufactured by 'TAB-Austria' and is marked 'CA02'
ROM_START( cabalbl2 )
ROM_REGION( 0x40000, "maincpu", 0 ) /* 64k for cpu code */
ROM_REGION( 0x40000, "maincpu", 0 )
ROM_LOAD16_BYTE( "c9.bin", 0x00000, 0x10000, CRC(00abbe0c) SHA1(bacf17444abfb4f56248ff56e37b0aa2b1a3800d) )
ROM_LOAD16_BYTE( "c7.bin", 0x00001, 0x10000, CRC(44736281) SHA1(1d6da95ef96d9c02aea70791e1cb87b70097d5ed) )
ROM_LOAD16_BYTE( "c8.bin", 0x20000, 0x10000, CRC(d763a47c) SHA1(146d8082a404b6eddaf2dc9ba41a997949c17f8a) )
ROM_LOAD16_BYTE( "c6.bin", 0x20001, 0x10000, CRC(96d5e8af) SHA1(ed7d854f08e87db5ae6cf526eafa029dfd2bfb9f) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound cpu code */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "c4.bin", 0x2000, 0x2000, CRC(82f9f296) SHA1(2769ffdc28f003684e77d4806be07b87d50be31c) )
ROM_CONTINUE(0x0000,0x2000)
ROM_IGNORE(0x4000)
ROM_LOAD( "c3.bin", 0x8000, 0x8000, CRC(d9defcbf) SHA1(f26b10b1dbe5aa6446f70fd18e5f1379455578ec) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "c5.bin", 0x00000, 0x04000, CRC(183e4834) SHA1(05ab0c388be8701930a9de437978206cda6fed68) ) /* characters */
ROM_REGION( 0x4000, "chars", 0 )
ROM_LOAD( "c5.bin", 0x00000, 0x04000, CRC(183e4834) SHA1(05ab0c388be8701930a9de437978206cda6fed68) )
ROM_CONTINUE(0x0000,0x4000)
ROM_REGION( 0x80000, "gfx2", 0 )
ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD16_BYTE( "c14.bin", 0x00000, 0x10000, CRC(1023319b) SHA1(38fcc8159776b82779b3163329b07c61be939fae) )
ROM_LOAD16_BYTE( "c10.bin", 0x00001, 0x10000, CRC(3b6d2b09) SHA1(4cdcd22836dce4ee6348c4e6df7c6360d12ef912) )
ROM_LOAD16_BYTE( "c15.bin", 0x20000, 0x10000, CRC(420b0801) SHA1(175be6e3ca3cb98672e4cdbc9b5f5b007bc531c9) )
@ -1074,7 +1312,7 @@ ROM_START( cabalbl2 )
ROM_LOAD16_BYTE( "c17.bin", 0x60000, 0x10000, CRC(d28d921e) SHA1(e133de5129a33ca9ff449948a959621bbfc58c11) )
ROM_LOAD16_BYTE( "c13.bin", 0x60001, 0x10000, CRC(67e4fe47) SHA1(15620fc5e985a249677da333b77331e40d2b24ab) )
ROM_REGION( 0x80000, "gfx3", 0 )
ROM_REGION( 0x80000, "sprites", 0 )
ROM_LOAD16_BYTE( "c18.bin", 0x00000, 0x10000, CRC(34d3cac8) SHA1(a6a2304fb576267db2c72cfbf0a3f66740ebe60e) )
ROM_LOAD16_BYTE( "c22.bin", 0x00001, 0x10000, CRC(4e49c28e) SHA1(ea74443a9423b14611a1f97e44692badfedd0ead) )
ROM_LOAD16_BYTE( "c19.bin", 0x20000, 0x10000, CRC(7065e840) SHA1(baa8cd28be60c678d782ecfabde6cd5e36480415) )
@ -1084,10 +1322,10 @@ ROM_START( cabalbl2 )
ROM_LOAD16_BYTE( "c21.bin", 0x60000, 0x10000, CRC(55c44764) SHA1(7fad1f2084664b5b4d1384c8081371b0c79c4f5e) )
ROM_LOAD16_BYTE( "c25.bin", 0x60001, 0x10000, CRC(702735c9) SHA1(e4ac799dc85ff5b7c8e578611605989c78f9e8b3) )
ROM_REGION( 0x10000, "adpcm1", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm1", 0 )
ROM_LOAD( "c2.bin", 0x00000, 0x10000, CRC(850406b4) SHA1(23ac1650c6d6f35607a5264b3aa89868401a645a) )
ROM_REGION( 0x10000, "adpcm2", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm2", 0 )
ROM_LOAD( "c1.bin", 0x00000, 0x10000, CRC(8b3e0789) SHA1(b1450db1b1bada237c90930623e4def321099f13) )
ROM_END
@ -1098,13 +1336,15 @@ void cabal_state::init_cabal()
m_adpcm[1]->decrypt();
}
} // anonymous namespace
GAME( 1988, cabal, 0, cabal, cabalj, cabal_state, init_cabal, ROT0, "TAD Corporation", "Cabal (World, Joystick)", MACHINE_SUPPORTS_SAVE )
GAME( 1989, cabala, cabal, cabal, cabalj, cabal_state, init_cabal, ROT0, "TAD Corporation (Alpha Trading license)", "Cabal (Korea?, Joystick)", MACHINE_SUPPORTS_SAVE ) // Korea?
GAME( 1989, cabalukj, cabal, cabal, cabalj, cabal_state, init_cabal, ROT0, "TAD Corporation (Electrocoin license)", "Cabal (UK, Joystick)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, cabal, 0, cabal, cabalj, cabal_state, init_cabal, ROT0, "TAD Corporation", "Cabal (World, Joystick)", MACHINE_SUPPORTS_SAVE )
GAME( 1989, cabala, cabal, cabal, cabalj, cabal_state, init_cabal, ROT0, "TAD Corporation (Alpha Trading license)", "Cabal (Korea?, Joystick)", MACHINE_SUPPORTS_SAVE ) // Korea?
GAME( 1989, cabalukj, cabal, cabal, cabalj, cabal_state, init_cabal, ROT0, "TAD Corporation (Electrocoin license)", "Cabal (UK, Joystick)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, cabalbl, cabal, cabalbl, cabalbl, cabalbl_state, empty_init, ROT0, "bootleg (Red Corporation)", "Cabal (bootleg of Joystick version, set 1, alternate sound hardware)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
GAME( 1988, cabalbl2, cabal, cabalbl2, cabalj, cabal_state, init_cabal, ROT0, "bootleg", "Cabal (bootleg of Joystick version, set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, cabalbl2, cabal, cabalbl2, cabalj, cabal_state, init_cabal, ROT0, "bootleg", "Cabal (bootleg of Joystick version, set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, cabalus, cabal, cabalt, cabalt, cabal_state, init_cabal, ROT0, "TAD Corporation (Fabtek license)", "Cabal (US set 1, Trackball)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, cabalus2, cabal, cabalt, cabalt, cabal_state, init_cabal, ROT0, "TAD Corporation (Fabtek license)", "Cabal (US set 2, Trackball)", MACHINE_SUPPORTS_SAVE )
GAME( 1989, cabaluk, cabal, cabalt, cabalt, cabal_state, init_cabal, ROT0, "TAD Corporation (Electrocoin license)", "Cabal (UK, Trackball)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, cabalus, cabal, cabalt, cabalt, cabal_state, init_cabal, ROT0, "TAD Corporation (Fabtek license)", "Cabal (US set 1, Trackball)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, cabalus2, cabal, cabalt, cabalt, cabal_state, init_cabal, ROT0, "TAD Corporation (Fabtek license)", "Cabal (US set 2, Trackball)", MACHINE_SUPPORTS_SAVE )
GAME( 1989, cabaluk, cabal, cabalt, cabalt, cabal_state, init_cabal, ROT0, "TAD Corporation (Electrocoin license)", "Cabal (UK, Trackball)", MACHINE_SUPPORTS_SAVE )

View File

@ -1,118 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Carlos A. Lozano
#ifndef MAME_SEIBU_CABAL_H
#define MAME_SEIBU_CABAL_H
#pragma once
#include "seibusound.h"
#include "sound/msm5205.h"
#include "emupal.h"
#include "tilemap.h"
class cabal_base_state : public driver_device
{
public:
cabal_base_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_msm(*this, "msm%u", 1U),
m_spriteram(*this, "spriteram"),
m_colorram(*this, "colorram"),
m_videoram(*this, "videoram")
{ }
protected:
virtual void video_start() override;
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device_array<msm5205_device, 2> m_msm;
void flipscreen_w(uint8_t data);
void background_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void text_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
private:
required_shared_ptr<uint16_t> m_spriteram;
required_shared_ptr<uint16_t> m_colorram;
required_shared_ptr<uint16_t> m_videoram;
tilemap_t *m_background_layer = nullptr;
tilemap_t *m_text_layer = nullptr;
TILE_GET_INFO_MEMBER(get_back_tile_info);
TILE_GET_INFO_MEMBER(get_text_tile_info);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
};
class cabal_state : public cabal_base_state
{
public:
cabal_state(const machine_config &mconfig, device_type type, const char *tag) :
cabal_base_state(mconfig, type, tag),
m_seibu_sound(*this, "seibu_sound"),
m_adpcm(*this, "adpcm%u", 1U)
{ }
void cabal(machine_config &config);
void cabalbl2(machine_config &config);
void cabalt(machine_config &config);
void init_cabal();
private:
required_device<seibu_sound_device> m_seibu_sound;
required_device_array<seibu_adpcm_device, 2> m_adpcm;
void sound_irq_trigger_word_w(offs_t, u16 data, u16 mem_mask);
void main_map(address_map &map);
void sound_decrypted_opcodes_map(address_map &map);
void sound_map(address_map &map);
void trackball_main_map(address_map &map);
void cabalbl2_predecrypted_opcodes_map(address_map &map);
void cabalbl2_sound_map(address_map &map);
};
class cabalbl_state : public cabal_base_state
{
public:
cabalbl_state(const machine_config &mconfig, device_type type, const char *tag) :
cabal_base_state(mconfig, type, tag)
{ }
void cabalbl(machine_config &config);
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
private:
int m_sound_command[2]{};
void sndcmd_w(offs_t offset, uint16_t data);
void sound_irq_trigger_word_w(uint16_t data);
template<uint8_t Which> uint8_t snd_r();
void coin_w(uint8_t data);
template<uint8_t Which> void adpcm_w(uint8_t data);
void main_map(address_map &map);
void sound_map(address_map &map);
void talk1_map(address_map &map);
void talk1_portmap(address_map &map);
void talk2_map(address_map &map);
void talk2_portmap(address_map &map);
};
#endif // MAME_SEIBU_CABAL_H

View File

@ -1,139 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Carlos A. Lozano
/***************************************************************************
cabal.cpp
Functions to emulate the video hardware of the machine.
***************************************************************************/
#include "emu.h"
#include "cabal.h"
TILE_GET_INFO_MEMBER(cabal_base_state::get_back_tile_info)
{
int tile = m_videoram[tile_index];
int color = (tile>>12)&0xf;
tile &= 0xfff;
tileinfo.set(1,
tile,
color,
0);
}
TILE_GET_INFO_MEMBER(cabal_base_state::get_text_tile_info)
{
int tile = m_colorram[tile_index];
int color = (tile>>10);
tile &= 0x3ff;
tileinfo.set(0,
tile,
color,
0);
}
void cabal_base_state::video_start()
{
m_background_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cabal_base_state::get_back_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
m_text_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cabal_base_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_text_layer->set_transparent_pen(3);
m_background_layer->set_transparent_pen(15);
}
/**************************************************************************/
void cabal_base_state::flipscreen_w(uint8_t data)
{
int flip = (data & 0x20) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0;
m_background_layer->set_flip(flip);
m_text_layer->set_flip(flip);
flip_screen_set(data & 0x20);
}
void cabal_base_state::background_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_videoram[offset]);
m_background_layer->mark_tile_dirty(offset);
}
void cabal_base_state::text_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_colorram[offset]);
m_text_layer->mark_tile_dirty(offset);
}
/********************************************************************
Cabal Spriteram
---------------
+0 .......x ........ Sprite enable bit
+0 ........ xxxxxxxx Sprite Y coordinate
+1 ..??.... ........ ??? unknown ???
+1 ....xxxx xxxxxxxx Sprite tile number
+2 .xxxx... ........ Sprite color bank
+2 .....x.. ........ Sprite flip x
+2 .......x xxxxxxxx Sprite X coordinate
+3 (unused)
-------E YYYYYYYY
----BBTT TTTTTTTT
-CCCCF-X XXXXXXXX
-------- --------
********************************************************************/
void cabal_base_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
for( int offs = m_spriteram.bytes()/2 - 4; offs >= 0; offs -= 4 )
{
int data0 = m_spriteram[offs];
int data1 = m_spriteram[offs+1];
int data2 = m_spriteram[offs+2];
if( data0 & 0x100 )
{
int tile_number = data1 & 0xfff;
int color = ( data2 & 0x7800 ) >> 11;
int sy = ( data0 & 0xff );
int sx = ( data2 & 0x1ff );
int flipx = ( data2 & 0x0400 );
int flipy = 0;
if ( sx>256 ) sx -= 512;
if (flip_screen())
{
sx = 240 - sx;
sy = 240 - sy;
flipx = !flipx;
flipy = !flipy;
}
m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
tile_number,
color,
flipx,flipy,
sx,sy,0xf );
}
}
}
uint32_t cabal_base_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_background_layer->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
draw_sprites(bitmap,cliprect);
m_text_layer->draw(screen, bitmap, cliprect, 0,0);
return 0;
}

View File

@ -1,5 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:David Haywood, Nicola Salmoria, Tomasz Slanina
// copyright-holders: David Haywood, Nicola Salmoria, Tomasz Slanina
/*
***********************************************************************************
Dark Mist (c)1986 Taito / Seibu
@ -11,7 +12,7 @@ driver by
Tomasz Slanina
Main CPU : z80 (with encryption, external to z80)
Sound CPU: custom T5182 cpu (like seibu sound system but with internal code)
Sound CPU: custom T5182 CPU (like Seibu sound system but with internal code)
The SEI8608B sound board, which features the T5182 "CPU CUSTOM" and YM2151, also
has unpopulated locations for a 76489AN, 2x MSM5205, 2x 27512 EPROM (presumably
@ -21,58 +22,328 @@ $e000 - coins (two bytes)
$e2b7 - player 1 energy
TODO:
- when player soaks in water, color pen used is wrong (entry 1 at 0xf500 should be 0x0c and instead is 0x14), might be btanb?
- when player soaks in water, color pen used is wrong (entry 1 at 0xf500 should be 0x0c and instead is 0x14), might be BTANB?
- cocktail mode
- unknown bit in sprite attr (there's code used for OR-ing sprite attrib with some
value (taken from ram) when one of coords is greater than 256-16 )
value (taken from RAM) when one of coords is greater than 256-16 )
***********************************************************************************
*/
#include "emu.h"
#include "darkmist.h"
#include "t5182.h"
#include "cpu/z80/z80.h"
#include "machine/timer.h"
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
#include "tilemap.h"
namespace {
class darkmist_state : public driver_device
{
public:
darkmist_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_t5182(*this, "t5182"),
m_screen(*this, "screen"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_spritebank(*this, "spritebank"),
m_scroll(*this, "scroll"),
m_videoram(*this, "videoram"),
m_spriteram(*this, "spriteram"),
m_bg_clut(*this, "bg_clut"),
m_fg_clut(*this, "fg_clut"),
m_spr_clut(*this, "spr_clut"),
m_tx_clut(*this, "tx_clut"),
m_decrypted_opcodes(*this, "decrypted_opcodes"),
m_rombank(*this, "rombank")
{ }
void darkmist(machine_config &config);
void init_darkmist();
protected:
virtual void machine_start() override;
virtual void video_start() override;
private:
required_device<cpu_device> m_maincpu;
required_device<t5182_device> m_t5182;
required_device<screen_device> m_screen;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_shared_ptr<uint8_t> m_spritebank;
required_shared_ptr<uint8_t> m_scroll;
required_shared_ptr<uint8_t> m_videoram;
required_shared_ptr<uint8_t> m_spriteram;
required_region_ptr<uint8_t> m_bg_clut;
required_region_ptr<uint8_t> m_fg_clut;
required_region_ptr<uint8_t> m_spr_clut;
required_region_ptr<uint8_t> m_tx_clut;
required_shared_ptr<uint8_t> m_decrypted_opcodes;
required_memory_bank m_rombank;
uint8_t m_hw = 0;
tilemap_t *m_bgtilemap = nullptr;
tilemap_t *m_fgtilemap = nullptr;
tilemap_t *m_txtilemap = nullptr;
void hw_w(uint8_t data);
void tx_vram_w(offs_t offset, uint8_t data);
TILE_GET_INFO_MEMBER(get_bgtile_info);
TILE_GET_INFO_MEMBER(get_fgtile_info);
TILE_GET_INFO_MEMBER(get_txttile_info);
void palette(palette_device &palette) const;
bitmap_ind16 m_temp_bitmap;
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void mix_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *clut);
void decrypt_fgbgtiles(uint8_t *rgn, int size);
void decrypt_gfx();
void decrypt_snd();
TIMER_DEVICE_CALLBACK_MEMBER(scanline);
void decrypted_opcodes_map(address_map &map);
void memmap(address_map &map);
};
// video
TILE_GET_INFO_MEMBER(darkmist_state::get_bgtile_info)
{
int code = memregion("bg_map")->base()[tile_index * 2]; // TTTTTTTT
int const attr = memregion("bg_map")->base()[(tile_index * 2) + 1]; // -PPP--TT - FIXED BITS (0xxx00xx)
code += (attr & 3) << 8;
int const pal = (attr >> 4) & 0xf;
tileinfo.set(1, code, pal, 0);
}
TILE_GET_INFO_MEMBER(darkmist_state::get_fgtile_info)
{
int code = memregion("fg_map")->base()[tile_index * 2]; // TTTTTTTT
int const attr = memregion("fg_map")->base()[(tile_index * 2) + 1]; // -PPP--TT - FIXED BITS (0xxx00xx)
code += (attr & 3) << 8;
int const pal = (attr >> 4) & 0xf;
tileinfo.set(2, code, pal, 0);
}
TILE_GET_INFO_MEMBER(darkmist_state::get_txttile_info)
{
int code = m_videoram[tile_index];
int const attr = m_videoram[tile_index + 0x400];
int const pal = (attr >> 1);
code += (attr & 1) << 8;
tileinfo.set(0, code, pal & 0xf, 0);
}
void darkmist_state::palette(palette_device &palette) const
{
//palette.set_indirect_color(0x100, rgb_t::black());
std::pair<uint8_t const *, uint8_t> const planes[4]{
{ &m_bg_clut[0], 0x80 },
{ &m_fg_clut[0], 0x00 },
{ &m_spr_clut[0], 0x40 },
{ &m_tx_clut[0], 0xc0 } };
for (unsigned plane = 0; std::size(planes) > plane; ++plane)
{
for (unsigned i = 0; 0x100 > i; ++i)
{
uint8_t const clut = planes[plane].first[i];
// if (clut & 0x40) // 0x40 indicates transparent pen
// ctabentry = 0x100;
// else
int const ctabentry = (clut & 0x3f) | planes[plane].second;
palette.set_pen_indirect((plane << 8) | i, ctabentry);
}
}
}
void darkmist_state::video_start()
{
m_bgtilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(darkmist_state::get_bgtile_info)), TILEMAP_SCAN_ROWS, 16, 16, 512, 64);
m_fgtilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(darkmist_state::get_fgtile_info)), TILEMAP_SCAN_ROWS, 16, 16, 64, 256);
m_txtilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(darkmist_state::get_txttile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
// m_fgtilemap->set_transparent_pen(0);
// m_txtilemap->set_transparent_pen(0);
save_item(NAME(m_hw));
m_screen->register_screen_bitmap(m_temp_bitmap);
}
// TODO: move this code into framework or substitute with a valid alternative
void darkmist_state::mix_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *clut)
{
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
{
uint16_t *const dest = &bitmap.pix(y);
uint16_t const *const src = &m_temp_bitmap.pix(y);
for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
{
uint16_t const pix = (src[x] & 0xff);
uint16_t const real = clut[pix];
if (!(real & 0x40))
dest[x] = src[x];
}
}
}
/*
Sprites
76543210
0 - TTTT TTTT - tile
1 - xyBP PPP? - palette (P), flips (x,y), B - use spritebank,
? - unknown, according to gamecode top bit of one of coords(y/x)
2 - YYYY YYYY - y coord
3 - XXXX XXXX - x coord
*/
void darkmist_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// fetch from top to bottom
for (int i = m_spriteram.bytes() - 32; i >= 0; i -= 32)
{
int const fy = m_spriteram[i + 1] & 0x40;
int const fx = m_spriteram[i + 1] & 0x80;
int tile = m_spriteram[i + 0];
if (m_spriteram[i + 1] & 0x20)
tile += (*m_spritebank << 8);
int palette = ((m_spriteram[i + 1]) >> 1) & 0xf;
if (m_spriteram[i + 1] & 0x1)
palette = machine().rand() & 15;
m_gfxdecode->gfx(3)->transpen(
bitmap, cliprect,
tile,
palette,
fx, fy,
m_spriteram[i + 3], m_spriteram[i + 2], 0);
}
}
uint32_t darkmist_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// vis. flags
constexpr int DISPLAY_SPR = 1;
constexpr int DISPLAY_FG = 2; // 2 or 8
constexpr int DISPLAY_BG = 4;
constexpr int DISPLAY_TXT = 16;
#define DM_GETSCROLL(n) (((m_scroll[(n)] << 1) & 0xff) + ((m_scroll[(n)] & 0x80) ? 1 : 0) +( ((m_scroll[(n) - 1] << 4) | (m_scroll[(n) - 1] << 12)) & 0xff00))
m_bgtilemap->set_scrollx(0, DM_GETSCROLL(0x2));
m_bgtilemap->set_scrolly(0, DM_GETSCROLL(0x6));
m_fgtilemap->set_scrollx(0, DM_GETSCROLL(0xa));
m_fgtilemap->set_scrolly(0, DM_GETSCROLL(0xe));
m_temp_bitmap.fill(0, cliprect);
bitmap.fill(m_palette->black_pen(), cliprect);
if (m_hw & DISPLAY_BG)
{
m_bgtilemap->draw(screen, m_temp_bitmap, cliprect, 0, 0);
mix_layer(screen, bitmap, cliprect, m_bg_clut);
}
if (m_hw & DISPLAY_FG)
{
m_fgtilemap->draw(screen, m_temp_bitmap, cliprect, 0, 0);
mix_layer(screen, bitmap, cliprect, m_fg_clut);
}
if (m_hw & DISPLAY_SPR)
{
draw_sprites(m_temp_bitmap, cliprect);
mix_layer(screen, bitmap, cliprect, m_spr_clut);
}
if (m_hw & DISPLAY_TXT)
{
m_txtilemap->draw(screen, m_temp_bitmap, cliprect, 0, 0);
mix_layer(screen, bitmap, cliprect, m_tx_clut);
}
return 0;
}
void darkmist_state::tx_vram_w(offs_t offset, uint8_t data)
{
m_videoram[offset] = data;
m_txtilemap->mark_tile_dirty(offset & 0x3ff);
}
// machine
void darkmist_state::machine_start()
{
membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x4000);
m_rombank->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x4000);
}
void darkmist_state::hw_w(uint8_t data)
{
m_hw=data;
membank("bank1")->set_entry((data&0x80)?1:0);
m_hw = data;
m_rombank->set_entry(BIT(data, 7));
}
void darkmist_state::memmap(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0xbfff).bankr("bank1");
map(0x8000, 0xbfff).bankr(m_rombank);
map(0xc801, 0xc801).portr("P1");
map(0xc802, 0xc802).portr("P2");
map(0xc803, 0xc803).portr("START");
map(0xc804, 0xc804).w(FUNC(darkmist_state::hw_w));
map(0xc805, 0xc805).writeonly().share("spritebank");
map(0xc805, 0xc805).writeonly().share(m_spritebank);
map(0xc806, 0xc806).portr("DSW1");
map(0xc807, 0xc807).portr("DSW2");
map(0xc808, 0xc808).portr("UNK");
map(0xd000, 0xd0ff).ram().w(m_palette, FUNC(palette_device::write_indirect)).share("palette");
map(0xd200, 0xd2ff).ram().w(m_palette, FUNC(palette_device::write_indirect_ext)).share("palette_ext");
map(0xd400, 0xd41f).ram().share("scroll");
map(0xd400, 0xd41f).ram().share(m_scroll);
map(0xd600, 0xd67f).rw(m_t5182, FUNC(t5182_device::sharedram_r), FUNC(t5182_device::sharedram_w));
map(0xd680, 0xd680).w(m_t5182, FUNC(t5182_device::sound_irq_w));
map(0xd681, 0xd681).r(m_t5182, FUNC(t5182_device::sharedram_semaphore_snd_r));
map(0xd682, 0xd682).w(m_t5182, FUNC(t5182_device::sharedram_semaphore_main_acquire_w));
map(0xd683, 0xd683).w(m_t5182, FUNC(t5182_device::sharedram_semaphore_main_release_w));
map(0xd800, 0xdfff).ram().w(FUNC(darkmist_state::tx_vram_w)).share("videoram");
map(0xd800, 0xdfff).ram().w(FUNC(darkmist_state::tx_vram_w)).share(m_videoram);
map(0xe000, 0xefff).ram().share("workram");
map(0xf000, 0xffff).ram().share("spriteram");
map(0xf000, 0xffff).ram().share(m_spriteram);
}
void darkmist_state::decrypted_opcodes_map(address_map &map)
{
map(0x0000, 0x7fff).rom().share("decrypted_opcodes");
map(0x8000, 0xbfff).bankr("bank1");
map(0x0000, 0x7fff).rom().share(m_decrypted_opcodes);
map(0x8000, 0xbfff).bankr(m_rombank);
}
static INPUT_PORTS_START( darkmist )
@ -132,7 +403,7 @@ static INPUT_PORTS_START( darkmist )
PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) )
PORT_SERVICE_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW1:6" )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7") /* Listed as "ALWAYS ON" */
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7") // Listed as "ALWAYS ON"
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:8")
@ -228,28 +499,28 @@ GFXDECODE_END
TIMER_DEVICE_CALLBACK_MEMBER(darkmist_state::scanline)
{
int scanline = param;
int const scanline = param;
if(scanline == 240) // vblank-out irq
m_maincpu->set_input_line_and_vector(0, HOLD_LINE,0xd7); /* Z80 - RST 10h */
if (scanline == 240) // vblank-out irq
m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xd7); // Z80 - RST 10h
if(scanline == 0) // vblank-in irq
m_maincpu->set_input_line_and_vector(0, HOLD_LINE,0xcf); /* Z80 - RST 08h */
if (scanline == 0) // vblank-in irq
m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xcf); // Z80 - RST 08h
}
void darkmist_state::darkmist(machine_config &config)
{
/* basic machine hardware */
Z80(config, m_maincpu, 4000000); /* ? MHz */
// basic machine hardware
Z80(config, m_maincpu, 4'000'000); // ? MHz
m_maincpu->set_addrmap(AS_PROGRAM, &darkmist_state::memmap);
m_maincpu->set_addrmap(AS_OPCODES, &darkmist_state::decrypted_opcodes_map);
TIMER(config, "scantimer").configure_scanline(FUNC(darkmist_state::scanline), "screen", 0, 1);
T5182(config, m_t5182, 0);
/* video hardware */
// video hardware
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_refresh_hz(60);
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
@ -259,14 +530,14 @@ void darkmist_state::darkmist(machine_config &config)
m_screen->set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_darkmist);
PALETTE(config, m_palette, FUNC(darkmist_state::darkmist_palette));
PALETTE(config, m_palette, FUNC(darkmist_state::palette));
m_palette->set_format(palette_device::xRGB_444, 0x100*4);
m_palette->set_indirect_entries(256+1);
/* sound hardware */
// sound hardware
SPEAKER(config, "mono").front_center();
ym2151_device &ymsnd(YM2151(config, "ymsnd", 14318180/4)); /* 3.579545 MHz */
ym2151_device &ymsnd(YM2151(config, "ymsnd", 14'318'180 / 4)); // 3.579545 MHz
ymsnd.irq_handler().set(m_t5182, FUNC(t5182_device::ym2151_irq_handler));
ymsnd.add_route(0, "mono", 1.0);
ymsnd.add_route(1, "mono", 1.0);
@ -278,7 +549,7 @@ ROM_START( darkmist )
ROM_LOAD( "dm_16.rom", 0x10000, 0x08000, CRC(094579d9) SHA1(2449bc9ba38396912ee9b72dd870ea9fcff95776) )
ROM_REGION( 0x8000, "t5182_z80", 0 ) /* Toshiba T5182 external ROM */
ROM_REGION( 0x8000, "t5182_z80", 0 ) // Toshiba T5182 external ROM
ROM_LOAD( "dm_17.rom", 0x0000, 0x8000, CRC(7723dcae) SHA1(a0c69e7a7b6fd74f7ed6b9c6419aed94aabcd4b0) )
ROM_REGION( 0x4000, "tx_gfx", 0 )
@ -299,13 +570,11 @@ ROM_START( darkmist )
ROM_LOAD( "dm_10.rom", 0x20000, 0x10000, CRC(34fd52b5) SHA1(c4ee464ed79ec91f993b0f894572c0288f0ad1d4) )
ROM_LOAD( "dm_12.rom", 0x30000, 0x08000, CRC(cc4b9839) SHA1(b7e95513d2e06929fed5005caf3bf8c3fba0b597) )
ROM_REGION( 0x10000, "bg_map", 0 )
/* BG layer map ( 512x64 )*/
ROM_REGION( 0x10000, "bg_map", 0 ) // 512x64
ROM_LOAD16_BYTE( "dm_03.rom", 0x00000, 0x08000, CRC(60b40c2a) SHA1(c046273b15dab95ea4851c26ce941e580fa1b6ec) )
ROM_LOAD16_BYTE( "dm_04.rom", 0x00001, 0x08000, CRC(d47b8cd9) SHA1(86eb7a5d8ea63c0c91f455b1b8322cc7b9c4a968) )
ROM_REGION( 0x08000, "fg_map", 0 )
/* FG layer map ( 64x256 ) */
ROM_REGION( 0x08000, "fg_map", 0 ) // 64x256
ROM_LOAD16_BYTE( "dm_07.rom", 0x00000, 0x04000, CRC(889b1277) SHA1(78405110b9cf1ab988c0cbfdb668498dadb41229) )
ROM_LOAD16_BYTE( "dm_08.rom", 0x00001, 0x04000, CRC(f76f6f46) SHA1(ce1c67dc8976106b24fee8d3a0b9e5deb016a327) )
@ -318,8 +587,7 @@ ROM_START( darkmist )
ROM_REGION( 0x0100, "tx_clut", 0 )
ROM_LOAD( "63s281n.j15", 0x0000, 0x0100, CRC(2ea780a4) SHA1(0f8d6791114705e9982f9035f291d2a305b47f0a) )
ROM_REGION( 0x0200, "proms", 0 ) // unknown PROMs
ROM_REGION( 0x0200, "proms", 0 ) // unknown
ROM_LOAD( "63s281n.l1", 0x0000, 0x0100, CRC(208d17ca) SHA1(a77d56337bcac8d9a7bc3411239dfb3045e069ec) )
ROM_LOAD( "82s129.d11", 0x0100, 0x0100, CRC(866eab0e) SHA1(398ffe2b82b6e2235746fd987d5f5995d7dc8687) )
ROM_END
@ -327,26 +595,24 @@ ROM_END
void darkmist_state::decrypt_fgbgtiles(uint8_t* rom, int size)
void darkmist_state::decrypt_fgbgtiles(uint8_t *rom, int size)
{
std::vector<uint8_t> buf(0x40000);
/* data lines */
for (int i = 0;i < size/2;i++)
// data lines
for (int i = 0; i < size / 2; i++)
{
int w1;
int w1 = (rom[i + 0 * size / 2] << 8) + rom[i + 1 * size / 2];
w1 = (rom[i + 0*size/2] << 8) + rom[i + 1*size/2];
w1 = bitswap<16>(w1, 9, 14, 7, 2, 6, 8, 3, 15, 10, 13, 5, 12, 0, 11, 4, 1);
w1 = bitswap<16>(w1, 9,14,7,2, 6,8,3,15, 10,13,5,12, 0,11,4,1);
buf[i + 0*size/2] = w1 >> 8;
buf[i + 1*size/2] = w1 & 0xff;
buf[i + 0 * size / 2] = w1 >> 8;
buf[i + 1 * size / 2] = w1 & 0xff;
}
/* address lines */
for (int i = 0;i < size;i++)
// address lines
for (int i = 0; i < size; i++)
{
rom[i] = buf[bitswap<24>(i,23,22,21,20,19,18,17,16,15,14,13, 5,4,3,2, 12,11,10,9,8, 1,0, 7,6)];
rom[i] = buf[bitswap<24>(i, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 5, 4, 3, 2, 12, 11, 10, 9, 8, 1, 0, 7, 6)];
}
}
@ -355,30 +621,24 @@ void darkmist_state::decrypt_fgbgtiles(uint8_t* rom, int size)
void darkmist_state::decrypt_gfx()
{
std::vector<uint8_t> buf(0x40000);
uint8_t *rom;
int size;
int i;
uint8_t *rom = memregion("tx_gfx")->base();
int size = memregion("tx_gfx")->bytes();
rom = memregion("tx_gfx")->base();
size = memregion("tx_gfx")->bytes();
/* data lines */
for (i = 0;i < size/2;i++)
// data lines
for (int i = 0; i < size / 2; i++)
{
int w1;
int w1 = (rom[i + 0 * size / 2] << 8) + rom[i + 1 * size / 2];
w1 = (rom[i + 0*size/2] << 8) + rom[i + 1*size/2];
w1 = bitswap<16>(w1, 9, 14, 7, 2, 6, 8, 3, 15, 10, 13, 5, 12, 0, 11, 4, 1);
w1 = bitswap<16>(w1, 9,14,7,2, 6,8,3,15, 10,13,5,12, 0,11,4,1);
buf[i + 0*size/2] = w1 >> 8;
buf[i + 1*size/2] = w1 & 0xff;
buf[i + 0 * size / 2] = w1 >> 8;
buf[i + 1 * size / 2] = w1 & 0xff;
}
/* address lines */
for (i = 0;i < size;i++)
// address lines
for (int i = 0; i < size; i++)
{
rom[i] = buf[bitswap<24>(i,23,22,21,20,19,18,17,16,15,14,13,12, 3,2,1, 11,10,9,8, 0, 7,6,5,4)];
rom[i] = buf[bitswap<24>(i, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 3, 2, 1, 11, 10, 9, 8, 0, 7, 6, 5, 4)];
}
decrypt_fgbgtiles(memregion("bg_gfx")->base(), memregion("bg_gfx")->bytes());
@ -388,37 +648,35 @@ void darkmist_state::decrypt_gfx()
rom = memregion("spr_gfx")->base();
size = memregion("spr_gfx")->bytes();
/* data lines */
for (i = 0;i < size/2;i++)
// data lines
for (int i = 0; i < size / 2; i++)
{
int w1;
int w1 = (rom[i + 0 * size / 2] << 8) + rom[i + 1 * size / 2];
w1 = (rom[i + 0*size/2] << 8) + rom[i + 1*size/2];
w1 = bitswap<16>(w1, 9, 14, 7, 2, 6, 8, 3, 15, 10, 13, 5, 12, 0, 11, 4, 1);
w1 = bitswap<16>(w1, 9,14,7,2, 6,8,3,15, 10,13,5,12, 0,11,4,1);
buf[i + 0*size/2] = w1 >> 8;
buf[i + 1*size/2] = w1 & 0xff;
buf[i + 0 * size / 2] = w1 >> 8;
buf[i + 1 * size / 2] = w1 & 0xff;
}
/* address lines */
for (i = 0;i < size;i++)
// address lines
for (int i = 0; i < size; i++)
{
rom[i] = buf[bitswap<24>(i, 23,22,21,20,19,18,17,16,15,14, 12,11,10,9,8, 5,4,3, 13, 7,6, 1,0, 2)];
rom[i] = buf[bitswap<24>(i, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 12, 11, 10, 9, 8, 5, 4, 3, 13, 7, 6, 1, 0, 2)];
}
}
void darkmist_state::decrypt_snd()
{
uint8_t *ROM = memregion("t5182_z80")->base();
uint8_t *rom = memregion("t5182_z80")->base();
for (int i = 0x0000; i < 0x8000; i++)
ROM[i] = bitswap<8>(ROM[i], 7, 1, 2, 3, 4, 5, 6, 0);
rom[i] = bitswap<8>(rom[i], 7, 1, 2, 3, 4, 5, 6, 0);
}
void darkmist_state::init_darkmist()
{
uint8_t *ROM = memregion("maincpu")->base();
uint8_t *rom = memregion("maincpu")->base();
std::vector<uint8_t> buffer(0x10000);
decrypt_gfx();
@ -427,49 +685,52 @@ void darkmist_state::init_darkmist()
for (int i = 0; i < 0x8000; i++)
{
uint8_t p = ROM[i];
uint8_t p = rom[i];
uint8_t d = p;
if(((i & 0x20) == 0x00) && ((i & 0x8) != 0))
if (((i & 0x20) == 0x00) && ((i & 0x8) != 0))
p ^= 0x20;
if(((i & 0x20) == 0x00) && ((i & 0xa) != 0))
if (((i & 0x20) == 0x00) && ((i & 0xa) != 0))
d ^= 0x20;
if(((i & 0x200) == 0x200) && ((i & 0x408) != 0))
if (((i & 0x200) == 0x200) && ((i & 0x408) != 0))
p ^= 0x10;
if((i & 0x220) != 0x200)
if ((i & 0x220) != 0x200)
{
p = bitswap<8>(p, 7,6,5,2,3,4,1,0);
d = bitswap<8>(d, 7,6,5,2,3,4,1,0);
p = bitswap<8>(p, 7, 6, 5, 2, 3, 4, 1, 0);
d = bitswap<8>(d, 7, 6, 5, 2, 3, 4, 1, 0);
}
ROM[i] = d;
rom[i] = d;
m_decrypted_opcodes[i] = p;
}
membank("bank1")->set_base(&ROM[0x010000]);
m_rombank->set_base(&rom[0x10000]);
/* adr line swaps */
ROM = memregion("bg_map")->base();
// adr line swaps
rom = memregion("bg_map")->base();
int len = memregion("bg_map")->bytes();
memcpy( &buffer[0], ROM, len );
memcpy(&buffer[0], rom, len);
for (int i = 0; i < len; i++)
{
ROM[i]=buffer[bitswap<24>(i,23,22,21,20,19,18,17,16,7,6,5,4,3,15,14,13,12,9,8,2,1,11,10, 0)];
rom[i] = buffer[bitswap<24>(i, 23, 22, 21, 20, 19, 18, 17, 16, 7, 6, 5, 4, 3, 15, 14, 13, 12, 9, 8, 2, 1, 11, 10, 0)];
}
ROM = memregion("fg_map")->base();
rom = memregion("fg_map")->base();
len = memregion("fg_map")->bytes();
memcpy( &buffer[0], ROM, len );
memcpy(&buffer[0], rom, len);
for (int i = 0; i < len; i++)
{
ROM[i]=buffer[bitswap<24>(i,23,22,21,20,19,18,17,16,15 ,6,5,4,3,12,11,10,9,14,13,2,1,8,7 ,0 )];
rom[i] = buffer[bitswap<24>(i, 23, 22, 21, 20, 19, 18, 17, 16, 15 , 6, 5, 4, 3, 12, 11, 10, 9, 14, 13, 2, 1, 8, 7, 0)];
}
}
} // anonymous namespace
GAME( 1986, darkmist, 0, darkmist, darkmist, darkmist_state, init_darkmist, ROT270, "Seibu Kaihatsu (Taito license)", "The Lost Castle In Darkmist", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )

View File

@ -1,87 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:David Haywood, Nicola Salmoria, Tomasz Slanina
#ifndef MAME_SEIBU_DARKMIST_H
#define MAME_SEIBU_DARKMIST_H
#pragma once
#include "t5182.h"
#include "machine/timer.h"
#include "emupal.h"
#include "screen.h"
#include "tilemap.h"
class darkmist_state : public driver_device
{
public:
darkmist_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_t5182(*this, "t5182"),
m_screen(*this, "screen"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_spritebank(*this, "spritebank"),
m_scroll(*this, "scroll"),
m_videoram(*this, "videoram"),
m_workram(*this, "workram"),
m_spriteram(*this, "spriteram"),
m_bg_clut(*this, "bg_clut"),
m_fg_clut(*this, "fg_clut"),
m_spr_clut(*this, "spr_clut"),
m_tx_clut(*this, "tx_clut"),
m_decrypted_opcodes(*this, "decrypted_opcodes")
{ }
void darkmist(machine_config &config);
void init_darkmist();
private:
required_device<cpu_device> m_maincpu;
required_device<t5182_device> m_t5182;
required_device<screen_device> m_screen;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_shared_ptr<uint8_t> m_spritebank;
required_shared_ptr<uint8_t> m_scroll;
required_shared_ptr<uint8_t> m_videoram;
required_shared_ptr<uint8_t> m_workram;
required_shared_ptr<uint8_t> m_spriteram;
required_region_ptr<uint8_t> m_bg_clut;
required_region_ptr<uint8_t> m_fg_clut;
required_region_ptr<uint8_t> m_spr_clut;
required_region_ptr<uint8_t> m_tx_clut;
optional_shared_ptr<uint8_t> m_decrypted_opcodes;
int m_hw = 0;
tilemap_t *m_bgtilemap = nullptr;
tilemap_t *m_fgtilemap = nullptr;
tilemap_t *m_txtilemap = nullptr;
void hw_w(uint8_t data);
void tx_vram_w(offs_t offset, uint8_t data);
TILE_GET_INFO_MEMBER(get_bgtile_info);
TILE_GET_INFO_MEMBER(get_fgtile_info);
TILE_GET_INFO_MEMBER(get_txttile_info);
virtual void machine_start() override;
virtual void video_start() override;
void darkmist_palette(palette_device &palette) const;
bitmap_ind16 m_temp_bitmap;
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void mix_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t* clut);
void decrypt_fgbgtiles(uint8_t* rgn, int size);
void decrypt_gfx();
void decrypt_snd();
TIMER_DEVICE_CALLBACK_MEMBER(scanline);
void decrypted_opcodes_map(address_map &map);
void memmap(address_map &map);
};
#endif // MAME_SEIBU_DARKMIST_H

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