diff --git a/source/frontends/ncurses/world.cpp b/source/frontends/ncurses/world.cpp index ee46f29f..2f89baa0 100644 --- a/source/frontends/ncurses/world.cpp +++ b/source/frontends/ncurses/world.cpp @@ -534,12 +534,12 @@ BYTE KeybGetKeycode () return 0; } -BYTE __stdcall KeybReadData (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG uExecutedCycles) +BYTE KeybReadData() { return nextKey; } -BYTE __stdcall KeybReadFlag (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG uExecutedCycles) +BYTE KeybReadFlag() { BYTE result = keyReady ? nextKey : 0; nextKey = 0; diff --git a/source/frontends/qapple/video.cpp b/source/frontends/qapple/video.cpp index 4edf45b5..f4fabf1e 100644 --- a/source/frontends/qapple/video.cpp +++ b/source/frontends/qapple/video.cpp @@ -433,25 +433,13 @@ BYTE KeybGetKeycode () return keyCode; } -BYTE __stdcall KeybReadData (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG uExecutedCycles) +BYTE KeybReadData() { - Q_UNUSED(pc) - Q_UNUSED(addr) - Q_UNUSED(bWrite) - Q_UNUSED(d) - Q_UNUSED(uExecutedCycles) - return keyCode | (keyWaiting ? 0x80 : 0x00); } -BYTE __stdcall KeybReadFlag (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG uExecutedCycles) +BYTE KeybReadFlag() { - Q_UNUSED(pc) - Q_UNUSED(addr) - Q_UNUSED(bWrite) - Q_UNUSED(d) - Q_UNUSED(uExecutedCycles) - keyWaiting = false; return keyCode; } diff --git a/source/linux/dummies.cpp b/source/linux/dummies.cpp index cc21eee9..ba19a4b4 100644 --- a/source/linux/dummies.cpp +++ b/source/linux/dummies.cpp @@ -142,11 +142,6 @@ int g_nAltCharSetOffset = 0; // alternate character set #define SW_PAGE2 (g_uVideoMode & VF_PAGE2) #define SW_TEXT (g_uVideoMode & VF_TEXT) -bool VideoGetSW80COL() -{ - return SW_80COL ? true : false; -} - bool VideoGetVblBar(DWORD uExecutedCycles) { // get video scanner position @@ -346,6 +341,46 @@ WORD VideoGetScannerAddress(bool* pbVblBar_OUT, const DWORD uExecutedCycles) return static_cast(nAddress); } +bool VideoGetSW80COL(void) +{ + return SW_80COL ? true : false; +} + +bool VideoGetSWDHIRES(void) +{ + return SW_DHIRES ? true : false; +} + +bool VideoGetSWHIRES(void) +{ + return SW_HIRES ? true : false; +} + +bool VideoGetSW80STORE(void) +{ + return SW_80STORE ? true : false; +} + +bool VideoGetSWMIXED(void) +{ + return SW_MIXED ? true : false; +} + +bool VideoGetSWPAGE2(void) +{ + return SW_PAGE2 ? true : false; +} + +bool VideoGetSWTEXT(void) +{ + return SW_TEXT ? true : false; +} + +bool VideoGetSWAltCharSet(void) +{ + return g_nAltCharSetOffset != 0; +} + // NTSC void NTSC_VideoUpdateCycles( long cyclesLeftToUpdate ) diff --git a/source/linux/interface.h b/source/linux/interface.h index 448b26a5..cbbbb5d8 100644 --- a/source/linux/interface.h +++ b/source/linux/interface.h @@ -16,8 +16,8 @@ void FrameRefreshStatus(int x, bool); // Keyboard BYTE KeybGetKeycode (); -BYTE __stdcall KeybReadData (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG uExecutedCycles); -BYTE __stdcall KeybReadFlag (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG uExecutedCycles); +BYTE KeybReadData(); +BYTE KeybReadFlag(); // Joystick diff --git a/source/linux/wincompat.h b/source/linux/wincompat.h index 6086b561..63662395 100644 --- a/source/linux/wincompat.h +++ b/source/linux/wincompat.h @@ -312,6 +312,8 @@ typedef struct tagOFN { typedef OPENFILENAME OPENFILENAME_NT4; +typedef int LCID; + #ifdef __cplusplus } #endif diff --git a/source/linux/wwrapper.cpp b/source/linux/wwrapper.cpp index de0f9a42..3587c9b7 100644 --- a/source/linux/wwrapper.cpp +++ b/source/linux/wwrapper.cpp @@ -8,10 +8,11 @@ #include #include #include -#include #include #include #include +#include +#include #include "../resource/resource.h" #include "Log.h" @@ -250,3 +251,25 @@ BOOL WINAPI PostMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { return TRUE; } + +int GetDateFormat(LCID Locale, DWORD dwFlags, CONST SYSTEMTIME *lpDate, LPCSTR lpFormat, LPSTR lpDateStr, int cchDate) +{ + std::time_t t = std::time(nullptr); + std::tm tm = *std::localtime(&t); + std::ostringstream ss; + ss << std::put_time(&tm, "%D"); + const std::string str = ss.str(); + strncpy(lpDateStr, str.c_str(), cchDate); + return cchDate; // not 100% sure, but it is never used +} + +int GetTimeFormat(LCID Locale, DWORD dwFlags, CONST SYSTEMTIME *lpTime, LPCSTR lpFormat, LPSTR lpTimeStr, int cchTime) +{ + std::time_t t = std::time(nullptr); + std::tm tm = *std::localtime(&t); + std::ostringstream ss; + ss << std::put_time(&tm, "%T"); + const std::string str = ss.str(); + strncpy(lpTimeStr, str.c_str(), cchTime); + return cchTime; // not 100% sure, but it is never used +} diff --git a/source/linux/wwrapper.h b/source/linux/wwrapper.h index dcde0413..ddfe952a 100644 --- a/source/linux/wwrapper.h +++ b/source/linux/wwrapper.h @@ -136,3 +136,8 @@ int MessageBox(HWND, const char *, const char *, UINT); // used in TestCPU6502 #define _tmain main + +#define LOCALE_SYSTEM_DEFAULT 0x0800 + +int GetDateFormat(LCID Locale, DWORD dwFlags, CONST SYSTEMTIME *lpDate, LPCSTR lpFormat, LPSTR lpDateStr, int cchDate); +int GetTimeFormat(LCID Locale, DWORD dwFlags, CONST SYSTEMTIME *lpTime, LPCSTR lpFormat, LPSTR lpTimeStr, int cchTime); diff --git a/test/TestCPU6502/dummy.cpp b/test/TestCPU6502/dummy.cpp index b99fd29c..5c8f3bfb 100644 --- a/test/TestCPU6502/dummy.cpp +++ b/test/TestCPU6502/dummy.cpp @@ -16,8 +16,8 @@ void FrameRefreshStatus(int x, bool) { } // Keyboard BYTE KeybGetKeycode () { return 0; } -BYTE __stdcall KeybReadData (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nCyclesLeft) { return 0; } -BYTE __stdcall KeybReadFlag (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nCyclesLeft) { return 0; } +BYTE KeybReadData() { return 0; } +BYTE KeybReadFlag() { return 0; } // Joystick