hp86b: new working machine

This commit is contained in:
fulivi 2020-02-14 15:33:02 +01:00
parent 81efea6823
commit e697566de8
6 changed files with 1434 additions and 520 deletions

132
hash/hp86_rom.xml Normal file
View File

@ -0,0 +1,132 @@
<?xml version="1.0"?>
<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
<softwarelist name="hp86_rom" description="HP-86/7 Option ROMs">
<software name="miksam">
<description>MIKSAM ROM</description>
<year>1982</year>
<publisher>Hewlett-Packard</publisher>
<info name="serial" value="00087-15011"/>
<part name="rom" interface="hp80_rom">
<feature name="sc" value="0x0e"/>
<dataarea name="rom" size="0x2000">
<rom name="rom016.bin" size="0x2000" crc="f3639add" sha1="975039f0373ac209094943df262261b46bf0f14d"/>
</dataarea>
</part>
</software>
<software name="language">
<description>Language ROM</description>
<year>1983</year>
<publisher>Hewlett-Packard</publisher>
<part name="rom" interface="hp80_rom">
<feature name="sc" value="0x18"/>
<dataarea name="rom" size="0x2000">
<rom name="rom030.bin" size="0x2000" crc="14507bc0" sha1="67ca5a15019bd7b2bfbf53bb8cfbe2ca20a6239c"/>
</dataarea>
</part>
</software>
<software name="assembler">
<description>Assembler ROM</description>
<year>1982</year>
<publisher>Hewlett-Packard</publisher>
<part name="rom" interface="hp80_rom">
<feature name="sc" value="0x28"/>
<dataarea name="rom" size="0x2000">
<rom name="rom050.bin" size="0x2000" crc="bdce8a12" sha1="395a763cf1f133c987973d8880a43afc494ba897"/>
</dataarea>
</part>
</software>
<software name="matrix1">
<description>Matrix 1 ROM</description>
<year>1982</year>
<publisher>Hewlett-Packard</publisher>
<info name="serial" value="00087-15004"/>
<part name="rom" interface="hp80_rom">
<feature name="sc" value="0xb0"/>
<dataarea name="rom" size="0x2000">
<rom name="rom260.bin" size="0x2000" crc="b57fd7fd" sha1="4a9251c4b6d7b8f12f80f4276e0c71e4ef6f8fcb"/>
</dataarea>
</part>
</software>
<software name="matrix2">
<description>Matrix 2 ROM</description>
<year>1982</year>
<publisher>Hewlett-Packard</publisher>
<info name="serial" value="00087-15004"/>
<part name="rom" interface="hp80_rom">
<feature name="sc" value="0xb1"/>
<dataarea name="rom" size="0x2000">
<rom name="rom261.bin" size="0x2000" crc="681c878e" sha1="a625fe5ae775eeb8436016c5baa8679c71bc184f"/>
</dataarea>
</part>
</software>
<software name="io">
<description>I/O ROM</description>
<year>1982</year>
<publisher>Hewlett-Packard</publisher>
<info name="serial" value="00087-15003"/>
<part name="rom" interface="hp80_rom">
<feature name="sc" value="0xc0"/>
<dataarea name="rom" size="0x2000">
<rom name="rom300.bin" size="0x2000" crc="c8583a7a" sha1="fa088c4c58e44044ac01f8c9bdb88ac91a59d3c1"/>
</dataarea>
</part>
</software>
<software name="ems">
<description>Extended Mass Storage ROM</description>
<year>1984</year>
<publisher>Structured Software Systems</publisher>
<part name="rom" interface="hp80_rom">
<feature name="sc" value="0xcf"/>
<dataarea name="rom" size="0x2000">
<rom name="rom317.bin" size="0x2000" crc="187f7a1e" sha1="4e52f81139a7bbb6e0ed8758dc4fe2307c3da074"/>
</dataarea>
</part>
</software>
<software name="advprg1">
<description>Advanced programming 1 ROM</description>
<year>1983</year>
<publisher>Hewlett-Packard</publisher>
<info name="serial" value="00087-15005"/>
<part name="rom" interface="hp80_rom">
<feature name="sc" value="0xe7"/>
<dataarea name="rom" size="0x2000">
<rom name="rom347.bin" size="0x2000" crc="14c085f8" sha1="1e796ae3925480ef50cd407981c5208994d9ab6a"/>
</dataarea>
</part>
</software>
<software name="advprg2">
<description>Advanced programming 2 ROM</description>
<year>1983</year>
<publisher>Hewlett-Packard</publisher>
<info name="serial" value="00087-15005"/>
<part name="rom" interface="hp80_rom">
<feature name="sc" value="0xe8"/>
<dataarea name="rom" size="0x2000">
<rom name="rom350.bin" size="0x2000" crc="0749ced1" sha1="9a2578df0e5237c0ba03517dc57431c93f1c7a84"/>
</dataarea>
</part>
</software>
<software name="plotter">
<description>Printer/plotter ROM</description>
<year>1982</year>
<publisher>Hewlett-Packard</publisher>
<info name="serial" value="00087-15002"/>
<part name="rom" interface="hp80_rom">
<feature name="sc" value="0xf0"/>
<dataarea name="rom" size="0x2000">
<rom name="rom360.bin" size="0x2000" crc="982e6ee3" sha1="2b074bb99f387ad55c55d72479627ac8e1546c48"/>
</dataarea>
</part>
</software>
</softwarelist>

