From 52e2492a6ae6e2ff45927c0ee7f43614e9ba3666 Mon Sep 17 00:00:00 2001 From: hap Date: Sun, 31 Aug 2025 11:15:09 +0200 Subject: gime: add PAL top/bottom padding to scanline buffer --- src/devices/video/mc6847.cpp | 5 ++++- src/devices/video/mc6847.h | 1 + src/mame/trs/gime.cpp | 49 +++++++++++++++++++++----------------------- src/mame/trs/gime.h | 2 +- 4 files changed, 29 insertions(+), 28 deletions(-) diff --git a/src/devices/video/mc6847.cpp b/src/devices/video/mc6847.cpp index 7b1cdcc7ffb..0e9721b2067 100644 --- a/src/devices/video/mc6847.cpp +++ b/src/devices/video/mc6847.cpp @@ -2,7 +2,7 @@ // copyright-holders:Nathan Woods /********************************************************************* - mc6847.c + mc6847.cpp Implementation of Motorola 6847 video hardware chip @@ -102,11 +102,13 @@ #define VERBOSE (0) #include "logmacro.h" + //************************************************************************** // CONSTANTS //************************************************************************** namespace { + constexpr int LINES_TOP_BORDER = 25; constexpr int LINES_ACTIVE_VIDEO = 192; constexpr int LINES_BOTTOM_BORDER = 26; @@ -137,6 +139,7 @@ constexpr int TIMER_FSYNC_TIME = 212; // the pixel clock is the mc6847's clock * 2 constexpr int BMP_L_OR_R_BORDER = CLOCKS_L_OR_R_BORDER * 2; constexpr int BMP_ACTIVE_VIDEO = CLOCKS_ACTIVE_VIDEO * 2; + } // anonymous namespace diff --git a/src/devices/video/mc6847.h b/src/devices/video/mc6847.h index 625e95a6541..87420ee55a4 100644 --- a/src/devices/video/mc6847.h +++ b/src/devices/video/mc6847.h @@ -7,6 +7,7 @@ Implementation of Motorola 6847 video hardware chip ***************************************************************************/ + #ifndef MAME_VIDEO_MC6847_H #define MAME_VIDEO_MC6847_H diff --git a/src/mame/trs/gime.cpp b/src/mame/trs/gime.cpp index 18fc5501189..7c218644331 100644 --- a/src/mame/trs/gime.cpp +++ b/src/mame/trs/gime.cpp @@ -9,19 +9,18 @@ Mid frame raster effects (source John Kowalski) - Here are the things that get changed mid-frame: + Here are the things that get changed mid-frame: + - Palette registers ($FFB0-$FFBF) + - Horizontal resolution (switches between 256 and 320 pixels, $FF99) + - Horizontal scroll position (bits 0-6 $FF9F) + - Horizontal virtual screen (bit 7 $FF9F) + - Pixel height (bits 0-2 $FF98) + - Border color ($FF9A) - - Palette registers ($FFB0-$FFBF) - - Horizontal resolution (switches between 256 and 320 pixels, $FF99) - - Horizontal scroll position (bits 0-6 $FF9F) - - Horizontal virtual screen (bit 7 $FF9F) - - Pixel height (bits 0-2 $FF98) - - Border color ($FF9A) - - On the positive side, you don't have to worry about registers - $FF9D/$FF9E being changed mid-frame. Even if they are changed - mid-frame, they have no effect on the displayed image. The video - address only gets latched at the top of the frame. + On the positive side, you don't have to worry about registers + $FF9D/$FF9E being changed mid-frame. Even if they are changed + mid-frame, they have no effect on the displayed image. The video + address only gets latched at the top of the frame. TIMING @@ -86,12 +85,12 @@ #include "emu.h" #include "gime.h" + #include "bus/coco/cococart.h" #include "machine/ram.h" - //************************************************************************** // CONSTANTS //************************************************************************** @@ -131,7 +130,6 @@ - //************************************************************************** // DEVICE SETUP //************************************************************************** @@ -291,9 +289,9 @@ inline gime_device::pixel_t gime_device::get_composite_color(int color) inline gime_device::pixel_t gime_device::get_rgb_color(int color) { - return (((color >> 4) & 2) | ((color >> 2) & 1)) * 0x550000 - | (((color >> 3) & 2) | ((color >> 1) & 1)) * 0x005500 - | (((color >> 2) & 2) | ((color >> 0) & 1)) * 0x000055; + return (((color >> 4) & 2) | ((color >> 2) & 1)) * 0x550000 | + (((color >> 3) & 2) | ((color >> 1) & 1)) * 0x005500 | + (((color >> 2) & 2) | ((color >> 0) & 1)) * 0x000055; } @@ -657,15 +655,15 @@ uint8_t gime_device::read(offs_t offset) switch(offset & 0xF0) { case 0x00: - data = read_gime_register(offset); // $FF90 - $FF9F + data = read_gime_register(offset); // $FF90 - $FF9F break; case 0x10: - data = read_mmu_register(offset); // $FFA0 - $FFAF + data = read_mmu_register(offset); // $FFA0 - $FFAF break; case 0x20: - data = read_palette_register(offset); // $FFB0 - $FFBF + data = read_palette_register(offset); // $FFB0 - $FFBF break; default: @@ -740,8 +738,7 @@ inline uint8_t gime_device::read_palette_register(offs_t offset) // POKE&HFFB1,0:PRINTPEEK(&HFFB1) returns 64 // // This is because of the floating bus - return m_palette_rotated[m_palette_rotated_position][offset & 0x0F] - | (read_floating_bus() & 0xC0); + return m_palette_rotated[m_palette_rotated_position][offset & 0x0F] | (read_floating_bus() & 0xC0); } @@ -1220,8 +1217,8 @@ inline offs_t gime_device::get_video_base() ff9e_mask = 0xFF; } - result += ((offs_t) (m_gime_registers[0x0E] & ff9e_mask) * 0x00008) - | ((offs_t) (m_gime_registers[0x0D] & ff9d_mask) * 0x00800); + result += ((offs_t) (m_gime_registers[0x0E] & ff9e_mask) * 0x00008) | + ((offs_t) (m_gime_registers[0x0D] & ff9d_mask) * 0x00800); return result; } @@ -1317,7 +1314,7 @@ void gime_device::record_border_scanline(uint16_t physical_scanline) { m_line_in_row = 0; update_border(physical_scanline); - update_value(&m_scanlines[physical_scanline].m_line_in_row, (uint8_t) ~0); + update_value(&m_scanlines[physical_scanline].m_line_in_row, uint8_t(~0)); } @@ -1860,7 +1857,7 @@ bool gime_device::update_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect, pixel_t *RESTRICT pixels = bitmap_addr(bitmap, y, 0); /* render the scanline */ - if (m_scanlines[y].m_line_in_row == (uint8_t) ~0) + if (m_scanlines[y].m_line_in_row == uint8_t(~0)) { /* this is a border scanline */ render_scanline<0, &gime_device::emit_dummy_samples>(scanline, pixels, min_x, max_x, &resolver); diff --git a/src/mame/trs/gime.h b/src/mame/trs/gime.h index 66c50162dcf..a5a7e311b03 100644 --- a/src/mame/trs/gime.h +++ b/src/mame/trs/gime.h @@ -150,7 +150,7 @@ protected: bool m_legacy_video; uint32_t m_video_position; uint8_t m_line_in_row; - scanline_record m_scanlines[25+192+26]; + scanline_record m_scanlines[25+25+192+26+25]; bool m_displayed_rgb; // palette state -- cgit v1.2.3