Add rayman2 source files

This commit is contained in:
2024-09-18 02:33:44 +08:00
parent bcc093f8ed
commit fb036c54fd
14339 changed files with 2596224 additions and 0 deletions

View File

@@ -0,0 +1,210 @@
/*=========================================================================
* IPT_Anal.c :
* Analyse entry
*
* (c) Ubi Studios 1997
*=======================================================================*/
#include <limits.h>
#include "IPT_CPA.h"
#include "IPT_Hdl.h"
#define D_IPT_Input_StructureDefine
#include "IPT_KDef.h"
#include "IPT_Str.h"
#include "ErrIPT.h"
#define D_IPT_DefineIsKeyWordValid
#include "IPT_Kwan.h"
#undef D_IPT_DefineIsKeyWordValid
#undef D_IPT_Input_StructureDefine
#include "IPT_Hist.h"
#include "IPT_Def.h"
#include "IPT_Anal.h"
/* ANNECY AV DEMO {*/
#ifndef U64
int IPT_g_bAtLeastOneActionIsValidated;
#endif
/* END ANNECY AV }*/
#ifdef U64
#include "TMP.h" /* for demo player*/
#include "u_dma.h" /* idem*/
#include "Input_s.h"
/*************************************************************************/
/* 007*/
#endif
#include "acp_driver.h"
#ifndef M_CheckPointer
#define M_CheckPointer(a)
#endif /* M_CheckPointer */
/*#ifdef U64_DEMO_RECORDER
unsigned long TabDemoRecord[C_MaxDemoEntry*C_NbCodedEntry];
#else
extern char _DemoDataSegmentRomStart[];
extern char _DemoDataSegmentRomEnd[];
unsigned long* TabDemoRecord=NULL;
#endif
short NbDemoEntry;
char IPT_DemoMode = IPT_M_DemoStopMode;*/
/* ANNECY AV {*/
extern IPT_tdxHandleToEntryElement g_h_ActualEntryInput;
extern IPT_tdxHandleToKeyWordElement IPT_g_hNextParameter;
INLINE
unsigned char IPT_fn_bIsEntryActionValid(IPT_tdxHandleToEntryElement _hEntryElement)
{
g_h_ActualEntryInput = _hEntryElement;
/* g_h_ActualEntryInput -> scAnalogicValue = 0;*/
g_h_ActualEntryInput->xAnalogicValue = 0.0f;
/* '=' is not an error*/
IPT_g_hNextParameter = &_hEntryElement->d_stKeyWordElementArray[0];
if (IPT_g_hNextParameter!=NULL)
return (IPT_fn_bIsKeyWordValid( IPT_g_hNextParameter ));
else
return (IPT_C_FALSE);
}
/* END ANNECY AV }*/
/*************************************************************************/
unsigned char IPT_fn_bIsJustValidated(IPT_tdxHandleToEntryElement _hEntryElement)
{
return((_hEntryElement->lState==1)?IPT_C_TRUE:IPT_C_FALSE);
}
/*************************************************************************/
unsigned char IPT_fn_bIsValidated(IPT_tdxHandleToEntryElement _hEntryElement)
{
/*XB*/
M_CheckPointer(_hEntryElement);
/*End XB*/
return((_hEntryElement->lState>0)?IPT_C_TRUE:IPT_C_FALSE);
}
/*************************************************************************/
unsigned char IPT_fn_bIsJustInvalidated(IPT_tdxHandleToEntryElement _hEntryElement)
{
return((_hEntryElement->lState==-1)?IPT_C_TRUE:IPT_C_FALSE);
}
/*************************************************************************/
unsigned char IPT_fn_bIsInvalidated(IPT_tdxHandleToEntryElement _hEntryElement)
{
return((_hEntryElement->lState<0)?IPT_C_TRUE:IPT_C_FALSE);
}
/*************************************************************************/
long IPT_fn_lGetAnalogicValue(IPT_tdxHandleToEntryElement _hEntryElement)
{
/* return((long)(_hEntryElement->scAnalogicValue));*/
return((long)(_hEntryElement->xAnalogicValue));
}
/*************************************************************************/
void IPT_fn_vReadInput(void)
{
unsigned long i;
IPT_tdxHandleToEntryElement hEntryElement;
unsigned char ucIsActionValid;
unsigned char ucValid = IPT_C_TRUE;
#ifdef USE_DIRECTX //Mouse Read
/**** Read the Mouse device ****/
// if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_KeyboardDeviceEvent] == IPT_C_ActivateDevice)
if (INO_fn_wReadMouse()== C_wMouseError)
{
ucValid = IPT_C_FALSE;
}
#ifdef TEST_MOUSE
else
{
float x,y;
int i,j;
static int kk=0;
if(INO_fn_wRightMouseButtonDown()==C_wMouseTrue)
{
INO_fn_wGetMousePositionInGldDevice(&x,&y);
if(INO_fn_wGetMousePosition(&i,&j)==C_wMouseTrue)
{
kk++;
}
else
{
kk--;
}
kk++;
}
}
#endif
#endif
/**** Read the keyboard device ****/
#if (!defined(U64))
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_KeyboardDeviceEvent] == IPT_C_ActivateDevice)
if (fn_wKbReadKeyboard()==C_wKbError)
ucValid = IPT_C_FALSE;
#endif /* !U64 */
/**** Read the joysticks devices ****/
if (IPT_g_hInputStructure.ucOnePadActivate == IPT_C_ActivateDevice)
if (fn_wJoyReadJoystick(C_wJoyReadConnected)==C_wJoyError)
ucValid = IPT_C_FALSE;
if (ucValid==IPT_C_TRUE)
{
/**** Historic ****/
IPT_fn_vActualizeHistoric();
#ifndef U64
IPT_g_bAtLeastOneActionIsValidated = FALSE;
#endif
/**** Actions ****/
for (i=0;i<IPT_g_hInputStructure.ulNumberOfEntryElement;i++)
{
hEntryElement = &IPT_g_hInputStructure.d_stEntryElementArray[i];
if (hEntryElement->bIsActivate==IPT_C_TRUE)
{
ucIsActionValid = IPT_fn_bIsEntryActionValid(hEntryElement);
if (ucIsActionValid == IPT_C_FALSE)
{
if (IPT_fn_bIsInvalidated (hEntryElement))
hEntryElement -> lState -= 1;
else
if (IPT_fn_bIsValidated (hEntryElement)) hEntryElement -> lState = -1;
}
else
{
if (IPT_fn_bIsValidated (hEntryElement))
hEntryElement -> lState += 1;
else
if (IPT_fn_bIsInvalidated (hEntryElement)) hEntryElement -> lState = 1;
}
}
}
}
}

View File

