From 9c43614612dc3a4992e9547e9d732bd68dc31037 Mon Sep 17 00:00:00 2001 From: "BADIM-PC\\Vadim" Date: Wed, 20 Dec 2017 15:16:42 +0300 Subject: [PATCH] reset bank indexes when cart is changed --- src/studio.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/studio.c b/src/studio.c index fd769ed..87fd6b7 100644 --- a/src/studio.c +++ b/src/studio.c @@ -1067,10 +1067,17 @@ void showDialog(const char** text, s32 rows, DialogCallback callback, void* data } } +static void resetBanks() +{ + SDL_memset(studio.bank.indexes, 0, sizeof studio.bank.indexes); +} + static void initModules() { tic_mem* tic = studio.tic; + resetBanks(); + for(s32 i = 0; i < TIC_EDITOR_BANKS; i++) { initCode(studio.editor[i].code, studio.tic, &tic->cart.banks[i].code);