#include "../emu.h"
#if defined(_USE_QT)
#include "osd.h"
-#include "csp_logger.h"
+
//#define USE_DEVICE_NAME
#endif
// max devices connected to the output port
#define SIG_SCSI_ACK 309
#define SIG_SCSI_RST 310
+#include "vm_template.h"
-class VM;
+class CSP_Logger;
+class VM_TEMPLATE;
class EMU;
class OSD;
class DEVICE
{
protected:
- VM* vm;
+ VM_TEMPLATE* vm;
EMU* emu;
OSD* osd;
+ CSP_Logger *p_logger;
public:
- DEVICE(VM* parent_vm, EMU* parent_emu);
- //ToDo: Will implement real destructor per real classes and below destructor decl. with "virtual".
- // This makes warning:
- //"deleting object of polymorphic class type 'DEVICE' which has non-virtual
- // destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]".
- //~DEVICE(void);
- virtual ~DEVICE() {}
-
- virtual void initialize() { /* osd = emu->get_osd(); */}
- virtual void release() {}
+ DEVICE(VM_TEMPLATE* parent_vm, EMU* parent_emu);
+ ~DEVICE() {}
+
+ virtual void initialize() { }
+ virtual void release();
virtual void update_config() {}
virtual void save_state(FILEIO* state_fio) {}
{
reset();
}
+ virtual bool process_state(FILEIO* state_fio, bool loading)
+ {
+ if(loading) {
+ return load_state(state_fio);
+ } else {
+ save_state(state_fio);
+ return true;
+ }
+ }
// NOTE: the virtual bus interface functions for 16/32bit access invite the cpu is little endian.
// if the cpu is big endian, you need to implement them in the virtual machine memory/io classes.
virtual uint32_t get_current_clock();
virtual uint32_t get_passed_clock(uint32_t prev);
virtual double get_passed_usec(uint32_t prev);
+ virtual uint32_t get_passed_clock_since_vline();
+ virtual double get_passed_usec_since_vline();
+ virtual int get_cur_vline();
+ virtual int get_cur_vline_clocks();
virtual uint32_t get_cpu_pc(int index);
virtual void request_skip_frames();
virtual void set_frames_per_sec(double frames);
virtual void set_lines_per_frame(int lines);
+ virtual int get_lines_per_frame(void);
// Force render sound immediately when device's status has changed.
// You must call this after you changing registers (or enything).
// If has problems, try set_realtime_render.
virtual void set_device_name(const _TCHAR *format, ...);
virtual void out_debug_log(const char *fmt, ...);
virtual void force_out_debug_log(const char *fmt, ...);
-#if 1
+
// debugger
// DEBUGGER is enabled by default.
virtual void *get_debugger();
virtual bool write_debug_reg(const _TCHAR *reg, uint32_t data);
virtual void get_debug_regs_info(_TCHAR *buffer, size_t buffer_len);
virtual int debug_dasm(uint32_t pc, _TCHAR *buffer, size_t buffer_len);
-#endif
+
+ // misc
+ const _TCHAR *get_lib_common_vm_version(void);
+
_TCHAR this_device_name[128];
+ // device node using with iterator.
DEVICE* prev_device;
DEVICE* next_device;
int this_device_id;