From 6cd9d17b9ecd6ca2205f8d577aa774c1a0170964 Mon Sep 17 00:00:00 2001 From: "BADIM-PC\\Vadim" Date: Fri, 1 Dec 2017 13:01:48 +0300 Subject: [PATCH] no message --- src/tic.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tic.c b/src/tic.c index fe05d38..66d2584 100644 --- a/src/tic.c +++ b/src/tic.c @@ -145,8 +145,6 @@ static void resetPalette(tic_mem* memory) static const u8 DefaultMapping[] = {16, 50, 84, 118, 152, 186, 220, 254}; memcpy(memory->ram.vram.palette.data, memory->cart.palette.data, sizeof(tic_palette)); memcpy(memory->ram.vram.mapping, DefaultMapping, sizeof DefaultMapping); - memset(&memory->ram.vram.vars, 0, sizeof memory->ram.vram.vars); - memory->ram.vram.vars.mask.data = TIC_GAMEPAD_MASK; } static inline u8 mapColor(tic_mem* tic, u8 color) @@ -469,6 +467,10 @@ static void api_clip(tic_mem* memory, s32 x, s32 y, s32 width, s32 height) static void api_reset(tic_mem* memory) { resetPalette(memory); + + memset(&memory->ram.vram.vars, 0, sizeof memory->ram.vram.vars); + memory->ram.vram.vars.mask.data = TIC_GAMEPAD_MASK; + api_clip(memory, 0, 0, TIC80_WIDTH, TIC80_HEIGHT); soundClear(memory); @@ -1214,6 +1216,8 @@ static void api_tick_start(tic_mem* memory, const tic_sound* src) else *hold = 0; } + resetPalette(memory); + machine->state.setpix = setPixelDma; machine->state.getpix = getPixelDma; }