OSDN Git Service

[VM][General] Apply Upstream 2018-10-07.Still WIP.
[csp-qt/common_source_project-fm7.git] / source / src / win32 / osd.h
index 4c5c332..21c8581 100644 (file)
 #ifndef _WIN32_OSD_H_
 #define _WIN32_OSD_H_
 
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT           0x500
+#endif
 #define DIRECTSOUND_VERSION    0x900
 #define DIRECT3D_VERSION       0x900
 // XXX: if your DirectX 9.0 SDK is newer and does not contain dinput.lib,
 // please change the definition of DIRECTINPUT_VERSION from 0x500 to 0x800
-#define DIRECTINPUT_VERSION    0x500
-//#define DIRECTINPUT_VERSION  0x800
+//#define DIRECTINPUT_VERSION  0x500
+#define DIRECTINPUT_VERSION    0x800
 
 #include <windows.h>
 #include <windowsx.h>
@@ -100,9 +103,9 @@ public:
 #ifdef USE_MOVIE_PLAYER
 class CMySampleGrabberCB : public ISampleGrabberCB {
 private:
-       VM *vm;
+       VM_TEMPLATE *vm;
 public:
-       CMySampleGrabberCB(VM *vm_ptr)
+       CMySampleGrabberCB(VM_TEMPLATE *vm_ptr)
        {
                vm = vm_ptr;
        }
@@ -157,6 +160,10 @@ public:
 
 // check memory leaks
 #ifdef _DEBUG
+// _malloca is defined in typeinfo.h
+#ifdef _malloca
+#undef _malloca
+#endif
 #define _CRTDBG_MAP_ALLOC
 #include <crtdbg.h>
 #define malloc(s) _malloc_dbg(s, _NORMAL_BLOCK, __FILE__, __LINE__)
@@ -246,11 +253,9 @@ private:
        
        uint8_t keycode_conv[256];
        uint8_t key_status[256];        // windows key code mapping
+       uint8_t key_dik[256];
        uint8_t key_dik_prev[256];
-#ifdef USE_SHIFT_NUMPAD_KEY
-       uint8_t key_converted[256];
        bool key_shift_pressed, key_shift_released;
-#endif
        bool key_caps_locked;
        bool lost_focus;
        
@@ -413,7 +418,7 @@ public:
        ~OSD() {}
        
        // common
-       VM* vm;
+       VM_TEMPLATE* vm;
        
        void initialize(int rate, int samples);
        void release();
@@ -436,14 +441,14 @@ public:
        bool is_console_active();
        void set_console_text_attribute(unsigned short attr);
        void write_console(_TCHAR* buffer, unsigned int length);
-       int read_console_input(_TCHAR* buffer);
+       int read_console_input(_TCHAR* buffer, unsigned int length);
        bool is_console_key_pressed(int vk);
        void close_debugger_console();
        
        // common input
        void update_input();
-       void key_down(int code, bool repeat);
-       void key_up(int code);
+       void key_down(int code, bool extended, bool repeat);
+       void key_up(int code, bool extended);
        void key_down_native(int code, bool repeat);
        void key_up_native(int code);
        void key_lost_focus()
@@ -484,6 +489,7 @@ public:
        int get_window_mode_height(int mode);
        void set_host_window_size(int window_width, int window_height, bool window_mode);
        void set_vm_screen_size(int screen_width, int screen_height, int window_width, int window_height, int window_width_aspect, int window_height_aspect);
+       void set_vm_screen_lines(int lines);
        int get_vm_window_width()
        {
                return vm_window_width;