Phase 0: scaffold modern RIOJoy solution + plan

Modernization of the legacy vJoy-based RIO cockpit interface for Win10/11,
removing the vJoy dependency in favor of a custom VHF/UMDF HID driver,
rewritten in C#/.NET 8 as a background tray app with per-game profiles.

- Reorganize: legacy C++ -> legacy/, cockpit art -> docs/reference/
- RioJoy.sln: src/RioJoy.Core (lib) + src/RioJoy.Tray (tray app), net8.0-windows x64
- driver/ placeholder for the RioGamepad WDK driver
- docs/PLAN.md (7-phase plan; profiles + serial-yield model)
- docs/PROTOCOL.md (RIO wire format + iRIO input-map reference)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-06-26 12:43:01 -05:00
co-authored by Claude Opus 4.8
commit 39a3dab1fc
54 changed files with 13616 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
#include <windows.h>
#include "c232comm.h"
#include "CPlasma.h"
+65
View File
@@ -0,0 +1,65 @@
#ifndef __CPLASMA_H__
#define __CPLASMA_H__
#define ESC 27
class CPlasma : public C232Comm
{
public:
DWORD m_dwStart;
int m_nOldRank;
int m_nOldScore;
enum {
ATTR_NORMAL = 0,
ATTR_HALF = 1,
ATTR_LINE = 2,
ATTR_REVERSE = 4,
ATTR_FLASH = 8,
ATTR_PROTECTED = 128
};
enum { PLASMA_OFF, PLASMA_ON, PLASMA_FLASH };
int m_nGlobalState;
// Time m_timeLastPlasma2;
public:
CPlasma () {
Open (2);
m_dwStart = GetTickCount ();
PlasmaClear ();
PlasmaCursor (CPlasma::PLASMA_OFF);
m_nOldRank = INT_MIN;
m_nOldScore = INT_MIN;
m_nGlobalState = -1;
}
virtual ~CPlasma () {
PlasmaCursor (CPlasma::PLASMA_OFF);
PlasmaClear ();
Close ();
}
public:
void SendPacket (const BYTE* pbPacket, char nLen);
void PlasmaClear ();
void PlasmaCursor (char n = PLASMA_OFF);
void PlasmaCursorHome ();
void PlasmaCursorX (char n);
void PlasmaCursorY (char n);
void PlasmaFontAttr (char n);
void PlasmaFont (char n);
void PlasmaText (const char *szText);
POINT GetFontSize (int Font);
void PlasmaBoxDraw (RECT tag);
void PlasmaBoxFill (RECT tag);
void PlasmaPosText (const char *szText, char x = 0, char y = 0, char Attr = 0, char Font = 5);
void PlasmaScoreDraw (const char *Rank, const char *Score, BOOL bFlag);
void DoPlasma(char nMode);
private:
void PlasmaDisplay (int Gamestate, const char *szName, const char *Rank, const char *Score);
};
#endif
BIN
View File
Binary file not shown.
+135
View File
@@ -0,0 +1,135 @@
#ifndef __RIO_H__
#define __RIO_H__
#define MSBON(B) {B |= 0x80;}
#define MSBOFF(B) {B &= ~0x80;}
#define MAXLENGTH 13
#define ACK_CHAR 0xFC
#define NAK_CHAR 0xFD
#define RESTART_CHAR 0xFE
#define IDLE_CHAR 0xFF
#define RX_ACK_BIT 0x0001
#define RX_NAK_BIT 0x0002
class CString
{
public:
char m_sz[256];
public:
CString()
{
m_sz[0] = '0';
};
~CString()
{
}
void _cdecl Format(const char* pcszFormat, ...)
{
va_list va_marker;
va_start(va_marker, pcszFormat);
vsprintf_s(m_sz, pcszFormat, va_marker);
va_end(va_marker);
}
operator const char* () const { return &m_sz[0]; }
CString& operator = (const char* pcszText)
{
strcpy_s(m_sz, pcszText);
return *this;
}
};
class CListBox
{
public:
public:
CListBox() {}
~CListBox() {}
int GetCount() const { return 0; }
void AddString(const char* pcszText) {}
void DeleteString(int nindex) {}
};
class CRIO : public C232Comm
{
public:
CListBox& m_ListBox;
BYTE m_ba[2048];
BYTE *m_pStart;
const BYTE *m_pEnd;
int m_nCount;
DWORD m_dwFlags;
BYTE m_baRead[128];
int m_nState;
int m_nRead;
int m_nLeft;
BYTE m_bCheck;
BYTE m_baReplies[32];
int m_nReplies;
int TestModeActive;
DWORD m_dwAnalogRequest;
public:
CRIO (CListBox& ListBox) : m_ListBox (ListBox) {
Init ();
}
virtual ~CRIO () {};
public:
void Init ();
void RIOBordState (BYTE ID);
void DoEventLoop();
void EventLoop (const BYTE *buf, int nLen);
void AddReply (BYTE bReply);
void CheckReplies ();
void CheckAnalogRequest();
void SendCommand (const BYTE* pbPacket);
void SendPacket (const BYTE* pbPacket, int nLen);
void SetLamp (int lampNumber, int state);
void GeneralReset();
void ResetThrottle ();
void RequestCheck();
void RequestVersion();
void RequestAnalogUpdate();
public:
enum RIOCommand {
rio_CheckRequest = 0x80, // 128
rio_VersionRequest, // 129
rio_AnalogRequest, // 130
rio_ResetRequest, // 131
rio_LampRequest, // 132
rio_CheckReply, // 133
rio_VersionReply, // 134
rio_AnalogReply, // 135
rio_ButtonPressed, // 136
rio_ButtonReleased, // 137
rio_KeyPressed, // 138
rio_KeyReleased, // 139
rio_TestModeChange // 140
};
enum RIOStatusType {
BoardOk, BoardMissing, BoardBad, LampBad, RestartCount, AbandonCount, FullBufferCount
};
enum LampState {
solid=0, flashSlow=1, flashMed=2, flashFast=3,
state1Off=0x00, state1Dim=0x04, state1Bright=0x0C,
state2Off=0x00, state2Dim=0x10, state2Bright=0x30,
};
enum {
LampSolidOff = solid + state1Off + state2Off,
LampSolidDim = solid + state1Dim + state2Dim,
LampSolidBright = solid + state1Bright + state2Bright
};
};
#endif
+10
View File
@@ -0,0 +1,10 @@
#include <windows.h>
#include <iostream>
#include "public.h"
#include "vjoyinterface.h"
#include "c232comm.h"
#include "CRIOMAIN.h"
+5
View File
@@ -0,0 +1,5 @@
#ifndef __CRIOMAIN_H__
#define __CRIOMAIN_H__
#endif
Binary file not shown.
+3622
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.
+4
View File
@@ -0,0 +1,4 @@
#include <iostream>
#include <windows.h>
#include "c232comm.h"
+4
View File
@@ -0,0 +1,4 @@
#if !defined(__C232COMM_H__)
#define __C232COMM_H__
#endif // !defined(__C232COMM_H__)
+206
View File
@@ -0,0 +1,206 @@
struct hhb_vkey{
char* name;
uint8_t vkey;
char* description;
};
const hhb_vkey hhb_vkey_list[] = {
{ "VK_LBUTTON", 0x01, "Left mouse button" },
{ "VK_RBUTTON", 0x02, "Right mouse button" },
{ "VK_CANCEL", 0x03, "Control-break processing" },
{ "VK_MBUTTON", 0x04, "Middle mouse button (three-button mouse)" },
{ "VK_XBUTTON1", 0x05, "X1 mouse button" },
{ "VK_XBUTTON2", 0x06, "X2 mouse button" },
{ "-", 0x07, "Undefined" },
{ "VK_BACK", 0x08, "BACKSPACE key" },
{ "VK_TAB", 0x09, "TAB key" },
//{ "-", 0x0A - 0B, "Reserved" },
{ "VK_CLEAR", 0x0C, "CLEAR key" },
{ "VK_RETURN", 0x0D, "ENTER key" },
//{ "-", 0x0E - 0F, "Undefined" },
{ "VK_SHIFT", 0x10, "SHIFT key" },
{ "VK_CONTROL", 0x11, "CTRL key" },
{ "VK_MENU", 0x12, "ALT key" },
{ "VK_PAUSE", 0x13, "PAUSE key" },
{ "VK_CAPITAL", 0x14, "CAPS LOCK key" },
{ "VK_KANA", 0x15, "IME Kana mode" },
{ "VK_HANGUEL", 0x15, "IME Hanguel mode (maintained for compatibility; use VK_HANGUL)" },
{ "VK_HANGUL", 0x15, "IME Hangul mode" },
//{ "-", 0x16, "Undefined" },
{ "VK_JUNJA", 0x17, "IME Junja mode" },
{ "VK_FINAL", 0x18, "IME final mode" },
{ "VK_HANJA", 0x19, "IME Hanja mode" },
{ "VK_KANJI", 0x19, "IME Kanji mode" },
//{ "-", 0x1A, "Undefined" },
{ "VK_ESCAPE", 0x1B, "ESC key" },
{ "VK_CONVERT", 0x1C, "IME convert" },
{ "VK_NONCONVERT", 0x1D, "IME nonconvert" },
{ "VK_ACCEPT", 0x1E, "IME accept" },
{ "VK_MODECHANGE", 0x1F, "IME mode change request" },
{ "VK_SPACE", 0x20, "SPACEBAR" },
{ "VK_PRIOR", 0x21, "PAGE UP key" },
{ "VK_NEXT", 0x22, "PAGE DOWN key" },
{ "VK_END", 0x23, "END key" },
{ "VK_HOME", 0x24, "HOME key" },
{ "VK_LEFT", 0x25, "LEFT ARROW key" },
{ "VK_UP", 0x26, "UP ARROW key" },
{ "VK_RIGHT", 0x27, "RIGHT ARROW key" },
{ "VK_DOWN", 0x28, "DOWN ARROW key" },
{ "VK_SELECT", 0x29, "SELECT key" },
{ "VK_PRINT", 0x2A, "PRINT key" },
{ "VK_EXECUTE", 0x2B, "EXECUTE key" },
{ "VK_SNAPSHOT", 0x2C, "PRINT SCREEN key" },
{ "VK_INSERT", 0x2D, "INS key" },
{ "VK_DELETE", 0x2E, "DEL key" },
{ "VK_HELP", 0x2F, "HELP key" },
{ "0 key", 0x30, "0 key" },
{ "1 key", 0x31, "1 key" },
{ "2 key", 0x32, "2 key" },
{ "3 key", 0x33, "3 key" },
{ "4 key", 0x34, "4 key" },
{ "5 key", 0x35, "5 key" },
{ "6 key", 0x36, "6 key" },
{ "7 key", 0x37, "7 key" },
{ "8 key", 0x38, "8 key" },
{ "9 key", 0x39, "9 key" },
//{ "undefined", 0x3A - 40, "undefined" },
{ "A key", 0x41, "A key" },
{ "B key", 0x42, "B key" },
{ "C key", 0x43, "C key" },
{ "D key", 0x44, "D key" },
{ "E key", 0x45, "E key" },
{ "F key", 0x46, "F key" },
{ "G key", 0x47, "G key" },
{ "H key", 0x48, "H key" },
{ "I key", 0x49, "I key" },
{ "J key", 0x4A, "J key" },
{ "K key", 0x4B, "K key" },
{ "L key", 0x4C, "L key" },
{ "M key", 0x4D, "M key" },
{ "N key", 0x4E, "N key" },
{ "O key", 0x4F, "O key" },
{ "P key", 0x50, "P key" },
{ "Q key", 0x51, "Q key" },
{ "R key", 0x52, "R key" },
{ "S key", 0x53, "S key" },
{ "T key", 0x54, "T key" },
{ "U key", 0x55, "U key" },
{ "V key", 0x56, "V key" },
{ "W key", 0x57, "W key" },
{ "X key", 0x58, "X key" },
{ "Y key", 0x59, "Y key" },
{ "Z key", 0x5A, "Z key" },
{ "VK_LWIN", 0x5B, "Left Windows key (Natural keyboard)" },
{ "VK_RWIN", 0x5C, "Right Windows key (Natural keyboard)" },
{ "VK_APPS", 0x5D, "Applications key (Natural keyboard)" },
//{ "-", 0x5E, "Reserved" },
{ "VK_SLEEP", 0x5F, "Computer Sleep key" },
{ "VK_NUMPAD0", 0x60, "Numeric keypad 0 key" },
{ "VK_NUMPAD1", 0x61, "Numeric keypad 1 key" },
{ "VK_NUMPAD2", 0x62, "Numeric keypad 2 key" },
{ "VK_NUMPAD3", 0x63, "Numeric keypad 3 key" },
{ "VK_NUMPAD4", 0x64, "Numeric keypad 4 key" },
{ "VK_NUMPAD5", 0x65, "Numeric keypad 5 key" },
{ "VK_NUMPAD6", 0x66, "Numeric keypad 6 key" },
{ "VK_NUMPAD7", 0x67, "Numeric keypad 7 key" },
{ "VK_NUMPAD8", 0x68, "Numeric keypad 8 key" },
{ "VK_NUMPAD9", 0x69, "Numeric keypad 9 key" },
{ "VK_MULTIPLY", 0x6A, "Multiply key" },
{ "VK_ADD", 0x6B, "Add key" },
{ "VK_SEPARATOR", 0x6C, "Separator key" },
{ "VK_SUBTRACT", 0x6D, "Subtract key" },
{ "VK_DECIMAL", 0x6E, "Decimal key" },
{ "VK_DIVIDE", 0x6F, "Divide key" },
{ "VK_F1", 0x70, "F1 key" },
{ "VK_F2", 0x71, "F2 key" },
{ "VK_F3", 0x72, "F3 key" },
{ "VK_F4", 0x73, "F4 key" },
{ "VK_F5", 0x74, "F5 key" },
{ "VK_F6", 0x75, "F6 key" },
{ "VK_F7", 0x76, "F7 key" },
{ "VK_F8", 0x77, "F8 key" },
{ "VK_F9", 0x78, "F9 key" },
{ "VK_F10", 0x79, "F10 key" },
{ "VK_F11", 0x7A, "F11 key" },
{ "VK_F12", 0x7B, "F12 key" },
{ "VK_F13", 0x7C, "F13 key" },
{ "VK_F14", 0x7D, "F14 key" },
{ "VK_F15", 0x7E, "F15 key" },
{ "VK_F16", 0x7F, "F16 key" },
{ "VK_F17", 0x80, "F17 key" },
{ "VK_F18", 0x81, "F18 key" },
{ "VK_F19", 0x82, "F19 key" },
{ "VK_F20", 0x83, "F20 key" },
{ "VK_F21", 0x84, "F21 key" },
{ "VK_F22", 0x85, "F22 key" },
{ "VK_F23", 0x86, "F23 key" },
{ "VK_F24", 0x87, "F24 key" },
//{ "-", 0x88 - 8F, "Unassigned" },
{ "VK_NUMLOCK", 0x90, "NUM LOCK key" },
{ "VK_SCROLL", 0x91, "SCROLL LOCK key" },
//{ "-", 0x88 - 8F, "Unassigned" },
{ "VK_NUMLOCK", 0x90, "NUM LOCK key" },
{ "VK_SCROLL", 0x91, "SCROLL LOCK key" },
//{"-", 0x92-96,"OEM specific"},
//{ "-", 0x97 - 9F, "Unassigned" },
{ "VK_LSHIFT", 0xA0, "Left SHIFT key" },
{ "VK_RSHIFT", 0xA1, "Right SHIFT key" },
{ "VK_LCONTROL", 0xA2, "Left CONTROL key" },
{ "VK_RCONTROL", 0xA3, "Right CONTROL key" },
{ "VK_LMENU", 0xA4, "Left MENU key" },
{ "VK_RMENU", 0xA5, "Right MENU key" },
{ "VK_BROWSER_BACK", 0xA6, "Browser Back key" },
{ "VK_BROWSER_FORWARD", 0xA7, "Browser Forward key" },
{ "VK_BROWSER_REFRESH", 0xA8, "Browser Refresh key" },
{ "VK_BROWSER_STOP", 0xA9, "Browser Stop key" },
{ "VK_BROWSER_SEARCH", 0xAA, "Browser Search key" },
{ "VK_BROWSER_FAVORITES", 0xAB, "Browser Favorites key" },
{ "VK_BROWSER_HOME", 0xAC, "Browser Start and Home key" },
{ "VK_VOLUME_MUTE", 0xAD, "Volume Mute key" },
{ "VK_VOLUME_DOWN", 0xAE, "Volume Down key" },
{ "VK_VOLUME_UP", 0xAF, "Volume Up key" },
{ "VK_MEDIA_NEXT_TRACK", 0xB0, "Next Track key" },
{ "VK_MEDIA_PREV_TRACK", 0xB1, "Previous Track key" },
{ "VK_MEDIA_STOP", 0xB2, "Stop Media key" },
{ "VK_MEDIA_PLAY_PAUSE", 0xB3, "Play/Pause Media key" },
{ "VK_LAUNCH_MAIL", 0xB4, "Start Mail key" },
{ "VK_LAUNCH_MEDIA_SELECT", 0xB5, "Select Media key" },
{ "VK_LAUNCH_APP1", 0xB6, "Start Application 1 key" },
{ "VK_LAUNCH_APP2", 0xB7, "Start Application 2 key" },
//{ "-", 0xB8 - B9, "Reserved" },
{ "VK_OEM_1", 0xBA, "Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the \';:\' key VK_OEM_PLUS" },
{"VK_OEM_PLUS", 0xBB, "For any country/region, the \'+\' key"},
{ "VK_OEM_COMMA", 0xBC, "For any country/region, the \',\' key" },
{ "VK_OEM_MINUS", 0xBD, "For any country/region, the \'-\' key" },
{ "VK_OEM_PERIOD", 0xBE, "For any country/region, the \'.\' key" },
{ "VK_OEM_2", 0xBF, "Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the \'/?\' key" },
{ "VK_OEM_3", 0xC0, "Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the \'`~\' key" },
//{ "-", 0xC1 - D7, "Reserved" },
//{ "-", 0xD8 - DA, "Unassigned" },
{ "VK_OEM_4", 0xDB, "Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the \'[{\' key" },
{ "VK_OEM_5", 0xDC, "Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the \'\\|\' key" },
{ "VK_OEM_6", 0xDD, "Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the \']}\' key" },
{ "VK_OEM_7", 0xDE, "Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the \'single-quote/double-quote\' key" },
{ "VK_OEM_8", 0xDF, "Used for miscellaneous characters; it can vary by keyboard." },
//{ "-", 0xE0, "Reserved" },
//{ "-", 0xE1, "OEM specific" },
{ "VK_OEM_102", 0xE2, "Either the angle bracket key or the backslash key on the RT 102-key keyboard" },
//{ "-", 0xE3 - E4, "OEM specific" },
{ "VK_PROCESSKEY", 0xE5, "IME PROCESS key" },
//{ "-", 0xE6, "OEM specific" },
{ "VK_PACKET", 0xE7, "Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT, SendInput, WM_KEYDOWN, and WM_KEYUP" },
//{ "-", 0xE8, "Unassigned" },
// {"-",0xE6,"OEM specific"},
{"VK_PACKET",0xE7,"Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT, SendInput, WM_KEYDOWN, and WM_KEYUP"},
// {"-",0xE8,"Unassigned"},
//{ "-", 0xE9 - F5, "OEM specific" },
{ "VK_ATTN", 0xF6, "Attn key" },
{ "VK_CRSEL", 0xF7, "CrSel key" },
{ "VK_EXSEL", 0xF8, "ExSel key" },
{ "VK_EREOF", 0xF9, "Erase EOF key" },
{ "VK_PLAY", 0xFA, "Play key" },
{ "VK_ZOOM", 0xFB, "Zoom key" },
{ "VK_NONAME", 0xFC, "Reserved" },
{ "VK_PA1", 0xFD, "PA1 key" },
{ "VK_OEM_CLEAR", 0xFE, "Clear key" }
};
+232
View File
@@ -0,0 +1,232 @@
/*++
Copyright (c) Shaul Eizikovich. All rights reserved.
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
PURPOSE.
Module Name:
public.h
Abstract:
Public header file for the vJoy project
Developpers that need to interface with vJoy need to include this file
Author:
Environment:
kernel mode and User mode
Notes:
Revision History:
--*/
#ifndef _PUBLIC_H
#define _PUBLIC_H
// Compilation directives
#define PPJOY_MODE
#undef PPJOY_MODE // Comment-out for compatibility mode
#ifdef PPJOY_MODE
#include "PPJIoctl.h"
#endif
#include <INITGUID.H> // Definitions for controlling GUID initialization
// Sideband comunication with vJoy Device
//{781EF630-72B2-11d2-B852-00C04FAD5101}
DEFINE_GUID(GUID_DEVINTERFACE_VJOY, 0x781EF630, 0x72B2, 0x11d2, 0xB8, 0x52, 0x00, 0xC0, 0x4F, 0xAD, 0x51, 0x01);
//
// Usage example:
// CreateFile(TEXT("\\\\.\\vJoy"), GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
#ifdef PPJOY_MODE
#define DEVICENAME_STRING "PPJoyIOCTL1"
#else
#define DEVICENAME_STRING "vJoy"
#endif
#define NTDEVICE_NAME_STRING "\\Device\\"DEVICENAME_STRING
#define SYMBOLIC_NAME_STRING "\\DosDevices\\"DEVICENAME_STRING
#define DOS_FILE_NAME "\\\\.\\"DEVICENAME_STRING
#define VJOY_INTERFACE L"Device_"
// Version parts
#define VER_X_ 0
#define VER_H_ 2
#define VER_M_ 0
#define VER_L_ 5
#define STRINGIFY_1(x) #x
#define STRINGIFY(x) STRINGIFY_1(x)
#define PASTE(x, y) x##y
#define MAKEWIDE(x) PASTE(L,x)
// Device Attributes
//
#define VENDOR_N_ID 0x1234
#define PRODUCT_N_ID 0xBEAD
#define VERSION_N (VER_L_ + 0x10*VER_M_ + 0x100*VER_H_ + 0x1000*VER_X_)
// Device Strings
//
#define VENDOR_STR_ID L"Shaul Eizikovich"
#define PRODUCT_STR_ID L"vJoy - Virtual Joystick"
#define SERIALNUMBER_STR MAKEWIDE(STRINGIFY(VER_H_)) L"." MAKEWIDE(STRINGIFY(VER_M_)) L"." MAKEWIDE(STRINGIFY(VER_L_))
// Function codes;
//#define LOAD_POSITIONS 0x910
//#define GETATTRIB 0x911
// #define GET_FFB_DATA 0x00222912 // METHOD_OUT_DIRECT + FILE_DEVICE_UNKNOWN + FILE_ANY_ACCESS
//#define SET_FFB_STAT 0x913 // METHOD_NEITHER
//#define GET_FFB_STAT 0x916
#define F_LOAD_POSITIONS 0x910
#define F_GETATTRIB 0x911
#define F_GET_FFB_DATA 0x912
#define F_SET_FFB_STAT 0x913
#define F_GET_FFB_STAT 0x916
#define F_GET_DEV_INFO 0x917
// IO Device Control codes;
#define IOCTL_VJOY_GET_ATTRIB CTL_CODE (FILE_DEVICE_UNKNOWN, GETATTRIB, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define LOAD_POSITIONS CTL_CODE (FILE_DEVICE_UNKNOWN, F_LOAD_POSITIONS, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define GET_FFB_DATA CTL_CODE (FILE_DEVICE_UNKNOWN, F_GET_FFB_DATA, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
#define SET_FFB_STAT CTL_CODE (FILE_DEVICE_UNKNOWN, F_SET_FFB_STAT, METHOD_NEITHER, FILE_ANY_ACCESS)
#define GET_FFB_STAT CTL_CODE (FILE_DEVICE_UNKNOWN, F_GET_FFB_STAT, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define GET_DEV_INFO CTL_CODE (FILE_DEVICE_UNKNOWN, F_GET_DEV_INFO, METHOD_BUFFERED, FILE_ANY_ACCESS)
#ifndef __HIDPORT_H__
// Copied from hidport.h
#define IOCTL_HID_SET_FEATURE 0xB0191
#define IOCTL_HID_WRITE_REPORT 0xB000F
typedef struct _HID_DEVICE_ATTRIBUTES {
ULONG Size;
//
// sizeof (struct _HID_DEVICE_ATTRIBUTES)
//
//
// Vendor ids of this hid device
//
USHORT VendorID;
USHORT ProductID;
USHORT VersionNumber;
USHORT Reserved[11];
} HID_DEVICE_ATTRIBUTES, * PHID_DEVICE_ATTRIBUTES;
#endif
// Error levels for status report
enum ERRLEVEL {INFO, WARN, ERR, FATAL, APP};
// Status report function prototype
#ifdef WINAPI
typedef BOOL (WINAPI *StatusMessageFunc)(void * output, TCHAR * buffer, enum ERRLEVEL level);
#endif
///////////////////////////////////////////////////////////////
/////////////////////// Joystick Position ///////////////////////
//
// This structure holds data that is passed to the device from
// an external application such as SmartPropoPlus.
//
// Usage example:
// JOYSTICK_POSITION iReport;
// :
// DeviceIoControl (hDevice, 100, &iReport, sizeof(HID_INPUT_REPORT), NULL, 0, &bytes, NULL)
/*
typedef struct _JOYSTICK_POSITION
{
BYTE bDevice; // Index of device. 1-based.
LONG wThrottle;
LONG wRudder;
LONG wAileron;
LONG wAxisX;
LONG wAxisY;
LONG wAxisZ;
LONG wAxisXRot;
LONG wAxisYRot;
LONG wAxisZRot;
LONG wSlider;
LONG wDial;
LONG wWheel;
LONG wAxisVX;
LONG wAxisVY;
LONG wAxisVZ;
LONG wAxisVBRX;
LONG wAxisVBRY;
LONG wAxisVBRZ;
LONG lButtons; // 32 buttons: 0x00000001 means button1 is pressed, 0x80000000 -> button32 is pressed
DWORD bHats; // Lower 4 bits: HAT switch or 16-bit of continuous HAT switch
DWORD bHatsEx1; // Lower 4 bits: HAT switch or 16-bit of continuous HAT switch
DWORD bHatsEx2; // Lower 4 bits: HAT switch or 16-bit of continuous HAT switch
DWORD bHatsEx3; // Lower 4 bits: HAT switch or 16-bit of continuous HAT switch
} JOYSTICK_POSITION, *PJOYSTICK_POSITION;
*/
// Superset of JOYSTICK_POSITION
// Extension of JOYSTICK_POSITION with Buttons 33-128 appended to the end of the structure.
typedef struct _JOYSTICK_POSITION_V2
{
/// JOYSTICK_POSITION
BYTE bDevice; // Index of device. 1-based.
LONG wThrottle;
LONG wRudder;
LONG wAileron;
LONG wAxisX;
LONG wAxisY;
LONG wAxisZ;
LONG wAxisXRot;
LONG wAxisYRot;
LONG wAxisZRot;
LONG wSlider;
LONG wDial;
LONG wWheel;
LONG wAxisVX;
LONG wAxisVY;
LONG wAxisVZ;
LONG wAxisVBRX;
LONG wAxisVBRY;
LONG wAxisVBRZ;
LONG lButtons; // 32 buttons: 0x00000001 means button1 is pressed, 0x80000000 -> button32 is pressed
DWORD bHats; // Lower 4 bits: HAT switch or 16-bit of continuous HAT switch
DWORD bHatsEx1; // Lower 4 bits: HAT switch or 16-bit of continuous HAT switch
DWORD bHatsEx2; // Lower 4 bits: HAT switch or 16-bit of continuous HAT switch
DWORD bHatsEx3; // Lower 4 bits: HAT switch or 16-bit of continuous HAT switch
/// JOYSTICK_POSITION_V2 Extenssion
LONG lButtonsEx1; // Buttons 33-64
LONG lButtonsEx2; // Buttons 65-96
LONG lButtonsEx3; // Buttons 97-128
} JOYSTICK_POSITION_V2, *PJOYSTICK_POSITION_V2;
// HID Descriptor definitions
#define HID_USAGE_X 0x30
#define HID_USAGE_Y 0x31
#define HID_USAGE_Z 0x32
#define HID_USAGE_RX 0x33
#define HID_USAGE_RY 0x34
#define HID_USAGE_RZ 0x35
#define HID_USAGE_SL0 0x36
#define HID_USAGE_SL1 0x37
#define HID_USAGE_WHL 0x38
#define HID_USAGE_POV 0x39
#endif
+2552
View File
File diff suppressed because it is too large Load Diff
+37
View File
@@ -0,0 +1,37 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33205.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "riovjoy2", "riovjoy2.vcxproj", "{960CFE0F-1508-4322-8A91-56E763A14E40}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
WinXP|x64 = WinXP|x64
WinXP|x86 = WinXP|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{960CFE0F-1508-4322-8A91-56E763A14E40}.Debug|x64.ActiveCfg = Debug|x64
{960CFE0F-1508-4322-8A91-56E763A14E40}.Debug|x64.Build.0 = Debug|x64
{960CFE0F-1508-4322-8A91-56E763A14E40}.Debug|x86.ActiveCfg = Debug|Win32
{960CFE0F-1508-4322-8A91-56E763A14E40}.Debug|x86.Build.0 = Debug|Win32
{960CFE0F-1508-4322-8A91-56E763A14E40}.Release|x64.ActiveCfg = Release|x64
{960CFE0F-1508-4322-8A91-56E763A14E40}.Release|x64.Build.0 = Release|x64
{960CFE0F-1508-4322-8A91-56E763A14E40}.Release|x86.ActiveCfg = Release|Win32
{960CFE0F-1508-4322-8A91-56E763A14E40}.Release|x86.Build.0 = Release|Win32
{960CFE0F-1508-4322-8A91-56E763A14E40}.WinXP|x64.ActiveCfg = WinXP|x64
{960CFE0F-1508-4322-8A91-56E763A14E40}.WinXP|x64.Build.0 = WinXP|x64
{960CFE0F-1508-4322-8A91-56E763A14E40}.WinXP|x86.ActiveCfg = WinXP|Win32
{960CFE0F-1508-4322-8A91-56E763A14E40}.WinXP|x86.Build.0 = WinXP|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BEB6DA97-9C84-49B2-BF49-0318C05AF72E}
EndGlobalSection
EndGlobal
+245
View File
@@ -0,0 +1,245 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="WinXP|Win32">
<Configuration>WinXP</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="WinXP|x64">
<Configuration>WinXP</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{960cfe0f-1508-4322-8a91-56e763a14e40}</ProjectGuid>
<RootNamespace>riovjoy2</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Static</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Static</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='WinXP|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Static</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='WinXP|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='WinXP|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='WinXP|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<CopyCppRuntimeToOutputDir>false</CopyCppRuntimeToOutputDir>
<CopyLocalProjectReference>false</CopyLocalProjectReference>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='WinXP|Win32'">
<CopyCppRuntimeToOutputDir>false</CopyCppRuntimeToOutputDir>
<CopyLocalProjectReference>false</CopyLocalProjectReference>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<CopyLocalProjectReference>false</CopyLocalProjectReference>
<CopyCppRuntimeToOutputDir>false</CopyCppRuntimeToOutputDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>Default</LanguageStandard>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>vJoyInterface.exp;user32.lib;Advapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>C:\Users\cyd\source\repos\riovjoy2\static_debug_vJoy;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<ProjectReference>
<UseLibraryDependencyInputs>true</UseLibraryDependencyInputs>
</ProjectReference>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<DebugInformationFormat>None</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>C:\Users\cyd\source\repos\riovjoy2\satic_release_vJoy;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>vJoyInterface.exp;user32.lib;Advapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ProjectReference>
<UseLibraryDependencyInputs>true</UseLibraryDependencyInputs>
</ProjectReference>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='WinXP|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>false</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<DebugInformationFormat>None</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>C:\Users\cyd\source\repos\riovjoy2\WinXP\vjoyinterface-x86-XPcompat;C:\WinDDK\7600.16385.1\lib\wxp\i386;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>vJoyInterface.lib;user32.lib;advapi32.lib;hid.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ProjectReference>
<UseLibraryDependencyInputs>true</UseLibraryDependencyInputs>
</ProjectReference>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='WinXP|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="riovjoy2.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="public.h" />
<ClInclude Include="SimpleIni.h" />
<ClInclude Include="vjoyinterface.h" />
</ItemGroup>
<ItemGroup>
<None Include="satic_release_vJoy\vJoyInterface.dll" />
<None Include="satic_release_vJoy\vJoyInterface.exp" />
<None Include="satic_release_vJoy\vJoyInterface.map" />
</ItemGroup>
<ItemGroup>
<Library Include="satic_release_vJoy\vJoyInterface.lib" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
+49
View File
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="riovjoy2.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="SimpleIni.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="vjoyinterface.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="public.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="static_debug_vJoy\vJoyInterface.exp">
<Filter>Resource Files</Filter>
</None>
<None Include="static_debug_vJoy\vJoyInterface.idb">
<Filter>Resource Files</Filter>
</None>
<None Include="static_debug_vJoy\vJoyInterface.pdb">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Library Include="static_debug_vJoy\vJoyInterface.lib">
<Filter>Resource Files</Filter>
</Library>
</ItemGroup>
</Project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
+7
View File
@@ -0,0 +1,7 @@
// stdafx.cpp : source file that includes just the standard includes
// riovjoy.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
+33
View File
@@ -0,0 +1,33 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include <cstdio>
#include <iostream>
#include <stdio.h>
#include <tchar.h>
#include <windows.h>
#include <basetyps.h>
#include <cfgmgr32.h>
#include <Setupapi.h>
#include <strsafe.h>
#include <Newdev.h>
#include <INITGUID.H>
#include <algorithm>
#include <array>
#include <string.h>
#include "SimpleIni.h"
#include "vjoyinterface.h"
#include "public.h"
#include "c232comm.h"
#include "CPlasma.h"
#include "CRIO.h"
#include "CRIOMAIN.h"
// TODO: reference additional headers your program requires here
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
+107
View File
@@ -0,0 +1,107 @@
// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the VJOYINTERFACE_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// VJOYINTERFACE_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#ifdef VJOYINTERFACE_EXPORTS
#define VJOYINTERFACE_API __declspec(dllexport)
#else
#define VJOYINTERFACE_API __declspec(dllimport)
#endif
///////////////////////////// vJoy device (collection) status ////////////////////////////////////////////
#ifndef VJDSTAT
#define VJDSTAT
enum VjdStat /* Declares an enumeration data type called BOOLEAN */
{
VJD_STAT_OWN, // The vJoy Device is owned by this application.
VJD_STAT_FREE, // The vJoy Device is NOT owned by any application (including this one).
VJD_STAT_BUSY, // The vJoy Device is owned by another application. It cannot be acquired by this application.
VJD_STAT_MISS, // The vJoy Device is missing. It either does not exist or the driver is down.
VJD_STAT_UNKN // Unknown
};
/* Error codes for some of the functions */
#define NO_HANDLE_BY_INDEX -1
#define BAD_PREPARSED_DATA -2
#define NO_CAPS -3
#define BAD_N_BTN_CAPS -4
#define BAD_CALLOC -5
#define BAD_BTN_CAPS -6
#define BAD_BTN_RANGE -7
#define BAD_N_VAL_CAPS -8
#define BAD_ID_RANGE -9
#define NO_SUCH_AXIS -10
/* Environment Variables */
#define INTERFACE_LOG_LEVEL "VJOYINTERFACELOGLEVEL"
#define INTERFACE_LOG_FILE "VJOYINTERFACELOGFILE"
#define INTERFACE_DEF_LOG_FILE "vJoyInterface.log"
struct DEV_INFO {
BYTE DeviceID; // Device ID: Valid values are 1-16
BYTE nImplemented; // Number of implemented device: Valid values are 1-16
BYTE isImplemented; // Is this device implemented?
BYTE MaxDevices; // Maximum number of devices that may be implemented (16)
BYTE DriverFFB; // Does this driver support FFB (False)
BYTE DeviceFFB; // Does this device support FFB (False)
} ;
typedef void (CALLBACK *RemovalCB)(BOOL, BOOL, PVOID);
#endif
extern "C" {
///////////////////////////// vJoy device (collection) Control interface /////////////////////////////////
/*
These functions allow writing feeders and other applications that interface with vJoy
It is assumed that only one vJoy top-device (= Raw PDO) exists.
This top-level device can have up to 16 siblings (=top-level Reports/collections)
Each sibling is refered to as a "vJoy Device" and is attributed a unique Report ID (Range: 1-16).
Naming convetion:
VJD = vJoy Device
rID = Report ID
*/
///// General driver data
VJOYINTERFACE_API SHORT __cdecl GetvJoyVersion(void);
VJOYINTERFACE_API BOOL __cdecl vJoyEnabled(void);
VJOYINTERFACE_API PVOID __cdecl GetvJoyProductString(void);
VJOYINTERFACE_API PVOID __cdecl GetvJoyManufacturerString(void);
VJOYINTERFACE_API PVOID __cdecl GetvJoySerialNumberString(void);
VJOYINTERFACE_API BOOL __cdecl DriverMatch(WORD * DllVer, WORD * DrvVer);
VJOYINTERFACE_API VOID __cdecl RegisterRemovalCB(RemovalCB cb, PVOID data);
///// vJoy Device properties
VJOYINTERFACE_API int __cdecl GetVJDButtonNumber(UINT rID); // Get the number of buttons defined in the specified VDJ
VJOYINTERFACE_API int __cdecl GetVJDDiscPovNumber(UINT rID); // Get the number of descrete-type POV hats defined in the specified VDJ
VJOYINTERFACE_API int __cdecl GetVJDContPovNumber(UINT rID); // Get the number of descrete-type POV hats defined in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl GetVJDAxisExist(UINT rID, UINT Axis); // Test if given axis defined in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl GetVJDAxisMax(UINT rID, UINT Axis, LONG * Max); // Get logical Maximum value for a given axis defined in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl GetVJDAxisMin(UINT rID, UINT Axis, LONG * Min); // Get logical Minimum value for a given axis defined in the specified VDJ
///// Write access to vJoy Device - Basic
VJOYINTERFACE_API BOOL __cdecl AcquireVJD(UINT rID); // Acquire the specified vJoy Device.
VJOYINTERFACE_API VOID __cdecl RelinquishVJD(UINT rID); // Relinquish the specified vJoy Device.
VJOYINTERFACE_API BOOL __cdecl UpdateVJD(UINT rID, PVOID pData); // Update the position data of the specified vJoy Device.
VJOYINTERFACE_API enum VjdStat __cdecl GetVJDStatus(UINT rID); // Get the status of the specified vJoy Device.
///// Write access to vJoy Device - Modifyiers
// This group of functions modify the current value of the position data
// They replace the need to create a structure of position data then call UpdateVJD
//// Reset functions
VJOYINTERFACE_API BOOL __cdecl ResetVJD(UINT rID); // Reset all controls to predefined values in the specified VDJ
VJOYINTERFACE_API VOID __cdecl ResetAll(void); // Reset all controls to predefined values in all VDJ
VJOYINTERFACE_API BOOL __cdecl ResetButtons(UINT rID); // Reset all buttons (To 0) in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl ResetPovs(UINT rID); // Reset all POV Switches (To -1) in the specified VDJ
// Write data
VJOYINTERFACE_API BOOL __cdecl SetAxis(LONG Value, UINT rID, UINT Axis); // Write Value to a given axis defined in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl SetBtn(BOOL Value, UINT rID, UCHAR nBtn); // Write Value to a given button defined in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl SetDiscPov(int Value, UINT rID, UCHAR nPov); // Write Value to a given descrete POV defined in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl SetContPov(DWORD Value, UINT rID, UCHAR nPov); // Write Value to a given continuous POV defined in the specified VDJ
} // extern "C"
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,107 @@
// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the VJOYINTERFACE_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// VJOYINTERFACE_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#ifdef VJOYINTERFACE_EXPORTS
#define VJOYINTERFACE_API __declspec(dllexport)
#else
#define VJOYINTERFACE_API __declspec(dllimport)
#endif
///////////////////////////// vJoy device (collection) status ////////////////////////////////////////////
#ifndef VJDSTAT
#define VJDSTAT
enum VjdStat /* Declares an enumeration data type called BOOLEAN */
{
VJD_STAT_OWN, // The vJoy Device is owned by this application.
VJD_STAT_FREE, // The vJoy Device is NOT owned by any application (including this one).
VJD_STAT_BUSY, // The vJoy Device is owned by another application. It cannot be acquired by this application.
VJD_STAT_MISS, // The vJoy Device is missing. It either does not exist or the driver is down.
VJD_STAT_UNKN // Unknown
};
/* Error codes for some of the functions */
#define NO_HANDLE_BY_INDEX -1
#define BAD_PREPARSED_DATA -2
#define NO_CAPS -3
#define BAD_N_BTN_CAPS -4
#define BAD_CALLOC -5
#define BAD_BTN_CAPS -6
#define BAD_BTN_RANGE -7
#define BAD_N_VAL_CAPS -8
#define BAD_ID_RANGE -9
#define NO_SUCH_AXIS -10
/* Environment Variables */
#define INTERFACE_LOG_LEVEL "VJOYINTERFACELOGLEVEL"
#define INTERFACE_LOG_FILE "VJOYINTERFACELOGFILE"
#define INTERFACE_DEF_LOG_FILE "vJoyInterface.log"
struct DEV_INFO {
BYTE DeviceID; // Device ID: Valid values are 1-16
BYTE nImplemented; // Number of implemented device: Valid values are 1-16
BYTE isImplemented; // Is this device implemented?
BYTE MaxDevices; // Maximum number of devices that may be implemented (16)
BYTE DriverFFB; // Does this driver support FFB (False)
BYTE DeviceFFB; // Does this device support FFB (False)
} ;
typedef void (CALLBACK *RemovalCB)(BOOL, BOOL, PVOID);
#endif
extern "C" {
///////////////////////////// vJoy device (collection) Control interface /////////////////////////////////
/*
These functions allow writing feeders and other applications that interface with vJoy
It is assumed that only one vJoy top-device (= Raw PDO) exists.
This top-level device can have up to 16 siblings (=top-level Reports/collections)
Each sibling is refered to as a "vJoy Device" and is attributed a unique Report ID (Range: 1-16).
Naming convetion:
VJD = vJoy Device
rID = Report ID
*/
///// General driver data
VJOYINTERFACE_API SHORT __cdecl GetvJoyVersion(void);
VJOYINTERFACE_API BOOL __cdecl vJoyEnabled(void);
VJOYINTERFACE_API PVOID __cdecl GetvJoyProductString(void);
VJOYINTERFACE_API PVOID __cdecl GetvJoyManufacturerString(void);
VJOYINTERFACE_API PVOID __cdecl GetvJoySerialNumberString(void);
VJOYINTERFACE_API BOOL __cdecl DriverMatch(WORD * DllVer, WORD * DrvVer);
VJOYINTERFACE_API VOID __cdecl RegisterRemovalCB(RemovalCB cb, PVOID data);
///// vJoy Device properties
VJOYINTERFACE_API int __cdecl GetVJDButtonNumber(UINT rID); // Get the number of buttons defined in the specified VDJ
VJOYINTERFACE_API int __cdecl GetVJDDiscPovNumber(UINT rID); // Get the number of descrete-type POV hats defined in the specified VDJ
VJOYINTERFACE_API int __cdecl GetVJDContPovNumber(UINT rID); // Get the number of descrete-type POV hats defined in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl GetVJDAxisExist(UINT rID, UINT Axis); // Test if given axis defined in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl GetVJDAxisMax(UINT rID, UINT Axis, LONG * Max); // Get logical Maximum value for a given axis defined in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl GetVJDAxisMin(UINT rID, UINT Axis, LONG * Min); // Get logical Minimum value for a given axis defined in the specified VDJ
///// Write access to vJoy Device - Basic
VJOYINTERFACE_API BOOL __cdecl AcquireVJD(UINT rID); // Acquire the specified vJoy Device.
VJOYINTERFACE_API VOID __cdecl RelinquishVJD(UINT rID); // Relinquish the specified vJoy Device.
VJOYINTERFACE_API BOOL __cdecl UpdateVJD(UINT rID, PVOID pData); // Update the position data of the specified vJoy Device.
VJOYINTERFACE_API enum VjdStat __cdecl GetVJDStatus(UINT rID); // Get the status of the specified vJoy Device.
///// Write access to vJoy Device - Modifyiers
// This group of functions modify the current value of the position data
// They replace the need to create a structure of position data then call UpdateVJD
//// Reset functions
VJOYINTERFACE_API BOOL __cdecl ResetVJD(UINT rID); // Reset all controls to predefined values in the specified VDJ
VJOYINTERFACE_API VOID __cdecl ResetAll(void); // Reset all controls to predefined values in all VDJ
VJOYINTERFACE_API BOOL __cdecl ResetButtons(UINT rID); // Reset all buttons (To 0) in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl ResetPovs(UINT rID); // Reset all POV Switches (To -1) in the specified VDJ
// Write data
VJOYINTERFACE_API BOOL __cdecl SetAxis(LONG Value, UINT rID, UINT Axis); // Write Value to a given axis defined in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl SetBtn(BOOL Value, UINT rID, UCHAR nBtn); // Write Value to a given button defined in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl SetDiscPov(int Value, UINT rID, UCHAR nPov); // Write Value to a given descrete POV defined in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl SetContPov(DWORD Value, UINT rID, UCHAR nPov); // Write Value to a given continuous POV defined in the specified VDJ
} // extern "C"
+107
View File
@@ -0,0 +1,107 @@
// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the VJOYINTERFACE_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// VJOYINTERFACE_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#ifdef VJOYINTERFACE_EXPORTS
#define VJOYINTERFACE_API __declspec(dllexport)
#else
#define VJOYINTERFACE_API __declspec(dllimport)
#endif
///////////////////////////// vJoy device (collection) status ////////////////////////////////////////////
#ifndef VJDSTAT
#define VJDSTAT
enum VjdStat /* Declares an enumeration data type called BOOLEAN */
{
VJD_STAT_OWN, // The vJoy Device is owned by this application.
VJD_STAT_FREE, // The vJoy Device is NOT owned by any application (including this one).
VJD_STAT_BUSY, // The vJoy Device is owned by another application. It cannot be acquired by this application.
VJD_STAT_MISS, // The vJoy Device is missing. It either does not exist or the driver is down.
VJD_STAT_UNKN // Unknown
};
/* Error codes for some of the functions */
#define NO_HANDLE_BY_INDEX -1
#define BAD_PREPARSED_DATA -2
#define NO_CAPS -3
#define BAD_N_BTN_CAPS -4
#define BAD_CALLOC -5
#define BAD_BTN_CAPS -6
#define BAD_BTN_RANGE -7
#define BAD_N_VAL_CAPS -8
#define BAD_ID_RANGE -9
#define NO_SUCH_AXIS -10
/* Environment Variables */
#define INTERFACE_LOG_LEVEL "VJOYINTERFACELOGLEVEL"
#define INTERFACE_LOG_FILE "VJOYINTERFACELOGFILE"
#define INTERFACE_DEF_LOG_FILE "vJoyInterface.log"
struct DEV_INFO {
BYTE DeviceID; // Device ID: Valid values are 1-16
BYTE nImplemented; // Number of implemented device: Valid values are 1-16
BYTE isImplemented; // Is this device implemented?
BYTE MaxDevices; // Maximum number of devices that may be implemented (16)
BYTE DriverFFB; // Does this driver support FFB (False)
BYTE DeviceFFB; // Does this device support FFB (False)
} ;
typedef void (CALLBACK *RemovalCB)(BOOL, BOOL, PVOID);
#endif
extern "C" {
///////////////////////////// vJoy device (collection) Control interface /////////////////////////////////
/*
These functions allow writing feeders and other applications that interface with vJoy
It is assumed that only one vJoy top-device (= Raw PDO) exists.
This top-level device can have up to 16 siblings (=top-level Reports/collections)
Each sibling is refered to as a "vJoy Device" and is attributed a unique Report ID (Range: 1-16).
Naming convetion:
VJD = vJoy Device
rID = Report ID
*/
///// General driver data
VJOYINTERFACE_API SHORT __cdecl GetvJoyVersion(void);
VJOYINTERFACE_API BOOL __cdecl vJoyEnabled(void);
VJOYINTERFACE_API PVOID __cdecl GetvJoyProductString(void);
VJOYINTERFACE_API PVOID __cdecl GetvJoyManufacturerString(void);
VJOYINTERFACE_API PVOID __cdecl GetvJoySerialNumberString(void);
VJOYINTERFACE_API BOOL __cdecl DriverMatch(WORD * DllVer, WORD * DrvVer);
VJOYINTERFACE_API VOID __cdecl RegisterRemovalCB(RemovalCB cb, PVOID data);
///// vJoy Device properties
VJOYINTERFACE_API int __cdecl GetVJDButtonNumber(UINT rID); // Get the number of buttons defined in the specified VDJ
VJOYINTERFACE_API int __cdecl GetVJDDiscPovNumber(UINT rID); // Get the number of descrete-type POV hats defined in the specified VDJ
VJOYINTERFACE_API int __cdecl GetVJDContPovNumber(UINT rID); // Get the number of descrete-type POV hats defined in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl GetVJDAxisExist(UINT rID, UINT Axis); // Test if given axis defined in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl GetVJDAxisMax(UINT rID, UINT Axis, LONG * Max); // Get logical Maximum value for a given axis defined in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl GetVJDAxisMin(UINT rID, UINT Axis, LONG * Min); // Get logical Minimum value for a given axis defined in the specified VDJ
///// Write access to vJoy Device - Basic
VJOYINTERFACE_API BOOL __cdecl AcquireVJD(UINT rID); // Acquire the specified vJoy Device.
VJOYINTERFACE_API VOID __cdecl RelinquishVJD(UINT rID); // Relinquish the specified vJoy Device.
VJOYINTERFACE_API BOOL __cdecl UpdateVJD(UINT rID, PVOID pData); // Update the position data of the specified vJoy Device.
VJOYINTERFACE_API enum VjdStat __cdecl GetVJDStatus(UINT rID); // Get the status of the specified vJoy Device.
///// Write access to vJoy Device - Modifyiers
// This group of functions modify the current value of the position data
// They replace the need to create a structure of position data then call UpdateVJD
//// Reset functions
VJOYINTERFACE_API BOOL __cdecl ResetVJD(UINT rID); // Reset all controls to predefined values in the specified VDJ
VJOYINTERFACE_API VOID __cdecl ResetAll(void); // Reset all controls to predefined values in all VDJ
VJOYINTERFACE_API BOOL __cdecl ResetButtons(UINT rID); // Reset all buttons (To 0) in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl ResetPovs(UINT rID); // Reset all POV Switches (To -1) in the specified VDJ
// Write data
VJOYINTERFACE_API BOOL __cdecl SetAxis(LONG Value, UINT rID, UINT Axis); // Write Value to a given axis defined in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl SetBtn(BOOL Value, UINT rID, UCHAR nBtn); // Write Value to a given button defined in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl SetDiscPov(int Value, UINT rID, UCHAR nPov); // Write Value to a given descrete POV defined in the specified VDJ
VJOYINTERFACE_API BOOL __cdecl SetContPov(DWORD Value, UINT rID, UCHAR nPov); // Write Value to a given continuous POV defined in the specified VDJ
} // extern "C"