X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=config.c;h=523e8e445d8c2b266ab2bae5c2ab6524cbb9ed4e;hb=3c6f5f8802dd300a48d390a7d08dad779565bf45;hp=5a70352e2925b5903c39bc278b36013cee786878;hpb=261178ecf52fe08844cd1b7e44cd675510767d16;p=c128-kasse diff --git a/config.c b/config.c index 5a70352..523e8e4 100644 --- a/config.c +++ b/config.c @@ -8,6 +8,9 @@ #include "general.h" #include "config.h" +/* undocumented function which scratches files */ +unsigned char __fastcall__ _sysremove(const char *name); + unsigned long int money = 0; unsigned long int items_sold = 0; BYTE printer_port = 4; @@ -49,11 +52,15 @@ void load_credits() { } void save_items() { + if (files_existing) + _sysremove("items"); cbm_save("items", (BYTE)8, &status, sizeof(struct status_array_t)); files_existing = true; } void save_credits() { + if (files_existing) + _sysremove("credits"); cbm_save("credits", (BYTE)8, &credits, sizeof(struct credits_array_t)); files_existing = true; }