mirror of
https://github.com/holub/mame
synced 2025-06-05 04:16:28 +03:00
acorn_vidc: Implement DAC differences between VIDC1 and VIDC1a.
This commit is contained in:
parent
da5f67a62c
commit
e8174a6df1
@ -88,7 +88,7 @@ void bbc_tube_a500_device::device_add_mconfig(machine_config &config)
|
||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
|
||||
screen.screen_vblank().set(m_ioc, FUNC(acorn_ioc_device::ir_w));
|
||||
|
||||
ACORN_VIDC10(config, m_vidc, 24_MHz_XTAL);
|
||||
ACORN_VIDC1(config, m_vidc, 24_MHz_XTAL);
|
||||
m_vidc->set_screen("screen");
|
||||
m_vidc->vblank().set(m_memc, FUNC(acorn_memc_device::vidrq_w));
|
||||
m_vidc->sound_drq().set(m_memc, FUNC(acorn_memc_device::sndrq_w));
|
||||
|
@ -28,8 +28,8 @@
|
||||
//**************************************************************************
|
||||
|
||||
// device type definition
|
||||
DEFINE_DEVICE_TYPE(ACORN_VIDC10, acorn_vidc10_device, "acorn_vidc10", "Acorn VIDC10")
|
||||
DEFINE_DEVICE_TYPE(ACORN_VIDC10_LCD, acorn_vidc10_lcd_device, "acorn_vidc10_lcd", "Acorn VIDC10 with LCD monitor")
|
||||
DEFINE_DEVICE_TYPE(ACORN_VIDC1, acorn_vidc1_device, "acorn_vidc1", "Acorn VIDC1")
|
||||
DEFINE_DEVICE_TYPE(ACORN_VIDC1A, acorn_vidc1a_device, "acorn_vidc1a", "Acorn VIDC1a")
|
||||
DEFINE_DEVICE_TYPE(ARM_VIDC20, arm_vidc20_device, "arm_vidc20", "ARM VIDC20")
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ void acorn_vidc10_device::regs_map(address_map &map)
|
||||
}
|
||||
|
||||
|
||||
acorn_vidc10_device::acorn_vidc10_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock)
|
||||
acorn_vidc10_device::acorn_vidc10_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int dac_type)
|
||||
: device_t(mconfig, type, tag, owner, clock)
|
||||
, device_memory_interface(mconfig, *this)
|
||||
, device_palette_interface(mconfig, *this)
|
||||
@ -62,6 +62,7 @@ acorn_vidc10_device::acorn_vidc10_device(const machine_config &mconfig, device_t
|
||||
, m_sound_frequency_latch(0)
|
||||
, m_sound_mode(false)
|
||||
, m_dac(*this, "dac%u", 0)
|
||||
, m_dac_type(dac_type)
|
||||
, m_lspeaker(*this, "lspeaker")
|
||||
, m_rspeaker(*this, "rspeaker")
|
||||
, m_vblank_cb(*this)
|
||||
@ -74,21 +75,19 @@ acorn_vidc10_device::acorn_vidc10_device(const machine_config &mconfig, device_t
|
||||
std::fill(std::begin(m_stereo_image), std::end(m_stereo_image), 0);
|
||||
}
|
||||
|
||||
acorn_vidc10_device::acorn_vidc10_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: acorn_vidc10_device(mconfig, ACORN_VIDC10, tag, owner, clock)
|
||||
acorn_vidc1_device::acorn_vidc1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: acorn_vidc10_device(mconfig, ACORN_VIDC1, tag, owner, clock, 1)
|
||||
{
|
||||
m_space_config = address_space_config("regs_space", ENDIANNESS_LITTLE, 32, 8, 0, address_map_constructor(FUNC(acorn_vidc10_device::regs_map), this));
|
||||
m_space_config = address_space_config("regs_space", ENDIANNESS_LITTLE, 32, 8, 0, address_map_constructor(FUNC(acorn_vidc1_device::regs_map), this));
|
||||
m_pal_4bpp_base = 0x100;
|
||||
m_pal_cursor_base = 0x10;
|
||||
m_pal_border_base = 0x110;
|
||||
}
|
||||
|
||||
|
||||
acorn_vidc10_lcd_device::acorn_vidc10_lcd_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: acorn_vidc10_device(mconfig, ACORN_VIDC10_LCD, tag, owner, clock)
|
||||
acorn_vidc1a_device::acorn_vidc1a_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: acorn_vidc10_device(mconfig, ACORN_VIDC1A, tag, owner, clock, 2)
|
||||
{
|
||||
m_space_config = address_space_config("regs_space", ENDIANNESS_LITTLE, 32, 8, 0, address_map_constructor(FUNC(acorn_vidc10_lcd_device::regs_map), this));
|
||||
// TODO: confirm being identical to raster version
|
||||
m_space_config = address_space_config("regs_space", ENDIANNESS_LITTLE, 32, 8, 0, address_map_constructor(FUNC(acorn_vidc1a_device::regs_map), this));
|
||||
m_pal_4bpp_base = 0x100;
|
||||
m_pal_cursor_base = 0x10;
|
||||
m_pal_border_base = 0x110;
|
||||
@ -104,7 +103,7 @@ device_memory_interface::space_config_vector acorn_vidc10_device::memory_space_c
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig - device-specific machine
|
||||
// configuration addiitons
|
||||
// configuration additions
|
||||
//-------------------------------------------------
|
||||
|
||||
void acorn_vidc10_device::device_add_mconfig(machine_config &config)
|
||||
@ -118,12 +117,6 @@ void acorn_vidc10_device::device_add_mconfig(machine_config &config)
|
||||
}
|
||||
}
|
||||
|
||||
void acorn_vidc10_lcd_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
acorn_vidc10_device::device_add_mconfig(config);
|
||||
// TODO: verify !Configure with automatic type detection, there must be an ID telling this is a LCD machine.
|
||||
}
|
||||
|
||||
u32 acorn_vidc10_device::palette_entries() const
|
||||
{
|
||||
return 0x100+0x10+4; // 8bpp + 1/2/4bpp + 2bpp for cursor
|
||||
@ -178,12 +171,22 @@ void acorn_vidc10_device::device_start()
|
||||
|
||||
// generate u255 law lookup table
|
||||
// cfr. page 48 of the VIDC20 manual, page 33 of the VIDC manual
|
||||
// TODO: manual mentions a format difference between VIDC10 revisions
|
||||
for (int rawval = 0; rawval < 256; rawval++)
|
||||
{
|
||||
u8 chord = rawval >> 5;
|
||||
u8 point = (rawval & 0x1e) >> 1;
|
||||
bool sign = rawval & 1;
|
||||
u8 chord, point;
|
||||
bool sign;
|
||||
if (m_dac_type == 1)
|
||||
{
|
||||
chord = (rawval & 0x70) >> 4;
|
||||
point = rawval & 0x0f;
|
||||
sign = rawval >> 7;
|
||||
}
|
||||
else
|
||||
{
|
||||
chord = rawval >> 5;
|
||||
point = (rawval & 0x1e) >> 1;
|
||||
sign = rawval & 1;
|
||||
}
|
||||
int16_t result = ((16+point)<<chord)-16;
|
||||
|
||||
if (sign)
|
||||
@ -541,7 +544,7 @@ u32 acorn_vidc10_device::screen_update(screen_device &screen, bitmap_rgb32 &bitm
|
||||
return 0;
|
||||
}
|
||||
|
||||
READ_LINE_MEMBER(acorn_vidc10_device::flyback_r )
|
||||
READ_LINE_MEMBER(acorn_vidc10_device::flyback_r)
|
||||
{
|
||||
int vert_pos = screen().vpos();
|
||||
if (vert_pos <= m_crtc_regs[CRTC_VDSR] * (m_crtc_interlace+1))
|
||||
@ -568,7 +571,7 @@ void arm_vidc20_device::regs_map(address_map &map)
|
||||
}
|
||||
|
||||
arm_vidc20_device::arm_vidc20_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: acorn_vidc10_device(mconfig, ARM_VIDC20, tag, owner, clock)
|
||||
: acorn_vidc10_device(mconfig, ARM_VIDC20, tag, owner, clock, 2)
|
||||
{
|
||||
m_space_config = address_space_config("regs_space", ENDIANNESS_LITTLE, 32, 8, -2, address_map_constructor(FUNC(arm_vidc20_device::regs_map), this));
|
||||
m_pal_4bpp_base = 0x000;
|
||||
|
@ -32,9 +32,6 @@ class acorn_vidc10_device : public device_t,
|
||||
public device_video_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
acorn_vidc10_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
// I/O operations
|
||||
void write(offs_t offset, u32 data, u32 mem_mask = ~0);
|
||||
DECLARE_READ_LINE_MEMBER( flyback_r );
|
||||
@ -50,7 +47,7 @@ public:
|
||||
u32 get_cursor_size() { return (m_crtc_regs[CRTC_VCER] - m_crtc_regs[CRTC_VCSR]) * (32/4); }
|
||||
|
||||
protected:
|
||||
acorn_vidc10_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
|
||||
acorn_vidc10_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int dac_type);
|
||||
|
||||
// device-level overrides
|
||||
//virtual void device_validity_check(validity_checker &valid) const override;
|
||||
@ -91,6 +88,7 @@ protected:
|
||||
bool m_sound_mode;
|
||||
|
||||
required_device_array<dac_16bit_r2r_twos_complement_device, 8> m_dac;
|
||||
int m_dac_type;
|
||||
|
||||
private:
|
||||
required_device<speaker_device> m_lspeaker;
|
||||
@ -131,18 +129,23 @@ private:
|
||||
inline void refresh_stereo_image(u8 channel);
|
||||
};
|
||||
|
||||
class acorn_vidc10_lcd_device : public acorn_vidc10_device
|
||||
class acorn_vidc1_device : public acorn_vidc10_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
acorn_vidc10_lcd_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
protected:
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
acorn_vidc1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
};
|
||||
|
||||
class acorn_vidc1a_device : public acorn_vidc10_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
acorn_vidc1a_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
};
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(ACORN_VIDC10, acorn_vidc10_device)
|
||||
DECLARE_DEVICE_TYPE(ACORN_VIDC10_LCD, acorn_vidc10_lcd_device)
|
||||
DECLARE_DEVICE_TYPE(ACORN_VIDC1, acorn_vidc1_device)
|
||||
DECLARE_DEVICE_TYPE(ACORN_VIDC1A, acorn_vidc1a_device)
|
||||
|
||||
class arm_vidc20_device : public acorn_vidc10_device
|
||||
{
|
||||
@ -193,4 +196,4 @@ DECLARE_DEVICE_TYPE(ARM_VIDC20, arm_vidc20_device)
|
||||
//**************************************************************************
|
||||
|
||||
|
||||
#endif // MAME_MACHINE_ACORN_VIDC10_H
|
||||
#endif // MAME_MACHINE_ACORN_VIDC_H
|
||||
|
@ -2337,7 +2337,7 @@ void aristmk5_state::aristmk5(machine_config &config)
|
||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
|
||||
screen.screen_vblank().set(m_ioc, FUNC(acorn_ioc_device::ir_w));
|
||||
|
||||
ACORN_VIDC10(config, m_vidc, MASTER_CLOCK/3);
|
||||
ACORN_VIDC1A(config, m_vidc, MASTER_CLOCK/3);
|
||||
m_vidc->set_screen("screen");
|
||||
m_vidc->vblank().set(m_memc, FUNC(acorn_memc_device::vidrq_w));
|
||||
m_vidc->sound_drq().set(m_memc, FUNC(acorn_memc_device::sndrq_w));
|
||||
|
@ -257,7 +257,7 @@ void ertictac_state::ertictac(machine_config &config)
|
||||
m_ioc->gpio_w<0>().set("i2cmem", FUNC(pcf8583_device::sda_w));
|
||||
m_ioc->gpio_w<1>().set("i2cmem", FUNC(pcf8583_device::scl_w));
|
||||
|
||||
ACORN_VIDC10(config, m_vidc10, 24_MHz_XTAL);
|
||||
ACORN_VIDC1A(config, m_vidc10, 24_MHz_XTAL);
|
||||
m_vidc10->set_screen("screen");
|
||||
m_vidc10->sound_drq().set(m_memc, FUNC(acorn_memc_device::sndrq_w));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user