Emuforums.com

Go Back   Emuforums.com > Handheld Emulation > iDeaS Discussion
About Us Register FAQ Members List Calendar Mark Forums Read

Login to remove all ads!
Reply
 
LinkBack Thread Tools Display Modes
Old October 20th, 2007   #41 (permalink)
VBA-M Team
 
Squall-Leonhart's Avatar
 
Join Date: Feb 2006
Location: Australia
Posts: 4,195
nope, still not, BUT, now pressing the debug button acts like pressing the triggers and start+select at the same time (quits game)
Squall-Leonhart is online now   Reply With Quote
Old October 20th, 2007   #42 (permalink)
Plugin author
 
NHervé's Avatar
 
Join Date: Jul 2007
Location: Nulle part
Posts: 413
What is the debug button for ? Where is it on the real DS ?
__________________
Pcsx2 is great emulator and Megapad is great pad plugin !!!
NHervé is offline   Reply With Quote
Old October 20th, 2007   #43 (permalink)
VBA-M Team
 
Squall-Leonhart's Avatar
 
Join Date: Feb 2006
Location: Australia
Posts: 4,195
there isn't one.

all the buttons can be assigned, but for me, x doesn't work ingame.
Squall-Leonhart is online now   Reply With Quote
Old October 20th, 2007   #44 (permalink)
THE Hentai M@ster
 
Hiei-YYH's Avatar
 
Join Date: Aug 2005
Location: MAKAI
Posts: 1,424
debug button is for developers, only available on debug nds's, don't expect to work with any commercial game.
__________________


冥界の王
My NEW Site
BEST anime ever!!

My Official Code Breaker DS Codes
Hiei-YYH is offline   Reply With Quote
Old October 20th, 2007   #45 (permalink)
Registered User
 
Join Date: Apr 2007
Location: arg
Posts: 9
Still having the same problem with the new version, no X or Y and the keyboard is not very responsive when the plugin is active.
keym is offline   Reply With Quote
Old October 20th, 2007   #46 (permalink)
Yu-Gi-Oh!&Dragon Ball FAN
 
M4yka's Avatar
 
Join Date: Feb 2007
Location: Hungary
Posts: 326
Thx for the plugin! Works great. The only problem is that I have to get used to it !
M4yka is offline   Reply With Quote
Old October 20th, 2007   #47 (permalink)
Rockman fan
 
RockmanForte's Avatar
 
Join Date: May 2002
Location: Earth!
Posts: 3,729
DsPad1.2.0. -- D-pads all directions, select, start,L,R, Y,B,A, works beautifully but I can't use X button.

New Super Mario Bros....

I use Y button to dash and to pick. The X button to dash and to pick too but didn't work. That's how I know.
__________________


CASE: EagleTech Sidewinder Gaming Tower Case w/420W Power Supply Black
OS: Windows XP Professional X64
CPU: Intel core 2 Duo Processor E8400 (2x 3.0GHz/6MB L2 Cache/1333FSB)
Processor Cooling: Thermaltake V1 CPU Cooling Fan System Kit Silent & Overclocking Proof
Graphics Card: NVIDIA GeForce 8800GT 512MB w/DVI + TV Out Video
Memory: 2048GB [1024GB X2] DDR2-800 PC6400 Memory Module Corsair-Value or Major Brand
Sound Card: 3D Premium Surround Sound Onboard

Last edited by RockmanForte; October 20th, 2007 at 13:55.
RockmanForte is offline   Reply With Quote
Old October 20th, 2007   #48 (permalink)
Plugin author
 
NHervé's Avatar
 
Join Date: Jul 2007
Location: Nulle part
Posts: 413
very strange, the plugin works fine for me.
I've Windows Vista, what's your config ?
__________________
Pcsx2 is great emulator and Megapad is great pad plugin !!!
NHervé is offline   Reply With Quote
Old October 20th, 2007   #49 (permalink)
Rockman fan
 
RockmanForte's Avatar
 
Join Date: May 2002
Location: Earth!
Posts: 3,729
I've using the Windows XP Home Edition:

Please try to test New Super Mario Bros. because of X and Y are the same buttons for pick up things and to dash accord to gamefaqs.com and Y works fine and X have no responsive.

Here:

PSX USB ADAPTER

__________________