@@ -0,0 +1,232 @@
/*=========================================================================
* IPT_Hist.c :
* Historic
*
* (c) Ubi Studios 1997
*=======================================================================*/
#include <limits.h>
#include "IPT_CPA.h"
#include "IPT_Hdl.h"
#define D_IPT_Input_StructureDefine
#include "IPT_KDef.h"
#include "IPT_Str.h"
#undef D_IPT_Input_StructureDefine
#include "IPT_Def.h"
#include "IPT_Anal.h"
#include "IPT_Hist.h"
/*************************************************************************/
#ifndef _FIRE_DEADCODE_U64_
unsigned long IPT_fn_ulSizeOfHistoric()
{
return(IPT_g_hInputStructure.sEventHistoricSize);
}
/*************************************************************************/
unsigned char IPT_fn_bIsEmptyHistoricElement(unsigned long _ulElementNumber)
{
return((IPT_g_hInputStructure.hEventHistoric[_ulElementNumber].bf6DeviceType==0)?IPT_C_TRUE:IPT_C_FALSE);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyboardHistoricElement(unsigned long _ulElementNumber)
{
return(((IPT_g_hInputStructure.hEventHistoric[_ulElementNumber].bf6DeviceType)==IPT_E_KeyboardDeviceEvent)?IPT_C_TRUE:IPT_C_FALSE);
}
/*************************************************************************/
unsigned char IPT_fn_bIsPadHistoricElement(unsigned long _ulElementNumber)
{
return(((IPT_g_hInputStructure.hEventHistoric[_ulElementNumber].bf6DeviceType)>=IPT_E_Pad00DeviceEvent&&(IPT_g_hInputStructure.hEventHistoric[_ulElementNumber].bf6DeviceType)<=IPT_E_Pad15DeviceEvent)?IPT_C_TRUE:IPT_C_FALSE);
}
#endif /* _FIRE_DEADCODE_U64_ */
/*************************************************************************/
void IPT_fn_vActualizeHistoric()
{
long i,j;
long lPadNumber;
long lFound = 0;
struct IPT_tdstHistoricElement_ hHistoricElement;
#if (!defined(U64))
/**** KeyBoard Test ****/
for (i=0;IPT_g_hScriptKeyValue[i].swKeyValue!=-1;i++)
{
if (fn_wKbJustDown(IPT_g_hScriptKeyValue[i].swKeyValue)==C_wKbTrue)
{
lFound = 1;
hHistoricElement.bf2State = IPT_E_InProgress;
hHistoricElement.bf6DeviceType = IPT_E_KeyboardDeviceEvent;
hHistoricElement.swDeviceValue = IPT_g_hScriptKeyValue[i].swKeyValue;
hHistoricElement.ucCounter = 0;
IPT_g_hInputStructure.p_ucKeyboardCounter[IPT_g_hScriptKeyValue[i].swKeyValue] = 0;
}
else if (fn_wKbJustUp(IPT_g_hScriptKeyValue[i].swKeyValue)==C_wKbTrue)
IPT_g_hInputStructure.p_ucKeyboardCounter[IPT_g_hScriptKeyValue[i].swKeyValue] = 0;
IPT_g_hInputStructure.p_ucKeyboardCounter[IPT_g_hScriptKeyValue[i].swKeyValue] =
min(UCHAR_MAX,IPT_g_hInputStructure.p_ucKeyboardCounter[IPT_g_hScriptKeyValue[i].swKeyValue]+1);
}
#endif /* !U64 */
/**** Joystick Test ****/
if (!lFound&&IPT_g_hInputStructure.ucOnePadActivate == IPT_C_ActivateDevice)
{
for (i=IPT_E_Pad00DeviceEvent;!lFound&&i<IPT_E_NumberOfDeviceEvent;i++)
{
lPadNumber = i-IPT_E_Pad00DeviceEvent;
if ( IPT_g_hInputStructure.p_ucValideAndActiveDevice[i]==IPT_C_ActivateJoystickDevice
||IPT_g_hInputStructure.p_ucValideAndActiveDevice[i]==IPT_C_ActivatePadDevice)
{
/**** Axis test ****/
if (INO_fn_wJoystickJustUp((short)(lPadNumber))==C_wJoyTrue)
{
lFound = 1;
hHistoricElement.bf2State = IPT_E_InProgress;
hHistoricElement.bf6DeviceType = (unsigned char)i;
hHistoricElement.swDeviceValue = IPT_E_PadUp;
hHistoricElement.ucCounter = 0;
IPT_g_hInputStructure.p_ucPadAndJoyCounter[lPadNumber][IPT_E_PadUp] = 0;
}
else if (INO_fn_wJoystickDirectionJustReleased((short)(lPadNumber),C_ulJoyUp)==C_wJoyTrue)
IPT_g_hInputStructure.p_ucPadAndJoyCounter[lPadNumber][IPT_E_PadUp] = 0;
IPT_g_hInputStructure.p_ucPadAndJoyCounter[lPadNumber][IPT_E_PadUp] =
min(UCHAR_MAX,IPT_g_hInputStructure.p_ucPadAndJoyCounter[lPadNumber][IPT_E_PadUp]+1);
if (INO_fn_wJoystickJustDown((short)(lPadNumber))==C_wJoyTrue)
{
lFound = 1;
hHistoricElement.bf2State = IPT_E_InProgress;
hHistoricElement.bf6DeviceType = (unsigned char)i;
hHistoricElement.swDeviceValue = IPT_E_PadDown;
hHistoricElement.ucCounter = 0;
IPT_g_hInputStructure.p_ucPadAndJoyCounter[lPadNumber][IPT_E_PadDown] = 0;
}
else if (INO_fn_wJoystickDirectionJustReleased((short)(lPadNumber),C_ulJoyDown)==C_wJoyTrue)
IPT_g_hInputStructure.p_ucPadAndJoyCounter[lPadNumber][IPT_E_PadDown] = 0;
IPT_g_hInputStructure.p_ucPadAndJoyCounter[lPadNumber][IPT_E_PadDown] =
min(UCHAR_MAX,IPT_g_hInputStructure.p_ucPadAndJoyCounter[lPadNumber][IPT_E_PadDown]+1);
if (INO_fn_wJoystickJustLeft((short)(lPadNumber))==C_wJoyTrue)
{
lFound = 1;
hHistoricElement.bf2State = IPT_E_InProgress;
hHistoricElement.bf6DeviceType = (unsigned char)i;
hHistoricElement.swDeviceValue = IPT_E_PadLeft;
hHistoricElement.ucCounter = 0;
IPT_g_hInputStructure.p_ucPadAndJoyCounter[lPadNumber][IPT_E_PadLeft] = 0;
}
else if (INO_fn_wJoystickDirectionJustReleased((short)(lPadNumber),C_ulJoyLeft)==C_wJoyTrue)
IPT_g_hInputStructure.p_ucPadAndJoyCounter[lPadNumber][IPT_E_PadLeft] = 0;
IPT_g_hInputStructure.p_ucPadAndJoyCounter[lPadNumber][IPT_E_PadLeft] =
min(UCHAR_MAX,IPT_g_hInputStructure.p_ucPadAndJoyCounter[lPadNumber][IPT_E_PadLeft]+1);
if (INO_fn_wJoystickJustRight((short)(lPadNumber))==C_wJoyTrue)
{
lFound = 1;
hHistoricElement.bf2State = IPT_E_InProgress;
hHistoricElement.bf6DeviceType = (unsigned char)i;
hHistoricElement.swDeviceValue = IPT_E_PadRight;
hHistoricElement.ucCounter = 0;
IPT_g_hInputStructure.p_ucPadAndJoyCounter[lPadNumber][IPT_E_PadRight] = 0;
}
else if (INO_fn_wJoystickDirectionJustReleased((short)(lPadNumber),C_ulJoyRight)==C_wJoyTrue)
IPT_g_hInputStructure.p_ucPadAndJoyCounter[lPadNumber][IPT_E_PadRight] = 0;
IPT_g_hInputStructure.p_ucPadAndJoyCounter[lPadNumber][IPT_E_PadRight] =
min(UCHAR_MAX,IPT_g_hInputStructure.p_ucPadAndJoyCounter[lPadNumber][IPT_E_PadRight]+1);
/**** Buttons test ****/
for (j=IPT_E_PadFirstButton;!lFound&&j<IPT_E_JoyLastButton;j++)
{
if (INO_fn_wJoystickButtonJustPressed((unsigned char)(lPadNumber),IPT_g_ulPadAndJoyButtonFlag[j-IPT_E_PadFirstButton])==C_wJoyTrue)
{
lFound = 1;
hHistoricElement.bf2State = IPT_E_InProgress;
hHistoricElement.bf6DeviceType = (unsigned char)i;
hHistoricElement.swDeviceValue = IPT_g_hScriptPadValue[j].swKeyValue;
hHistoricElement.ucCounter = 0;
IPT_g_hInputStructure.p_ucPadAndJoyCounter[i][IPT_g_hScriptPadValue[j].swKeyValue] = 0;
}
else if (INO_fn_wJoystickButtonJustReleased((unsigned char)(lPadNumber),IPT_g_ulPadAndJoyButtonFlag[j-IPT_E_PadFirstButton])==C_wJoyTrue)
IPT_g_hInputStructure.p_ucPadAndJoyCounter[lPadNumber][IPT_g_hScriptPadValue[j].swKeyValue] = 0;
IPT_g_hInputStructure.p_ucPadAndJoyCounter[lPadNumber][IPT_g_hScriptPadValue[j].swKeyValue] =
min(UCHAR_MAX,IPT_g_hInputStructure.p_ucPadAndJoyCounter[lPadNumber][IPT_g_hScriptPadValue[j].swKeyValue]+1);
}
}
}
}
/**** Update Historic ****/
if (lFound)
{
/* ANNECY AV {*/
/*
for (i=IPT_g_hInputStructure.sEventHistoricSize-1;i>0;i--)
{ memcpy(&(IPT_g_hInputStructure.hEventHistoric[i]),&(IPT_g_hInputStructure.hEventHistoric[i-1]),sizeof(struct IPT_tdstHistoricElement_)); }
memcpy(&(IPT_g_hInputStructure.hEventHistoric[0]),&hHistoricElement,sizeof(struct IPT_tdstHistoricElement_));
*/
memmove (& IPT_g_hInputStructure.hEventHistoric [1] , & IPT_g_hInputStructure.hEventHistoric [0] , (IPT_g_hInputStructure.sEventHistoricSize-1) * sizeof (struct IPT_tdstHistoricElement_));
IPT_g_hInputStructure.hEventHistoric [0] = hHistoricElement;
/* END ANNECY AV }*/
}
/**** Update the counter ****/
for (i=0;i<IPT_g_hInputStructure.sEventHistoricSize;i++)
{
/**** Keyboard ****/
#if (!defined(U64))
if ( IPT_g_hInputStructure.hEventHistoric[i].bf6DeviceType==IPT_E_KeyboardDeviceEvent
&&IPT_g_hInputStructure.hEventHistoric[i].bf2State==IPT_E_InProgress
&&fn_wKbIsDown(IPT_g_hInputStructure.hEventHistoric[i].swDeviceValue)==C_wKbTrue)
{
IPT_g_hInputStructure.hEventHistoric[i].ucCounter=min(UCHAR_MAX,IPT_g_hInputStructure.hEventHistoric[i].ucCounter+1);
}
else
#endif /* !U64 */
if( IPT_g_hInputStructure.hEventHistoric[i].bf6DeviceType>=IPT_E_Pad00DeviceEvent
&&IPT_g_hInputStructure.hEventHistoric[i].bf6DeviceType<=IPT_E_Pad15DeviceEvent
&&IPT_g_hInputStructure.hEventHistoric[i].bf2State==IPT_E_InProgress)
{
lPadNumber = IPT_g_hInputStructure.hEventHistoric[i].bf6DeviceType-IPT_E_Pad00DeviceEvent;
if ( ( IPT_g_hInputStructure.hEventHistoric[i].swDeviceValue==IPT_E_PadUp
&&INO_fn_wIsJoystickUp((unsigned char)(lPadNumber))==C_wJoyTrue)
||( IPT_g_hInputStructure.hEventHistoric[i].swDeviceValue==IPT_E_PadDown
&&INO_fn_wIsJoystickDown((unsigned char)(lPadNumber))==C_wJoyTrue)
||( IPT_g_hInputStructure.hEventHistoric[i].swDeviceValue==IPT_E_PadLeft
&&INO_fn_wIsJoystickLeft((unsigned char)(lPadNumber))==C_wJoyTrue)
||( IPT_g_hInputStructure.hEventHistoric[i].swDeviceValue==IPT_E_PadRight
&&INO_fn_wIsJoystickRight((unsigned char)(lPadNumber))==C_wJoyTrue)
||( IPT_g_hInputStructure.hEventHistoric[i].swDeviceValue>=IPT_E_PadFirstButton
&&IPT_g_hInputStructure.hEventHistoric[i].swDeviceValue<=IPT_E_PadLastButton
&&INO_fn_wIsJoystickButtonPressed((unsigned char)(lPadNumber),IPT_g_ulPadAndJoyButtonFlag[IPT_g_hInputStructure.hEventHistoric[i].swDeviceValue-IPT_E_PadFirstButton])==C_wJoyTrue)
)
{
IPT_g_hInputStructure.hEventHistoric[i].ucCounter=min(UCHAR_MAX,IPT_g_hInputStructure.hEventHistoric[i].ucCounter+1);
}
else
{
if (IPT_g_hInputStructure.hEventHistoric[i].bf2State==IPT_E_InProgress)
IPT_g_hInputStructure.hEventHistoric[i].bf2State = IPT_E_Stopping;
else if (IPT_g_hInputStructure.hEventHistoric[i].bf2State==IPT_E_Stopping)
IPT_g_hInputStructure.hEventHistoric[i].bf2State = IPT_E_Stopped;
}
}
else
{
if (IPT_g_hInputStructure.hEventHistoric[i].bf2State==IPT_E_InProgress)
IPT_g_hInputStructure.hEventHistoric[i].bf2State = IPT_E_Stopping;
else if (IPT_g_hInputStructure.hEventHistoric[i].bf2State==IPT_E_Stopping)
IPT_g_hInputStructure.hEventHistoric[i].bf2State = IPT_E_Stopped;
}
}
}

View File

@@ -0,0 +1,968 @@
/*=========================================================================
* IPT_Kwan.c :
* KeyWord Analyse
*
* (c) Ubi Studios 1997
*=======================================================================*/
#include "IPT_CPA.h"
#include "IPT_Hdl.h"
#define D_IPT_Input_StructureDefine
#include "IPT_KDef.h"
#include "IPT_Str.h"
#undef D_IPT_Input_StructureDefine
#include "ErrIPT.h"
#include "IPT_Hist.h"
#include "IPT_Def.h"
#include "IPT_KDef.h"
#include "IPT_Anal.h"
#define D_IPT_DefineIsKeyWordValid
#include "IPT_Kwan.h"
#undef D_IPT_DefineIsKeyWordValid
/* ANNECY AV DEMO {*/
#ifndef U64
extern int IPT_g_bAtLeastOneActionIsValidated;
#endif
/* END ANNECY AV }*/
IPT_tdxHandleToEntryElement g_h_ActualEntryInput;
IPT_tdxHandleToKeyWordElement IPT_g_hNextParameter;
unsigned long IPT_g_ulSequenceAnalyseNumber;
/*************************************************************************/
/*************************************************************************/
/**** Keyword functions ****/
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_And(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ucReturn = ( (IPT_fn_bIsKeyWordValid(IPT_g_hNextParameter)==IPT_C_TRUE)
&(IPT_fn_bIsKeyWordValid(IPT_g_hNextParameter)==IPT_C_TRUE))
?IPT_C_TRUE:IPT_C_FALSE;
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_Or(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ucReturn = ( (IPT_fn_bIsKeyWordValid(IPT_g_hNextParameter)==IPT_C_TRUE)
|(IPT_fn_bIsKeyWordValid(IPT_g_hNextParameter)==IPT_C_TRUE))
?IPT_C_TRUE:IPT_C_FALSE;
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_Not(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
/*IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ucReturn = IPT_fn_bIsKeyWordValid(IPT_g_hNextParameter)==IPT_C_TRUE ? IPT_C_FALSE : IPT_C_TRUE;
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_KeyJustPressed(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
#if (!defined(U64))
unsigned char ucReturn = IPT_C_FALSE;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ucReturn = (fn_wKbJustDown(IPT_g_hNextParameter->u_ElementUnion.swKey)==C_wKbTrue)?IPT_C_TRUE:IPT_C_FALSE;
/*IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
/* ANNECY AV DEMO {*/
IPT_g_bAtLeastOneActionIsValidated |= ucReturn;
/* END ANNECY AV }*/
return(ucReturn);
#else
return(IPT_C_FALSE);
#endif /* !U64 */
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_KeyJustReleased(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
#if (!defined(U64))
unsigned char ucReturn = IPT_C_FALSE;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ucReturn = (fn_wKbJustUp(IPT_g_hNextParameter->u_ElementUnion.swKey)==C_wKbTrue)?IPT_C_TRUE:IPT_C_FALSE;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
return(ucReturn);
#else
return(IPT_C_FALSE);
#endif /* !U64 */
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_KeyPressed(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
#if (!defined(U64))
unsigned char ucReturn = IPT_C_FALSE;
/* ANNECY AV {*/
unsigned char ucValue;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ucReturn = ( fn_wKbIsDown(IPT_g_hNextParameter->u_ElementUnion.swKey)==C_wKbTrue
&&((ucValue = IPT_g_hInputStructure.p_ucKeyboardCounter[IPT_g_hNextParameter->u_ElementUnion.swKey]) >= IPT_g_hNextParameter->ucMinCounterInput)
&&( ucValue <= IPT_g_hNextParameter->ucMaxCounterInput)
/* END ANNECY AV }*/
)?IPT_C_TRUE:IPT_C_FALSE;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
/* ANNECY AV DEMO {*/
IPT_g_bAtLeastOneActionIsValidated |= ucReturn;
/* END ANNECY AV }*/
return(ucReturn);
#else
return(IPT_C_FALSE);
#endif /* !U64 */
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_KeyReleased(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
#if (!defined(U64))
unsigned char ucReturn = IPT_C_FALSE;
/* ANNECY AV {*/
unsigned char ucValue;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ucReturn = ( fn_wKbIsDown(IPT_g_hNextParameter->u_ElementUnion.swKey)==C_wKbFalse
&&((ucValue = IPT_g_hInputStructure.p_ucKeyboardCounter[IPT_g_hNextParameter->u_ElementUnion.swKey]) >= IPT_g_hNextParameter->ucMinCounterInput)
&&( ucValue <= IPT_g_hNextParameter->ucMaxCounterInput)
/* END ANNECY AV }*/
)?IPT_C_TRUE:IPT_C_FALSE;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
return(ucReturn);
#else
return(IPT_C_FALSE);
#endif /* !U64 */
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_PadJustPressed(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
unsigned long ulPadNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ulPadNumber = IPT_g_hNextParameter->u_ElementUnion.swPadNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber]==IPT_C_ActivatePadDevice)
{
switch (IPT_g_hNextParameter->u_ElementUnion.swPadAction)
{
case IPT_E_PadUp:
ucReturn = (INO_fn_wJoystickJustUp((short)ulPadNumber)==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadDown:
ucReturn = (INO_fn_wJoystickJustDown((short)ulPadNumber)==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadLeft:
ucReturn = (INO_fn_wJoystickJustLeft((short)ulPadNumber)==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadRight:
ucReturn = (INO_fn_wJoystickJustRight((short)ulPadNumber)==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
break;
default: /* Button ?*/
if (IPT_g_hNextParameter->u_ElementUnion.swPadAction>=IPT_E_PadFirstButton&&IPT_g_hNextParameter->u_ElementUnion.swPadAction<=IPT_E_PadLastButton)
ucReturn = (INO_fn_wJoystickButtonJustPressed((short)ulPadNumber,IPT_g_ulPadAndJoyButtonFlag[IPT_g_hNextParameter->u_ElementUnion.swPadAction-IPT_E_PadFirstButton])==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
}
}
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement)));*/
IPT_g_hNextParameter ++;
/* ANNECY AV DEMO {*/
#ifndef U64
IPT_g_bAtLeastOneActionIsValidated |= ucReturn;
#endif
/* END ANNECY AV }*/
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_PadJustReleased(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
unsigned long ulPadNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ulPadNumber = IPT_g_hNextParameter->u_ElementUnion.swPadNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber]==IPT_C_ActivatePadDevice)
{
switch (IPT_g_hNextParameter->u_ElementUnion.swPadAction)
{
case IPT_E_PadUp:
ucReturn = (INO_fn_wJoystickDirectionJustReleased((short)ulPadNumber,C_ulJoyUp)==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadDown:
ucReturn = (INO_fn_wJoystickDirectionJustReleased((short)ulPadNumber,C_ulJoyDown)==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadLeft:
ucReturn = (INO_fn_wJoystickDirectionJustReleased((short)ulPadNumber,C_ulJoyLeft)==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadRight:
ucReturn = (INO_fn_wJoystickDirectionJustReleased((short)ulPadNumber,C_ulJoyRight)==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
break;
default: /* Button ?*/
if (IPT_g_hNextParameter->u_ElementUnion.swPadAction>=IPT_E_PadFirstButton&&IPT_g_hNextParameter->u_ElementUnion.swPadAction<=IPT_E_PadLastButton)
ucReturn = (INO_fn_wJoystickButtonJustReleased((short)ulPadNumber,IPT_g_ulPadAndJoyButtonFlag[IPT_g_hNextParameter->u_ElementUnion.swPadAction-IPT_E_PadFirstButton])==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
}
}
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement)));*/
IPT_g_hNextParameter ++;
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_PadPressed(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
unsigned long ulPadNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ulPadNumber = IPT_g_hNextParameter->u_ElementUnion.swPadNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber]==IPT_C_ActivatePadDevice)
{
switch (IPT_g_hNextParameter->u_ElementUnion.swPadAction)
{
case IPT_E_PadUp:
ucReturn = ( fn_wJoyIsUp((short)ulPadNumber)==C_wJoyTrue
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadDown:
ucReturn = ( fn_wJoyIsDown((short)ulPadNumber)==C_wJoyTrue
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadLeft:
ucReturn = ( fn_wJoyIsLeft((short)ulPadNumber)==C_wJoyTrue
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadRight:
ucReturn = ( fn_wJoyIsRight((short)ulPadNumber)==C_wJoyTrue
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
break;
default: /* Button ?*/
if (IPT_g_hNextParameter->u_ElementUnion.swPadAction>=IPT_E_PadFirstButton&&IPT_g_hNextParameter->u_ElementUnion.swPadAction<=IPT_E_PadLastButton)
{
ucReturn = ( fn_wJoyIsButtonPressed((short)ulPadNumber,IPT_g_ulPadAndJoyButtonFlag[IPT_g_hNextParameter->u_ElementUnion.swPadAction-IPT_E_PadFirstButton])==C_wJoyTrue
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
}
}
}
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement)));*/
IPT_g_hNextParameter ++;
/* ANNECY AV DEMO {*/
#ifndef U64
IPT_g_bAtLeastOneActionIsValidated |= ucReturn;
#endif
/* END ANNECY AV }*/
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_PadReleased(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
unsigned long ulPadNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ulPadNumber = IPT_g_hNextParameter->u_ElementUnion.swPadNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber]==IPT_C_ActivatePadDevice)
{
switch (IPT_g_hNextParameter->u_ElementUnion.swPadAction)
{
case IPT_E_PadUp:
ucReturn = ( fn_wJoyIsUp((short)ulPadNumber)==C_wJoyFalse
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadDown:
ucReturn = ( fn_wJoyIsDown((short)ulPadNumber)==C_wJoyFalse
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadLeft:
ucReturn = ( fn_wJoyIsLeft((short)ulPadNumber)==C_wJoyFalse
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadRight:
ucReturn = ( fn_wJoyIsRight((short)ulPadNumber)==C_wJoyFalse
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
break;
default: /* Button ?*/
if (IPT_g_hNextParameter->u_ElementUnion.swPadAction>=IPT_E_PadFirstButton&&IPT_g_hNextParameter->u_ElementUnion.swPadAction<=IPT_E_PadLastButton)
{
ucReturn = ( fn_wJoyIsButtonPressed((short)ulPadNumber,IPT_g_ulPadAndJoyButtonFlag[IPT_g_hNextParameter->u_ElementUnion.swPadAction-IPT_E_PadFirstButton])==C_wJoyFalse
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
}
}
}
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement)));*/
IPT_g_hNextParameter ++;
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_JoystickAxeValue(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
unsigned long ulJoyNumber;
unsigned long ulActionNumber;
long lMinValue,lMaxValue;
double dfPosition;
IPT_g_hNextParameter = _hKeyWordElement+1;
ulJoyNumber = IPT_g_hNextParameter->u_ElementUnion.swJoyNumber;
IPT_g_hNextParameter++;
ulActionNumber = IPT_g_hNextParameter->u_ElementUnion.swJoyAction;
IPT_g_hNextParameter ++;
lMinValue = IPT_g_hNextParameter->u_ElementUnion.swJoyValueMin;
IPT_g_hNextParameter ++;
lMaxValue = IPT_g_hNextParameter->u_ElementUnion.swJoyValueMax;
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulJoyNumber]==IPT_C_ActivateJoystickDevice)
{
switch (ulActionNumber)
{
case IPT_E_JoyXValue:
fn_wJoyGetCurrentPosition((short)ulJoyNumber,C_ulJoyX,&dfPosition);
break;
case IPT_E_JoyYValue:
fn_wJoyGetCurrentPosition((short)ulJoyNumber,C_ulJoyY,&dfPosition);
break;
case IPT_E_JoyZValue:
fn_wJoyGetCurrentPosition((short)ulJoyNumber,C_ulJoyZ,&dfPosition);
break;
case IPT_E_JoyRValue:
fn_wJoyGetCurrentPosition((short)ulJoyNumber,C_ulJoyR,&dfPosition);
break;
case IPT_E_JoyUValue:
fn_wJoyGetCurrentPosition((short)ulJoyNumber,C_ulJoyU,&dfPosition);
break;
case IPT_E_JoyVValue:
fn_wJoyGetCurrentPosition((short)ulJoyNumber,C_ulJoyV,&dfPosition);
break;
}
ucReturn = ((long)(dfPosition*100)>=lMinValue&&(long)(dfPosition*100)<=lMaxValue)?IPT_C_TRUE:IPT_C_FALSE;
if (ucReturn==IPT_C_TRUE)
/* g_h_ActualEntryInput->scAnalogicValue = (signed char)(dfPosition*100);*/
g_h_ActualEntryInput->xAnalogicValue = (float)(dfPosition*100);
}
/*IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(IPT_g_hNextParameter);*/
IPT_g_hNextParameter ++;
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_JoystickJustPressed(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
unsigned long ulJoyNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ulJoyNumber = IPT_g_hNextParameter->u_ElementUnion.swJoyNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulJoyNumber]==IPT_C_ActivateJoystickDevice)
{
if (IPT_g_hNextParameter->u_ElementUnion.swJoyAction>=IPT_E_JoyFirstButton&&IPT_g_hNextParameter->u_ElementUnion.swJoyAction<=IPT_E_JoyLastButton)
ucReturn = (INO_fn_wJoystickButtonJustPressed((short)ulJoyNumber,IPT_g_ulPadAndJoyButtonFlag[IPT_g_hNextParameter->u_ElementUnion.swPadAction-IPT_E_JoyFirstButton])==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
}
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement)));*/
IPT_g_hNextParameter ++;
/* ANNECY AV DEMO {*/
#ifndef U64
IPT_g_bAtLeastOneActionIsValidated |= ucReturn;
#endif
/* END ANNECY AV }*/
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_JoystickJustReleased(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
unsigned long ulJoyNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ulJoyNumber = IPT_g_hNextParameter->u_ElementUnion.swJoyNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulJoyNumber]==IPT_C_ActivateJoystickDevice)
{
if (IPT_g_hNextParameter->u_ElementUnion.swJoyAction>=IPT_E_JoyFirstButton&&IPT_g_hNextParameter->u_ElementUnion.swJoyAction<=IPT_E_JoyLastButton)
ucReturn = (INO_fn_wJoystickButtonJustReleased((short)ulJoyNumber,IPT_g_ulPadAndJoyButtonFlag[IPT_g_hNextParameter->u_ElementUnion.swPadAction-IPT_E_JoyFirstButton])==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
}
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement)));*/
IPT_g_hNextParameter ++;
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_JoystickPressed(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
unsigned long ulJoyNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ulJoyNumber = IPT_g_hNextParameter->u_ElementUnion.swJoyNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulJoyNumber]==IPT_C_ActivateJoystickDevice)
{
if (IPT_g_hNextParameter->u_ElementUnion.swJoyAction>=IPT_E_JoyFirstButton&&IPT_g_hNextParameter->u_ElementUnion.swJoyAction<=IPT_E_JoyLastButton)
{
ucReturn = ( fn_wJoyIsButtonPressed((short)ulJoyNumber,IPT_g_ulPadAndJoyButtonFlag[IPT_g_hNextParameter->u_ElementUnion.swPadAction-IPT_E_JoyFirstButton])==C_wJoyTrue
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulJoyNumber][IPT_g_hNextParameter->u_ElementUnion.swJoyAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulJoyNumber][IPT_g_hNextParameter->u_ElementUnion.swJoyAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
}
}
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement)));*/
IPT_g_hNextParameter ++;
/* ANNECY AV DEMO {*/
#ifndef U64
IPT_g_bAtLeastOneActionIsValidated |= ucReturn;
#endif
/* END ANNECY AV }*/
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_JoystickReleased(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
unsigned long ulJoyNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ulJoyNumber = IPT_g_hNextParameter->u_ElementUnion.swJoyNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulJoyNumber]==IPT_C_ActivateJoystickDevice)
{
if (IPT_g_hNextParameter->u_ElementUnion.swJoyAction>=IPT_E_JoyFirstButton&&IPT_g_hNextParameter->u_ElementUnion.swJoyAction<=IPT_E_JoyLastButton)
{
ucReturn = ( fn_wJoyIsButtonPressed((short)ulJoyNumber,IPT_g_ulPadAndJoyButtonFlag[IPT_g_hNextParameter->u_ElementUnion.swPadAction-IPT_E_JoyFirstButton])==C_wJoyFalse
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulJoyNumber][IPT_g_hNextParameter->u_ElementUnion.swJoyAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulJoyNumber][IPT_g_hNextParameter->u_ElementUnion.swJoyAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
}
}
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement)));*/
IPT_g_hNextParameter ++;
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_JoystickOrPadJustPressed(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
unsigned long ulPadNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ulPadNumber = IPT_g_hNextParameter->u_ElementUnion.swPadNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
if ( IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber]==IPT_C_ActivateJoystickDevice
||IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber]==IPT_C_ActivatePadDevice)
{
switch (IPT_g_hNextParameter->u_ElementUnion.swPadAction)
{
case IPT_E_PadUp:
ucReturn = (INO_fn_wJoystickJustUp((short)ulPadNumber)==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadDown:
ucReturn = (INO_fn_wJoystickJustDown((short)ulPadNumber)==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadLeft:
ucReturn = (INO_fn_wJoystickJustLeft((short)ulPadNumber)==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadRight:
ucReturn = (INO_fn_wJoystickJustRight((short)ulPadNumber)==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
break;
default: /* Button ?*/
if (IPT_g_hNextParameter->u_ElementUnion.swPadAction>=IPT_E_PadFirstButton&&IPT_g_hNextParameter->u_ElementUnion.swPadAction<=IPT_E_PadLastButton)
ucReturn = (INO_fn_wJoystickButtonJustPressed((short)ulPadNumber,IPT_g_ulPadAndJoyButtonFlag[IPT_g_hNextParameter->u_ElementUnion.swPadAction-IPT_E_PadFirstButton])==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
}
}
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement)));*/
IPT_g_hNextParameter ++;
/* ANNECY AV DEMO {*/
#ifndef U64
IPT_g_bAtLeastOneActionIsValidated |= ucReturn;
#endif
/* END ANNECY AV }*/
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_JoystickOrPadJustReleased(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
unsigned long ulPadNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ulPadNumber = IPT_g_hNextParameter->u_ElementUnion.swPadNumber;
/*IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
if ( IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber]==IPT_C_ActivateJoystickDevice
||IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber]==IPT_C_ActivatePadDevice)
{
switch (IPT_g_hNextParameter->u_ElementUnion.swPadAction)
{
case IPT_E_PadUp:
ucReturn = (INO_fn_wJoystickDirectionJustReleased((short)ulPadNumber,C_ulJoyUp)==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadDown:
ucReturn = (INO_fn_wJoystickDirectionJustReleased((short)ulPadNumber,C_ulJoyDown)==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadLeft:
ucReturn = (INO_fn_wJoystickDirectionJustReleased((short)ulPadNumber,C_ulJoyLeft)==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadRight:
ucReturn = (INO_fn_wJoystickDirectionJustReleased((short)ulPadNumber,C_ulJoyRight)==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
break;
default: /* Button ?*/
if (IPT_g_hNextParameter->u_ElementUnion.swPadAction>=IPT_E_PadFirstButton&&IPT_g_hNextParameter->u_ElementUnion.swPadAction<=IPT_E_PadLastButton)
ucReturn = (INO_fn_wJoystickButtonJustReleased((short)ulPadNumber,IPT_g_ulPadAndJoyButtonFlag[IPT_g_hNextParameter->u_ElementUnion.swPadAction-IPT_E_PadFirstButton])==C_wJoyTrue)?IPT_C_TRUE:IPT_C_FALSE;
}
}
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement)));*/
IPT_g_hNextParameter ++;
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_JoystickOrPadPressed(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
unsigned long ulPadNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ulPadNumber = IPT_g_hNextParameter->u_ElementUnion.swPadNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
if ( IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber]==IPT_C_ActivateJoystickDevice
||IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber]==IPT_C_ActivatePadDevice)
{
switch (IPT_g_hNextParameter->u_ElementUnion.swPadAction)
{
case IPT_E_PadUp:
ucReturn = ( fn_wJoyIsUp((short)ulPadNumber)==C_wJoyTrue
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadDown:
ucReturn = ( fn_wJoyIsDown((short)ulPadNumber)==C_wJoyTrue
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadLeft:
ucReturn = ( fn_wJoyIsLeft((short)ulPadNumber)==C_wJoyTrue
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadRight:
ucReturn = ( fn_wJoyIsRight((short)ulPadNumber)==C_wJoyTrue
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
break;
default: /* Button ?*/
if (IPT_g_hNextParameter->u_ElementUnion.swPadAction>=IPT_E_PadFirstButton&&IPT_g_hNextParameter->u_ElementUnion.swPadAction<=IPT_E_PadLastButton)
{
ucReturn = ( fn_wJoyIsButtonPressed((short)ulPadNumber,IPT_g_ulPadAndJoyButtonFlag[IPT_g_hNextParameter->u_ElementUnion.swPadAction-IPT_E_PadFirstButton])==C_wJoyTrue
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
}
}
}
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement)));*/
IPT_g_hNextParameter ++;
/* ANNECY AV DEMO {*/
#ifndef U64
IPT_g_bAtLeastOneActionIsValidated |= ucReturn;
#endif
/* END ANNECY AV }*/
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_JoystickOrPadReleased(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
unsigned long ulPadNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ulPadNumber = IPT_g_hNextParameter->u_ElementUnion.swPadNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
if ( IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber]==IPT_C_ActivateJoystickDevice
||IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber]==IPT_C_ActivatePadDevice)
{
switch (IPT_g_hNextParameter->u_ElementUnion.swPadAction)
{
case IPT_E_PadUp:
ucReturn = ( fn_wJoyIsUp((short)ulPadNumber)==C_wJoyFalse
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadDown:
ucReturn = ( fn_wJoyIsDown((short)ulPadNumber)==C_wJoyFalse
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadLeft:
ucReturn = ( fn_wJoyIsLeft((short)ulPadNumber)==C_wJoyFalse
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
break;
case IPT_E_PadRight:
ucReturn = ( fn_wJoyIsRight((short)ulPadNumber)==C_wJoyFalse
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
break;
default: /* Button ?*/
if (IPT_g_hNextParameter->u_ElementUnion.swPadAction>=IPT_E_PadFirstButton&&IPT_g_hNextParameter->u_ElementUnion.swPadAction<=IPT_E_PadLastButton)
{
ucReturn = ( fn_wJoyIsButtonPressed((short)ulPadNumber,IPT_g_ulPadAndJoyButtonFlag[IPT_g_hNextParameter->u_ElementUnion.swPadAction-IPT_E_PadFirstButton])==C_wJoyFalse
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.p_ucPadAndJoyCounter[ulPadNumber][IPT_g_hNextParameter->u_ElementUnion.swPadAction]<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
}
}
}
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement)));*/
IPT_g_hNextParameter ++;
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_ActionJustValidated(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ucReturn = (IPT_fn_bIsJustValidated(IPT_g_hNextParameter->u_ElementUnion.hEntryElement)==IPT_C_TRUE)?IPT_C_TRUE:IPT_C_FALSE;
IPT_g_hNextParameter ++;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_ActionValidated(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ucReturn = (IPT_fn_bIsValidated(IPT_g_hNextParameter->u_ElementUnion.hEntryElement)==IPT_C_TRUE)?IPT_C_TRUE:IPT_C_FALSE;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_ActionJustInvalidated(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
/* Oliv' - Portage v15 - Someone forgot something here ?*/
/*
// IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);
ucReturn = (IPT_fn_bIsJustInvalidated(IPT_g_hNextParameter->u_ElementUnion.hEntryElement)==IPT_C_TRUE)?IPT_C_TRUE:IPT_C_FALSE;
IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));
*/
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ucReturn = (IPT_fn_bIsJustInvalidated(IPT_g_hNextParameter->u_ElementUnion.hEntryElement)==IPT_C_TRUE)?IPT_C_TRUE:IPT_C_FALSE;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
/* EndOfOliv'*/
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_ActionInvalidated(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ucReturn = (IPT_fn_bIsInvalidated(IPT_g_hNextParameter->u_ElementUnion.hEntryElement)==IPT_C_TRUE)?IPT_C_TRUE:IPT_C_FALSE;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_Sequence(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
unsigned long i;
IPT_g_ulSequenceAnalyseNumber = 0;
ucReturn = IPT_C_TRUE;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter = _hKeyWordElement+2;
/* for (i=0;ucReturn&&i<LST2_M_DynamicGetNextElement(_hKeyWordElement)->u_ElementUnion.ulNumberOfSequence;i++)*/
for (i=0;ucReturn&&i<(_hKeyWordElement+1)->u_ElementUnion.ulNumberOfSequence;i++)
{
ucReturn &= (IPT_fn_bIsKeyWordValid(IPT_g_hNextParameter)==IPT_C_TRUE)
?IPT_C_TRUE:IPT_C_FALSE;
}
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_SequenceKey(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ucReturn = (
(IPT_g_hInputStructure.hEventHistoric[IPT_g_ulSequenceAnalyseNumber].bf6DeviceType==IPT_E_KeyboardDeviceEvent)
&&(IPT_g_hInputStructure.hEventHistoric[IPT_g_ulSequenceAnalyseNumber].bf2State==IPT_E_Stopped)
&&(IPT_g_hInputStructure.hEventHistoric[IPT_g_ulSequenceAnalyseNumber].swDeviceValue==IPT_g_hNextParameter->u_ElementUnion.swKey)
&&(IPT_g_hInputStructure.hEventHistoric[IPT_g_ulSequenceAnalyseNumber].ucCounter>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.hEventHistoric[IPT_g_ulSequenceAnalyseNumber].ucCounter<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter++;
IPT_g_ulSequenceAnalyseNumber++;
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_SequenceKeyEnd(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ucReturn = (
(IPT_g_hInputStructure.hEventHistoric[IPT_g_ulSequenceAnalyseNumber].bf6DeviceType==IPT_E_KeyboardDeviceEvent)
&&(IPT_g_hInputStructure.hEventHistoric[IPT_g_ulSequenceAnalyseNumber].bf2State==IPT_E_Stopping)
&&(IPT_g_hInputStructure.hEventHistoric[IPT_g_ulSequenceAnalyseNumber].swDeviceValue==IPT_g_hNextParameter->u_ElementUnion.swKey)
&&(IPT_g_hInputStructure.hEventHistoric[IPT_g_ulSequenceAnalyseNumber].ucCounter>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.hEventHistoric[IPT_g_ulSequenceAnalyseNumber].ucCounter<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter++;
IPT_g_ulSequenceAnalyseNumber++;
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_SequencePad(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
unsigned long ulPadNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ulPadNumber = IPT_g_hNextParameter->u_ElementUnion.swPadNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
ucReturn = (
(IPT_g_hInputStructure.hEventHistoric[IPT_g_ulSequenceAnalyseNumber].bf6DeviceType==ulPadNumber+IPT_E_Pad00DeviceEvent)
&&(IPT_g_hInputStructure.hEventHistoric[IPT_g_ulSequenceAnalyseNumber].bf2State==IPT_E_Stopped)
&&(IPT_g_hInputStructure.hEventHistoric[IPT_g_ulSequenceAnalyseNumber].swDeviceValue==IPT_g_hNextParameter->u_ElementUnion.swPadAction)
&&(IPT_g_hInputStructure.hEventHistoric[IPT_g_ulSequenceAnalyseNumber].ucCounter>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.hEventHistoric[IPT_g_ulSequenceAnalyseNumber].ucCounter<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement)));*/
IPT_g_hNextParameter ++;
IPT_g_ulSequenceAnalyseNumber++;
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsKeyWordValid_SequencePadEnd(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
unsigned long ulPadNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(_hKeyWordElement);*/
IPT_g_hNextParameter = _hKeyWordElement+1;
ulPadNumber = IPT_g_hNextParameter->u_ElementUnion.swPadNumber;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement));*/
IPT_g_hNextParameter ++;
ucReturn = (
(IPT_g_hInputStructure.hEventHistoric[IPT_g_ulSequenceAnalyseNumber].bf6DeviceType==ulPadNumber+IPT_E_Pad00DeviceEvent)
&&(IPT_g_hInputStructure.hEventHistoric[IPT_g_ulSequenceAnalyseNumber].bf2State==IPT_E_Stopping)
&&(IPT_g_hInputStructure.hEventHistoric[IPT_g_ulSequenceAnalyseNumber].swDeviceValue==IPT_g_hNextParameter->u_ElementUnion.swPadAction)
&&(IPT_g_hInputStructure.hEventHistoric[IPT_g_ulSequenceAnalyseNumber].ucCounter>=IPT_g_hNextParameter->ucMinCounterInput)
&&(IPT_g_hInputStructure.hEventHistoric[IPT_g_ulSequenceAnalyseNumber].ucCounter<=IPT_g_hNextParameter->ucMaxCounterInput)
)?IPT_C_TRUE:IPT_C_FALSE;
/* IPT_g_hNextParameter = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(_hKeyWordElement)));*/
IPT_g_hNextParameter ++;
IPT_g_ulSequenceAnalyseNumber++;
return(ucReturn);
}
/*************************************************************************/
#ifndef _FIRE_DEADCODE_U64_
unsigned char IPT_fn_bIsKeyWordValid_NameOfKeyWord(IPT_tdxHandleToKeyWordElement _hKeyWordElement)
{
unsigned char ucReturn = IPT_C_FALSE;
return(ucReturn);
}
#endif /* _FIRE_DEADCODE_U64_ */
/*************************************************************************/

View File

@@ -0,0 +1,831 @@
/*=========================================================================
* IPT_Main.c :
* Variables declaration and init function
*
* (c) Ubi Studios 1997
*=======================================================================*/
#include "IPT_CPA.h"
#include "IPT_Hdl.h"
#define D_IPT_Input_StructureDefine
#define D_IPT_Input_VariableDefine
#include "IPT_Main.h"
#include "MemIPT.h"
#include "ErrIPT.h"
#include "IPT_Kwan.h"
#include "IPT_KDef.h"
#include "IPT_Str.h"
#include "IPT_Scpt.h"
#include "IPT_Hist.h"
#include "IPT_Def.h"
#include "IPT_Anal.h"
#include "ACP_base.h"
#include "GAM/ToolsCPA.h"
#include "gam.h"
#include "acp_driver.h"
/*XB*/
#include <string.h>
/*End XB*/
#undef D_IPT_Input_StructureDefine
#undef D_IPT_Input_VariableDefine
/*************************************************************************/
void IPT_fn_vFirstInitInput()
{
Erm_M_InitErrMsg(IPT);
Mmg_M_InitMmg(IPT);
Mmg_fn_cCheckAlignmentValidity();
}
/*************************************************************************/
void IPT_fn_vInitMemory(unsigned long _ulMemSize)
{
#if !defined(U64)
Mmg_M_InitBlock(IPT,E_ucIPTMemoryBlock,_ulMemSize);
#else /* !U64 */
#ifdef CHECK_MEMORY
Mmg_M_InitSpecificBlock(IPT,E_ucIPTMemoryBlock,_ulMemSize, C_ulDefaultMaxNbStaticMalloc, 4, C_BlockWithFreeFlag | C_Check_AlignementFlag | C_Check_OverflowFlag);
#else /* CHECK_MEMORY */
Mmg_M_InitSpecificBlock(IPT,E_ucIPTMemoryBlock,_ulMemSize, C_ulDefaultMaxNbStaticMalloc, 4, C_BlockWithoutFreeFlag | C_Check_AlignementFlag | C_Check_OverflowFlag);
#endif /* CHECK_MEMORY */
#endif /* !U64 */
}
/*************************************************************************/
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
void IPT_fn_vInitInputWhenLoadSnapshot( HINSTANCE hInstance, HWND hWindow )
{
long i;
#if (!defined(U64))
/**** Init the Keyboard library ****/
if (fn_wKbInitKeyboard(IPT_C_ACP_HistoricSize,hInstance,hWindow)!=C_wKbError)
{
fn_wKbResetKeyboard();
/* Mark keyboard as active instead of Valide.*/
IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_KeyboardDeviceEvent] = IPT_C_ActivateDevice;
}
else
IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_KeyboardDeviceEvent] = IPT_C_InvalideDevice;
#endif /* !U64 */
/**** Init the Joystick library ****/
IPT_g_hInputStructure.ucOnePadActivate = IPT_C_InvalideDevice;
IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent] = IPT_C_InvalideDevice;
if (fn_wJoyInitGamePort(IPT_C_ACP_HistoricSize)!=C_wJoyError)
{
fn_wJoyResetGamePort();
for (i=0;i<fn_wJoyMaximumJoystickNumber();i++)
{
if ( fn_wJoyAllocJoystick((short)i)!=C_wJoyError && fn_wJoyIsConnected((short)i)==C_wJoyTrue)
{
IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+i] = IPT_C_ValideDevice;
}
}
/* Now, activate joy 0*/
/* This is usually done using scripts but we are in snapshot version...*/
if( IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent] == IPT_C_ValideDevice )
{
IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent] = IPT_C_ActivateJoystickDevice;
IPT_g_hInputStructure.ucOnePadActivate = IPT_C_ActivateDevice;
fn_wJoyAddActiveJoystick( 0 );
}
}
}
/*************************************************************************/
void IPT_fn_vDesinitInputWhenLoadSnapshot()
{
long i;
#if (!defined(U64))
fn_wKbFreeKeyboard();
#endif /* !U64 */
for (i=0;i<fn_wJoyMaximumJoystickNumber();i++)
{
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+i]==IPT_C_ActivateDevice)
fn_wJoyRemoveActiveJoystick((short)i); /*DFM : Il faut tous*/
}
fn_wJoyFreeGamePort();
#if !defined(U64)
SCR_fn_v_RdL0_DeleteRegisterCallback(IPT_C_EntryActionSection,SCR_CRC_c_RdL0_ForSection, SCR_CDR_c_RdL0_Contains);
SCR_fn_v_RdL0_DeleteRegisterCallback(IPT_C_SequenceSection,SCR_CRC_c_RdL0_ForSection, SCR_CDR_c_RdL0_Contains);
SCR_fn_v_RdL0_DeleteRegisterCallback(IPT_C_ActivateDeviceSection,SCR_CRC_c_RdL0_ForSection, SCR_CDR_c_RdL0_Contains);
SCR_fn_v_RdL0_DeleteRegisterCallback(IPT_C_AddCommandsSection,SCR_CRC_c_RdL0_ForSection, SCR_CDR_c_RdL0_Contains);
Mmg_M_DeleteBlock(IPT,E_ucIPTMemoryBlock);
#endif /* U64 */
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
/*************************************************************************/
void IPT_fn_vInitInput(short _sHistoricSize,HINSTANCE hInstance, HWND hWindow)
{
long i;
/**** Historic initialisation ****/
IPT_g_hInputStructure.sEventHistoricSize = _sHistoricSize;
Mmg_M_SetModeAlloc4Ch(IPT,E_ucIPTMemoryBlock,C_ucMmgDefaultChannel);
MMG_fn_vAddMemoryInfo(MMG_C_lTypeIPT,MMG_C_lSubTypeIPT,0);
IPT_g_hInputStructure.hEventHistoric = Mmg_fn_p_vAlloc4Ch(_sHistoricSize*sizeof(struct IPT_tdstHistoricElement_),C_ucMmgDefaultChannel);
memset(IPT_g_hInputStructure.hEventHistoric,0,_sHistoricSize*sizeof(struct IPT_tdstHistoricElement_));
/**** Keyboard timer initialisation ****/
memset(IPT_g_hInputStructure.p_ucKeyboardCounter,0,256*sizeof(unsigned char));
/**** Joystick timer initialisation ****/
memset(IPT_g_hInputStructure.p_ucPadAndJoyCounter,0,IPT_E_NumberOfDeviceEvent*IPT_E_NumberOfPadAndJoyAction*sizeof(unsigned char));
#if !defined(U64)
/**** Script initialisation ****/
SCR_fn_v_RdL0_RegisterCallback(IPT_C_EntryActionSection,IPT_fn_eAddKeyActionScriptCallBack,SCR_CRC_c_RdL0_ForSection);
SCR_fn_v_RdL0_RegisterCallback(IPT_C_SequenceSection,IPT_fn_eSequenceCallBack,SCR_CRC_c_RdL0_ForSection);
SCR_fn_v_RdL0_RegisterCallback(IPT_C_ActivateDeviceSection,IPT_fn_eActivateDeviceScriptCallBack,SCR_CRC_c_RdL0_ForSection);
SCR_fn_v_RdL0_RegisterCallback(IPT_C_KeyDefineSection,IPT_fn_eKeyDefineScriptCallBack,SCR_CRC_c_RdL0_ForSection);
/**** Link table initialisation ****/
SCR_fn_v_Link_InitTable(&IPT_g_hInputStructure.stEntryLink);
SCR_fn_v_Link_InitTable(&IPT_g_hInputStructure.stCommandLink);
#endif /* U64 */
/**** Init static list ****/
LST2_M_DynamicInitAnchor(&IPT_g_hInputStructure.hEntryElement);
/**** Valide device initialisation ****/
IPT_g_hInputStructure.ucOnePadActivate = 0;
memset(IPT_g_hInputStructure.p_ucValideAndActiveDevice,0,IPT_E_NumberOfDeviceEvent*sizeof(unsigned char));
#if (!defined(U64))
/**** Init the Keyboard library ****/
if (fn_wKbInitKeyboard(IPT_C_ACP_HistoricSize,hInstance,hWindow)!=C_wKbError)
{
fn_wKbResetKeyboard();
IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_KeyboardDeviceEvent] = IPT_C_ValideDevice;
IPT_g_hInputStructure.ucKeyboardType = g_cIsAzerty?IPT_C_AZERTYKeyBoardType:IPT_C_QWERTYKeyBoardType;
}
#endif /* !U64 */
#ifdef USE_DIRECTX //init mouse
/**** Init the Mose library ****/
if( INO_fn_wInitMouseWithGLD(hInstance,g_stEngineStructure.hGLDDevice)==C_wMouseError)
{
INO_fn_vFreeMouse();
}
#endif
/**** Init the Joystick library ****/
if (fn_wJoyInitGamePort(IPT_C_ACP_HistoricSize)!=C_wJoyError)
{
IPT_g_hInputStructure.ucOnePadActivate = IPT_C_ValideDevice;
fn_wJoyResetGamePort();
for (i=0;i<fn_wJoyMaximumJoystickNumber();i++)
{
if ( fn_wJoyAllocJoystick((short)i)!=C_wJoyError
&&fn_wJoyIsConnected((short)i)==C_wJoyTrue)
{
IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+i] = IPT_C_ValideDevice;
}
}
}
}
/*************************************************************************/
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC 04/06/99 */
void IPT_fn_vDesinitInput(void)
{
long i;
#if (!defined(U64))
fn_wKbFreeKeyboard();
#endif /* !U64 */
for (i=0;i<fn_wJoyMaximumJoystickNumber();i++)
{
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+i]==IPT_C_ActivateDevice)
fn_wJoyRemoveActiveJoystick((short)i); /*DFM : Il faut tous*/
}
fn_wJoyFreeGamePort();
#if !defined(U64)
SCR_fn_v_RdL0_DeleteRegisterCallback(IPT_C_EntryActionSection,SCR_CRC_c_RdL0_ForSection, SCR_CDR_c_RdL0_Contains);
SCR_fn_v_RdL0_DeleteRegisterCallback(IPT_C_SequenceSection,SCR_CRC_c_RdL0_ForSection, SCR_CDR_c_RdL0_Contains);
SCR_fn_v_RdL0_DeleteRegisterCallback(IPT_C_ActivateDeviceSection,SCR_CRC_c_RdL0_ForSection, SCR_CDR_c_RdL0_Contains);
SCR_fn_v_RdL0_DeleteRegisterCallback(IPT_C_AddCommandsSection,SCR_CRC_c_RdL0_ForSection, SCR_CDR_c_RdL0_Contains);
Mmg_M_DeleteBlock(IPT,E_ucIPTMemoryBlock);
SCR_fn_v_Link_CloseTable(&IPT_g_hInputStructure.stEntryLink);
SCR_fn_v_Link_CloseTable(&IPT_g_hInputStructure.stCommandLink);
#endif /* U64 */
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC 04/06/99 */
/*************************************************************************/
void IPT_fn_vResetInputEntry(void)
{
unsigned long i;
/* IPT_tdxHandleToEntryElement hEntryElement;*/
/* LST2_M_DynamicForEachElementOf(&IPT_g_hInputStructure.hEntryElement,hEntryElement,i)*/
for (i=0;i<IPT_g_hInputStructure.ulNumberOfEntryElement;i++)
{
/*hEntryElement->lState=-2;*/
IPT_g_hInputStructure.d_stEntryElementArray[i].lState=-2;
}
}
/*************************************************************************/
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
IPT_tdxHandleToEntryElement IPT_fn_hGetEntryActionHandleForOptions(char *_szKeyActionName)
{
unsigned long i;
/* IPT_tdxHandleToEntryElement hEntryElement;*/
IPT_tdxHandleToEntryElement hAction = NULL;
/* LST2_M_DynamicForEachElementOf(&IPT_g_hInputStructure.hEntryElement,hEntryElement,i)*/
/* {*/
/* if (hEntryElement->p_szEntryName!=NULL&&!stricmp(hEntryElement->p_szEntryName,_szKeyActionName))*/
for (i=0;i<IPT_g_hInputStructure.ulNumberOfEntryElement;i++)
{
if (IPT_g_hInputStructure.d_stEntryElementArray[i].p_szEntryName!=NULL&&!stricmp(IPT_g_hInputStructure.d_stEntryElementArray[i].p_szEntryName,_szKeyActionName))
/* hAction = hEntryElement;*/
hAction = &IPT_g_hInputStructure.d_stEntryElementArray[i];
}
return(hAction);
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
/*************************************************************************/
char *IPT_fn_szGetEntryActionName(IPT_tdxHandleToEntryElement hKeyActionHandle)
{
/*
char *szName = NULL;
#if !defined(U64)
SCR_tdst_Link_Value *p_xIndex;
p_xIndex=SCR_fnp_st_Link_SearchValue(&IPT_g_hInputStructure.stEntryLink,(unsigned long)hKeyActionHandle);
if (p_xIndex!=NULL&&SCR_M_e_Link_GetState(p_xIndex)==SCR_ELS_Link_Initialized)
szName = SCR_M_p_sz_Link_GetKey(p_xIndex);
#endif
return(szName);
*/
#if !defined(U64)
if (hKeyActionHandle)
return(hKeyActionHandle->p_szActionName);
else
#endif /* U64*/
return(NULL);
}
/*************************************************************************/
#ifndef _FIRE_DEADCODE_U64_
unsigned char IPT_fn_bIsAValidEntryActionHandle(IPT_tdxHandleToEntryElement hKeyActionHandle)
{
/*
unsigned char ucReturn = IPT_C_FALSE;
#if !defined(U64)
SCR_tdst_Link_Value *p_xIndex;
if (hKeyActionHandle!=NULL)
{
p_xIndex=SCR_fnp_st_Link_SearchValue(&IPT_g_hInputStructure.stEntryLink,(unsigned long)hKeyActionHandle);
if (p_xIndex!=NULL&&SCR_M_e_Link_GetState(p_xIndex)==SCR_ELS_Link_Initialized)
ucReturn = IPT_C_TRUE;
}
#endif // U64
return(ucReturn);
*/
#if !defined(U64)
unsigned long i;
if (hKeyActionHandle!=NULL)
{
for (i=0;i<IPT_g_hInputStructure.ulNumberOfEntryElement;i++)
{
if (hKeyActionHandle==&IPT_g_hInputStructure.d_stEntryElementArray[i])
return (IPT_C_TRUE);
}
}
#endif /* U64 */
return(IPT_C_FALSE);
}
#endif /* _FIRE_DEADCODE_U64_ */
/*************************************************************************/
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
unsigned long IPT_fn_ulNumberOfEntryAction(void)
{
/* unsigned long ulNumberOfEntryAction;
ulNumberOfEntryAction=LST2_M_DynamicGetNumberOfElements(&IPT_g_hInputStructure.hEntryElement);
return(ulNumberOfEntryAction);
*/
return(IPT_g_hInputStructure.ulNumberOfEntryElement);
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
/*************************************************************************/
#ifndef _FIRE_DEADCODE_U64_
char *IPT_fn_szEntryActionNumber(unsigned long _ulEntryAction)
{
/*
unsigned long i;
char *szEntryAction = NULL;
IPT_tdxHandleToEntryElement hElement;
if (_ulEntryAction<IPT_fn_ulNumberOfEntryAction())
{
LST2_M_DynamicGetElementNumber(&IPT_g_hInputStructure.hEntryElement,hElement,_ulEntryAction,i);
szEntryAction = IPT_fn_szGetEntryActionName(hElement);
}
return (szEntryAction);
*/
char *szEntryAction = NULL;
if (_ulEntryAction<IPT_fn_ulNumberOfEntryAction())
{
szEntryAction = IPT_fn_szGetEntryActionName(&IPT_g_hInputStructure.d_stEntryElementArray[_ulEntryAction]);
}
return (szEntryAction);
}
#endif /* _FIRE_DEADCODE_U64_ */
/*************************************************************************/
void IPT_fn_vActivateAllEntryElements ( void )
{
IPT_tdxHandleToEntryElement hEntryElement ;
unsigned long ulI ;
for ( ulI = 0 , hEntryElement = IPT_g_hInputStructure.d_stEntryElementArray ; ulI < IPT_g_hInputStructure . ulNumberOfEntryElement ; ulI ++ , hEntryElement ++ )
{
IPT_fn_vActivateEntryElement ( hEntryElement ) ;
}
}
/*************************************************************************/
void IPT_fn_vActivateEntryElement(IPT_tdxHandleToEntryElement _hEntryElement)
{
_hEntryElement->bIsActivate=IPT_C_TRUE;
_hEntryElement->lState = -2;
}
/*************************************************************************/
void IPT_fn_vDesactivateEntryElement(IPT_tdxHandleToEntryElement _hEntryElement)
{
_hEntryElement->bIsActivate=IPT_C_FALSE;
_hEntryElement->lState = -2;
}
/*************************************************************************/
#ifndef _FIRE_DEADCODE_U64_
unsigned char IPT_fn_bGetActivationFlagOfEntryElement(IPT_tdxHandleToEntryElement _hEntryElement)
{
return(_hEntryElement->bIsActivate);
}
#endif /* _FIRE_DEADCODE_U64_ */
/*************************************************************************/
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
char IPT_fn_cGetValidAsciiKey(char *p_szValideKey)
{
#if (!defined(U64))
short wKey = 0;
char cKey = 0;
wKey = INO_fn_wGetLastASCIICode();
cKey = (char)wKey;
if (wKey==C_wKbError||strchr(p_szValideKey,cKey)==NULL)
cKey = 0;
return(cKey);
#else
return(0);
#endif /* !U64 */
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
/*************************************************************************/
#if !defined(RETAIL) || defined(FINAL_VERSION_FOR_TESTERS)
void IPT_PrintUsedStaticMemory(void)
{
Mmg_M_PrintUsedStaticMemoryInModule(IPT);
}
#endif /* !defined(RETAIL) || defined(FINAL_VERSION_FOR_TESTERS) */
/**************************************************************************/
/*XB*/
#ifdef CHECK_MEMORY
void IPT_CheckMemory(void)
{
Mmg_M_CheckMemory(IPT);
}
#endif /* CHECK_MEMORY */
/*End XB*/
/**************************************************************************/
/* XB 02/06/99 */
#ifndef FINAL_VERSION
unsigned long IPT_fn_ulGetUsedStaticMemory(void)
{
return Mmg_M_GetUsedStaticMemory(IPT);
}
#endif /* FINAL_VERSION */
/* End XB 02/06/99 */
/*************************************************************************/
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
unsigned char IPT_fn_bIsKeyboardControlAvailable(void)
{
unsigned char ucReturn = IPT_C_FALSE;
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_KeyboardDeviceEvent]==IPT_C_ActivateDevice)
ucReturn = IPT_C_TRUE;
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsPaddleControlAvailable(void)
{
unsigned long i;
unsigned char ucReturn = IPT_C_FALSE;
for (i=IPT_E_Pad00DeviceEvent;i<=IPT_E_Pad15DeviceEvent;i++)
{
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[i]==IPT_C_ActivatePadDevice)
ucReturn = IPT_C_TRUE;
}
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bIsJoystickControlAvailable(void)
{
unsigned long i;
unsigned char ucReturn = IPT_C_FALSE;
for (i=IPT_E_Pad00DeviceEvent;i<=IPT_E_Pad15DeviceEvent;i++)
{
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[i]==IPT_C_ActivateJoystickDevice)
ucReturn = IPT_C_TRUE;
}
return(ucReturn);
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
/*************************************************************************/
void IPT_fn_vDesactiveJoystickAndPadControl(void)
{
unsigned long i;
for (i=IPT_E_Pad00DeviceEvent;i<=IPT_E_Pad15DeviceEvent;i++)
{
if ( IPT_g_hInputStructure.p_ucValideAndActiveDevice[i]==IPT_C_ActivatePadDevice
||IPT_g_hInputStructure.p_ucValideAndActiveDevice[i]==IPT_C_ActivateJoystickDevice)
{
IPT_g_hInputStructure.p_ucValideAndActiveDevice[i]=IPT_C_ValideDevice;
fn_wJoyRemoveActiveJoystick((short)(i-IPT_E_Pad00DeviceEvent));
}
}
}
/*************************************************************************/
void IPT_fn_vActiveJoystickControl(void)
{
unsigned long i;
for (i=IPT_E_Pad00DeviceEvent;i<=IPT_E_Pad15DeviceEvent;i++)
{
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[i]==IPT_C_ValideDevice)
{
IPT_g_hInputStructure.p_ucValideAndActiveDevice[i]=IPT_C_ActivateJoystickDevice;
fn_wJoyAddActiveJoystick((short)(i-IPT_E_Pad00DeviceEvent));
}
}
}
/*************************************************************************/
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
void IPT_fn_vActivePaddleControl(void)
{
unsigned long i;
for (i=IPT_E_Pad00DeviceEvent;i<=IPT_E_Pad15DeviceEvent;i++)
{
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[i]==IPT_C_ValideDevice)
{
IPT_g_hInputStructure.p_ucValideAndActiveDevice[i]=IPT_C_ActivatePadDevice;
fn_wJoyAddActiveJoystick((short)(i-IPT_E_Pad00DeviceEvent));
}
}
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
/*************************************************************************/
IPT_tdxHandleToEntryElement IPT_fn_hSearchElementInOptionWithKeyWord(signed short _swEntryType,signed short swPadNumber,signed short _swKeyValue)
{
unsigned long i;
IPT_tdxHandleToEntryElement hEntryElement;
IPT_tdxHandleToEntryElement hAction = NULL;
IPT_tdxHandleToKeyWordElement hNextElement;
for (i=0;i<IPT_g_hInputStructure.ulNumberOfEntryElement;i++)
{
hEntryElement = &IPT_g_hInputStructure.d_stEntryElementArray[i];
if (hEntryElement->p_szEntryName!=NULL)
{
if (_swEntryType==IPT_E_KeyWord_KeyPressed)
{
hNextElement = &hEntryElement->d_stKeyWordElementArray[0];
if (hNextElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_KeyPressed)
{
hNextElement = &hEntryElement->d_stKeyWordElementArray[1];
if (hNextElement->u_ElementUnion.swKey==_swKeyValue)
hAction = hEntryElement;
}
}
else if (_swEntryType==IPT_E_KeyWord_JoystickOrPadPressed)
{
hNextElement = &hEntryElement->d_stKeyWordElementArray[0];
if (hNextElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickOrPadPressed)
{
hNextElement = &hEntryElement->d_stKeyWordElementArray[1];
if (hNextElement->u_ElementUnion.swPadNumber==swPadNumber)
{
hNextElement = &hEntryElement->d_stKeyWordElementArray[2];
if (hNextElement->u_ElementUnion.swKey==_swKeyValue)
hAction = hEntryElement;
}
}
}
}
}
return(hAction);
}
/*************************************************************************/
/* replace an ActionValidated action inside another one */
unsigned char IPT_fn_bModifyIPTAction ( IPT_tdxHandleToEntryElement _hElementToChange, IPT_tdxHandleToEntryElement _hReplacingElement )
{
long lI ;
for ( lI = 0 ; lI < ( long ) _hElementToChange -> ulNumberOfKeyWordElement ; lI ++ )
if ( _hElementToChange -> d_stKeyWordElementArray [ lI ] . u_ElementUnion . swKeyWord == IPT_E_KeyWord_ActionValidated )
{
_hElementToChange -> d_stKeyWordElementArray [ lI + 1 ] . u_ElementUnion . hEntryElement = _hReplacingElement ;
return IPT_C_TRUE ;
}
return IPT_C_FALSE ;
}
/*************************************************************************/
unsigned char IPT_fn_bChangeIPTValue(IPT_tdxHandleToEntryElement _hElement,unsigned char ucWhichTest)
{
signed short swPadNumber;
unsigned char ucReturn = IPT_C_FALSE;
unsigned long i;
unsigned char bFlag = FALSE;
IPT_tdxHandleToEntryElement hExchangeEntry;
IPT_tdxHandleToKeyWordElement hExchangeNextElement;
IPT_tdxHandleToKeyWordElement hNextElement;
/* hNextElement = LST2_M_DynamicGetFirstElement(&_hElement->hKeyWordList);*/
hNextElement = &_hElement->d_stKeyWordElementArray[0];
#if (!defined(U64))
if (hNextElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_KeyPressed)
{
/* hNextElement = LST2_M_DynamicGetNextElement(hNextElement);*/
hNextElement++;
for (i=0;IPT_g_hScriptKeyValue[i].swKeyValue!=-1&&fn_wKbJustDown(IPT_g_hScriptKeyValue[i].swKeyValue)!=C_wKbTrue;i++);
if (IPT_g_hScriptKeyValue[i].swKeyValue!=-1&&IPT_fn_p_szGetNameOfKeyName(IPT_g_hScriptKeyValue[i].swKeyValue,0)!=NULL)
{
hExchangeEntry = IPT_fn_hSearchElementInOptionWithKeyWord(IPT_E_KeyWord_KeyPressed,0,IPT_g_hScriptKeyValue[i].swKeyValue);
if (ucWhichTest==IPT_C_Duplicate)
bFlag = TRUE;
else if (ucWhichTest==IPT_C_NoDuplicate)
{
if (hExchangeEntry==NULL||hExchangeEntry==_hElement)
bFlag = TRUE;
}
else if (ucWhichTest==IPT_C_Exchange)
{
bFlag = TRUE;
if (hExchangeEntry!=NULL&&hExchangeEntry!=_hElement)
{
/* hExchangeNextElement = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetFirstElement(&hExchangeEntry->hKeyWordList));*/
hExchangeNextElement = &hExchangeEntry->d_stKeyWordElementArray[1];
hExchangeNextElement->u_ElementUnion.swKey = hNextElement->u_ElementUnion.swKey;
}
}
if (bFlag)
{
hNextElement->u_ElementUnion.swKey = IPT_g_hScriptKeyValue[i].swKeyValue;
ucReturn = IPT_C_TRUE;
}
}
}
else
#endif /* !U64 */
if (hNextElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickOrPadPressed)
{
/* hNextElement = LST2_M_DynamicGetNextElement(hNextElement);*/
hNextElement++;
swPadNumber = hNextElement->u_ElementUnion.swPadNumber;
/* hNextElement = LST2_M_DynamicGetNextElement(hNextElement);*/
hNextElement++;
for (i=IPT_E_PadFirstButton;i<=IPT_E_PadLastButton&&INO_fn_wJoystickButtonJustPressed(swPadNumber,IPT_g_ulPadAndJoyButtonFlag[i-IPT_E_PadFirstButton])!=C_wJoyTrue;i++);
if (i<=IPT_E_PadLastButton)
{
hExchangeEntry = IPT_fn_hSearchElementInOptionWithKeyWord(IPT_E_KeyWord_JoystickOrPadPressed,swPadNumber,IPT_g_hScriptPadValue[i].swKeyValue);
if (ucWhichTest==IPT_C_Duplicate)
bFlag = TRUE;
else if (ucWhichTest==IPT_C_NoDuplicate)
{
if (hExchangeEntry==NULL||hExchangeEntry==_hElement)
bFlag = TRUE;
}
else if (ucWhichTest==IPT_C_Exchange)
{
bFlag = TRUE;
if (hExchangeEntry!=NULL&&hExchangeEntry!=_hElement)
{
/* hExchangeNextElement = LST2_M_DynamicGetNextElement(LST2_M_DynamicGetNextElement(LST2_M_DynamicGetFirstElement(&hExchangeEntry->hKeyWordList)));*/
hExchangeNextElement = &hExchangeEntry->d_stKeyWordElementArray[2];
hExchangeNextElement->u_ElementUnion.swKey = hNextElement->u_ElementUnion.swKey;
}
}
if (bFlag)
{
hNextElement->u_ElementUnion.swKey = IPT_g_hScriptPadValue[i].swKeyValue;
ucReturn = IPT_C_TRUE;
}
}
}
return(ucReturn);
}
/*************************************************************************/
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
char *IPT_fn_szGetStringOf(IPT_tdxHandleToEntryElement _hElement)
{
IPT_tdxHandleToKeyWordElement hNextElement;
/*hNextElement = LST2_M_DynamicGetFirstElement(&_hElement->hKeyWordList);*/
hNextElement = &_hElement->d_stKeyWordElementArray[0];;
if (hNextElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_KeyPressed)
{
/* hNextElement = LST2_M_DynamicGetNextElement(hNextElement);*/
hNextElement++;
if (IPT_g_hInputStructure.ucKeyboardType==IPT_C_AZERTYKeyBoardType)
return(IPT_fn_p_szGetNameOfKeyName(hNextElement->u_ElementUnion.swKey,0));
else
return(IPT_fn_p_szGetNameOfKeyName(hNextElement->u_ElementUnion.swKey,1));
}
else if (hNextElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickOrPadPressed)
{
/* hNextElement = LST2_M_DynamicGetNextElement(hNextElement);*/
/* hNextElement = LST2_M_DynamicGetNextElement(hNextElement);*/
hNextElement+=2;
return(IPT_fn_p_szGetNameOfKeyName((unsigned short)(hNextElement->u_ElementUnion.swPadAction|0x8000),0));
}
return NULL;
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
/*************************************************************************/
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
IPT_tdxHandleToKeyWordElement IPT_fn_hAllocKeyWord(void)
{
IPT_tdxHandleToKeyWordElement hKeyWordElement;
Mmg_M_SetModeAlloc4Ch(IPT,E_ucIPTMemoryBlock,C_ucMmgDefaultChannel);
MMG_fn_vAddMemoryInfo(MMG_C_lTypeIPT,MMG_C_lSubTypeIPT,0);
if ((hKeyWordElement = (IPT_tdxHandleToKeyWordElement)Mmg_fn_p_vAlloc4Ch(sizeof(struct IPT_tdstKeyWordElement_),C_ucMmgDefaultChannel))==NULL)
{
M_IPTFatalError(E_uwIPT_AllocNewKeyWord);
}
memset(hKeyWordElement,0,sizeof(struct IPT_tdstKeyWordElement_));
return(hKeyWordElement);
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
/*************************************************************************/
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
char *IPT_fn_p_szGetNameOfKeyName(unsigned short uwKeyCode,unsigned char ucFrenchOrAmerican)
{
long i;
char *szReturn = NULL;
for (i=0;IPT_gd_hKeyAndPadDefine[i].uwBasedKey!=0xffff&&uwKeyCode!=IPT_gd_hKeyAndPadDefine[i].uwBasedKey;i++);
if (IPT_gd_hKeyAndPadDefine[i].uwBasedKey!=0xffff)
{
if (ucFrenchOrAmerican==0)
szReturn = IPT_gd_hKeyAndPadDefine[i].p_szFrenchKey;
else if (ucFrenchOrAmerican==1)
szReturn = IPT_gd_hKeyAndPadDefine[i].p_szAmericanKey;
}
return(szReturn);
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
/*************************************************************************/
ACP_tdxBool IPT_fn_bAJoypadConnected()
{
return ((IPT_g_hInputStructure.ucOnePadActivate == IPT_C_ActivateDevice)||
(fn_wJoyReadJoystick(C_wJoyReadConnected)!=C_wJoyError));
}
/* LOL*/
#ifndef U64
/*************************************************************************/
ACP_tdxBool IPT_fn_bAKeyJustPressed()
{
unsigned short uwKeyCode;
struct IPT_tdstScriptValue_ *p_hScriptKeyValue;
struct IPT_tdstKeyAndPadDefine_ *p_stKeyAndPadDefine;
p_hScriptKeyValue = &IPT_g_hScriptKeyValue[0];
while (p_hScriptKeyValue->swKeyValue!=-1)
{
uwKeyCode = p_hScriptKeyValue->swKeyValue;
if (fn_wKbJustDown(uwKeyCode)==C_wKbTrue)
{
p_stKeyAndPadDefine = &IPT_gd_hKeyAndPadDefine[0];
while (p_stKeyAndPadDefine->uwBasedKey!=0xffff)
{
if (uwKeyCode==p_stKeyAndPadDefine->uwBasedKey)
return TRUE;
p_stKeyAndPadDefine++;
}
}
p_hScriptKeyValue ++;
}
return FALSE;
}
#endif
/*************************************************************************/
ACP_tdxBool IPT_fn_bAButtonPadJustPressed()
{
long i;
i =IPT_E_PadFirstButton;
while (i<=IPT_E_PadLastButton)
{
if (INO_fn_wJoystickButtonJustPressed(0,IPT_g_ulPadAndJoyButtonFlag[i-IPT_E_PadFirstButton])==C_wJoyTrue)
return TRUE;
i++;
}
return FALSE;
}
/*************************************************************************/
void *IPT_fn_p_vAlloc(unsigned long lSize)
{
void *p_vPointer;
Mmg_M_SetModeAlloc4Ch(IPT,E_ucIPTMemoryBlock,C_ucMmgDefaultChannel);
p_vPointer=(void*)Mmg_fn_p_vAlloc4Ch(lSize,C_ucMmgDefaultChannel);
memset(p_vPointer,0,lSize);
if (p_vPointer==NULL)
M_IPTFatalError(E_uwIPTMemoryPlace);
return (p_vPointer);
}
/**************************************************************************/
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
void IPT_fn_vFree(void **p_vPointer)
{
Mmg_M_SetModeAlloc4Ch(IPT,E_ucIPTMemoryBlock,C_ucMmgDefaultChannel);
Mmg_fn_vFree4Ch(*p_vPointer,C_ucMmgDefaultChannel);
*p_vPointer = NULL;
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
/**************************************************************************/

View File

@@ -0,0 +1,148 @@
/*=========================================================================
* IPT_Save.c :
* Input options saved
*
* (c) Ubi Studios 1997
*=======================================================================*/
#include "IPT_CPA.h"
#include "IPT_Hdl.h"
#include "MemIPT.h"
#include "ErrIPT.h"
#include "IPT_Def.h"
#include "IPT_Hdl.h"
#define D_IPT_Input_StructureDefine
#include "IPT_KDef.h"
#include "IPT_Str.h"
#undef D_IPT_Input_StructureDefine
#include "IPT_Main.h"
#include "IPT_Scpt.h"
extern signed char g_cJoystickXmin;
extern signed char g_cJoystickXmax;
extern signed char g_cJoystickYmin;
extern signed char g_cJoystickYmax;
#ifndef U64
extern signed char g_cJoystickXcenter;
extern signed char g_cJoystickYcenter;
#endif
/*************************************************************************/
unsigned char IPT_fn_bSaveOptionsInFile(FILE *p_stFile)
{
unsigned char ucReturn = IPT_C_TRUE;
unsigned long i;
IPT_tdxHandleToEntryElement hEntryElement;
IPT_tdxHandleToKeyWordElement hNextElement;
unsigned char uc8bits;
uc8bits = IPT_fn_bIsKeyboardControlAvailable();
fwrite(&uc8bits,sizeof(char),1,p_stFile);
uc8bits = IPT_fn_bIsPaddleControlAvailable();
fwrite(&uc8bits,sizeof(char),1,p_stFile);
uc8bits = IPT_fn_bIsJoystickControlAvailable();
fwrite(&uc8bits,sizeof(char),1,p_stFile);
for (i=0;i<IPT_g_hInputStructure.ulNumberOfEntryElement;i++)
{
hEntryElement = &IPT_g_hInputStructure.d_stEntryElementArray[i];
if (hEntryElement->p_szEntryName!=NULL)
{
uc8bits = strlen(hEntryElement->p_szEntryName)+1;
fwrite(&uc8bits,sizeof(char),1,p_stFile);
fwrite(hEntryElement->p_szEntryName,sizeof(char),uc8bits,p_stFile);
hNextElement = &hEntryElement->d_stKeyWordElementArray[0];
if (hNextElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_KeyPressed)
{
hNextElement = &hEntryElement->d_stKeyWordElementArray[1];
fwrite(&hNextElement->u_ElementUnion.swKey,sizeof(short),1,p_stFile);
}
else if (hNextElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickOrPadPressed)
{
hNextElement = &hEntryElement->d_stKeyWordElementArray[1];
fwrite(&hNextElement->u_ElementUnion.swPadNumber,sizeof(short),1,p_stFile);
hNextElement = &hEntryElement->d_stKeyWordElementArray[2];
fwrite(&hNextElement->u_ElementUnion.swPadAction,sizeof(short),1,p_stFile);
}
}
}
uc8bits = 0xff;
fwrite(&uc8bits,sizeof(char),1,p_stFile);
/* Save joystick calibration */
fwrite( &g_cJoystickXmin, sizeof(signed char), 1, p_stFile );
fwrite( &g_cJoystickXmax, sizeof(signed char), 1, p_stFile );
fwrite( &g_cJoystickYmin, sizeof(signed char), 1, p_stFile );
fwrite( &g_cJoystickYmax, sizeof(signed char), 1, p_stFile );
#ifndef U64
fwrite( &g_cJoystickXcenter, sizeof(signed char), 1, p_stFile );
fwrite( &g_cJoystickYcenter, sizeof(signed char), 1, p_stFile );
#endif
return(ucReturn);
}
/*************************************************************************/
unsigned char IPT_fn_bLoadOptionsFromFile(FILE *p_stFile)
{
unsigned char ucReturn = IPT_C_TRUE;
IPT_tdxHandleToEntryElement hEntryElement;
IPT_tdxHandleToKeyWordElement hNextElement;
unsigned char uc8bits;
char szActionName[255];
IPT_fn_vDesactiveJoystickAndPadControl();
fread(&uc8bits,sizeof(char),1,p_stFile);
fread(&uc8bits,sizeof(char),1,p_stFile);
if (uc8bits)
{
IPT_fn_vDesactiveJoystickAndPadControl();
IPT_fn_vActivePaddleControl();
}
fread(&uc8bits,sizeof(char),1,p_stFile);
if (uc8bits)
{
IPT_fn_vDesactiveJoystickAndPadControl();
IPT_fn_vActiveJoystickControl();
}
fread(&uc8bits,sizeof(char),1,p_stFile);
while(uc8bits!=0xff)
{
fread(szActionName,sizeof(char),uc8bits,p_stFile);
hEntryElement=IPT_fn_hGetEntryActionHandleForOptions(szActionName);
hNextElement = &hEntryElement->d_stKeyWordElementArray[0];
if (hNextElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_KeyPressed)
{
hNextElement = &hEntryElement->d_stKeyWordElementArray[1];
fread(&hNextElement->u_ElementUnion.swKey,sizeof(short),1,p_stFile);
}
else if (hNextElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickOrPadPressed)
{
hNextElement = &hEntryElement->d_stKeyWordElementArray[1];
fread(&hNextElement->u_ElementUnion.swPadNumber,sizeof(short),1,p_stFile);
hNextElement = &hEntryElement->d_stKeyWordElementArray[2];
fread(&hNextElement->u_ElementUnion.swPadAction,sizeof(short),1,p_stFile);
}
fread(&uc8bits,sizeof(char),1,p_stFile);
}
/* Read joystick calibration */
fread( &g_cJoystickXmin, sizeof(signed char), 1, p_stFile );
fread( &g_cJoystickXmax, sizeof(signed char), 1, p_stFile );
fread( &g_cJoystickYmin, sizeof(signed char), 1, p_stFile );
fread( &g_cJoystickYmax, sizeof(signed char), 1, p_stFile );
#ifndef U64
fread( &g_cJoystickXcenter, sizeof(signed char), 1, p_stFile );
fread( &g_cJoystickYcenter, sizeof(signed char), 1, p_stFile );
#endif
return(ucReturn);
}
/*************************************************************************/

View File

@@ -0,0 +1,186 @@
# Microsoft Developer Studio Project File - Name="IPT_WIN" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 5.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=IPT_WIN - Win32 Debug DREAMCAST
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "Ipt_win.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "Ipt_win.mak" CFG="IPT_WIN - Win32 Debug DREAMCAST"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "IPT_WIN - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "IPT_WIN - Win32 Debug DREAMCAST" (based on\
"Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP Scc_ProjName ""$/cpa/tempgrp/IPT", HJDAAAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
!IF "$(CFG)" == "IPT_WIN - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "x:\cpa\lib"
# PROP Intermediate_Dir "tmp\debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /G5 /MD /W3 /GX /Z7 /Od /I "x:\Cpa\Public" /I "x:\Cpa\Public\IPT" /I "t:\dxsdk\sdk\inc" /D "_DEBUG" /D "VISUAL" /D "WIN32" /D "USE_PROFILER" /D "MTH_CHECK" /D "CPA_WANTS_EXPORT" /FD /c
# SUBTRACT CPP /Fr /YX
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\..\Lib\IPTP5_vd.lib"
!ELSEIF "$(CFG)" == "IPT_WIN - Win32 Debug DREAMCAST"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "IPT___Wi"
# PROP BASE Intermediate_Dir "IPT___Wi"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "IPT___Wi"
# PROP Intermediate_Dir "IPT___Wi"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G5 /MD /W3 /GX /Z7 /Od /I "x:\Cpa\Public" /I "x:\Cpa\Public\IPT" /I "t:\dxsdk\sdk\inc" /D "_DEBUG" /D "VISUAL" /D "WIN32" /D "USE_PROFILER" /D "MTH_CHECK" /D "CPA_WANTS_EXPORT" /FD /c
# SUBTRACT BASE CPP /Fr /YX
# ADD CPP /nologo /G5 /MD /W3 /GX /Z7 /Od /I "x:\Cpa\Public" /I "x:\Cpa\Public\IPT" /I "t:\dxsdk\sdk\inc" /D "DREAM" /D "_DEBUG" /D "VISUAL" /D "WIN32" /D "USE_PROFILER" /D "MTH_CHECK" /D "CPA_WANTS_EXPORT" /FD /c
# SUBTRACT CPP /Fr /YX
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\..\Lib\IPTP5_vd.lib"
# ADD LIB32 /nologo /out:"..\..\Lib\IPTP5DC_vd.lib"
!ENDIF
# Begin Target
# Name "IPT_WIN - Win32 Debug"
# Name "IPT_WIN - Win32 Debug DREAMCAST"
# Begin Group "Sources"
# PROP Default_Filter ".c,.cpp"
# Begin Source File
SOURCE=.\IPT_Anal.c
# End Source File
# Begin Source File
SOURCE=.\IPT_Hist.c
# End Source File
# Begin Source File
SOURCE=.\IPT_Kwan.c
# End Source File
# Begin Source File
SOURCE=.\IPT_Main.c
# End Source File
# Begin Source File
SOURCE=.\IPT_Save.c
# End Source File
# Begin Source File
SOURCE=.\P5\IPT_Scpt.c
# End Source File
# End Group
# Begin Group "Includes"
# PROP Default_Filter ".h,.hpp"
# Begin Source File
SOURCE=..\..\Public\IPT\ErrIPT.h
# End Source File
# Begin Source File
SOURCE=..\..\Public\IPT\IPT_Anal.h
# End Source File
# Begin Source File
SOURCE=..\..\Public\IPT\IPT_CPA.h
# End Source File
# Begin Source File
SOURCE=..\..\Public\IPT\IPT_Def.h
# End Source File
# Begin Source File
SOURCE=..\..\Public\IPT\IPT_Hist.h
# End Source File
# Begin Source File
SOURCE=..\..\Public\IPT\IPT_KDef.h
# End Source File
# Begin Source File
SOURCE=..\..\Public\IPT\IPT_Kwan.h
# End Source File
# Begin Source File
SOURCE=..\..\Public\IPT\IPT_Main.h
# End Source File
# Begin Source File
SOURCE=..\..\Public\IPT\IPT_Save.h
# End Source File
# Begin Source File
SOURCE=..\..\Public\IPT\IPT_Scpt.h
# End Source File
# Begin Source File
SOURCE=..\..\Public\IPT\IPT_Str.h
# End Source File
# Begin Source File
SOURCE=..\..\Public\IPT\IPT_Ver.h
# End Source File
# Begin Source File
SOURCE=..\..\Public\IPT.h
# End Source File
# Begin Source File
SOURCE=..\..\Public\INO\Joystick.h
# End Source File
# Begin Source File
SOURCE=..\..\Public\INO\Keyboard.h
# End Source File
# Begin Source File
SOURCE=..\..\Public\IPT\MemIPT.h
# End Source File
# Begin Source File
SOURCE=..\..\Public\INO\Mouse.h
# End Source File
# End Group
# Begin Source File
SOURCE=.\IPT_WIN.mak
# End Source File
# End Target
# End Project

View File

@@ -0,0 +1,295 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="IPT_WIN"
ProjectGUID="{A5077928-F1CB-4A38-9F33-C72ECDA2B512}"
SccProjectName="&quot;$/cpa/tempgrp/IPT&quot;, HJDAAAAA"
SccAuxPath=""
SccLocalPath="."
SccProvider="MSSCCI:NXN alienbrain">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug DREAMCAST|Win32"
OutputDirectory=".\IPT___Wi"
IntermediateDirectory=".\IPT___Wi"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
OptimizeForProcessor="1"
AdditionalIncludeDirectories="x:\Cpa\Public,x:\Cpa\Public\IPT,t:\dxsdk\sdk\inc"
PreprocessorDefinitions="DREAM;_DEBUG;VISUAL;WIN32;USE_PROFILER;MTH_CHECK;CPA_WANTS_EXPORT"
RuntimeLibrary="2"
PrecompiledHeaderFile=".\IPT___Wi/IPT_WIN.pch"
AssemblerListingLocation=".\IPT___Wi/"
ObjectFile=".\IPT___Wi/"
ProgramDataBaseFileName=".\IPT___Wi/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="1"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\Lib\IPTP5DC_vd.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory="x:\cpa\libd"
IntermediateDirectory=".\tmp\debug"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
OptimizeForProcessor="1"
AdditionalIncludeDirectories="x:\Cpa\Public,x:\Cpa\Public\IPT,t:\dxsdk\sdk\inc"
PreprocessorDefinitions="_DEBUG;VISUAL;WIN32;USE_PROFILER;MTH_CHECK;CPA_WANTS_EXPORT"
RuntimeLibrary="3"
PrecompiledHeaderFile=".\tmp\debug/IPT_WIN.pch"
AssemblerListingLocation=".\tmp\debug/"
ObjectFile=".\tmp\debug/"
ProgramDataBaseFileName=".\tmp\debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="1"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="x:\CPA\Libd\IPTP5_vd.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Sources"
Filter=".c,.cpp">
<File
RelativePath="IPT_Anal.c">
<FileConfiguration
Name="Debug DREAMCAST|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="IPT_Hist.c">
<FileConfiguration
Name="Debug DREAMCAST|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="IPT_Kwan.c">
<FileConfiguration
Name="Debug DREAMCAST|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="IPT_Main.c">
<FileConfiguration
Name="Debug DREAMCAST|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="IPT_Save.c">
<FileConfiguration
Name="Debug DREAMCAST|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="P5\IPT_Scpt.c">
<FileConfiguration
Name="Debug DREAMCAST|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Includes"
Filter=".h,.hpp">
<File
RelativePath="..\..\Public\IPT\ErrIPT.h">
</File>
<File
RelativePath="..\..\Public\IPT.h">
</File>
<File
RelativePath="..\..\Public\IPT\IPT_Anal.h">
</File>
<File
RelativePath="..\..\Public\IPT\IPT_CPA.h">
</File>
<File
RelativePath="..\..\Public\IPT\IPT_Def.h">
</File>
<File
RelativePath="..\..\Public\IPT\IPT_Hist.h">
</File>
<File
RelativePath="..\..\Public\IPT\IPT_KDef.h">
</File>
<File
RelativePath="..\..\Public\IPT\IPT_Kwan.h">
</File>
<File
RelativePath="..\..\Public\IPT\IPT_Main.h">
</File>
<File
RelativePath="..\..\Public\IPT\IPT_Save.h">
</File>
<File
RelativePath="..\..\Public\IPT\IPT_Scpt.h">
</File>
<File
RelativePath="..\..\Public\IPT\IPT_Str.h">
</File>
<File
RelativePath="..\..\Public\IPT\IPT_Ver.h">
</File>
<File
RelativePath="..\..\Public\INO\Joystick.h">
</File>
<File
RelativePath="..\..\Public\INO\Keyboard.h">
</File>
<File
RelativePath="..\..\Public\IPT\MemIPT.h">
</File>
<File
RelativePath="..\..\Public\INO\Mouse.h">
</File>
</Filter>
<File
RelativePath="IPT_WIN.mak">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,619 @@
/*=========================================================================
* IPT_Scpt.c :
* Script read
*
* (c) Ubi Studios 1997
*=======================================================================*/
#include "IPT_CPA.h"
#include "MemIPT.h"
#include "ErrIPT.h"
#include "IPT_Def.h"
#include "IPT_Hdl.h"
#define D_IPT_Input_StructureDefine
#include "IPT_KDef.h"
#include "IPT_Str.h"
#undef D_IPT_Input_StructureDefine
#include "IPT_Main.h"
#include "IPT_Scpt.h"
#include "Tmp.h"
#if !defined(U64)
void IPT_fn_vComputeArrayFromList(void)
{
unsigned long i,j;
IPT_tdxHandleToEntryElement hEntryElement,hEntryElementNext;
IPT_tdxHandleToKeyWordElement hKeyWord,hKeyWordNext;
/**** Destroy arrays ****/
#if !defined(ACTIVE_EDITOR)
if (IPT_g_hInputStructure.d_stEntryElementArray!=NULL)
{
for (i=0;i<IPT_g_hInputStructure.ulNumberOfEntryElement;i++)
{
IPT_fn_vFree(&IPT_g_hInputStructure.d_stEntryElementArray[i].d_stKeyWordElementArray);
}
IPT_fn_vFree(&IPT_g_hInputStructure.d_stEntryElementArray);
}
#endif /* ACTIVE_EDITOR */
/**** Allocation of the EntryElement array ****/
IPT_g_hInputStructure.ulNumberOfEntryElement = LST2_M_DynamicGetNumberOfElements(&IPT_g_hInputStructure.hEntryElement);
if (IPT_g_hInputStructure.ulNumberOfEntryElement!=0)
IPT_g_hInputStructure.d_stEntryElementArray = (IPT_tdstEntryElement *)IPT_fn_p_vAlloc(IPT_g_hInputStructure.ulNumberOfEntryElement* sizeof(struct IPT_tdstEntryElement_ ));
LST2_M_DynamicForEachMovingElementOf(&IPT_g_hInputStructure.hEntryElement,hEntryElement,hEntryElementNext,i)
{
IPT_g_hInputStructure.d_stEntryElementArray[i].p_szActionName = hEntryElement->p_szActionName;
IPT_g_hInputStructure.d_stEntryElementArray[i].p_szEntryName = hEntryElement->p_szEntryName;
IPT_g_hInputStructure.d_stEntryElementArray[i].lState = hEntryElement->lState;
IPT_g_hInputStructure.d_stEntryElementArray[i].xAnalogicValue = hEntryElement->xAnalogicValue;
IPT_g_hInputStructure.d_stEntryElementArray[i].bIsActivate = hEntryElement->bIsActivate;
IPT_g_hInputStructure.d_stEntryElementArray[i].ulNumberOfKeyWordElement = LST2_M_DynamicGetNumberOfElements(&hEntryElement->hKeyWordList);
if (IPT_g_hInputStructure.d_stEntryElementArray[i].ulNumberOfKeyWordElement!=0)
IPT_g_hInputStructure.d_stEntryElementArray[i].d_stKeyWordElementArray = (IPT_tdstKeyWordElement *)IPT_fn_p_vAlloc(IPT_g_hInputStructure.d_stEntryElementArray[i].ulNumberOfKeyWordElement*sizeof(struct IPT_tdstKeyWordElement_));
LST2_M_DynamicForEachMovingElementOf(&hEntryElement->hKeyWordList,hKeyWord,hKeyWordNext,j)
{
IPT_g_hInputStructure.d_stEntryElementArray[i].d_stKeyWordElementArray[j].u_ElementUnion = hKeyWord->u_ElementUnion;
IPT_g_hInputStructure.d_stEntryElementArray[i].d_stKeyWordElementArray[j].ucResult = hKeyWord->ucResult;
IPT_g_hInputStructure.d_stEntryElementArray[i].d_stKeyWordElementArray[j].ucMinCounterInput = hKeyWord->ucMinCounterInput;
IPT_g_hInputStructure.d_stEntryElementArray[i].d_stKeyWordElementArray[j].ucMaxCounterInput = hKeyWord->ucMaxCounterInput;
if ( hKeyWord->u_ElementUnion.swKeyWord==IPT_E_KeyWord_ActionJustValidated
||hKeyWord->u_ElementUnion.swKeyWord==IPT_E_KeyWord_ActionValidated
||hKeyWord->u_ElementUnion.swKeyWord==IPT_E_KeyWord_ActionJustInvalidated
||hKeyWord->u_ElementUnion.swKeyWord==IPT_E_KeyWord_ActionInvalidated)
{
LST2_M_DynamicGetNextElement(hKeyWord)->u_ElementUnion.hEntryElement = IPT_fn_hGetEntryActionHandle((char *)(LST2_M_DynamicGetNextElement(hKeyWord)->u_ElementUnion.hEntryElement));
}
#if !defined(ACTIVE_EDITOR)
LST2_M_DynamicIsolate(hKeyWord);
IPT_fn_vFree(&hKeyWord);
#endif /* ACTIVE_EDITOR */
}
#if !defined(ACTIVE_EDITOR)
LST2_M_DynamicIsolate(hEntryElement);
IPT_fn_vFree(&hEntryElement);
#endif /* ACTIVE_EDITOR */
}
}
/*************************************************************************/
void IPT_fn_vReadInputScript(char *_szName)
{
SCR_fnp_st_RdL0_AnalyseSection(_szName, SCR_CDF_uw_Anl_ForceAnalyse);
}
void IPT_fn_vEndReadInputScript(void)
{
/**** Transform list in array ****/
IPT_fn_vComputeArrayFromList();
}
/*************************************************************************/
IPT_tdxHandleToEntryElement IPT_fn_hGetEntryActionHandle(char *_szKeyActionName)
{
/*
IPT_tdxHandleToEntryElement hAction = NULL;
SCR_tdst_Link_Value *p_xIndex;
p_xIndex = SCR_fnp_st_Link_SearchKey(&IPT_g_hInputStructure.stEntryLink,_szKeyActionName);
if (p_xIndex!=NULL&&SCR_M_e_Link_GetState(p_xIndex)==SCR_ELS_Link_Initialized)
hAction = (IPT_tdxHandleToEntryElement)SCR_M_ul_Link_GetValue(p_xIndex);
return(hAction);
*/
unsigned long i;
IPT_tdxHandleToEntryElement hAction = NULL;
for (i=0;hAction==NULL&&i<IPT_g_hInputStructure.ulNumberOfEntryElement;i++)
{
if (!stricmp(IPT_g_hInputStructure.d_stEntryElementArray[i].p_szActionName,_szKeyActionName))
hAction = &IPT_g_hInputStructure.d_stEntryElementArray[i];
}
return(hAction);
}
/*************************************************************************/
SCR_tde_Anl_ReturnValue IPT_fn_eAddKeyActionScriptCallBack(SCR_tdst_File_Description *_p_stFile,char *_p_szName,char *_ap_szParams[],SCR_tde_Anl_Action _eAction)
{
SCR_tde_Anl_ReturnValue eReturnValue = SCR_ERV_Anl_NormalReturn;
IPT_tdxHandleToEntryElement hEntryElement;
/* SCR_tdst_Link_Value *p_xIndex;*/
if (M_IsTitle)
{
/*
Mmg_M_SetModeAlloc4Ch(IPT,E_ucIPTMemoryBlock,C_ucMmgDefaultChannel);
MMG_fn_vAddMemoryInfo(MMG_C_lTypeIPT,MMG_C_lSubTypeIPT,0);
if ((hEntryElement = (IPT_tdxHandleToEntryElement)Mmg_fn_p_vAlloc4Ch(sizeof(struct IPT_tdstEntryElement_),C_ucMmgDefaultChannel))==NULL)
M_IPTFatalError(E_uwIPT_AllocNewKeyAction);
*/
MMG_fn_vAddMemoryInfo(MMG_C_lTypeIPT,MMG_C_lSubTypeIPT,0);
hEntryElement = (IPT_tdxHandleToEntryElement)IPT_fn_p_vAlloc(sizeof(struct IPT_tdstEntryElement_));
memset(hEntryElement,0,sizeof(struct IPT_tdstEntryElement_));
SCR_M_RdL0_SetSectionLong(C_ThisSection,0,hEntryElement);
LST2_M_DynamicInitElement(hEntryElement);
LST2_M_DynamicAddTail(&IPT_g_hInputStructure.hEntryElement,hEntryElement);
LST2_M_DynamicInitAnchor(&hEntryElement->hKeyWordList);
hEntryElement->lState = -2;
hEntryElement->bIsActivate = IPT_C_TRUE;
if (_ap_szParams[0]!=NULL&&!stricmp(_ap_szParams[0],IPT_C_ParamOptions))
{
MMG_fn_vAddMemoryInfo(MMG_C_lTypeIPT,MMG_C_lSubTypeIPT,0);
/* if ((hEntryElement->p_szEntryName = (char*)Mmg_fn_p_vAlloc4Ch((strlen(_p_szName)+1)*sizeof(char),C_ucMmgDefaultChannel))==NULL)
M_IPTFatalError(E_uwIPT_AllocNewKeyAction);
*/
hEntryElement->p_szEntryName = (char*)IPT_fn_p_vAlloc(strlen(_p_szName)+1);
strcpy(hEntryElement->p_szEntryName,_p_szName);
}
hEntryElement->p_szActionName = (char*)TMP_M_p_Malloc(strlen(_p_szName)+1);
strcpy(hEntryElement->p_szActionName,_p_szName);
/* p_xIndex=SCR_fnp_st_Link_CreateOrGetLinkFromKey(&IPT_g_hInputStructure.stEntryLink,_p_szName);
if (p_xIndex!=NULL&&p_xIndex->eState==SCR_ELS_Link_NotInitialized)
{
SCR_fnp_st_Link_SetValue(&IPT_g_hInputStructure.stEntryLink,_p_szName,(unsigned long)hEntryElement);
}
else if (p_xIndex!=NULL&&p_xIndex->eState==SCR_ELS_Link_Initialized)
{
M_IPTFatalError(E_uwIPT_NewKeyActionAlreadyExist);
}
*/
}
else if (M_IsEntry)
{
IPT_tdxHandleToKeyWordElement hKeyWordOrderElement,hKeyWordElement;
SCR_M_RdL0_GetSectionLong(C_ThisSection,0,IPT_tdxHandleToEntryElement,hEntryElement);
hKeyWordOrderElement=IPT_fn_hAllocKeyWord();
hKeyWordOrderElement->u_ElementUnion.swKeyWord = IPT_fn_swGetKeyValue(_p_szName,IPT_g_hScriptKeyWordValue);
LST2_M_DynamicInitElement(hKeyWordOrderElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordOrderElement);
/**** All following keyword take a key in parameter ****/
if ( hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_KeyJustPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_KeyPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_KeyJustReleased
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_KeyReleased)
{
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swKeyWord = IPT_fn_swGetKeyValue(_ap_szParams[0],IPT_g_hScriptKeyValue);
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordElement);
}
/**** All following keyword take a pad in parameter ****/
if ( hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_PadJustPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_PadPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_PadJustReleased
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_PadReleased
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickOrPadPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickOrPadJustPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickOrPadReleased
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickOrPadJustReleased)
{
/**** Pad Number ****/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swPadNumber = atoi(_ap_szParams[0]);
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordElement);
/**** Pad Action ****/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swPadAction = IPT_fn_swGetKeyValue(_ap_szParams[1],IPT_g_hScriptPadValue);
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordElement);
}
/**** All following keyword take a joystick in parameter ****/
if ( hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickAxeValue)
{
/**** Joystick Number ****/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swJoyNumber = atoi(_ap_szParams[0]);
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordElement);
/**** Joystick Action ****/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swJoyAction = IPT_fn_swGetKeyValue(_ap_szParams[1],IPT_g_hScriptPadValue);
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordElement);
/**** Joystick Min Value ****/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swJoyValueMin = atoi(_ap_szParams[2]);
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordElement);
/**** Joystick Max Value ****/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swJoyValueMax = atoi(_ap_szParams[3]);
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordElement);
}
/**** All following keyword take a joystick in parameter ****/
if ( hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickJustPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickJustReleased
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickReleased)
{
/**** Pad Number ****/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swJoyNumber = atoi(_ap_szParams[0]);
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordElement);
/**** Pad Action ****/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swJoyAction = IPT_fn_swGetKeyValue(_ap_szParams[1],IPT_g_hScriptPadValue);
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordElement);
}
/**** All following keyword take a Entry Handle in parameter ****/
if ( hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_ActionJustValidated
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_ActionValidated
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_ActionJustInvalidated
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_ActionInvalidated)
{
hKeyWordElement=IPT_fn_hAllocKeyWord();
/* hKeyWordElement->u_ElementUnion.hEntryElement = IPT_fn_hGetEntryActionHandle(_ap_szParams[0]);*/
hKeyWordElement->u_ElementUnion.hEntryElement = TMP_M_p_Malloc(strlen(_ap_szParams[0])+1);
strcpy((char*)hKeyWordElement->u_ElementUnion.hEntryElement,_ap_szParams[0]);
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
/*
if (!IPT_fn_bIsAValidEntryActionHandle(hKeyWordElement->u_ElementUnion.hEntryElement))
M_IPTFatalError(E_uwIPT_UnknownActionValue);
*/
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordElement);
}
/**** All following keyword can have time notion ****/
if ( hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_KeyPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_KeyReleased
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_ActionValidated
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_ActionInvalidated)
{
if (_ap_szParams[1]!=NULL)
{
hKeyWordElement->ucMinCounterInput = atoi(_ap_szParams[1]);
if (_ap_szParams[2]!=NULL)
hKeyWordElement->ucMaxCounterInput = atoi(_ap_szParams[2]);
}
}
else if ( hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_PadPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_PadReleased
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickReleased
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickOrPadPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickOrPadReleased)
{
if (_ap_szParams[2]!=NULL)
{
hKeyWordElement->ucMinCounterInput = atoi(_ap_szParams[2]);
if (_ap_szParams[3]!=NULL)
hKeyWordElement->ucMaxCounterInput = atoi(_ap_szParams[3]);
}
}
}
return(eReturnValue);
}
/*************************************************************************/
SCR_tde_Anl_ReturnValue IPT_fn_eSequenceCallBack(SCR_tdst_File_Description *_p_stFile,char *_p_szName,char *_ap_szParams[],SCR_tde_Anl_Action _eAction)
{
SCR_tde_Anl_ReturnValue eReturnValue = SCR_ERV_Anl_NormalReturn;
IPT_tdxHandleToEntryElement hEntryElement;
IPT_tdxHandleToKeyWordElement hSequenceKeyWordElement,hSequenceOrderKeyWordElement;
IPT_tdxHandleToKeyWordElement hKeyWordElement;
long ulNumberOfSequence;
SCR_M_RdL0_GetSectionLong(C_ParentSection,0,IPT_tdxHandleToEntryElement,hEntryElement);
if (M_IsTitle)
{
hSequenceKeyWordElement=IPT_fn_hAllocKeyWord();
hSequenceKeyWordElement->u_ElementUnion.swKeyWord = IPT_fn_swGetKeyValue(IPT_C_SequenceSection,IPT_g_hScriptKeyWordValue);
LST2_M_DynamicInitElement(hSequenceKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hSequenceKeyWordElement);
SCR_M_RdL0_SetSectionLong(C_ThisSection,0,hSequenceKeyWordElement);
SCR_M_RdL0_SetSectionLong(C_ThisSection,1,0);
}
else if (M_IsEntry)
{
SCR_M_RdL0_GetSectionLong(C_ThisSection,0,IPT_tdxHandleToKeyWordElement,hSequenceKeyWordElement);
SCR_M_RdL0_GetSectionLong(C_ThisSection,1,unsigned long,ulNumberOfSequence);
SCR_M_RdL0_SetSectionLong(C_ThisSection,1,ulNumberOfSequence+1);
hSequenceOrderKeyWordElement=IPT_fn_hAllocKeyWord();
hSequenceOrderKeyWordElement->u_ElementUnion.swKeyWord = IPT_fn_swGetKeyValue(_p_szName,IPT_g_hScriptKeyWordValue);
LST2_M_DynamicInitElement(hSequenceOrderKeyWordElement);
LST2_M_DynamicInsertBetween(hSequenceOrderKeyWordElement,hSequenceKeyWordElement,LST2_M_DynamicGetNextElement(hSequenceKeyWordElement));
if (hSequenceOrderKeyWordElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_SequenceKey)
{
hSequenceOrderKeyWordElement->u_ElementUnion.swKeyWord=IPT_E_KeyWord_SequenceKeyEnd;
if (LST2_M_DynamicGetNextElement(hSequenceOrderKeyWordElement)!=NULL)
LST2_M_DynamicGetNextElement(hSequenceOrderKeyWordElement)->u_ElementUnion.swKeyWord=IPT_E_KeyWord_SequenceKey;
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swKeyWord = IPT_fn_swGetKeyValue(_ap_szParams[0],IPT_g_hScriptKeyValue);
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
if (_ap_szParams[1]!=NULL)
{
hKeyWordElement->ucMinCounterInput = atoi(_ap_szParams[1]);
if (_ap_szParams[2]!=NULL)
hKeyWordElement->ucMaxCounterInput = atoi(_ap_szParams[2]);
}
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicInsertBetween(hKeyWordElement,hSequenceOrderKeyWordElement,LST2_M_DynamicGetNextElement(hSequenceOrderKeyWordElement));
}
else if (hSequenceOrderKeyWordElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_SequencePad)
{
hSequenceOrderKeyWordElement->u_ElementUnion.swKeyWord=IPT_E_KeyWord_SequencePadEnd;
if (LST2_M_DynamicGetNextElement(hSequenceOrderKeyWordElement)!=NULL)
LST2_M_DynamicGetNextElement(hSequenceOrderKeyWordElement)->u_ElementUnion.swKeyWord=IPT_E_KeyWord_SequencePad;
/**** Pad Action ****/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swKeyWord = IPT_fn_swGetKeyValue(_ap_szParams[1],IPT_g_hScriptPadValue);
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
if (_ap_szParams[2]!=NULL)
{
hKeyWordElement->ucMinCounterInput = atoi(_ap_szParams[2]);
if (_ap_szParams[3]!=NULL)
hKeyWordElement->ucMaxCounterInput = atoi(_ap_szParams[3]);
}
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicInsertBetween(hKeyWordElement,hSequenceOrderKeyWordElement,LST2_M_DynamicGetNextElement(hSequenceOrderKeyWordElement));
/**** Pad Number ****/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swJoyNumber = atoi(_ap_szParams[0]);
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicInsertBetween(hKeyWordElement,hSequenceOrderKeyWordElement,LST2_M_DynamicGetNextElement(hSequenceOrderKeyWordElement));
}
}
else if (M_IsEnd)
{
SCR_M_RdL0_GetSectionLong(C_ThisSection,0,IPT_tdxHandleToKeyWordElement,hSequenceKeyWordElement);
SCR_M_RdL0_GetSectionLong(C_ThisSection,1,unsigned long,ulNumberOfSequence);
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.ulNumberOfSequence = ulNumberOfSequence;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicInsertBetween(hKeyWordElement,hSequenceKeyWordElement,LST2_M_DynamicGetNextElement(hSequenceKeyWordElement));
}
return(eReturnValue);
}
/*************************************************************************/
SCR_tde_Anl_ReturnValue IPT_fn_eActivateDeviceScriptCallBack(SCR_tdst_File_Description *_p_stFile,char *_p_szName,char *_ap_szParams[],SCR_tde_Anl_Action _eAction)
{
SCR_tde_Anl_ReturnValue eReturnValue = SCR_ERV_Anl_NormalReturn;
if (M_IsEntry)
{
if (M_ActionIs(IPT_C_ActivatePadAction))
{
unsigned long ulPadNumber = atoi(_ap_szParams[0]);
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber]==IPT_C_ActivateJoystickDevice)
M_IPTFatalError(E_uwIPT_AlreadyActivateAsAJoystick);
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber] == IPT_C_ValideDevice)
{
fn_wJoyAddActiveJoystick((short)ulPadNumber);
IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber] = IPT_C_ActivatePadDevice;
IPT_g_hInputStructure.ucOnePadActivate = IPT_C_ActivateDevice;
}
}
else if (M_ActionIs(IPT_C_ActivateJoystickAction))
{
unsigned long ulPadNumber = atoi(_ap_szParams[0]);
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber]==IPT_C_ActivatePadDevice)
M_IPTFatalError(E_uwIPT_AlreadyActivateAsAPad);
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber] == IPT_C_ValideDevice)
{
fn_wJoyAddActiveJoystick((short)ulPadNumber);
IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber] = IPT_C_ActivateJoystickDevice;
IPT_g_hInputStructure.ucOnePadActivate = IPT_C_ActivateDevice;
}
}
else if (M_ActionIs(IPT_C_ActivateKeyboardAction))
{
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_KeyboardDeviceEvent] == IPT_C_ValideDevice)
IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_KeyboardDeviceEvent] = IPT_C_ActivateDevice;
}
}
return(eReturnValue);
}
/*************************************************************************/
SCR_tde_Anl_ReturnValue IPT_fn_eKeyDefineScriptCallBack(SCR_tdst_File_Description *_p_stFile,char *_p_szName,char *_ap_szParams[],SCR_tde_Anl_Action _eAction)
{
SCR_tde_Anl_ReturnValue eReturnValue = SCR_ERV_Anl_NormalReturn;
unsigned long ulKeyNumber;
unsigned long ulKeyMaxNumber;
if (M_IsTitle)
{
ulKeyMaxNumber = atoi(_ap_szParams[0]);
Mmg_M_SetModeAlloc4Ch(IPT,E_ucIPTMemoryBlock,C_ucMmgDefaultChannel);
MMG_fn_vAddMemoryInfo(MMG_C_lTypeIPT,MMG_C_lSubTypeIPT,0);
if ((IPT_gd_hKeyAndPadDefine = (struct IPT_tdstKeyAndPadDefine_ *)Mmg_fn_p_vAlloc4Ch((ulKeyMaxNumber+1)*sizeof(struct IPT_tdstKeyAndPadDefine_),C_ucMmgDefaultChannel))==NULL)
M_IPTFatalError(E_uwIPT_NoMemory);
ulKeyNumber = 0;
SCR_M_RdL0_SetSectionLong(C_ThisSection,0,ulKeyNumber);
SCR_M_RdL0_SetSectionLong(C_ThisSection,1,ulKeyMaxNumber);
}
else if (M_IsEntry)
{
SCR_M_RdL0_GetSectionLong(C_ThisSection,0,unsigned long,ulKeyNumber);
SCR_M_RdL0_GetSectionLong(C_ThisSection,1,unsigned long,ulKeyMaxNumber);
if (M_ActionIs(IPT_C_KeyDefineAction))
{
if (ulKeyNumber>ulKeyMaxNumber)
M_IPTFatalError(E_uwIPT_TooMuchKeyDefine);
if (IPT_fn_p_szGetKeyPointerOfName(_ap_szParams[0],IPT_g_hScriptKeyValue)==NULL)
{
if (IPT_fn_p_szGetKeyPointerOfName(_ap_szParams[0],IPT_g_hScriptPadValue)==NULL)
{
M_IPTFatalError(E_uwIPT_UnknownKeyValue);
}
else
{
IPT_gd_hKeyAndPadDefine[ulKeyNumber].uwBasedKey = IPT_fn_swGetKeyValue(_ap_szParams[0],IPT_g_hScriptPadValue)|0x8000;
IPT_gd_hKeyAndPadDefine[ulKeyNumber].p_szFrenchKey =
IPT_gd_hKeyAndPadDefine[ulKeyNumber].p_szAmericanKey = IPT_fn_p_szGetKeyPointerOfName(_ap_szParams[0],IPT_g_hScriptPadValue);
}
}
else
{
IPT_gd_hKeyAndPadDefine[ulKeyNumber].uwBasedKey = IPT_fn_swGetKeyValue(_ap_szParams[0],IPT_g_hScriptKeyValue);
IPT_gd_hKeyAndPadDefine[ulKeyNumber].p_szFrenchKey =
IPT_gd_hKeyAndPadDefine[ulKeyNumber].p_szAmericanKey = IPT_fn_p_szGetKeyPointerOfName(_ap_szParams[0],IPT_g_hScriptKeyValue);
}
if (SCR_fn_uc_RdL0_GetNumberOfParameters(_ap_szParams)>1)
{
Mmg_M_SetModeAlloc4Ch(IPT,E_ucIPTMemoryBlock,C_ucMmgDefaultChannel);
MMG_fn_vAddMemoryInfo(MMG_C_lTypeIPT,MMG_C_lSubTypeIPT,0);
if ((IPT_gd_hKeyAndPadDefine[ulKeyNumber].p_szFrenchKey = (char *)Mmg_fn_p_vAlloc4Ch(strlen(_ap_szParams[1])+1,C_ucMmgDefaultChannel))==NULL)
M_IPTFatalError(E_uwIPT_NoMemory);
strcpy(IPT_gd_hKeyAndPadDefine[ulKeyNumber].p_szFrenchKey,_ap_szParams[1]);
if (SCR_fn_uc_RdL0_GetNumberOfParameters(_ap_szParams)>2)
{
Mmg_M_SetModeAlloc4Ch(IPT,E_ucIPTMemoryBlock,C_ucMmgDefaultChannel);
MMG_fn_vAddMemoryInfo(MMG_C_lTypeIPT,MMG_C_lSubTypeIPT,0);
if ((IPT_gd_hKeyAndPadDefine[ulKeyNumber].p_szAmericanKey = (char *)Mmg_fn_p_vAlloc4Ch(strlen(_ap_szParams[2])+1,C_ucMmgDefaultChannel))==NULL)
M_IPTFatalError(E_uwIPT_NoMemory);
strcpy(IPT_gd_hKeyAndPadDefine[ulKeyNumber].p_szAmericanKey,_ap_szParams[2]);
}
else
{
IPT_gd_hKeyAndPadDefine[ulKeyNumber].p_szAmericanKey = IPT_gd_hKeyAndPadDefine[ulKeyNumber].p_szFrenchKey;
}
}
ulKeyNumber++;
SCR_M_RdL0_SetSectionLong(C_ThisSection,0,ulKeyNumber);
}
}
else if (M_IsEnd)
{
SCR_M_RdL0_GetSectionLong(C_ThisSection,0,unsigned long,ulKeyNumber);
SCR_M_RdL0_GetSectionLong(C_ThisSection,1,unsigned long,ulKeyMaxNumber);
if (ulKeyNumber>ulKeyMaxNumber)
M_IPTFatalError(E_uwIPT_TooMuchKeyDefine);
IPT_gd_hKeyAndPadDefine[ulKeyNumber].uwBasedKey = 0xffff;
}
return(eReturnValue);
}
#endif /* U64 */
/*************************************************************************/
signed short IPT_fn_swGetKeyValue(char *_szKeyName,IPT_tdxHandleToScriptValue _hScriptValueTable)
{
long i;
signed short swReturn = -1;
for (i=0;_hScriptValueTable[i].swKeyValue!=-1&&stricmp(_szKeyName,_hScriptValueTable[i].zsKeyName);i++);
if (_hScriptValueTable[i].swKeyValue==-1)
{
M_IPTFatalError(E_uwIPT_UnknownKeyValue);
}
else
swReturn = _hScriptValueTable[i].swKeyValue;
return(swReturn);
}
/*************************************************************************/
char *IPT_fn_szGetKeyName(signed short swValue,IPT_tdxHandleToScriptValue _hScriptValueTable)
{
long i;
char *szReturn;
for (i=0;_hScriptValueTable[i].swKeyValue!=-1&&_hScriptValueTable[i].swKeyValue!=swValue;i++);
if (_hScriptValueTable[i].swKeyValue==-1)
{
M_IPTFatalError(E_uwIPT_UnknownKeyValue);
}
else
szReturn = _hScriptValueTable[i].zsKeyName;
return(szReturn);
}
/*************************************************************************/
char *IPT_fn_p_szGetKeyPointerOfName(char *_szKeyName,IPT_tdxHandleToScriptValue _hScriptValueTable)
{
long i;
char *szReturn = NULL;
for (i=0;_hScriptValueTable[i].swKeyValue!=-1&&stricmp(_szKeyName,_hScriptValueTable[i].zsKeyName);i++);
if (_hScriptValueTable[i].swKeyValue!=-1)
szReturn = _hScriptValueTable[i].zsKeyName;
return(szReturn);
}
/*************************************************************************/
signed short IPT_fn_swConvertAZERTYtoQWERTY(signed short swAZERTY)
{
long i;
for (i=0;IPT_g_ConvertAZERTYtoQWERTY[i].swAZERTYKeyValue!=-1&&IPT_g_ConvertAZERTYtoQWERTY[i].swAZERTYKeyValue!=swAZERTY;i++);
if (IPT_g_ConvertAZERTYtoQWERTY[i].swAZERTYKeyValue==-1)
return(swAZERTY);
else
return(IPT_g_ConvertAZERTYtoQWERTY[i].swQWERTYKeyValue);
}
/*************************************************************************/

