-hp_taco, hd64610: Removed MCFG, nw

This commit is contained in:
mooglyguy 2018-08-28 11:10:25 +02:00
parent 9854bd7f66
commit 18114cb314
4 changed files with 36 additions and 66 deletions

View File

@ -28,25 +28,6 @@
#include "dirtc.h" #include "dirtc.h"
//**************************************************************************
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_HD64610_OUT_IRQ_CB(_devcb) \
downcast<hd64610_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
#define MCFG_HD64610_OUT_1HZ_CB(_devcb) \
downcast<hd64610_device &>(*device).set_out_1hz_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> hd64610_device
class hd64610_device : public device_t, class hd64610_device : public device_t,
public device_rtc_interface, public device_rtc_interface,
public device_nvram_interface public device_nvram_interface
@ -55,8 +36,8 @@ public:
// construction/destruction // construction/destruction
hd64610_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); hd64610_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
template <class Object> devcb_base &set_out_irq_callback(Object &&cb) { return m_out_irq_cb.set_callback(std::forward<Object>(cb)); } auto irq() { return m_out_irq_cb.bind(); }
template <class Object> devcb_base &set_out_1hz_callback(Object &&cb) { return m_out_1hz_cb.set_callback(std::forward<Object>(cb)); } auto clkout() { return m_out_1hz_cb.bind(); }
DECLARE_READ8_MEMBER( read ); DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write ); DECLARE_WRITE8_MEMBER( write );
@ -78,26 +59,23 @@ protected:
virtual void nvram_write(emu_file &file) override; virtual void nvram_write(emu_file &file) override;
private: private:
inline void set_irq_line(); void set_irq_line();
inline uint8_t read_counter(int counter); uint8_t read_counter(int counter);
inline void write_counter(int counter, uint8_t value); void write_counter(int counter, uint8_t value);
inline void check_alarm(); void check_alarm();
static const device_timer_id TIMER_UPDATE_COUNTER = 0; static const device_timer_id TIMER_UPDATE_COUNTER = 0;
devcb_write_line m_out_irq_cb; devcb_write_line m_out_irq_cb;
devcb_write_line m_out_1hz_cb; devcb_write_line m_out_1hz_cb;
uint8_t m_regs[0x10]; // Internal registers uint8_t m_regs[0x10]; // Internal registers
int m_hline_state; // H-Start/Stop line int m_hline_state; // H-Start/Stop line
int m_irq_out; // alarm output int m_irq_out; // alarm output
// timers
emu_timer *m_counter_timer; emu_timer *m_counter_timer;
}; };
// device type definition
DECLARE_DEVICE_TYPE(HD64610, hd64610_device) DECLARE_DEVICE_TYPE(HD64610, hd64610_device)
#endif // MAME_MACHINE_HD64610_H #endif // MAME_MACHINE_HD64610_H

View File