CASE: EagleTech Sidewinder Gaming Tower Case w/420W Power Supply Black
OS: Windows XP Professional X64
CPU: Intel core 2 Duo Processor E8400 (2x 3.0GHz/6MB L2 Cache/1333FSB)
Processor Cooling: Thermaltake V1 CPU Cooling Fan System Kit Silent & Overclocking Proof
Graphics Card: NVIDIA GeForce 8800GT 512MB w/DVI + TV Out Video
Memory: 2048GB [1024GB X2] DDR2-800 PC6400 Memory Module Corsair-Value or Major Brand
Sound Card: 3D Premium Surround Sound Onboard

Last edited by RockmanForte; October 20th, 2007 at 14:10.
RockmanForte is offline   Reply With Quote
Old October 20th, 2007   #50 (permalink)
VBA-M Team
 
Squall-Leonhart's Avatar
 
Join Date: Feb 2006
Location: Australia
Posts: 4,195
Windows XP
Microsoft Xbox S-type using XBCD 0.2.6

even if i assign the x button to another button that works (such as the one y is assigned to) it doesn't work.

i was able to get it to work before, somehow, though i can't for the life of me work out how, or repeat it.

the way i know somethings wrong, is that when the plugin is enabled, the x button assigned in the main input settings doesn't work either.

hey Nherve, have you tried