View File

@@ -0,0 +1,470 @@
#include "IPT_CPA.h"
#include "MemIPT.h"
#include "ErrIPT.h"
#include "IPT_Def.h"
#include "IPT_Hdl.h"
#define D_IPT_Input_StructureDefine
#include "IPT_KDef.h"
#include "IPT_Str.h"
#undef D_IPT_Input_StructureDefine
#include "IPT_Main.h"
#include "IPT_Scpt.h"
#include "ldt.h"
/*BEGIN FS 9/16/98*/
/*----------------------------------------------------------------------
* Description: callback for InputAction section from .IPT sript file
*----------------------------------------------------------------------
* Input:
* Output:
*----------------------------------------------------------------------
* Author: FS
* Creation date:9/16/98
* Modif date:
*----------------------------------------------------------------------*/
int LoadIPT_InputAction(LDT_tdst_Link *pLink)
{
IPT_tdxHandleToKeyWordElement hKeyWordOrderElement,hKeyWordElement;
LDT_tdeParseResult result=ParseResult_BeginSection;
char *szEntryName;
IPT_tdxHandleToEntryElement hEntryElement;
SCR_tdst_Link_Value *p_xIndex;
/*Working for BeginSection*/
Mmg_M_SetModeAlloc4Ch(IPT,E_ucIPTMemoryBlock,C_ucMmgDefaultChannel);
MMG_fn_vAddMemoryInfo(MMG_C_lTypeIPT,MMG_C_lSubTypeIPT,0);
if ((hEntryElement = (IPT_tdxHandleToEntryElement)Mmg_fn_p_vAlloc4Ch(sizeof(struct IPT_tdstEntryElement_),C_ucMmgDefaultChannel))==NULL)
M_IPTFatalError(E_uwIPT_AllocNewKeyAction);
memset(hEntryElement,0,sizeof(struct IPT_tdstEntryElement_));
LDT_SetFileLong(51,(unsigned long)hEntryElement);
LST2_M_DynamicInitElement(hEntryElement);
LST2_M_DynamicAddTail(&IPT_g_hInputStructure.hEntryElement,hEntryElement);
LST2_M_DynamicInitAnchor(&hEntryElement->hKeyWordList);
hEntryElement->lState = -2;
hEntryElement->bIsActivate = IPT_C_TRUE;
if (LDT_iGetNbParams()-1>0) /*there are params in "()"?*/
if (!stricmp(LDT_szGetParam(1),IPT_C_ParamOptions)) /*yes, if the first isn't "Options"*/
{
MMG_fn_vAddMemoryInfo(MMG_C_lTypeIPT,MMG_C_lSubTypeIPT,0);
if ((hEntryElement->p_szEntryName = (char*)Mmg_fn_p_vAlloc4Ch((strlen(LDT_szGetSectionName())+1)*sizeof(char),C_ucMmgDefaultChannel))==NULL)
M_IPTFatalError(E_uwIPT_AllocNewKeyAction);
strcpy(hEntryElement->p_szEntryName,LDT_szGetSectionName());
}
p_xIndex=SCR_fnp_st_Link_CreateOrGetLinkFromKey(&IPT_g_hInputStructure.stEntryLink,LDT_szGetSectionName());
if (p_xIndex!=NULL&&p_xIndex->eState==SCR_ELS_Link_NotInitialized)
{
SCR_fnp_st_Link_SetValue(&IPT_g_hInputStructure.stEntryLink,LDT_szGetSectionName(),(unsigned long)hEntryElement);
}
else if (p_xIndex!=NULL&&p_xIndex->eState==SCR_ELS_Link_Initialized)
{
M_IPTFatalError(E_uwIPT_NewKeyActionAlreadyExist);
}
/*Working for Entries*/
while( (result=LDT_GetNextEntry())!=ParseResult_EndSection )
{
if (result==ParseResult_BeginSection) /*is a SubSection?*/
{
LDT_LoadSection(NULL);
continue;
}
szEntryName=LDT_szGetEntryName();
hKeyWordOrderElement=IPT_fn_hAllocKeyWord();
hKeyWordOrderElement->u_ElementUnion.swKeyWord = IPT_fn_swGetKeyValue(szEntryName,IPT_g_hScriptKeyWordValue);
LST2_M_DynamicInitElement(hKeyWordOrderElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordOrderElement);
/**** All following keyword take a key in parameter ****/
if ( hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_KeyJustPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_KeyPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_KeyJustReleased
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_KeyReleased)
{
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swKeyWord = IPT_fn_swGetKeyValue(LDT_szGetParam(1),IPT_g_hScriptKeyValue);
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordElement);
}
/**** All following keyword take a pad in parameter ****/
if ( hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_PadJustPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_PadPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_PadJustReleased
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_PadReleased
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickOrPadPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickOrPadJustPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickOrPadReleased
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickOrPadJustReleased)
{
/**** Pad Number ****/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swPadNumber = atoi(LDT_szGetParam(1));
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordElement);
/**** Pad Action ****/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swPadAction = IPT_fn_swGetKeyValue(LDT_szGetParam(2),IPT_g_hScriptPadValue);
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordElement);
}
/**** All following keyword take a joystick in parameter ****/
if ( hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickAxeValue)
{
/**** Joystick Number ****/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swJoyNumber = atoi(LDT_szGetParam(1));
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordElement);
/**** Joystick Action ****/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swJoyAction = IPT_fn_swGetKeyValue(LDT_szGetParam(2),IPT_g_hScriptPadValue);
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordElement);
/**** Joystick Min Value ****/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swJoyValueMin = atoi(LDT_szGetParam(3));
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordElement);
/**** Joystick Max Value ****/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swJoyValueMax = atoi(LDT_szGetParam(4));
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordElement);
}
/**** All following keyword take a joystick in parameter ****/
if ( hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickJustPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickJustReleased
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickReleased)
{
/**** Pad Number ****/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swJoyNumber = atoi(LDT_szGetParam(1));
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordElement);
/**** Pad Action ****/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swJoyAction = IPT_fn_swGetKeyValue(LDT_szGetParam(2),IPT_g_hScriptPadValue);
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordElement);
}
/**** All following keyword take a Entry Handle in parameter ****/
if ( hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_ActionJustValidated
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_ActionValidated
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_ActionJustInvalidated
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_ActionInvalidated)
{
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.hEntryElement = IPT_fn_hGetEntryActionHandle(LDT_szGetParam(1));
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
if (!IPT_fn_bIsAValidEntryActionHandle(hKeyWordElement->u_ElementUnion.hEntryElement))
M_IPTFatalError(E_uwIPT_UnknownActionValue);
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hKeyWordElement);
}
/**** All following keyword can have time notion ****/
if ( hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_KeyPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_KeyReleased
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_ActionValidated
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_ActionInvalidated)
{
if (LDT_iGetNbParams()-1>1) /*more than 1 param in "()"*/
{
hKeyWordElement->ucMinCounterInput = atoi(LDT_szGetParam(2));
if (LDT_iGetNbParams()-1>2) /*more than 2 params in"()"*/
hKeyWordElement->ucMaxCounterInput = atoi(LDT_szGetParam(3));
}
}
else if (hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_PadPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_PadReleased
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickReleased
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickOrPadPressed
||hKeyWordOrderElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_JoystickOrPadReleased)
{
if (LDT_iGetNbParams()-1>2) /*more than 2 params in "()"*/
{
hKeyWordElement->ucMinCounterInput = atoi(LDT_szGetParam(3));
if (LDT_iGetNbParams()-1>3) /*more than 3 params in "()"*/
hKeyWordElement->ucMaxCounterInput = atoi(LDT_szGetParam(4));
}
}
} /*end while for entries*/
return 0;
}
/*END FS 9/16/98*/
/*BEGIN FS 9/16/98*/
/*----------------------------------------------------------------------
* Description: callback for Sequence section from .IPT sript file
*----------------------------------------------------------------------
* Input:
* Output:
*----------------------------------------------------------------------
* Author: FS
* Creation date:9/16/98
* Modif date:
*----------------------------------------------------------------------*/
int LoadIPT_Sequence( LDT_tdst_Link *pLink )
{
IPT_tdxHandleToEntryElement hEntryElement;
IPT_tdxHandleToKeyWordElement hSequenceKeyWordElement,hSequenceOrderKeyWordElement;
IPT_tdxHandleToKeyWordElement hKeyWordElement;
long ulNumberOfSequence=0;
LDT_tdeParseResult result=ParseResult_BeginSection;
char *szEntryName;
hEntryElement=(IPT_tdxHandleToEntryElement)LDT_GetFileLong(51);
/*Working for BeginSection*/
hSequenceKeyWordElement=IPT_fn_hAllocKeyWord();
hSequenceKeyWordElement->u_ElementUnion.swKeyWord = IPT_fn_swGetKeyValue(IPT_C_SequenceSection,IPT_g_hScriptKeyWordValue);
LST2_M_DynamicInitElement(hSequenceKeyWordElement);
LST2_M_DynamicAddTail(&hEntryElement->hKeyWordList,hSequenceKeyWordElement);
/*Working for Entries*/
result=LDT_GetNextEntry();
while( result!=ParseResult_EndSection )
{
szEntryName=LDT_szGetEntryName();
ulNumberOfSequence++;
hSequenceOrderKeyWordElement=IPT_fn_hAllocKeyWord();
hSequenceOrderKeyWordElement->u_ElementUnion.swKeyWord = IPT_fn_swGetKeyValue(szEntryName,IPT_g_hScriptKeyWordValue);
LST2_M_DynamicInitElement(hSequenceOrderKeyWordElement);
LST2_M_DynamicInsertBetween(hSequenceOrderKeyWordElement,hSequenceKeyWordElement,LST2_M_DynamicGetNextElement(hSequenceKeyWordElement));
if (hSequenceOrderKeyWordElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_SequenceKey)
{
hSequenceOrderKeyWordElement->u_ElementUnion.swKeyWord=IPT_E_KeyWord_SequenceKeyEnd;
if (LST2_M_DynamicGetNextElement(hSequenceOrderKeyWordElement)!=NULL)
LST2_M_DynamicGetNextElement(hSequenceOrderKeyWordElement)->u_ElementUnion.swKeyWord=IPT_E_KeyWord_SequenceKey;
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swKeyWord = IPT_fn_swGetKeyValue(LDT_szGetParam(1),IPT_g_hScriptKeyValue);
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
if (LDT_iGetNbParams()-1>1)
{
hKeyWordElement->ucMinCounterInput = atoi(LDT_szGetParam(2));
if (LDT_iGetNbParams()-1>2)
hKeyWordElement->ucMaxCounterInput = atoi(LDT_szGetParam(3));
}
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicInsertBetween(hKeyWordElement,hSequenceOrderKeyWordElement,LST2_M_DynamicGetNextElement(hSequenceOrderKeyWordElement));
}
else if (hSequenceOrderKeyWordElement->u_ElementUnion.swKeyWord==IPT_E_KeyWord_SequencePad)
{
hSequenceOrderKeyWordElement->u_ElementUnion.swKeyWord=IPT_E_KeyWord_SequencePadEnd;
if (LST2_M_DynamicGetNextElement(hSequenceOrderKeyWordElement)!=NULL)
LST2_M_DynamicGetNextElement(hSequenceOrderKeyWordElement)->u_ElementUnion.swKeyWord=IPT_E_KeyWord_SequencePad;
/**** Pad Action ****/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swKeyWord = IPT_fn_swGetKeyValue(LDT_szGetParam(2),IPT_g_hScriptPadValue);
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
if (LDT_iGetNbParams()-1>2)
{
hKeyWordElement->ucMinCounterInput = atoi(LDT_szGetParam(3));
if (LDT_iGetNbParams()-1>3)
hKeyWordElement->ucMaxCounterInput = atoi(LDT_szGetParam(4));
}
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicInsertBetween(hKeyWordElement,hSequenceOrderKeyWordElement,LST2_M_DynamicGetNextElement(hSequenceOrderKeyWordElement));
/**** Pad Number ****/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.swJoyNumber = atoi(LDT_szGetParam(1));
hKeyWordElement->ucMinCounterInput = 0;
hKeyWordElement->ucMaxCounterInput = 255;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicInsertBetween(hKeyWordElement,hSequenceOrderKeyWordElement,LST2_M_DynamicGetNextElement(hSequenceOrderKeyWordElement));
}
result=LDT_GetNextEntry();
} /*end while for entries*/
/*Working for EndSection*/
hKeyWordElement=IPT_fn_hAllocKeyWord();
hKeyWordElement->u_ElementUnion.ulNumberOfSequence = ulNumberOfSequence;
LST2_M_DynamicInitElement(hKeyWordElement);
LST2_M_DynamicInsertBetween(hKeyWordElement,hSequenceKeyWordElement,LST2_M_DynamicGetNextElement(hSequenceKeyWordElement));
return 0;
}
/*END FS 9/16/98*/
/*BEGIN FS 9/16/98*/
/*----------------------------------------------------------------------
* Description: callback for ActivateDevices section from .IPT sript file
*----------------------------------------------------------------------
* Input:
* Output:
*----------------------------------------------------------------------
* Author: FS
* Creation date:9/16/98
* Modif date:
*----------------------------------------------------------------------*/
int LoadIPT_ActivateDevices( LDT_tdst_Link *pLink )
{
LDT_tdeParseResult result=ParseResult_BeginSection;
char *szEntryName;
unsigned long ulPadNumber;
/*Working for Entries*/
result=LDT_GetNextEntry();
while( result!=ParseResult_EndSection )
{
szEntryName=LDT_szGetEntryName();
switch (*(long*)(szEntryName))
{
case 'daP': /*"Pad"*/
ulPadNumber = atoi(LDT_szGetParam(1));
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber]==IPT_C_ActivateJoystickDevice)
M_IPTFatalError(E_uwIPT_AlreadyActivateAsAJoystick);
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber] == IPT_C_ValideDevice)
{
fn_wJoyAddActiveJoystick((short)ulPadNumber);
IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber] = IPT_C_ActivatePadDevice;
IPT_g_hInputStructure.ucOnePadActivate = IPT_C_ActivateDevice;
}
break;
case 'syoJ': /*"Joystick"*/
ulPadNumber = atoi(LDT_szGetParam(1));
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber]==IPT_C_ActivatePadDevice)
M_IPTFatalError(E_uwIPT_AlreadyActivateAsAPad);
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber] == IPT_C_ValideDevice)
{
fn_wJoyAddActiveJoystick((short)ulPadNumber);
IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_Pad00DeviceEvent+ulPadNumber] = IPT_C_ActivateJoystickDevice;
IPT_g_hInputStructure.ucOnePadActivate = IPT_C_ActivateDevice;
}
break;
case 'ByeK': /*"KeyBoard"*/
if (IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_KeyboardDeviceEvent] == IPT_C_ValideDevice)
IPT_g_hInputStructure.p_ucValideAndActiveDevice[IPT_E_KeyboardDeviceEvent] = IPT_C_ActivateDevice;
break;
}
result=LDT_GetNextEntry();
} /*end while for entries*/
return 0;
}
/*END FS 9/16/98*/
/*BEGIN FS 9/16/98*/
/*----------------------------------------------------------------------
* Description: callback for KeyDefine section from .IPT script file
*----------------------------------------------------------------------
* Input:
* Output:
*----------------------------------------------------------------------
* Author: FS
* Creation date:9/16/98
* Modif date:
*----------------------------------------------------------------------*/
int LoadIPT_KeyDefine( LDT_tdst_Link *pLink )
{
LDT_tdeParseResult result=ParseResult_BeginSection;
char *szEntryName;
unsigned long ulKeyNumber,ulKeyMaxNumber;
/*Working for BeginSection*/
ulKeyMaxNumber = atoi(LDT_szGetParam(1));
Mmg_M_SetModeAlloc4Ch(IPT,E_ucIPTMemoryBlock,C_ucMmgDefaultChannel);
MMG_fn_vAddMemoryInfo(MMG_C_lTypeIPT,MMG_C_lSubTypeIPT,0);
if ((IPT_gd_hKeyAndPadDefine = (struct IPT_tdstKeyAndPadDefine_ *)Mmg_fn_p_vAlloc4Ch((ulKeyMaxNumber+1)*sizeof(struct IPT_tdstKeyAndPadDefine_),C_ucMmgDefaultChannel))==NULL)
M_IPTFatalError(E_uwIPT_NoMemory);
ulKeyNumber = 0;
/*Working for Entries*/
result=LDT_GetNextEntry();
while( result!=ParseResult_EndSection )
{
szEntryName=LDT_szGetEntryName();
switch (*(long*)(szEntryName))
{
case 'KweN': /*"NewKeyDefine"*/
if (ulKeyNumber>ulKeyMaxNumber)
M_IPTFatalError(E_uwIPT_TooMuchKeyDefine);
if (IPT_fn_p_szGetKeyPointerOfName(LDT_szGetParam(1),IPT_g_hScriptKeyValue)==NULL)
{
if (IPT_fn_p_szGetKeyPointerOfName(LDT_szGetParam(1),IPT_g_hScriptPadValue)==NULL)
{
M_IPTFatalError(E_uwIPT_UnknownKeyValue);
}
else
{
IPT_gd_hKeyAndPadDefine[ulKeyNumber].uwBasedKey = IPT_fn_swGetKeyValue(LDT_szGetParam(1),IPT_g_hScriptPadValue)|0x8000;
IPT_gd_hKeyAndPadDefine[ulKeyNumber].p_szFrenchKey =
IPT_gd_hKeyAndPadDefine[ulKeyNumber].p_szAmericanKey = IPT_fn_p_szGetKeyPointerOfName(LDT_szGetParam(1),IPT_g_hScriptPadValue);
}
}
else
{
IPT_gd_hKeyAndPadDefine[ulKeyNumber].uwBasedKey = IPT_fn_swGetKeyValue(LDT_szGetParam(1),IPT_g_hScriptKeyValue);
IPT_gd_hKeyAndPadDefine[ulKeyNumber].p_szFrenchKey =
IPT_gd_hKeyAndPadDefine[ulKeyNumber].p_szAmericanKey = IPT_fn_p_szGetKeyPointerOfName(LDT_szGetParam(1),IPT_g_hScriptKeyValue);
}
if ((LDT_iGetNbParams()-1)>1)
{
Mmg_M_SetModeAlloc4Ch(IPT,E_ucIPTMemoryBlock,C_ucMmgDefaultChannel);
MMG_fn_vAddMemoryInfo(MMG_C_lTypeIPT,MMG_C_lSubTypeIPT,0);
if ((IPT_gd_hKeyAndPadDefine[ulKeyNumber].p_szFrenchKey = (char *)Mmg_fn_p_vAlloc4Ch(strlen(LDT_szGetParam(2))+1,C_ucMmgDefaultChannel))==NULL)
M_IPTFatalError(E_uwIPT_NoMemory);
strcpy(IPT_gd_hKeyAndPadDefine[ulKeyNumber].p_szFrenchKey,LDT_szGetParam(2));
if ((LDT_iGetNbParams()-1)>2)
{
Mmg_M_SetModeAlloc4Ch(IPT,E_ucIPTMemoryBlock,C_ucMmgDefaultChannel);
MMG_fn_vAddMemoryInfo(MMG_C_lTypeIPT,MMG_C_lSubTypeIPT,0);
if ((IPT_gd_hKeyAndPadDefine[ulKeyNumber].p_szAmericanKey = (char *)Mmg_fn_p_vAlloc4Ch(strlen(LDT_szGetParam(3))+1,C_ucMmgDefaultChannel))==NULL)
M_IPTFatalError(E_uwIPT_NoMemory);
strcpy(IPT_gd_hKeyAndPadDefine[ulKeyNumber].p_szAmericanKey,LDT_szGetParam(3));
}
else
{
IPT_gd_hKeyAndPadDefine[ulKeyNumber].p_szAmericanKey = IPT_gd_hKeyAndPadDefine[ulKeyNumber].p_szFrenchKey;
}
}
ulKeyNumber++;
break;
}
result=LDT_GetNextEntry();
} /*end while for entries*/
/*Working for EndSection*/
if (ulKeyNumber>ulKeyMaxNumber)
M_IPTFatalError(E_uwIPT_TooMuchKeyDefine);
IPT_gd_hKeyAndPadDefine[ulKeyNumber].uwBasedKey = 0xffff;
return 0;
}
/*END FS 9/16/98*/

View File

@@ -0,0 +1,5 @@
SCC = This is a source code control file
[IPT_WIN.vcproj]
SCC_Aux_Path = "P4SCC#srvperforce-ma:1666##raymandata##Editor"
SCC_Project_Name = Perforce Project