summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2021-06-21 13:53:49 -0700
committer Aaron Giles <aaron@aarongiles.com>2021-06-21 13:53:49 -0700
commit32dbba7d2d4513774b2d877b4c88f2d0760bcf54 (patch)
treef9e6426cf8dc28413c456bdbcd450c85cb302422 /src/devices/video
parent5522729235b3ce81c839f3932c1aadc14de59e2b (diff)
parent2709c0143a8c7009715242c135b28403eeffce8b (diff)
Merge branch 'master' into deprecateddeprecated
Diffstat (limited to 'src/devices/video')
-rw-r--r--src/devices/video/dl1416.cpp36
-rw-r--r--src/devices/video/dl1416.h20
-rw-r--r--src/devices/video/hd61830.cpp6
-rw-r--r--src/devices/video/pc_vga.cpp6
-rw-r--r--src/devices/video/vooddefs.ipp20
-rw-r--r--src/devices/video/voodoo.cpp4
6 files changed, 52 insertions, 40 deletions
diff --git a/src/devices/video/dl1416.cpp b/src/devices/video/dl1416.cpp
index 2508bb179fb..4321192e981 100644
--- a/src/devices/video/dl1416.cpp
+++ b/src/devices/video/dl1416.cpp
@@ -185,15 +185,12 @@ dl1414_device::dl1414_device(
device_t *owner,
u32 clock)
: device_t(mconfig, type, tag, owner, clock)
- , m_update_cb(*this)
- , m_digit_ram{ 0x00, 0x00, 0x00, 0x00 }
- , m_cursor_state{ false, false, false, false }
, m_wr_in(true)
- , m_ce_in(true)
- , m_ce_latch(true)
, m_addr_in(0x00)
- , m_addr_latch(0x00)
, m_data_in(0x00)
+ , m_update_cb(*this)
+ , m_digit_ram{ 0x00, 0x00, 0x00, 0x00 }
+ , m_cursor_state{ false, false, false, false }
{
}
@@ -204,7 +201,10 @@ dl1416_device::dl1416_device(
device_t *owner,
u32 clock)
: dl1414_device(mconfig, type, tag, owner, clock)
+ , m_ce_in(true)
+ , m_ce_latch(true)
, m_cu_in(true)
+ , m_addr_latch(0x00)
{
}
@@ -220,18 +220,12 @@ void dl1414_device::device_start()
save_item(NAME(m_digit_ram));
save_item(NAME(m_cursor_state));
save_item(NAME(m_wr_in));
- save_item(NAME(m_ce_in));
- save_item(NAME(m_ce_latch));
save_item(NAME(m_addr_in));
- save_item(NAME(m_addr_latch));
save_item(NAME(m_data_in));
// set initial state for input lines
m_wr_in = true;
- m_ce_in = true;
- m_ce_latch = true;
m_addr_in = 0x00;
- m_addr_latch = 0x00;
m_data_in = 0x00;
// randomise internal RAM
@@ -249,10 +243,16 @@ void dl1416_device::device_start()
dl1414_device::device_start();
// register for state saving
+ save_item(NAME(m_ce_in));
+ save_item(NAME(m_ce_latch));
save_item(NAME(m_cu_in));
+ save_item(NAME(m_addr_latch));
// set initial state for input lines
+ m_ce_in = true;
+ m_ce_latch = true;
m_cu_in = true;
+ m_addr_latch = 0x00;
}
//-------------------------------------------------
@@ -277,6 +277,16 @@ WRITE_LINE_MEMBER( dl1414_device::wr_w )
{
m_wr_in = bool(state);
if (m_wr_in)
+ bus_w(m_addr_in, m_data_in);
+ }
+}
+
+WRITE_LINE_MEMBER( dl1416_device::wr_w )
+{
+ if (bool(state) != m_wr_in)
+ {
+ m_wr_in = bool(state);
+ if (m_wr_in)
{
if (!m_ce_latch)
bus_w(m_addr_latch, m_data_in);
@@ -289,7 +299,7 @@ WRITE_LINE_MEMBER( dl1414_device::wr_w )
}
}
-WRITE_LINE_MEMBER( dl1414_device::ce_w )
+WRITE_LINE_MEMBER( dl1416_device::ce_w )
{
m_ce_in = bool(state);
}
diff --git a/src/devices/video/dl1416.h b/src/devices/video/dl1416.h
index 9c4b6228ee3..ce1d61071f4 100644
--- a/src/devices/video/dl1416.h
+++ b/src/devices/video/dl1416.h
@@ -7,7 +7,7 @@
* 4-Digit 16-Segment Alphanumeric Intelligent Display
* with Memory/Decoder/Driver
*
- * See video/dl1416.c for more info
+ * See video/dl1416.cpp for more info
*
****************************************************************************/
@@ -36,8 +36,7 @@ public:
auto update() { return m_update_cb.bind(); }
// signal-level interface
- DECLARE_WRITE_LINE_MEMBER(wr_w); // write strobe (rising edge)
- DECLARE_WRITE_LINE_MEMBER(ce_w); // chip enable (active low)
+ virtual DECLARE_WRITE_LINE_MEMBER(wr_w); // write strobe (rising edge)
void addr_w(u8 state);
void data_w(u8 state);
@@ -59,23 +58,24 @@ protected:
void set_cursor_state(offs_t offset, bool state);
virtual u16 translate(u8 digit, bool cursor) const = 0;
+ // input line state
+ bool m_wr_in;
+ u8 m_addr_in;
+ u8 m_data_in;
+
private:
devcb_write16 m_update_cb;
// internal state
u8 m_digit_ram[4]; // holds the digit code for each position
bool m_cursor_state[4]; // holds the cursor state for each position
-
- // input line state
- bool m_wr_in;
- bool m_ce_in, m_ce_latch;
- u8 m_addr_in, m_addr_latch;
- u8 m_data_in;
};
class dl1416_device : public dl1414_device
{
public:
+ virtual DECLARE_WRITE_LINE_MEMBER(wr_w) override;
+ DECLARE_WRITE_LINE_MEMBER(ce_w); // chip enable (active low)
DECLARE_WRITE_LINE_MEMBER(cu_w); // cursor enable (active low)
protected:
@@ -93,7 +93,9 @@ protected:
private:
// input line state
+ bool m_ce_in, m_ce_latch;
bool m_cu_in;
+ u8 m_addr_latch;
};
#endif // MAME_VIDEO_DL1416_H
diff --git a/src/devices/video/hd61830.cpp b/src/devices/video/hd61830.cpp
index 55bf2bbd588..235d250b405 100644
--- a/src/devices/video/hd61830.cpp
+++ b/src/devices/video/hd61830.cpp
@@ -440,7 +440,7 @@ void hd61830_device::draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect,
{
// cursor off, character blink
if (!cursor)
- pixel = m_cursor ? pixel : 0;
+ pixel = m_cursor ? 1 : pixel;
// cursor blink
if (cursor && (cl == m_cp))
@@ -483,8 +483,8 @@ void hd61830_device::update_text(bitmap_ind16 &bitmap, const rectangle &cliprect
md1 = readbyte(rac2);
md2 = readbyte(rac2+1);
- draw_char(bitmap, cliprect, ma, x, y + rows, md1);
- draw_char(bitmap, cliprect, ma+1, x+1, y + rows, md2);
+ draw_char(bitmap, cliprect, ma + (rows * m_hn), x, y + rows, md1);
+ draw_char(bitmap, cliprect, ma+1 + (rows * m_hn), x+1, y + rows, md2);
ma+=2;
rac1+=2;
diff --git a/src/devices/video/pc_vga.cpp b/src/devices/video/pc_vga.cpp
index d72899d2de2..2edaaca392a 100644
--- a/src/devices/video/pc_vga.cpp
+++ b/src/devices/video/pc_vga.cpp
@@ -36,11 +36,11 @@
ROM declarations:
(oti 037 chip)
- ROM_LOAD("oakvga.bin", 0xc0000, 0x8000, 0x318c5f43)
+ ROM_LOAD("oakvga.bin", 0xc0000, 0x8000, CRC(318c5f43) SHA1(2aeb6cf737fd87dfd08c9f5b5bc421fcdbab4ce9) )
(tseng labs famous et4000 isa vga card (oem))
- ROM_LOAD("et4000b.bin", 0xc0000, 0x8000, 0xa903540d)
+ ROM_LOAD("et4000b.bin", 0xc0000, 0x8000, CRC(a903540d) SHA1(unknown) )
(tseng labs famous et4000 isa vga card)
- ROM_LOAD("et4000.bin", 0xc0000, 0x8000, 0xf01e4be0)
+ ROM_LOAD("et4000.bin", 0xc0000, 0x8000, CRC(f01e4be0) SHA1(95d75ff41bcb765e50bd87a8da01835fd0aa01d5) )
***************************************************************************/
diff --git a/src/devices/video/vooddefs.ipp b/src/devices/video/vooddefs.ipp
index 6a169640947..d9726edf960 100644
--- a/src/devices/video/vooddefs.ipp
+++ b/src/devices/video/vooddefs.ipp
@@ -135,7 +135,7 @@ static inline int32_t fast_reciplog(int64_t value, int32_t *log2)
}
/* determine how many leading zeros in the value and shift it up high */
- lz = count_leading_zeros(temp);
+ lz = count_leading_zeros_32(temp);
temp <<= lz;
exp += lz;
@@ -1852,15 +1852,15 @@ do
wfloat = 0xffff; \
else \
{ \
- int exp = count_leading_zeros(temp); \
+ int exp = count_leading_zeros_32(temp); \
wfloat = ((exp << 12) | ((~temp >> (19 - exp)) & 0xfff)) + 1; \
} \
} \
\
/* compute depth value (W or Z) for this pixel */ \
- if (FBZMODE_WBUFFER_SELECT(FBZMODE)) \
+ if (FBZMODE_WBUFFER_SELECT(FBZMODE)) \
{ \
- if (!FBZMODE_DEPTH_FLOAT_SELECT(FBZMODE)) \
+ if (!FBZMODE_DEPTH_FLOAT_SELECT(FBZMODE)) \
depthval = wfloat; \
else \
{ \
@@ -1873,7 +1873,7 @@ do
depthval = 0xffff; \
else \
{ \
- int exp = count_leading_zeros(temp); \
+ int exp = count_leading_zeros_32(temp); \
depthval = ((exp << 12) | ((~temp >> (19 - exp)) & 0xfff)) + 1; \
} \
} \
@@ -1884,11 +1884,11 @@ do
CLAMPED_Z(ITERZ, FBZCOLORPATH, depthval); \
} \
/* add the bias */ \
- biasdepth = depthval; \
+ biasdepth = depthval; \
if (FBZMODE_ENABLE_DEPTH_BIAS(FBZMODE)) \
{ \
- biasdepth += (int16_t)vd->reg[zaColor].u; \
- CLAMP(biasdepth, 0, 0xffff); \
+ biasdepth += (int16_t)vd->reg[zaColor].u; \
+ CLAMP(biasdepth, 0, 0xffff); \
}
@@ -1898,12 +1898,12 @@ do
/* handle depth buffer testing */ \
if (FBZMODE_ENABLE_DEPTHBUF(FBZMODE)) \
{ \
- int32_t depthsource; \
+ int32_t depthsource; \
\
/* the source depth is either the iterated W/Z+bias or a */ \
/* constant value */ \
if (FBZMODE_DEPTH_SOURCE_COMPARE(FBZMODE) == 0) \
- depthsource = biasdepth; \
+ depthsource = biasdepth; \
else \
depthsource = (uint16_t)vd->reg[zaColor].u; \
\
diff --git a/src/devices/video/voodoo.cpp b/src/devices/video/voodoo.cpp
index 180a8d454c3..2b57e67e3de 100644
--- a/src/devices/video/voodoo.cpp
+++ b/src/devices/video/voodoo.cpp
@@ -3129,7 +3129,7 @@ int32_t voodoo_device::register_w(voodoo_device *vd, offs_t offset, uint32_t dat
attoseconds_t refresh = vd->m_screen->frame_period().attoseconds();
attoseconds_t stdperiod, medperiod, vgaperiod;
attoseconds_t stddiff, meddiff, vgadiff;
- rectangle visarea;
+ rectangle visarea;
if (vd->vd_type == TYPE_VOODOO_2)
{
@@ -3151,7 +3151,7 @@ int32_t voodoo_device::register_w(voodoo_device *vd, offs_t offset, uint32_t dat
}
/* create a new visarea */
- visarea.set(hbp, hbp + hvis - 1, vbp, vbp + vvis - 1);
+ visarea.set(hbp, hbp + std::max(hvis - 1, 0), vbp, vbp + std::max(vvis - 1, 0));
/* keep within bounds */
visarea.max_x = (std::min)(visarea.max_x, htotal - 1);