From e8174a6df19f6bd096e0d760a3d8f2fda1e0d707 Mon Sep 17 00:00:00 2001 From: Nigel Barnes Date: Sun, 14 Nov 2021 15:32:08 +0000 Subject: acorn_vidc: Implement DAC differences between VIDC1 and VIDC1a. --- src/devices/bus/bbc/tube/tube_a500.cpp | 2 +- src/devices/machine/acorn_vidc.cpp | 51 ++++++++++++++++++---------------- src/devices/machine/acorn_vidc.h | 25 +++++++++-------- src/mame/drivers/aristmk5.cpp | 2 +- src/mame/drivers/ertictac.cpp | 2 +- 5 files changed, 44 insertions(+), 38 deletions(-) diff --git a/src/devices/bus/bbc/tube/tube_a500.cpp b/src/devices/bus/bbc/tube/tube_a500.cpp index 7af77e0d328..aeaf4e819c7 100644 --- a/src/devices/bus/bbc/tube/tube_a500.cpp +++ b/src/devices/bus/bbc/tube/tube_a500.cpp @@ -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)); diff --git a/src/devices/machine/acorn_vidc.cpp b/src/devices/machine/acorn_vidc.cpp index 3ea63a91740..2179c64d787 100644 --- a/src/devices/machine/acorn_vidc.cpp +++ b/src/devices/machine/acorn_vidc.cpp @@ -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)< m_dac; + int m_dac_type; private: required_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 diff --git a/src/mame/drivers/aristmk5.cpp b/src/mame/drivers/aristmk5.cpp index eb4c09649ee..e8794f29d06 100644 --- a/src/mame/drivers/aristmk5.cpp +++ b/src/mame/drivers/aristmk5.cpp @@ -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)); diff --git a/src/mame/drivers/ertictac.cpp b/src/mame/drivers/ertictac.cpp index 2936f37d545..035348bbced 100644 --- a/src/mame/drivers/ertictac.cpp +++ b/src/mame/drivers/ertictac.cpp @@ -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)); } -- cgit v1.2.3