register_frame_event(this);
}
-void SYSPORT::write_io8(uint32 addr, uint32 data)
+void SYSPORT::write_io8(uint32_t addr, uint32_t data)
{
switch(addr & 0x3f0) {
case 0x70:
}
}
-uint32 SYSPORT::read_io8(uint32 addr)
+uint32_t SYSPORT::read_io8(uint32_t addr)
{
switch(addr & 0x3ff) {
case 0x60:
#define STATE_VERSION 1
+#include "../../statesub.h"
+
+void SYSPORT::decl_state()
+{
+
+ enter_decl_state(STATE_VERSION);
+
+ DECL_STATE_ENTRY_INT32(rst);
+ DECL_STATE_ENTRY_INT32(highden);
+
+ leave_decl_state();
+}
+
void SYSPORT::save_state(FILEIO* state_fio)
{
- state_fio->FputUint32(STATE_VERSION);
- state_fio->FputInt32(this_device_id);
+ if(state_entry != NULL) {
+ state_entry->save_state(state_fio);
+ }
+// state_fio->FputUint32(STATE_VERSION);
+// state_fio->FputInt32(this_device_id);
- state_fio->FputInt32(rst);
- state_fio->FputInt32(highden);
+// state_fio->FputInt32(rst);
+// state_fio->FputInt32(highden);
}
bool SYSPORT::load_state(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
- return false;
+ bool mb = false;
+ if(state_entry != NULL) {
+ mb = state_entry->load_state(state_fio);
}
- if(state_fio->FgetInt32() != this_device_id) {
+ if(!mb) {
return false;
}
- rst = state_fio->FgetInt32();
- highden = state_fio->FgetInt32();
+// if(state_fio->FgetUint32() != STATE_VERSION) {
+// return false;
+// }
+// if(state_fio->FgetInt32() != this_device_id) {
+// return false;
+// }
+// rst = state_fio->FgetInt32();
+// highden = state_fio->FgetInt32();
return true;
}
+bool SYSPORT::process_state(FILEIO* state_fio, bool loading)
+{
+ if(!state_fio->StateCheckUint32(STATE_VERSION)) {
+ return false;
+ }
+ if(!state_fio->StateCheckInt32(this_device_id)) {
+ return false;
+ }
+ state_fio->StateInt32(rst);
+ state_fio->StateInt32(highden);
+ return true;
+}