(nw) clean up trivial stuff - the device delegate boilerplate is ugly, I will address it ASAP

This commit is contained in:
Vas Crabb 2019-02-19 20:19:15 +11:00
parent 4f049026f6
commit 7983685096
28 changed files with 148 additions and 108 deletions

View File

@ -187,36 +187,26 @@ protected:
// cartridges (e.g. - Orch-90, Multi-Pak interface) for their control registers, independently
// of the SCS or CTS lines
address_space &cartridge_space();
template<typename R> void install_read_handler(u16 addrstart, u16 addrend, R rhandler)
template <typename R>
void install_read_handler(u16 addrstart, u16 addrend, R &&rhandler)
{
address_space &space(cartridge_space());
space.install_read_handler(addrstart, addrend, rhandler);
space.install_read_handler(addrstart, addrend, std::forward<R>(rhandler));
}
template<typename W> void install_write_handler(u16 addrstart, u16 addrend, W whandler)
template <typename W>
void install_write_handler(u16 addrstart, u16 addrend, W &&whandler)
{
address_space &space(cartridge_space());
space.install_write_handler(addrstart, addrend, whandler);
space.install_write_handler(addrstart, addrend, std::forward<W>(whandler));
}
template<typename R, typename W> void install_readwrite_handler(u16 addrstart, u16 addrend, R rhandler, W whandler)
template <typename R, typename W>
void install_readwrite_handler(u16 addrstart, u16 addrend, R &&rhandler, W &&whandler)
{
address_space &space(cartridge_space());
space.install_read_handler(addrstart, addrend, rhandler);
space.install_write_handler(addrstart, addrend, whandler);
space.install_read_handler(addrstart, addrend, std::forward<R>(rhandler));
space.install_write_handler(addrstart, addrend, std::forward<W>(whandler));
}
void install_read_handler(u16 addrstart, u16 addrend, read8_delegate rhandler) { install_read_handler<read8_delegate>(addrstart, addrend, rhandler); }
void install_write_handler(u16 addrstart, u16 addrend, write8_delegate whandler) { install_write_handler<write8_delegate>(addrstart, addrend, whandler); }
void install_read_handler(u16 addrstart, u16 addrend, read8m_delegate rhandler) { install_read_handler<read8m_delegate>(addrstart, addrend, rhandler); }
void install_write_handler(u16 addrstart, u16 addrend, write8m_delegate whandler) { install_write_handler<write8m_delegate>(addrstart, addrend, whandler); }
void install_read_handler(u16 addrstart, u16 addrend, read8s_delegate rhandler) { install_read_handler<read8s_delegate>(addrstart, addrend, rhandler); }
void install_write_handler(u16 addrstart, u16 addrend, write8s_delegate whandler) { install_write_handler<write8s_delegate>(addrstart, addrend, whandler); }
void install_read_handler(u16 addrstart, u16 addrend, read8sm_delegate rhandler) { install_read_handler<read8sm_delegate>(addrstart, addrend, rhandler); }
void install_write_handler(u16 addrstart, u16 addrend, write8sm_delegate whandler) { install_write_handler<write8sm_delegate>(addrstart, addrend, whandler); }
void install_read_handler(u16 addrstart, u16 addrend, read8mo_delegate rhandler) { install_read_handler<read8mo_delegate>(addrstart, addrend, rhandler); }
void install_write_handler(u16 addrstart, u16 addrend, write8mo_delegate whandler) { install_write_handler<write8mo_delegate>(addrstart, addrend, whandler); }
void install_read_handler(u16 addrstart, u16 addrend, read8smo_delegate rhandler) { install_read_handler<read8smo_delegate>(addrstart, addrend, rhandler); }
void install_write_handler(u16 addrstart, u16 addrend, write8smo_delegate whandler) { install_write_handler<write8smo_delegate>(addrstart, addrend, whandler); }
// setting line values
void set_line_value(cococart_slot_device::line line, cococart_slot_device::line_value value);
void set_line_value(cococart_slot_device::line line, bool value) { set_line_value(line, value ? cococart_slot_device::line_value::ASSERT : cococart_slot_device::line_value::CLEAR); }

View File

