Skip to content

Commit 3d4ad34

Browse files
authored
video/mc6847.cpp: remove implicit screen setup default in device_config_complete (#15855)
* video devices are never intended to have this kind of information, screen_device is an abstraction that emulates a monitor _connection_. * In MC6847 case the device is normally paired with a MC6883 Synchronous Address Multiplexer (where the clock is actually generated) and a MC1372 RF modulator. * fix recent regression with trs/coco12.cpp at least (setting a screen of 100x100)
1 parent bcf1988 commit 3d4ad34

19 files changed

Lines changed: 62 additions & 48 deletions

File tree

src/devices/video/mc6847.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -640,39 +640,6 @@ void mc6847_base_device::setup_fixed_mode()
640640
}
641641

642642

643-
//-------------------------------------------------
644-
// device_config_complete - perform any
645-
// operations now that the configuration is
646-
// complete
647-
//-------------------------------------------------
648-
649-
void mc6847_base_device::device_config_complete()
650-
{
651-
if (!has_screen())
652-
return;
653-
654-
if (!screen().configured())
655-
{
656-
// It is preferred to initialize the screen device using set_raw.
657-
// Setting screen device's raw parameters requires values in terms of pixels.
658-
// Multiplying the 6847's clock by 2 produces a pixel clock that allows
659-
// 256 pixels of active video area per line, with apparently no roundoff
660-
// error or drift.
661-
screen().set_raw(
662-
uint32_t(clock() * 2),
663-
456, // htotal
664-
0, // hbend
665-
BMP_L_OR_R_BORDER * 2 + BMP_ACTIVE_VIDEO, // hbstart
666-
m_tpfs, // vtotal
667-
0, // vbend
668-
m_lines_until_retrace); // vbstart
669-
}
670-
671-
if (!screen().has_screen_update())
672-
screen().set_screen_update(*this, FUNC(mc6847_base_device::screen_update));
673-
}
674-
675-
676643
//-------------------------------------------------
677644
// device_start - device-specific startup
678645
//-------------------------------------------------

src/devices/video/mc6847.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,6 @@ class mc6847_base_device : public mc6847_friend_device
504504
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);
505505

506506
// device_t overrides
507-
virtual void device_config_complete() override;
508507
virtual void device_start() override ATTR_COLD;
509508
virtual void device_reset() override ATTR_COLD;
510509
virtual ioport_constructor device_input_ports() const override ATTR_COLD;

src/mame/acorn/atom.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,9 @@ void atom_state::atom_base(machine_config &config)
11421142
m_maincpu->set_addrmap(AS_PROGRAM, &atom_state::atom_mem);
11431143
config.set_perfect_quantum(m_maincpu); // required for Tube interface
11441144

1145-
SCREEN(config, "screen");
1145+
screen_device &screen(SCREEN(config, "screen"));
1146+
screen.set_raw(XTAL(3'579'545) * 2, 456, 0, 372, 262, 0, 243);
1147+
screen.set_screen_update("vdg", FUNC(mc6847_base_device::screen_update));
11461148

11471149
MC6847(config, m_vdg, 3.579545_MHz_XTAL);
11481150
m_vdg->input_callback().set(FUNC(atom_state::vdg_videoram_r));

src/mame/apf/apf.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,9 @@ void apf_state::apfm1000(machine_config &config)
548548
m_maincpu->set_addrmap(AS_PROGRAM, &apf_state::apfm1000_map);
549549

550550
/* video hardware */
551-
SCREEN(config, "screen");
551+
screen_device &screen(SCREEN(config, "screen"));
552+
screen.set_raw(XTAL(3'579'545) * 2, 456, 0, 372, 262, 0, 243);
553+
screen.set_screen_update(m_crtc, FUNC(mc6847_base_device::screen_update));
552554

553555
MC6847(config, m_crtc, 3.579545_MHz_XTAL);
554556
m_crtc->fsync_wr_callback().set(m_pia0, FUNC(pia6821_device::cb1_w));

src/mame/bandai/sv8000.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,9 @@ void sv8000_state::sv8000(machine_config &config)
298298
m_s68047p->set_palette(sv8000_palette);
299299
m_s68047p->set_screen("screen");
300300

301-
SCREEN(config, "screen");
301+
screen_device &screen(SCREEN(config, "screen"));
302+
screen.set_raw(XTAL(3'579'545) * 2, 456, 0, 372, 262, 0, 243);
303+
screen.set_screen_update(m_s68047p, FUNC(s68047_device::screen_update));
302304

303305
// sound hardware
304306
SPEAKER(config, "mono").front_center();

