giga-refactor, part 1

work on loading - NOT WORKING
This commit is contained in:
tildearrow 2025-11-16 05:42:47 -05:00
parent dc0eda0445
commit 94044ef210
3 changed files with 868 additions and 596 deletions

View file

@ -20,6 +20,7 @@
#include "engine.h"
#include "../ta-log.h"
#include <inttypes.h>
#include <string.h>
#include <chrono>
static DivCompatFlags defaultFlags;
@ -952,6 +953,23 @@ bool DivCompatFlags::areDefaults() {
return (*this==defaultFlags);
}
bool DivCompatFlags::readData(SafeReader& reader) {
DivConfig c;
unsigned char magic[4];
reader.read(magic,4);
if (memcmp(magic,"CFLG",4)!=0) {
return false;
}
reader.readI();
String data=reader.readString();
c.loadFromMemory(data.c_str());
// TODO: this
return true;
}
#define CHECK_AND_STORE_BOOL(_x) \
if (_x!=defaultFlags._x) { \
c.set(#_x,_x); \