@ -89,7 +89,7 @@ void compis_hrg_device::device_add_mconfig(machine_config &config)
UPD7220(config, m_crtc, 2252500); // unknown clock
m_crtc->set_addrmap(0, &compis_hrg_device::hrg_map);
m_crtc->set_display_pixels_callback(FUNC(compis_hrg_device::display_pixels), this);
m_crtc->set_display_pixels(FUNC(compis_hrg_device::display_pixels));
m_crtc->set_screen(SCREEN_TAG);
PALETTE(config, m_palette, palette_device::MONOCHROME);
@ -108,7 +108,7 @@ void compis_uhrg_device::device_add_mconfig(machine_config &config)
UPD7220(config, m_crtc, 2252500*2); // unknown clock
m_crtc->set_addrmap(0, &compis_uhrg_device::uhrg_map);
m_crtc->set_display_pixels_callback(FUNC(compis_uhrg_device::display_pixels), this);
m_crtc->set_display_pixels(FUNC(compis_uhrg_device::display_pixels));
m_crtc->set_screen(SCREEN_TAG);
PALETTE(config, m_palette, palette_device::MONOCHROME);

View File

@ -64,7 +64,7 @@ void isa8_number_9_rev_device::device_add_mconfig(machine_config &config)
UPD7220(config, m_upd7220, XTAL(4'433'619)/2); // unknown clock
m_upd7220->set_addrmap(0, &isa8_number_9_rev_device::upd7220_map);
m_upd7220->set_display_pixels_callback(FUNC(isa8_number_9_rev_device::hgdc_display_pixels), this);
m_upd7220->set_display_pixels(FUNC(isa8_number_9_rev_device::hgdc_display_pixels));
m_upd7220->set_screen("screen");
}

View File

@ -127,12 +127,12 @@ void wangpc_tig_device::device_add_mconfig(machine_config &config)
UPD7220(config, m_hgdc0, XTAL(52'832'000)/28);
m_hgdc0->set_addrmap(0, &wangpc_tig_device::upd7220_0_map);
m_hgdc0->set_draw_text_callback(FUNC(wangpc_tig_device::hgdc_draw_text), this);
m_hgdc0->set_draw_text(FUNC(wangpc_tig_device::hgdc_draw_text));
m_hgdc0->set_screen(SCREEN_TAG);
UPD7220(config, m_hgdc1, XTAL(52'832'000)/28);
m_hgdc1->set_addrmap(0, &wangpc_tig_device::upd7220_1_map);
m_hgdc1->set_display_pixels_callback(FUNC(wangpc_tig_device::hgdc_display_pixels), this);
m_hgdc1->set_display_pixels(FUNC(wangpc_tig_device::hgdc_display_pixels));
m_hgdc1->set_screen(SCREEN_TAG);
}

View File

