From 762dc8ea05de2af959790e8308fca02a71f1a1ad Mon Sep 17 00:00:00 2001 From: TC1995 Date: Sun, 4 Jul 2021 00:34:11 +0200 Subject: [PATCH] Fixed the difference in handling the bresenham command between the 9440 and 96xx. --- src/video/vid_tgui9440.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/video/vid_tgui9440.c b/src/video/vid_tgui9440.c index 1aa30fba6..169ac8582 100644 --- a/src/video/vid_tgui9440.c +++ b/src/video/vid_tgui9440.c @@ -1561,9 +1561,10 @@ tgui_accel_command(int count, uint32_t cpu_dat, tgui_t *tgui) while (count--) { READ(tgui->accel.src_x + (tgui->accel.src_y * tgui->accel.pitch), src_dat); + /*Note by TC1995: I suppose the x/y clipping max is always more than 0 in the TGUI 96xx, but the TGUI 9440 lacks clipping*/ if (steep) { - if (dx >= tgui->accel.left && dx <= tgui->accel.right && - dy >= tgui->accel.top && dy <= tgui->accel.bottom) { + if ((tgui->type == TGUI_9440) || (tgui->type >= TGUI_9680 && dx >= tgui->accel.left && dx <= tgui->accel.right && + dy >= tgui->accel.top && dy <= tgui->accel.bottom)) { READ(dx + (dy * tgui->accel.pitch), dst_dat); pat_dat = tgui->accel.fg_col; @@ -1578,8 +1579,8 @@ tgui_accel_command(int count, uint32_t cpu_dat, tgui_t *tgui) WRITE(dx + (dy * tgui->accel.pitch), out); } } else { - if (dy >= tgui->accel.left && dy <= tgui->accel.right && - dx >= tgui->accel.top && dx <= tgui->accel.bottom) { + if ((tgui->type == TGUI_9440) || (tgui->type >= TGUI_9680 && dy >= tgui->accel.left && dy <= tgui->accel.right && + dx >= tgui->accel.top && dx <= tgui->accel.bottom)) { READ(dy + (dx * tgui->accel.pitch), dst_dat); pat_dat = tgui->accel.fg_col;