View File

@ -141,7 +141,9 @@ DEFINE_DEVICE_TYPE(HP_CAPRICORN , capricorn_cpu_device , "capricorn" , "HP-Capri
capricorn_cpu_device::capricorn_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: cpu_device(mconfig, HP_CAPRICORN, tag, owner, clock),
m_program_config("program" , ENDIANNESS_LITTLE , 8 , 16)
m_program_config("program" , ENDIANNESS_LITTLE , 8 , 16),
m_opcode_func(*this),
m_lma_out(*this)
{
}
@ -179,6 +181,9 @@ void capricorn_cpu_device::device_start()
save_item(NAME(m_flags));
set_icountptr(m_icount);
m_opcode_func.resolve_safe();
m_lma_out.resolve_safe();
}
void capricorn_cpu_device::device_reset()
@ -204,6 +209,7 @@ void capricorn_cpu_device::execute_run()
debugger_instruction_hook(m_genpc);
uint8_t opcode = fetch();
m_opcode_func(opcode);
execute_one(opcode);
offset_pc(1);
}
@ -243,18 +249,21 @@ std::unique_ptr<util::disasm_interface> capricorn_cpu_device::create_disassemble
return std::make_unique<capricorn_disassembler>();
}
void capricorn_cpu_device::start_mem_burst(ea_addr_t addr)
void capricorn_cpu_device::start_mem_burst(ea_addr_t addr , bool lmard)
{
m_flatten = false;
// Only relevant for memory access (not for internal registers)
m_start_addr = (uint16_t)(addr & ADDR_MASK);
if (!BIT(addr , GP_REG_BIT)) {
// Only relevant for memory access (not for internal registers)
m_start_addr = (uint16_t)(addr & ADDR_MASK);
m_lma_out(lmard);
}
}
uint16_t capricorn_cpu_device::read_u16(ea_addr_t addr)
uint16_t capricorn_cpu_device::read_u16(ea_addr_t addr , bool lmard)
{
PAIR16 tmp;
start_mem_burst(addr);
start_mem_burst(addr , lmard);
tmp.b.l = RM(addr);
tmp.b.h = RM(addr);
return tmp.w;
@ -299,6 +308,7 @@ void capricorn_cpu_device::WM(ea_addr_t& addr , uint8_t v)
uint8_t capricorn_cpu_device::fetch()
{
m_genpc = read_u16(REG_PC | GP_REG_MASK);
start_mem_burst(m_genpc , false);
return m_cache->read_byte(m_genpc);
}
@ -416,12 +426,22 @@ capricorn_cpu_device::ea_addr_t capricorn_cpu_device::get_ea_idx_dir()
// Indexed direct addressing mode
m_icount -= 3;
offset_pc(1);
uint16_t res = read_u16(m_genpc) + read_u16(m_arp | GP_REG_MASK);
uint16_t res = read_u16(m_genpc , false) + read_u16(m_arp | GP_REG_MASK);
offset_pc(1);
write_u16(REG_INDEX_SCRATCH | GP_REG_MASK, res);
return res;
}
capricorn_cpu_device::ea_addr_t capricorn_cpu_device::get_ea_jsbx()
{
// Indexed direct addressing mode in JSBX instruction
m_icount -= 3;
offset_pc(1);
uint16_t res = read_u16(m_genpc) + read_u16(m_arp | GP_REG_MASK);
offset_pc(1);
return res;
}
capricorn_cpu_device::ea_addr_t capricorn_cpu_device::get_ea_lit_indir()
{
// Literal indirect addressing mode
@ -437,7 +457,7 @@ capricorn_cpu_device::ea_addr_t capricorn_cpu_device::get_ea_idx_indir()
// Indexed indirect addressing mode
m_icount -= 5;
offset_pc(1);
uint16_t res = read_u16(m_genpc) + read_u16(m_arp | GP_REG_MASK);
uint16_t res = read_u16(m_genpc , false) + read_u16(m_arp | GP_REG_MASK);
offset_pc(1);
write_u16(REG_INDEX_SCRATCH | GP_REG_MASK, res);
return read_u16(res);
@ -975,11 +995,11 @@ void capricorn_cpu_device::do_PAD_op()
byte = RM(ea);
m_arp = byte & ARP_DRP_MASK;
COPY_BIT(BIT(byte , 6), m_flags, FLAGS_CY_BIT);
COPY_BIT(BIT(byte , 7), m_flags, FLAGS_OVF_BIT);
byte = RM(ea);
m_drp = byte & ARP_DRP_MASK;
COPY_BIT(BIT(byte , 6), m_flags, FLAGS_DCM_BIT);
COPY_BIT(BIT(byte , 7), m_flags, FLAGS_OVF_BIT);
byte = RM(ea);
COPY_BIT(BIT(byte , 0), m_flags, FLAGS_LSB_BIT);
@ -1163,7 +1183,7 @@ void capricorn_cpu_device::execute_one(uint8_t opcode)
case 0xc6:
// JSB
do_JSB_op(get_ea_idx_dir());
do_JSB_op(get_ea_jsbx());
break;
case 0xc7:
@ -1511,8 +1531,10 @@ void capricorn_cpu_device::execute_one(uint8_t opcode)
void capricorn_cpu_device::take_interrupt()
{
// According to O. De Smet emulator interrupt handling takes 15 cycles
m_icount -= 15;
// Int. ack sequence takes 9 cycles
// Microcode FSM runs through this state sequence (see patent):
// 31-15-26-13-23-22-30-16-20
m_icount -= 9;
push_pc();
uint8_t vector = (uint8_t)standard_irq_callback(0);
vector_to_pc(vector);

View File

@ -5,6 +5,10 @@
// Emulator for HP Capricorn CPU
// *****************************
//
// References:
// HP 00085-90444, Nov 81, HP83/85 Assembler ROM manual
// US Patent 4,424,563 describing the architecture of HP85
//
#ifndef MAME_CPU_CAPRICORN_CAPRICORN_H
#define MAME_CPU_CAPRICORN_CAPRICORN_H
@ -17,6 +21,13 @@ public:
uint8_t flatten_burst();
// This CB reports the start of LMA (Load Memory Address) cycles
// Its parameter is true when starting a LMARD cycle
auto lma_cb() { return m_lma_out.bind(); }
// Tap into fetched opcodes
auto opcode_cb() { return m_opcode_func.bind(); }
protected:
// device_t overrides
virtual void device_start() override;
@ -61,13 +72,16 @@ private:
uint16_t m_start_addr; // Start address of burst
uint16_t m_curr_addr; // Current address in burst
devcb_write8 m_opcode_func;
devcb_write_line m_lma_out;
// Effective Addresses
// When b17 = 0, b15..b0 hold 16-bit memory address
// When b17 = 1, b5..b0 hold register index
typedef unsigned ea_addr_t;
void start_mem_burst(ea_addr_t addr);
uint16_t read_u16(ea_addr_t addr);
void start_mem_burst(ea_addr_t addr , bool lmard = false);
uint16_t read_u16(ea_addr_t addr , bool lmard = true);
void write_u16(ea_addr_t addr , uint16_t v);
uint8_t RM(ea_addr_t& addr);
void WM(ea_addr_t& addr , uint8_t v);
@ -86,6 +100,7 @@ private:
ea_addr_t get_ea_lit_dir();
ea_addr_t get_ea_reg_indir();
ea_addr_t get_ea_idx_dir();
ea_addr_t get_ea_jsbx();
ea_addr_t get_ea_lit_indir();
ea_addr_t get_ea_idx_indir();

File diff suppressed because it is too large Load Diff

31
src/mame/layout/hp86b.lay Normal file
View File

@ -0,0 +1,31 @@
<?xml version="1.0"?>
<!--
license:CC0
copyright-holders:F. Ulivi
Layout of Hewlett-Packard 86B with 82913A monitor (and run light)
-->
<mamelayout version="2">
<element name="run_light" defstate="0">
<disk state="0">
<color red="0.25" green="0.25" blue="0" />
</disk>
<disk state="1">
<color red="1.0" green="1.0" blue="0" />
</disk>
</element>
<element name="power_s"> <text string="POWER" align="1"> <color red="1.0" green="1.0" blue="1.0" /></text></element>
<view name="82913A monitor">
<!-- dimensions in mm -->
<bounds x="0" y="0" width="230" height="160"/>
<bezel element="power_s">
<bounds x="134" y="152" width="20" height="5"/>
</bezel>
<bezel name="run_light" element="run_light">
<bounds x="130" y="153" width="3" height="3"/>
</bezel>
<screen index="0">
<bounds left="0" top="0" right="230" bottom="150" />
</screen>
</view>
</mamelayout>

View File

@ -16161,6 +16161,7 @@ hpz80unk //
@source:hp80.cpp
hp85 //
hp86b //
@source:hshavoc.cpp
hshavoc // (c) 1993 Data East