@ -58,7 +58,7 @@ static inline void ATTR_PRINTF( 3, 4 ) verboselog( device_t *device, int n_level
//**************************************************************************
// device type definition
DEFINE_DEVICE_TYPE(I2CMEM, i2cmem_device, "i2cmem", "I2C Memory")
DEFINE_DEVICE_TYPE(I2CMEM, i2cmem_device, "i2cmem", "I2C Memory")
DEFINE_DEVICE_TYPE(I2C_X2404P, i2c_x2404p_device, "x2404p", "X2404P I2C Memory")
DEFINE_DEVICE_TYPE(I2C_24C01, i2c_24c01_device, "24c01", "24C01 I2C Memory")
DEFINE_DEVICE_TYPE(I2C_24C02, i2c_24c02_device, "24c02", "24C02 I2C Memory")
@ -75,8 +75,15 @@ DEFINE_DEVICE_TYPE(I2C_24C64, i2c_24c64_device, "24c64", "24C64 I2C Memory")
// i2cmem_device - constructor
//-------------------------------------------------
i2cmem_device::i2cmem_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, int page_size, int data_size)
: device_t(mconfig, type, tag, owner, (uint32_t)0),
i2cmem_device::i2cmem_device(
const machine_config &mconfig,
device_type type,
const char *tag,
device_t *owner,
uint32_t clock,
int page_size,
int data_size) :
device_t(mconfig, type, tag, owner, clock),
device_nvram_interface(mconfig, *this),
m_region(*this, DEVICE_SELF),
m_slave_address(I2CMEM_SLAVE_ADDRESS),
@ -93,45 +100,47 @@ i2cmem_device::i2cmem_device(const machine_config &mconfig, device_type type, co
m_shift(0),
m_byteaddr(0)
{
// these memories work off the I2C clock only
assert(!clock);
}
i2cmem_device::i2cmem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: i2cmem_device(mconfig, I2CMEM, tag, owner, 0, 0)
i2cmem_device::i2cmem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
i2cmem_device(mconfig, I2CMEM, tag, owner, clock, 0, 0)
{
}
i2c_x2404p_device::i2c_x2404p_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: i2cmem_device(mconfig, I2C_X2404P, tag, owner, 8, 0x200)
i2c_x2404p_device::i2c_x2404p_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
i2cmem_device(mconfig, I2C_X2404P, tag, owner, clock, 8, 0x200)
{
}
i2c_24c01_device::i2c_24c01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: i2cmem_device(mconfig, I2C_24C01, tag, owner, 4, 0x80)
i2c_24c01_device::i2c_24c01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
i2cmem_device(mconfig, I2C_24C01, tag, owner, clock, 4, 0x80)
{
}
i2c_24c02_device::i2c_24c02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: i2cmem_device(mconfig, I2C_24C02, tag, owner, 4, 0x100)
i2c_24c02_device::i2c_24c02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
i2cmem_device(mconfig, I2C_24C02, tag, owner, clock, 4, 0x100)
{
}
i2c_24c08_device::i2c_24c08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: i2cmem_device(mconfig, I2C_24C08, tag, owner, 0, 0x400)
i2c_24c08_device::i2c_24c08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
i2cmem_device(mconfig, I2C_24C08, tag, owner, clock, 0, 0x400)
{
}
i2c_24c16_device::i2c_24c16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: i2cmem_device(mconfig, I2C_24C16, tag, owner, 8, 0x800)
i2c_24c16_device::i2c_24c16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
i2cmem_device(mconfig, I2C_24C16, tag, owner, clock, 8, 0x800)
{
}
i2c_24c16a_device::i2c_24c16a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: i2cmem_device(mconfig, I2C_24C16A, tag, owner, 0, 0x800)
i2c_24c16a_device::i2c_24c16a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
i2cmem_device(mconfig, I2C_24C16A, tag, owner, clock, 0, 0x800)
{
}
i2c_24c64_device::i2c_24c64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: i2cmem_device(mconfig, I2C_24C64, tag, owner, 8, 0x2000)
i2c_24c64_device::i2c_24c64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
i2cmem_device(mconfig, I2C_24C64, tag, owner, clock, 8, 0x2000)
{
}

View File

@ -55,7 +55,7 @@ public:
protected:
// construction/destruction
i2cmem_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, int page_size, int data_size);
i2cmem_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int page_size, int data_size);
// device-level overrides
virtual void device_start() override;

View File

@ -62,8 +62,47 @@ public:
// construction/destruction
upd7220_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
template <typename... T> void set_display_pixels_callback(T &&... args) { m_display_cb = display_pixels_delegate(std::forward<T>(args)...); }
template <typename... T> void set_draw_text_callback(T &&... args) { m_draw_text_cb = draw_text_delegate(std::forward<T>(args)...); }
// FIXME: these should be aware of current device for resolving the tag
template <class FunctionClass>
void set_display_pixels(void (FunctionClass::*init)(bitmap_rgb32 &, int, int, uint32_t), const char *name)
{
m_display_cb = display_pixels_delegate(init, name, nullptr, static_cast<FunctionClass *>(nullptr));
}
template <class FunctionClass>
void set_display_pixels(void (FunctionClass::*init)(bitmap_rgb32 &, int, int, uint32_t) const, const char *name)
{
m_display_cb = display_pixels_delegate(init, name, nullptr, static_cast<FunctionClass *>(nullptr));
}
template <class FunctionClass>
void set_display_pixels(const char *devname, void (FunctionClass::*init)(bitmap_rgb32 &, int, int, uint32_t), const char *name)
{
m_display_cb = display_pixels_delegate(init, name, devname, static_cast<FunctionClass *>(nullptr));
}
template <class FunctionClass>
void set_display_pixels(const char *devname, void (FunctionClass::*init)(bitmap_rgb32 &, int, int, uint32_t) const, const char *name)
{
m_display_cb = display_pixels_delegate(init, name, devname, static_cast<FunctionClass *>(nullptr));
}
template <class FunctionClass>
void set_draw_text(void (FunctionClass::*init)(bitmap_rgb32 &, uint32_t, int, int, int, int, int, int), const char *name)
{
m_draw_text_cb = draw_text_delegate(init, name, nullptr, static_cast<FunctionClass *>(nullptr));
}
template <class FunctionClass>
void set_draw_text(void (FunctionClass::*init)(bitmap_rgb32 &, uint32_t, int, int, int, int, int, int) const, const char *name)
{
m_draw_text_cb = draw_text_delegate(init, name, nullptr, static_cast<FunctionClass *>(nullptr));
}
template <class FunctionClass>
void set_draw_text(const char *devname, void (FunctionClass::*init)(bitmap_rgb32 &, uint32_t, int, int, int, int, int, int), const char *name)
{
m_draw_text_cb = draw_text_delegate(init, name, devname, static_cast<FunctionClass *>(nullptr));
}
template <class FunctionClass>
void set_draw_text(const char *devname, void (FunctionClass::*init)(bitmap_rgb32 &, uint32_t, int, int, int, int, int, int) const, const char *name)
{
m_draw_text_cb = draw_text_delegate(init, name, devname, static_cast<FunctionClass *>(nullptr));
}
auto drq_wr_callback() { return m_write_drq.bind(); }
auto hsync_wr_callback() { return m_write_hsync.bind(); }

