OSDN Git Service

[VM] Apply new APIs to all VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / svi3x8 / msx_ex.cpp
index 926a6a6..d64949b 100644 (file)
@@ -127,9 +127,10 @@ VM::VM(EMU_TEMPLATE* parent_emu) : VM_TEMPLATE(parent_emu)
 #endif
        
        // initialize all devices
-       for(DEVICE* device = first_device; device; device = device->next_device) {
-               device->initialize();
-       }
+#if defined(__GIT_REPO_VERSION)
+       set_git_repo_version(__GIT_REPO_VERSION);
+#endif
+       initialize_devices();
 }
 
 VM::~VM()
@@ -400,22 +401,8 @@ void VM::update_config()
 
 bool VM::process_state(FILEIO* state_fio, bool loading)
 {
-       if(!state_fio->StateCheckUint32(STATE_VERSION)) {
+       if(!(VM_TEMPLATE::process_state_core(state_fio, loading, STATE_VERSION))) {
                return false;
        }
-       for(DEVICE* device = first_device; device; device = device->next_device) {
-               const _TCHAR *name = char_to_tchar(typeid(*device).name() + 6); // skip "class "
-               int len = (int)_tcslen(name);
-               
-               if(!state_fio->StateCheckInt32(len)) {
-                       return false;
-               }
-               if(!state_fio->StateCheckBuffer(name, len, 1)) {
-                       return false;
-               }
-               if(!device->process_state(state_fio, loading)) {
-                       return false;
-               }
-       }
        return true;
 }