hp9845: put parts common to various 9845 models in a base class to

prepare for 9845C & 9845T drivers
This commit is contained in:
fulivi 2017-02-13 16:11:19 +01:00 committed by Vas Crabb
parent 6474fcd7d8
commit 019b22561b
4 changed files with 118 additions and 94 deletions

View File

@ -74,7 +74,7 @@ void hp9845_io_card_device::flg_w(int state)
void hp9845_io_card_device::install_readwrite_handler(read16_delegate rhandler, write16_delegate whandler) void hp9845_io_card_device::install_readwrite_handler(read16_delegate rhandler, write16_delegate whandler)
{ {
if (m_sys == nullptr) { if (m_sys == nullptr) {
m_sys = dynamic_cast<hp9845b_state*>(&machine().root_device()); m_sys = dynamic_cast<hp9845_base_state*>(&machine().root_device());
//printf("m_sys=%p\n" , m_sys); //printf("m_sys=%p\n" , m_sys);
m_sys->install_readwrite_handler(m_my_sc , rhandler, whandler); m_sys->install_readwrite_handler(m_my_sc , rhandler, whandler);
} }

View File

@ -48,7 +48,7 @@ public:
virtual void device_start() override; virtual void device_start() override;
}; };
class hp9845b_state; class hp9845_base_state;
class hp9845_io_card_device : public device_t, class hp9845_io_card_device : public device_t,
public device_slot_card_interface public device_slot_card_interface
@ -61,7 +61,7 @@ protected:
// device-level overrides // device-level overrides
virtual void device_reset() override; virtual void device_reset() override;
hp9845b_state *m_sys; hp9845_base_state *m_sys;
required_ioport m_select_code_port; required_ioport m_select_code_port;
uint8_t m_my_sc; uint8_t m_my_sc;

View File

