OSDN Git Service

[General] Merge Upstream 2017-03-07.
[csp-qt/common_source_project-fm7.git] / source / src / vm / pasopia7 / pac2dev.h
index 4709e55..c8aa0bf 100644 (file)
@@ -20,7 +20,10 @@ protected:
        VM* vm;
        EMU* emu;
 public:
-       PAC2DEV(VM* parent_vm, EMU* parent_emu) : vm(parent_vm), emu(parent_emu) {}
+       PAC2DEV(VM* parent_vm, EMU* parent_emu) : vm(parent_vm), emu(parent_emu)
+       {
+               set_device_name(_T("PAC2 Base Device"));
+       }
        ~PAC2DEV(void) {}
        
        virtual void initialize(int id) {}
@@ -30,6 +33,28 @@ public:
        virtual uint32_t read_io8(uint32_t addr) { return 0xff; }
        virtual void save_state(FILEIO* state_fio) {}
        virtual bool load_state(FILEIO* state_fio) { return true; }
+       
+       virtual void set_device_name(const _TCHAR* format, ...)
+       {
+               if(format != NULL) {
+                       va_list ap;
+                       _TCHAR buffer[1024];
+                       
+                       va_start(ap, format);
+                       my_vstprintf_s(buffer, 1024, format, ap);
+                       va_end(ap);
+                       
+                       my_tcscpy_s(this_device_name, 128, buffer);
+#ifdef _USE_QT
+//                     emu->get_osd()->set_vm_node(this_device_id, buffer);
+#endif
+               }
+       }
+       virtual const _TCHAR *get_device_name()
+       {
+               return (const _TCHAR *)this_device_name;
+       }
+       _TCHAR this_device_name[128];
 };
 
 #endif