Merge pull request #502 from fulivi/hp9845_dev

First version of HP9845B driver [F.Ulvi]
This commit is contained in:
Miodrag Milanović 2015-12-15 19:21:34 +01:00
commit 4ba5d45e4e
4 changed files with 1838 additions and 354 deletions

File diff suppressed because it is too large Load Diff

View File

@ -8,14 +8,15 @@
// The HP hybrid processor series is composed of a few different models with different // 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 // 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). // 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: // For this emulator I mainly relied on these sources:
// - http://www.hp9845.net/ website // - http://www.hp9845.net/ website
// - HP manual "Assembly development ROM manual for the HP9845": this is the most precious // - HP manual "Assembly development ROM manual for the HP9845": this is the most precious
// and "enabling" resource of all // and "enabling" resource of all
// - US Patent 4,180,854 describing the HP9845 system // - 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
// - hp9800e emulator for inspiration on implementing EMC instructions
// - A lot of "educated" guessing // - A lot of "educated" guessing
#ifndef _HPHYBRID_H_ #ifndef _HPHYBRID_H_
@ -26,11 +27,6 @@
#define HPHYBRID_IRL 1 // Low-level interrupt #define HPHYBRID_IRL 1 // Low-level interrupt
#define HPHYBRID_INT_LVLS 2 // Levels of 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) // I/O addressing space (16-bit wide)
// Addresses into this space are composed as follows: // Addresses into this space are composed as follows:
// b[5..2] = Peripheral address 0..15 // b[5..2] = Peripheral address 0..15
@ -52,95 +48,199 @@
#define HP_REG_R7_ADDR 0x0007 #define HP_REG_R7_ADDR 0x0007
#define HP_REG_IV_ADDR 0x0008 #define HP_REG_IV_ADDR 0x0008
#define HP_REG_PA_ADDR 0x0009 #define HP_REG_PA_ADDR 0x0009
#define HP_REG_W_ADDR 0x000A
#define HP_REG_DMAPA_ADDR 0x000B #define HP_REG_DMAPA_ADDR 0x000B
#define HP_REG_DMAMA_ADDR 0x000C #define HP_REG_DMAMA_ADDR 0x000C
#define HP_REG_DMAC_ADDR 0x000D #define HP_REG_DMAC_ADDR 0x000D
#define HP_REG_C_ADDR 0x000e #define HP_REG_C_ADDR 0x000e
#define HP_REG_D_ADDR 0x000f #define HP_REG_D_ADDR 0x000f
#define HP_REG_AR2_ADDR 0x0010
#define HP_REG_SE_ADDR 0x0014
#define HP_REG_R25_ADDR 0x0015
#define HP_REG_R26_ADDR 0x0016
#define HP_REG_R27_ADDR 0x0017
#define HP_REG_R32_ADDR 0x001a
#define HP_REG_R33_ADDR 0x001b
#define HP_REG_R34_ADDR 0x001c
#define HP_REG_R35_ADDR 0x001d
#define HP_REG_R36_ADDR 0x001e
#define HP_REG_R37_ADDR 0x001f
#define HP_REG_LAST_ADDR 0x001f #define HP_REG_LAST_ADDR 0x001f
#define HP_REG_AR1_ADDR 0xfff8
#define HP_REG_IV_MASK 0xfff0 #define HP_REG_IV_MASK 0xfff0
#define HP_REG_PA_MASK 0x000f #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);
// PA changed callback
#define MCFG_HPHYBRID_PA_CHANGED(_devcb) \
hp_hybrid_cpu_device::set_pa_changed_func(*device , DEVCB_##_devcb);
class hp_hybrid_cpu_device : public cpu_device class hp_hybrid_cpu_device : public cpu_device
{ {
public: public:
DECLARE_WRITE_LINE_MEMBER(dmar_w); DECLARE_WRITE_LINE_MEMBER(dmar_w);
DECLARE_WRITE_LINE_MEMBER(halt_w);
DECLARE_WRITE_LINE_MEMBER(status_w);
DECLARE_WRITE_LINE_MEMBER(flag_w);
template<class _Object> static devcb_base &set_pa_changed_func(device_t &device, _Object object) { return downcast<hp_hybrid_cpu_device &>(device).m_pa_changed_func.set_callback(object); }
protected: protected:
hp_hybrid_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); hp_hybrid_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname , UINT8 addrwidth);
// device-level overrides // device-level overrides
virtual void device_start() override; virtual void device_start();
virtual void device_reset() override; virtual void device_reset();
// device_execute_interface overrides // device_execute_interface overrides
virtual UINT32 execute_min_cycles() const override { return 6; } virtual UINT32 execute_min_cycles() const { return 6; }
virtual UINT32 execute_max_cycles() const override { return 25; } virtual UINT32 execute_input_lines() const { return 2; }
virtual UINT32 execute_input_lines() const override { return 2; } virtual UINT32 execute_default_irq_vector() const { return 0xffff; }
virtual UINT32 execute_default_irq_vector() const override { return 0xffff; } virtual void execute_run();
virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state);
virtual void execute_set_input(int inputnum, int state) override;
UINT16 execute_one(UINT16 opcode); UINT16 execute_one(UINT16 opcode);
UINT16 execute_one_sub(UINT16 opcode); UINT16 execute_one_sub(UINT16 opcode);
// Execute an instruction that doesn't belong to either BPC or IOC
virtual UINT16 execute_no_bpc_ioc(UINT16 opcode) = 0;
// device_memory_interface overrides // device_memory_interface overrides
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : nullptr ); } virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : NULL ); }
// device_state_interface overrides // device_state_interface overrides
void state_string_export(const device_state_entry &entry, std::string &str) override; void state_string_export(const device_state_entry &entry, std::string &str);
// device_disasm_interface overrides // device_disasm_interface overrides
virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } virtual UINT32 disasm_min_opcode_bytes() const { return 2; }
virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } virtual UINT32 disasm_max_opcode_bytes() const { return 2; }
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
// Different cases of memory access
// See patent @ pg 361
typedef enum {
AEC_CASE_A, // Instr. fetches, non-base page fetches of link pointers, BPC direct non-base page accesses
AEC_CASE_B, // Base page fetches of link pointers, BPC direct base page accesses
AEC_CASE_C, // IOC, EMC & BPC indirect final destination accesses
AEC_CASE_D // DMA accesses
} aec_cases_t;
// do memory address extension
virtual UINT32 add_mae(aec_cases_t aec_case , UINT16 addr) = 0;
UINT16 remove_mae(UINT32 addr);
UINT16 RM(aec_cases_t aec_case , UINT16 addr);
UINT16 RM(UINT32 addr);
virtual UINT16 read_non_common_reg(UINT16 addr) = 0;
void WM(aec_cases_t aec_case , UINT16 addr , UINT16 v);
void WM(UINT32 addr , UINT16 v);
virtual void write_non_common_reg(UINT16 addr , UINT16 v) = 0;
UINT16 fetch(void);
UINT16 get_skip_addr(UINT16 opcode , bool condition) const;
devcb_write8 m_pa_changed_func;
int m_icount;
bool m_forced_bsc_25;
// State of processor
UINT16 m_reg_A; // Register A
UINT16 m_reg_B; // Register B
UINT16 m_reg_P; // Register P
UINT16 m_reg_R; // Register R
UINT16 m_reg_C; // Register C
UINT16 m_reg_D; // Register D
UINT16 m_reg_IV; // Register IV
UINT16 m_reg_W; // Register W
UINT8 m_reg_PA[ HPHYBRID_INT_LVLS + 1 ]; // Stack of register PA (4 bit-long)
UINT16 m_flags; // Flags
UINT8 m_dmapa; // DMA peripheral address (4 bits)
UINT16 m_dmama; // DMA address
UINT16 m_dmac; // DMA counter
UINT16 m_reg_I; // Instruction register
UINT32 m_genpc; // Full PC
private: private:
address_space_config m_program_config; address_space_config m_program_config;
address_space_config m_io_config; address_space_config m_io_config;
address_space *m_program; address_space *m_program;
direct_read_data *m_direct; direct_read_data *m_direct;
address_space *m_io; address_space *m_io;
int m_icount;
// State of processor UINT32 get_ea(UINT16 opcode);
UINT16 m_reg_A; // Register A void do_add(UINT16& addend1 , UINT16 addend2);
UINT16 m_reg_B; // Register B UINT16 get_skip_addr_sc(UINT16 opcode , UINT16& v , unsigned n);
UINT16 m_reg_P; // Register P void do_pw(UINT16 opcode);
UINT16 m_reg_R; // Register R void check_for_interrupts(void);
UINT16 m_reg_C; // Register C void handle_dma(void);
UINT16 m_reg_D; // Register D
UINT16 m_reg_IV; // Register IV
UINT8 m_reg_PA[ HPHYBRID_INT_LVLS + 1 ]; // Stack of register PA (4 bit-long)
UINT16 m_flags; // Flags (carry, overflow, cb, db, int en, dma en, dma dir)
UINT8 m_dmapa; // DMA peripheral address (4 bits)
UINT16 m_dmama; // DMA address
UINT16 m_dmac; // DMA counter
UINT16 m_reg_I; // Instruction register
UINT16 get_ea(UINT16 opcode); UINT16 RIO(UINT8 pa , UINT8 ic);
void do_add(UINT16& addend1 , UINT16 addend2); void WIO(UINT8 pa , UINT8 ic , UINT16 v);
UINT16 get_skip_addr(UINT16 opcode , bool condition) const; };
UINT16 get_skip_addr_sc(UINT16 opcode , UINT16& v , unsigned n);
void do_pw(UINT16 opcode);
void check_for_interrupts(void);
void handle_dma(void);
UINT16 RM(UINT16 addr); class hp_5061_3001_cpu_device : public hp_hybrid_cpu_device
void WM(UINT16 addr , UINT16 v); {
void WMB(UINT32 addr , UINT8 v); public:
UINT16 RIO(UINT8 pa , UINT8 ic); hp_5061_3001_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
void WIO(UINT8 pa , UINT8 ic , UINT16 v);
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();
virtual UINT32 execute_max_cycles() const { return 237; } // FMP 15
static UINT8 do_dec_shift_r(UINT8 d1 , UINT64& mantissa);
static UINT8 do_dec_shift_l(UINT8 d12 , UINT64& mantissa);
UINT64 get_ar1(void);
void set_ar1(UINT64 v);
UINT64 get_ar2(void) const;
void set_ar2(UINT64 v);
UINT64 do_mrxy(UINT64 ar);
bool do_dec_add(bool carry_in , UINT64& a , UINT64 b);
void do_mpy(void);
virtual UINT16 execute_no_bpc_ioc(UINT16 opcode);
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
virtual UINT32 add_mae(aec_cases_t aec_case , UINT16 addr);
virtual UINT16 read_non_common_reg(UINT16 addr);
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)
UINT16 m_reg_r25; // R25 register
UINT16 m_reg_r26; // R26 register
UINT16 m_reg_r27; // R27 register
UINT16 m_reg_aec[ HP_REG_R37_ADDR - HP_REG_R32_ADDR + 1 ]; // AEC registers R32-R37
}; };
class hp_5061_3011_cpu_device : public hp_hybrid_cpu_device class hp_5061_3011_cpu_device : public hp_hybrid_cpu_device
{ {
public: public:
hp_5061_3011_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); hp_5061_3011_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
virtual UINT32 execute_max_cycles() const { return 25; }
virtual UINT16 execute_no_bpc_ioc(UINT16 opcode);
virtual UINT32 add_mae(aec_cases_t aec_case , UINT16 addr);
virtual UINT16 read_non_common_reg(UINT16 addr);
virtual void write_non_common_reg(UINT16 addr , UINT16 v);
}; };
extern const device_type HP_5061_3001;
extern const device_type HP_5061_3011; extern const device_type HP_5061_3011;
#endif /* _HPHYBRID_H_ */ #endif /* _HPHYBRID_H_ */

