Commit 0d312366 authored by Xi Wang's avatar Xi Wang Committed by Anton Khirnov

cdgraphics: fix incorrect vertical offset mask in cdg_scroll()

The vertical offset mask 0x07 is suspicious.

    v_off = FFMIN(data[2] & 0x07, CDG_BORDER_HEIGHT - 1);

Note that v_off is up to 11 (CDG_BORDER_HEIGHT - 1), the correct mask
should be 0x0F.
Signed-off-by: 's avatarXi Wang <xi.wang@gmail.com>
Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
parent b655cfef
...@@ -218,7 +218,7 @@ static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data, ...@@ -218,7 +218,7 @@ static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data,
vscmd = (data[2] & 0x30) >> 4; vscmd = (data[2] & 0x30) >> 4;
h_off = FFMIN(data[1] & 0x07, CDG_BORDER_WIDTH - 1); h_off = FFMIN(data[1] & 0x07, CDG_BORDER_WIDTH - 1);
v_off = FFMIN(data[2] & 0x07, CDG_BORDER_HEIGHT - 1); v_off = FFMIN(data[2] & 0x0F, CDG_BORDER_HEIGHT - 1);
/// find the difference and save the offset for cdg_tile_block usage /// find the difference and save the offset for cdg_tile_block usage
hinc = h_off - cc->hscroll; hinc = h_off - cc->hscroll;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment