aiie/prefsstore.h

52 lines
1001 B
C
Raw Permalink Normal View History

#ifndef __PREFSSTORE_H
#define __PREFSSTORE_H
#include <stdint.h>
// Fun trivia: the Apple //e was in production from January 1983 to
// November 1993. And the 65C02 in them supported weird BCD math modes.
#define PREFSMAGIC 0x01831093
2021-01-19 23:40:13 +00:00
#define PREFSVERSION 4
2020-07-03 02:00:12 +00:00
#ifndef MAXPATH
#define MAXPATH 255
#endif
// The Teensy 3.6 has 4096 bytes of flash. We want this to stay under
// that size.
typedef struct _prefs {
uint32_t magic;
uint16_t prefsSize;
uint8_t version;
uint8_t volume;
uint8_t displayType;
2021-01-19 23:40:13 +00:00
uint8_t luminanceCutoff;
uint8_t debug;
uint8_t speed;
uint8_t invertPaddleX;
uint8_t invertPaddleY;
2020-07-03 02:00:12 +00:00
char reserved[MAXPATH]; // 255 is the Teensy MAXPATH size
2020-07-03 02:00:12 +00:00
char disk1[MAXPATH];
char disk2[MAXPATH];
char hd1[MAXPATH];
char hd2[MAXPATH];
2021-01-19 23:40:13 +00:00
uint32_t magicFooter;
} prefs_t;
class PrefsStore {
public:
PrefsStore() {};
virtual ~PrefsStore() {};
virtual bool readPrefs(prefs_t *readTo) = 0;
virtual bool writePrefs(prefs_t *newPrefs) = 0;
};
#endif