@ -15,15 +15,6 @@
#include "formats/hti_tape.h" #include "formats/hti_tape.h"
#define MCFG_TACO_IRQ_HANDLER(_devcb) \
downcast<hp_taco_device &>(*device).set_irq_handler(DEVCB_##_devcb);
#define MCFG_TACO_FLG_HANDLER(_devcb) \
downcast<hp_taco_device &>(*device).set_flg_handler(DEVCB_##_devcb);
#define MCFG_TACO_STS_HANDLER(_devcb) \
downcast<hp_taco_device &>(*device).set_sts_handler(DEVCB_##_devcb);
class hp_taco_device : public device_t , class hp_taco_device : public device_t ,
public device_image_interface public device_image_interface
{ {
@ -32,9 +23,9 @@ public:
hp_taco_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); hp_taco_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration helpers // configuration helpers
template <class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward<Object>(cb)); } auto irq() { return m_irq_handler.bind(); }
template <class Object> devcb_base &set_flg_handler(Object &&cb) { return m_flg_handler.set_callback(std::forward<Object>(cb)); } auto flg() { return m_flg_handler.bind(); }
template <class Object> devcb_base &set_sts_handler(Object &&cb) { return m_sts_handler.set_callback(std::forward<Object>(cb)); } auto sts() { return m_sts_handler.bind(); }
// Register read/write // Register read/write
DECLARE_WRITE16_MEMBER(reg_w); DECLARE_WRITE16_MEMBER(reg_w);

View File

@ -3763,14 +3763,14 @@ MACHINE_CONFIG_START(hp9845_base_state::hp9845_base)
MCFG_TIMER_DRIVER_ADD("beep_timer" , hp9845_base_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) hp_taco_device &t15(HP_TACO(config , "t15" , 4000000));
MCFG_TACO_IRQ_HANDLER(WRITELINE(*this, hp9845_base_state , t15_irq_w)) t15.irq().set(FUNC(hp9845_base_state::t15_irq_w));
MCFG_TACO_FLG_HANDLER(WRITELINE(*this, hp9845_base_state , t15_flg_w)) t15.flg().set(FUNC(hp9845_base_state::t15_flg_w));
MCFG_TACO_STS_HANDLER(WRITELINE(*this, hp9845_base_state , t15_sts_w)) t15.sts().set(FUNC(hp9845_base_state::t15_sts_w));
MCFG_DEVICE_ADD("t14" , HP_TACO , 4000000) hp_taco_device &t14(HP_TACO(config , "t14" , 4000000));
MCFG_TACO_IRQ_HANDLER(WRITELINE(*this, hp9845_base_state , t14_irq_w)) t14.irq().set(FUNC(hp9845_base_state::t14_irq_w));
MCFG_TACO_FLG_HANDLER(WRITELINE(*this, hp9845_base_state , t14_flg_w)) t14.flg().set(FUNC(hp9845_base_state::t14_flg_w));
MCFG_TACO_STS_HANDLER(WRITELINE(*this, hp9845_base_state , t14_sts_w)) t14.sts().set(FUNC(hp9845_base_state::t14_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.

View File

@ -204,29 +204,30 @@ static GFXDECODE_START( gfx_pda600 )
GFXDECODE_END GFXDECODE_END
MACHINE_CONFIG_START(pda600_state::pda600) void pda600_state::pda600(machine_config &config)
{
/* basic machine hardware */ /* basic machine hardware */
MCFG_DEVICE_ADD("maincpu",Z180, XTAL(14'318'181)) Z180(config, m_maincpu, XTAL(14'318'181));
MCFG_DEVICE_PROGRAM_MAP(pda600_mem) m_maincpu->set_addrmap(AS_PROGRAM, &pda600_state::pda600_mem);
MCFG_DEVICE_IO_MAP(pda600_io) m_maincpu->set_addrmap(AS_IO, &pda600_state::pda600_io);
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", LCD) screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
MCFG_SCREEN_REFRESH_RATE(50) screen.set_refresh_hz(50);
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
MCFG_SCREEN_SIZE(240, 320) screen.set_size(240, 320);
MCFG_SCREEN_VISIBLE_AREA(0, 240-1, 0, 320-1) screen.set_visarea(0, 240-1, 0, 320-1);
MCFG_SCREEN_UPDATE_DRIVER( pda600_state, screen_update ) screen.set_screen_update(FUNC(pda600_state::screen_update));
MCFG_SCREEN_PALETTE("palette") screen.set_palette("palette");
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_pda600) GFXDECODE(config, "gfxdecode", "palette", gfx_pda600);
MCFG_PALETTE_ADD_MONOCHROME("palette") PALETTE(config, "palette", 2).set_init("palette", FUNC(palette_device::palette_init_monochrome));
// NVRAM needs to be filled with random data to fail the checksum and be initialized correctly // NVRAM needs to be filled with random data to fail the checksum and be initialized correctly
NVRAM(config, "nvram", nvram_device::DEFAULT_RANDOM); NVRAM(config, "nvram", nvram_device::DEFAULT_RANDOM);
MCFG_DEVICE_ADD("rtc", HD64610, XTAL(32'768)) HD64610(config, "rtc", XTAL(32'768));
MACHINE_CONFIG_END }
/* ROM definition */ /* ROM definition */
ROM_START( pda600 ) ROM_START( pda600 )