OSDN Git Service

[VM][General][Qt] Merge upstream 2015-12-31.
[csp-qt/common_source_project-fm7.git] / source / src / common.h
index 88ce165..1c2d81f 100644 (file)
 #include <string.h>
 #include <errno.h>
 
+// LOG COMMAND
+#define EMU_LOG_CPU1        0x00000001
+#define EMU_LOG_CPU2        0x00000002
+#define EMU_LOG_CPU3        0x00000004
+#define EMU_LOG_CPU4        0x00000008
+#define EMU_LOG_FLOPPY      0x00000010
+#define EMU_LOG_CMT         0x00000020
+#define EMU_LOG_QD          0x00000040
+#define EMU_LOG_CART        0x00000080
+#define EMU_LOG_BINARY      0x00000100
+#define EMU_LOG_LASERDISC   0x00000200
+#define EMU_LOG_DISPLAY     0x00001000
+#define EMU_LOG_SOUND       0x00002000
+#define EMU_LOG_KEYBOARD    0x00004000
+#define EMU_LOG_IO          0x00008000
+#define EMU_LOG_MEMORY      0x00010000
+#define EMU_LOG_USR1        0x00020000
+#define EMU_LOG_USR2        0x00040000
+#define EMU_LOG_USR3        0x00080000
+#define EMU_LOG_USR4        0x00100000
+#define EMU_LOG_USR5        0x00200000
+#define EMU_LOG_USR6        0x00400000
+#define EMU_LOG_USR7        0x00800000
+#define EMU_LOG_USR8        0x01000000
+#define EMU_LOG_USR9        0x02000000
+#define EMU_LOG_USR10       0x04000000
+#define EMU_LOG_GUI         0x08000000
+#define EMU_LOG_DEBUG       0x10000000
+#define EMU_LOG_INFO        0x20000000
+#define EMU_LOG_WARNING     0x40000000
+#define EMU_LOG_GENERAL     0x80000000
+
 #ifdef _MSC_VER
 #include <windows.h>
 #include <windowsx.h>
 #if defined(_USE_QT)
 # if defined(_USE_QT5)
 #  include <QtEndian>
-# else
+# endif
+# include <sys/param.h>
+# ifndef _MAX_PATH
+#  define _MAX_PATH 2048
 # endif
 #endif
 
        #else
                // Windows, but not VC++
                #define SUPPORT_TCHAR_TYPE
-//             #define SUPPORT_SECURE_FUNCTIONS
        #endif
- #endif
+#endif
 
-// disable warnings  for microsoft visual c++ 2005 or later
-#if defined(_MSC_VER) && (_MSC_VER >= 1400)
-#pragma warning( disable : 4819 )
-//#pragma warning( disable : 4995 )
-#pragma warning( disable : 4996 )
+// secure functions need tchar type
+#ifndef SUPPORT_TCHAR_TYPE
+#undef SUPPORT_SECURE_FUNCTIONS
 #endif
 
+
 // endian
 #if !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
        #if defined(__BYTE_ORDER) && (defined(__LITTLE_ENDIAN) || defined(__BIG_ENDIAN))
 
 
 // type definition
-#ifndef _MSC_VER
+#if !defined(_MSC_VER) && !defined(CSP_OS_GCC_WINDOWS) && !defined(CSP_OS_GCC_CYGWIN)
        #ifndef boolean
                typedef bool boolean;
        #endif
@@ -189,8 +222,8 @@ typedef int64_t INT64;
        #ifndef LPTSTR
                typedef _TCHAR* LPTSTR;
        #endif
-       #ifndef LPCTSTR
-               typedef const _TCHAR* LPCTSTR;
+       #ifndef LPCTSTR // This with const causes FTBFS with GCC/LLVM . 
+               typedef _TCHAR* LPCTSTR;
        #endif
 #endif
 
@@ -342,6 +375,9 @@ typedef union {
        #ifndef _tcstok
                #define _tcstok strtok
        #endif
+       #ifndef _tstoi
+               #define _tstoi atoi
+       #endif
        #ifndef _tcstol
                #define _tcstol strtol
        #endif
@@ -415,7 +451,9 @@ typedef union {
 
 
 // rgb color
-#define _RGB888
+#if !defined(_RGB555) && !defined(_RGB565) && !defined(_RGB888)
+       #define _RGB888
+#endif
 
 #if defined(_RGB555) || defined(_RGB565)
        typedef uint16 scrntype;
@@ -542,6 +580,7 @@ bool check_file_extension(const _TCHAR* file_path, const _TCHAR* ext);
 _TCHAR *get_file_path_without_extensiton(const _TCHAR* file_path);
 
 uint32 getcrc32(uint8 data[], int size);
+uint16 jis_to_sjis(uint16 jis);
 
 
 #define array_length(array) (sizeof(array) / sizeof(array[0]))