View File

@ -8,7 +8,7 @@
#include "debugger.h" #include "debugger.h"
#include "hphybrid.h" #include "hphybrid.h"
typedef void (*fn_dis_param)(char *buffer , offs_t pc , UINT16 opcode); typedef void (*fn_dis_param)(char *buffer , offs_t pc , UINT16 opcode , bool is_3001);
typedef struct { typedef struct {
UINT16 m_op_mask; UINT16 m_op_mask;
@ -18,84 +18,160 @@ typedef struct {
UINT32 m_dasm_flags; UINT32 m_dasm_flags;
} dis_entry_t; } dis_entry_t;
static void addr_2_str(char *buffer , UINT16 addr , bool indirect) static void addr_2_str(char *buffer , UINT16 addr , bool indirect , bool is_3001)
{ {
char *s = buffer + strlen(buffer); char *s = buffer + strlen(buffer);
s += sprintf(s , "$%04x" , addr); s += sprintf(s , "$%04x" , addr);
switch (addr) { if (is_3001) {
case HP_REG_A_ADDR: switch (addr) {
strcpy(s , "(A)"); case HP_REG_AR1_ADDR:
break; strcpy(s , "(Ar1)");
break;
case HP_REG_B_ADDR: case HP_REG_AR1_ADDR + 1:
strcpy(s , "(B)"); strcpy(s , "(Ar1_2)");
break; break;
case HP_REG_P_ADDR: case HP_REG_AR1_ADDR + 2:
strcpy(s , "(P)"); strcpy(s , "(Ar1_3)");
break; break;
case HP_REG_R_ADDR: case HP_REG_AR1_ADDR + 3:
strcpy(s , "(R)"); strcpy(s , "(Ar1_4)");
break; break;
case HP_REG_R4_ADDR: case HP_REG_AR2_ADDR:
strcpy(s , "(R4)"); strcpy(s , "(Ar2)");
break; break;
case HP_REG_R5_ADDR: case HP_REG_AR2_ADDR + 1:
strcpy(s , "(R5)"); strcpy(s , "(Ar2_2)");
break; break;
case HP_REG_R6_ADDR: case HP_REG_AR2_ADDR + 2:
strcpy(s , "(R6)"); strcpy(s , "(Ar2_3)");
break; break;
case HP_REG_R7_ADDR: case HP_REG_AR2_ADDR + 3:
strcpy(s , "(R7)"); strcpy(s , "(Ar2_4)");
break; break;
case HP_REG_IV_ADDR: case HP_REG_SE_ADDR:
strcpy(s , "(IV)"); strcpy(s , "(SE)");
break; break;
case HP_REG_PA_ADDR: case HP_REG_R25_ADDR:
strcpy(s , "(PA)"); strcpy(s , "(R25)");
break; break;
case HP_REG_DMAPA_ADDR: case HP_REG_R26_ADDR:
strcpy(s , "(DMAPA)"); strcpy(s , "(R26)");
break; break;
case HP_REG_DMAMA_ADDR: case HP_REG_R27_ADDR:
strcpy(s , "(DMAMA)"); strcpy(s , "(R27)");
break; break;
case HP_REG_DMAC_ADDR: case HP_REG_R32_ADDR:
strcpy(s , "(DMAC)"); strcpy(s , "(R32)");
break; break;
case HP_REG_C_ADDR: case HP_REG_R33_ADDR:
strcpy(s , "(C)"); strcpy(s , "(R33)");
break; break;
case HP_REG_D_ADDR: case HP_REG_R34_ADDR:
strcpy(s , "(D)"); strcpy(s , "(R34)");
break; break;
}
if (indirect) { case HP_REG_R35_ADDR:
strcat(s , ",I"); strcpy(s , "(R35)");
} break;
case HP_REG_R36_ADDR:
strcpy(s , "(R36)");
break;
case HP_REG_R37_ADDR:
strcpy(s , "(R37)");
break;
}
}
switch (addr) {
case HP_REG_A_ADDR:
strcpy(s , "(A)");
break;
case HP_REG_B_ADDR:
strcpy(s , "(B)");
break;
case HP_REG_P_ADDR:
strcpy(s , "(P)");
break;
case HP_REG_R_ADDR:
strcpy(s , "(R)");
break;
case HP_REG_R4_ADDR:
strcpy(s , "(R4)");
break;
case HP_REG_R5_ADDR:
strcpy(s , "(R5)");
break;
case HP_REG_R6_ADDR:
strcpy(s , "(R6)");
break;
case HP_REG_R7_ADDR:
strcpy(s , "(R7)");
break;
case HP_REG_IV_ADDR:
strcpy(s , "(IV)");
break;
case HP_REG_PA_ADDR:
strcpy(s , "(PA)");
break;
case HP_REG_DMAPA_ADDR:
strcpy(s , "(DMAPA)");
break;
case HP_REG_DMAMA_ADDR:
strcpy(s , "(DMAMA)");
break;
case HP_REG_DMAC_ADDR:
strcpy(s , "(DMAC)");
break;
case HP_REG_C_ADDR:
strcpy(s , "(C)");
break;
case HP_REG_D_ADDR:
strcpy(s , "(D)");
break;
}
if (indirect) {
strcat(s , ",I");
}
} }
static void param_none(char *buffer , offs_t pc , UINT16 opcode) static void param_none(char *buffer , offs_t pc , UINT16 opcode , bool is_3001)
{ {
} }
static void param_loc(char *buffer , offs_t pc , UINT16 opcode) static void param_loc(char *buffer , offs_t pc , UINT16 opcode , bool is_3001)
{ {
UINT16 base; UINT16 base;
UINT16 off; UINT16 off;
@ -113,26 +189,26 @@ static void param_loc(char *buffer , offs_t pc , UINT16 opcode)
off -= 0x400; off -= 0x400;
} }
addr_2_str(buffer , base + off , (opcode & 0x8000) != 0); addr_2_str(buffer , base + off , (opcode & 0x8000) != 0 , is_3001);
} }
static void param_addr32(char *buffer , offs_t pc , UINT16 opcode) static void param_addr32(char *buffer , offs_t pc , UINT16 opcode , bool is_3001)
{ {
addr_2_str(buffer , opcode & 0x1f , (opcode & 0x8000) != 0); addr_2_str(buffer , opcode & 0x1f , (opcode & 0x8000) != 0 , is_3001);
} }
static void param_skip(char *buffer , offs_t pc , UINT16 opcode) static void param_skip(char *buffer , offs_t pc , UINT16 opcode , bool is_3001)
{ {
UINT16 off = opcode & 0x3f; UINT16 off = opcode & 0x3f;
if (off & 0x20) { if (off & 0x20) {
off -= 0x40; off -= 0x40;
} }
addr_2_str(buffer , pc + off , false); addr_2_str(buffer , pc + off , false , is_3001);
} }
static void param_skip_sc(char *buffer , offs_t pc , UINT16 opcode) static void param_skip_sc(char *buffer , offs_t pc , UINT16 opcode , bool is_3001)
{ {
param_skip(buffer, pc, opcode); param_skip(buffer, pc, opcode , is_3001);
if (opcode & 0x80) { if (opcode & 0x80) {
if (opcode & 0x40) { if (opcode & 0x40) {
@ -143,7 +219,7 @@ static void param_skip_sc(char *buffer , offs_t pc , UINT16 opcode)
} }
} }
static void param_ret(char *buffer , offs_t pc , UINT16 opcode) static void param_ret(char *buffer , offs_t pc , UINT16 opcode , bool is_3001)
{ {
char *s = buffer + strlen(buffer); char *s = buffer + strlen(buffer);
@ -159,16 +235,16 @@ static void param_ret(char *buffer , offs_t pc , UINT16 opcode)
} }
} }
static void param_n16(char *buffer , offs_t pc , UINT16 opcode) static void param_n16(char *buffer , offs_t pc , UINT16 opcode , bool is_3001)
{ {
char *s = buffer + strlen(buffer); char *s = buffer + strlen(buffer);
sprintf(s , "%u" , (opcode & 0xf) + 1); sprintf(s , "%u" , (opcode & 0xf) + 1);
} }
static void param_reg_id(char *buffer , offs_t pc , UINT16 opcode) static void param_reg_id(char *buffer , offs_t pc , UINT16 opcode , bool is_3001)
{ {
addr_2_str(buffer, opcode & 7, false); addr_2_str(buffer, opcode & 7, false , is_3001);
if (opcode & 0x80) { if (opcode & 0x80) {
strcat(buffer , ",D"); strcat(buffer , ",D");
@ -260,22 +336,78 @@ static const dis_entry_t dis_table[] = {
{0 , 0 , nullptr , nullptr , 0 } {0 , 0 , nullptr , nullptr , 0 }
}; };
static const dis_entry_t dis_table_emc[] = {
// *** EMC Instructions ***
{0xffff , 0x7200 , "MWA" , param_none , 0 },
{0xffff , 0x7220 , "CMY" , param_none , 0 },
{0xffff , 0x7260 , "CMX" , param_none , 0 },
{0xffff , 0x7280 , "FXA" , param_none , 0 },
{0xfff0 , 0x7300 , "XFR" , param_n16 , 0 },
{0xffff , 0x7340 , "NRM" , param_none , 0 },
{0xfff0 , 0x7380 , "CLR" , param_n16 , 0 },
{0xffff , 0x73c0 , "CDC" , param_none , 0 },
{0xffc0 , 0x74c0 , "SDS" , param_skip , 0 },
{0xffc0 , 0x75c0 , "SDC" , param_skip , 0 },
{0xffff , 0x7a00 , "FMP" , param_none , 0 },
{0xffff , 0x7a21 , "FDV" , param_none , 0 },
{0xffff , 0x7b00 , "MRX" , param_none , 0 },
{0xffff , 0x7b21 , "DRS" , param_none , 0 },
{0xffff , 0x7b40 , "MRY" , param_none , 0 },
{0xffff , 0x7b61 , "MLY" , param_none , 0 },
{0xffff , 0x7b8f , "MPY" , param_none , 0 },
// *** END ***
{0 , 0 , NULL , NULL , 0 }
};
static offs_t disassemble_table(UINT16 opcode , offs_t pc , const dis_entry_t *table , bool is_3001 , char *buffer)
{
const dis_entry_t *p;
for (p = table; p->m_op_mask; p++) {
if ((opcode & p->m_op_mask) == p->m_opcode) {
strcpy(buffer , p->m_mnemonic);
strcat(buffer , " ");
p->m_param_fn(buffer , pc , opcode , is_3001);
return 1 | p->m_dasm_flags | DASMFLAG_SUPPORTED;
}
}
return 0;
}
CPU_DISASSEMBLE(hp_hybrid) CPU_DISASSEMBLE(hp_hybrid)
{ {
UINT16 opcode = ((UINT16)oprom[ 0 ] << 8) | oprom[ 1 ]; UINT16 opcode = ((UINT16)oprom[ 0 ] << 8) | oprom[ 1 ];
const dis_entry_t *p; offs_t res;
for (p = dis_table; p->m_op_mask; p++) { res = disassemble_table(opcode , pc , dis_table , false , buffer);
if ((opcode & p->m_op_mask) == p->m_opcode) {
strcpy(buffer , p->m_mnemonic);
strcat(buffer , " ");
p->m_param_fn(buffer , pc , opcode);
return 1 | p->m_dasm_flags | DASMFLAG_SUPPORTED;
}
}
// Unknown opcode if (res == 0) {
strcpy(buffer , "???"); // Unknown opcode
strcpy(buffer , "???");
res = 1 | DASMFLAG_SUPPORTED;
}
return 1 | DASMFLAG_SUPPORTED; return res;
} }
CPU_DISASSEMBLE(hp_5061_3001)
{
UINT16 opcode = ((UINT16)oprom[ 0 ] << 8) | oprom[ 1 ];
offs_t res;
res = disassemble_table(opcode , pc , dis_table_emc , true , buffer);
if (res == 0) {
res = disassemble_table(opcode , pc , dis_table , true , buffer);
}
if (res == 0) {
// Unknown opcode
strcpy(buffer , "???");
res = 1 | DASMFLAG_SUPPORTED;
}
return res;
}

View File

@ -1,5 +1,5 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders:Curt Coder // copyright-holders:Curt Coder, F. Ulivi
/* /*
HP 9845 HP 9845
@ -7,10 +7,51 @@
http://www.hp9845.net/ http://www.hp9845.net/
*/ */
// **************************
// Driver for HP 9845B system
// **************************
//
// What's in:
// - Emulation of both 5061-3001 CPUs
// - LPU & PPU ROMs
// - LPU & PPU RAMs
// - Text mode screen
// - Keyboard (most of keys)
// What's not yet in:
// - Beeper
// - Rest of keyboard
// - Graphic screen
// - Tape drive (this needs some heavy RE of the TACO chip)
// - Better documentation of this file
// - Software list to load optional ROMs
// What's wrong:
// - I'm using character generator from HP64K (another driver of mine): no known dump of the original one
// - Speed, as usual
// - There are a couple of undocumented opcodes that PPU executes at each keyboard interrupt: don't know if ignoring them is a Bad Thing (tm) or not
#include "emu.h" #include "emu.h"
#include "cpu/z80/z80.h" #include "cpu/z80/z80.h"
#include "softlist.h" #include "softlist.h"
#include "cpu/hphybrid/hphybrid.h"
#define BIT_MASK(n) (1U << (n))
// Macros to clear/set single bits
#define BIT_CLR(w , n) ((w) &= ~BIT_MASK(n))
#define BIT_SET(w , n) ((w) |= BIT_MASK(n))
// Base address of video buffer
#define VIDEO_BUFFER_BASE 0x17000
#define MAX_WORD_PER_ROW 600
#define VIDEO_CHAR_WIDTH 9
#define VIDEO_CHAR_HEIGHT 15
#define VIDEO_CHAR_COLUMNS 80
#define VIDEO_CHAR_ROWS 25
#define VIDEO_ACTIVE_SCANLINES (VIDEO_CHAR_HEIGHT * VIDEO_CHAR_ROWS)
#define KEY_SCAN_OSCILLATOR 327680
class hp9845_state : public driver_device class hp9845_state : public driver_device
{ {
@ -25,11 +66,530 @@ public:
static INPUT_PORTS_START( hp9845 ) static INPUT_PORTS_START( hp9845 )
INPUT_PORTS_END INPUT_PORTS_END
class hp9845b_state : public driver_device
{
public:
hp9845b_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_lpu(*this , "lpu"),
m_ppu(*this , "ppu"),
m_palette(*this , "palette"),
m_io_key0(*this , "KEY0"),
m_io_key1(*this , "KEY1"),
m_io_key2(*this , "KEY2"),
m_io_key3(*this , "KEY3")
{ }
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
virtual void machine_start();
virtual void machine_reset();
TIMER_DEVICE_CALLBACK_MEMBER(scanline_timer);
void vblank_w(screen_device &screen, bool state);
IRQ_CALLBACK_MEMBER(irq_callback);
void update_irl(void);
TIMER_DEVICE_CALLBACK_MEMBER(kb_scan);
DECLARE_READ16_MEMBER(kb_scancode_r);
DECLARE_READ16_MEMBER(kb_status_r);
DECLARE_WRITE16_MEMBER(kb_irq_clear_w);
DECLARE_WRITE8_MEMBER(pa_w);
private:
required_device<hp_5061_3001_cpu_device> m_lpu;
required_device<hp_5061_3001_cpu_device> m_ppu;
required_device<palette_device> m_palette;
required_ioport m_io_key0;
required_ioport m_io_key1;
required_ioport m_io_key2;
required_ioport m_io_key3;
void set_video_mar(UINT16 mar);
void video_fill_buff(bool buff_idx);
void video_render_buff(unsigned line_in_row, bool buff_idx);
// Character generator
const UINT8 *m_chargen;
// Text mode video I/F
typedef struct {
UINT8 chars[ 80 ];
UINT8 attrs[ 80 ];
bool full;
} video_buffer_t;
bitmap_rgb32 m_bitmap;
unsigned m_video_scanline;
offs_t m_video_mar;
UINT16 m_video_word;
bool m_video_load_mar;
bool m_video_byte_idx;
UINT8 m_video_attr;
bool m_video_buff_idx;
bool m_video_blanked;
UINT8 m_video_frame;
video_buffer_t m_video_buff[ 2 ];
// Interrupt handling
UINT8 m_irl_pending;
// State of keyboard
ioport_value m_kb_state[ 4 ];
UINT8 m_kb_scancode;
UINT16 m_kb_status;
};
static INPUT_PORTS_START(hp9845b)
// Keyboard is arranged in a 8 x 16 matrix. Of the 128 possible positions, 118 are used.
// Keys are mapped on bit b of KEYn
// where b = (row & 1) << 4 + column, n = row >> 1
// column = [0..15]
// row = [0..7]
PORT_START("KEY0")
PORT_BIT(BIT_MASK(0) , IP_ACTIVE_HIGH , IPT_UNUSED) // N/U
PORT_BIT(BIT_MASK(1) , IP_ACTIVE_HIGH , IPT_UNUSED) // Print All
PORT_BIT(BIT_MASK(2) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP +
PORT_BIT(BIT_MASK(3) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP ,
PORT_BIT(BIT_MASK(4) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP .
PORT_BIT(BIT_MASK(5) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP 0
PORT_BIT(BIT_MASK(6) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F12) PORT_NAME("Execute") // Execute
PORT_BIT(BIT_MASK(7) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F11) PORT_NAME("Cont") // Cont
PORT_BIT(BIT_MASK(8) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) // Right
PORT_BIT(BIT_MASK(9) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') // Space
PORT_BIT(BIT_MASK(10) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') // /
PORT_BIT(BIT_MASK(11) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') // <
PORT_BIT(BIT_MASK(12) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') // N
PORT_BIT(BIT_MASK(13) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') // V
PORT_BIT(BIT_MASK(14) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') // X
PORT_BIT(BIT_MASK(15) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) // Shift
PORT_BIT(BIT_MASK(16) , IP_ACTIVE_HIGH , IPT_UNUSED) // N/U
PORT_BIT(BIT_MASK(17) , IP_ACTIVE_HIGH , IPT_UNUSED) // Auto Start
PORT_BIT(BIT_MASK(18) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP -
PORT_BIT(BIT_MASK(19) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP 3
PORT_BIT(BIT_MASK(20) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP 2
PORT_BIT(BIT_MASK(21) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP 1
PORT_BIT(BIT_MASK(22) , IP_ACTIVE_HIGH , IPT_UNUSED) // N/U
PORT_BIT(BIT_MASK(23) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) // Left
PORT_BIT(BIT_MASK(24) , IP_ACTIVE_HIGH , IPT_UNUSED) // Repeat
PORT_BIT(BIT_MASK(25) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) // Down
PORT_BIT(BIT_MASK(26) , IP_ACTIVE_HIGH , IPT_UNUSED) // N/U
PORT_BIT(BIT_MASK(27) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') // >
PORT_BIT(BIT_MASK(28) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') // M
PORT_BIT(BIT_MASK(29) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') // B
PORT_BIT(BIT_MASK(30) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') // C
PORT_BIT(BIT_MASK(31) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') // Z
PORT_START("KEY1")
PORT_BIT(BIT_MASK(0) , IP_ACTIVE_HIGH , IPT_UNUSED) // N/U
PORT_BIT(BIT_MASK(1) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_INSERT) PORT_NAME("INSCHAR") // Ins Char
PORT_BIT(BIT_MASK(2) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP *
PORT_BIT(BIT_MASK(3) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP 6
PORT_BIT(BIT_MASK(4) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP 5
PORT_BIT(BIT_MASK(5) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP 4
PORT_BIT(BIT_MASK(6) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP =
PORT_BIT(BIT_MASK(7) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F10) PORT_NAME("Pause") // Pause
PORT_BIT(BIT_MASK(8) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) // Up
PORT_BIT(BIT_MASK(9) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) // Store
PORT_BIT(BIT_MASK(10) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') // :
PORT_BIT(BIT_MASK(11) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') // K
PORT_BIT(BIT_MASK(12) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') // H
PORT_BIT(BIT_MASK(13) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') // F
PORT_BIT(BIT_MASK(14) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') // S
PORT_BIT(BIT_MASK(15) , IP_ACTIVE_HIGH , IPT_UNUSED) // N/U
PORT_BIT(BIT_MASK(16) , IP_ACTIVE_HIGH , IPT_UNUSED) // N/U
PORT_BIT(BIT_MASK(17) , IP_ACTIVE_HIGH , IPT_UNUSED) // Ins Ln
PORT_BIT(BIT_MASK(18) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP /
PORT_BIT(BIT_MASK(19) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP 9
PORT_BIT(BIT_MASK(20) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP 8
PORT_BIT(BIT_MASK(21) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP 7
PORT_BIT(BIT_MASK(22) , IP_ACTIVE_HIGH , IPT_UNUSED) // Result
PORT_BIT(BIT_MASK(23) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F9) PORT_NAME("Run") // Run
PORT_BIT(BIT_MASK(24) , IP_ACTIVE_HIGH , IPT_UNUSED) // N/U
PORT_BIT(BIT_MASK(25) , IP_ACTIVE_HIGH , IPT_UNUSED) // N/U
PORT_BIT(BIT_MASK(26) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('"') // "
PORT_BIT(BIT_MASK(27) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') // L
PORT_BIT(BIT_MASK(28) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') // J
PORT_BIT(BIT_MASK(29) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') // G
PORT_BIT(BIT_MASK(30) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') // D
PORT_BIT(BIT_MASK(31) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') // A
PORT_START("KEY2")
PORT_BIT(BIT_MASK(0) , IP_ACTIVE_HIGH , IPT_UNUSED) // N/U
PORT_BIT(BIT_MASK(1) , IP_ACTIVE_HIGH , IPT_UNUSED) // Del Ln
PORT_BIT(BIT_MASK(2) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP ^
PORT_BIT(BIT_MASK(3) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP )
PORT_BIT(BIT_MASK(4) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP (
PORT_BIT(BIT_MASK(5) , IP_ACTIVE_HIGH , IPT_UNUSED) // KP E
PORT_BIT(BIT_MASK(6) , IP_ACTIVE_HIGH , IPT_UNUSED) // Clear Line
PORT_BIT(BIT_MASK(7) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F8) PORT_NAME("Stop") // Stop
PORT_BIT(BIT_MASK(8) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') // |
PORT_BIT(BIT_MASK(9) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') // ]
PORT_BIT(BIT_MASK(10) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') // P
PORT_BIT(BIT_MASK(11) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') // I
PORT_BIT(BIT_MASK(12) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') // Y
PORT_BIT(BIT_MASK(13) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') // R
PORT_BIT(BIT_MASK(14) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') // W
PORT_BIT(BIT_MASK(15) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) // Control
PORT_BIT(BIT_MASK(16) , IP_ACTIVE_HIGH , IPT_UNUSED) // Typwtr
PORT_BIT(BIT_MASK(17) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL) PORT_NAME("DELCHAR") // Del Char
PORT_BIT(BIT_MASK(18) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_PGDN) PORT_NAME("ROLLDOWN") // Roll down
PORT_BIT(BIT_MASK(19) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_PGUP) PORT_NAME("ROLLUP") // Roll up
PORT_BIT(BIT_MASK(20) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_HOME) PORT_NAME("HOME") // Home
PORT_BIT(BIT_MASK(21) , IP_ACTIVE_HIGH , IPT_UNUSED) // Clr to end
PORT_BIT(BIT_MASK(22) , IP_ACTIVE_HIGH , IPT_UNUSED) // Clear
PORT_BIT(BIT_MASK(23) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR('~') // ~
PORT_BIT(BIT_MASK(24) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) // BS
PORT_BIT(BIT_MASK(25) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') // +
PORT_BIT(BIT_MASK(26) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') // [
PORT_BIT(BIT_MASK(27) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') // O
PORT_BIT(BIT_MASK(28) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') // U
PORT_BIT(BIT_MASK(29) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') // T
PORT_BIT(BIT_MASK(30) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') // E
PORT_BIT(BIT_MASK(31) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') // Q
PORT_START("KEY3")
PORT_BIT(BIT_MASK(0) , IP_ACTIVE_HIGH , IPT_UNUSED) // Tab set
PORT_BIT(BIT_MASK(1) , IP_ACTIVE_HIGH , IPT_UNUSED) // Recall
PORT_BIT(BIT_MASK(2) , IP_ACTIVE_HIGH , IPT_UNUSED) // K15
PORT_BIT(BIT_MASK(3) , IP_ACTIVE_HIGH , IPT_UNUSED) // K14
PORT_BIT(BIT_MASK(4) , IP_ACTIVE_HIGH , IPT_UNUSED) // K13
PORT_BIT(BIT_MASK(5) , IP_ACTIVE_HIGH , IPT_UNUSED) // K12
PORT_BIT(BIT_MASK(6) , IP_ACTIVE_HIGH , IPT_UNUSED) // K11
PORT_BIT(BIT_MASK(7) , IP_ACTIVE_HIGH , IPT_UNUSED) // K10
PORT_BIT(BIT_MASK(8) , IP_ACTIVE_HIGH , IPT_UNUSED) // K9
PORT_BIT(BIT_MASK(9) , IP_ACTIVE_HIGH , IPT_UNUSED) // K8
PORT_BIT(BIT_MASK(10) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') // 0
PORT_BIT(BIT_MASK(11) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') // 8
PORT_BIT(BIT_MASK(12) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') // 6
PORT_BIT(BIT_MASK(13) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') // 4
PORT_BIT(BIT_MASK(14) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') // 2
PORT_BIT(BIT_MASK(15) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') // Tab
PORT_BIT(BIT_MASK(16) , IP_ACTIVE_HIGH , IPT_UNUSED) // Tab clr
PORT_BIT(BIT_MASK(17) , IP_ACTIVE_HIGH , IPT_UNUSED) // Step
PORT_BIT(BIT_MASK(18) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F7) PORT_NAME("K7") // K7
PORT_BIT(BIT_MASK(19) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F6) PORT_NAME("K6") // K6
PORT_BIT(BIT_MASK(20) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F5) PORT_NAME("K5") // K5
PORT_BIT(BIT_MASK(21) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F4) PORT_NAME("K4") // K4
PORT_BIT(BIT_MASK(22) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F3) PORT_NAME("K3") // K3
PORT_BIT(BIT_MASK(23) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F2) PORT_NAME("K2") // K2
PORT_BIT(BIT_MASK(24) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F1) PORT_NAME("K1") // K1
PORT_BIT(BIT_MASK(25) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_ESC) PORT_NAME("K0") // K0
PORT_BIT(BIT_MASK(26) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') // _
PORT_BIT(BIT_MASK(27) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') // 9
PORT_BIT(BIT_MASK(28) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') // 7
PORT_BIT(BIT_MASK(29) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') // 5
PORT_BIT(BIT_MASK(30) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') // 3
PORT_BIT(BIT_MASK(31) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') // 1
INPUT_PORTS_END
UINT32 hp9845_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) UINT32 hp9845_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{ {
return 0; return 0;
} }
UINT32 hp9845b_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect);
return 0;
}
void hp9845b_state::machine_start()
{
machine().first_screen()->register_screen_bitmap(m_bitmap);
m_chargen = memregion("chargen")->base();
}
void hp9845b_state::machine_reset()
{
m_lpu->halt_w(1);
m_ppu->halt_w(0);
// Some sensible defaults
m_video_mar = VIDEO_BUFFER_BASE;
m_video_load_mar = false;
m_video_byte_idx = false;
m_video_attr = 0;
m_video_buff_idx = false;
m_video_blanked = false;
m_video_frame = 0;
m_irl_pending = 0;
memset(&m_kb_state[ 0 ] , 0 , sizeof(m_kb_state));
m_kb_scancode = 0x7f;
m_kb_status = 0;
}
void hp9845b_state::set_video_mar(UINT16 mar)
{
m_video_mar = (mar & 0xfff) | VIDEO_BUFFER_BASE;
}
void hp9845b_state::video_fill_buff(bool buff_idx)
{
unsigned char_idx = 0;
unsigned iters = 0;
UINT8 byte;
address_space& prog_space = m_ppu->space(AS_PROGRAM);
m_video_buff[ buff_idx ].full = false;
while (1) {
if (!m_video_byte_idx) {
if (iters++ >= MAX_WORD_PER_ROW) {
// Limit on accesses per row reached
break;
}
m_video_word = prog_space.read_word(m_video_mar << 1);
if (m_video_load_mar) {
// Load new address into MAR after start of a new frame or NWA instruction
// TODO: decode graphic/alpha mode bit
set_video_mar(~m_video_word);
m_video_load_mar = false;
continue;
} else {
// Read normal word from frame buffer, start parsing at MSB
set_video_mar(m_video_mar + 1);
byte = (UINT8)(m_video_word >> 8);
m_video_byte_idx = true;
}
} else {
// Parse LSB
byte = (UINT8)(m_video_word & 0xff);
m_video_byte_idx = false;
}
if ((byte & 0xc0) == 0x80) {
// Attribute command
m_video_attr = byte & 0x1f;
} else if ((byte & 0xc1) == 0xc0) {
// New Word Address (NWA)
m_video_load_mar = true;
m_video_byte_idx = false;
} else if ((byte & 0xc1) == 0xc1) {
// End of line (EOL)
// Fill rest of buffer with spaces
memset(&m_video_buff[ buff_idx ].chars[ char_idx ] , 0x20 , 80 - char_idx);
memset(&m_video_buff[ buff_idx ].attrs[ char_idx ] , m_video_attr , 80 - char_idx);
m_video_buff[ buff_idx ].full = true;
break;
} else {
// Normal character
m_video_buff[ buff_idx ].chars[ char_idx ] = byte;
m_video_buff[ buff_idx ].attrs[ char_idx ] = m_video_attr;
char_idx++;
if (char_idx == 80) {
m_video_buff[ buff_idx ].full = true;
break;
}
}
}
}
void hp9845b_state::video_render_buff(unsigned line_in_row, bool buff_idx)
{
if (!m_video_buff[ buff_idx ].full) {
m_video_blanked = true;
}
if (m_video_blanked) {
// TODO: blank scanline
} else {
const rgb_t *palette = m_palette->palette()->entry_list_raw();
bool cursor_line = line_in_row == 12;
bool ul_line = line_in_row == 14;
bool cursor_blink = BIT(m_video_frame , 3);
bool char_blink = BIT(m_video_frame , 4);
for (unsigned i = 0; i < 80; i++) {
UINT8 charcode = m_video_buff[ buff_idx ].chars[ i ];
UINT8 attrs = m_video_buff[ buff_idx ].attrs[ i ];
UINT8 chargen_byte = m_chargen[ line_in_row | ((unsigned)charcode << 4) ];
UINT16 pixels;
// TODO: Handle selection of 2nd chargen
// TODO: Check if order of bits in "pixels" is ok
if ((ul_line && BIT(attrs , 3)) ||
(cursor_line && cursor_blink && BIT(attrs , 0))) {
pixels = ~0;
} else if (char_blink && BIT(attrs , 2)) {
pixels = 0;
} else {
pixels = (UINT16)(chargen_byte & 0x7f) << 2;
}
if (BIT(attrs , 1)) {
pixels = ~pixels;
}
for (unsigned j = 0; j < 9; j++) {
bool pixel = (pixels & (1U << (8 - j))) != 0;
m_bitmap.pix32(m_video_scanline , i * 9 + j) = palette[ pixel ? 1 : 0 ];
}
}
}
}
TIMER_DEVICE_CALLBACK_MEMBER(hp9845b_state::scanline_timer)
{
m_video_scanline = param;
if (m_video_scanline < VIDEO_ACTIVE_SCANLINES) {
unsigned row = m_video_scanline / 15;
unsigned line_in_row = m_video_scanline - row * 15;
if (line_in_row == 0) {
// Start of new row, swap buffers
m_video_buff_idx = !m_video_buff_idx;
video_fill_buff(!m_video_buff_idx);
}
video_render_buff(line_in_row , m_video_buff_idx);
}
}
void hp9845b_state::vblank_w(screen_device &screen, bool state)
{
// VBlank signal is fed into HALT flag of PPU
m_ppu->halt_w(state);
if (state) {
// Start of V blank
set_video_mar(0);
m_video_load_mar = true;
m_video_byte_idx = false;
m_video_blanked = false;
m_video_frame++;
m_video_buff_idx = !m_video_buff_idx;
video_fill_buff(!m_video_buff_idx);
}
}
IRQ_CALLBACK_MEMBER(hp9845b_state::irq_callback)
{
if (irqline == HPHYBRID_IRL) {
return m_irl_pending;
} else {
return 0;
}
}
void hp9845b_state::update_irl(void)
{
m_ppu->set_input_line(HPHYBRID_IRL , m_irl_pending != 0);
}
TIMER_DEVICE_CALLBACK_MEMBER(hp9845b_state::kb_scan)
{
ioport_value input[ 4 ];
input[ 0 ] = m_io_key0->read();
input[ 1 ] = m_io_key1->read();
input[ 2 ] = m_io_key2->read();
input[ 3 ] = m_io_key3->read();
// Set status bits for "shift", "control", "auto start" & "print all" keys
// ** Print all **
// (R,C) = (0,1)
// Bit 12 in kb status
if (BIT(input[ 0 ] , 1)) {
BIT_SET(m_kb_status , 12);
BIT_CLR(input[ 0 ] , 1);
} else {
BIT_CLR(m_kb_status, 12);
}
// ** Auto start **
// (R,C) = (1,1)
// Bit 13 in kb status
if (BIT(input[ 0 ] , 17)) {
BIT_SET(m_kb_status , 13);
BIT_CLR(input[ 0 ] , 17);
} else {
BIT_CLR(m_kb_status, 13);
}
// ** Control **
// (R,C) = (4,15)
// Bit 14 in kb status
if (BIT(input[ 2 ] , 15)) {
BIT_SET(m_kb_status , 14);
BIT_CLR(input[ 2 ] , 15);
} else {
BIT_CLR(m_kb_status, 14);
}
// ** Shift **
// (R,C) = (0,15)
// Bit 15 in kb status
if (BIT(input[ 0 ] , 15)) {
BIT_SET(m_kb_status , 15);
BIT_CLR(input[ 0 ] , 15);
} else {
BIT_CLR(m_kb_status, 15);
}
// TODO: handle repeat key
// TODO: handle ctrl+stop
for (unsigned i = 0; i < 128; i++) {
ioport_value mask = BIT_MASK(i & 0x1f);
unsigned idx = i >> 5;
if ((input[ idx ] & ~m_kb_state[ idx ]) & mask) {
// Key pressed, store scancode & generate IRL
m_kb_scancode = i;
BIT_SET(m_irl_pending , 0);
BIT_SET(m_kb_status, 0);
update_irl();
// Special case: pressing stop key sets LPU "status" flag
if (i == 0x47) {
m_lpu->status_w(1);
}
}
}
memcpy(&m_kb_state[ 0 ] , &input[ 0 ] , sizeof(m_kb_state));
}
READ16_MEMBER(hp9845b_state::kb_scancode_r)
{
return ~m_kb_scancode & 0x7f;
}
READ16_MEMBER(hp9845b_state::kb_status_r)
{
return m_kb_status;
}
WRITE16_MEMBER(hp9845b_state::kb_irq_clear_w)
{
BIT_CLR(m_irl_pending , 0);
BIT_CLR(m_kb_status, 0);
update_irl();
m_lpu->status_w(0);
// TODO: beeper start
}
WRITE8_MEMBER(hp9845b_state::pa_w)
{
// TODO: handle sts & flg
if (data == 0xf) {
// RHS tape drive (T15)
m_ppu->status_w(1);
m_ppu->flag_w(1);
} else {
m_ppu->status_w(0);
m_ppu->flag_w(0);
}
}
static MACHINE_CONFIG_START( hp9845a, hp9845_state ) static MACHINE_CONFIG_START( hp9845a, hp9845_state )
//MCFG_CPU_ADD("lpu", HP_5061_3010, XTAL_11_4MHz) //MCFG_CPU_ADD("lpu", HP_5061_3010, XTAL_11_4MHz)
//MCFG_CPU_ADD("ppu", HP_5061_3011, XTAL_11_4MHz) //MCFG_CPU_ADD("ppu", HP_5061_3011, XTAL_11_4MHz)
@ -60,19 +620,50 @@ static MACHINE_CONFIG_START( hp9835a, hp9845_state )
MCFG_SOFTWARE_LIST_ADD("optrom_list", "hp9835a_rom") MCFG_SOFTWARE_LIST_ADD("optrom_list", "hp9835a_rom")
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_START( hp9845b, hp9845_state ) static ADDRESS_MAP_START(global_mem_map , AS_PROGRAM , 16 , hp9845b_state)
//MCFG_CPU_ADD("lpu", HP_5061_3001, XTAL_11_4MHz) ADDRESS_MAP_GLOBAL_MASK(0x3f7fff)
//MCFG_CPU_ADD("ppu", HP_5061_3001, XTAL_11_4MHz) ADDRESS_MAP_UNMAP_LOW
AM_RANGE(0x000000 , 0x007fff) AM_RAM AM_SHARE("lpu_ram")
AM_RANGE(0x014000 , 0x017fff) AM_RAM AM_SHARE("ppu_ram")
AM_RANGE(0x030000 , 0x037fff) AM_ROM AM_REGION("lpu" , 0)
AM_RANGE(0x050000 , 0x057fff) AM_ROM AM_REGION("ppu" , 0)
//AM_RANGE(0x250000 , 0x251fff) AM_ROM AM_REGION("test_rom" , 0)
ADDRESS_MAP_END
static ADDRESS_MAP_START(ppu_io_map , AS_IO , 16 , hp9845b_state)
ADDRESS_MAP_UNMAP_LOW
// PA = 0, IC = 2
// Keyboard scancode input
AM_RANGE(HP_MAKE_IOADDR(0 , 2) , HP_MAKE_IOADDR(0 , 2)) AM_READ(kb_scancode_r)
// PA = 0, IC = 3
// Keyboard status input & keyboard interrupt clear
AM_RANGE(HP_MAKE_IOADDR(0 , 3) , HP_MAKE_IOADDR(0 , 3)) AM_READWRITE(kb_status_r , kb_irq_clear_w)
ADDRESS_MAP_END
static MACHINE_CONFIG_START( hp9845b, hp9845b_state )
MCFG_CPU_ADD("lpu", HP_5061_3001, 5700000)
MCFG_CPU_PROGRAM_MAP(global_mem_map)
MCFG_HPHYBRID_SET_9845_BOOT(true)
MCFG_CPU_ADD("ppu", HP_5061_3001, 5700000)
MCFG_CPU_PROGRAM_MAP(global_mem_map)
MCFG_CPU_IO_MAP(ppu_io_map)
MCFG_HPHYBRID_SET_9845_BOOT(true)
MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(hp9845b_state , irq_callback)
MCFG_HPHYBRID_PA_CHANGED(WRITE8(hp9845b_state , pa_w))
// video hardware // video hardware
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_UPDATE_DRIVER(hp9845_state, screen_update) MCFG_SCREEN_UPDATE_DRIVER(hp9845b_state, screen_update)
MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_RAW_PARAMS(20849400 , 99 * 9 , 0 , 80 * 9 , 26 * 15 , 0 , 25 * 15)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) MCFG_SCREEN_VBLANK_DRIVER(hp9845b_state, vblank_w)
MCFG_SCREEN_SIZE(560, 455) MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
MCFG_SCREEN_VISIBLE_AREA(0, 560-1, 0, 455-1)
MCFG_SOFTWARE_LIST_ADD("optrom_list", "hp9845b_rom") MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", hp9845b_state, scanline_timer, "screen", 0, 1)
// Actual keyboard refresh rate should be KEY_SCAN_OSCILLATOR / 128 (2560 Hz)
MCFG_TIMER_DRIVER_ADD_PERIODIC("kb_timer" , hp9845b_state , kb_scan , attotime::from_hz(100))
MCFG_SOFTWARE_LIST_ADD("optrom_list", "hp9845b_rom")
MACHINE_CONFIG_END MACHINE_CONFIG_END
ROM_START( hp9845a ) ROM_START( hp9845a )
@ -108,6 +699,21 @@ ROM_END
#define rom_hp9835b rom_hp9835a #define rom_hp9835b rom_hp9835a
ROM_START( hp9845b ) ROM_START( hp9845b )
ROM_REGION(0x4000 , "test_rom" , ROMREGION_16BIT | ROMREGION_BE)
ROM_LOAD("09845-66520-45_00-Test_ROM.bin" , 0x0000 , 0x2000 , CRC(95a5b299))
ROM_LOAD("09845-66520-45_10-Test_ROM.bin" , 0x2000 , 0x2000 , CRC(257e4c66))
ROM_REGION(0x800 , "chargen" , 0)
// Don't have the real character generator from HP9845, use the one from HP64000 for now
ROM_LOAD("1818_2668.bin" , 0 , 0x800 , BAD_DUMP CRC(32a52664) SHA1(8b2a49a32510103ff424e8481d5ed9887f609f2f))
ROM_REGION(0x10000, "lpu", ROMREGION_16BIT | ROMREGION_BE)
ROM_LOAD("9845-LPU-Standard-Processor.bin", 0, 0x10000, CRC(dc266c1b) SHA1(1cf3267f13872fbbfc035b70f8b4ec6b5923f182))
ROM_REGION(0x10000, "ppu", ROMREGION_16BIT | ROMREGION_BE)
ROM_LOAD("9845-PPU-Standard-Graphics.bin", 0, 0x10000, CRC(f866510f) SHA1(3e22cd2072e3a5f3603a1eb8477b6b4a198d184d))
#if 0
ROM_REGION( 0200000, "lpu", ROMREGION_16BIT | ROMREGION_BE ) ROM_REGION( 0200000, "lpu", ROMREGION_16BIT | ROMREGION_BE )
ROM_LOAD( "1818-0823-0827-03_00-revb-system_lpu.bin", 0000000, 020000, CRC(7e49c781) SHA1(866c9ebd98d94bb6f99692e29d2d83f55b38c4b6) ) ROM_LOAD( "1818-0823-0827-03_00-revb-system_lpu.bin", 0000000, 020000, CRC(7e49c781) SHA1(866c9ebd98d94bb6f99692e29d2d83f55b38c4b6) )
ROM_LOAD( "1818-0823-0827-03_10-revb-system_lpu.bin", 0020000, 020000, CRC(2f819e3d) SHA1(250886378c3ce2253229997007c7bf0be80a8d1d) ) ROM_LOAD( "1818-0823-0827-03_10-revb-system_lpu.bin", 0020000, 020000, CRC(2f819e3d) SHA1(250886378c3ce2253229997007c7bf0be80a8d1d) )
@ -159,6 +765,7 @@ ROM_START( hp9845b )
ROM_LOAD( "1818-0841-0846-05_20-revd-keyboard_german.bin", 0060000, 020000, CRC(3bf6268a) SHA1(65d7dfeaf34c74dbc86ebe5d3bb65c6bd10163cb) ) ROM_LOAD( "1818-0841-0846-05_20-revd-keyboard_german.bin", 0060000, 020000, CRC(3bf6268a) SHA1(65d7dfeaf34c74dbc86ebe5d3bb65c6bd10163cb) )
ROM_LOAD( "1818-0841-0846-05_30-revc-keyboard_german.bin", 0040000, 020000, CRC(2b83db22) SHA1(6eda714ce05d2d75f4c041e36b6b6df40697d94a) ) ROM_LOAD( "1818-0841-0846-05_30-revc-keyboard_german.bin", 0040000, 020000, CRC(2b83db22) SHA1(6eda714ce05d2d75f4c041e36b6b6df40697d94a) )
ROM_LOAD( "1818-0841-0846-05_30-revd-keyboard_german.bin", 0060000, 020000, CRC(b4006959) SHA1(584a85f746a3b0c262fdf9e4be8e696c80cfd429) ) ROM_LOAD( "1818-0841-0846-05_30-revd-keyboard_german.bin", 0060000, 020000, CRC(b4006959) SHA1(584a85f746a3b0c262fdf9e4be8e696c80cfd429) )
#endif
ROM_END ROM_END
#define rom_hp9845t rom_hp9845b #define rom_hp9845t rom_hp9845b
@ -168,6 +775,6 @@ COMP( 1978, hp9845a, 0, 0, hp9845a, hp9845, driver_device, 0,
COMP( 1978, hp9845s, hp9845a, 0, hp9845a, hp9845, driver_device, 0, "Hewlett-Packard", "9845S", MACHINE_IS_SKELETON | MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) COMP( 1978, hp9845s, hp9845a, 0, hp9845a, hp9845, driver_device, 0, "Hewlett-Packard", "9845S", MACHINE_IS_SKELETON | MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
COMP( 1979, hp9835a, 0, 0, hp9835a, hp9845, driver_device, 0, "Hewlett-Packard", "9835A", MACHINE_IS_SKELETON | MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) COMP( 1979, hp9835a, 0, 0, hp9835a, hp9845, driver_device, 0, "Hewlett-Packard", "9835A", MACHINE_IS_SKELETON | MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
COMP( 1979, hp9835b, hp9835a, 0, hp9835a, hp9845, driver_device, 0, "Hewlett-Packard", "9835B", MACHINE_IS_SKELETON | MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) COMP( 1979, hp9835b, hp9835a, 0, hp9835a, hp9845, driver_device, 0, "Hewlett-Packard", "9835B", MACHINE_IS_SKELETON | MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
COMP( 1980, hp9845b, 0, 0, hp9845b, hp9845, driver_device, 0, "Hewlett-Packard", "9845B", MACHINE_IS_SKELETON | MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) COMP( 1980, hp9845b, 0, 0, hp9845b, hp9845b,driver_device, 0, "Hewlett-Packard", "9845B", MACHINE_NO_SOUND )
COMP( 1980, hp9845t, hp9845b, 0, hp9845b, hp9845, driver_device, 0, "Hewlett-Packard", "9845T", MACHINE_IS_SKELETON | MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) COMP( 1980, hp9845t, hp9845b, 0, hp9845b, hp9845, driver_device, 0, "Hewlett-Packard", "9845T", MACHINE_IS_SKELETON | MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
COMP( 1981, hp9845c, hp9845b, 0, hp9845b, hp9845, driver_device, 0, "Hewlett-Packard", "9845C", MACHINE_IS_SKELETON | MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) COMP( 1981, hp9845c, hp9845b, 0, hp9845b, hp9845, driver_device, 0, "Hewlett-Packard", "9845C", MACHINE_IS_SKELETON | MACHINE_NOT_WORKING | MACHINE_NO_SOUND )