<commit_before>#include <sl.h>
#include "push.h"


USB_DEVICES KnownDevices[] = {
    { L"USB\\Vid_054c&Pid_0268", L"Sony PlayStation 3 Controller" },
    { L"USB\\Vid_0A12&Pid_0001", L"TRENDnet TBW-106UB Bluetooth Adapter" },
    { L"USB\\Vid_0B05&Pid_17CB", L"ASUS USB-BT400 Bluetooth Adapter" }
    // Add more devices to search for here
};


void GetControllerMappingFile( wchar_t* GameName, wchar_t* Buffer )
{
    wchar_t *dot;
    wchar_t batchFile[260];

    String_Copy(batchFile, L"mij\\");
    String_Concatenate(batchFile, GameName);

    dot = String_FindLastChar(batchFile, '.');

    if (dot)
        String_Copy(dot, L".map");
    else
        String_Concatenate(batchFile, L".map");

    String_Copy(Buffer, batchFile);
}


void GetSettingsFile( wchar_t* GameName, wchar_t* Buffer )
{
    wchar_t *dot;
    wchar_t batchFile[260];

    String_Copy(batchFile, L"mij\\");
    String_Concatenate(batchFile, GameName);

    dot = String_FindLastChar(batchFile, '.');

    if (dot)
        String_Copy(dot, L".mij");
    else
        String_Concatenate(batchFile, L".mij");

    String_Copy(Buffer, batchFile);
}


void SetMacro(UINT8 Count, MOTIONINJOY_MACRO* Macro);
void InstallDriver(HANDLE DeviceInformation, SP_DEVINFO_DATA* DeviceData);
void GetDeviceDetail(HANDLE DeviceInformation, SP_DEVINFO_DATA* DeviceData);


WORD SomeMacro[6] = {
    0x0214, //D-Pad Up
    0x0216, //D-Pad Down
    0x0215, //D-Pad Right
    0x0217, //D-Pad Left
    0x0215, //D-Pad Right
    0x0308  //E
};


VOID Mij_SetButton( MOTIONINJOY_BUTTON_MAP* ButtonMapping )
{
    HANDLE driverHandle;
    IO_STATUS_BLOCK isb;
    MOTIONINJOY_APP_OPTION options;

    File_Create(
        &driverHandle,
        L"\\\\.\\MIJFilter",
        SYNCHRONIZE | FILE_READ_DATA | FILE_WRITE_DATA,
        FILE_SHARE_READ | FILE_SHARE_WRITE,
        FILE_OPEN,
        FILE_SYNCHRONOUS_IO_NONALERT,
        NULL
        );

    Memory_Clear(&options, sizeof(MOTIONINJOY_APP_OPTION));

    options.CommonOption.mode = DirectInput;
    options.CommonOption.LED = 129;
    options.CommonOption.AutoOff_timeout = 0x80 | /*PushSharedMemory->ControllerTimeout*/60;
    options.CommonOption.Deadzone_LStick_X = 10;
    options.CommonOption.Deadzone_LStick_Y = 10;

    options.InputOption.Duration = 100;
    options.InputOption.Interval = 400;

    Memory_Copy(options.InputOption.Maping, ButtonMapping, 96);

    NtDeviceIoControlFile(driverHandle, NULL, NULL, NULL, &isb, IOCTL_MIJ_SET_CONFIG_OPTIONS, &options, 256, NULL, 0);
    File_Close(driverHandle);
}


VOID Mij_SetProfile( WCHAR* GameName )
{<commit_msg>lower idle timer to 10 minutes<commit_after>#include <sl.h>
#include "push.h"


USB_DEVICES KnownDevices[] = {
    { L"USB\\Vid_054c&Pid_0268", L"Sony PlayStation 3 Controller" },
    { L"USB\\Vid_0A12&Pid_0001", L"TRENDnet TBW-106UB Bluetooth Adapter" },
    { L"USB\\Vid_0B05&Pid_17CB", L"ASUS USB-BT400 Bluetooth Adapter" }
    // Add more devices to search for here
};


void GetControllerMappingFile( wchar_t* GameName, wchar_t* Buffer )
{
    wchar_t *dot;
    wchar_t batchFile[260];

    String_Copy(batchFile, L"mij\\");
    String_Concatenate(batchFile, GameName);

    dot = String_FindLastChar(batchFile, '.');

    if (dot)
        String_Copy(dot, L".map");
    else
        String_Concatenate(batchFile, L".map");

    String_Copy(Buffer, batchFile);
}


void GetSettingsFile( wchar_t* GameName, wchar_t* Buffer )
{
    wchar_t *dot;
    wchar_t batchFile[260];

    String_Copy(batchFile, L"mij\\");
    String_Concatenate(batchFile, GameName);

    dot = String_FindLastChar(batchFile, '.');

    if (dot)
        String_Copy(dot, L".mij");
    else
        String_Concatenate(batchFile, L".mij");

    String_Copy(Buffer, batchFile);
}


void SetMacro(UINT8 Count, MOTIONINJOY_MACRO* Macro);
void InstallDriver(HANDLE DeviceInformation, SP_DEVINFO_DATA* DeviceData);
void GetDeviceDetail(HANDLE DeviceInformation, SP_DEVINFO_DATA* DeviceData);


WORD SomeMacro[6] = {
    0x0214, //D-Pad Up
    0x0216, //D-Pad Down
    0x0215, //D-Pad Right
    0x0217, //D-Pad Left
    0x0215, //D-Pad Right
    0x0308  //E
};


VOID Mij_SetButton( MOTIONINJOY_BUTTON_MAP* ButtonMapping )
{
    HANDLE driverHandle;
    IO_STATUS_BLOCK isb;
    MOTIONINJOY_APP_OPTION options;

    File_Create(
        &driverHandle,
        L"\\\\.\\MIJFilter",
        SYNCHRONIZE | FILE_READ_DATA | FILE_WRITE_DATA,
        FILE_SHARE_READ | FILE_SHARE_WRITE,
        FILE_OPEN,
        FILE_SYNCHRONOUS_IO_NONALERT,
        NULL
        );

    Memory_Clear(&options, sizeof(MOTIONINJOY_APP_OPTION));

    options.CommonOption.mode = DirectInput;
    options.CommonOption.LED = 129;
    options.CommonOption.AutoOff_timeout = 0x80 | /*PushSharedMemory->ControllerTimeout*/10; //minutes
    options.CommonOption.Deadzone_LStick_X = 10;
    options.CommonOption.Deadzone_LStick_Y = 10;

    options.InputOption.Duration = 100;
    options.InputOption.Interval = 400;

    Memory_Copy(options.InputOption.Maping, ButtonMapping, 96);

    NtDeviceIoControlFile(driverHandle, NULL, NULL, NULL, &isb, IOCTL_MIJ_SET_CONFIG_OPTIONS, &options, 256, NULL, 0);
    File_Close(driverHandle);
}


VOID Mij_SetProfile( WCHAR* GameName )
{
{'fraction_non_alphanumeric': 0.11570247933884298, 'fraction_numerical': 0.03421103209686719, 'mean_word_length': 3.6012378426171527, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '200342', 'n_tokens_mistral': 2047, 'n_tokens_neox': 1875, 'n_words': 342}