View File

@ -314,23 +314,26 @@ bool finder_base::validate_addrspace(int spacenum, u8 width, bool required) cons
bool finder_base::report_missing(bool found, const char *objname, bool required) const
{
if (required && (strcmp(m_tag, DUMMY_TAG) == 0))
if (required && (DUMMY_TAG == m_tag))
{
osd_printf_error("Tag not defined for required %s\n", objname);
return false;
}
// just pass through in the found case
if (found)
else if (found)
{
// just pass through in the found case
return true;
// otherwise, report
std::string const region_fulltag(m_base.get().subtag(m_tag));
if (required)
osd_printf_error("Required %s '%s' not found\n", objname, region_fulltag.c_str());
}
else
osd_printf_verbose("Optional %s '%s' not found\n", objname, region_fulltag.c_str());
return !required;
{
// otherwise, report
std::string const region_fulltag(m_base.get().subtag(m_tag));
if (required)
osd_printf_error("Required %s '%s' not found\n", objname, region_fulltag.c_str());
else if (DUMMY_TAG != m_tag)
osd_printf_verbose("Optional %s '%s' not found\n", objname, region_fulltag.c_str());
return !required;
}
}
@ -339,7 +342,7 @@ void finder_base::printf_warning(const char *format, ...)
va_list argptr;
char buffer[1024];
/* do the output */
// do the output
va_start(argptr, format);
vsnprintf(buffer, 1024, format, argptr);
osd_printf_warning("%s", buffer);

View File

@ -5,11 +5,11 @@
*
*/
#include <array>
#include "nld_7448.h"
#include "nld_7448.h"
#include "nlid_truthtable.h"
#include <array>
namespace netlist
{
namespace devices

View File

@ -42,14 +42,14 @@ public:
using string_type = typename T::string_type;
using traits_type = typename T::traits_type;
pstring_const_iterator() noexcept : p() { }
constexpr pstring_const_iterator() noexcept : p() { }
explicit constexpr pstring_const_iterator(const typename string_type::const_iterator &x) noexcept : p(x) { }
pstring_const_iterator& operator++() noexcept { p += static_cast<difference_type>(traits_type::codelen(&(*p))); return *this; }
const pstring_const_iterator operator++(int) noexcept { pstring_const_iterator tmp(*this); operator++(); return tmp; }
pstring_const_iterator operator++(int) noexcept { pstring_const_iterator tmp(*this); operator++(); return tmp; }
bool operator==(const pstring_const_iterator& rhs) const noexcept { return p == rhs.p; }
bool operator!=(const pstring_const_iterator& rhs) const noexcept { return p != rhs.p; }
constexpr bool operator==(const pstring_const_iterator& rhs) const noexcept { return p == rhs.p; }
constexpr bool operator!=(const pstring_const_iterator& rhs) const noexcept { return p != rhs.p; }
reference operator*() const noexcept { return *reinterpret_cast<pointer>(&(*p)); }
pointer operator->() const noexcept { return reinterpret_cast<pointer>(&(*p)); }

View File

@ -108,7 +108,7 @@ namespace plib
operator E() const {return m_v;} \
bool operator==(const ename &rhs) const {return m_v == rhs.m_v;} \
bool operator==(const E &rhs) const {return m_v == rhs;} \
const std::string name() const { \
std::string name() const { \
static char const *const strings = # __VA_ARGS__; \
return nthstr(static_cast<int>(m_v), strings); \
} \

View File

@ -31,10 +31,6 @@
#pragma GCC optimize "ivopts"
#endif
#include <algorithm>
#include <cmath> // <<= needed by windows build
#include <memory>
#include "../nl_lists.h"
#include "../plib/pomp.h"
@ -58,6 +54,9 @@
#include "nld_ms_sor_mat.h"
#include "nld_ms_w.h"
#include <algorithm>
#include <cmath>
namespace netlist
{
namespace devices

View File

@ -8,14 +8,14 @@
#ifndef NLD_SOLVER_H_
#define NLD_SOLVER_H_
#include <map>
#include <memory>
#include <vector>
#include "../nl_base.h"
#include "../plib/pstream.h"
#include "nld_matrix_solver.h"
#include <map>
#include <memory>
#include <vector>
//#define ATTR_ALIGNED(N) __attribute__((aligned(N)))
#define ATTR_ALIGNED(N) ATTR_ALIGN

View File

@ -102,8 +102,8 @@ void nichisnd_device::device_add_mconfig(machine_config &config)
DAC_8BIT_R2R(config, "dac2", 0).add_route(ALL_OUTPUTS, "speaker", 0.37); // unknown DAC
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
vref.set_output(5.0);
vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT).add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT).add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT);
}

