summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video
diff options
context:
space:
mode:
author Lord-Nightmare <Lord-Nightmare@users.noreply.github.com>2016-03-20 10:07:40 -0400
committer Lord-Nightmare <Lord-Nightmare@users.noreply.github.com>2016-03-20 10:07:40 -0400
commit13be662eec0541a474c63140c4d6b98d551b1838 (patch)
treea91cb739417faed42caa404b4a39a5c2fc26d146 /src/devices/video
parentaa3ac422582e65972282a5f858eeb979b20d2fb4 (diff)
Add additional sanity checking to the tms9927/crt5027 core. [Lord Nightmare]
Diffstat (limited to 'src/devices/video')
-rw-r--r--src/devices/video/tms9927.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/devices/video/tms9927.cpp b/src/devices/video/tms9927.cpp
index 4b6f82e18b8..5a9a0b3e960 100644
--- a/src/devices/video/tms9927.cpp
+++ b/src/devices/video/tms9927.cpp
@@ -22,7 +22,7 @@ static const UINT8 skew_bits_value[4] = { 0, 1, 2, 2 };
#define CHARS_PER_DATA_ROW (chars_per_row_value[(m_reg[2] >> 0) & 0x07])
#define SKEW_BITS (skew_bits_value[(m_reg[3] >> 6) & 0x03])
#define DATA_ROWS_PER_FRAME (((m_reg[3] >> 0) & 0x3f) + 1)
-#define SCAN_LINES_PER_FRAME ((m_reg[4] * 2) + 256)
+#define SCAN_LINES_PER_FRAME ((m_reg[4] * 2) + 256 + (((m_reg[1] >> 7) & 0x01) * 257))
#define VERTICAL_DATA_START (m_reg[5])
#define LAST_DISP_DATA_ROW (m_reg[6] & 0x3f)
#define CURSOR_CHAR_ADDRESS (m_reg[7])
@@ -79,7 +79,7 @@ crt5057_device::crt5057_device(const machine_config &mconfig, const char *tag, d
void tms9927_device::device_start()
{
assert(clock() > 0);
- assert(m_hpixels_per_column > 0);
+ if (!(m_hpixels_per_column > 0)) fatalerror("ERROR: TMS9927: number of pixels per column must be explicitly set using MCFG_TMS9927_CHAR_WIDTH()!\n");
/* copy the initial parameters */
m_clock = clock();
@@ -303,12 +303,19 @@ void tms9927_device::recompute_parameters(int postload)
/* see if it all makes sense */
m_valid_config = TRUE;
- if (m_visible_hpix > m_total_hpix || m_visible_vpix > m_total_vpix)
+ if ( (m_visible_hpix > m_total_hpix || m_visible_vpix > m_total_vpix) || (((m_visible_hpix-1)<=0) || ((m_visible_vpix-1)<=0)) || ((m_total_hpix * m_total_vpix) == 0) )
{
m_valid_config = FALSE;
logerror("tms9927: invalid visible size (%dx%d) versus total size (%dx%d)\n", m_visible_hpix, m_visible_vpix, m_total_hpix, m_total_vpix);
}
+ if (m_clock == 0)
+ {
+ m_valid_config = FALSE;
+ // TODO: make the screen refresh never, and disable the vblank and odd/even interrupts here!
+ logerror("tms9927: invalid clock rate of zero defined!\n");
+ }
+
/* update */
if (!m_valid_config)
return;