Code:
            case 0: //X
                val&=~(1<<15);
                break;
            case 1: //Y
                val&=~(1<<17);
                break;
            case 12: //Debug
                val&=(1<<18);
                break;
            default: //Others
                val&=~(1<<(i-2));
                break;
            }
        }else{
            switch(i){
            case 0: //X
                val|=(1<<15);
                break;
            case 1: //Y
                val|=(1<<17);
                break;
            case 12: //Debug
                val|=(1<<18);
                break;
            default: //Others
                val|=(1<<(i-2));
                break;

Last edited by Squall-Leonhart; October 20th, 2007 at 14:57. Reason: Automerged Doublepost
Squall-Leonhart is online now   Reply With Quote
Old October 20th, 2007   #51 (permalink)
Plugin author
 
NHervé's Avatar
 
Join Date: Jul 2007
Location: Nulle part
Posts: 413
rockmanforte : I've tested new super mario bros and strangely my plugin works fine.
Squall-Leonhart : i will test it. I see you have visited my sources.
__________________
Pcsx2 is great emulator and Megapad is great pad plugin !!!
NHervé is offline   Reply With Quote
Old October 20th, 2007   #52 (permalink)
Rockman fan
 
RockmanForte's Avatar
 
Join Date: May 2002
Location: Earth!
Posts: 3,729
NHerve,

you tried X button that use for dash and pick up the same way for Y button ?

If so, what can I do ? Everything's working fine but not X button. No responsive.
__________________


CASE: EagleTech Sidewinder Gaming Tower Case w/420W Power Supply Black
OS: Windows XP Professional X64
CPU: Intel core 2 Duo Processor E8400 (2x 3.0GHz/6MB L2 Cache/1333FSB)
Processor Cooling: Thermaltake V1 CPU Cooling Fan System Kit Silent & Overclocking Proof
Graphics Card: NVIDIA GeForce 8800GT 512MB w/DVI + TV Out Video
Memory: 2048GB [1024GB X2] DDR2-800 PC6400 Memory Module Corsair-Value or Major Brand
Sound Card: 3D Premium Surround Sound Onboard
RockmanForte is offline   Reply With Quote
Old October 20th, 2007   #53 (permalink)
VBA-M Team
 
Squall-Leonhart's Avatar
 
Join Date: Feb 2006
Location: Australia
Posts: 4,195
it is very strange that it works on Vista, as vista has the same dinput structure as XP.

how strange, when the input plugin is enabled, using the assigned buttons on the keyboard ends up being like button turbo mode lol.

it is definitely cutting the emulators ability to use x off.

maybe lino will have a better idea as to why :\

Last edited by Squall-Leonhart; October 20th, 2007 at 16:14.
Squall-Leonhart is online now   Reply With Quote
Old October 20th, 2007   #54 (permalink)
Rockman fan
 
RockmanForte's Avatar
 
Join Date: May 2002
Location: Earth!
Posts: 3,729
Want me to copy inside the config setting so you can take a look at it about the x button problem ?
__________________


CASE: EagleTech Sidewinder Gaming Tower Case w/420W Power Supply Black
OS: Windows XP Professional X64
CPU: Intel core 2 Duo Processor E8400 (2x 3.0GHz/6MB L2 Cache/1333FSB)
Processor Cooling: Thermaltake V1 CPU Cooling Fan System Kit Silent & Overclocking Proof
Graphics Card: NVIDIA GeForce 8800GT 512MB w/DVI + TV Out Video
Memory: 2048GB [1024GB X2] DDR2-800 PC6400 Memory Module Corsair-Value or Major Brand
Sound Card: 3D Premium Surround Sound Onboard
RockmanForte is offline   Reply With Quote
Old October 20th, 2007   #55 (permalink)
Plugin author
 
NHervé's Avatar
 
Join Date: Jul 2007
Location: Nulle part
Posts: 413
I tested with X and A buttons to jump and Y and B buttons to dash.
My plugin uses SDL, not directinput.
New version 1.3.0, go to first post to get it. Hope it will definitively solve bugs.
__________________
Pcsx2 is great emulator and Megapad is great pad plugin !!!
NHervé is offline   Reply With Quote
Old October 20th, 2007   #56 (permalink)
BLEACH CORP.®
 
MASTERXZ's Avatar
 
Join Date: Jul 2006
Location: Panamá
Posts: 37
Exlent Great Plugin works perfect for me thanks for the hard work nad keep goin.
__________________
..::BLEACH CORPORATION ®::..
MASTERXZ is offline   Reply With Quote
Old October 20th, 2007   #57 (permalink)
VBA-M Team
 
Squall-Leonhart's Avatar
 
Join Date: Feb 2006
Location: Australia
Posts: 4,195
hasn't solved anything unfortunately.

ok,
1.0.0
X button works, Diagonals don't.

Diagonals work if X or Y is pressed

onto 1.1.0+
X button no longer works, but Y does, Dpad works now.

Code:
//DsPad Plugin by NHervé.
//Copyright NHervé 2007
//Distributed under the terms of GNU license.
#include <objbase.h>
#include <initguid.h>
#ifdef DEFINE_GUID
DEFINE_GUID(PLUGGUID, 0x2E1E8E48, 0x4AE9, 0x4BAA, 0x89, 0x93, 0x1E, 0xBC, 0xAB, 0xF6, 0xAE, 0xDE);
#endif
#include <windows.h>
#include <windowsx.h>
#include <stdio.h>
#include <sdl/sdl.h>
#include <sdl/sdl_joystick.h>
#include <sdl/sdl_error.h>
#include "resource.h"
#include "DsPad.h"

#pragma comment(lib, "comctl32.lib")
#pragma comment(lib, "sdl.lib")
#pragma comment(lib, "sdlmain.lib")

HINSTANCE hInst;
SDL_Joystick *joy[4]; //4 joysticks max

void OpenSDL();
void LoadConf();

void Message(char *txt, ...){
    va_list list;
    char tmp[512];
    va_start(list, txt);
    vsprintf(tmp, txt, list);
    va_end(list);
    MessageBox(0, tmp, "DsPad Plugin", 0);
}

void SetEditText(HWND edit, char *txt, ...){
    va_list list;
    char tmp[512];
    va_start(list, txt);
    vsprintf(tmp, txt, list);
    va_end(list);
    SetWindowText(edit, tmp);
}

//Return plugin info to iDeaS.

DWORD __stdcall GetInfoFunc(LPGETPLUGININFO info){    
    info->dwType=PIT_PAD;
    strcpy((char *)info->pszText, "DsPad Input Plugin 1.3.0");
    info->guidID=PLUGGUID;
    OpenSDL();
    return 1;
}

//

BOOL __stdcall SetInfoFunc(LPSETPLUGININFO info){
    //info->lParam is a hwnd
    return TRUE;
}

/*
4000136h - NDS7 - EXTKEYIN - Key X/Y Input (R) HIWORD
  Bit    Expl.
  0      Button X     (0=Pressed, 1=Released)
  1      Button Y     (0=Pressed, 1=Released)
  2      DEBUG button (0=Pressed, 1=Released/None such) 0x8 in ideas

4000130h - KEYINPUT - Key Status (R) LOWORD

  Bit   Expl.
  0     Button A        (0=Pressed, 1=Released)
  1     Button B        (etc.)
  2     Select          (etc.)
  3     Start           (etc.)
  4     Right           (etc.)
  5     Left            (etc.)
  6     Up              (etc.)
  7     Down            (etc.)
  8     Button R        (etc.)
  9     Button L        (etc.)
  10-15 Not used
  *value=loword|hiword
*/

int flag=0;

u32 __stdcall RunFunc(u32 *value){
    int key;
    unsigned char str[256];
    u32 val;
    if(!flag){LoadConf();flag=1;}
    memset(str, 0, 256);
    GetKeyboardState(str);
    for(key=0; key<256; key++)
    {
        if(str[key]&0x80)break;
    }
    SDL_JoystickUpdate();
    for(int i=0; i<=12; i++){
        if(conf.keys.type[i]==BT_KEY && key==conf.keys.num[i] && key<256 || 
            conf.keys.type[i]==BT_JOYBTN && SDL_JoystickGetButton(joy[conf.keys.index[i]-1], conf.keys.num[i]-1)!=0 ||
            conf.keys.type[i]==BT_JOYPOV && SDL_JoystickGetHat(joy[conf.keys.index[i]-1], conf.keys.num[i]-1)==conf.keys.dir[i] ||
            conf.keys.type[i]==BT_JOYAXIS && (SDL_JoystickGetAxis(joy[conf.keys.index[i]-1], conf.keys.num[i]-1)<=-conf.axisthresh && conf.keys.dir[i]==1 || SDL_JoystickGetAxis(joy[conf.keys.index[i]-1], conf.keys.num[i]-1)>=conf.axisthresh && conf.keys.dir[i]==2)){
            switch(i){
            case 0: //X
                val&=~(0<<16);
                break;
            case 1: //Y
                val&=~(0<<17);
                break;
            case 12: //Debug
                val&=~(0<<18);
                break;
            default: //Others
                val&=~(0<<(i-2));
                break;
            }
        //    Message("%x", HIWORD(val));
        }else{
            switch(i){
            case 0: //X
                val|=(1<<16);
                break;
            case 1: //Y
                val|=(1<<17);
                break;
            case 12: //Debug
                val|=(1<<18);
                break;
            default: //Others
                val|=(1<<(i-2));
                break;
            }
        }
    }
    *value=val;
    return 1; //NonZero so iDeaS accepts the value
}

//Config

void SaveConf(){
    FILE *cfg=NULL;
    int i;    
    cfg=fopen("DsPad.ini", "w");
    if(cfg==NULL){
        Message("Error %i while opening config file", GetLastError());
        return;
    }
    for(i=0; i<=12; i++){
        fprintf(cfg, "Btn%i_type=%i\n", i, conf.keys.type[i]);
        fprintf(cfg, "Btn%i_num=%i\n", i, conf.keys.num[i]);
        fprintf(cfg, "Btn%i_index=%i\n", i, conf.keys.index[i]);
        fprintf(cfg, "Btn%i_dir=%i\n", i, conf.keys.dir[i]);
    }
    fprintf(cfg, "Axis sensitivity=%i\n", conf.axisthresh);
    fclose(cfg);
}

void LoadConf(){
    FILE *cfg=NULL;
    int i;
    int unused=0;
    cfg=fopen("DsPad.ini", "r");
    if(cfg==NULL){ //No config file ? Let's create it.
        CreateFile("DsPad.ini", GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, 0, NULL);
        conf.axisthresh=1000;
        SaveConf();
        return;
    }
    for(i=0; i<=12; i++){
        fscanf(cfg, "Btn%i_type=%i\n", &unused, &conf.keys.type[i]);
        fscanf(cfg, "Btn%i_num=%i\n", &unused, &conf.keys.num[i]);
        fscanf(cfg, "Btn%i_index=%i\n", &unused, &conf.keys.index[i]);
        fscanf(cfg, "Btn%i_dir=%i\n", &unused, &conf.keys.dir[i]);
    }
    fscanf(cfg, "Axis sensitivity=%i\n", &conf.axisthresh);
    fclose(cfg);
}

//Fill the property page.

void FillPropPage(HWND hWnd){
    int i, j;
    char keyName[21];
    int key=0;
    ComboBox_AddString(GetDlgItem(hWnd, IDC_AXISTHR), "High");
    ComboBox_AddString(GetDlgItem(hWnd, IDC_AXISTHR), "Medium");
    ComboBox_AddString(GetDlgItem(hWnd, IDC_AXISTHR), "Low");
    ComboBox_SetCurSel(GetDlgItem(hWnd, IDC_AXISTHR), (conf.axisthresh/500)-1);
    for(i=IDC_EBX, j=0; i<=IDC_EBDEBUG, j<=12; i+=2, j++){
        switch(conf.keys.type[j]){
        case BT_NONE:
            SetEditText(GetDlgItem(hWnd, i), "None");
            break;
        case BT_KEY:
            key=conf.keys.num[j];
            if(key>=0x30 && key<=0x39 || key>=0x25 && key<=0x28 || key>=0x21 && key<=0x24 || key>=0x29 && key<=0x2f)
            {
                GetKeyNameText(MapVirtualKey(key, 0)<<16|1<<24, keyName, sizeof(keyName));
            }else{
                GetKeyNameText(MapVirtualKey(key, 0)<<16, keyName, sizeof(keyName));
            }
            SetEditText(GetDlgItem(hWnd, i), "%s", keyName);
            break;
        case BT_JOYBTN:
            SetEditText(GetDlgItem(hWnd, i), "J%i.B%i", conf.keys.index[j], conf.keys.num[j]);
            break;
        case BT_JOYPOV:
            switch(conf.keys.dir[j]){
            case 1: //Up
                SetEditText(GetDlgItem(hWnd, i), "J%i.P%i.Up", conf.keys.index[j], conf.keys.num[j]);
                break;
            case 2: //Right
                SetEditText(GetDlgItem(hWnd, i), "J%i.P%i.Right", conf.keys.index[j], conf.keys.num[j]);
                break;
            case 4: //Down
                SetEditText(GetDlgItem(hWnd, i), "J%i.P%i.Down", conf.keys.index[j], conf.keys.num[j]);
                break;
            case 8: //Left
                SetEditText(GetDlgItem(hWnd, i), "J%i.P%i.Left", conf.keys.index[j], conf.keys.num[j]);
                break;
            }
            break;
        case BT_JOYAXIS:
            switch(conf.keys.dir[j]){
            case 1: //Min
                SetEditText(GetDlgItem(hWnd, i), "J%i.A%i.Min", conf.keys.index[j], conf.keys.num[j]);
                break;
            case 2: //Max
                SetEditText(GetDlgItem(hWnd, i), "J%i.A%i.Max", conf.keys.index[j], conf.keys.num[j]);
                break;
            }
            break;
        }
    }
}

//Procedure of the property page.

static int disabled=0;

BOOL CfgDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam){
    unsigned char str[256];
    int key;
    int i, j;
    int a, b;
    char keyName[21];
    switch(uMsg){
    case WM_INITDIALOG:
        flag=0;
        LoadConf();
        FillPropPage(hWnd);
        return TRUE;
    case WM_TIMER:
        memset(str, 0, 256);
        GetKeyboardState(str);
        for(key=0; key<256; key++)
        {
            if(str[key]&0x80)break;
        }
        if(key==8){
            for(i=IDC_BX, j=0; i<=IDC_BDEBUG, j<=12; i+=2, j++){
                if(i==disabled){
                    conf.keys.type[j]=BT_NONE;
                    conf.keys.num[j]=0;
                    conf.keys.index[j]=0;
                    conf.keys.dir[j]=0;
                    SaveConf();
                    SetEditText(GetDlgItem(hWnd, disabled+1), "None");
                }
            }
            KillTimer(hWnd, 0x80);
            EnableWindow(GetDlgItem(hWnd, disabled), TRUE);
            return TRUE;
        }else if(key<256 && key>2){
            if(key>=0x30 && key<=0x39 || key>=0x25 && key<=0x28 || key>=0x21 && key<=0x24 || key>=0x29 && key<=0x2f)
            {
                GetKeyNameText(MapVirtualKey(key, 0)<<16|1<<24, keyName, sizeof(keyName));
            }else{
                GetKeyNameText(MapVirtualKey(key, 0)<<16, keyName, sizeof(keyName));
            }
            for(i=IDC_BX, j=0; i<=IDC_BDEBUG, j<=12; i+=2, j++){
                if(i==disabled){
                    conf.keys.type[j]=BT_KEY;
                    conf.keys.num[j]=key;
                    conf.keys.index[j]=0;
                    conf.keys.dir[j]=0;
                    SaveConf();
                    SetEditText(GetDlgItem(hWnd, disabled+1), "%s", keyName);
                }
            }
            KillTimer(hWnd, 0x80);
            EnableWindow(GetDlgItem(hWnd, disabled), TRUE);
            return TRUE;
        }
        //Joystick support.
        SDL_JoystickUpdate();
        for(a=1; a<=SDL_NumJoysticks(); a++){
            for(b=1; b<=SDL_JoystickNumButtons(joy[a-1]); b++){
                if(SDL_JoystickGetButton(joy[a-1], b-1)!=0){
                    for(i=IDC_BX, j=0; i<=IDC_BDEBUG, j<=12; i+=2, j++){
                        if(i==disabled){
                            conf.keys.type[j]=BT_JOYBTN;
                            conf.keys.num[j]=b;
                            conf.keys.index[j]=a;
                            conf.keys.dir[j]=0;
                            SaveConf();
                            SetEditText(GetDlgItem(hWnd, disabled+1), "J%i.B%i", a, b);
                        }
                    }
                    KillTimer(hWnd, 0x80);
                    EnableWindow(GetDlgItem(hWnd, disabled), TRUE);
                    return TRUE;
                }
            }
            for(b=1; b<=SDL_JoystickNumHats(joy[a-1]); b++){
                if(SDL_JoystickGetHat(joy[a-1], b-1)!=0){
                    for(i=IDC_BX, j=0; i<=IDC_BDEBUG, j<=12; i+=2, j++){
                        if(i==disabled){
                            conf.keys.type[j]=BT_JOYPOV;
                            conf.keys.num[j]=b;
                            conf.keys.index[j]=a;
                            conf.keys.dir[j]=SDL_JoystickGetHat(joy[a-1], b-1);
                            SaveConf();
                            switch(SDL_JoystickGetHat(joy[a-1], b-1)){
                            case 1: //Up
                                SetEditText(GetDlgItem(hWnd, disabled+1), "J%i.P%i.Up", a, b);
                                break;
                            case 2: //Right
                                SetEditText(GetDlgItem(hWnd, disabled+1), "J%i.P%i.Right", a, b);
                                break;
                            case 4: //Down
                                SetEditText(GetDlgItem(hWnd, disabled+1), "J%i.P%i.Down", a, b);
                                break;
                            case 8: //Left
                                SetEditText(GetDlgItem(hWnd, disabled+1), "J%i.P%i.Left", a, b);
                                break;
                            }
                        }
                    }
                    KillTimer(hWnd, 0x80);
                    EnableWindow(GetDlgItem(hWnd, disabled), TRUE);
                    return TRUE;
                }
            }
            for(b=1; b<=SDL_JoystickNumAxes(joy[a-1]); b++){
                if(SDL_JoystickGetAxis(joy[a-1], b-1)<=-conf.axisthresh){
                    for(i=IDC_BX, j=0; i<=IDC_BDEBUG, j<=12; i+=2, j++){
                        if(i==disabled){
                            conf.keys.type[j]=BT_JOYAXIS;
                            conf.keys.num[j]=b;
                            conf.keys.index[j]=a;
                            conf.keys.dir[j]=1;
                            SaveConf();
                            SetEditText(GetDlgItem(hWnd, disabled+1), "J%i.A%i.Min", a, b);
                        }
                    }
                    KillTimer(hWnd, 0x80);
                    EnableWindow(GetDlgItem(hWnd, disabled), TRUE);
                    return TRUE;
                }else if(SDL_JoystickGetAxis(joy[a-1], b-1)>=conf.axisthresh){
                    for(i=IDC_BX, j=0; i<=IDC_BDEBUG, j<=12; i+=2, j++){
                        if(i==disabled){
                            conf.keys.type[j]=BT_JOYAXIS;
                            conf.keys.num[j]=b;
                            conf.keys.index[j]=a;
                            conf.keys.dir[j]=2;
                            SaveConf();
                            SetEditText(GetDlgItem(hWnd, disabled+1), "J%i.A%i.Max", a, b);
                        }
                    }
                    KillTimer(hWnd, 0x80);
                    EnableWindow(GetDlgItem(hWnd, disabled), TRUE);
                    return TRUE;
                }
            }
        }
        return FALSE;
    case WM_COMMAND:
        if(LOWORD(wParam)==IDC_AXISTHR){
            conf.axisthresh=(ComboBox_GetCurSel((HWND)lParam)+1)*500;
            SaveConf();
            return TRUE;
        }else if(LOWORD(wParam)==IDC_SAVE){
            SaveConf();
        }
        for(i=IDC_BX; i<=IDC_BDEBUG; i+=2){
            if(LOWORD(wParam)==i){
                if(disabled)EnableWindow(GetDlgItem(hWnd, disabled), TRUE);
                disabled=wParam;
                EnableWindow((HWND)lParam, FALSE);
                SetTimer(hWnd, 0x80, 10, NULL);
                return TRUE;
            }
        }
        return TRUE;
    }
    return FALSE;
}

//Add a property page for the plugin.

BOOL __stdcall SetPropertyFunc(LPSETPROPPLUGIN prop){
    PROPSHEETPAGE Psp={NULL};
    HPROPSHEETPAGE hPsp;
    Psp.dwSize=sizeof(PROPSHEETPAGE);
    Psp.dwFlags=PSP_DEFAULT|PSP_USETITLE;
    Psp.hInstance=hInst;
    Psp.pfnDlgProc=(DLGPROC)CfgDlgProc;
    Psp.pszTemplate=MAKEINTRESOURCE(IDD_CFG);
    Psp.pszTitle="DsPad Plugin Config";
    hPsp=CreatePropertySheetPage(&Psp);
    if(hPsp==NULL)return FALSE;
    return PropSheet_AddPage((HWND)prop->hwndOwner, hPsp);
}

//SDL open && close

void OpenSDL(){
    SDL_Init(SDL_INIT_JOYSTICK);
    for(int i=1; i<=SDL_NumJoysticks(); i++){
        if(i<=4 && !SDL_JoystickOpened(i-1))joy[i-1]=SDL_JoystickOpen(i-1);
        if(!joy[i-1] || !SDL_JoystickOpened(i-1))Message("Could not open joystick %i.\n Error %i", i, SDL_GetError());
    }
}

void CloseSDL(){
    for(int i=1; i<=SDL_NumJoysticks(); i++){
        if(i<=4 && SDL_JoystickOpened(i-1))SDL_JoystickClose(joy[i-1]);
    }
    SDL_Quit();
}

//Dll Entry

BOOL APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID Reserved){
    switch(dwReason){
    case DLL_PROCESS_ATTACH:
        hInst=hInstance;
        LoadConf();
        return TRUE;
    case DLL_PROCESS_DETACH:
        CloseSDL();
        return TRUE;
    }
    return FALSE;
}
i'll work through the differing sources until its fixed >.<
Squall-Leonhart is online now   Reply With Quote
Old October 20th, 2007   #58 (permalink)
Plugin author
 
