# HG changeset patch # User Michael Pavone # Date 1644216744 28800 # Node ID 8665d8da0e1c26d1b21a77341487767f9efe82ec # Parent 36a9cf4db65f9a1a41619a6a4782ab942376fcb9 Fix infinite loop in Sega CD graphics coprocessor code diff -r 36a9cf4db65f -r 8665d8da0e1c cd_graphics.c --- a/cd_graphics.c Sun Feb 06 22:24:42 2022 -0800 +++ b/cd_graphics.c Sun Feb 06 22:52:24 2022 -0800 @@ -214,6 +214,7 @@ if ((cd->graphics_dst_x & 3) == 3 || (cd->graphics_dst_x + 1 == cd->gate_array[GA_IMAGE_BUFFER_HDOTS] + (cd->gate_array[GA_IMAGE_BUFFER_OFFSET] & 3))) { cd->graphics_step = DRAW; CHECK_ONLY; + goto draw; } else { CHECK_CYCLES; } @@ -223,6 +224,7 @@ if ((cd->graphics_dst_x & 3) == 2 || (cd->graphics_dst_x + 2 == cd->gate_array[GA_IMAGE_BUFFER_HDOTS] + (cd->gate_array[GA_IMAGE_BUFFER_OFFSET] & 3))) { cd->graphics_step = DRAW; CHECK_ONLY; + goto draw; } else { CHECK_CYCLES; } @@ -232,6 +234,7 @@ if ((cd->graphics_dst_x & 3) == 1 || (cd->graphics_dst_x + 3 == cd->gate_array[GA_IMAGE_BUFFER_HDOTS] + (cd->gate_array[GA_IMAGE_BUFFER_OFFSET] & 3))) { cd->graphics_step = DRAW; CHECK_ONLY; + goto draw; } else { CHECK_CYCLES; } @@ -239,6 +242,7 @@ cd->graphics_pixels[3] = get_src_pixel(cd); cd->graphics_cycle += 2*4; CHECK_CYCLES; +draw: case DRAW: draw_pixels(cd); cd->graphics_cycle += 1*4;