Add rayman2 source files
This commit is contained in:
124
Rayman_X/cpa/tempgrp/AI/AIDebug/AID_Erm.h
Normal file
124
Rayman_X/cpa/tempgrp/AI/AIDebug/AID_Erm.h
Normal file
@@ -0,0 +1,124 @@
|
||||
/*///////////////////////////////////////////////////////////*/
|
||||
/**/
|
||||
/* Management of the Module : AIDebug*/
|
||||
/**/
|
||||
/* File Name : ErrAIDebug.h*/
|
||||
/* Date : 03/10/96*/
|
||||
/* Author : First_Name Last_Name*/
|
||||
/**/
|
||||
/*///////////////////////////////////////////////////////////*/
|
||||
/**/
|
||||
/* abbreviation of the module-name. Used in macro is 'AIDebug'*/
|
||||
/**/
|
||||
/*///////////////////////////////////////////////////////////*/
|
||||
|
||||
#ifndef __ERRAIDEBUG_H__
|
||||
#define __ERRAIDEBUG_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define C_szAIDebugVersion "AIDEBUG V5.0.0" /* The format is XXX Va.b.c with Xxx is the Tag of the module */
|
||||
#define C_szAIDebugFullName "My AIDebug module"/* the complete and clear name of the module */
|
||||
#define C_szAIDebugDate __DATE__ /*The format is "Mmm dd yyyy".You can use __DATE__ but be careful that you have the control of the compilation*/
|
||||
|
||||
/* For DLLs who are using this module : */
|
||||
#undef CPA_EXPORT
|
||||
#if defined(CPA_WANTS_IMPORT)
|
||||
#define CPA_EXPORT __declspec(dllimport)
|
||||
#elif defined(CPA_WANTS_EXPORT)
|
||||
#define CPA_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define CPA_EXPORT
|
||||
#endif
|
||||
|
||||
|
||||
#include "ERM.h"
|
||||
|
||||
#define __FATAL_ERR_AIDEBUG__
|
||||
#define __WARNING1_ERR_AIDEBUG__
|
||||
|
||||
/*----------*/
|
||||
/* Constant */
|
||||
/*----------*/
|
||||
/* error of the AIDebug Module*/
|
||||
typedef enum e_uwAIDebugErrNumber_{
|
||||
E_uwAIDebugFatalErr,
|
||||
#ifdef __FATAL_ERR_AIDEBUG__
|
||||
/* -----------------*/
|
||||
E_uwAIDebugFatalNotAFatalError,
|
||||
#endif /*__FATAL_ERR_AIDEBUG__*/
|
||||
E_uwAIDebugStartOfWarning,/* important constant, it allows to recognize if an error is fatal or not.*/
|
||||
#ifdef __WARNING1_ERR_AIDEBUG__
|
||||
/* -------------------*/
|
||||
E_uwAIDebugWarningInitFailureMem, /* memory error when initialisation */
|
||||
E_uwAIDebugWarningDesInitFailureMem,/* memory failure when desinitialisation */
|
||||
E_uwAIDebugWarningInvalidParameter,/* one parameter is invalid*/
|
||||
E_uwAIDebugWarningNullPointer, /* try to ccess fields of a null pointer */
|
||||
|
||||
E_uwAIDebugWarningShouldNotHappen,/* should never happen, but....*/
|
||||
#endif /*__WARNING1_ERR_AIDEBUG__*/
|
||||
E_uwAIDebugErrNumber
|
||||
} e_uwAIDebugErrNumber;
|
||||
|
||||
/*------------------*/
|
||||
/* Global Variables*/
|
||||
/*------------------*/
|
||||
#undef __ERRAIDEBUG_EXTERN
|
||||
#ifndef __DeclareGlobalVariableErrAIDebug_h__
|
||||
#define __ERRAIDEBUG_EXTERN extern /*external declaration*/
|
||||
#else /*__DeclareGlobalVariableErrAIDebug_h__*/
|
||||
#define __ERRAIDEBUG_EXTERN /*replace by nothing : we have to declare*/
|
||||
#endif /*__DeclareGlobalVariableErrAIDebug_h__*/
|
||||
|
||||
__ERRAIDEBUG_EXTERN CPA_EXPORT unsigned char g_ucAIDebugModuleId /*number of identification of the Erm module*/
|
||||
#if defined(__DeclareGlobalVariableErrAIDebug_h__) && !defined(CPA_WANTS_IMPORT)
|
||||
= C_ucModuleNotInitialized
|
||||
#endif /*__DeclareGlobalVariableErrAIDebug_h__&& CPA_WANTS_IMPORT*/
|
||||
;
|
||||
|
||||
#ifdef __ERROR_STRINGS__
|
||||
|
||||
__ERRAIDEBUG_EXTERN CPA_EXPORT char * g_a_szAIDebugInformationModule []
|
||||
#if defined(__DeclareGlobalVariableErrAIDebug_h__) && !defined(CPA_WANTS_IMPORT)
|
||||
= {C_szAIDebugVersion, C_szAIDebugFullName, C_szAIDebugDate}
|
||||
#endif /*__DeclareGlobalVariableErrAIDebug_h__ && CPA_WANTS_IMPORT*/
|
||||
;
|
||||
|
||||
__ERRAIDEBUG_EXTERN CPA_EXPORT struct tdstErrorMsg_ g_a_stAIDebugTabErr [] /* Mandatory syntax 'g_a_st'+[Abbreviation of ModuleName]+'TabErr'*/
|
||||
#if defined(__DeclareGlobalVariableErrAIDebug_h__) && !defined(CPA_WANTS_IMPORT)
|
||||
={
|
||||
#ifdef __FATAL_ERR_AIDEBUG__
|
||||
/* -------------*/
|
||||
E_uwAIDebugFatalNotAFatalError, "This is not a valide AI Debug fatal error",
|
||||
#endif /*__FATAL_ERR_AIDEBUG__*/
|
||||
#ifdef __WARNING1_ERR_AIDEBUG__
|
||||
/* ----------------*/
|
||||
E_uwAIDebugWarningInitFailureMem,"Initialisation failure due to memory problem",
|
||||
E_uwAIDebugWarningDesInitFailureMem,"Desinitialisation failure due to memory problem",
|
||||
E_uwAIDebugWarningInvalidParameter, "One parameter of the function is invalid",
|
||||
E_uwAIDebugWarningNullPointer, "Try to access fields of a null pointer",
|
||||
|
||||
E_uwAIDebugWarningShouldNotHappen,"This error should never happen!!!!",
|
||||
#endif /*__WARNING1_ERR_AIDEBUG__*/
|
||||
|
||||
0xFFFF, "\0"/*fin*/
|
||||
};
|
||||
#endif /*__DeclareGlobalVariableErrAIDebug_h__ && CPA_WANTS_IMPORT*/
|
||||
;
|
||||
|
||||
#endif /*__ERROR_STRINGS__*/
|
||||
|
||||
|
||||
/*** WARNING THIS IS A PARTICULAR MACRO, FUTUR BUG :( ***/
|
||||
/*#define M_bTestErrorOtherModule(ModuleName,_ChannelErrorNumber) \*/
|
||||
/* (g_uc## ModuleName ##ModuleId != g_stErmTheLastErrorInfo[_ChannelErrorNumber].ucLastFailedModuleId) */
|
||||
#define M_bTestErrorOtherModule(ModuleName,_ChannelErrorNumber) \
|
||||
(Erm_M_uwCheckError(ModuleName,ChannelErrorNumber) != C_uwErmNoErr)
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /*__ERRAIDEBUG_H__*/
|
19
Rayman_X/cpa/tempgrp/AI/AIDebug/AID_Head.h
Normal file
19
Rayman_X/cpa/tempgrp/AI/AIDebug/AID_Head.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
AI Debugger Headers file
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
File Name : AID_Head.h
|
||||
Date : November 15, 1996
|
||||
Author : Albert PAIS
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
Purpose :
|
||||
this file includes all headers relative to AIDebug modul
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
*/
|
||||
#undef extern
|
||||
#include "specif/AID_Trac.h"
|
||||
#include "AID_Main.h"
|
||||
/*#include "AID_Misc.h"*/
|
||||
/* error management :*/
|
||||
#include "ErrAID.h"
|
||||
#include "MemAID.h"
|
49
Rayman_X/cpa/tempgrp/AI/AIDebug/AID_Main.c
Normal file
49
Rayman_X/cpa/tempgrp/AI/AIDebug/AID_Main.c
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
------------------------------------------------------------------------------------------
|
||||
INCLUDE FILE :
|
||||
------------------------------------------------------------------------------------------
|
||||
*/
|
||||
/*
|
||||
memory and error management :
|
||||
*/
|
||||
#include "AIUseCpa.h"
|
||||
#include "specif/AIOption.h"
|
||||
#define __DeclareGlobalVariableMmgAIDebug_h__
|
||||
#include "AID_Mmg.h"
|
||||
#undef __DeclareGlobalVariableMmgAIDebug_h__
|
||||
#define __DeclareGlobalVariableErrAIDebug_h__
|
||||
#include "AID_Erm.h"
|
||||
#undef __DeclareGlobalVariableErrAIDebug_h__
|
||||
|
||||
#include "Action.h"
|
||||
#include "DsgMem.h"
|
||||
#include "specif/ActTable.h"
|
||||
#include "StrIntel.h"
|
||||
#include "GetSet.h"
|
||||
|
||||
#include "AID_Main.h"
|
||||
/*#include "AID_Eng.h"*/
|
||||
/*#include "AID_Misc.h"*/
|
||||
|
||||
#ifdef ACTIVE_AIDEBUG /* For AI debugger*/
|
||||
|
||||
/* Oliv' - becoz'of codewarrior (compatible with gcc)*/
|
||||
#ifdef U64_AIDEBUG
|
||||
#include "AID_Trac.h"
|
||||
extern tdstU64AIDebug g_stU64AIDebug;
|
||||
#endif
|
||||
|
||||
void AIDebug_fnv_InitMain(void)
|
||||
{
|
||||
/* Init error module :*/
|
||||
Erm_M_InitErrMsg(AIDebug);
|
||||
Mmg_M_InitMmg(AIDebug);
|
||||
/* Oliv' - becoz'of codewarrior (compatible with gcc)*/
|
||||
#ifdef U64_AIDEBUG
|
||||
g_stU64AIDebug.iU64AIDMaxIndex= D_SizeOfU64AIDBuffer;
|
||||
g_stU64AIDebug.iU64AIDCurrentIndex=0;
|
||||
memset( g_stU64AIDebug.a_stU64AIDBuffer, 0, D_SizeOfU64AIDBuffer*sizeof(AIDebug_tdstSectionEntry) );
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* ACTIVE_AIDEBUG For AI debugger*/
|
178
Rayman_X/cpa/tempgrp/AI/AIDebug/AID_Main.h
Normal file
178
Rayman_X/cpa/tempgrp/AI/AIDebug/AID_Main.h
Normal file
@@ -0,0 +1,178 @@
|
||||
/*
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
AI Debug main file
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
File Name : AID_Main.h
|
||||
Date : November 15, 1996
|
||||
Author : Albert PAIS
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
Purpose :
|
||||
This file defines structures and prototypes used by differents
|
||||
components of the AI debugger
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
*/
|
||||
|
||||
#if !defined(__AIDMAIN_TYPES__)
|
||||
#define __AIDMAIN_TYPES__
|
||||
|
||||
#if !defined(ONLY_TYPES)
|
||||
#define AIDMAIN_UNDEF
|
||||
#define ONLY_TYPES
|
||||
#endif /* !ONLY_TYPES */
|
||||
|
||||
/*
|
||||
------------------------------------------------------------------------------------------
|
||||
INCLUDE FILES :
|
||||
------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#if defined(AIDMAIN_UNDEF)
|
||||
#undef ONLY_TYPES
|
||||
#undef AIDMAIN_UNDEF
|
||||
#endif /* !AIDMAIN_UNDEF */
|
||||
|
||||
/*
|
||||
------------------------------------------------------------------------------------------
|
||||
TYPE DECLARATION :
|
||||
------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#endif /* !__AIDMAIN_TYPES__ */
|
||||
|
||||
#if !defined(ONLY_TYPES)
|
||||
|
||||
#if !defined(__AIDMAIN_VARS__)
|
||||
#define __AIDMAIN_VARS__
|
||||
|
||||
#undef EXTERN
|
||||
#undef extern
|
||||
#if !defined(GLOBALS)
|
||||
#define EXTERN extern
|
||||
#else /* !GLOBALS */
|
||||
#define EXTERN
|
||||
#endif /* !GLOBALS */
|
||||
|
||||
/*
|
||||
------------------------------------------------------------------------------------------
|
||||
VARIABLES DEFINITION :
|
||||
------------------------------------------------------------------------------------------
|
||||
*/
|
||||
#ifdef ACTIVE_AIDEBUG /* For AI debugger*/
|
||||
|
||||
#define AIDebug_C_ucIsReflex ((unsigned char)0)
|
||||
#define AIDebug_C_ucIsAI ((unsigned char)1)
|
||||
|
||||
#endif /* ACTIVE_AIDEBUG For AI debugger*/
|
||||
|
||||
#endif /* !__AIDMAIN_VARS__ */
|
||||
|
||||
#if !defined (__AIDMAIN_PROTOS__)
|
||||
#define __AIDMAIN_PROTOS__
|
||||
|
||||
/*
|
||||
------------------------------------------------------------------------------------------
|
||||
MACROS DECLARATION:
|
||||
------------------------------------------------------------------------------------------
|
||||
*/
|
||||
#ifdef ACTIVE_AIDEBUG /* For AI debugger*/
|
||||
|
||||
/* getting a slot from a structure :*/
|
||||
#define AIDebug_M_GetSlot(_p_stObject,_SlotName)\
|
||||
((_p_stObject)->m_##_SlotName)
|
||||
|
||||
/* memory for AIDebug module :*/
|
||||
#define AIDebug_M_xAlloc(_Var,_Type,_Size,_ErrorCode,_FailureDo)\
|
||||
if(_Size)\
|
||||
{\
|
||||
Mmg_M_SetModeAlloc4Ch(AIDebug,E_ucDynamic,C_ucMmgDefaultChannel);\
|
||||
_Var = (_Type)Mmg_fn_p_vAlloc4Ch(_Size,C_ucMmgDefaultChannel);\
|
||||
if(Erm_M_uwCheckError(Mmg,C_ucErmDefaultChannel)) /*** DR Mmg instead of Mem ***/ \
|
||||
{/* An error occured : initialisation failure*/ \
|
||||
Erm_M_ClearLastError(C_ucErmDefaultChannel); \
|
||||
Erm_M_UpdateLastError \
|
||||
( \
|
||||
AIDebug, /* Module 's name*/ \
|
||||
C_ucErmDefaultChannel, /*mutli-thread channel*/ \
|
||||
_ErrorCode, /* error code */ \
|
||||
C_lErmNoDebugData, /* long for debugging data */\
|
||||
C_ucErmOpenInfoWindow, /* open window ?*/ \
|
||||
C_ucAllowStopForDebug,/* wether to stop or not for debugging */\
|
||||
NULL \
|
||||
); \
|
||||
/* error ::*/ \
|
||||
(_Var) = (_Type)NULL;\
|
||||
_FailureDo;\
|
||||
}\
|
||||
}
|
||||
|
||||
#define AIDebug_M_xReAlloc(_Var,_Type,_Size,_ErrorCode,_FailureDo)\
|
||||
if(_Size)\
|
||||
{\
|
||||
Mmg_M_SetModeAlloc4Ch(AIDebug,E_ucDynamic,C_ucMmgDefaultChannel);\
|
||||
_Var = (_Type)Mmg_fn_p_vRealloc4Ch((void*)(_Var),_Size,C_ucMmgDefaultChannel);\
|
||||
if(Erm_M_uwCheckError(Mmg,C_ucErmDefaultChannel))\
|
||||
{/* An error occured : initialisation failure*/ \
|
||||
Erm_M_ClearLastError(C_ucErmDefaultChannel); \
|
||||
Erm_M_UpdateLastError \
|
||||
( \
|
||||
AIDebug, /* Module 's name*/ \
|
||||
C_ucErmDefaultChannel, /*mutli-thread channel*/ \
|
||||
_ErrorCode, /* error code */ \
|
||||
C_lErmNoDebugData, /* long for debugging data */\
|
||||
C_ucErmOpenInfoWindow, /* open window ?*/ \
|
||||
C_ucAllowStopForDebug,/* wether to stop or not for debugging */\
|
||||
NULL \
|
||||
); \
|
||||
/* error ::*/ \
|
||||
(_Var) = (_Type)NULL;\
|
||||
_FailureDo;\
|
||||
}\
|
||||
}
|
||||
|
||||
#define AIDebug_M_xFree(_Var,_Type,_ErrorCode,_FailureDo)\
|
||||
if(_Var)\
|
||||
{\
|
||||
Mmg_M_SetModeAlloc4Ch(AIDebug,E_ucDynamic,C_ucMmgDefaultChannel);\
|
||||
Mmg_fn_vFree4Ch((void*)(_Var),C_ucMmgDefaultChannel);\
|
||||
(_Var) = (_Type)NULL;\
|
||||
if(Erm_M_uwCheckError(Mmg,C_ucErmDefaultChannel))/*** DR Mmg instead of Mem ***/\
|
||||
{\
|
||||
/* handle error :*/\
|
||||
Erm_M_ClearLastError(C_ucErmDefaultChannel);\
|
||||
Erm_M_UpdateLastError\
|
||||
(\
|
||||
AIDebug, /* Module 's name*/\
|
||||
C_ucErmDefaultChannel, /*mutli-thread channel*/\
|
||||
_ErrorCode, /* error code */\
|
||||
C_lErmNoDebugData, /* long for debugging data */\
|
||||
C_ucErmOpenInfoWindow, /* open window ?*/\
|
||||
C_ucAllowStopForDebug,/* wether to stop or not for debugging */\
|
||||
NULL \
|
||||
);\
|
||||
_FailureDo;\
|
||||
}\
|
||||
}
|
||||
|
||||
#define AIDebug_M_MainInitialisation()\
|
||||
AIDebug_fnv_InitMain();\
|
||||
if(Erm_M_uwCheckError(AIDebug,C_ucErmDefaultChannel))\
|
||||
Erm_M_ClearLastError(C_ucErmDefaultChannel);
|
||||
|
||||
/*
|
||||
------------------------------------------------------------------------------------------
|
||||
FUNCTIONS PROTOTYPES :
|
||||
------------------------------------------------------------------------------------------
|
||||
*/
|
||||
/* main initialisation function*/
|
||||
void AIDebug_fnv_InitMain(void);
|
||||
|
||||
#else /* ACTIVE_AIDEBUG For AI debugger*/
|
||||
|
||||
#define AIDebug_M_MainInitialisation()
|
||||
|
||||
#endif /* ACTIVE_AIDEBUG For AI debugger*/
|
||||
|
||||
#endif /* !__AIDMAIN_PROTOS__ */
|
||||
|
||||
#endif /* !ONLY_TYPES */
|
||||
|
55
Rayman_X/cpa/tempgrp/AI/AIDebug/AID_Mmg.h
Normal file
55
Rayman_X/cpa/tempgrp/AI/AIDebug/AID_Mmg.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/*///////////////////////////////////////////////////////////*/
|
||||
/**/
|
||||
/* Memory Management of the Module : AIDebug*/
|
||||
/**/
|
||||
/* File Name : MmgAIDebug.h*/
|
||||
/* Date : 703/10/96*/
|
||||
/* Author : First_Name Last_Name*/
|
||||
/**/
|
||||
/*///////////////////////////////////////////////////////////*/
|
||||
#ifndef __MmgAIDebug_H__
|
||||
#define __MmgAIDebug_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
/* For DLLs who are using this module : */
|
||||
#undef CPA_EXPORT
|
||||
#if defined(CPA_WANTS_IMPORT)
|
||||
#define CPA_EXPORT __declspec(dllimport)
|
||||
#elif defined(CPA_WANTS_EXPORT)
|
||||
#define CPA_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define CPA_EXPORT
|
||||
#endif
|
||||
|
||||
|
||||
#include "MMG.h"
|
||||
|
||||
typedef enum e_ucAIDebugStaticBlocks_{
|
||||
E_ucAIDebugBlock1, /* Not used now*/
|
||||
E_ucAIDebugMaxBlocksNb /* maximum number of static block, You have to follow this syntax 'E_uc+ Abbreviation Module +MaxBlocksNb'*/
|
||||
} e_ucAIDebugStaticBlocks;
|
||||
|
||||
#undef __MMGAIDEBUG_EXTERN
|
||||
#ifdef __DeclareGlobalVariableMmgAIDebug_h__
|
||||
#define __MMGAIDEBUG_EXTERN /*nothing*/
|
||||
#else /* no __DeclareGlobalVariableMmgAIDebug_h__*/
|
||||
#define __MMGAIDEBUG_EXTERN extern
|
||||
#endif /*__DeclareGlobalVariableMmgAIDebug_h__*/
|
||||
|
||||
__MMGAIDEBUG_EXTERN CPA_EXPORT struct tdstBlockInfo_ g_a_stAIDebugBlocksInfo[E_ucAIDebugMaxBlocksNb];
|
||||
|
||||
#ifdef __DYNAMIC_MALLOC_ALLOWED__
|
||||
#ifdef __DEBUG_MALLOC_MODE__
|
||||
__MMGAIDEBUG_EXTERN CPA_EXPORT struct tdstDynInfo_ g_stAIDebugDynInfo;
|
||||
#endif /*__DEBUG_MALLOC_MODE__*/
|
||||
#endif /*__DYNAMIC_MALLOC_ALLOWED__*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /*__MmgAIDebug_H__*/
|
1111
Rayman_X/cpa/tempgrp/AI/AIDebug/AID_Trac.c
Normal file
1111
Rayman_X/cpa/tempgrp/AI/AIDebug/AID_Trac.c
Normal file
File diff suppressed because it is too large
Load Diff
183
Rayman_X/cpa/tempgrp/AI/AIDebug/BreakPts.c
Normal file
183
Rayman_X/cpa/tempgrp/AI/AIDebug/BreakPts.c
Normal file
@@ -0,0 +1,183 @@
|
||||
/****************************************************
|
||||
|
||||
BreakPoints for AI Debugger
|
||||
|
||||
implementation file
|
||||
David Reizer December 1997
|
||||
|
||||
*****************************************************/
|
||||
|
||||
#include "AIUseCPA.h"
|
||||
#include "StrIntel.h"
|
||||
#include "EnumOper.h"
|
||||
|
||||
#include "AID_Erm.h"
|
||||
|
||||
#include "BreakPts.h"
|
||||
|
||||
|
||||
#if defined(ACTIVE_AIDEBUG)
|
||||
|
||||
#define M_bIsBreakableOperator(_eId)\
|
||||
( ((_eId) == eOperator_Affect) ||\
|
||||
((_eId) == eOperator_PlusAffect) ||\
|
||||
((_eId) == eOperator_MinusAffect) ||\
|
||||
((_eId) == eOperator_MulAffect) ||\
|
||||
((_eId) == eOperator_DivAffect) ||\
|
||||
((_eId) == eOperator_VectorPlusVector) ||\
|
||||
((_eId) == eOperator_VectorMinusVector) ||\
|
||||
((_eId) == eOperator_VectorMulScalar) ||\
|
||||
((_eId) == eOperator_VectorDivScalar) ||\
|
||||
((_eId) == eOperator_SetVectorX) ||\
|
||||
((_eId) == eOperator_SetVectorY) ||\
|
||||
((_eId) == eOperator_SetVectorZ) )
|
||||
|
||||
/***
|
||||
**** Return True if the Node accepts a breakpoint
|
||||
***/
|
||||
ACP_tdxBool fn_bIsBreakableNode( tdstNodeInterpret *_pstNode )
|
||||
{
|
||||
tdeTypeInterpret eType;
|
||||
tdeOperatorId eId;
|
||||
|
||||
if( _pstNode == NULL )
|
||||
{
|
||||
Erm_M_UpdateLastError( AIDebug,
|
||||
C_ucErmDefaultChannel,
|
||||
E_uwAIDebugWarningNullPointer,
|
||||
C_lErmNoDebugData,
|
||||
C_ucErmOpenInfoWindow,
|
||||
C_ucAllowStopForDebug,
|
||||
NULL );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
eType = M_GetTypeInterpret(_pstNode);
|
||||
eId = M_eOperatorIdInterpret(_pstNode);
|
||||
|
||||
return( (eType == E_ti_KeyWord) ||
|
||||
(eType == E_ti_Procedure) ||
|
||||
(eType == E_ti_MetaAction) ||
|
||||
((eType == E_ti_Operator) && M_bIsBreakableOperator(eId)) );
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
**** Find the tree containing a given node
|
||||
***/
|
||||
tdstTreeInterpret * fn_pstFindTreeWithNode( tdstScriptAI *_pstScript, unsigned long _ulNb, tdstNodeInterpret *_pstNode )
|
||||
{
|
||||
tdstComport *pstComport = NULL;
|
||||
tdstTreeInterpret * pstTree = NULL;
|
||||
int i = 0;
|
||||
|
||||
/*** first get the comport ***/
|
||||
pstComport = M_GetScriptAIComportN( _pstScript, _ulNb );
|
||||
if( pstComport == NULL )
|
||||
{
|
||||
Erm_M_UpdateLastError( AIDebug,
|
||||
C_ucErmDefaultChannel,
|
||||
E_uwAIDebugWarningNullPointer,
|
||||
C_lErmNoDebugData,
|
||||
C_ucErmOpenInfoWindow,
|
||||
C_ucAllowStopForDebug,
|
||||
"The comport is null" );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*** Search in schedule ***/
|
||||
pstTree = M_GetComportSchedule( pstComport );
|
||||
if( pstTree == NULL )
|
||||
{
|
||||
Erm_M_UpdateLastError( AIDebug,
|
||||
C_ucErmDefaultChannel,
|
||||
E_uwAIDebugWarningNullPointer,
|
||||
C_lErmNoDebugData,
|
||||
C_ucErmOpenInfoWindow,
|
||||
C_ucAllowStopForDebug,
|
||||
"The schedule is null" );
|
||||
}
|
||||
else
|
||||
if( ( M_GetNodeInterpret(pstTree) <= _pstNode ) && ( _pstNode < (M_GetNodeInterpret(pstTree) + M_GetNbNodeInterpret(pstTree)) ) )
|
||||
return pstTree;
|
||||
|
||||
/*** Search in rules ***/
|
||||
for( i=0; i < M_GetComportNbRules(pstComport); i++ )
|
||||
{
|
||||
pstTree = M_GetComportRuleN( pstComport, i );
|
||||
if( pstTree == NULL )
|
||||
{
|
||||
Erm_M_UpdateLastError( AIDebug,
|
||||
C_ucErmDefaultChannel,
|
||||
E_uwAIDebugWarningNullPointer,
|
||||
C_lErmNoDebugData,
|
||||
C_ucErmOpenInfoWindow,
|
||||
C_ucAllowStopForDebug,
|
||||
"The rule is null" );
|
||||
}
|
||||
else
|
||||
if( ( M_GetNodeInterpret(pstTree) <= _pstNode ) && ( _pstNode < (M_GetNodeInterpret(pstTree) + M_GetNbNodeInterpret(pstTree)) ) )
|
||||
return pstTree;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**************************************************************************************
|
||||
* Set a breakpoint on the first breakable node before the one passed as a parameter
|
||||
*
|
||||
* Input : the proposed node for BreakPoint
|
||||
* the script containing the node
|
||||
* the number of the comport containing the node
|
||||
*
|
||||
* Output: the actual node with the breakpoint or NULL
|
||||
*
|
||||
*****************************************************************************************/
|
||||
|
||||
tdstNodeInterpret * fn_pstSetValidBreakPoint( tdstNodeInterpret *_pstNode, tdstScriptAI *_pstScript, unsigned long _ulNb )
|
||||
{
|
||||
tdstTreeInterpret *pstTree = NULL;
|
||||
tdstNodeInterpret *pstTmpNode = NULL;
|
||||
|
||||
/*** if node accepts breakpoint then it is used ***/
|
||||
if( fn_bIsBreakableNode( _pstNode ) )
|
||||
{
|
||||
M_SetBreakPoint( _pstNode, TRUE );
|
||||
return _pstNode;
|
||||
}
|
||||
|
||||
/*** else find the tree containing the node ***/
|
||||
pstTree = fn_pstFindTreeWithNode( _pstScript, _ulNb, _pstNode );
|
||||
if( pstTree == NULL )
|
||||
{
|
||||
Erm_M_UpdateLastError( AIDebug,
|
||||
C_ucErmDefaultChannel,
|
||||
E_uwAIDebugWarningNullPointer,
|
||||
C_lErmNoDebugData,
|
||||
C_ucErmOpenInfoWindow,
|
||||
C_ucAllowStopForDebug,
|
||||
"The found tree is null" );
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*** Serach for the previous breakable node ***/
|
||||
pstTmpNode = _pstNode;
|
||||
while( (pstTmpNode >= M_GetNodeInterpret(pstTree)) && !(fn_bIsBreakableNode( pstTmpNode )) )
|
||||
pstTmpNode --;
|
||||
|
||||
/*** a node is found ***/
|
||||
if( fn_bIsBreakableNode( pstTmpNode ) )
|
||||
{
|
||||
M_SetBreakPoint( pstTmpNode, TRUE );
|
||||
return pstTmpNode;
|
||||
}
|
||||
/*** no node is found, the breakpoint is invalid ***/
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
#endif /*ACTIVE_AIDEBUG*/
|
Reference in New Issue
Block a user