From abd3665c541a710e4f899983b7901428bc06a187 Mon Sep 17 00:00:00 2001 From: "BADIM-PC\\Vadim" Date: Sun, 24 Dec 2017 12:23:19 +0300 Subject: [PATCH] no message --- src/tic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tic.c b/src/tic.c index 6450a35..0265915 100644 --- a/src/tic.c +++ b/src/tic.c @@ -1389,7 +1389,7 @@ static void api_sync(tic_mem* tic, u32 mask, s32 bank, bool toCart) {offsetof(tic_bank, music), offsetof(tic_ram, music), sizeof(tic_music) }, }; - enum{Count = COUNT_OF(Sections), Mask = (1 << (Count+1)) - 1}; + enum{Count = COUNT_OF(Sections), Mask = (1 << (Count+1)) - 1, PaletteMask = 1 << Count}; if(mask == 0) mask = Mask; @@ -1405,7 +1405,7 @@ static void api_sync(tic_mem* tic, u32 mask, s32 bank, bool toCart) : memcpy((u8*)&tic->ram + Sections[i].ram, (u8*)&tic->cart.banks[bank] + Sections[i].bank, Sections[i].size); } - if(mask & (1 << Count)) + if(mask & PaletteMask) toCart ? memcpy(&tic->cart.palette, &tic->ram.vram.palette, sizeof(tic_palette)) : memcpy(&tic->ram.vram.palette, &tic->cart.palette, sizeof(tic_palette));