s3c44b0, tms3556: Add device_video_interface and remove first_screen (nw)

This commit is contained in:
AJR 2018-03-08 13:45:38 -05:00
parent 92fd78aadf
commit 9e48b81b45
4 changed files with 7 additions and 8 deletions

View File

@ -224,6 +224,7 @@ DEFINE_DEVICE_TYPE(S3C44B0, s3c44b0_device, "s3c44b0", "Samsung S3C44B0 SoC")
s3c44b0_device::s3c44b0_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, S3C44B0, tag, owner, clock)
, device_video_interface(mconfig, *this)
, m_cpu(nullptr)
, m_port_r_cb(*this)
, m_port_w_cb(*this)
@ -747,7 +748,6 @@ READ32_MEMBER( s3c44b0_device::lcd_r )
void s3c44b0_device::lcd_configure()
{
screen_device *screen = machine().first_screen();
int dismode, clkval, lineval, wdly, hozval, lineblank, wlh, mclk;
double vclk, framerate;
int width, height;
@ -776,7 +776,7 @@ void s3c44b0_device::lcd_configure()
height = lineval + 1;
m_lcd.framerate = framerate;
verboselog( *this, 3, "video_screen_configure %d %d %f\n", width, height, m_lcd.framerate);
screen->configure(screen->width(), screen->height(), screen->visible_area(), HZ_TO_ATTOSECONDS(m_lcd.framerate));
screen().configure(screen().width(), screen().height(), screen().visible_area(), HZ_TO_ATTOSECONDS(m_lcd.framerate));
m_lcd.hpos_min = 25;
m_lcd.hpos_max = 25 + width - 1;
m_lcd.hpos_end = 25 + width - 1 + 25;
@ -800,13 +800,12 @@ void s3c44b0_device::lcd_configure()
void s3c44b0_device::lcd_start()
{
screen_device *screen = machine().first_screen();
verboselog( *this, 1, "LCD start\n");
lcd_configure();
lcd_dma_init();
m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
m_lcd.frame_time = screen->time_until_pos( 0, 0);
m_lcd.frame_time = screen().time_until_pos( 0, 0);
m_lcd.timer->adjust(m_lcd.frame_time, 0);
m_lcd.frame_time = machine().time() + m_lcd.frame_time;
}

View File

@ -111,7 +111,7 @@ enum
};
class s3c44b0_device : public device_t
class s3c44b0_device : public device_t, public device_video_interface
{
public:
s3c44b0_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

View File

@ -109,6 +109,7 @@ inline void tms3556_device::writebyte(offs_t address, uint8_t data)
tms3556_device::tms3556_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, TMS3556, tag, owner, clock),
device_memory_interface(mconfig, *this),
device_video_interface(mconfig, *this),
m_space_config("videoram", ENDIANNESS_LITTLE, 8, 17, 0, address_map_constructor(), address_map_constructor(FUNC(tms3556_device::tms3556), this)),
m_reg(0), m_reg2(0),
m_reg_access_phase(0),
@ -159,7 +160,7 @@ void tms3556_device::device_start()
save_item(NAME(m_char_line_counter));
save_item(NAME(m_dbl_h_phase));
machine().first_screen()->register_screen_bitmap(m_bitmap);
screen().register_screen_bitmap(m_bitmap);
}

View File

@ -33,8 +33,7 @@
// ======================> tms3556_device
class tms3556_device : public device_t,
public device_memory_interface
class tms3556_device : public device_t, public device_memory_interface, public device_video_interface
{
public:
static constexpr unsigned TOP_BORDER = 1;