From 9fbe608a9014011ed1b31a58a0f251a16f513a22 Mon Sep 17 00:00:00 2001 From: AJR Date: Tue, 11 Sep 2018 22:30:58 -0400 Subject: pcd, pcx: Add screen parameters and CRTC clocks; pcx has SCN2672 rather than SCN2674 (nw) --- src/mame/video/pcd.cpp | 47 ++++++++++++++++++++++------------------------- src/mame/video/pcd.h | 6 ++++-- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/src/mame/video/pcd.cpp b/src/mame/video/pcd.cpp index 2a444997c4e..003ad8ca1b8 100644 --- a/src/mame/video/pcd.cpp +++ b/src/mame/video/pcd.cpp @@ -17,13 +17,13 @@ pcdx_video_device::pcdx_video_device(const machine_config &mconfig, device_type device_gfx_interface(mconfig, *this, nullptr, "palette"), m_maincpu(*this, ":maincpu"), m_mcu(*this, "graphics"), - m_crtc(*this, "crtc"), m_pic2(*this, ":pic2") { } pcd_video_device::pcd_video_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pcdx_video_device(mconfig, PCD_VIDEO, tag, owner, clock), + m_crtc(*this, "crtc"), m_mouse_btn(*this, "MOUSE"), m_mouse_x(*this, "MOUSEX"), m_mouse_y(*this, "MOUSEY"), @@ -35,6 +35,7 @@ pcd_video_device::pcd_video_device(const machine_config &mconfig, const char *ta pcx_video_device::pcx_video_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pcdx_video_device(mconfig, PCX_VIDEO, tag, owner, clock), device_serial_interface(mconfig, *this), + m_crtc(*this, "crtc"), m_vram(4*1024), m_charrom(*this, "char"), m_txd_handler(*this) @@ -100,25 +101,23 @@ ioport_constructor pcd_video_device::device_input_ports() const } MACHINE_CONFIG_START(pcd_video_device::device_add_mconfig) - MCFG_DEVICE_ADD("graphics", I8741, XTAL(16'000'000)/2) + MCFG_DEVICE_ADD("graphics", I8741, 16_MHz_XTAL / 2) MCFG_MCS48_PORT_P1_IN_CB(READ8(*this, pcd_video_device, p1_r)) MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(*this, pcd_video_device, p2_w)) MCFG_MCS48_PORT_T1_IN_CB(READLINE(*this, pcd_video_device, t1_r)) // video hardware - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_SIZE(640, 350) - MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 349) - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_UPDATE_DEVICE("crtc", scn2674_device, screen_update) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(16_MHz_XTAL, 832, 0, 640, 381, 0, 350); + screen.set_screen_update("crtc", FUNC(scn2674_device::screen_update)); MCFG_PALETTE_ADD("palette", 3) MCFG_PALETTE_INIT_OWNER(pcdx_video_device, pcdx) - scn2674_device &crtc(SCN2674(config, "crtc", 0)); - crtc.set_character_width(16); - crtc.set_display_callback(FUNC(pcd_video_device::display_pixels)); - crtc.set_screen("screen"); + SCN2674(config, m_crtc, 16_MHz_XTAL / 16); + m_crtc->set_character_width(16); + m_crtc->set_display_callback(FUNC(pcd_video_device::display_pixels)); + m_crtc->set_screen("screen"); MCFG_TIMER_DRIVER_ADD_PERIODIC("mouse_timer", pcd_video_device, mouse_timer, attotime::from_hz(15000)) // guess MACHINE_CONFIG_END @@ -130,7 +129,7 @@ void pcx_video_device::pcx_vid_map(address_map &map) void pcx_video_device::pcx_vid_io(address_map &map) { - map(0x8000, 0x8007).rw("crtc", FUNC(scn2674_device::read), FUNC(scn2674_device::write)); + map(0x8000, 0x8007).rw("crtc", FUNC(scn2672_device::read), FUNC(scn2672_device::write)); map(0x8008, 0x8008).r(FUNC(pcx_video_device::unk_r)); map(0xa000, 0xa001).rw(FUNC(pcx_video_device::vram_latch_r), FUNC(pcx_video_device::vram_latch_w)); map(0xa002, 0xa003).rw(FUNC(pcx_video_device::term_mcu_r), FUNC(pcx_video_device::term_mcu_w)); @@ -143,7 +142,7 @@ void pcx_video_device::pcx_vram(address_map &map) } MACHINE_CONFIG_START(pcx_video_device::device_add_mconfig) - MCFG_DEVICE_ADD("graphics", I8031, XTAL(24'000'000)/2) + MCFG_DEVICE_ADD("graphics", I8031, 24_MHz_XTAL / 2) MCFG_DEVICE_PROGRAM_MAP(pcx_vid_map) MCFG_DEVICE_IO_MAP(pcx_vid_io) MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, pcx_video_device, p1_w)) @@ -151,20 +150,18 @@ MACHINE_CONFIG_START(pcx_video_device::device_add_mconfig) MCFG_MCS51_SERIAL_RX_CB(READ8(*this, pcx_video_device, rx_callback)) // video hardware - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_SIZE(640, 350) - MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 349) - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_UPDATE_DEVICE("crtc", scn2674_device, screen_update) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(24_MHz_XTAL, 1272, 0, 960, 381, 0, 350); + screen.set_screen_update("crtc", FUNC(scn2672_device::screen_update)); MCFG_PALETTE_ADD_MONOCHROME("palette") - scn2674_device &crtc(SCN2674(config, "crtc", 0)); - crtc.intr_callback().set_inputline("graphics", MCS51_INT0_LINE); - crtc.set_character_width(16); - crtc.set_display_callback(FUNC(pcx_video_device::display_pixels)); - crtc.set_screen("screen"); - crtc.set_addrmap(0, &pcx_video_device::pcx_vram); + SCN2672(config, m_crtc, 24_MHz_XTAL / 12); // used with SCB2673B + m_crtc->intr_callback().set_inputline("graphics", MCS51_INT0_LINE); + m_crtc->set_character_width(12); + m_crtc->set_display_callback(FUNC(pcx_video_device::display_pixels)); + m_crtc->set_screen("screen"); + m_crtc->set_addrmap(0, &pcx_video_device::pcx_vram); MACHINE_CONFIG_END @@ -212,7 +209,7 @@ SCN2674_DRAW_CHARACTER_MEMBER(pcd_video_device::display_pixels) } } -SCN2674_DRAW_CHARACTER_MEMBER(pcx_video_device::display_pixels) +SCN2672_DRAW_CHARACTER_MEMBER(pcx_video_device::display_pixels) { uint8_t data; address <<= 1; diff --git a/src/mame/video/pcd.h b/src/mame/video/pcd.h index 8d874d5cbf8..1c92a66512b 100644 --- a/src/mame/video/pcd.h +++ b/src/mame/video/pcd.h @@ -30,7 +30,6 @@ protected: required_device m_maincpu; required_device m_mcu; - required_device m_crtc; required_device m_pic2; }; @@ -52,6 +51,7 @@ protected: virtual ioport_constructor device_input_ports() const override; private: + required_device m_crtc; required_ioport m_mouse_btn; required_ioport m_mouse_x; required_ioport m_mouse_y; @@ -113,6 +113,8 @@ protected: void rcv_complete() override; private: + required_device m_crtc; + std::vector m_vram; required_region_ptr m_charrom; devcb_write_line m_txd_handler; @@ -121,7 +123,7 @@ private: DECLARE_READ8_MEMBER(rx_callback); DECLARE_WRITE8_MEMBER(tx_callback); - SCN2674_DRAW_CHARACTER_MEMBER(display_pixels); + SCN2672_DRAW_CHARACTER_MEMBER(display_pixels); }; DECLARE_DEVICE_TYPE(PCD_VIDEO, pcd_video_device) -- cgit v1.2.3