-/*\r
- SANYO PHC-20 Emulator 'ePHC-20'\r
-\r
- Author : Takeda.Toshiya\r
- Date : 2010.09.03-\r
-\r
- [ virtual machine ]\r
-*/\r
-\r
-#ifndef _PHC20_H_\r
-#define _PHC20_H_\r
-\r
-#define DEVICE_NAME "SANYO PHC-20"\r
-#define CONFIG_NAME "phc20"\r
-\r
-// device informations for virtual machine\r
-#define FRAMES_PER_SEC 60\r
-#define LINES_PER_FRAME 262\r
-#define CPU_CLOCKS 4000000\r
-#define SCREEN_WIDTH 256\r
-#define SCREEN_HEIGHT 192\r
-\r
-#define MC6847_VRAM_INV 0x40\r
-\r
-// device informations for win32\r
-#define USE_TAPE\r
-#define USE_ALT_F10_KEY\r
-#define USE_AUTO_KEY 6\r
-#define USE_AUTO_KEY_RELEASE 10\r
-#define USE_AUTO_KEY_NO_CAPS\r
-#define USE_DEBUGGER\r
-#define USE_STATE\r
-\r
-#include "../../common.h"\r
-\r
-class EMU;\r
-class DEVICE;\r
-class EVENT;\r
-\r
-class DATAREC;\r
-class MC6847;\r
-class Z80;\r
-\r
-class MEMORY;\r
-\r
-class FILEIO;\r
-\r
-class VM\r
-{\r
-protected:\r
- EMU* emu;\r
- \r
- // devices\r
- EVENT* event;\r
- \r
- DATAREC* drec;\r
- MC6847* vdp;\r
- Z80* cpu;\r
- \r
- MEMORY* memory;\r
- \r
-public:\r
- // ----------------------------------------\r
- // initialize\r
- // ----------------------------------------\r
- \r
- VM(EMU* parent_emu);\r
- ~VM();\r
- \r
- // ----------------------------------------\r
- // for emulation class\r
- // ----------------------------------------\r
- \r
- // drive virtual machine\r
- void reset();\r
- void run();\r
- \r
-#ifdef USE_DEBUGGER\r
- // debugger\r
- DEVICE *get_cpu(int index);\r
-#endif\r
- \r
- // draw screen\r
- void draw_screen();\r
- \r
- // sound generation\r
- void initialize_sound(int rate, int samples);\r
- uint16* create_sound(int* extra_frames);\r
- int sound_buffer_ptr();\r
- \r
- // user interface\r
- void play_tape(_TCHAR* file_path);\r
- void rec_tape(_TCHAR* file_path);\r
- void close_tape();\r
- bool tape_inserted();\r
- bool now_skip();\r
- \r
- void update_config();\r
- void save_state(FILEIO* state_fio);\r
- bool load_state(FILEIO* state_fio);\r
- \r
- // ----------------------------------------\r
- // for each device\r
- // ----------------------------------------\r
- \r
- // devices\r
- DEVICE* get_device(int id);\r
- DEVICE* dummy;\r
- DEVICE* first_device;\r
- DEVICE* last_device;\r
-};\r
-\r
-#endif\r
+/*
+ SANYO PHC-20 Emulator 'ePHC-20'
+
+ Author : Takeda.Toshiya
+ Date : 2010.09.03-
+
+ [ virtual machine ]
+*/
+
+#ifndef _PHC20_H_
+#define _PHC20_H_
+
+#define DEVICE_NAME "SANYO PHC-20"
+#define CONFIG_NAME "phc20"
+
+// device informations for virtual machine
+#define FRAMES_PER_SEC 60
+#define LINES_PER_FRAME 262
+#define CPU_CLOCKS 4000000
+#define SCREEN_WIDTH 256
+#define SCREEN_HEIGHT 192
+
+#define MC6847_VRAM_INV 0x40
+
+// device informations for win32
+#define USE_TAPE
+#define USE_ALT_F10_KEY
+#define USE_AUTO_KEY 6
+#define USE_AUTO_KEY_RELEASE 10
+#define USE_AUTO_KEY_NO_CAPS
+#define USE_DEBUGGER
+#define USE_STATE
+
+#include "../../common.h"
+
+class EMU;
+class DEVICE;
+class EVENT;
+
+class DATAREC;
+class MC6847;
+class Z80;
+
+class MEMORY;
+
+class FILEIO;
+
+class VM
+{
+protected:
+ EMU* emu;
+
+ // devices
+ EVENT* event;
+
+ DATAREC* drec;
+ MC6847* vdp;
+ Z80* cpu;
+
+ MEMORY* memory;
+
+public:
+ // ----------------------------------------
+ // initialize
+ // ----------------------------------------
+
+ VM(EMU* parent_emu);
+ ~VM();
+
+ // ----------------------------------------
+ // for emulation class
+ // ----------------------------------------
+
+ // drive virtual machine
+ void reset();
+ void run();
+
+#ifdef USE_DEBUGGER
+ // debugger
+ DEVICE *get_cpu(int index);
+#endif
+
+ // draw screen
+ void draw_screen();
+
+ // sound generation
+ void initialize_sound(int rate, int samples);
+ uint16* create_sound(int* extra_frames);
+ int sound_buffer_ptr();
+
+ // user interface
+ void play_tape(_TCHAR* file_path);
+ void rec_tape(_TCHAR* file_path);
+ void close_tape();
+ bool tape_inserted();
+ bool now_skip();
+
+ void update_config();
+ void save_state(FILEIO* state_fio);
+ bool load_state(FILEIO* state_fio);
+
+ // ----------------------------------------
+ // for each device
+ // ----------------------------------------
+
+ // devices
+ DEVICE* get_device(int id);
+ DEVICE* dummy;
+ DEVICE* first_device;
+ DEVICE* last_device;
+};
+
+#endif