View File

@ -585,8 +585,8 @@ MACHINE_CONFIG_START(a5105_state::a5105)
/* Devices */
UPD7220(config, m_hgdc, XTAL(15'000'000) / 16); // unk clock
m_hgdc->set_addrmap(0, &a5105_state::upd7220_map);
m_hgdc->set_display_pixels_callback(FUNC(a5105_state::hgdc_display_pixels), this);
m_hgdc->set_draw_text_callback(FUNC(a5105_state::hgdc_draw_text), this);
m_hgdc->set_display_pixels(FUNC(a5105_state::hgdc_display_pixels));
m_hgdc->set_draw_text(FUNC(a5105_state::hgdc_draw_text));
z80ctc_device& ctc(Z80CTC(config, "z80ctc", XTAL(15'000'000) / 4));
ctc.intr_callback().set_inputline(m_maincpu, 0);

View File

@ -995,11 +995,11 @@ MACHINE_CONFIG_START(apc_state::apc)
UPD7220(config, m_hgdc1, 3579545); // unk clock
m_hgdc1->set_addrmap(0, &apc_state::upd7220_1_map);
m_hgdc1->set_draw_text_callback(FUNC(apc_state::hgdc_draw_text), this);
m_hgdc1->set_draw_text(FUNC(apc_state::hgdc_draw_text));
UPD7220(config, m_hgdc2, 3579545); // unk clock
m_hgdc2->set_addrmap(0, &apc_state::upd7220_2_map);
m_hgdc2->set_display_pixels_callback(FUNC(apc_state::hgdc_display_pixels), this);
m_hgdc2->set_display_pixels(FUNC(apc_state::hgdc_display_pixels));
/* sound hardware */
SPEAKER(config, m_speaker).front_center();

View File

@ -882,8 +882,8 @@ MACHINE_CONFIG_START(applix_state::applix)
DAC0800(config, "rdac", 0).add_route(ALL_OUTPUTS, "rspeaker", 1.0); // 74ls374.u20 + dac0800.u21 + 4052.u23
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
vref.set_output(5.0);
vref.add_route(0, "ldac", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "ldac", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "rdac", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "rdac", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "ldac", 1.0, DAC_VREF_POS_INPUT).add_route(0, "ldac", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "rdac", 1.0, DAC_VREF_POS_INPUT).add_route(0, "rdac", -1.0, DAC_VREF_NEG_INPUT);
WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "lspeaker", 0.50);

View File

