From 07b00bec6155d13f32583a366cb1df1e5889f175 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Thu, 24 Dec 2020 06:48:15 +0100 Subject: [PATCH] fix problems with color cycling in iff viewer --- examples/cx16/imageviewer/iff_module.p8 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/examples/cx16/imageviewer/iff_module.p8 b/examples/cx16/imageviewer/iff_module.p8 index ba0dc3944..f7ce8cd23 100644 --- a/examples/cx16/imageviewer/iff_module.p8 +++ b/examples/cx16/imageviewer/iff_module.p8 @@ -69,12 +69,15 @@ iff_module { if not cycle_ccrt { cycle_crng = true diskio.f_read_exact(buffer, chunk_size_lo) - cycle_rates[num_cycles] = mkword(buffer[2], buffer[3]) - cycle_rate_ticks[num_cycles] = 1 - cycle_lows[num_cycles] = buffer[6] - cycle_highs[num_cycles] = buffer[7] - cycle_reverseflags[num_cycles] = (buffer[5] & 2)!=0 - num_cycles++ + ubyte flags = buffer[5] + if flags & 1 { + cycle_rates[num_cycles] = mkword(buffer[2], buffer[3]) + cycle_rate_ticks[num_cycles] = 1 + cycle_lows[num_cycles] = buffer[6] + cycle_highs[num_cycles] = buffer[7] + cycle_reverseflags[num_cycles] = flags & 2 != 0 + num_cycles++ + } } else skip_chunk() }