summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Nigel Barnes <ngbarnes@gmail.com>2025-07-24 23:04:46 +0100
committer Nigel Barnes <ngbarnes@gmail.com>2025-07-24 23:11:46 +0100
commit751bbf20d80bcce0d9bb583a4bb6bec14732b1e1 (patch)
tree6924ed499a5c7b98d2b71fc818d757ce64acb3ed /src
parentbfb18d11f5ffbe7717d5f2ad6bcf70ff364b7765 (diff)
video/mc6847.cpp: Removed fake PAL variants, and replaced with a configuration option.
Diffstat (limited to 'src')
-rw-r--r--src/devices/video/mc6847.cpp226
-rw-r--r--src/devices/video/mc6847.h134
-rw-r--r--src/mame/acorn/atom.cpp2
-rw-r--r--src/mame/apf/apf.cpp4
-rw-r--r--src/mame/cce/mc1000.cpp2
-rw-r--r--src/mame/misc/ctvboy.cpp4
-rw-r--r--src/mame/misc/z80ne.cpp6
-rw-r--r--src/mame/motorola/uchroma68.cpp4
-rw-r--r--src/mame/samsung/spc1000.cpp4
-rw-r--r--src/mame/sanyo/phc20.cpp4
-rw-r--r--src/mame/sanyo/phc25.cpp10
-rw-r--r--src/mame/skeleton/fc100.cpp2
-rw-r--r--src/mame/skeleton/shine.cpp2
-rw-r--r--src/mame/trs/agvision.cpp2
-rw-r--r--src/mame/trs/coco12.cpp4
-rw-r--r--src/mame/trs/dragon.cpp4
-rw-r--r--src/mame/trs/mc10.cpp2
-rw-r--r--src/mame/vtech/vtech1.cpp6
18 files changed, 168 insertions, 254 deletions
diff --git a/src/devices/video/mc6847.cpp b/src/devices/video/mc6847.cpp
index 89e833798f6..7b1cdcc7ffb 100644
--- a/src/devices/video/mc6847.cpp
+++ b/src/devices/video/mc6847.cpp
@@ -182,13 +182,13 @@ mc6847_friend_device::mc6847_friend_device(const machine_config &mconfig, device
, m_charrom_cb(*this)
, m_character_map(fontdata, is_mc6847t1)
, m_tpfs(tpfs)
- , m_divider(divider)
- , m_field_sync_falling_edge_scanline(pal ? field_sync_falling_edge_scanline + LINES_PADDING_TOP_PAL : field_sync_falling_edge_scanline)
- , m_supports_partial_body_scanlines(supports_partial_body_scanlines)
, m_pal(pal)
, m_lines_top_border(pal ? LINES_TOP_BORDER + LINES_PADDING_TOP_PAL : LINES_TOP_BORDER)
, m_lines_until_vblank(pal ? LINES_UNTIL_VBLANK_PAL : LINES_UNTIL_VBLANK_NTSC)
, m_lines_until_retrace(pal ? LINES_UNTIL_RETRACE_PAL : LINES_UNTIL_RETRACE_NTSC)
+ , m_divider(divider)
+ , m_field_sync_falling_edge_scanline(pal ? field_sync_falling_edge_scanline + LINES_PADDING_TOP_PAL : field_sync_falling_edge_scanline)
+ , m_supports_partial_body_scanlines(supports_partial_body_scanlines)
{
// Note: field_sync_falling_edge_scanline is parameterized because the MC6847
// and the GIME apply field sync on different scanlines
@@ -299,13 +299,13 @@ std::string mc6847_friend_device::scanline_zone_string(scanline_zone zone) const
std::string result;
switch(zone)
{
- case SCANLINE_ZONE_TOP_BORDER: result = "SCANLINE_ZONE_TOP_BORDER"; break;
- case SCANLINE_ZONE_BODY: result = "SCANLINE_ZONE_BODY"; break;
- case SCANLINE_ZONE_BOTTOM_BORDER: result = "SCANLINE_ZONE_BOTTOM_BORDER"; break;
- case SCANLINE_ZONE_RETRACE: result = "SCANLINE_ZONE_RETRACE"; break;
- case SCANLINE_ZONE_VBLANK: result = "SCANLINE_ZONE_VBLANK"; break;
- default:
- fatalerror("Should not get here\n");
+ case SCANLINE_ZONE_TOP_BORDER: result = "SCANLINE_ZONE_TOP_BORDER"; break;
+ case SCANLINE_ZONE_BODY: result = "SCANLINE_ZONE_BODY"; break;
+ case SCANLINE_ZONE_BOTTOM_BORDER: result = "SCANLINE_ZONE_BOTTOM_BORDER"; break;
+ case SCANLINE_ZONE_RETRACE: result = "SCANLINE_ZONE_RETRACE"; break;
+ case SCANLINE_ZONE_VBLANK: result = "SCANLINE_ZONE_VBLANK"; break;
+ default:
+ fatalerror("Should not get here\n");
}
return result;
}
@@ -331,24 +331,24 @@ TIMER_CALLBACK_MEMBER(mc6847_friend_device::change_horizontal_sync)
auto profile2 = g_profiler.start(PROFILER_USER2);
switch((scanline_zone) m_logical_scanline_zone)
{
- case SCANLINE_ZONE_TOP_BORDER:
- case SCANLINE_ZONE_BOTTOM_BORDER:
- record_border_scanline(m_physical_scanline);
- break;
-
- case SCANLINE_ZONE_BODY:
- m_recording_scanline = true;
- if (m_partial_scanline_clocks > 0)
- record_partial_body_scanline(m_physical_scanline, m_logical_scanline, m_partial_scanline_clocks, CLOCKS_HSYNC_PERIOD);
- else
- record_full_body_scanline(m_physical_scanline, m_logical_scanline);
- m_recording_scanline = false;
- break;
-
- case SCANLINE_ZONE_RETRACE:
- case SCANLINE_ZONE_VBLANK:
- // do nothing
- break;
+ case SCANLINE_ZONE_TOP_BORDER:
+ case SCANLINE_ZONE_BOTTOM_BORDER:
+ record_border_scanline(m_physical_scanline);
+ break;
+
+ case SCANLINE_ZONE_BODY:
+ m_recording_scanline = true;
+ if (m_partial_scanline_clocks > 0)
+ record_partial_body_scanline(m_physical_scanline, m_logical_scanline, m_partial_scanline_clocks, CLOCKS_HSYNC_PERIOD);
+ else
+ record_full_body_scanline(m_physical_scanline, m_logical_scanline);
+ m_recording_scanline = false;
+ break;
+
+ case SCANLINE_ZONE_RETRACE:
+ case SCANLINE_ZONE_VBLANK:
+ // do nothing
+ break;
}
// stop profiling USER2
}
@@ -419,8 +419,7 @@ inline void mc6847_friend_device::next_scanline()
m_partial_scanline_clocks = 0;
/* check for movement into the next "zone" */
- if ((m_logical_scanline_zone == SCANLINE_ZONE_VBLANK) &&
- (m_logical_scanline >= LINES_VBLANK))
+ if ((m_logical_scanline_zone == SCANLINE_ZONE_VBLANK) && (m_logical_scanline >= LINES_VBLANK))
{
/* new frame, starts at top border */
m_physical_scanline = 0;
@@ -612,21 +611,12 @@ std::string mc6847_friend_device::describe_context() const
// ctor
//-------------------------------------------------
-mc6847_base_device::mc6847_base_device(
- const machine_config &mconfig,
- device_type type,
- const char *tag,
- device_t *owner,
- uint32_t clock,
- const uint8_t *fontdata,
- double tpfs,
- bool pal) :
- mc6847_friend_device(mconfig, type, tag, owner, clock, fontdata, (type == MC6847T1_NTSC) || (type == MC6847T1_PAL),
- tpfs, LINES_TOP_BORDER + LINES_ACTIVE_VIDEO - 1, 1, true, pal),
- m_input_cb(*this, 0),
- m_black_and_white(false),
- m_fixed_mode(0),
- m_fixed_mode_mask(0)
+mc6847_base_device::mc6847_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const uint8_t *fontdata, double tpfs, bool pal)
+ : mc6847_friend_device(mconfig, type, tag, owner, clock, fontdata, type == MC6847T1, tpfs, LINES_TOP_BORDER + LINES_ACTIVE_VIDEO - 1, 1, true, pal)
+ , m_input_cb(*this, 0)
+ , m_black_and_white(false)
+ , m_fixed_mode(0)
+ , m_fixed_mode_mask(0)
{
set_palette(s_palette);
}
@@ -802,35 +792,35 @@ void mc6847_base_device::record_body_scanline(uint8_t mode, uint16_t physical_sc
{
switch(mode & (MODE_GM2|MODE_GM1|MODE_GM0))
{
- case 0:
- case MODE_GM0:
- record_scanline_res<16, 64>(scanline, start_pos, end_pos);
- break;
+ case 0:
+ case MODE_GM0:
+ record_scanline_res<16, 64>(scanline, start_pos, end_pos);
+ break;
- case MODE_GM1:
- record_scanline_res<32, 64>(scanline, start_pos, end_pos);
- break;
+ case MODE_GM1:
+ record_scanline_res<32, 64>(scanline, start_pos, end_pos);
+ break;
- case MODE_GM1|MODE_GM0:
- record_scanline_res<16, 96>(scanline, start_pos, end_pos);
- break;
+ case MODE_GM1|MODE_GM0:
+ record_scanline_res<16, 96>(scanline, start_pos, end_pos);
+ break;
- case MODE_GM2:
- record_scanline_res<32, 96>(scanline, start_pos, end_pos);
- break;
+ case MODE_GM2:
+ record_scanline_res<32, 96>(scanline, start_pos, end_pos);
+ break;
- case MODE_GM2|MODE_GM0:
- record_scanline_res<16, 192>(scanline, start_pos, end_pos);
- break;
+ case MODE_GM2|MODE_GM0:
+ record_scanline_res<16, 192>(scanline, start_pos, end_pos);
+ break;
- case MODE_GM2|MODE_GM1:
- case MODE_GM2|MODE_GM1|MODE_GM0:
- record_scanline_res<32, 192>(scanline, start_pos, end_pos);
- break;
+ case MODE_GM2|MODE_GM1:
+ case MODE_GM2|MODE_GM1|MODE_GM0:
+ record_scanline_res<32, 192>(scanline, start_pos, end_pos);
+ break;
- default:
- /* should not get here */
- fatalerror("should not get here\n");
+ default:
+ /* should not get here */
+ fatalerror("should not get here\n");
}
}
else
@@ -1048,10 +1038,8 @@ uint32_t mc6847_base_device::screen_update(screen_device &screen, bitmap_rgb32 &
mc6847_friend_device::character_map::character_map(const uint8_t *text_fontdata, bool is_mc6847t1)
{
- int mode, i;
-
// set up font data
- for (i = 0; i < 64*12; i++)
+ for (int i = 0; i < 64*12; i++)
{
m_text_fontdata_inverse[i] = text_fontdata[i] ^ 0xFF;
m_text_fontdata_lower_case[i] = text_fontdata[i + (i < 32*12 ? 64*12 : 0)] ^ (i < 32*12 ? 0xFF : 0x00);
@@ -1061,7 +1049,7 @@ mc6847_friend_device::character_map::character_map(const uint8_t *text_fontdata,
m_stripes[i] = ~(i / 12);
// loop through all modes
- for (mode = 0; mode < std::size(m_entries); mode++)
+ for (int mode = 0; mode < std::size(m_entries); mode++)
{
const uint8_t *fontdata;
uint8_t character_mask;
@@ -1631,7 +1619,7 @@ void mc6847_base_device::artifacter::update_colors(pixel_t c0, pixel_t c1)
* have cleaned everything up, the ugliness is much more prominent.
*
* Hopefully we will have a generic artifacting algorithm that plugs into
- * the MESS/MAME core directly so we can chuck this hack */
+ * the MAME core directly so we can chuck this hack */
static const double artifact_colors[14*3] =
{
0.157, 0.000, 0.157, /* [ 1] - dk purple (reverse 2) */
@@ -1674,7 +1662,6 @@ void mc6847_base_device::artifacter::update_colors(pixel_t c0, pixel_t c1)
};
pixel_t colors[16];
- int i;
/* do we need to update our artifact colors table? */
if ((m_artifacting != m_saved_artifacting) || (c0 != m_saved_c0) || (c1 != m_saved_c1))
@@ -1684,7 +1671,7 @@ void mc6847_base_device::artifacter::update_colors(pixel_t c0, pixel_t c1)
m_saved_c1 = colors[15] = c1;
/* mix the other colors */
- for (i = 1; i <= 14; i++)
+ for (int i = 1; i <= 14; i++)
{
const double *factors = &artifact_colors[((i - 1) ^ (m_artifacting & 0x01)) * 3];
@@ -1692,7 +1679,7 @@ void mc6847_base_device::artifacter::update_colors(pixel_t c0, pixel_t c1)
| (mix_color(factors[1], c0 >> 8, c1 >> 8) << 8)
| (mix_color(factors[2], c0 >> 0, c1 >> 0) << 0);
}
- for (i = 0; i < 128; i++)
+ for (int i = 0; i < 128; i++)
{
m_expanded_colors[i] = colors[artifact_correction[i]];
}
@@ -1741,78 +1728,46 @@ void mc6847_base_device::artifacter::create_color_blend_table( const pixel_t *pa
// VARIATIONS
//**************************************************************************
-DEFINE_DEVICE_TYPE(MC6847_NTSC, mc6847_ntsc_device, "mc6847_ntsc", "Motorola MC6847 VDG (NTSC)")
-DEFINE_DEVICE_TYPE(MC6847_PAL, mc6847_pal_device, "mc6847_pal", "Motorola MC6847 VDG (PAL)")
-DEFINE_DEVICE_TYPE(MC6847Y_NTSC, mc6847y_ntsc_device, "mc6847y_ntsc", "Motorola MC6847Y VDG (NTSC)")
-DEFINE_DEVICE_TYPE(MC6847Y_PAL, mc6847y_pal_device, "mc6847y_pal", "Motorola MC6847Y VDG (PAL)")
-DEFINE_DEVICE_TYPE(MC6847T1_NTSC, mc6847t1_ntsc_device, "mc6847t1_ntsc", "Motorola MC6847T1 VDG (NTSC)")
-DEFINE_DEVICE_TYPE(MC6847T1_PAL, mc6847t1_pal_device, "mc6847t1_pal", "Motorola MC6847T1 VDG (PAL)")
-DEFINE_DEVICE_TYPE(S68047, s68047_device, "s68047", "AMI S68047 VDG")
-DEFINE_DEVICE_TYPE(M5C6847P1, m5c6847p1_device, "m5c6847p1", "Mitsubishi M5C6847P-1 VDG")
-
-
-
-//-------------------------------------------------
-// mc6847_ntsc_device
-//-------------------------------------------------
-
-mc6847_ntsc_device::mc6847_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : mc6847_base_device(mconfig, MC6847_NTSC, tag, owner, clock, vdg_fontdata8x12, 262.0, false)
-{
-}
-
+DEFINE_DEVICE_TYPE(MC6847, mc6847_device, "mc6847", "Motorola MC6847 VDG")
+DEFINE_DEVICE_TYPE(MC6847Y, mc6847y_device, "mc6847y", "Motorola MC6847Y VDG")
+DEFINE_DEVICE_TYPE(MC6847T1, mc6847t1_device, "mc6847t1", "Motorola MC6847T1 VDG")
+DEFINE_DEVICE_TYPE(S68047, s68047_device, "s68047", "AMI S68047 VDG")
+DEFINE_DEVICE_TYPE(M5C6847P1, m5c6847p1_device, "m5c6847p1", "Mitsubishi M5C6847P-1 VDG")
//-------------------------------------------------
-// mc6847_pal_device
+// mc6847_device
//-------------------------------------------------
-mc6847_pal_device::mc6847_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : mc6847_base_device(mconfig, MC6847_PAL, tag, owner, clock, vdg_fontdata8x12, 312.0, true)
+mc6847_device::mc6847_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, bool pal)
+ : mc6847_base_device(mconfig, MC6847, tag, owner, clock, vdg_fontdata8x12, pal ? 312.0 : 262.0, pal)
{
- m_artifacter.set_pal_artifacting(true);
+ m_artifacter.set_pal_artifacting(pal);
}
-
//-------------------------------------------------
-// mc6847y_ntsc_device
+// mc6847y_device
//-------------------------------------------------
-mc6847y_ntsc_device::mc6847y_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : mc6847_base_device(mconfig, MC6847Y_NTSC, tag, owner, clock, vdg_fontdata8x12, 262.5, false)
+mc6847y_device::mc6847y_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, bool pal)
+ : mc6847_base_device(mconfig, MC6847Y, tag, owner, clock, vdg_fontdata8x12, pal ? 312.0 : 262.5, pal)
{
+ m_artifacter.set_pal_artifacting(pal);
}
-
-//-------------------------------------------------
-// mc6847y_pal_device
-//-------------------------------------------------
-
-mc6847y_pal_device::mc6847y_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : mc6847_base_device(mconfig, MC6847Y_PAL, tag, owner, clock, vdg_fontdata8x12, 312.0, true)
-{
- m_artifacter.set_pal_artifacting(true);
-}
-
-
-
//-------------------------------------------------
-// mc6847t1_ntsc_device
+// mc6847t1_device
//-------------------------------------------------
-mc6847t1_ntsc_device::mc6847t1_ntsc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const uint8_t *fontdata, double tpfs, bool pal)
- : mc6847_base_device(mconfig, type, tag, owner, clock, fontdata, tpfs, pal)
+mc6847t1_device::mc6847t1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, bool pal)
+ : mc6847_base_device(mconfig, MC6847T1, tag, owner, clock, vdg_t1_fontdata8x12, pal ? 312.0 : 262.0, pal)
{
+ m_artifacter.set_pal_artifacting(pal);
}
-mc6847t1_ntsc_device::mc6847t1_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : mc6847t1_ntsc_device(mconfig, MC6847T1_NTSC, tag, owner, clock, vdg_t1_fontdata8x12, 262.0, false)
-{
-}
-
-uint8_t mc6847t1_ntsc_device::border_value(uint8_t mode)
+uint8_t mc6847t1_device::border_value(uint8_t mode)
{
if (mode & MODE_AG)
{
@@ -1832,19 +1787,6 @@ uint8_t mc6847t1_ntsc_device::border_value(uint8_t mode)
}
-
-//-------------------------------------------------
-// mc6847t1_pal_device
-//-------------------------------------------------
-
-mc6847t1_pal_device::mc6847t1_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : mc6847t1_ntsc_device(mconfig, MC6847T1_PAL, tag, owner, clock, vdg_t1_fontdata8x12, 312.0, true)
-{
- m_artifacter.set_pal_artifacting(true);
-}
-
-
-
//-------------------------------------------------
// s68047_device
//-------------------------------------------------
@@ -1916,12 +1858,12 @@ uint32_t s68047_device::emit_samples(uint8_t mode, const uint8_t *data, int leng
}
-
//-------------------------------------------------
// m5c6847p1_device
//-------------------------------------------------
-m5c6847p1_device::m5c6847p1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : mc6847_base_device(mconfig, M5C6847P1, tag, owner, clock, vdg_fontdata8x12, 262.5, false)
+m5c6847p1_device::m5c6847p1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, bool pal)
+ : mc6847_base_device(mconfig, M5C6847P1, tag, owner, clock, vdg_fontdata8x12, pal ? 312.0 : 262.5, pal)
{
+ m_artifacter.set_pal_artifacting(pal);
}
diff --git a/src/devices/video/mc6847.h b/src/devices/video/mc6847.h
index d2d6d546a03..625e95a6541 100644
--- a/src/devices/video/mc6847.h
+++ b/src/devices/video/mc6847.h
@@ -258,7 +258,7 @@ protected:
character_map m_character_map;
artifacter m_artifacter;
- // device-level overrides
+ // device_t overrides
virtual void device_start() override ATTR_COLD;
virtual void device_reset() override ATTR_COLD;
virtual void device_post_load() override;
@@ -368,34 +368,34 @@ protected:
/* graphics */
switch(mode & (MODE_GM2|MODE_GM1|MODE_GM0))
{
- case 0:
- emit_graphics<2, xscale * 4>(data, length, pixels, (mode & MODE_CSS) ? 4 : 0, palette);
- result = length * 8 * xscale * 2;
- break;
-
- case MODE_GM0:
- case MODE_GM1|MODE_GM0:
- case MODE_GM2|MODE_GM0:
- emit_graphics<1, xscale * 2>(data, length, pixels, (mode & MODE_CSS) ? 10 : 8, palette);
- result = length * 8 * xscale * 2;
- break;
-
- case MODE_GM1:
- case MODE_GM2:
- case MODE_GM2|MODE_GM1:
- emit_graphics<2, xscale * 2>(data, length, pixels, (mode & MODE_CSS) ? 4 : 0, palette);
- result = length * 8 * xscale;
- break;
-
- case MODE_GM2|MODE_GM1|MODE_GM0:
- emit_graphics<1, xscale * 1>(data, length, pixels, (mode & MODE_CSS) ? 10 : 8, palette);
- result = length * 8 * xscale;
- break;
-
- default:
- /* should not get here */
- fatalerror("Should not get here\n");
- break;
+ case 0:
+ emit_graphics<2, xscale * 4>(data, length, pixels, (mode & MODE_CSS) ? 4 : 0, palette);
+ result = length * 8 * xscale * 2;
+ break;
+
+ case MODE_GM0:
+ case MODE_GM1|MODE_GM0:
+ case MODE_GM2|MODE_GM0:
+ emit_graphics<1, xscale * 2>(data, length, pixels, (mode & MODE_CSS) ? 10 : 8, palette);
+ result = length * 8 * xscale * 2;
+ break;
+
+ case MODE_GM1:
+ case MODE_GM2:
+ case MODE_GM2|MODE_GM1:
+ emit_graphics<2, xscale * 2>(data, length, pixels, (mode & MODE_CSS) ? 4 : 0, palette);
+ result = length * 8 * xscale;
+ break;
+
+ case MODE_GM2|MODE_GM1|MODE_GM0:
+ emit_graphics<1, xscale * 1>(data, length, pixels, (mode & MODE_CSS) ? 10 : 8, palette);
+ result = length * 8 * xscale;
+ break;
+
+ default:
+ /* should not get here */
+ fatalerror("Should not get here\n");
+ break;
}
}
else if (!m_charrom_cb.isnull() && ((mode & (MODE_AG|MODE_AS|MODE_INTEXT)) == MODE_INTEXT))
@@ -417,6 +417,17 @@ protected:
return result;
}
+protected:
+ double m_tpfs;
+ bool m_pal;
+ const uint16_t m_lines_top_border;
+ const uint16_t m_lines_until_vblank;
+ const uint16_t m_lines_until_retrace;
+
+ bool is_top_pal_padding_line(int scanline) const;
+ bool is_bottom_pal_padding_line(int scanline) const;
+ bool is_pal_padding_line(int scanline) const;
+
private:
enum scanline_zone
{
@@ -432,10 +443,6 @@ private:
emu_timer *m_hsync_off_timer;
emu_timer *m_fsync_timer;
-protected:
- const double m_tpfs;
-
-private:
// incidentals
const int m_divider;
const int m_field_sync_falling_edge_scanline;
@@ -446,13 +453,6 @@ private:
bool m_recording_scanline;
const bool m_supports_partial_body_scanlines;
-protected:
- const bool m_pal;
- const uint16_t m_lines_top_border;
- const uint16_t m_lines_until_vblank;
- const uint16_t m_lines_until_retrace;
-
-private:
// video state
uint16_t m_physical_scanline;
uint16_t m_logical_scanline;
@@ -470,11 +470,6 @@ private:
// debugging
std::string scanline_zone_string(scanline_zone zone) const;
-
-protected:
- bool is_top_pal_padding_line(int scanline) const;
- bool is_bottom_pal_padding_line(int scanline) const;
- bool is_pal_padding_line(int scanline) const;
};
// actual base class for MC6847 family of devices
@@ -507,7 +502,7 @@ public:
protected:
mc6847_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const uint8_t *fontdata, double tpfs, bool pal);
- // device-level overrides
+ // device_t overrides
virtual void device_config_complete() override;
virtual void device_start() override ATTR_COLD;
virtual void device_reset() override ATTR_COLD;
@@ -603,47 +598,27 @@ private:
// VARIATIONS
//**************************************************************************
-class mc6847_ntsc_device : public mc6847_base_device
-{
-public:
- mc6847_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-};
-
-class mc6847_pal_device : public mc6847_base_device
+class mc6847_device : public mc6847_base_device
{
public:
- mc6847_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ mc6847_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, bool pal = false);
};
-class mc6847y_ntsc_device : public mc6847_base_device
+class mc6847y_device : public mc6847_base_device
{
public:
- mc6847y_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ mc6847y_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, bool pal = false);
};
-class mc6847y_pal_device : public mc6847_base_device
+class mc6847t1_device : public mc6847_base_device
{
public:
- mc6847y_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-};
-
-class mc6847t1_ntsc_device : public mc6847_base_device
-{
-public:
- mc6847t1_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ mc6847t1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, bool pal = false);
protected:
- mc6847t1_ntsc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const uint8_t *fontdata, double tpfs, bool pal);
-
virtual uint8_t border_value(uint8_t mode) override;
};
-class mc6847t1_pal_device : public mc6847t1_ntsc_device
-{
-public:
- mc6847t1_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-};
-
class s68047_device : public mc6847_base_device
{
public:
@@ -664,17 +639,14 @@ private:
class m5c6847p1_device : public mc6847_base_device
{
public:
- m5c6847p1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ m5c6847p1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, bool pal = false);
};
-DECLARE_DEVICE_TYPE(MC6847_NTSC, mc6847_ntsc_device)
-DECLARE_DEVICE_TYPE(MC6847_PAL, mc6847_pal_device)
-DECLARE_DEVICE_TYPE(MC6847Y_NTSC, mc6847y_ntsc_device)
-DECLARE_DEVICE_TYPE(MC6847Y_PAL, mc6847y_pal_device)
-DECLARE_DEVICE_TYPE(MC6847T1_NTSC, mc6847t1_ntsc_device)
-DECLARE_DEVICE_TYPE(MC6847T1_PAL, mc6847t1_pal_device)
-DECLARE_DEVICE_TYPE(S68047, s68047_device)
-DECLARE_DEVICE_TYPE(M5C6847P1, m5c6847p1_device)
+DECLARE_DEVICE_TYPE(MC6847, mc6847_device)
+DECLARE_DEVICE_TYPE(MC6847Y, mc6847y_device)
+DECLARE_DEVICE_TYPE(MC6847T1, mc6847t1_device)
+DECLARE_DEVICE_TYPE(S68047, s68047_device)
+DECLARE_DEVICE_TYPE(M5C6847P1, m5c6847p1_device)
#endif // MAME_VIDEO_MC6847_H
diff --git a/src/mame/acorn/atom.cpp b/src/mame/acorn/atom.cpp
index 441c319ed38..624fa5df922 100644
--- a/src/mame/acorn/atom.cpp
+++ b/src/mame/acorn/atom.cpp
@@ -1147,7 +1147,7 @@ void atom_state::atom_base(machine_config &config)
SCREEN(config, "screen", SCREEN_TYPE_RASTER);
- MC6847_NTSC(config, m_vdg, 3.579545_MHz_XTAL);
+ MC6847(config, m_vdg, 3.579545_MHz_XTAL);
m_vdg->input_callback().set(FUNC(atom_state::vdg_videoram_r));
m_vdg->set_screen("screen");
diff --git a/src/mame/apf/apf.cpp b/src/mame/apf/apf.cpp
index 26b948e6ed8..037a80c8f15 100644
--- a/src/mame/apf/apf.cpp
+++ b/src/mame/apf/apf.cpp
@@ -550,10 +550,10 @@ void apf_state::apfm1000(machine_config &config)
/* video hardware */
SCREEN(config, "screen", SCREEN_TYPE_RASTER);
- MC6847_NTSC(config, m_crtc, 3.579545_MHz_XTAL);
+ MC6847(config, m_crtc, 3.579545_MHz_XTAL);
m_crtc->fsync_wr_callback().set(m_pia0, FUNC(pia6821_device::cb1_w));
m_crtc->input_callback().set(FUNC(apf_state::videoram_r));
- m_crtc->set_get_fixed_mode(mc6847_ntsc_device::MODE_GM2 | mc6847_ntsc_device::MODE_GM1);
+ m_crtc->set_get_fixed_mode(mc6847_device::MODE_GM2 | mc6847_device::MODE_GM1);
m_crtc->set_screen("screen");
// INTEXT = GND
// other lines not connected
diff --git a/src/mame/cce/mc1000.cpp b/src/mame/cce/mc1000.cpp
index bbd8e74e0d0..9a92a2765f0 100644
--- a/src/mame/cce/mc1000.cpp
+++ b/src/mame/cce/mc1000.cpp
@@ -568,7 +568,7 @@ void mc1000_state::mc1000(machine_config &config)
/* video hardware */
SCREEN(config, SCREEN_TAG, SCREEN_TYPE_RASTER);
- MC6847_NTSC(config, m_vdg, XTAL(3'579'545));
+ MC6847(config, m_vdg, XTAL(3'579'545));
m_vdg->hsync_wr_callback().set(FUNC(mc1000_state::hs_w));
m_vdg->fsync_wr_callback().set(FUNC(mc1000_state::fs_w));
m_vdg->input_callback().set(FUNC(mc1000_state::videoram_r));
diff --git a/src/mame/misc/ctvboy.cpp b/src/mame/misc/ctvboy.cpp
index f0f7151c39d..7e99a2b2b52 100644
--- a/src/mame/misc/ctvboy.cpp
+++ b/src/mame/misc/ctvboy.cpp
@@ -58,7 +58,7 @@ protected:
private:
required_device<m6801u4_cpu_device> m_maincpu;
required_shared_ptr<u8> m_vram;
- required_device<mc6847_ntsc_device> m_mc6847;
+ required_device<mc6847_device> m_mc6847;
required_device<screen_device> m_screen;
required_device<dac_bit_interface> m_dac;
required_device<filter_volume_device> m_volume;
@@ -239,7 +239,7 @@ void ctvboy_state::ctvboy(machine_config &config)
m_maincpu->in_p2_cb().set(FUNC(ctvboy_state::p2_r));
// video hardware
- MC6847_NTSC(config, m_mc6847, 3.579545_MHz_XTAL);
+ MC6847(config, m_mc6847, 3.579545_MHz_XTAL);
m_mc6847->input_callback().set(FUNC(ctvboy_state::mc6847_vram_r));
m_mc6847->fsync_wr_callback().set(FUNC(ctvboy_state::vblank_irq));
m_mc6847->set_screen(m_screen);
diff --git a/src/mame/misc/z80ne.cpp b/src/mame/misc/z80ne.cpp
index 4c4afd4e89a..b5cc0d98b66 100644
--- a/src/mame/misc/z80ne.cpp
+++ b/src/mame/misc/z80ne.cpp
@@ -1417,7 +1417,7 @@ void z80net_state::z80net(machine_config &config)
/* video hardware */
SCREEN(config, "lx388", SCREEN_TYPE_RASTER);
- MC6847_PAL(config, m_vdg, 4.433619_MHz_XTAL);
+ MC6847(config, m_vdg, 4.433619_MHz_XTAL, true);
m_vdg->set_screen("lx388");
m_vdg->input_callback().set(FUNC(z80net_state::lx388_mc6847_videoram_r));
// AG = GND, GM2 = GND, GM1 = GND, GM0 = GND, CSS = GND
@@ -1458,7 +1458,7 @@ void z80netb_state::z80netb(machine_config &config)
/* video hardware */
SCREEN(config, "lx388", SCREEN_TYPE_RASTER);
- MC6847_PAL(config, m_vdg, 4.433619_MHz_XTAL);
+ MC6847(config, m_vdg, 4.433619_MHz_XTAL, true);
m_vdg->set_screen("lx388");
m_vdg->input_callback().set(FUNC(z80netb_state::lx388_mc6847_videoram_r));
// AG = GND, GM2 = GND, GM1 = GND, GM0 = GND, CSS = GND
@@ -1500,7 +1500,7 @@ void z80netf_state::z80netf(machine_config &config)
/* video hardware */
SCREEN(config, "lx388", SCREEN_TYPE_RASTER);
- MC6847_PAL(config, m_vdg, 4.433619_MHz_XTAL);
+ MC6847(config, m_vdg, 4.433619_MHz_XTAL, true);
m_vdg->set_screen("lx388");
m_vdg->input_callback().set(FUNC(z80netf_state::lx388_mc6847_videoram_r));
// AG = GND, GM2 = GND, GM1 = GND, GM0 = GND, CSS = GND
diff --git a/src/mame/motorola/uchroma68.cpp b/src/mame/motorola/uchroma68.cpp
index 2160ffe0f9e..c353c5d18d9 100644
--- a/src/mame/motorola/uchroma68.cpp
+++ b/src/mame/motorola/uchroma68.cpp
@@ -178,7 +178,7 @@ private:
required_device<cpu_device> m_maincpu;
required_device<mc6846_device> m_mc6846;
- required_device<mc6847_ntsc_device> m_mc6847;
+ required_device<mc6847_device> m_mc6847;
required_device<pia6821_device> m_pia;
required_device<acia6850_device> m_acia;
required_device<clock_device> m_acia_tx_clock;
@@ -452,7 +452,7 @@ void uchroma68_state::uchroma68(machine_config &config)
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
- MC6847_NTSC(config, m_mc6847, XTAL_UCHROMA68);
+ MC6847(config, m_mc6847, XTAL_UCHROMA68);
m_mc6847->set_screen(m_screen);
m_mc6847->input_callback().set(FUNC(uchroma68_state::mc6847_videoram_r));
diff --git a/src/mame/samsung/spc1000.cpp b/src/mame/samsung/spc1000.cpp
index d569d493d34..58e2b907225 100644
--- a/src/mame/samsung/spc1000.cpp
+++ b/src/mame/samsung/spc1000.cpp
@@ -484,12 +484,12 @@ void spc1000_state::spc1000(machine_config &config)
/* video hardware */
SCREEN(config, "screen", SCREEN_TYPE_RASTER);
- MC6847_NTSC(config, m_vdg, XTAL(3'579'545));
+ MC6847(config, m_vdg, XTAL(3'579'545));
m_vdg->set_screen("screen");
m_vdg->fsync_wr_callback().set(FUNC(spc1000_state::irq_w));
m_vdg->input_callback().set(FUNC(spc1000_state::mc6847_videoram_r));
m_vdg->set_get_char_rom(FUNC(spc1000_state::get_char_rom));
- m_vdg->set_get_fixed_mode(mc6847_ntsc_device::MODE_GM2);
+ m_vdg->set_get_fixed_mode(mc6847_device::MODE_GM2);
// other lines not connected
/* sound hardware */
diff --git a/src/mame/sanyo/phc20.cpp b/src/mame/sanyo/phc20.cpp
index 53af9985f28..68810964ba4 100644
--- a/src/mame/sanyo/phc20.cpp
+++ b/src/mame/sanyo/phc20.cpp
@@ -174,7 +174,7 @@ uint8_t phc20_state::system_r()
uint8_t data = 0x00;
- data |= (m_cassette->input() < +0.3) << 0;
+ data |= (m_cassette->input() > +0.3) << 0;
data |= m_vdg->fs_r() << 1;
return data;
@@ -211,7 +211,7 @@ void phc20_state::phc20(machine_config &config)
SCREEN(config, "screen", SCREEN_TYPE_RASTER);
- MC6847_PAL(config, m_vdg, 3.579545_MHz_XTAL);
+ M5C6847P1(config, m_vdg, 3.579545_MHz_XTAL);
m_vdg->set_screen("screen");
m_vdg->input_callback().set(FUNC(phc20_state::video_ram_r));
m_vdg->set_black_and_white(true);
diff --git a/src/mame/sanyo/phc25.cpp b/src/mame/sanyo/phc25.cpp
index 1e4ae6cb752..c600432d588 100644
--- a/src/mame/sanyo/phc25.cpp
+++ b/src/mame/sanyo/phc25.cpp
@@ -66,7 +66,7 @@ public:
, m_vram(*this, "videoram")
, m_maincpu(*this, "maincpu")
, m_chargen(*this, "chargen")
- , m_vdg(*this, "m5c6847p1")
+ , m_vdg(*this, "vdg")
, m_centronics(*this, "centronics")
, m_cent_data_out(*this, "cent_data_out")
, m_cassette(*this, "cassette")
@@ -642,12 +642,12 @@ void phc25_state::phc25(machine_config &config)
/* video hardware */
SCREEN(config, "screen", SCREEN_TYPE_RASTER);
- M5C6847P1(config, m_vdg, XTAL(4'433'619));
+ M5C6847P1(config, m_vdg, XTAL(4'433'619), true);
m_vdg->set_screen("screen");
m_vdg->fsync_wr_callback().set(FUNC(phc25_state::fsync_irq_w));
m_vdg->input_callback().set(FUNC(phc25_state::video_ram_r));
m_vdg->set_get_char_rom(FUNC(phc25_state::char_rom_r));
- m_vdg->set_get_fixed_mode(mc6847_pal_device::MODE_GM2 | mc6847_pal_device::MODE_GM1 | mc6847_pal_device::MODE_INTEXT);
+ m_vdg->set_get_fixed_mode(mc6847_device::MODE_GM2 | mc6847_device::MODE_GM1 | mc6847_device::MODE_INTEXT);
// other lines not connected
/* sound hardware (Synthesizer PSG-01 add-on) */
@@ -680,10 +680,10 @@ void phc25_state::phc25j(machine_config &config)
M5C6847P1(config.replace(), m_vdg, XTAL(3'579'545));
m_vdg->set_screen("screen");
- m_vdg->fsync_wr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0).invert();
+ m_vdg->fsync_wr_callback().set(FUNC(phc25_state::fsync_irq_w));
m_vdg->input_callback().set(FUNC(phc25_state::video_ram_r));
m_vdg->set_get_char_rom(FUNC(phc25_state::char_rom_r));
- m_vdg->set_get_fixed_mode(mc6847_ntsc_device::MODE_GM2 | mc6847_ntsc_device::MODE_GM1 | mc6847_ntsc_device::MODE_INTEXT);
+ m_vdg->set_get_fixed_mode(mc6847_device::MODE_GM2 | mc6847_device::MODE_GM1 | mc6847_device::MODE_INTEXT);
// other lines not connected
}
diff --git a/src/mame/skeleton/fc100.cpp b/src/mame/skeleton/fc100.cpp
index b6d320f5425..16cfe14ddc0 100644
--- a/src/mame/skeleton/fc100.cpp
+++ b/src/mame/skeleton/fc100.cpp
@@ -524,7 +524,7 @@ void fc100_state::fc100(machine_config &config)
m_maincpu->set_addrmap(AS_IO, &fc100_state::io_map);
/* video hardware */
- M5C6847P1(config, m_vdg, XTAL(7'159'090)/3); // Clock not verified
+ M5C6847P1(config, m_vdg, XTAL(7'159'090)/2); // Clock not verified
m_vdg->set_screen("screen");
m_vdg->input_callback().set(FUNC(fc100_state::mc6847_videoram_r));
m_vdg->set_get_char_rom(FUNC(fc100_state::get_char_rom));
diff --git a/src/mame/skeleton/shine.cpp b/src/mame/skeleton/shine.cpp
index ac405decd9b..278b5beb4cd 100644
--- a/src/mame/skeleton/shine.cpp
+++ b/src/mame/skeleton/shine.cpp
@@ -256,7 +256,7 @@ void shine_state::shine(machine_config &config)
/* video hardware */
SCREEN(config, "screen", SCREEN_TYPE_RASTER);
- MC6847_NTSC(config, m_vdg, 3.579545_MHz_XTAL); // or really PAL?
+ MC6847(config, m_vdg, 3.579545_MHz_XTAL);
m_vdg->set_screen("screen");
m_vdg->input_callback().set(FUNC(shine_state::vdg_videoram_r));
m_vdg->set_black_and_white(true);
diff --git a/src/mame/trs/agvision.cpp b/src/mame/trs/agvision.cpp
index 75a1aeda6ea..00b6c05af66 100644
--- a/src/mame/trs/agvision.cpp
+++ b/src/mame/trs/agvision.cpp
@@ -212,7 +212,7 @@ void agvision_state::agvision(machine_config &config)
// video hardware
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
- MC6847_NTSC(config, m_vdg, XTAL(14'318'181) / 4); // VClk output from MC6883
+ MC6847(config, m_vdg, XTAL(14'318'181) / 4); // VClk output from MC6883
m_vdg->set_screen(m_screen);
m_vdg->hsync_wr_callback().set(m_pia_0, FUNC(pia6821_device::ca1_w));
m_vdg->input_callback().set(FUNC(agvision_state::sam_read));
diff --git a/src/mame/trs/coco12.cpp b/src/mame/trs/coco12.cpp
index 99f2fc8838c..95c8dbad1e1 100644
--- a/src/mame/trs/coco12.cpp
+++ b/src/mame/trs/coco12.cpp
@@ -543,7 +543,7 @@ void coco12_state::coco(machine_config &config)
// video hardware
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
- MC6847_NTSC(config, m_vdg, XTAL(14'318'181) / 4); // VClk output from MC6883
+ MC6847(config, m_vdg, XTAL(14'318'181) / 4); // VClk output from MC6883
m_vdg->set_screen(m_screen);
m_vdg->hsync_wr_callback().set(FUNC(coco12_state::horizontal_sync));
m_vdg->fsync_wr_callback().set(FUNC(coco12_state::field_sync));
@@ -617,7 +617,7 @@ void coco12_state::coco2b(machine_config &config)
{
coco(config);
- MC6847T1_NTSC(config.replace(), m_vdg, XTAL(14'318'181) / 4);
+ MC6847T1(config.replace(), m_vdg, XTAL(14'318'181) / 4);
m_vdg->set_screen(m_screen);
m_vdg->hsync_wr_callback().set(FUNC(coco12_state::horizontal_sync));
m_vdg->fsync_wr_callback().set(FUNC(coco12_state::field_sync));
diff --git a/src/mame/trs/dragon.cpp b/src/mame/trs/dragon.cpp
index 4f7bbf4d434..9a4341b3673 100644
--- a/src/mame/trs/dragon.cpp
+++ b/src/mame/trs/dragon.cpp
@@ -516,7 +516,7 @@ void dragon_state::dragon_base(machine_config &config)
// video hardware
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
- MC6847_PAL(config, m_vdg, 14.218_MHz_XTAL / 4);
+ MC6847(config, m_vdg, 14.218_MHz_XTAL / 4, true);
m_vdg->set_screen(m_screen);
m_vdg->hsync_wr_callback().set(FUNC(dragon_state::horizontal_sync));
m_vdg->fsync_wr_callback().set(FUNC(dragon_state::field_sync));
@@ -628,7 +628,7 @@ void dragon64_state::tanodr64(machine_config &config)
m_sam->set_clock(14.318181_MHz_XTAL);
// video hardware
- MC6847_NTSC(config.replace(), m_vdg, 14.318181_MHz_XTAL / 4);
+ MC6847(config.replace(), m_vdg, 14.318181_MHz_XTAL / 4);
m_vdg->set_screen(m_screen);
m_vdg->hsync_wr_callback().set(FUNC(dragon_state::horizontal_sync));
m_vdg->fsync_wr_callback().set(FUNC(dragon_state::field_sync));
diff --git a/src/mame/trs/mc10.cpp b/src/mame/trs/mc10.cpp
index 4089f85c18d..3070eb6e1c4 100644
--- a/src/mame/trs/mc10.cpp
+++ b/src/mame/trs/mc10.cpp
@@ -511,7 +511,7 @@ void mc10_state::mc10_video(machine_config &config)
/* video hardware */
SCREEN(config, "screen", SCREEN_TYPE_RASTER);
- mc6847_ntsc_device &vdg(MC6847_NTSC(config, "mc6847", XTAL(3'579'545)));
+ mc6847_device &vdg(MC6847(config, "mc6847", XTAL(3'579'545)));
vdg.set_screen("screen");
vdg.input_callback().set(FUNC(mc10_state::mc6847_videoram_r));
}
diff --git a/src/mame/vtech/vtech1.cpp b/src/mame/vtech/vtech1.cpp
index 25012325fc2..351bc5c79a1 100644
--- a/src/mame/vtech/vtech1.cpp
+++ b/src/mame/vtech/vtech1.cpp
@@ -477,10 +477,10 @@ void vtech1_base_state::vtech1(machine_config &config)
m_maincpu->set_addrmap(AS_IO, &vtech1_base_state::vtech1_io);
// video hardware
- MC6847_PAL(config, m_crtc, XTAL(4'433'619));
+ MC6847(config, m_crtc, XTAL(4'433'619), true);
m_crtc->set_screen("screen");
m_crtc->fsync_wr_callback().set_inputline(m_maincpu, 0).invert();
- m_crtc->set_get_fixed_mode(mc6847_pal_device::MODE_GM1);
+ m_crtc->set_get_fixed_mode(mc6847_device::MODE_GM1);
// GM2 = GND, GM0 = GND, INTEXT = GND
// other lines not connected
@@ -554,7 +554,7 @@ void laser310h_state::laser310h(machine_config &config)
m_maincpu->set_addrmap(AS_IO, &laser310h_state::vtech1_shrg_io);
m_crtc->input_callback().set(FUNC(laser310h_state::mc6847_videoram_r));
- m_crtc->set_get_fixed_mode(mc6847_pal_device::MODE_GM1);
+ m_crtc->set_get_fixed_mode(mc6847_device::MODE_GM1);
// INTEXT = GND
// other lines not connected
}