amerihok: Make some educated guesses regarding manufacturer, decade, MCU and sound chip types (nw)

z8: A few technical modifications to memory interface; add Z8681 type (nw)
This commit is contained in:
AJR 2017-07-20 17:16:17 -04:00
parent b6d7d31d49
commit a85ae608dd
3 changed files with 39 additions and 12 deletions

View File

@ -155,45 +155,54 @@ enum
DEFINE_DEVICE_TYPE(Z8601, z8601_device, "z8601", "Z8601")
DEFINE_DEVICE_TYPE(UB8830D, ub8830d_device, "ub8830d", "UB8830D")
DEFINE_DEVICE_TYPE(Z8611, z8611_device, "z8611", "Z8611")
DEFINE_DEVICE_TYPE(Z8681, z8681_device, "z8681", "Z8681")
/***************************************************************************
ADDRESS MAPS
***************************************************************************/
static ADDRESS_MAP_START( program_2kb, AS_PROGRAM, 8, z8_device )
DEVICE_ADDRESS_MAP_START( program_2kb, 8, z8_device )
AM_RANGE(0x0000, 0x07ff) AM_ROM
ADDRESS_MAP_END
static ADDRESS_MAP_START( program_4kb, AS_PROGRAM, 8, z8_device )
DEVICE_ADDRESS_MAP_START( program_4kb, 8, z8_device )
AM_RANGE(0x0000, 0x0fff) AM_ROM
ADDRESS_MAP_END
z8_device::z8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int size)
z8_device::z8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint32_t rom_size, address_map_delegate map)
: cpu_device(mconfig, type, tag, owner, clock)
, m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0, (size == 4) ? ADDRESS_MAP_NAME(program_4kb) : ADDRESS_MAP_NAME(program_2kb))
, m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0, map)
, m_data_config("data", ENDIANNESS_LITTLE, 8, 16, 0)
, m_input_cb{{*this}, {*this}, {*this}, {*this}}
, m_output_cb{{*this}, {*this}, {*this}, {*this}}
, m_rom_size(rom_size)
{
(void)m_rom_size; // not used at the moment
}
z8601_device::z8601_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: z8_device(mconfig, Z8601, tag, owner, clock, 2)
: z8_device(mconfig, Z8601, tag, owner, clock, 0x800, address_map_delegate(FUNC(z8601_device::program_2kb), this))
{
}
ub8830d_device::ub8830d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: z8_device(mconfig, UB8830D, tag, owner, clock, 2)
: z8_device(mconfig, UB8830D, tag, owner, clock, 0x800, address_map_delegate(FUNC(ub8830d_device::program_2kb), this))
{
}
z8611_device::z8611_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: z8_device(mconfig, Z8611, tag, owner, clock, 4)
: z8_device(mconfig, Z8611, tag, owner, clock, 0x1000, address_map_delegate(FUNC(z8611_device::program_4kb), this))
{
}
z8681_device::z8681_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: z8_device(mconfig, Z8681, tag, owner, clock, 0, address_map_delegate())
{
}
@ -775,6 +784,10 @@ void z8_device::device_reset()
{
m_pc = 0x000c;
// crude hack for Z8681
if (m_rom_size == 0)
m_pc |= m_input_cb[0]() << 8;
register_write(Z8_REGISTER_TMR, 0x00);
register_write(Z8_REGISTER_PRE1, PRE1 & 0xfc);
register_write(Z8_REGISTER_PRE0, PRE0 & 0xfe);

View File

@ -67,7 +67,7 @@ protected:
};
// construction/destruction
z8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int size);
z8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint32_t rom_size, address_map_delegate map);
// device-level overrides
virtual void device_start() override;
@ -95,6 +95,8 @@ protected:
virtual uint32_t disasm_max_opcode_bytes() const override { return 3; }
virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override;
DECLARE_ADDRESS_MAP(program_2kb, 8);
DECLARE_ADDRESS_MAP(program_4kb, 8);
private:
address_space_config m_program_config;
@ -108,6 +110,8 @@ private:
devcb_read8 m_input_cb[4];
devcb_write8 m_output_cb[4];
uint32_t m_rom_size;
/* registers */
uint16_t m_pc; /* program counter */
uint8_t m_r[256]; /* register file */
@ -344,6 +348,13 @@ public:
};
class z8681_device : public z8_device
{
public:
z8681_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};
// Zilog Z8601
DECLARE_DEVICE_TYPE(Z8601, z8601_device)
@ -353,4 +364,7 @@ DECLARE_DEVICE_TYPE(UB8830D, ub8830d_device)
// Zilog Z8611
DECLARE_DEVICE_TYPE(Z8611, z8611_device)
// Zilog Z8681 ROMless
DECLARE_DEVICE_TYPE(Z8681, z8681_device)
#endif // MAME_CPU_Z8_Z8_H

View File

@ -17,7 +17,7 @@ Processor is a ROMless MCU from the Z8 family.
#include "emu.h"
#include "cpu/z8/z8.h"
#include "sound/okim6295.h"
#include "sound/okim6376.h"
#include "speaker.h"
@ -56,14 +56,14 @@ void amerihok_state::machine_reset()
static MACHINE_CONFIG_START( amerihok )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z8601, 8000000) // unknown clock; type definitely wrong
MCFG_CPU_ADD("maincpu", Z8681, XTAL_12MHz) // type guessed
MCFG_CPU_PROGRAM_MAP(amerihok_map)
// MCFG_CPU_VBLANK_INT_DRIVER("screen", amerihok_state, irq4_line_hold)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_OKIM6295_ADD("oki", 1000000, PIN7_HIGH) // maybe
MCFG_SOUND_ADD("oki", OKIM6376, 1000000) // 64-pin surface mount
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@ -79,4 +79,4 @@ ROM_START( amerihok )
ROM_LOAD( "airh-u10", 0x80000, 0x40000, CRC(71ee6421) SHA1(10131fc7c009158308c4a8bb2b037101622c07a1) )
ROM_END
GAME( 19??, amerihok, 0, amerihok, amerihok, driver_device, 0, ROT0, "<unknown>", "Ameri-Hockey", MACHINE_IS_SKELETON_MECHANICAL )
GAME( 199?, amerihok, 0, amerihok, amerihok, driver_device, 0, ROT0, "Ameri Corporation", "Ameri-Hockey", MACHINE_IS_SKELETON_MECHANICAL )