@ -1268,8 +1268,8 @@ void armedf_state::terraf_sound(machine_config &config)
DAC_8BIT_R2R(config, "dac2", 0).add_route(ALL_OUTPUTS, "speaker", 0.8); // 10-pin SIP with 74HC374P latch
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
vref.set_output(5.0);
vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT).add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT).add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT);
}
MACHINE_CONFIG_START(armedf_state::terraf)
@ -1347,8 +1347,8 @@ MACHINE_CONFIG_START(armedf_state::terrafjb)
DAC_8BIT_R2R(config, "dac2", 0).add_route(ALL_OUTPUTS, "speaker", 0.8); // unknown DAC
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
vref.set_output(5.0);
vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT).add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT).add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT);
MACHINE_CONFIG_END
void armedf_state::terrafb(machine_config &config)
@ -1428,8 +1428,8 @@ MACHINE_CONFIG_START(armedf_state::armedf)
DAC_8BIT_R2R(config, "dac2", 0).add_route(ALL_OUTPUTS, "speaker", 0.5); // unknown DAC
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
vref.set_output(5.0);
vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT).add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT).add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(armedf_state::cclimbr2)
@ -1475,8 +1475,8 @@ MACHINE_CONFIG_START(armedf_state::cclimbr2)
DAC_8BIT_R2R(config, "dac2", 0).add_route(ALL_OUTPUTS, "speaker", 0.4); // unknown DAC
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
vref.set_output(5.0);
vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT).add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT).add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(armedf_state::legion_common)
@ -1514,8 +1514,8 @@ MACHINE_CONFIG_START(armedf_state::legion_common)
DAC_8BIT_R2R(config, "dac2", 0).add_route(ALL_OUTPUTS, "speaker", 0.4); // 10-pin SIP with 74HC374P latch
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
vref.set_output(5.0);
vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT).add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT).add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(armedf_state::legion)

View File

@ -495,8 +495,8 @@ void atari_s2_state::atari_s2(machine_config &config)
DAC_3BIT_BINARY_WEIGHTED(config, m_dac1, 0).add_route(ALL_OUTPUTS, "speaker", 0.15); // r18-r20 (100k,47k,100k)
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
vref.set_output(5.0);
vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT).add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT).add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT);
/* Video */
config.set_default_layout(layout_atari_s2);

View File

@ -805,8 +805,8 @@ void dmv_state::dmv(machine_config &config)
// devices
UPD7220(config, m_hgdc, XTAL(5'000'000)/2); // unk clock
m_hgdc->set_addrmap(0, &dmv_state::upd7220_map);
m_hgdc->set_display_pixels_callback(FUNC(dmv_state::hgdc_display_pixels), this);
m_hgdc->set_draw_text_callback(FUNC(dmv_state::hgdc_draw_text), this);
m_hgdc->set_display_pixels(FUNC(dmv_state::hgdc_display_pixels));
m_hgdc->set_draw_text(FUNC(dmv_state::hgdc_draw_text));
AM9517A(config, m_dmac, 4_MHz_XTAL);
m_dmac->out_hreq_callback().set(FUNC(dmv_state::dma_hrq_changed));

View File

@ -100,7 +100,7 @@ MACHINE_CONFIG_START(if800_state::if800)
// PIC8259(config, "pic8259", 0);
UPD7220(config, m_hgdc, 8000000/4);
m_hgdc->set_addrmap(0, &if800_state::upd7220_map);
m_hgdc->set_display_pixels_callback(FUNC(if800_state::hgdc_display_pixels), this);
m_hgdc->set_display_pixels(FUNC(if800_state::hgdc_display_pixels));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)

View File

@ -836,12 +836,12 @@ MACHINE_CONFIG_START(mz3500_state::mz3500)
UPD7220(config, m_hgdc1, MAIN_CLOCK/5);
m_hgdc1->set_addrmap(0, &mz3500_state::upd7220_1_map);
m_hgdc1->set_draw_text_callback(FUNC(mz3500_state::hgdc_draw_text), this);
m_hgdc1->set_draw_text(FUNC(mz3500_state::hgdc_draw_text));
m_hgdc1->vsync_wr_callback().set(m_hgdc2, FUNC(upd7220_device::ext_sync_w));
UPD7220(config, m_hgdc2, MAIN_CLOCK/5);
m_hgdc2->set_addrmap(0, &mz3500_state::upd7220_2_map);
m_hgdc2->set_display_pixels_callback(FUNC(mz3500_state::hgdc_display_pixels), this);
m_hgdc2->set_display_pixels(FUNC(mz3500_state::hgdc_display_pixels));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)

View File