src/mame/cce/mc1000.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,9 @@ void mc1000_state::mc1000(machine_config &config)
569569
ne555assert.config_param(ASSERT_LINE);
570570

571571
/* video hardware */
572-
SCREEN(config, SCREEN_TAG);
572+
screen_device &screen(SCREEN(config, SCREEN_TAG));
573+
screen.set_raw(XTAL(3'579'545) * 2, 456, 0, 372, 262, 0, 243);
574+
screen.set_screen_update(m_vdg, FUNC(mc6847_base_device::screen_update));
573575

574576
MC6847(config, m_vdg, XTAL(3'579'545));
575577
m_vdg->hsync_wr_callback().set(FUNC(mc1000_state::hs_w));

src/mame/misc/ctvboy.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ void ctvboy_state::ctvboy(machine_config &config)
245245
m_mc6847->set_screen(m_screen);
246246

247247
SCREEN(config, m_screen);
248+
m_screen->set_raw(XTAL(3'579'545) * 2, 456, 0, 372, 262, 0, 243);
249+
m_screen->set_screen_update(m_mc6847, FUNC(mc6847_base_device::screen_update));
248250

249251
// sound hardware
250252
SPEAKER(config, "speaker").front_center();

src/mame/misc/z80ne.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,9 @@ void z80net_state::z80net(machine_config &config)
14061406
lx387(config);
14071407

14081408
/* video hardware */
1409-
SCREEN(config, "lx388");
1409+
screen_device &screen(SCREEN(config, "lx388"));
1410+
screen.set_raw(XTAL(4'433'619) * 2, 456, 0, 372, 312, 0, 293);
1411+
screen.set_screen_update(m_vdg, FUNC(mc6847_base_device::screen_update));
14101412

14111413
MC6847(config, m_vdg, 4.433619_MHz_XTAL, true);
14121414
m_vdg->set_screen("lx388");
@@ -1447,7 +1449,9 @@ void z80netb_state::z80netb(machine_config &config)
14471449
lx387(config);
14481450

14491451
/* video hardware */
1450-
SCREEN(config, "lx388");
1452+
screen_device &screen(SCREEN(config, "lx388"));
1453+
screen.set_raw(XTAL(4'433'619) * 2, 456, 0, 372, 312, 0, 293);
1454+
screen.set_screen_update(m_vdg, FUNC(mc6847_base_device::screen_update));
14511455

14521456
MC6847(config, m_vdg, 4.433619_MHz_XTAL, true);
14531457
m_vdg->set_screen("lx388");
@@ -1489,7 +1493,9 @@ void z80netf_state::z80netf(machine_config &config)
14891493
lx387(config);
14901494

14911495
/* video hardware */
1492-
SCREEN(config, "lx388");
1496+
screen_device &screen(SCREEN(config, "lx388"));
1497+
screen.set_raw(XTAL(4'433'619) * 2, 456, 0, 372, 312, 0, 293);
1498+
screen.set_screen_update(m_vdg, FUNC(mc6847_base_device::screen_update));
14931499

14941500
MC6847(config, m_vdg, 4.433619_MHz_XTAL, true);
14951501
m_vdg->set_screen("lx388");

src/mame/motorola/uchroma68.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,9 @@ void uchroma68_state::uchroma68(machine_config &config)
451451
m_cass->add_route(ALL_OUTPUTS, "mono", 0.05);
452452

453453
SCREEN(config, m_screen);
454+
// NTSC
455+
m_screen->set_raw(XTAL_UCHROMA68 * 2, 456, 0, 372, 262, 0, 243);
456+
m_screen->set_screen_update(m_mc6847, FUNC(mc6847_base_device::screen_update));
454457

455458
MC6847(config, m_mc6847, XTAL_UCHROMA68);
456459
m_mc6847->set_screen(m_screen);

src/mame/samsung/spc1000.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,9 @@ void spc1000_state::spc1000(machine_config &config)
482482
m_maincpu->set_addrmap(AS_IO, &spc1000_state::io_map);
483483

484484
/* video hardware */
485-
SCREEN(config, "screen");
485+
screen_device &screen(SCREEN(config, "screen"));
486+
screen.set_raw(XTAL(3'579'545) * 2, 456, 0, 372, 262, 0, 243);
487+
screen.set_screen_update(m_vdg, FUNC(mc6847_base_device::screen_update));
486488

487489
MC6847(config, m_vdg, XTAL(3'579'545));
488490
m_vdg->set_screen("screen");

0 commit comments

Comments
 (0)