--- hatari/src/falcon/nvram.c 2019/04/01 07:14:55 1.1.1.2 +++ hatari/src/falcon/nvram.c 2019/04/09 08:47:22 1.1.1.4 @@ -27,7 +27,7 @@ All other cells are reserved / unused. */ -const char NvRam_rcsid[] = "Hatari $Id: nvram.c,v 1.1.1.2 2019/04/01 07:14:55 root Exp $"; +const char NvRam_fileid[] = "Hatari nvram.c : " __DATE__ " " __TIME__; #include "main.h" #include "configuration.h" @@ -35,16 +35,15 @@ const char NvRam_rcsid[] = "Hatari $Id: #include "log.h" #include "nvram.h" #include "paths.h" -#include "araglue.h" #define DEBUG 0 - #if DEBUG -#define D(x) x +#define Dprintf(a) printf a #else -#define D(x) +#define Dprintf(a) #endif + // Defs for checksum #define CKS_RANGE_START 14 #define CKS_RANGE_END (14+47) @@ -80,7 +79,7 @@ void NvRam_Reset(void) */ static bool NvRam_Load(void) { - bool ret = FALSE; + bool ret = false; FILE *f = fopen(nvram_filename, "rb"); if (f != NULL) { @@ -88,7 +87,7 @@ static bool NvRam_Load(void) if (fread(fnvram, 1, NVRAM_LEN, f) == NVRAM_LEN) { memcpy(nvram+NVRAM_START, fnvram, NVRAM_LEN); - ret = TRUE; + ret = true; } fclose(f); Log_Printf(LOG_DEBUG, "NVRAM loaded from '%s'\n", nvram_filename); @@ -108,13 +107,13 @@ static bool NvRam_Load(void) */ static bool NvRam_Save(void) { - bool ret = FALSE; + bool ret = false; FILE *f = fopen(nvram_filename, "wb"); if (f != NULL) { if (fwrite(nvram+NVRAM_START, 1, NVRAM_LEN, f) == NVRAM_LEN) { - ret = TRUE; + ret = true; } fclose(f); } @@ -259,7 +258,7 @@ void NvRam_Data_ReadByte(void) { value = nvram[nvram_index]; } - D(bug("Reading NVRAM data at %d = %d ($%02x)", nvram_index, value, value)); + Dprintf(("Reading NVRAM data at %d = %d ($%02x)\n", nvram_index, value, value)); IoMem_WriteByte(0xff8963, value); } @@ -273,7 +272,6 @@ void NvRam_Data_ReadByte(void) void NvRam_Data_WriteByte(void) { Uint8 value = IoMem_ReadByte(0xff8963); - D(bug("Writing NVRAM data at %d = %d ($%02x)", nvram_index, value, value)); + Dprintf(("Writing NVRAM data at %d = %d ($%02x)\n", nvram_index, value, value)); nvram[nvram_index] = value; } -