NHervé's Avatar
 
Join Date: Jul 2007
Location: Nulle part
Posts: 413
glad to hear it, thanks.
__________________
Pcsx2 is great emulator and Megapad is great pad plugin !!!
NHervé is offline   Reply With Quote
Old October 20th, 2007   #59 (permalink)
Rockman fan
 
RockmanForte's Avatar
 
Join Date: May 2002
Location: Earth!
Posts: 3,729
Quote:
Originally Posted by NHervé View Post
I tested with X and A buttons to jump and Y and B buttons to dash.
My plugin uses SDL, not directinput.
New version 1.3.0, go to first post to get it. Hope it will definitively solve bugs.
Yes, I uses SDL because I already know, not directinput and guess what ? It works!!!!! You are the best!!!!!
__________________


CASE: EagleTech Sidewinder Gaming Tower Case w/420W Power Supply Black
OS: Windows XP Professional X64
CPU: Intel core 2 Duo Processor E8400 (2x 3.0GHz/6MB L2 Cache/1333FSB)
Processor Cooling: Thermaltake V1 CPU Cooling Fan System Kit Silent & Overclocking Proof
Graphics Card: NVIDIA GeForce 8800GT 512MB w/DVI + TV Out Video
Memory: 2048GB [1024GB X2] DDR2-800 PC6400 Memory Module Corsair-Value or Major Brand
Sound Card: 3D Premium Surround Sound Onboard
RockmanForte is offline   Reply With Quote