for(DEVICE* device = first_device; device; device = device->next_device) {
device->initialize();
}
+ decl_state();
rtc->write_signal(SIG_UPD1990A_STB, 0, 0);
}
#define STATE_VERSION 3
+#include "../../statesub.h"
+
+void VM::decl_state(void)
+{
+#if defined(_PC8201)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PC_8201_HEAD")));
+#elif defined(_PC8201A)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PC_8201A_HEAD")));
+#else
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PC_8201_SERIES_HEAD")));
+#endif
+
+ for(DEVICE* device = first_device; device; device = device->next_device) {
+ device->decl_state();
+ }
+}
+
void VM::save_state(FILEIO* state_fio)
{
- state_fio->FputUint32(STATE_VERSION);
+ //state_fio->FputUint32(STATE_VERSION);
+ if(state_entry != NULL) {
+ state_entry->save_state(state_fio);
+ }
for(DEVICE* device = first_device; device; device = device->next_device) {
device->save_state(state_fio);
}
bool VM::load_state(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
+ //if(state_fio->FgetUint32() != STATE_VERSION) {
+ // return false;
+ //}
+ bool mb = false;
+ if(state_entry != NULL) {
+ mb = state_entry->load_state(state_fio);
+ }
+ if(!mb) {
+ emu->out_debug_log("INFO: HEADER DATA ERROR");
return false;
}
for(DEVICE* device = first_device; device; device = device->next_device) {
};
#endif
+class csp_state_utils;
+
class EMU;
class DEVICE;
class EVENT;
{
protected:
EMU* emu;
+ csp_state_utils *state_entry;
// devices
EVENT* event;
bool is_frame_skippable();
void update_config();
+ void decl_state();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
void VM::decl_state(void)
{
- state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PC98_SERIES_HEAD")));
+#if defined(_PC9801)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PC9801_HEAD")));
+#elif defined(_PC9801E)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PC9801E_HEAD")));
+#elif defined(_PC9801U)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PC9801U_HEAD")));
+#elif defined(_PC9801VF)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PC9801VF_HEAD")));
+#elif defined(_PC9801VM)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PC9801VF_HEAD")));
+#elif defined(_PC98DO)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PC98DO_HEAD")));
+#elif defined(_PC9801DOPLUS)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PC98DO_PLUS_HEAD")));
+#elif defined(_PC9801VX)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PC9801VX_HEAD")));
+#elif defined(_PC98XL)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PC98XL_HEAD")));
+#elif defined(_PC98XA)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PC98XA_HEAD")));
+#elif defined(_PC9801RA)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PC9801RA_HEAD")));
+#elif defined(_PC98RL)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PC98RL_HEAD")));
+#else
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PC9801_SERIES_HEAD")));
+#endif
+
DECL_STATE_ENTRY_BOOL(pit_clock_8mhz);
#if defined(_PC98DO) || defined(_PC98DOPLUS)
DECL_STATE_ENTRY_INT32(boot_mode);
DECL_STATE_ENTRY_INT32(sound_type);
#if defined(USE_HARD_DISK) && defined(OPEN_HARD_DISK_IN_RESET)
DECL_STATE_ENTRY_MULTI(void, hd_file_path, sizeof(hd_file_path));
-
#endif
for(DEVICE* device = first_device; device; device = device->next_device) {
device->decl_state();
#endif
class csp_state_utils;
+
class EMU;
class DEVICE;
class EVENT;
for(DEVICE* device = first_device; device; device = device->next_device) {
device->initialize();
}
+ decl_state();
}
VM::~VM()
#define STATE_VERSION 6
+#include "../../statesub.h"
+
+void VM::decl_state(void)
+{
+#if defined(_PC98HA)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PC_98HA_HEAD")));
+#elif defined(_PC98LT)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PC_98LT_HEAD")));
+#else
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PC_98LT_SERIES_HEAD")));
+#endif
+
+ for(DEVICE* device = first_device; device; device = device->next_device) {
+ device->decl_state();
+ }
+}
+
void VM::save_state(FILEIO* state_fio)
{
- state_fio->FputUint32(STATE_VERSION);
+ //state_fio->FputUint32(STATE_VERSION);
+ if(state_entry != NULL) {
+ state_entry->save_state(state_fio);
+ }
for(DEVICE* device = first_device; device; device = device->next_device) {
device->save_state(state_fio);
}
bool VM::load_state(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
+ //if(state_fio->FgetUint32() != STATE_VERSION) {
+ // return false;
+ //}
+ bool mb = false;
+ if(state_entry != NULL) {
+ mb = state_entry->load_state(state_fio);
+ }
+ if(!mb) {
+ emu->out_debug_log("INFO: HEADER DATA ERROR");
return false;
}
for(DEVICE* device = first_device; device; device = device->next_device) {
};
#endif
+class csp_state_utils;
+
class EMU;
class DEVICE;
class EVENT;
{
protected:
EMU* emu;
+ csp_state_utils *state_entry;
// devices
EVENT* event;
bool is_frame_skippable();
void update_config();
+ void decl_state();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
for(DEVICE* device = first_device; device; device = device->next_device) {
device->initialize();
}
+ decl_state();
}
VM::~VM()
#define STATE_VERSION 3
+#include "../../statesub.h"
+
+void VM::decl_state(void)
+{
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PHC_20_HEAD")));
+
+ for(DEVICE* device = first_device; device; device = device->next_device) {
+ device->decl_state();
+ }
+}
+
void VM::save_state(FILEIO* state_fio)
{
- state_fio->FputUint32(STATE_VERSION);
+ //state_fio->FputUint32(STATE_VERSION);
+ if(state_entry != NULL) {
+ state_entry->save_state(state_fio);
+ }
for(DEVICE* device = first_device; device; device = device->next_device) {
device->save_state(state_fio);
}
bool VM::load_state(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
+ //if(state_fio->FgetUint32() != STATE_VERSION) {
+ // return false;
+ //}
+
+ bool mb = false;
+ if(state_entry != NULL) {
+ mb = state_entry->load_state(state_fio);
+ }
+ if(!mb) {
+ emu->out_debug_log("INFO: HEADER DATA ERROR");
return false;
}
for(DEVICE* device = first_device; device; device = device->next_device) {
};
#endif
+class csp_state_utils;
+
class EMU;
class DEVICE;
class EVENT;
{
protected:
EMU* emu;
+ csp_state_utils* state_entry;
// devices
EVENT* event;
bool is_frame_skippable();
void update_config();
+ void decl_state();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
for(DEVICE* device = first_device; device; device = device->next_device) {
device->initialize();
}
+ decl_state();
}
VM::~VM()
#define STATE_VERSION 4
-void VM::save_state(FILEIO* state_fio)
+#include "../../statesub.h"
+
+void VM::decl_state(void)
{
- state_fio->FputUint32(STATE_VERSION);
+#if defined(_PHC25)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PHC_25_HEAD")));
+#elif defined(_MAP1010)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::MAP_1010_HEAD")));
+#else
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PHC_25_SERIES_HEAD")));
+#endif
for(DEVICE* device = first_device; device; device = device->next_device) {
+ device->decl_state();
+ }
+}
+
+void VM::save_state(FILEIO* state_fio)
+{
+ //state_fio->FputUint32(STATE_VERSION);
+ if(state_entry != NULL) {
+ state_entry->save_state(state_fio);
+ }
+ for(DEVICE* device = first_device; device; device = device->next_device) {
device->save_state(state_fio);
}
}
bool VM::load_state(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
+ //if(state_fio->FgetUint32() != STATE_VERSION) {
+ // return false;
+ //}
+ bool mb = false;
+ if(state_entry != NULL) {
+ mb = state_entry->load_state(state_fio);
+ }
+ if(!mb) {
+ emu->out_debug_log("INFO: HEADER DATA ERROR");
return false;
}
+
for(DEVICE* device = first_device; device; device = device->next_device) {
if(!device->load_state(state_fio)) {
return false;
};
#endif
+class csp_state_utils;
+
class EMU;
class DEVICE;
class EVENT;
{
protected:
EMU* emu;
+ csp_state_utils* state_entry;
// devices
EVENT* event;
bool is_frame_skippable();
void update_config();
+ void decl_state();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
for(DEVICE* device = first_device; device; device = device->next_device) {
device->initialize();
}
+ decl_state();
inserted = false;
}
#define STATE_VERSION 2
+#include "../../statesub.h"
+
+void VM::decl_state(void)
+{
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PV_1000_HEAD")));
+
+ DECL_STATE_ENTRY_1DARRAY(mem, sizeof(mem));
+ DECL_STATE_ENTRY_BOOL(inserted);
+ for(DEVICE* device = first_device; device; device = device->next_device) {
+ device->decl_state();
+ }
+}
+
void VM::save_state(FILEIO* state_fio)
{
- state_fio->FputUint32(STATE_VERSION);
+ //state_fio->FputUint32(STATE_VERSION);
+ if(state_entry != NULL) {
+ state_entry->save_state(state_fio);
+ }
for(DEVICE* device = first_device; device; device = device->next_device) {
device->save_state(state_fio);
}
- state_fio->Fwrite(mem, sizeof(mem), 1);
- state_fio->FputBool(inserted);
+ //state_fio->Fwrite(mem, sizeof(mem), 1);
+ //state_fio->FputBool(inserted);
}
bool VM::load_state(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
+ //if(state_fio->FgetUint32() != STATE_VERSION) {
+ // return false;
+ //}
+ bool mb = false;
+ if(state_entry != NULL) {
+ mb = state_entry->load_state(state_fio);
+ }
+ if(!mb) {
+ emu->out_debug_log("INFO: HEADER DATA ERROR");
return false;
}
for(DEVICE* device = first_device; device; device = device->next_device) {
return false;
}
}
- state_fio->Fread(mem, sizeof(mem), 1);
- inserted = state_fio->FgetBool();
+ //state_fio->Fread(mem, sizeof(mem), 1);
+ //inserted = state_fio->FgetBool();
return true;
}
};
#endif
+class csp_state_utils;
+
class EMU;
class DEVICE;
class EVENT;
{
protected:
EMU* emu;
+ csp_state_utils* state_entry;
// devices
EVENT* event;
bool is_frame_skippable();
void update_config();
+ void decl_state();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
for(DEVICE* device = first_device; device; device = device->next_device) {
device->initialize();
}
+ decl_state();
inserted = false;
}
#define STATE_VERSION 2
+#include "../../statesub.h"
+
+void VM::decl_state(void)
+{
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PV_2000_HEAD")));
+
+ DECL_STATE_ENTRY_1DARRAY(ram, sizeof(ram));
+ DECL_STATE_ENTRY_1DARRAY(ext, sizeof(ext));
+ DECL_STATE_ENTRY_BOOL(inserted);
+ for(DEVICE* device = first_device; device; device = device->next_device) {
+ device->decl_state();
+ }
+}
+
void VM::save_state(FILEIO* state_fio)
{
- state_fio->FputUint32(STATE_VERSION);
+ //state_fio->FputUint32(STATE_VERSION);
+ if(state_entry != NULL) {
+ state_entry->save_state(state_fio);
+ }
for(DEVICE* device = first_device; device; device = device->next_device) {
device->save_state(state_fio);
}
- state_fio->Fwrite(ram, sizeof(ram), 1);
- state_fio->Fwrite(ext, sizeof(ext), 1);
- state_fio->FputBool(inserted);
+ //state_fio->Fwrite(ram, sizeof(ram), 1);
+ //state_fio->Fwrite(ext, sizeof(ext), 1);
+ //state_fio->FputBool(inserted);
}
bool VM::load_state(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
+ //if(state_fio->FgetUint32() != STATE_VERSION) {
+ // return false;
+ //}
+ bool mb = false;
+ if(state_entry != NULL) {
+ mb = state_entry->load_state(state_fio);
+ }
+ if(!mb) {
+ emu->out_debug_log("INFO: HEADER DATA ERROR");
return false;
}
for(DEVICE* device = first_device; device; device = device->next_device) {
return false;
}
}
- state_fio->Fread(ram, sizeof(ram), 1);
- state_fio->Fread(ext, sizeof(ext), 1);
- inserted = state_fio->FgetBool();
+ //state_fio->Fread(ram, sizeof(ram), 1);
+ //state_fio->Fread(ext, sizeof(ext), 1);
+ //inserted = state_fio->FgetBool();
return true;
}
};
#endif
+class csp_state_utils;
+
class EMU;
class DEVICE;
class EVENT;
{
protected:
EMU* emu;
+ csp_state_utils* state_entry;
// devices
EVENT* event;
bool is_frame_skippable();
void update_config();
+ void decl_state();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
for(DEVICE* device = first_device; device; device = device->next_device) {
device->initialize();
}
+ decl_state();
}
VM::~VM()
#define STATE_VERSION 4
+#include "../../statesub.h"
+
+void VM::decl_state(void)
+{
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::PYUTA_HEAD")));
+
+ for(DEVICE* device = first_device; device; device = device->next_device) {
+ device->decl_state();
+ }
+}
+
void VM::save_state(FILEIO* state_fio)
{
- state_fio->FputUint32(STATE_VERSION);
+ //state_fio->FputUint32(STATE_VERSION);
+ if(state_entry != NULL) {
+ state_entry->save_state(state_fio);
+ }
for(DEVICE* device = first_device; device; device = device->next_device) {
device->save_state(state_fio);
}
bool VM::load_state(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
+ //if(state_fio->FgetUint32() != STATE_VERSION) {
+ // return false;
+ //}
+
+ bool mb = false;
+ if(state_entry != NULL) {
+ mb = state_entry->load_state(state_fio);
+ }
+ if(!mb) {
+ emu->out_debug_log("INFO: HEADER DATA ERROR");
return false;
}
for(DEVICE* device = first_device; device; device = device->next_device) {
};
#endif
+class csp_state_utils;
+
class EMU;
class DEVICE;
class EVENT;
{
protected:
EMU* emu;
+ csp_state_utils* state_entry;
// devices
EVENT* event;
bool is_frame_skippable();
void update_config();
+ void decl_state();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
for(DEVICE* device = first_device; device; device = device->next_device) {
device->initialize();
}
+ decl_state();
//pcm->set_realtime_render(true);
for(int i = 0; i < 4; i++) {
fdc->set_drive_type(i, DRIVE_TYPE_2D);
#define STATE_VERSION 3
+#include "../../statesub.h"
+
+void VM::decl_state(void)
+{
+#ifdef _COLOR_MONITOR
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::QC_10_WITH_COLOR_MONITOR_HEAD")));
+#else
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::QC_10_HEAD")));
+#endif
+ for(DEVICE* device = first_device; device; device = device->next_device) {
+ device->decl_state();
+ }
+}
+
void VM::save_state(FILEIO* state_fio)
{
- state_fio->FputUint32(STATE_VERSION);
+ //state_fio->FputUint32(STATE_VERSION);
+ if(state_entry != NULL) {
+ state_entry->save_state(state_fio);
+ }
for(DEVICE* device = first_device; device; device = device->next_device) {
device->save_state(state_fio);
}
bool VM::load_state(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
+ //if(state_fio->FgetUint32() != STATE_VERSION) {
+ // return false;
+ //}
+ bool mb = false;
+ if(state_entry != NULL) {
+ mb = state_entry->load_state(state_fio);
+ }
+ if(!mb) {
+ emu->out_debug_log("INFO: HEADER DATA ERROR");
return false;
}
for(DEVICE* device = first_device; device; device = device->next_device) {
};
#endif
+class csp_state_utils;
+
class EMU;
class DEVICE;
class EVENT;
{
protected:
EMU* emu;
+ csp_state_utils* state_entry;
// devices
EVENT* event;
bool is_frame_skippable();
void update_config();
+ void decl_state();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
for(DEVICE* device = first_device; device; device = device->next_device) {
device->initialize();
}
+ decl_state();
}
VM::~VM()
#define STATE_VERSION 3
+#include "../../statesub.h"
+
+void VM::decl_state(void)
+{
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::RX_78_HEAD")));
+ for(DEVICE* device = first_device; device; device = device->next_device) {
+ device->decl_state();
+ }
+}
+
void VM::save_state(FILEIO* state_fio)
{
- state_fio->FputUint32(STATE_VERSION);
+ //state_fio->FputUint32(STATE_VERSION);
+ if(state_entry != NULL) {
+ state_entry->save_state(state_fio);
+ }
for(DEVICE* device = first_device; device; device = device->next_device) {
device->save_state(state_fio);
}
bool VM::load_state(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
+ //if(state_fio->FgetUint32() != STATE_VERSION) {
+ // return false;
+ //}
+ bool mb = false;
+ if(state_entry != NULL) {
+ mb = state_entry->load_state(state_fio);
+ }
+ if(!mb) {
+ emu->out_debug_log("INFO: HEADER DATA ERROR");
return false;
}
for(DEVICE* device = first_device; device; device = device->next_device) {
};
#endif
+class csp_state_utils;
+
class EMU;
class DEVICE;
class EVENT;
{
protected:
EMU* emu;
+ csp_state_utils* state_entry;
// devices
EVENT* event;
bool is_frame_skippable();
void update_config();
+ void decl_state();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
#define STATE_VERSION 3
+#include "../../statesub.h"
+
+void VM::decl_state(void)
+{
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::SC_3000_HEAD")));
+ for(DEVICE* device = first_device; device; device = device->next_device) {
+ device->decl_state();
+ }
+}
+
void VM::save_state(FILEIO* state_fio)
{
- state_fio->FputUint32(STATE_VERSION);
+ //state_fio->FputUint32(STATE_VERSION);
+ if(state_entry != NULL) {
+ state_entry->save_state(state_fio);
+ }
for(DEVICE* device = first_device; device; device = device->next_device) {
device->save_state(state_fio);
}
bool VM::load_state(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
+ //if(state_fio->FgetUint32() != STATE_VERSION) {
+ // return false;
+ //}
+ bool mb = false;
+ if(state_entry != NULL) {
+ mb = state_entry->load_state(state_fio);
+ }
+ if(!mb) {
+ emu->out_debug_log("INFO: HEADER DATA ERROR");
return false;
}
for(DEVICE* device = first_device; device; device = device->next_device) {
};
#endif
+class csp_state_utils;
+
class EMU;
class DEVICE;
class EVENT;
{
protected:
EMU* emu;
+ csp_state_utils* state_entry;
// devices
EVENT* event;
bool is_frame_skippable();
void update_config();
+ void decl_state();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
for(DEVICE* device = first_device; device; device = device->next_device) {
device->initialize();
}
+ decl_state();
}
VM::~VM()
#define STATE_VERSION 2
+#include "../../statesub.h"
+
+void VM::decl_state(void)
+{
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::SCV_HEAD")));
+ for(DEVICE* device = first_device; device; device = device->next_device) {
+ device->decl_state();
+ }
+}
+
void VM::save_state(FILEIO* state_fio)
{
- state_fio->FputUint32(STATE_VERSION);
+ //state_fio->FputUint32(STATE_VERSION);
+ if(state_entry != NULL) {
+ state_entry->save_state(state_fio);
+ }
for(DEVICE* device = first_device; device; device = device->next_device) {
device->save_state(state_fio);
}
bool VM::load_state(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
+ //if(state_fio->FgetUint32() != STATE_VERSION) {
+ // return false;
+ //}
+ bool mb = false;
+ if(state_entry != NULL) {
+ mb = state_entry->load_state(state_fio);
+ }
+ if(!mb) {
+ emu->out_debug_log("INFO: HEADER DATA ERROR");
return false;
}
for(DEVICE* device = first_device; device; device = device->next_device) {
};
#endif
+class csp_state_utils;
+
class EMU;
class DEVICE;
class EVENT;
{
protected:
EMU* emu;
+ csp_state_utils* state_entry;
// devices
EVENT* event;
bool is_frame_skippable();
void update_config();
+ void decl_state();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
for(DEVICE* device = first_device; device; device = device->next_device) {
device->initialize();
}
+ decl_state();
}
VM::~VM()
#define STATE_VERSION 3
+#include "../../statesub.h"
+
+void VM::decl_state(void)
+{
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::SM_B_80TE_HEAD")));
+ for(DEVICE* device = first_device; device; device = device->next_device) {
+ device->decl_state();
+ }
+}
+
void VM::save_state(FILEIO* state_fio)
{
- state_fio->FputUint32(STATE_VERSION);
+ //state_fio->FputUint32(STATE_VERSION);
+ if(state_entry != NULL) {
+ state_entry->save_state(state_fio);
+ }
for(DEVICE* device = first_device; device; device = device->next_device) {
device->save_state(state_fio);
}
bool VM::load_state(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
+ //if(state_fio->FgetUint32() != STATE_VERSION) {
+ // return false;
+ //}
+ bool mb = false;
+ if(state_entry != NULL) {
+ mb = state_entry->load_state(state_fio);
+ }
+ if(!mb) {
+ emu->out_debug_log("INFO: HEADER DATA ERROR");
return false;
}
for(DEVICE* device = first_device; device; device = device->next_device) {
{446 + 32 * 0, 110, LED_WIDTH, LED_HEIGHT},
};
+class csp_state_utils;
+
class EMU;
class DEVICE;
class EVENT;
{
protected:
EMU* emu;
+ csp_state_utils* state_entry;
// devices
EVENT* event;
bool is_frame_skippable();
void update_config();
+ void decl_state();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
for(DEVICE* device = first_device; device; device = device->next_device) {
device->initialize();
}
+ decl_state();
for(int i = 0; i < MAX_DRIVE; i++) {
fdc->set_drive_type(i, DRIVE_TYPE_2DD); // 1DD
fdc->set_drive_rpm(i, 600);
#define STATE_VERSION 4
+#include "../../statesub.h"
+
+void VM::decl_state(void)
+{
+#if defined(_SMC70)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::SMC_70_HEAD")));
+#elif defined(_SMC777)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::SMC_777_HEAD")));
+#else
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::SMC_70_SERIES_HEAD")));
+#endif
+ for(DEVICE* device = first_device; device; device = device->next_device) {
+ device->decl_state();
+ }
+}
+
void VM::save_state(FILEIO* state_fio)
{
- state_fio->FputUint32(STATE_VERSION);
+ //state_fio->FputUint32(STATE_VERSION);
+ if(state_entry != NULL) {
+ state_entry->save_state(state_fio);
+ }
for(DEVICE* device = first_device; device; device = device->next_device) {
device->save_state(state_fio);
}
bool VM::load_state(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
+ //if(state_fio->FgetUint32() != STATE_VERSION) {
+ // return false;
+ //}
+ bool mb = false;
+ if(state_entry != NULL) {
+ mb = state_entry->load_state(state_fio);
+ }
+ if(!mb) {
+ emu->out_debug_log("INFO: HEADER DATA ERROR");
return false;
}
for(DEVICE* device = first_device; device; device = device->next_device) {
};
#endif
+class csp_state_utils;
+
class EMU;
class DEVICE;
class EVENT;
{
protected:
EMU* emu;
+ csp_state_utils* state_entry;
// devices
EVENT* event;
bool is_frame_skippable();
void update_config();
+ void decl_state();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
for(DEVICE* device = first_device; device; device = device->next_device) {
device->initialize();
}
+ decl_state();
}
VM::~VM()
#define STATE_VERSION 6
+#include "../../statesub.h"
+
+void VM::decl_state(void)
+{
+#if defined(_TK80)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::TK_80_HEAD")));
+#elif defined(_TK85)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::TK_85_HEAD")));
+#elif defined(_TK80BS)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::TK_80BS_HEAD")));
+#else
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::TK_80_SERIES_HEAD")));
+#endif
+ DECL_STATE_ENTRY_1DARRAY(ram, sizeof(ram));
+#if defined(_TK80BS)
+ DECL_STATE_ENTRY_1DARRAY(vram, sizeof(vram));
+ DECL_STATE_ENTRY_INT32(boot_mode);
+ //DECL_STATE_ENTRY_INT32(draw_ranges);
+#endif
+ for(DEVICE* device = first_device; device; device = device->next_device) {
+ device->decl_state();
+ }
+}
+
void VM::save_state(FILEIO* state_fio)
{
- state_fio->FputUint32(STATE_VERSION);
+ //state_fio->FputUint32(STATE_VERSION);
+ if(state_entry != NULL) {
+ state_entry->save_state(state_fio);
+ }
for(DEVICE* device = first_device; device; device = device->next_device) {
device->save_state(state_fio);
}
- state_fio->Fwrite(ram, sizeof(ram), 1);
-#if defined(_TK80BS)
- state_fio->Fwrite(vram, sizeof(vram), 1);
- state_fio->FputInt32(boot_mode);
-// state_fio->FputInt32(draw_ranges);
-#endif
+// state_fio->Fwrite(ram, sizeof(ram), 1);
+//#if defined(_TK80BS)
+// state_fio->Fwrite(vram, sizeof(vram), 1);
+// state_fio->FputInt32(boot_mode);
+//// state_fio->FputInt32(draw_ranges);
+//#endif
}
bool VM::load_state(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
+ //if(state_fio->FgetUint32() != STATE_VERSION) {
+ // return false;
+ //}
+ bool mb = false;
+ if(state_entry != NULL) {
+ mb = state_entry->load_state(state_fio);
+ }
+ if(!mb) {
+ emu->out_debug_log("INFO: HEADER DATA ERROR");
return false;
}
for(DEVICE* device = first_device; device; device = device->next_device) {
return false;
}
}
- state_fio->Fread(ram, sizeof(ram), 1);
+// state_fio->Fread(ram, sizeof(ram), 1);
#if defined(_TK80BS)
- state_fio->Fread(vram, sizeof(vram), 1);
- boot_mode = state_fio->FgetInt32();
-// draw_ranges = state_fio->FgetInt32();
+// state_fio->Fread(vram, sizeof(vram), 1);
+// boot_mode = state_fio->FgetInt32();
+//// draw_ranges = state_fio->FgetInt32();
// post process
emu->reload_bitmap();
#endif
};
+class csp_state_utils;
+
class EMU;
class DEVICE;
class EVENT;
{
protected:
EMU* emu;
+ csp_state_utils* state_entry;
// devices
EVENT* event;
bool is_frame_skippable();
void update_config();
+ void decl_state();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
for(DEVICE* device = first_device; device; device = device->next_device) {
device->initialize();
}
+ decl_state();
}
VM::~VM()
#define STATE_VERSION 2
+#include "../../statesub.h"
+
+void VM::decl_state(void)
+{
+
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::X07_HEAD")));
+ DECL_STATE_ENTRY_1DARRAY(ram, sizeof(ram));
+ DECL_STATE_ENTRY_1DARRAY(vram, sizeof(vram));
+ for(DEVICE* device = first_device; device; device = device->next_device) {
+ device->decl_state();
+ }
+}
+
void VM::save_state(FILEIO* state_fio)
{
- state_fio->FputUint32(STATE_VERSION);
+ //state_fio->FputUint32(STATE_VERSION);
+ if(state_entry != NULL) {
+ state_entry->save_state(state_fio);
+ }
for(DEVICE* device = first_device; device; device = device->next_device) {
device->save_state(state_fio);
}
- state_fio->Fwrite(ram, sizeof(ram), 1);
- state_fio->Fwrite(vram, sizeof(vram), 1);
+ //state_fio->Fwrite(ram, sizeof(ram), 1);
+ //state_fio->Fwrite(vram, sizeof(vram), 1);
}
bool VM::load_state(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
+ //if(state_fio->FgetUint32() != STATE_VERSION) {
+ // return false;
+ //}
+ bool mb = false;
+ if(state_entry != NULL) {
+ mb = state_entry->load_state(state_fio);
+ }
+ if(!mb) {
+ emu->out_debug_log("INFO: HEADER DATA ERROR");
return false;
}
for(DEVICE* device = first_device; device; device = device->next_device) {
return false;
}
}
- state_fio->Fread(ram, sizeof(ram), 1);
- state_fio->Fread(vram, sizeof(vram), 1);
+ //state_fio->Fread(ram, sizeof(ram), 1);
+ //state_fio->Fread(vram, sizeof(vram), 1);
return true;
}
};
#endif
+class csp_state_utils;
+
class EMU;
class DEVICE;
class EVENT;
{
protected:
EMU* emu;
+ csp_state_utils* state_entry;
// devices
EVENT* event;
bool is_frame_skippable();
void update_config();
+ void decl_state();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
void VM::decl_state(void)
{
- state_entry = new csp_state_utils(STATE_VERSION, 0, CONFIG_NAME);
+#if defined(_X1)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, _T("CSP::X1_HEAD"));
+#elif defined(_X1TURBO)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, _T("CSP::X1_TURBO_HEAD"));
+#elif defined(_X1TURBOZ)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, _T("CSP::X1_TURBO_Z_HEAD"));
+#elif defined(_X1TWIN)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, _T("CSP::X1_TWIN_HEAD"));
+#else
+ state_entry = new csp_state_utils(STATE_VERSION, 0, _T("CSP::X1_SERIES_HEAD"));
+#endif
+
DECL_STATE_ENTRY_BOOL(pseudo_sub_cpu);
DECL_STATE_ENTRY_INT32(sound_type);
for(DEVICE* device = first_device; device; device = device->next_device) {
for(DEVICE* device = first_device; device; device = device->next_device) {
device->initialize();
}
+ decl_state();
}
VM::~VM()
#define STATE_VERSION 4
+#include "../../statesub.h"
+
+void VM::decl_state(void)
+{
+
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::YALKY_HEAD")));
+ DECL_STATE_ENTRY_1DARRAY(ram, sizeof(ram));
+ DECL_STATE_ENTRY_1DARRAY(vram, sizeof(vram));
+ for(DEVICE* device = first_device; device; device = device->next_device) {
+ device->decl_state();
+ }
+}
+
void VM::save_state(FILEIO* state_fio)
{
- state_fio->FputUint32(STATE_VERSION);
+ //state_fio->FputUint32(STATE_VERSION);
+ if(state_entry != NULL) {
+ state_entry->save_state(state_fio);
+ }
for(DEVICE* device = first_device; device; device = device->next_device) {
device->save_state(state_fio);
}
- state_fio->Fwrite(ram, sizeof(ram), 1);
- state_fio->Fwrite(vram, sizeof(vram), 1);
+ //state_fio->Fwrite(ram, sizeof(ram), 1);
+ //state_fio->Fwrite(vram, sizeof(vram), 1);
}
bool VM::load_state(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
+ //if(state_fio->FgetUint32() != STATE_VERSION) {
+ // return false;
+ //}
+ bool mb = false;
+ if(state_entry != NULL) {
+ mb = state_entry->load_state(state_fio);
+ }
+ if(!mb) {
+ emu->out_debug_log("INFO: HEADER DATA ERROR");
return false;
}
for(DEVICE* device = first_device; device; device = device->next_device) {
return false;
}
}
- state_fio->Fread(ram, sizeof(ram), 1);
- state_fio->Fread(vram, sizeof(vram), 1);
+ //state_fio->Fread(ram, sizeof(ram), 1);
+ //state_fio->Fread(vram, sizeof(vram), 1);
return true;
}
};
#endif
+class csp_state_utils;
+
class EMU;
class DEVICE;
class EVENT;
{
protected:
EMU* emu;
+ csp_state_utils* state_entry;
// devices
EVENT* event;
bool is_frame_skippable();
void update_config();
+ void decl_state();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
for(DEVICE* device = first_device; device; device = device->next_device) {
device->initialize();
}
+ decl_state();
for(int i = 0; i < MAX_DRIVE; i++) {
fdc->set_drive_type(i, DRIVE_TYPE_2DD); // 1DD
fdc->set_track_size(i, 6238);
#define STATE_VERSION 2
+#include "../../statesub.h"
+
+void VM::decl_state(void)
+{
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::YIS_HEAD")));
+ for(DEVICE* device = first_device; device; device = device->next_device) {
+ device->decl_state();
+ }
+}
+
void VM::save_state(FILEIO* state_fio)
{
- state_fio->FputUint32(STATE_VERSION);
+ //state_fio->FputUint32(STATE_VERSION);
+ if(state_entry != NULL) {
+ state_entry->save_state(state_fio);
+ }
for(DEVICE* device = first_device; device; device = device->next_device) {
device->save_state(state_fio);
}
bool VM::load_state(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
+ //if(state_fio->FgetUint32() != STATE_VERSION) {
+ // return false;
+ //}
+ bool mb = false;
+ if(state_entry != NULL) {
+ mb = state_entry->load_state(state_fio);
+ }
+ if(!mb) {
+ emu->out_debug_log("INFO: HEADER DATA ERROR");
return false;
}
for(DEVICE* device = first_device; device; device = device->next_device) {
};
#endif
+class csp_state_utils;
+
class EMU;
class DEVICE;
class EVENT;
{
protected:
EMU* emu;
+ csp_state_utils* state_entry;
// devices
EVENT* event;
bool is_frame_skippable();
void update_config();
+ void decl_state();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
for(DEVICE* device = first_device; device; device = device->next_device) {
device->initialize();
}
+ decl_state();
}
VM::~VM()
#define STATE_VERSION 2
+#include "../../statesub.h"
+
+void VM::decl_state(void)
+{
+
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::YS_6464A_HEAD")));
+ DECL_STATE_ENTRY_1DARRAY(ram, sizeof(ram));
+ for(DEVICE* device = first_device; device; device = device->next_device) {
+ device->decl_state();
+ }
+}
+
void VM::save_state(FILEIO* state_fio)
{
- state_fio->FputUint32(STATE_VERSION);
+ //state_fio->FputUint32(STATE_VERSION);
+ if(state_entry != NULL) {
+ state_entry->save_state(state_fio);
+ }
for(DEVICE* device = first_device; device; device = device->next_device) {
device->save_state(state_fio);
}
- state_fio->Fwrite(ram, sizeof(ram), 1);
+ //state_fio->Fwrite(ram, sizeof(ram), 1);
}
bool VM::load_state(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
+ //if(state_fio->FgetUint32() != STATE_VERSION) {
+ // return false;
+ //}
+ bool mb = false;
+ if(state_entry != NULL) {
+ mb = state_entry->load_state(state_fio);
+ }
+ if(!mb) {
+ emu->out_debug_log("INFO: HEADER DATA ERROR");
return false;
}
for(DEVICE* device = first_device; device; device = device->next_device) {
return false;
}
}
- state_fio->Fread(ram, sizeof(ram), 1);
+ //state_fio->Fread(ram, sizeof(ram), 1);
return true;
}
{582, 23, 28, 40},
};
+class csp_state_utils;
+
class EMU;
class DEVICE;
class EVENT;
{
protected:
EMU* emu;
+ csp_state_utils* state_entry;
// devices
EVENT* event;
bool is_frame_skippable();
void update_config();
+ void decl_state();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
for(DEVICE* device = first_device; device; device = device->next_device) {
device->initialize();
}
+ decl_state();
}
VM::~VM()
#define STATE_VERSION 2
+#include "../../statesub.h"
+
+void VM::decl_state(void)
+{
+#if defined(_USE_I8255)
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::Z80_TV_GAME_I8255_HEAD")));
+#else
+ state_entry = new csp_state_utils(STATE_VERSION, 0, (_TCHAR *)(_T("CSP::Z80_TV_GAME_Z80PIO_HEAD")));
+#endif
+ for(DEVICE* device = first_device; device; device = device->next_device) {
+ device->decl_state();
+ }
+}
+
void VM::save_state(FILEIO* state_fio)
{
- state_fio->FputUint32(STATE_VERSION);
+ //state_fio->FputUint32(STATE_VERSION);
+ if(state_entry != NULL) {
+ state_entry->save_state(state_fio);
+ }
for(DEVICE* device = first_device; device; device = device->next_device) {
device->save_state(state_fio);
}
bool VM::load_state(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
+ //if(state_fio->FgetUint32() != STATE_VERSION) {
+ // return false;
+ //}
+ bool mb = false;
+ if(state_entry != NULL) {
+ mb = state_entry->load_state(state_fio);
+ }
+ if(!mb) {
+ emu->out_debug_log("INFO: HEADER DATA ERROR");
return false;
}
for(DEVICE* device = first_device; device; device = device->next_device) {
};
#endif
+class csp_state_utils;
+
class EMU;
class DEVICE;
class EVENT;
{
protected:
EMU* emu;
+ csp_state_utils* state_entry;
// devices
EVENT* event;
bool is_frame_skippable();
void update_config();
+ void decl_state();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);