@ -7,9 +7,9 @@
http://www.hp9845.net/ http://www.hp9845.net/
*/ */
// ************************** // *******************************
// Driver for HP 9845B system // Driver for HP 9845B/C/T systems
// ************************** // *******************************
// //
// What's in: // What's in:
// - Emulation of both 5061-3001 CPUs // - Emulation of both 5061-3001 CPUs
@ -107,7 +107,7 @@ uint32_t hp9845_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap
return 0; return 0;
} }
static INPUT_PORTS_START(hp9845b) static INPUT_PORTS_START(hp9845_base)
// Keyboard is arranged in a 8 x 16 matrix. Of the 128 possible positions, 118 are used. // 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 // Keys are mapped on bit b of KEYn
// where b = (row & 1) << 4 + column, n = row >> 1 // where b = (row & 1) << 4 + column, n = row >> 1
@ -251,7 +251,10 @@ static INPUT_PORTS_START(hp9845b)
INPUT_PORTS_END INPUT_PORTS_END
hp9845b_state::hp9845b_state(const machine_config &mconfig, device_type type, const char *tag) : // *******************
// hp9845_base_state
// *******************
hp9845_base_state::hp9845_base_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag), driver_device(mconfig, type, tag),
m_lpu(*this , "lpu"), m_lpu(*this , "lpu"),
m_ppu(*this , "ppu"), m_ppu(*this , "ppu"),
@ -273,7 +276,7 @@ hp9845b_state::hp9845b_state(const machine_config &mconfig, device_type type, co
{ {
} }
uint32_t hp9845b_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) uint32_t hp9845_base_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{ {
if (m_graphic_sel) { if (m_graphic_sel) {
copybitmap(bitmap, m_bitmap, 0, 0, GVIDEO_HBEND, GVIDEO_VBEND, cliprect); copybitmap(bitmap, m_bitmap, 0, 0, GVIDEO_HBEND, GVIDEO_VBEND, cliprect);
@ -284,14 +287,14 @@ uint32_t hp9845b_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma
return 0; return 0;
} }
void hp9845b_state::setup_ram_block(unsigned block , unsigned offset) void hp9845_base_state::setup_ram_block(unsigned block , unsigned offset)
{ {
unsigned block_addr = block << 16; unsigned block_addr = block << 16;
m_lpu->space(AS_PROGRAM).install_ram(block_addr , block_addr + 0x7fff , m_ram->pointer() + offset); m_lpu->space(AS_PROGRAM).install_ram(block_addr , block_addr + 0x7fff , m_ram->pointer() + offset);
m_ppu->space(AS_PROGRAM).install_ram(block_addr , block_addr + 0x7fff , m_ram->pointer() + offset); m_ppu->space(AS_PROGRAM).install_ram(block_addr , block_addr + 0x7fff , m_ram->pointer() + offset);
} }
void hp9845b_state::machine_start() void hp9845_base_state::machine_start()
{ {
machine().first_screen()->register_screen_bitmap(m_bitmap); machine().first_screen()->register_screen_bitmap(m_bitmap);
@ -321,7 +324,7 @@ void hp9845b_state::machine_start()
} }
} }
void hp9845b_state::device_reset() void hp9845_base_state::device_reset()
{ {
// FLG & STS are to be reset before sub-devices, // FLG & STS are to be reset before sub-devices,
// because the latter may set the former in their own reset functions // because the latter may set the former in their own reset functions
@ -329,7 +332,7 @@ void hp9845b_state::device_reset()
m_sts_status = 0; m_sts_status = 0;
} }
void hp9845b_state::machine_reset() void hp9845_base_state::machine_reset()
{ {
m_lpu->halt_w(1); m_lpu->halt_w(1);
m_ppu->halt_w(0); m_ppu->halt_w(0);
@ -363,12 +366,12 @@ void hp9845b_state::machine_reset()
logerror("STS=%04x FLG=%04x\n" , m_sts_status , m_flg_status); logerror("STS=%04x FLG=%04x\n" , m_sts_status , m_flg_status);
} }
void hp9845b_state::set_video_mar(uint16_t mar) void hp9845_base_state::set_video_mar(uint16_t mar)
{ {
m_video_mar = (mar & 0xfff) | VIDEO_BUFFER_BASE; m_video_mar = (mar & 0xfff) | VIDEO_BUFFER_BASE;
} }
void hp9845b_state::video_fill_buff(bool buff_idx) void hp9845_base_state::video_fill_buff(bool buff_idx)
{ {
unsigned char_idx = 0; unsigned char_idx = 0;
unsigned iters = 0; unsigned iters = 0;
@ -431,7 +434,7 @@ void hp9845b_state::video_fill_buff(bool buff_idx)
} }
} }
void hp9845b_state::video_render_buff(unsigned video_scanline , unsigned line_in_row, bool buff_idx) void hp9845_base_state::video_render_buff(unsigned video_scanline , unsigned line_in_row, bool buff_idx)
{ {
if (!m_video_buff[ buff_idx ].full) { if (!m_video_buff[ buff_idx ].full) {
m_video_blanked = true; m_video_blanked = true;
@ -481,7 +484,7 @@ void hp9845b_state::video_render_buff(unsigned video_scanline , unsigned line_in
} }
} }
TIMER_DEVICE_CALLBACK_MEMBER(hp9845b_state::scanline_timer) TIMER_DEVICE_CALLBACK_MEMBER(hp9845_base_state::scanline_timer)
{ {
unsigned video_scanline = param; unsigned video_scanline = param;
@ -503,12 +506,12 @@ TIMER_DEVICE_CALLBACK_MEMBER(hp9845b_state::scanline_timer)
} }
} }
TIMER_DEVICE_CALLBACK_MEMBER(hp9845b_state::gv_timer) TIMER_DEVICE_CALLBACK_MEMBER(hp9845_base_state::gv_timer)
{ {
advance_gv_fsm(false , false); advance_gv_fsm(false , false);
} }
void hp9845b_state::vblank_w(screen_device &screen, bool state) void hp9845_base_state::vblank_w(screen_device &screen, bool state)
{ {
// VBlank signal is fed into HALT flag of PPU // VBlank signal is fed into HALT flag of PPU
m_ppu->halt_w(state); m_ppu->halt_w(state);
@ -525,7 +528,7 @@ void hp9845b_state::vblank_w(screen_device &screen, bool state)
} }
} }
void hp9845b_state::set_graphic_mode(bool graphic) void hp9845_base_state::set_graphic_mode(bool graphic)
{ {
if (graphic != m_graphic_sel) { if (graphic != m_graphic_sel) {
m_graphic_sel = graphic; m_graphic_sel = graphic;
@ -542,7 +545,7 @@ void hp9845b_state::set_graphic_mode(bool graphic)
} }
} }
READ16_MEMBER(hp9845b_state::graphic_r) READ16_MEMBER(hp9845_base_state::graphic_r)
{ {
uint16_t res = 0; uint16_t res = 0;
@ -581,7 +584,7 @@ READ16_MEMBER(hp9845b_state::graphic_r)
return res; return res;
} }
WRITE16_MEMBER(hp9845b_state::graphic_w) WRITE16_MEMBER(hp9845_base_state::graphic_w)
{ {
//logerror("wr gv R%u = %04x\n", 4 + offset , data); //logerror("wr gv R%u = %04x\n", 4 + offset , data);
@ -619,7 +622,7 @@ WRITE16_MEMBER(hp9845b_state::graphic_w)
} }
} }
attotime hp9845b_state::time_to_gv_mem_availability(void) const attotime hp9845_base_state::time_to_gv_mem_availability(void) const
{ {
if (m_graphic_sel) { if (m_graphic_sel) {
int hpos = m_screen->hpos(); int hpos = m_screen->hpos();
@ -636,7 +639,7 @@ attotime hp9845b_state::time_to_gv_mem_availability(void) const
} }
} }
void hp9845b_state::advance_gv_fsm(bool ds , bool trigger) void hp9845_base_state::advance_gv_fsm(bool ds , bool trigger)
{ {
bool get_out = false; bool get_out = false;
@ -785,7 +788,7 @@ void hp9845b_state::advance_gv_fsm(bool ds , bool trigger)
update_graphic_bits(); update_graphic_bits();
} }
void hp9845b_state::update_graphic_bits(void) void hp9845_base_state::update_graphic_bits(void)
{ {
bool gv_ready = m_gv_fsm_state == GV_STAT_WAIT_DS_0 || bool gv_ready = m_gv_fsm_state == GV_STAT_WAIT_DS_0 ||
m_gv_fsm_state == GV_STAT_WAIT_DS_1 || m_gv_fsm_state == GV_STAT_WAIT_DS_1 ||
@ -802,7 +805,7 @@ void hp9845b_state::update_graphic_bits(void)
m_ppu->dmar_w(dmar); m_ppu->dmar_w(dmar);
} }
void hp9845b_state::graphic_video_render(unsigned video_scanline) void hp9845_base_state::graphic_video_render(unsigned video_scanline)
{ {
const pen_t *pen = m_palette->pens(); const pen_t *pen = m_palette->pens();
bool yc = (video_scanline + GVIDEO_VCNT_OFF) == (m_gv_cursor_y + 6); bool yc = (video_scanline + GVIDEO_VCNT_OFF) == (m_gv_cursor_y + 6);
@ -841,7 +844,7 @@ void hp9845b_state::graphic_video_render(unsigned video_scanline)
} }
} }
IRQ_CALLBACK_MEMBER(hp9845b_state::irq_callback) IRQ_CALLBACK_MEMBER(hp9845_base_state::irq_callback)
{ {
if (irqline == HPHYBRID_IRL) { if (irqline == HPHYBRID_IRL) {
//logerror("irq ack L %02x\n" , m_irl_pending); //logerror("irq ack L %02x\n" , m_irl_pending);
@ -852,13 +855,13 @@ IRQ_CALLBACK_MEMBER(hp9845b_state::irq_callback)
} }
} }
void hp9845b_state::update_irq(void) void hp9845_base_state::update_irq(void)
{ {
m_ppu->set_input_line(HPHYBRID_IRL , m_irl_pending != 0); m_ppu->set_input_line(HPHYBRID_IRL , m_irl_pending != 0);
m_ppu->set_input_line(HPHYBRID_IRH , m_irh_pending != 0); m_ppu->set_input_line(HPHYBRID_IRH , m_irh_pending != 0);
} }
void hp9845b_state::irq_w(uint8_t sc , int state) void hp9845_base_state::irq_w(uint8_t sc , int state)
{ {
unsigned bit_n = sc % 8; unsigned bit_n = sc % 8;
@ -878,7 +881,7 @@ void hp9845b_state::irq_w(uint8_t sc , int state)
update_irq(); update_irq();
} }
void hp9845b_state::update_flg_sts(void) void hp9845_base_state::update_flg_sts(void)
{ {
bool sts = BIT(m_sts_status , m_pa); bool sts = BIT(m_sts_status , m_pa);
bool flg = BIT(m_flg_status , m_pa); bool flg = BIT(m_flg_status , m_pa);
@ -886,7 +889,7 @@ void hp9845b_state::update_flg_sts(void)
m_ppu->flag_w(flg); m_ppu->flag_w(flg);
} }
void hp9845b_state::sts_w(uint8_t sc , int state) void hp9845_base_state::sts_w(uint8_t sc , int state)
{ {
if (state) { if (state) {
BIT_SET(m_sts_status, sc); BIT_SET(m_sts_status, sc);
@ -898,7 +901,7 @@ void hp9845b_state::sts_w(uint8_t sc , int state)
} }
} }
void hp9845b_state::flg_w(uint8_t sc , int state) void hp9845_base_state::flg_w(uint8_t sc , int state)
{ {
if (state) { if (state) {
BIT_SET(m_flg_status, sc); BIT_SET(m_flg_status, sc);
@ -910,13 +913,13 @@ void hp9845b_state::flg_w(uint8_t sc , int state)
} }
} }
void hp9845b_state::install_readwrite_handler(uint8_t sc , read16_delegate rhandler, write16_delegate whandler) void hp9845_base_state::install_readwrite_handler(uint8_t sc , read16_delegate rhandler, write16_delegate whandler)
{ {
// Install r/w handlers to cover all I/O addresses of PPU belonging to "sc" select code // Install r/w handlers to cover all I/O addresses of PPU belonging to "sc" select code
m_ppu->space(AS_IO).install_readwrite_handler(sc * 4 , sc * 4 + 3 , rhandler , whandler); m_ppu->space(AS_IO).install_readwrite_handler(sc * 4 , sc * 4 + 3 , rhandler , whandler);
} }
TIMER_DEVICE_CALLBACK_MEMBER(hp9845b_state::kb_scan) TIMER_DEVICE_CALLBACK_MEMBER(hp9845_base_state::kb_scan)
{ {
ioport_value input[ 4 ]; ioport_value input[ 4 ];
input[ 0 ] = m_io_key0->read(); input[ 0 ] = m_io_key0->read();
@ -985,17 +988,17 @@ TIMER_DEVICE_CALLBACK_MEMBER(hp9845b_state::kb_scan)
memcpy(&m_kb_state[ 0 ] , &input[ 0 ] , sizeof(m_kb_state)); memcpy(&m_kb_state[ 0 ] , &input[ 0 ] , sizeof(m_kb_state));
} }
READ16_MEMBER(hp9845b_state::kb_scancode_r) READ16_MEMBER(hp9845_base_state::kb_scancode_r)
{ {
return ~m_kb_scancode & 0x7f; return ~m_kb_scancode & 0x7f;
} }
READ16_MEMBER(hp9845b_state::kb_status_r) READ16_MEMBER(hp9845_base_state::kb_status_r)
{ {
return m_kb_status; return m_kb_status;
} }
WRITE16_MEMBER(hp9845b_state::kb_irq_clear_w) WRITE16_MEMBER(hp9845_base_state::kb_irq_clear_w)
{ {
irq_w(0 , 0); irq_w(0 , 0);
BIT_CLR(m_kb_status, 0); BIT_CLR(m_kb_status, 0);
@ -1008,12 +1011,12 @@ WRITE16_MEMBER(hp9845b_state::kb_irq_clear_w)
} }
} }
TIMER_DEVICE_CALLBACK_MEMBER(hp9845b_state::beeper_off) TIMER_DEVICE_CALLBACK_MEMBER(hp9845_base_state::beeper_off)
{ {
m_beeper->set_state(0); m_beeper->set_state(0);
} }
WRITE8_MEMBER(hp9845b_state::pa_w) WRITE8_MEMBER(hp9845_base_state::pa_w)
{ {
if (data != m_pa) { if (data != m_pa) {
m_pa = data; m_pa = data;
@ -1021,21 +1024,38 @@ WRITE8_MEMBER(hp9845b_state::pa_w)
} }
} }
WRITE_LINE_MEMBER(hp9845b_state::t15_irq_w) WRITE_LINE_MEMBER(hp9845_base_state::t15_irq_w)
{ {
irq_w(T15_PA , state); irq_w(T15_PA , state);
} }
WRITE_LINE_MEMBER(hp9845b_state::t15_flg_w) WRITE_LINE_MEMBER(hp9845_base_state::t15_flg_w)
{ {
flg_w(T15_PA , state); flg_w(T15_PA , state);
} }
WRITE_LINE_MEMBER(hp9845b_state::t15_sts_w) WRITE_LINE_MEMBER(hp9845_base_state::t15_sts_w)
{ {
sts_w(T15_PA , state); sts_w(T15_PA , state);
} }
// ***************
// hp9845b_state
// ***************
class hp9845b_state : public hp9845_base_state
{
public:
hp9845b_state(const machine_config &mconfig, device_type type, const char *tag);
private:
};
hp9845b_state::hp9845b_state(const machine_config &mconfig, device_type type, const char *tag)
: hp9845_base_state(mconfig , type , tag)
{
puts("hp9845b_state\n");
}
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)
@ -1095,7 +1115,7 @@ MACHINE_CONFIG_END
- all LPU RAM is dynamically mapped at machine start according to -ramsize option - all LPU RAM is dynamically mapped at machine start according to -ramsize option
*/ */
static ADDRESS_MAP_START(global_mem_map , AS_PROGRAM , 16 , hp9845b_state) static ADDRESS_MAP_START(global_mem_map , AS_PROGRAM , 16 , hp9845_base_state)
ADDRESS_MAP_GLOBAL_MASK(0x3f7fff) ADDRESS_MAP_GLOBAL_MASK(0x3f7fff)
ADDRESS_MAP_UNMAP_LOW ADDRESS_MAP_UNMAP_LOW
AM_RANGE(0x014000 , 0x017fff) AM_RAM AM_SHARE("ppu_ram") AM_RANGE(0x014000 , 0x017fff) AM_RAM AM_SHARE("ppu_ram")
@ -1103,61 +1123,50 @@ static ADDRESS_MAP_START(global_mem_map , AS_PROGRAM , 16 , hp9845b_state)
AM_RANGE(0x050000 , 0x057fff) AM_ROM AM_REGION("ppu" , 0) AM_RANGE(0x050000 , 0x057fff) AM_ROM AM_REGION("ppu" , 0)
ADDRESS_MAP_END ADDRESS_MAP_END
static ADDRESS_MAP_START(ppu_io_map , AS_IO , 16 , hp9845b_state) static ADDRESS_MAP_START(ppu_io_map , AS_IO , 16 , hp9845_base_state)
ADDRESS_MAP_UNMAP_LOW ADDRESS_MAP_UNMAP_LOW
// PA = 0, IC = 2 // PA = 0, IC = 2
// Keyboard scancode input // Keyboard scancode input
AM_RANGE(HP_MAKE_IOADDR(0 , 2) , HP_MAKE_IOADDR(0 , 2)) AM_READ(kb_scancode_r) AM_RANGE(HP_MAKE_IOADDR(0 , 2) , HP_MAKE_IOADDR(0 , 2)) AM_READ(kb_scancode_r)
// PA = 0, IC = 3 // PA = 0, IC = 3
// Keyboard status input & keyboard interrupt clear // 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) AM_RANGE(HP_MAKE_IOADDR(0 , 3) , HP_MAKE_IOADDR(0 , 3)) AM_READWRITE(kb_status_r , kb_irq_clear_w)
// PA = 13, IC = 0..3 // PA = 13, IC = 0..3
// Graphic video // Graphic video
AM_RANGE(HP_MAKE_IOADDR(GVIDEO_PA , 0) , HP_MAKE_IOADDR(GVIDEO_PA , 3)) AM_READWRITE(graphic_r , graphic_w) AM_RANGE(HP_MAKE_IOADDR(GVIDEO_PA , 0) , HP_MAKE_IOADDR(GVIDEO_PA , 3)) AM_READWRITE(graphic_r , graphic_w)
// PA = 15, IC = 0..3 // PA = 15, IC = 0..3
// Right-hand side tape drive (T15) // Right-hand side tape drive (T15)
AM_RANGE(HP_MAKE_IOADDR(T15_PA , 0) , HP_MAKE_IOADDR(T15_PA , 3)) AM_DEVREADWRITE("t15" , hp_taco_device , reg_r , reg_w) AM_RANGE(HP_MAKE_IOADDR(T15_PA , 0) , HP_MAKE_IOADDR(T15_PA , 3)) AM_DEVREADWRITE("t15" , hp_taco_device , reg_r , reg_w)
ADDRESS_MAP_END ADDRESS_MAP_END
static MACHINE_CONFIG_START( hp9845b, hp9845b_state ) static MACHINE_CONFIG_START(hp9845_base, hp9845_base_state)
MCFG_CPU_ADD("lpu", HP_5061_3001, 5700000) MCFG_CPU_ADD("lpu", HP_5061_3001, 5700000)
MCFG_CPU_PROGRAM_MAP(global_mem_map) MCFG_CPU_PROGRAM_MAP(global_mem_map)
MCFG_HPHYBRID_SET_9845_BOOT(true) MCFG_HPHYBRID_SET_9845_BOOT(true)
MCFG_CPU_ADD("ppu", HP_5061_3001, 5700000) MCFG_CPU_ADD("ppu", HP_5061_3001, 5700000)
MCFG_CPU_PROGRAM_MAP(global_mem_map) MCFG_CPU_PROGRAM_MAP(global_mem_map)
MCFG_CPU_IO_MAP(ppu_io_map) MCFG_CPU_IO_MAP(ppu_io_map)
MCFG_HPHYBRID_SET_9845_BOOT(true) MCFG_HPHYBRID_SET_9845_BOOT(true)
MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(hp9845b_state , irq_callback) MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(hp9845_base_state , irq_callback)
MCFG_HPHYBRID_PA_CHANGED(WRITE8(hp9845b_state , pa_w)) MCFG_HPHYBRID_PA_CHANGED(WRITE8(hp9845_base_state , pa_w))
// video hardware MCFG_TIMER_DRIVER_ADD("gv_timer", hp9845_base_state, gv_timer)
MCFG_SCREEN_ADD_MONOCHROME("screen", RASTER, rgb_t::green())
MCFG_SCREEN_UPDATE_DRIVER(hp9845b_state, screen_update)
// These parameters are for alpha video
MCFG_SCREEN_RAW_PARAMS(VIDEO_PIXEL_CLOCK , VIDEO_HTOTAL , 0 , VIDEO_HBSTART , VIDEO_VTOTAL , 0 , VIDEO_ACTIVE_SCANLINES)
MCFG_SCREEN_VBLANK_DRIVER(hp9845b_state, vblank_w)
MCFG_PALETTE_ADD_MONOCHROME_HIGHLIGHT("palette")
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", hp9845b_state, scanline_timer, "screen", 0, 1)
MCFG_TIMER_DRIVER_ADD("gv_timer", hp9845b_state, gv_timer)
MCFG_DEFAULT_LAYOUT(layout_hp9845b)
// Actual keyboard refresh rate should be KEY_SCAN_OSCILLATOR / 128 (2560 Hz) // 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_TIMER_DRIVER_ADD_PERIODIC("kb_timer" , hp9845_base_state , kb_scan , attotime::from_hz(100))
// Beeper // Beeper
MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("beeper" , BEEP , KEY_SCAN_OSCILLATOR / 512) MCFG_SOUND_ADD("beeper" , BEEP , KEY_SCAN_OSCILLATOR / 512)
MCFG_SOUND_ROUTE(ALL_OUTPUTS , "mono" , 1.00) MCFG_SOUND_ROUTE(ALL_OUTPUTS , "mono" , 1.00)
MCFG_TIMER_DRIVER_ADD("beep_timer" , hp9845b_state , beeper_off); MCFG_TIMER_DRIVER_ADD("beep_timer" , hp9845_base_state , beeper_off);
// Tape controller // Tape controller
MCFG_DEVICE_ADD("t15" , HP_TACO , 4000000) MCFG_DEVICE_ADD("t15" , HP_TACO , 4000000)
MCFG_TACO_IRQ_HANDLER(WRITELINE(hp9845b_state , t15_irq_w)) MCFG_TACO_IRQ_HANDLER(WRITELINE(hp9845_base_state , t15_irq_w))
MCFG_TACO_FLG_HANDLER(WRITELINE(hp9845b_state , t15_flg_w)) MCFG_TACO_FLG_HANDLER(WRITELINE(hp9845_base_state , t15_flg_w))
MCFG_TACO_STS_HANDLER(WRITELINE(hp9845b_state , t15_sts_w)) MCFG_TACO_STS_HANDLER(WRITELINE(hp9845_base_state , t15_sts_w))
// In real machine there were 8 slots for LPU ROMs and 8 slots for PPU ROMs in // In real machine there were 8 slots for LPU ROMs and 8 slots for PPU ROMs in
// right-hand side and left-hand side drawers, respectively. // right-hand side and left-hand side drawers, respectively.
@ -1180,8 +1189,6 @@ static MACHINE_CONFIG_START( hp9845b, hp9845b_state )
MCFG_DEVICE_ADD("drawer8", HP_OPTROM_SLOT, 0) MCFG_DEVICE_ADD("drawer8", HP_OPTROM_SLOT, 0)
MCFG_DEVICE_SLOT_INTERFACE(hp_optrom_slot_device, NULL, false) MCFG_DEVICE_SLOT_INTERFACE(hp_optrom_slot_device, NULL, false)
MCFG_SOFTWARE_LIST_ADD("optrom_list", "hp9845b_rom")
// I/O slots // I/O slots
MCFG_HP9845_IO_SLOT_ADD("slot0") MCFG_HP9845_IO_SLOT_ADD("slot0")
MCFG_HP9845_IO_SLOT_ADD("slot1") MCFG_HP9845_IO_SLOT_ADD("slot1")
@ -1194,6 +1201,23 @@ static MACHINE_CONFIG_START( hp9845b, hp9845b_state )
MCFG_RAM_EXTRA_OPTIONS("64K, 320K, 448K") MCFG_RAM_EXTRA_OPTIONS("64K, 320K, 448K")
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED_CLASS(hp9845b, hp9845_base, hp9845b_state)
// video hardware
MCFG_SCREEN_ADD_MONOCHROME("screen", RASTER, rgb_t::green())
MCFG_SCREEN_UPDATE_DRIVER(hp9845_base_state, screen_update)
// These parameters are for alpha video
MCFG_SCREEN_RAW_PARAMS(VIDEO_PIXEL_CLOCK , VIDEO_HTOTAL , 0 , VIDEO_HBSTART , VIDEO_VTOTAL , 0 , VIDEO_ACTIVE_SCANLINES)
MCFG_SCREEN_VBLANK_DRIVER(hp9845_base_state, vblank_w)
MCFG_PALETTE_ADD_MONOCHROME_HIGHLIGHT("palette")
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", hp9845_base_state, scanline_timer, "screen", 0, 1)
MCFG_DEFAULT_LAYOUT(layout_hp9845b)
MCFG_SOFTWARE_LIST_ADD("optrom_list", "hp9845b_rom")
MACHINE_CONFIG_END
ROM_START( hp9845a ) ROM_START( hp9845a )
ROM_REGION( 0200000, "lpu", ROMREGION_16BIT | ROMREGION_BE ) ROM_REGION( 0200000, "lpu", ROMREGION_16BIT | ROMREGION_BE )
ROM_LOAD( "09845-65544-65547-03-system_lpu.bin", 0000000, 0200000, CRC(47beb87f) SHA1(456caefacafcf19435e1e7e68b1c1e4010841664) ) ROM_LOAD( "09845-65544-65547-03-system_lpu.bin", 0000000, 0200000, CRC(47beb87f) SHA1(456caefacafcf19435e1e7e68b1c1e4010841664) )
@ -1301,6 +1325,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, hp9845b,driver_device, 0, "Hewlett-Packard", "9845B", 0 ) COMP( 1980, hp9845b, 0, 0, hp9845b, hp9845_base,driver_device, 0, "Hewlett-Packard", "9845B", 0 )
COMP( 1980, hp9845t, hp9845b, 0, hp9845b, hp9845b,driver_device, 0, "Hewlett-Packard", "9845T", MACHINE_IS_SKELETON | MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) COMP( 1980, hp9845t, hp9845b, 0, hp9845b, hp9845_base,driver_device, 0, "Hewlett-Packard", "9845T", MACHINE_IS_SKELETON | MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
COMP( 1981, hp9845c, hp9845b, 0, hp9845b, hp9845b,driver_device, 0, "Hewlett-Packard", "9845C", MACHINE_IS_SKELETON | MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) COMP( 1981, hp9845c, hp9845b, 0, hp9845b, hp9845_base,driver_device, 0, "Hewlett-Packard", "9845C", MACHINE_IS_SKELETON | MACHINE_NOT_WORKING | MACHINE_NO_SOUND )

View File

@ -1,8 +1,8 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders:F. Ulivi // copyright-holders:F. Ulivi
// ************************** // *******************************
// Driver for HP 9845B system // Driver for HP 9845B/C/T systems
// ************************** // *******************************
#ifndef _HP9845_H_ #ifndef _HP9845_H_
#define _HP9845_H_ #define _HP9845_H_
@ -13,10 +13,10 @@
#include "screen.h" #include "screen.h"
#include "machine/ram.h" #include "machine/ram.h"
class hp9845b_state : public driver_device class hp9845_base_state : public driver_device
{ {
public: public:
hp9845b_state(const machine_config &mconfig, device_type type, const char *tag); hp9845_base_state(const machine_config &mconfig, device_type type, const char *tag);
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
@ -56,7 +56,7 @@ public:
DECLARE_WRITE_LINE_MEMBER(t15_flg_w); DECLARE_WRITE_LINE_MEMBER(t15_flg_w);
DECLARE_WRITE_LINE_MEMBER(t15_sts_w); DECLARE_WRITE_LINE_MEMBER(t15_sts_w);
private: protected:
required_device<hp_5061_3001_cpu_device> m_lpu; required_device<hp_5061_3001_cpu_device> m_lpu;
required_device<hp_5061_3001_cpu_device> m_ppu; required_device<hp_5061_3001_cpu_device> m_ppu;
required_device<screen_device> m_screen; required_device<screen_device> m_screen;