From b313a4e7bfc7f791e0720f6bcb62831b740b0097 Mon Sep 17 00:00:00 2001 From: AJR Date: Sun, 28 Jan 2018 10:13:23 -0500 Subject: tms9927: Adjust vertical positioning of cursor by upscroll value (nw) tv912: Add scrolling (nw) --- src/devices/video/tms9927.cpp | 16 ++-------------- src/devices/video/tms9927.h | 6 +++--- src/mame/drivers/alphatpx.cpp | 2 +- src/mame/drivers/tv912.cpp | 4 +++- src/mame/video/intv.cpp | 2 +- 5 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/devices/video/tms9927.cpp b/src/devices/video/tms9927.cpp index 720889a3ed5..c5653c88b13 100644 --- a/src/devices/video/tms9927.cpp +++ b/src/devices/video/tms9927.cpp @@ -293,22 +293,10 @@ READ_LINE_MEMBER(tms9927_device::bl_r) } -bool tms9927_device::screen_reset() -{ - return m_reset; -} - - -int tms9927_device::upscroll_offset() -{ - return m_start_datarow; -} - - -bool tms9927_device::cursor_bounds(rectangle &bounds) +bool tms9927_device::cursor_bounds(rectangle &bounds) const { int cursorx = CURSOR_CHAR_ADDRESS; - int cursory = CURSOR_ROW_ADDRESS; + int cursory = (CURSOR_ROW_ADDRESS + DATA_ROWS_PER_FRAME - m_start_datarow) % DATA_ROWS_PER_FRAME; bounds.min_x = cursorx * m_hpixels_per_column; bounds.max_x = bounds.min_x + m_hpixels_per_column - 1; diff --git a/src/devices/video/tms9927.h b/src/devices/video/tms9927.h index 4108f015b71..c1b6ec7bce8 100644 --- a/src/devices/video/tms9927.h +++ b/src/devices/video/tms9927.h @@ -48,9 +48,9 @@ public: DECLARE_READ_LINE_MEMBER(bl_r); - bool screen_reset(); - int upscroll_offset(); - bool cursor_bounds(rectangle &bounds); + bool screen_reset() const { return m_reset; } + int upscroll_offset() const { return m_start_datarow; } + bool cursor_bounds(rectangle &bounds) const; protected: tms9927_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); diff --git a/src/mame/drivers/alphatpx.cpp b/src/mame/drivers/alphatpx.cpp index 37389da111f..440745cfc0f 100644 --- a/src/mame/drivers/alphatpx.cpp +++ b/src/mame/drivers/alphatpx.cpp @@ -432,7 +432,7 @@ uint32_t alphatpx_state::screen_update(screen_device &screen, bitmap_rgb32 &bitm { uint8_t code = m_vram[(vramy * 128) + x]; // helwie44 must be 128d is 080h physical display-ram step line // draw 12 lines of the character - bool cursoren = cursor.contains(x * 8, vramy * 12); + bool cursoren = cursor.contains(x * 8, y * 12); for (int line = 0; line < 12; line++) { uint8_t data = m_gfx[((code & 0x7f) * 16) + line]; diff --git a/src/mame/drivers/tv912.cpp b/src/mame/drivers/tv912.cpp index 0b36e40e6a9..7ae5f02895a 100644 --- a/src/mame/drivers/tv912.cpp +++ b/src/mame/drivers/tv912.cpp @@ -294,9 +294,11 @@ u32 tv912_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, cons rectangle curs; m_crtc->cursor_bounds(curs); + int scroll = m_crtc->upscroll_offset(); + for (int y = cliprect.top(); y <= cliprect.bottom(); y++) { - int row = y / 10; + int row = ((y / 10) + scroll) % 24; int ra = y % 10; int x = 0; u8 *charbase = &m_p_chargen[(ra & 7) | BIT(videoctrl, 1) << 10]; diff --git a/src/mame/video/intv.cpp b/src/mame/video/intv.cpp index cf1bf324777..32478790473 100644 --- a/src/mame/video/intv.cpp +++ b/src/mame/video/intv.cpp @@ -37,7 +37,7 @@ uint32_t intv_state::screen_update_intvkbd(screen_device &screen, bitmap_ind16 & { for(int x=0;x<40;x++) { - if ((cursor_row == current_row) && (cursor_col == x+1)) { + if ((cursor_row == y) && (cursor_col == x+1)) { /* draw the cursor as a solid white block */ m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, 191, /* a block */ -- cgit v1.2.3