From b0b4683f7d9b7eac3523cd0ed5c7a1a7d32ab6c5 Mon Sep 17 00:00:00 2001 From: Guus Waals <_@guusw.nl> Date: Thu, 29 May 2025 20:36:01 +0800 Subject: [PATCH] WIP --- game_re/gh_types.h | 656 ++++++++++++------------- java/ghidra/re3lib/DataTypeWriter.java | 61 +-- 2 files changed, 355 insertions(+), 362 deletions(-) diff --git a/game_re/gh_types.h b/game_re/gh_types.h index 268147a3..00f4c93b 100644 --- a/game_re/gh_types.h +++ b/game_re/gh_types.h @@ -5,8 +5,8 @@ #include typedef struct tdstMorphChannelList_ *CHN_tdxHandleToMorphElement; struct TMR_tdstTimerCount { - ulong ulLowPart; - ulong ulHighPart; + unsigned long ulLowPart; + unsigned long ulHighPart; }; struct _SwitchParam { long lObjectType; @@ -20,8 +20,8 @@ struct _RollOffParam { }; typedef struct _RollOffParam RollOffParam; struct _ExtraSoundParam { - struct RollOffParam stRollOff; - struct SwitchParam stSwitch; + RollOffParam stRollOff; + SwitchParam stSwitch; }; typedef struct _ExtraSoundParam ExtraSoundParam; typedef float GEO_tdxColorValue; @@ -42,7 +42,7 @@ struct MTH3D_Matrix { struct MTH3_Vector stCol_2; }; struct POS_stCompletePosition { - ulong ulType; + unsigned long ulType; struct MTH3_Vector stTranslationVector; struct MTH3D_Matrix stRotationMatrix; struct MTH3D_Matrix stTransformMatrix; @@ -55,10 +55,10 @@ struct GLI_tdstZBufferForLight { float *p_xZBufferMap; float *p_xMiddleZBufferMap; }; -typedef uchar ACP_tdxBool; +typedef unsigned char ACP_tdxBool; struct GLI_tdstLight { - uchar bOnOff; - uchar bThisLightIsZBuffered; + unsigned char bOnOff; + unsigned char bThisLightIsZBuffered; long lTypeOfLight; float xFar; float xNear; @@ -70,9 +70,9 @@ struct GLI_tdstLight { struct GLI_tdstZBufferForLight stZBuffer; struct GEO_tdstColor stColor; ACP_tdxBool bValid; - uchar ucObjectPainted; + unsigned char ucObjectPainted; ACP_tdxBool bIsPainting; - uchar ucIsAlpha; + unsigned char ucIsAlpha; struct MTH3_Vector stInter_Min_Pos; struct MTH3_Vector stExter_Min_Pos; struct MTH3_Vector stInter_Max_Pos; @@ -84,28 +84,28 @@ struct GLI_tdstLight { struct GEO_tdstColor stBackgroundColor; }; typedef tdfn_ulSizeofHandleFunction tdfn_ulSizeofHandleFunction; -typedef struct CLSID *LPCLSID; +typedef CLSID *LPCLSID; struct _tdstTypeSampleDisk { }; typedef struct _tdstTypeSampleDisk tdstTypeSampleDisk; struct _tdstFormatPCM { - ulong ulNbSamples; - ushort uwResolution; - ushort uwNbChannels; - ulong ulFreq; + unsigned long ulNbSamples; + unsigned short uwResolution; + unsigned short uwNbChannels; + unsigned long ulFreq; }; struct tdstTimerCount { - ulong ulLowPart; - ulong ulHighPart; + unsigned long ulLowPart; + unsigned long ulHighPart; }; struct tdstChannelInfo_ { - ulong ulThreadId; - uchar ucGroupId; + unsigned long ulThreadId; + unsigned char ucGroupId; }; struct tdstInformationHeaderOfBlockWithoutFree_ { - uchar ucBoundededHeaderSize; - uchar ucAlignment; - uchar ucMode; + unsigned char ucBoundededHeaderSize; + unsigned char ucAlignment; + unsigned char ucMode; }; typedef struct tdstChannelActivationStateList_ *CHN_tdxHandleToCASElement; struct _SndVector { @@ -121,16 +121,16 @@ struct _MicroLink { typedef struct _MicroLink MicroLink; struct _SoundParam { SndReal Freq; - uchar ucVol; - uchar ucPan; - uchar ucSpace; - uchar ucReverb; - struct SndVector Pos; - struct SndVector Vit; + unsigned char ucVol; + unsigned char ucPan; + unsigned char ucSpace; + unsigned char ucReverb; + SndVector Pos; + SndVector Vit; int iFlags; int iNbLinks; - struct MicroLink astMicro[2]; - struct ExtraSoundParam xExtra; + MicroLink astMicro[2]; + ExtraSoundParam xExtra; }; struct FIL_FileNameListElement { struct FIL_FileNameListElement *hNextBrotherDyn; @@ -153,18 +153,18 @@ struct _tdstTypeMidiDisk { typedef struct _tdstTypeMidiDisk tdstTypeMidiDisk; typedef struct tdstFamilyList_ *tdxHandleToFamilyList; typedef struct tdstState_ *tdxHandleToState; -typedef struct GUID *LPGUID; +typedef GUID *LPGUID; struct tdstWaterStreakEffect_ { }; struct _tdstRangeSplitListMem { }; typedef struct _tdstRangeSplitListMem tdstRangeSplitListMem; typedef void *MS_tdxHandleToMSLight; -typedef dword color_rgba8_t; +typedef unsigned int color_rgba8_t; struct astruct_2 { - uint *field0_0x0; - uint *field1_0x4; - uint *field2_0x8; + unsigned int *field0_0x0; + unsigned int *field1_0x4; + unsigned int *field2_0x8; undefined field3_0xc; undefined field4_0xd; undefined field5_0xe; @@ -174,9 +174,9 @@ struct astruct_2 { undefined field9_0x12; undefined field10_0x13; color_rgba8_t unkColor; - byte field12_0x18; + unsigned char field12_0x18; undefined field13_0x19; - byte field14_0x1a; + unsigned char field14_0x1a; }; struct astruct_3 { undefined field0_0x0; @@ -206,8 +206,8 @@ struct SND_Request3 { }; typedef struct IPT_tdstEntryElement_ *IPT_tdxHandleToEntryElement; struct LST2_tdstAnchorToIPT_tdxHandleToEntryElementDyn { - struct IPT_tdxHandleToEntryElement hFirstElementDyn; - struct IPT_tdxHandleToEntryElement hLastElementDyn; + IPT_tdxHandleToEntryElement hFirstElementDyn; + IPT_tdxHandleToEntryElement hLastElementDyn; long lNumberOfElementsDyn; }; struct _tdstRefResList { @@ -216,8 +216,8 @@ typedef struct tdstInformationHeaderOfBlockWithoutFree_ tdstInformationHeaderOfB struct r3_graphics_data { int field0_0x0; int field1_0x4; - uint field2_0x8; - uint field3_0xc; + unsigned int field2_0x8; + unsigned int field3_0xc; float field4_0x10; float field5_0x14; float field6_0x18; @@ -242,9 +242,9 @@ struct r3_graphics_data { undefined field25_0x4f; float field26_0x50; float field27_0x54; - uint field28_0x58; - uint field29_0x5c; - uint field30_0x60; + unsigned int field28_0x58; + unsigned int field29_0x5c; + unsigned int field30_0x60; struct IDirect3DVertexBuffer8 **field31_0x64; undefined field32_0x68; undefined field33_0x69; @@ -376,8 +376,8 @@ struct r3_graphics_data { }; typedef struct tdstObjectTypeElement_ *ObjectTypeElementHandle; struct LST2_tdstAnchorTotdhHandleToObjectTypeElementDyn { - struct ObjectTypeElementHandle hFirstElementDyn; - struct ObjectTypeElementHandle hLastElementDyn; + ObjectTypeElementHandle hFirstElementDyn; + ObjectTypeElementHandle hLastElementDyn; long lNumberOfElementsDyn; }; struct tdstObjectType_ { @@ -397,8 +397,8 @@ struct tdstZoneSetList_ { struct _tdstSampleStreaming { }; struct SCR_tdst_DyAr_Header_ { - uint uiIndexInArray; - uchar ucMemLevel; + unsigned int uiIndexInArray; + unsigned char ucMemLevel; }; typedef td_pfn_bRetRollOffFactor *td_pfn_bRetRollOffFactor; struct GLI_tdstAnimatedTextureNode { @@ -410,12 +410,12 @@ struct GEO_tdstParallelBox { }; typedef struct IPT_tdstKeyWordElement_ *IPT_tdxHandleToKeyWordElement; struct LST2_tdstAnchorToIPT_tdxHandleToKeyWordElementDyn { - struct IPT_tdxHandleToKeyWordElement hFirstElementDyn; - struct IPT_tdxHandleToKeyWordElement hLastElementDyn; + IPT_tdxHandleToKeyWordElement hFirstElementDyn; + IPT_tdxHandleToKeyWordElement hLastElementDyn; long lNumberOfElementsDyn; }; typedef struct _GUID GUID; -typedef struct GUID CLSID; +typedef GUID CLSID; struct _tdstSndBankHeader { }; typedef struct _tdstSndBankHeader tdstSndBankHeader; @@ -455,7 +455,7 @@ typedef void *GEO_tdxHandleToRadiosity; typedef struct IPT_tdstInput_ *IPT_tdxHandleToInput; typedef struct POS_stCompletePosition *POS_tdxHandleToPosition; struct HIE_SuperObject { - ulong ulTypeOfLinkedObject; + unsigned long ulTypeOfLinkedObject; union HIE_tduLinkedObject hLinkedObject; struct HIE_SuperObject *hFirstElementDyn; struct HIE_SuperObject *hLastElementDyn; @@ -463,19 +463,19 @@ struct HIE_SuperObject { struct HIE_SuperObject *hNextBrotherDyn; struct HIE_SuperObject *hPrevBrotherDyn; struct HIE_SuperObject *hFatherDyn; - struct POS_tdxHandleToPosition hLocalMatrix; - struct POS_tdxHandleToPosition hGlobalMatrix; + POS_tdxHandleToPosition hLocalMatrix; + POS_tdxHandleToPosition hGlobalMatrix; long lLastComputeFrame; long lDrawModeMask; - ulong ulFlags; + unsigned long ulFlags; void *hBoundingVolume; float fTransparenceLevel; struct MTH3_Vector stSemiLookAtVector; }; struct tdstGeneralChannelsInfo_ { - uchar ucNbchannelUsed; - uchar ucMAxNbChannel; - struct tdstChannelInfo *d_stTabChannelInfo; + unsigned char ucNbchannelUsed; + unsigned char ucMAxNbChannel; + tdstChannelInfo *d_stTabChannelInfo; }; struct _tdstTypeThemeDisk { }; @@ -498,13 +498,13 @@ struct _tdstAllRetChannelSound { struct _SND_tdstBlockEvent { }; struct FIL_ConcatFile { - struct FILE *p_stFile; - ulong ulNumberOfPath; - ulong ulNumberOfFile; - uchar bUseXorCode; - uchar bUseCheckSum; - uchar ucPathXorCode; - uchar ucPathCheckSum; + FILE *p_stFile; + unsigned long ulNumberOfPath; + unsigned long ulNumberOfFile; + unsigned char bUseXorCode; + unsigned char bUseCheckSum; + unsigned char ucPathXorCode; + unsigned char ucPathCheckSum; char **d_szPathList; struct FIL_ConcatFileElement *d_stConcatFileElement; }; @@ -519,28 +519,28 @@ struct _tdstInfoTrackDisk { typedef struct _tdstInfoTrackDisk tdstInfoTrackDisk; typedef td_pfn_rRetSoundCoord *td_pfn_rRetSoundCoord; struct GLD_ViewportAttributes { - ulong dwInitialHeight; - ulong dwInitialWidth; - ulong dwHeight; - ulong dwWidth; - ulong dwTopInPix; - ulong dwBottomInPix; - ulong dwLeftInPix; - ulong dwRightInPix; - ulong dwTopInPixForClip; - ulong dwBottomInPixForClip; - ulong dwLeftInPixForClip; - ulong dwRightInPixForClip; - ulong dwWidthInPercent; - ulong dwHeightInPercent; - ulong dwClipTopInPix; - ulong dwClipBottomInPix; - ulong dwClipLeftInPix; - ulong dwClipRightInPix; - ulong dwClipTopInPerMille; - ulong dwClipBottomInPerMille; - ulong dwClipLeftInPerMille; - ulong dwClipRightInPerMille; + unsigned long dwInitialHeight; + unsigned long dwInitialWidth; + unsigned long dwHeight; + unsigned long dwWidth; + unsigned long dwTopInPix; + unsigned long dwBottomInPix; + unsigned long dwLeftInPix; + unsigned long dwRightInPix; + unsigned long dwTopInPixForClip; + unsigned long dwBottomInPixForClip; + unsigned long dwLeftInPixForClip; + unsigned long dwRightInPixForClip; + unsigned long dwWidthInPercent; + unsigned long dwHeightInPercent; + unsigned long dwClipTopInPix; + unsigned long dwClipBottomInPix; + unsigned long dwClipLeftInPix; + unsigned long dwClipRightInPix; + unsigned long dwClipTopInPerMille; + unsigned long dwClipBottomInPerMille; + unsigned long dwClipLeftInPerMille; + unsigned long dwClipRightInPerMille; long lOffsetPosX; long lOffsetPosY; char *p_cVirtualScreen; @@ -551,7 +551,7 @@ struct GLD_ViewportAttributes { }; struct GLD_stViewport { struct GLD_ViewportAttributes stViewAttrib; - uchar bIsLocked; + unsigned char bIsLocked; }; typedef td_pfn_vRetSoundExtraCoef *td_pfn_vRetSoundExtraCoef; typedef struct tdstParticleGenerator_ *tdxHandleToParticleGenerator; @@ -575,41 +575,41 @@ struct r3_TaggedFloatUnk { typedef struct IPT_tdstHistoricElement_ *IPT_tdxHandleToHistoricElement; typedef struct SCR_tdst_DyAr_Header_ SCR_tdst_DyAr_Header; struct SCR_tdst_DyAr_Description_ { - struct SCR_tdst_DyAr_Element *d_stDynArray; - uint uiNumValues; - uint uiMaxValues; + SCR_tdst_DyAr_Element *d_stDynArray; + unsigned int uiNumValues; + unsigned int uiMaxValues; }; typedef struct SCR_tdst_DyAr_Description_ SCR_tdst_DyAr_Description; -typedef struct SCR_tdst_DyAr_Description SCR_tda_st_Hash_Table[256]; +typedef SCR_tdst_DyAr_Description SCR_tda_st_Hash_Table[256]; struct SCR_tdst_Link_Table_ { - struct SCR_tdst_DyAr_Header stHeader; - struct SCR_tdst_DyAr_Description stLinkArray; - struct SCR_tda_st_Hash_Table a_stHashTableForValues; - struct SCR_tda_st_Hash_Table a_stHashTableForKeys; + SCR_tdst_DyAr_Header stHeader; + SCR_tdst_DyAr_Description stLinkArray; + SCR_tda_st_Hash_Table a_stHashTableForValues; + SCR_tda_st_Hash_Table a_stHashTableForKeys; }; typedef struct SCR_tdst_Link_Table_ SCR_tdst_Link_Table; struct IPT_tdstInput_ { - uchar ucOnePadActivate; - uchar p_ucValideAndActiveDevice[0]; - uchar p_ucKeyboardCounter[256]; - uchar p_ucPadAndJoyCounter[0][0]; - struct SCR_tdst_Link_Table stEntryLink; - struct SCR_tdst_Link_Table stCommandLink; - uchar ucKeyboardType; - ulong ulNumberOfEntryElement; + unsigned char ucOnePadActivate; + unsigned char p_ucValideAndActiveDevice[0]; + unsigned char p_ucKeyboardCounter[256]; + unsigned char p_ucPadAndJoyCounter[0][0]; + SCR_tdst_Link_Table stEntryLink; + SCR_tdst_Link_Table stCommandLink; + unsigned char ucKeyboardType; + unsigned long ulNumberOfEntryElement; struct IPT_tdstEntryElement_ *d_stEntryElementArray; struct LST2_tdstAnchorToIPT_tdxHandleToEntryElementDyn hEntryElement; short sEventHistoricSize; - struct IPT_tdxHandleToHistoricElement hEventHistoric; + IPT_tdxHandleToHistoricElement hEventHistoric; }; struct LST2_tdstAnchorTotdxHandleToFamilyListDyn { - struct tdxHandleToFamilyList hFirstElementDyn; - struct tdxHandleToFamilyList hLastElementDyn; + tdxHandleToFamilyList hFirstElementDyn; + tdxHandleToFamilyList hLastElementDyn; long lNumberOfElementsDyn; }; struct LST2_tdstAnchorTotdxHandleToStateSLk { - struct tdxHandleToState hFirstElementSLk; - struct tdxHandleToState hLastElementSLk; + tdxHandleToState hFirstElementSLk; + tdxHandleToState hLastElementSLk; long lNumberOfElementsSLk; }; typedef union _tduResDisk tduResDisk; @@ -631,8 +631,8 @@ struct Float3 { /* Vector (r3) */ typedef void *GMT_tdxHandleToGameMaterial; typedef struct tdstObjectsTablesList_ *tdxHandleToObjectsTablesList; struct LST2_tdstAnchorTotdxHandleToObjectsTablesListSLk { - struct tdxHandleToObjectsTablesList hFirstElementSLk; - struct tdxHandleToObjectsTablesList hLastElementSLk; + tdxHandleToObjectsTablesList hFirstElementSLk; + tdxHandleToObjectsTablesList hLastElementSLk; long lNumberOfElementsSLk; }; struct Float2 { /* Vector (r3) */ @@ -686,21 +686,21 @@ struct GLD_DeviceAttributes { DWORD dwFullScreenModeX; DWORD dwFullScreenModeY; DWORD dwFullScreenModeBpp; - struct HWND hFullScreenModeWnd; - struct HWND hNormalModeWnd; - uchar bFullScreen; - uint uiTypeDriver; - struct POINT pClientOnPrimary; - struct RECT rtClientRect; - struct RECT rtWindowRect; + HWND hFullScreenModeWnd; + HWND hNormalModeWnd; + unsigned char bFullScreen; + unsigned int uiTypeDriver; + POINT pClientOnPrimary; + RECT rtClientRect; + RECT rtWindowRect; }; struct GLD_Device { struct GLD_DeviceAttributes stDevAttrib; - struct GLD_tdpstViewport pstViewports[16]; - uchar bIsLocked; + GLD_tdpstViewport pstViewports[16]; + unsigned char bIsLocked; DWORD dwStyleBeforeSwap; DWORD dwExStyleBeforeSwap; - struct RECT rcWindowBeforeSwap; + RECT rcWindowBeforeSwap; DWORD dwBackgroundColor; }; struct tdstAlwaysActiveCharacter_ { @@ -710,13 +710,13 @@ struct _tdstThemePartOutro { struct IPT_tdstScriptValue_ { }; struct IPT_tdstKeyWordElement_ { - struct IPT_tdxHandleToKeyWordElement hNextBrotherDyn; - struct IPT_tdxHandleToKeyWordElement hPrevBrotherDyn; + IPT_tdxHandleToKeyWordElement hNextBrotherDyn; + IPT_tdxHandleToKeyWordElement hPrevBrotherDyn; struct LST2_tdstAnchorToIPT_tdxHandleToKeyWordElementDyn *hFatherDyn; union tdu_KeyWordElementUnion_ u_ElementUnion; - uchar ucResult; - uchar ucMinCounterInput; - uchar ucMaxCounterInput; + unsigned char ucResult; + unsigned char ucMinCounterInput; + unsigned char ucMaxCounterInput; }; struct tdstTransition_ { }; @@ -727,7 +727,7 @@ struct _tdstBlockResourceDisk { typedef struct _tdstBlockResourceDisk tdstBlockResourceDisk; typedef union _tduBlockResource tduBlockResource; struct _SND_tdstStackBuffer { - ulong ulNbSamples; + unsigned long ulNbSamples; void *ptrData; }; typedef struct _SND_tdstStackBuffer SND_tdstStackBuffer; @@ -787,39 +787,39 @@ struct _tdstSndBankDescriptor { }; typedef struct _tdstSndBankDescriptor tdstSndBankDescriptor; struct tdstChunkHeader_ { - uchar ucChunkMark[4]; + unsigned char ucChunkMark[4]; long lChunkLength; }; typedef td_pfn_bRetChannelAbsCoord *td_pfn_bRetChannelAbsCoord; struct _tdstSwitchList { }; -typedef ulong ACP_tdxAddress; +typedef unsigned long ACP_tdxAddress; struct SCR_tdst_Link_AdditionalInfos_ { - ulong ulLong1; - ulong ulLong2; - ulong ulLong3; - ulong ulLong4; + unsigned long ulLong1; + unsigned long ulLong2; + unsigned long ulLong3; + unsigned long ulLong4; }; typedef struct SCR_tdst_Link_AdditionalInfos_ SCR_tdst_Link_AdditionalInfos; typedef IPT_tdfn_bIsKeyWordValid IPT_tdfn_bIsKeyWordValid; typedef enum enum_2474 tdeTypeZip; struct _SND_tdstFormat { - enum tdeTypeZip eZip; + tdeTypeZip eZip; union _union_2479 uFormat; }; typedef struct _tdstTypeSplitMem tdstTypeSplitMem; struct TMR_tdstEngineTimerStructure { - ulong ulFrameNumber; - ushort wTimerHandle; - ulong ulCurrentTimerCount; - ulong ulDeltaTimerCount; - ulong a_ulCounter[16]; - ulong ulUsefulDeltaTime; - ulong ulPauseTime; + unsigned long ulFrameNumber; + unsigned short wTimerHandle; + unsigned long ulCurrentTimerCount; + unsigned long ulDeltaTimerCount; + unsigned long a_ulCounter[16]; + unsigned long ulUsefulDeltaTime; + unsigned long ulPauseTime; float xFrameLength; struct TMR_tdstTimerCount stRealTimeCount; struct TMR_tdstTimerCount stPauseTime; - ulong ulTickPerMs; + unsigned long ulTickPerMs; }; struct GLI_SpecificAttributesFor3D { struct GLI_Camera *p_stCam; @@ -834,12 +834,12 @@ struct GAM_EngineStructure { char szFirstLevelName[30]; undefined field4_0x5b; enum GAM_DisplayFixMode eDisplayFixMode; - ulong ulDisplayMode; + unsigned long ulDisplayMode; undefined field7_0x61; undefined field8_0x62; undefined field9_0x63; struct TMR_tdstEngineTimerStructure stEngineTimer; - short ?renderCtl; /* controls level rendeirng parameter */ + short field11_0xd4; /* controls level rendeirng parameter (fix name "?renderCtl") */ enum GAM_InputMode eInputMode; /* maybe? */ undefined field13_0xda; undefined field14_0xdb; @@ -863,7 +863,7 @@ struct GAM_EngineStructure { undefined field32_0xef; undefined field33_0xf0; undefined field34_0xf1; - word screenshotVpHandle_maybe; + unsigned short screenshotVpHandle_maybe; struct GLD_ViewportAttributes stViewportAttr; /* correct 0xf4 */ struct GLI_Camera *p_stGameViewportCamera; GLD_ViewportHandle hGLDFixViewport; @@ -1064,8 +1064,8 @@ struct GAM_EngineStructure { undefined field233_0x2b9; undefined field234_0x2ba; undefined field235_0x2bb; - dword screenshotWidth; - dword screenshotHeight; + unsigned int screenshotWidth; + unsigned int screenshotHeight; undefined field238_0x2c4; undefined field239_0x2c5; undefined field240_0x2c6; @@ -3354,11 +3354,11 @@ struct tdstBlockInfoPriv { typedef struct IPT_tdstScriptValue_ *IPT_tdxHandleToScriptValue; typedef td_fn_vTimerEventCallback td_fn_vTimerEventCallback; struct tdstObjectTypeElement_ { - struct ObjectTypeElementHandle hNextBrotherDyn; - struct ObjectTypeElementHandle hPrevBrotherDyn; + ObjectTypeElementHandle hNextBrotherDyn; + ObjectTypeElementHandle hPrevBrotherDyn; struct LST2_tdstAnchorTotdhHandleToObjectTypeElementDyn *hFatherDyn; char *szName; - uchar ucElementPriority; + unsigned char ucElementPriority; }; struct GEO_tdstVisualSet { }; @@ -3366,11 +3366,11 @@ struct _tdstMidiStreaming { }; typedef struct _tdstMidiStreaming tdstMidiStreaming; struct FIL_RealGFFileHeader { - ulong ulFormat; - ulong ulWidth; - ulong ulHeight; - uchar ucBpp; - uchar ucRLECode; + unsigned long ulFormat; + unsigned long ulWidth; + unsigned long ulHeight; + unsigned char ucBpp; + unsigned char ucRLECode; }; struct _tdstTypeSequenceMem { }; @@ -3403,17 +3403,17 @@ struct FileInner1 { }; typedef struct _tdstSampleStreaming tdstSampleStreaming; struct IPT_tdstEntryElement_ { - struct IPT_tdxHandleToEntryElement hNextBrotherDyn; - struct IPT_tdxHandleToEntryElement hPrevBrotherDyn; + IPT_tdxHandleToEntryElement hNextBrotherDyn; + IPT_tdxHandleToEntryElement hPrevBrotherDyn; struct LST2_tdstAnchorToIPT_tdxHandleToEntryElementDyn *hFatherDyn; struct LST2_tdstAnchorToIPT_tdxHandleToKeyWordElementDyn hKeyWordList; - ulong ulNumberOfKeyWordElement; + unsigned long ulNumberOfKeyWordElement; struct IPT_tdstKeyWordElement_ *d_stKeyWordElementArray; char *p_szActionName; char *p_szEntryName; long lState; float xAnalogicValue; - uchar bIsActivate; + unsigned char bIsActivate; }; typedef struct _tdstAllRetObjectSound tdstAllRetObjectSound; typedef struct FIL_ConcatFile *FIL_HandleToConcatFile; @@ -3422,16 +3422,16 @@ struct _tdstRangeSplitDisk { typedef struct _tdstRangeSplitDisk tdstRangeSplitDisk; struct Anim3d { struct Frame3d *d_stFrame3d; - uchar ucNumberOfFrames; - uchar ucFrameRate; - uchar ucMaxNumberOfElements; + unsigned char ucNumberOfFrames; + unsigned char ucFrameRate; + unsigned char ucMaxNumberOfElements; struct Event *d_stAnimEvent; - uchar ucNumberOfEvents; + unsigned char ucNumberOfEvents; struct POS_stCompletePosition stOffsetMatrix; - uchar bCompressedAnim; + unsigned char bCompressedAnim; struct AnimLights *p_stLights; struct stMorphData *d_stMorphDataArray; - ushort uwNumOfA3dGENERAL; + unsigned short uwNumOfA3dGENERAL; }; typedef td_pfn_vCopyString *td_pfn_vCopyString; struct _tdstBlockResourceMem { @@ -3441,20 +3441,20 @@ struct _tdstInfoTrackList { }; typedef struct _tdstInfoTrackList tdstInfoTrackList; typedef struct _tdstTypeRandomDisk tdstTypeRandomDisk; -typedef struct GUID FMTID; +typedef GUID FMTID; struct IPT_tdstHistoricElement_ { - uchar bf2State; - uchar bf6DeviceType; - uchar ucCounter; + unsigned char bf2State; + unsigned char bf6DeviceType; + unsigned char ucCounter; short swDeviceValue; }; typedef struct IPT_tdstHistoricElement_ IPT_tdstHistoricElement; struct _SampleParam { SndReal Freq; - uchar ucVol; - uchar ucPan; - uchar ucSpace; - uchar ucReverb; + unsigned char ucVol; + unsigned char ucPan; + unsigned char ucSpace; + unsigned char ucReverb; }; struct SCR_tdst_DyAr_Element_ { void *d_vElement; @@ -3478,7 +3478,7 @@ struct _tdstTimer { struct TMR_tdstTimerCount m_stTimerCount_InitValue; struct TMR_tdstTimerCount m_stTimerCount_LastValue; struct TMR_tdstTimerCount m_stTimerCount_TotalValue; - ulong m_ulEventId; + unsigned long m_ulEventId; td_p_fn_vTimerEventCallback m_p_fn_vEventCallback; }; typedef struct _tdstTimer tdstTimer; @@ -3491,9 +3491,9 @@ struct GEO_tdstDoubledIndex { ACP_tdxIndex a2_xIndex[2]; }; struct tdstAviHeader_ { - uchar ucRIFFMark[4]; + unsigned char ucRIFFMark[4]; long lLength; - uchar ucAVIMark[4]; + unsigned char ucAVIMark[4]; }; typedef struct _tdstSndBankHead tdstSndBankHead; struct _tdstSampleMemory { @@ -3507,23 +3507,23 @@ typedef struct _tdstTypeCD tdstTypeCD; struct _tdstSndPolyResource { }; struct FIL_FileInConcatFile { - uchar bUseConcatFile; - struct FILE *p_stFile; - ulong ulFileActualSeek; - ulong ulFileEndSeek; - ulong ulFileXorCode; - ulong ulFileCheckSum; - ulong ulCacheSeek; - ulong ulCacheSize; - ulong ulCacheCheckSum; - uchar *p_ucCache; + unsigned char bUseConcatFile; + FILE *p_stFile; + unsigned long ulFileActualSeek; + unsigned long ulFileEndSeek; + unsigned long ulFileXorCode; + unsigned long ulFileCheckSum; + unsigned long ulCacheSeek; + unsigned long ulCacheSize; + unsigned long ulCacheCheckSum; + unsigned char *p_ucCache; }; typedef float GLI_tdxValue; typedef struct IPT_tdstEntryElement_ IPT_tdstEntryElement; struct tdstSubAnim3d_ { - uchar ucCurrentFrame; - uchar ucRepeatAnimation; - uchar ucElement; + unsigned char ucCurrentFrame; + unsigned char ucRepeatAnimation; + unsigned char ucElement; struct tdstState_ *p_stCurrentState; }; struct tdstAChannel_ { @@ -3532,31 +3532,31 @@ struct _tdstSwitchElement { }; typedef struct tdstAlwaysActiveCharacter_ *tdxHandleToAlwaysActiveCharacterNode; struct LST2_tdstAnchorTotdxHandleToAlwaysActiveCharacterNodeSLk { - struct tdxHandleToAlwaysActiveCharacterNode hFirstElementSLk; - struct tdxHandleToAlwaysActiveCharacterNode hLastElementSLk; + tdxHandleToAlwaysActiveCharacterNode hFirstElementSLk; + tdxHandleToAlwaysActiveCharacterNode hLastElementSLk; long lNumberOfElementsSLk; }; struct tdstPLA_Hierarchy_ { - ulong ulNbOfCouples; + unsigned long ulNbOfCouples; struct Couple *d_stCouples; }; struct stDevCaps { - uchar m_ucNbButtons; - ulong m_ulCapsFlags; + unsigned char m_ucNbButtons; + unsigned long m_ulCapsFlags; }; typedef struct _tdstRefResList tdstRefResList; struct FIL_ConcatFileElement { char *p_szFileName; long lPathNumber; long lOffset; - ulong ulFileLength; - ulong ulXorCode; - ulong ulCheckSum; + unsigned long ulFileLength; + unsigned long ulXorCode; + unsigned long ulCheckSum; }; typedef struct tdstWaterStreakEffect_ *GAM_tdxHandleToWaterStreakEffect; typedef struct stDevCaps INO_tdstDevCaps; struct IPT_tdstKeyAndPadDefine_ { - ushort uwBasedKey; + unsigned short uwBasedKey; char *p_szFrenchKey; char *p_szAmericanKey; }; @@ -3570,30 +3570,30 @@ typedef struct _tdstAllRetChannelSound tdstAllRetChannelSound; struct tdstNodeMainCharacter_ { }; struct GMA_tdstEngineEndStructure { - uchar ucNumberOfLevels; - uchar ucCurrentLevel; - uchar ucPreviousLevel; - uchar ucExitIdToQuitPrevLevel; - uchar ucLevelGlobalCounter; + unsigned char ucNumberOfLevels; + unsigned char ucCurrentLevel; + unsigned char ucPreviousLevel; + unsigned char ucExitIdToQuitPrevLevel; + unsigned char ucLevelGlobalCounter; ACP_tdxBool xDemoMode; - uchar ucCurrentLanguage; - uchar ucNbLanguages; + unsigned char ucCurrentLanguage; + unsigned char ucNbLanguages; ACP_tdxBool bEngineFrozen; ACP_tdxBool bResurrection; char cCameraMode; }; struct stDevState { - uchar m_ucStatus; + unsigned char m_ucStatus; }; typedef struct tdstFootPath_ *GAM_tdxHandleToFootPathEffect; typedef enum SCR_tde_Link_State_ SCR_tde_Link_State; typedef struct tdstChunkHeader_ tdstChunkHeader; typedef struct tdstObjectTypeElement_ tdstObjectTypeElement; struct _MicroParam { - struct SndVector pos; - struct SndVector vit; - struct SndVector dirnor; - struct SndVector dirtan; + SndVector pos; + SndVector vit; + SndVector dirnor; + SndVector dirtan; }; typedef struct SCR_tdst_DyAr_Element_ SCR_tdst_DyAr_Element; typedef struct tdstAviHeader_ tdstAviHeader; @@ -3605,11 +3605,11 @@ struct _tdstInfoTrackMem { }; typedef struct tdstPLA_Hierarchy_ tdstPLA_Hierarchy; struct Element3d { - struct POS_tdxHandleToPosition stMatrix; - uchar ucElement; - uchar ucChannelNumber; - uchar bActiveStatus; - ulong eTypeOfElement; + POS_tdxHandleToPosition stMatrix; + unsigned char ucElement; + unsigned char ucChannelNumber; + unsigned char bActiveStatus; + unsigned long eTypeOfElement; }; typedef struct _s_UnwindMapEntry UnwindMapEntry; struct LST2_tdstAnchorTotdxHandleToNodeCameraSLk { @@ -3624,19 +3624,19 @@ struct _tdstTypeSwitchMem { typedef struct _tdstTypeSwitchMem tdstTypeSwitchMem; struct Event { struct EventInTable *p_stfEventInTBL; - ushort usEventNumberInTBL; - ushort uwFrameNumber; - ushort uwChannelNumber; + unsigned short usEventNumberInTBL; + unsigned short uwFrameNumber; + unsigned short uwChannelNumber; }; struct LevelLoadState { undefined *ptrSized; /* len = size * 8 */ - dword ptrSize; + unsigned int ptrSize; }; typedef struct IPT_tdstInput_ IPT_tdstInput; typedef struct tdstProhibit_ *tdxHandleToProhibit; struct LST2_tdstAnchorTotdxHandleToProhibitSLk { - struct tdxHandleToProhibit hFirstElementSLk; - struct tdxHandleToProhibit hLastElementSLk; + tdxHandleToProhibit hFirstElementSLk; + tdxHandleToProhibit hLastElementSLk; long lNumberOfElementsSLk; }; typedef struct _tdstFormatPCM tdstFormatADPCM; @@ -3648,8 +3648,8 @@ struct GameStructure { float field3_0xc; float field4_0x10; HANDLE drawSemaphore; - struct FILE *movieFile; - dword keySeqEsc; + FILE *movieFile; + unsigned int keySeqEsc; undefined field8_0x20; undefined field9_0x21; undefined field10_0x22; @@ -3682,7 +3682,7 @@ struct GameStructure { undefined field37_0x3d; undefined field38_0x3e; undefined field39_0x3f; - byte passedToDisplayFn; + unsigned char passedToDisplayFn; undefined field41_0x41; undefined field42_0x42; undefined field43_0x43; @@ -3726,41 +3726,41 @@ struct tdstObjectsTablesList_ { }; typedef union _tduRefRes tduRefRes; struct m7_init_struct { - dword threadSignal0; - dword threadSignal1; - byte field2_0x8; - byte field3_0x9; - byte field4_0xa; - byte field5_0xb; - byte field6_0xc; - byte field7_0xd; - byte field8_0xe; - byte field9_0xf; - byte field10_0x10; - byte field11_0x11; + unsigned int threadSignal0; + unsigned int threadSignal1; + unsigned char field2_0x8; + unsigned char field3_0x9; + unsigned char field4_0xa; + unsigned char field5_0xb; + unsigned char field6_0xc; + unsigned char field7_0xd; + unsigned char field8_0xe; + unsigned char field9_0xf; + unsigned char field10_0x10; + unsigned char field11_0x11; undefined1 field12_0x12; - byte field13_0x13; - byte field14_0x14; - byte field15_0x15; - byte field16_0x16; - byte field17_0x17; - byte field18_0x18; + unsigned char field13_0x13; + unsigned char field14_0x14; + unsigned char field15_0x15; + unsigned char field16_0x16; + unsigned char field17_0x17; + unsigned char field18_0x18; }; typedef struct tdstSndBankDescriptorList_ tdstSndBankDescriptorList; struct AnimLights { void **a_p_stLights; - ushort uwNumberOfLights; + unsigned short uwNumberOfLights; void *a_hLightsInSector; }; typedef struct INO_Device *INO_DeviceHandle; struct INO_DIDevice { - struct DIDEVICEINSTANCE m_stDevInstance; - struct LPDIRECTINPUTDEVICE m_p_stDevInterface; /* set */ - struct LPDIRECTINPUTDEVICE2 m_p_stDevInterface2; + DIDEVICEINSTANCE m_stDevInstance; + LPDIRECTINPUTDEVICE m_p_stDevInterface; /* set */ + LPDIRECTINPUTDEVICE2 m_p_stDevInterface2; short m_wExtendedInterfaceAvailable; undefined field4_0x24e; undefined field5_0x24f; - struct INO_DeviceHandle m_hDevice; + INO_DeviceHandle m_hDevice; undefined field7_0x254; undefined field8_0x255; undefined field9_0x256; @@ -3819,17 +3819,17 @@ struct INO_DIDevice { undefined field62_0x28b; undefined field63_0x28c; }; -typedef uint SCR_tdx_Hash_Key; +typedef unsigned int SCR_tdx_Hash_Key; struct SCR_tdst_Link_Value_ { - struct SCR_tdst_DyAr_Header stHeader; + SCR_tdst_DyAr_Header stHeader; char *p_szKey; - ulong ulValue; + unsigned long ulValue; SCR_tdx_Hash_Key xHashKeyForKey; - uint uiIndexHashKeyKey; + unsigned int uiIndexHashKeyKey; SCR_tdx_Hash_Key xHashKeyForValue; - uint uiIndexHashKeyValue; - enum SCR_tde_Link_State eState; - struct SCR_tdst_Link_AdditionalInfos stInfos; + unsigned int uiIndexHashKeyValue; + SCR_tde_Link_State eState; + SCR_tdst_Link_AdditionalInfos stInfos; }; typedef struct SCR_tdst_Link_Value_ SCR_tdst_Link_Value; struct _tdstThemePart { @@ -4276,8 +4276,8 @@ struct windowInnerParams { undefined field25_0x1c; }; struct GAM_as4_inner { - dword unk; - byte tag; /* Created by retype action */ + unsigned int unk; + unsigned char tag; /* Created by retype action */ undefined field2_0x5; undefined field3_0x6; undefined field4_0x7; @@ -4326,17 +4326,17 @@ struct GAM_as4_inner { undefined field47_0x3b; float field48_0x3c; float field49_0x40; - dword counter; + unsigned int counter; }; struct GAM_tdstEngineOuter { - uchar ucNumberOfLevels; - uchar ucCurrentLevel; - uchar ucPreviousLevel; - uchar ucExitIdToQuitPrevLevel; - uchar ucLevelGlobalCounter; + unsigned char ucNumberOfLevels; + unsigned char ucCurrentLevel; + unsigned char ucPreviousLevel; + unsigned char ucExitIdToQuitPrevLevel; + unsigned char ucLevelGlobalCounter; ACP_tdxBool xDemoMode; - uchar ucCurrentLanguage; - uchar ucNbLanguages; + unsigned char ucCurrentLanguage; + unsigned char ucNbLanguages; ACP_tdxBool bEngineFrozen; ACP_tdxBool bResurrection; char cCameraMode; @@ -4345,9 +4345,9 @@ struct _tdstMidiMemory { }; typedef struct _tdstMidiMemory tdstMidiMemory; typedef struct _tdstSwitchElement tdstSwitchElement; -typedef struct GUID *LPCGUID; +typedef GUID *LPCGUID; struct _SND_tdstCallback { - enum SND_tduTypeCallback eType; + SND_tduTypeCallback eType; union _union_2482 uCallback; union _union_2483 uInfo; }; @@ -4377,8 +4377,8 @@ struct _tdstTypeSwitchDisk { }; typedef struct _virtual_module *SND_VirtualModuleHandle; struct tdstCurrentModeInfo { - uchar ucModuleId; - uchar ucMode; + unsigned char ucModuleId; + unsigned char ucMode; void *p_vTdstBlockInfoOrTdstDynInfo; }; typedef union _tduDataMidi tduDataMidi; @@ -4386,10 +4386,10 @@ typedef struct tdstNodeMainCharacter_ *MC_tdxHandleToMainCharacterNode; typedef long SndRealTwin; typedef INO_fn_wMethod *INO_fn_wMethod; struct INO_Device { - ushort m_uwType; - struct INO_tdstDevCaps *m_p_stCaps; - struct INO_tdstDevState *m_p_stState; - ulong m_ulLastTimeCount; + unsigned short m_uwType; + INO_tdstDevCaps *m_p_stCaps; + INO_tdstDevState *m_p_stState; + unsigned long m_ulLastTimeCount; short m_wHistoricSize; short m_wHistoricHead; short m_wRecordNumber; @@ -4400,11 +4400,11 @@ struct IPT_tdstConvertValue_ { }; struct EventInTable { void *p_xEvent; - uchar ucTypeOfEvent; - uchar ucPriority; - uchar ucFirstCall; - uchar ucPeriod; - ulong ulBinaryEventId; + unsigned char ucTypeOfEvent; + unsigned char ucPriority; + unsigned char ucFirstCall; + unsigned char ucPeriod; + unsigned long ulBinaryEventId; }; struct r3_math_interface { undefined *field0_0x0; @@ -4655,10 +4655,10 @@ struct tdstCsaList_ { typedef struct _SND_tdstBlockEvent SND_tdstBlockEvent; struct _tdstRangeSplitListDisk { }; -typedef struct GUID IID; +typedef GUID IID; struct GLD_Viewport { struct GLD_ViewportAttributes stViewAttrib; - uchar bIsLocked; + unsigned char bIsLocked; }; struct tdstProhibit_ { }; @@ -4666,8 +4666,8 @@ struct tdstFootPath_ { }; typedef enum tdeObjectTreeInit_ tdeObjectTreeInit; struct Couple { - ushort wChild; - ushort wFather; + unsigned short wChild; + unsigned short wFather; }; typedef union _SND_tduRefEvt SND_tduRefEvt; typedef struct _tdstRangeSplitMem tdstRangeSplitMem; @@ -4754,28 +4754,28 @@ struct _tdstTypeRandomMem { }; typedef struct _SND_tdstBlockEvent *SND_tdxHandleToSoundEvent; struct FIL_FileHeader { - ulong ulWidth; - ulong ulHeight; - ulong ulImageSize; + unsigned long ulWidth; + unsigned long ulHeight; + unsigned long ulImageSize; long lChromakeyIndex; - ushort uwNbColorInPalette; - uchar ucBpcInPalette; - uchar ucBpp; - uchar ucRLECode; - uchar ucRed; - uchar ucGreen; - uchar ucBlue; - uchar ucFormat; - uchar ucVersion; + unsigned short uwNbColorInPalette; + unsigned char ucBpcInPalette; + unsigned char ucBpp; + unsigned char ucRLECode; + unsigned char ucRed; + unsigned char ucGreen; + unsigned char ucBlue; + unsigned char ucFormat; + unsigned char ucVersion; }; struct FIL_GF { struct FIL_FileHeader stFileHeader; - uchar *p_ucBitMap; - uchar *p_ucPalette; + unsigned char *p_ucBitMap; + unsigned char *p_ucPalette; }; struct _tdstTypeSequenceDisk { }; -typedef struct IID *LPIID; +typedef IID *LPIID; typedef struct _SND_tdstCallback SND_tdstCallback; typedef tdfn_vInitHandleFunction tdfn_vInitHandleFunction; struct windowInnerUnkParams { @@ -4788,9 +4788,9 @@ struct windowInnerUnkParams { undefined4 field6_0x18; int field7_0x1c; int field8_0x20; - uint field9_0x24; + unsigned int field9_0x24; int field10_0x28; - uint field11_0x2c; + unsigned int field11_0x2c; int unk2_100; int unk3_100; int field14_0x38; @@ -4804,7 +4804,7 @@ struct windowInnerUnkParams { int unk6_0; int unk7_0; undefined4 unk1_0; - uint unk_ffffffff; + unsigned int unk_ffffffff; undefined *unk0_0; /* set from r3_wndUnk1 */ undefined field27_0x6c; undefined field28_0x6d; @@ -4812,7 +4812,7 @@ struct windowInnerUnkParams { undefined field30_0x6f; }; struct GLI_tdstMaterial { - ulong ulMaterialType; + unsigned long ulMaterialType; struct GEO_tdstColor stAmbient; struct GEO_tdstColor stDiffuse; struct GEO_tdstColor stSpecular; @@ -4824,7 +4824,7 @@ struct GLI_tdstMaterial { float xConstantAddU; float xConstantAddV; long lIncrementIsEnable; - ulong dwActualRefreshNumber; + unsigned long dwActualRefreshNumber; struct GLI_tdstAnimatedTextureNode *p_stFirstAnimatedTextureNode; struct GLI_tdstAnimatedTextureNode *p_stActualAnimatedTextureNode; long lNumberOfDisplayNode; @@ -4848,10 +4848,10 @@ struct Frame3d { struct Element3d *p_stArrayOfElts3d; struct MTH3D_Matrix *p_stAngularSpeedMatrix; struct MTH3_Vector *p_stLinearSpeedVector; - struct tdstPLA_Hierarchy *p_stHierarchy; + tdstPLA_Hierarchy *p_stHierarchy; }; typedef struct _tdstFormatPCM tdstFormatMPEG; -typedef struct FMTID *LPFMTID; +typedef FMTID *LPFMTID; typedef struct _tdstFormatPCM tdstFormatPCM; typedef struct _s_FuncInfo FuncInfo; typedef struct tdstAChannel_ *CHN_tdxHandleToChannel; @@ -4860,7 +4860,7 @@ struct tdstParticleGenerator_ { }; typedef struct tdstViewportManagement_ *tdxHandleToViewportManagement; struct levelFixStruct { - byte field0_0x0; /* stripped of usually */ + unsigned char field0_0x0; /* stripped of usually */ undefined field1_0x1; undefined field2_0x2; undefined field3_0x3; @@ -4929,37 +4929,37 @@ struct levelFixStruct { }; typedef struct _tdstTypeRandomMem tdstTypeRandomMem; struct tdstLastErrorInfo { - word lastErr; + unsigned short lastErr; char ucLastFailedModuleId; - dword ulChannelId; + unsigned int ulChannelId; }; struct GLI_Texture { - uchar bIsAvailable; + unsigned char bIsAvailable; long lTextureQuality; void *p_vBitMap; void *p_vColorTable; void *p_stSpecParam; - ulong ulTextureCaps; - ushort uwHeight; - ushort uwWidth; - ushort uwRealHeight; - ushort uwRealWidth; + unsigned long ulTextureCaps; + unsigned short uwHeight; + unsigned short uwWidth; + unsigned short uwRealHeight; + unsigned short uwRealWidth; float xAddU; float xAddV; - uchar lIncrementIsEnable; - ulong ulChromakeyColorRGBA; + unsigned char lIncrementIsEnable; + unsigned long ulChromakeyColorRGBA; long lNumberOfLod; - ulong ulCompressionCounter; - ulong ulTypeOfCompression; - ulong ulTypeOfMipMapping; + unsigned long ulCompressionCounter; + unsigned long ulTypeOfCompression; + unsigned long ulTypeOfMipMapping; struct GLI_Texture *p_TextureOfSubstitution; - uchar ucBilinearMode; - uchar ucCyclingMode; + unsigned char ucBilinearMode; + unsigned char ucCyclingMode; char szFileName[128]; }; typedef struct _tdstTypeSequenceDisk tdstTypeSequenceDisk; struct INO_unk_joy { - byte field0_0x0; + unsigned char field0_0x0; undefined field1_0x1; undefined field2_0x2; undefined field3_0x3; @@ -5040,12 +5040,12 @@ struct INO_unk_joy { undefined field78_0x51; undefined field79_0x52; undefined field80_0x53; - byte field81_0x54; + unsigned char field81_0x54; undefined field82_0x55; - byte field83_0x56; + unsigned char field83_0x56; undefined field84_0x57; undefined field85_0x58; - byte field86_0x59; + unsigned char field86_0x59; undefined field87_0x5a; undefined field88_0x5b; int field89_0x5c; @@ -5063,7 +5063,7 @@ struct INO_unk_joy { int field101_0x74; int field102_0x78; int field103_0x7c; - byte field104_0x80; + unsigned char field104_0x80; undefined field105_0x81; undefined field106_0x82; undefined field107_0x83; @@ -5229,16 +5229,16 @@ struct INO_unk_joy { undefined field267_0x123; }; struct LST2_tdstAnchorTotdxHandleToTransitionSLk { - struct tdxHandleToTransition hFirstElementSLk; - struct tdxHandleToTransition hLastElementSLk; + tdxHandleToTransition hFirstElementSLk; + tdxHandleToTransition hLastElementSLk; long lNumberOfElementsSLk; }; typedef struct _tdstTypeSwitchDisk tdstTypeSwitchDisk; typedef struct levelFixStruct *relPtr; typedef struct stDevState INO_tdstDevState; struct LST2_tdstAnchorToMC_tdxHandleToMainCharacterNodeSLk { - struct MC_tdxHandleToMainCharacterNode hFirstElementSLk; - struct MC_tdxHandleToMainCharacterNode hLastElementSLk; + MC_tdxHandleToMainCharacterNode hFirstElementSLk; + MC_tdxHandleToMainCharacterNode hLastElementSLk; long lNumberOfElementsSLk; }; struct GEO_tdstBoundingSphere { diff --git a/java/ghidra/re3lib/DataTypeWriter.java b/java/ghidra/re3lib/DataTypeWriter.java index bde15a3a..cd0f7249 100644 --- a/java/ghidra/re3lib/DataTypeWriter.java +++ b/java/ghidra/re3lib/DataTypeWriter.java @@ -231,7 +231,9 @@ public class DataTypeWriter { code.append(annotator.getPrefix(composite, component)); String fieldName = component.getFieldName(); - if (fieldName == null || fieldName.length() == 0) { + String originalName = fieldName; + boolean needsFixing = fieldName != null && fieldName.contains("?"); + if (fieldName == null || fieldName.length() == 0 || needsFixing) { fieldName = component.getDefaultFieldName(); } @@ -250,8 +252,12 @@ public class DataTypeWriter { code.append(annotator.getSuffix(composite, component)); String comment = component.getComment(); - if (comment != null && comment.length() > 0) { - code.append(" ").append(comment(comment)); + String commentText = comment != null && comment.length() > 0 ? comment : ""; + if (needsFixing) { + commentText += (commentText.length() > 0 ? " " : "") + "(fix name \"" + originalName + "\")"; + } + if (commentText.length() > 0) { + code.append(" ").append(comment(commentText)); } code.append(EOL); } @@ -297,8 +303,6 @@ public class DataTypeWriter { String dataTypeName = dataType.getDisplayName(); if (!isIntegral(typedefName, dataTypeName)) { - DataType baseType = typeDef.getBaseDataType(); - // Add dependency only if it's not a pointer if (!isPointerType(dataType)) { DataType depType = getImmediateDependencyType(dataType); @@ -314,24 +318,17 @@ public class DataTypeWriter { private void writeBuiltInBlock(BuiltInDataType dt, StringBuilder code, Set dependencies) { String declaration = dt.getCTypeDeclaration(this.dataOrganization); - if (declaration != null && !dt.getDisplayName().equals("bool")) { + if (declaration != null) { code.append(declaration); } } - + private boolean isPointerType(DataType dt) { return dt instanceof Pointer; } private boolean isBuiltInType(DataType dt) { - return dt instanceof BuiltInDataType || - dt.getDisplayName().equals("void") || - dt.getDisplayName().equals("char") || - dt.getDisplayName().equals("int") || - dt.getDisplayName().equals("short") || - dt.getDisplayName().equals("long") || - dt.getDisplayName().equals("float") || - dt.getDisplayName().equals("double"); + return dt instanceof BuiltInDataType; } private DataType getImmediateDependencyType(DataType dt) { @@ -348,23 +345,6 @@ public class DataTypeWriter { return dt; } - private DataType getBaseDataType(DataType dt) { - while (dt != null) { - if (dt instanceof Array) { - dt = ((Array) dt).getDataType(); - } else if (dt instanceof Pointer) { - dt = ((Pointer) dt).getDataType(); - } else if (dt instanceof BitFieldDataType) { - dt = ((BitFieldDataType) dt).getBaseDataType(); - } else if (dt instanceof TypeDef) { - dt = ((TypeDef) dt).getBaseDataType(); - } else { - break; - } - } - return dt; - } - private String getTypeDeclaration(String name, DataType dataType, int instanceLength) { if (name == null) { name = ""; @@ -399,7 +379,15 @@ public class DataTypeWriter { } String prefix = getDataTypePrefix(dataType); - String componentString = prefix + dataType.getDisplayName(); + + String dataTypeString; + if (dataType instanceof AbstractIntegerDataType) { + dataTypeString = ((AbstractIntegerDataType)dataType).getCDeclaration(); + } else { + dataTypeString = dataType.getDisplayName(); + } + + String componentString = prefix + dataTypeString; if (name.length() != 0) { componentString = componentString + " " + name; } @@ -408,7 +396,12 @@ public class DataTypeWriter { } private String getDataTypePrefix(DataType dataType) { - dataType = getBaseDataType(dataType); + // Don't add struct/union prefix for typedefs - they already have their own name + if (dataType instanceof TypeDef) { + return ""; + } + + // Only add struct/union prefix for direct struct/union references (not typedefs) if (dataType instanceof Structure) { return "struct "; } else if (dataType instanceof Union) {