@ -168,7 +168,7 @@ MACHINE_CONFIG_START(mz6500_state::mz6500)
/* Devices */
UPD7220(config, m_hgdc, 8000000/6); // unk clock
m_hgdc->set_addrmap(0, &mz6500_state::upd7220_map);
m_hgdc->set_display_pixels_callback(FUNC(mz6500_state::hgdc_display_pixels), this);
m_hgdc->set_display_pixels(FUNC(mz6500_state::hgdc_display_pixels));
UPD765A(config, m_fdc, 8000000, true, true);
FLOPPY_CONNECTOR(config, "upd765:0", mz6500_floppies, "525hd", floppy_image_device::default_floppy_formats);

View File

@ -2367,12 +2367,12 @@ void pc9801_state::pc9801_common(machine_config &config)
UPD7220(config, m_hgdc1, 21.0526_MHz_XTAL / 8);
m_hgdc1->set_addrmap(0, &pc9801_state::upd7220_1_map);
m_hgdc1->set_draw_text_callback(FUNC(pc9801_state::hgdc_draw_text), this);
m_hgdc1->set_draw_text(FUNC(pc9801_state::hgdc_draw_text));
m_hgdc1->vsync_wr_callback().set(m_hgdc2, FUNC(upd7220_device::ext_sync_w));
UPD7220(config, m_hgdc2, 21.0526_MHz_XTAL / 8);
m_hgdc2->set_addrmap(0, &pc9801_state::upd7220_2_map);
m_hgdc2->set_display_pixels_callback(FUNC(pc9801_state::hgdc_display_pixels), this);
m_hgdc2->set_display_pixels(FUNC(pc9801_state::hgdc_display_pixels));
SPEAKER(config, "mono").front_center();

View File

@ -801,8 +801,8 @@ MACHINE_CONFIG_START(qx10_state::qx10)
UPD7220(config, m_hgdc, MAIN_CLK/6); // unk clock
m_hgdc->set_addrmap(0, &qx10_state::upd7220_map);
m_hgdc->set_display_pixels_callback(FUNC(qx10_state::hgdc_display_pixels), this);
m_hgdc->set_draw_text_callback(FUNC(qx10_state::hgdc_draw_text), this);
m_hgdc->set_display_pixels(FUNC(qx10_state::hgdc_display_pixels));
m_hgdc->set_draw_text(FUNC(qx10_state::hgdc_draw_text));
m_hgdc->set_screen("screen");
MC146818(config, m_rtc, 32.768_kHz_XTAL);

View File

@ -3233,7 +3233,7 @@ MACHINE_CONFIG_START(rainbow_state::rainbow)
m_hgdc->vsync_wr_callback().set(FUNC(rainbow_state::GDC_vblank_irq)); // "The vsync callback line needs to be below the 7220 DEVICE_ADD line."
m_hgdc->set_addrmap(0, &rainbow_state::upd7220_map);
m_hgdc->set_display_pixels_callback(FUNC(rainbow_state::hgdc_display_pixels), this);
m_hgdc->set_display_pixels(FUNC(rainbow_state::hgdc_display_pixels));
m_hgdc->set_screen(m_screen2); // set_screen needs to be added after 7720 device in the machine config, not after the screen.
MCFG_PALETTE_ADD("palette2", 32)

View File

@ -667,7 +667,7 @@ void vt240_state::vt240(machine_config &config)
UPD7220(config, m_hgdc, XTAL(16'097'280) / 16); // actually /8?
m_hgdc->set_addrmap(0, &vt240_state::upd7220_map);
m_hgdc->set_display_pixels_callback(FUNC(vt240_state::hgdc_draw), this);
m_hgdc->set_display_pixels(FUNC(vt240_state::hgdc_draw));
m_hgdc->vsync_wr_callback().set_inputline(m_i8085, I8085_RST75_LINE);
m_hgdc->blank_wr_callback().set_inputline(m_i8085, I8085_RST55_LINE);
m_hgdc->set_screen("screen");

View File

@ -150,6 +150,6 @@ void mm1_state::mm1m6_video(machine_config &config)
UPD7220(config, m_hgdc, XTAL(18'720'000)/8);
m_hgdc->set_addrmap(0, &mm1_state::mm1_upd7220_map);
m_hgdc->set_display_pixels_callback(FUNC(mm1_state::hgdc_display_pixels), this);
m_hgdc->set_display_pixels(FUNC(mm1_state::hgdc_display_pixels));
m_hgdc->set_screen(SCREEN_TAG);
}