hphybrid: added selection of boot mode for 5061-3001

This commit is contained in:
fulivi 2015-12-13 16:59:53 +01:00
parent 26fcc6f7ae
commit 2408e8167d
2 changed files with 31 additions and 10 deletions

View File

@ -134,6 +134,7 @@ void hp_hybrid_cpu_device::device_start()
m_dmama = 0;
m_dmac = 0;
m_reg_I = 0;
m_forced_bsc_25 = false;
{
state_add(HPHYBRID_A, "A", m_reg_A);
@ -174,6 +175,7 @@ void hp_hybrid_cpu_device::device_start()
save_item(NAME(m_dmama));
save_item(NAME(m_dmac));
save_item(NAME(m_reg_I));
save_item(NAME(m_forced_bsc_25));
m_icountptr = &m_icount;
}
@ -642,6 +644,9 @@ UINT16 hp_hybrid_cpu_device::RM(UINT32 addr)
UINT16 addr_wo_bsc = remove_mae(addr);
if (addr_wo_bsc <= HP_REG_LAST_ADDR) {
// Any access to internal registers removes forcing of BSC 2x
m_forced_bsc_25 = false;
// Memory mapped registers that are present in both 3001 & 3011
switch (addr_wo_bsc) {
case HP_REG_A_ADDR:
@ -716,6 +721,9 @@ void hp_hybrid_cpu_device::WM(UINT32 addr , UINT16 v)
UINT16 addr_wo_bsc = remove_mae(addr);
if (addr_wo_bsc <= HP_REG_LAST_ADDR) {
// Any access to internal registers removes forcing of BSC 2x
m_forced_bsc_25 = false;
// Memory mapped registers
switch (addr_wo_bsc) {
case HP_REG_A_ADDR:
@ -1046,7 +1054,8 @@ void hp_hybrid_cpu_device::WIO(UINT8 pa , UINT8 ic , UINT16 v)
}
hp_5061_3001_cpu_device::hp_5061_3001_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: hp_hybrid_cpu_device(mconfig, HP_5061_3001, "HP-5061-3001", tag, owner, clock, "5061-3001", 22)
: hp_hybrid_cpu_device(mconfig, HP_5061_3001, "HP-5061-3001", tag, owner, clock, "5061-3001", 22),
m_boot_mode(false)
{
}
@ -1095,12 +1104,14 @@ void hp_5061_3001_cpu_device::device_reset()
// R36 0
// R37 0
m_reg_aec[ 0 ] = 0;
m_reg_aec[ 1 ] = 0x25; // FU_TEST
m_reg_aec[ 1 ] = 5;
m_reg_aec[ 2 ] = 0;
m_reg_aec[ 3 ] = 0;
m_reg_aec[ 4 ] = 0;
m_reg_aec[ 5 ] = 0;
m_forced_bsc_25 = m_boot_mode;
hp_hybrid_cpu_device::device_reset();
}
@ -1471,7 +1482,13 @@ UINT32 hp_5061_3001_cpu_device::add_mae(aec_cases_t aec_case , UINT16 addr)
return 0;
}
return (UINT32)addr | ((UINT32)(m_reg_aec[ bsc_reg - HP_REG_R32_ADDR ] & BSC_REG_MASK) << 16);
UINT16 aec_reg = m_reg_aec[ bsc_reg - HP_REG_R32_ADDR ] & BSC_REG_MASK;
if (m_forced_bsc_25) {
aec_reg = (aec_reg & 0xf) | 0x20;
}
return (UINT32)addr | ((UINT32)aec_reg << 16);
}
UINT16 hp_5061_3001_cpu_device::read_non_common_reg(UINT16 addr)

View File

@ -8,14 +8,14 @@
// The HP hybrid processor series is composed of a few different models with different
// capabilities. The series was derived from HP's own 2116 processor by translating a
// discrete implementation of the 1960s into a multi-chip module (hence the "hybrid" name).
// This emulator currently supports the 5061-3011 version only.
// This emulator currently supports both the 5061-3001 & the 5061-3011 versions.
//
// For this emulator I mainly relied on these sources:
// - http://www.hp9845.net/ website
// - HP manual "Assembly development ROM manual for the HP9845": this is the most precious
// and "enabling" resource of all
// - US Patent 4,180,854 describing the HP9845 system
// - Study of disassembly of firmware of HP64000 system
// - Study of disassembly of firmware of HP64000 & HP9845 systems
// - A lot of "educated" guessing
#ifndef _HPHYBRID_H_
@ -26,11 +26,6 @@
#define HPHYBRID_IRL 1 // Low-level interrupt
#define HPHYBRID_INT_LVLS 2 // Levels of interrupt
#define HPHYBRID_DMAR 2 // DMA request
#define HPHYBRID_HALT 3 // "Halt" input
#define HPHYBRID_STS 4 // "Status" input
#define HPHYBRID_FLG 5 // "Flag" input
// I/O addressing space (16-bit wide)
// Addresses into this space are composed as follows:
// b[5..2] = Peripheral address 0..15
@ -75,6 +70,10 @@
#define HP_REG_IV_MASK 0xfff0
#define HP_REG_PA_MASK 0x000f
// Set boot mode of 5061-3001: either normal (false) or as in HP9845 system (true)
#define MCFG_HPHYBRID_SET_9845_BOOT(_mode) \
hp_5061_3001_cpu_device::set_boot_mode_static(*device, _mode);
class hp_hybrid_cpu_device : public cpu_device
{
public:
@ -140,6 +139,7 @@ protected:
UINT16 get_skip_addr(UINT16 opcode , bool condition) const;
int m_icount;
bool m_forced_bsc_25;
// State of processor
UINT16 m_reg_A; // Register A
@ -182,6 +182,8 @@ class hp_5061_3001_cpu_device : public hp_hybrid_cpu_device
public:
hp_5061_3001_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
static void set_boot_mode_static(device_t &device, bool mode) { downcast<hp_5061_3001_cpu_device &>(device).m_boot_mode = mode; }
protected:
virtual void device_start();
virtual void device_reset();
@ -204,6 +206,8 @@ protected:
virtual void write_non_common_reg(UINT16 addr , UINT16 v);
private:
bool m_boot_mode;
// Additional state of processor
UINT16 m_reg_ar2[ 4 ]; // AR2 register
UINT16 m_reg_se; // SE register (4 bits)