OSDN Git Service

[VM][STATE] Apply new framework to some VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / pasopia / pac2dev.h
1 /*
2         TOSHIBA PASOPIA Emulator 'EmuPIA'
3         TOSHIBA PASOPIA 7 Emulator 'EmuPIA7'
4
5         Author : Takeda.Toshiya
6         Date   : 2006.09.20 -
7
8         [ pac slot 2 base class ]
9 */
10
11 #ifndef _PAC2DEV_H_
12 #define _PAC2DEV_H_
13
14 #include "../vm.h"
15 #include "../../emu.h"
16
17 class csp_state_utils;
18 class PAC2DEV
19 {
20 protected:
21         VM* vm;
22         EMU* emu;
23         csp_state_utils *state_entry;
24         
25 public:
26         PAC2DEV(VM* parent_vm, EMU* parent_emu) : vm(parent_vm), emu(parent_emu)
27         {
28                 set_device_name(_T("PAC2 Base Device"));
29         }
30         ~PAC2DEV(void) {}
31         
32         virtual void initialize(int id) {}
33         virtual void release() {}
34         virtual void reset() {}
35         virtual void write_io8(uint32_t addr, uint32_t data) {}
36         virtual uint32_t read_io8(uint32_t addr) { return 0xff; }
37         virtual bool process_state(FILEIO* state_fio, bool loading) { return true; }
38         
39         virtual void set_device_name(const _TCHAR* format, ...)
40         {
41                 if(format != NULL) {
42                         va_list ap;
43                         _TCHAR buffer[1024];
44                         
45                         va_start(ap, format);
46                         my_vstprintf_s(buffer, 1024, format, ap);
47                         va_end(ap);
48                         
49                         my_tcscpy_s(this_device_name, 128, buffer);
50 #ifdef _USE_QT
51 //                      emu->get_osd()->set_vm_node(this_device_id, buffer);
52 #endif
53                 }
54         }
55         virtual const _TCHAR *get_device_name()
56         {
57                 return (const _TCHAR *)this_device_name;
58         }
59         _TCHAR this_device_name[128];
60 };
61
62 #endif
63