DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
gameutil.hpp File Reference

Go to the source code of this file.

Classes

struct  MOTION_INFO
 
struct  MOTION_STATE
 
struct  tagFRAME_INF
 
struct  Mot_Key
 
struct  Mot_List
 
struct  Mot_File_List
 
struct  tagMOTION_TYPE
 
struct  MOTION_FILE_INFO
 
struct  MoveCheckInfo
 

Enumerations

enum  FontColor {
  FONT_COLOR_WHITE = 0x80BFBFBF , FONT_COLOR_BROWN = 0x80304045 , FONT_COLOR_YELLOW = 0x8040BDBD , FONT_COLOR_CYAN = 0x80BDBD40 ,
  FONT_COLOR_GREEN = 0x8040BD40 , FONT_COLOR_BROWN_OPAQUE = 0xFF304045 , FONT_COLOR_GOLD = 0x8066CEE7 , FONT_COLOR_GREY = 0x808F8F8F ,
  FONT_COLOR_MAGENTA = 0x80BF3FBF
}
 
enum  MotionKeyType {
  MOTION_KEY_ROTATION = 0 , MOTION_KEY_SCALE = 1 , MOTION_KEY_TRANSLATION = 2 , MOTION_KEY_VERTEX = 12 ,
  MOTION_KEY_CAMERA_POSITION = 30 , MOTION_KEY_CAMERA_TARGET = 31 , MOTION_KEY_CAMERA_ROLL = 32 , MOTION_KEY_CAMERA_FOV = 33 ,
  MOTION_KEY_MATERIAL_ALPHA = 40 , MOTION_KEY_MATERIAL_COLOR = 41 , MOTION_KEY_VISIBLE = 50 , MOTION_KEY_UNK_33 = 51 ,
  MOTION_KEY_SKIP = 200
}
 

Functions

int ezMidiInit ()
 
int ezMidi (int command, int argument)
 
int ezTransToIOP (void *iop_address, void *ee_address, int size)
 
int LookAt (CFrameVu1 *frame, float *target, _FRAMECONSTRAINT constraint)
 
int LookAt (CFrameVu1 *frame, CFrameVu1 *target, _FRAMECONSTRAINT constraint)
 
void set2DSprite_Start (sceVif1Packet *packet, CTexture *texture)
 
void set2DSprite_End (sceVif1Packet *packet, CTexture *texture)
 
void SetClut (sceVif1Packet *packet, CTexture *texture, i *clut)
 
 STATIC_ASSERT (sizeof(MOTION_INFO)==0x10)
 
 STATIC_ASSERT (sizeof(MOTION_STATE)==0x50)
 
 STATIC_ASSERT (sizeof(tagFRAME_INF)==0xD0)
 
 STATIC_ASSERT (sizeof(Mot_Key)==0x20)
 
 STATIC_ASSERT (sizeof(Mot_List)==0x20)
 
 STATIC_ASSERT (sizeof(Mot_File_List)==0x20)
 
 STATIC_ASSERT (sizeof(tagMOTION_TYPE)==0x80)
 
 STATIC_ASSERT (sizeof(MOTION_FILE_INFO)==0xC)
 
int CreateAnimeDataEX (tagMOTION_TYPE *motion, CDataAlloc2< 1 > *arena, MOTION_FILE_INFO *files)
 
void AnimeDataInit (CFrame *frame, tagMOTION_TYPE *motion, CDataAlloc2< 1 > *arena, tagFRAME_INF **frame_info)
 
int AnimeDataInit (CFrame *frame, tagMOTION_TYPE *motion, CDataAlloc2< 1 > *arena, tagFRAME_INF *frame_info)
 
Mot_List * MotionProc (CFrame *frame, MOTION_STATE *state, Mot_List *list)
 
Mot_List * MotionProc2 (CFrame *frame, tagMOTION_TYPE *motion, tagFRAME_INF *frame_info, Mot_List *list)
 
void SetMotionEX (CFrame *frame, tagMOTION_TYPE *motion, MOTION_INFO *info, MOTION_STATE *state, tagFRAME_INF *frame_info)
 
int NextMotionTime_GET_EX (MOTION_INFO *info, MOTION_STATE *state)
 
int CheckHits (CCPoly *poly, int count, float *from, float *to, int max, int *hit_poly, float(*hit_point)[4], int sort, int mode)
 
int CheckHitVertical (CCPoly *poly, int count, float *from, float depth, float *hit_point, int mode)
 
void GetScrPosFromChar (CCharacter *chara, int *out_pos)
 
int NameRegistCodeJtoE (int code)
 
unsigned int Color2Clut (unsigned int colour)
 
void RollPos (float *centre, float *point, float angle, float *out)
 
void set2DSprite_Core (sceVif1Packet *packet, CTexture *texture, const CRect_i_ &screen, const CRect_i_ &texel, unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha)
 
int CheckPosInOutForRect (RECT *rect, int x, int y)
 
float GetDisPosToRect (RECT *rect, int x, int y)
 
float LinerInterpolation (float from, float to, float at)
 
void AreaAddPos (int *area, int *pos, int *out)
 
 STATIC_ASSERT (sizeof(MoveCheckInfo)==0xD0)
 
int MoveCheck (float *pos, float *velocity, float *out_pos, MoveCheckInfo *out_info, CCPoly *polys, int poly_num, int mode)
 
int GetFootPoly (float *position, float depth, CCPoly *found, float *ground, CCPoly *polys, int count, int mode)
 
int CheckWidth (CCPoly *polys, int count, float *position, float radius, float *out, int flags)
 
int GetEventPoly (float *position, float *velocity, CCPoly *found, int *found_no, float *hit, CCPoly *polys, int count, int mode)
 
int CheckCameraWidth (CCPoly *polys, int count, float *position, float radius, float *out, int flags)
 

Variables

u32 MesWinClut [256]
 
s32 GaijiDataTbl [158][8]
 
u32 FontColorTbl [16]
 
int Mes1MakeFlg
 
int Mes2MakeFlg
 
int MesAbsDrawOff
 
u8 MesWinTexBuff_02 [0x100]
 
u8 MesWinTexBuff_01 [0x100]
 
u8 MesWinTexBuff_11 [0x100]
 
u8 MesWinTexBuff_12 [0x100]
 

Detailed Description

Declares the motion data that a character plays, and the calls that step it.

Definition in file gameutil.hpp.

Enumeration Type Documentation

◆ FontColor

enum FontColor

Font colours of FontColorTbl.

Enumerator
FONT_COLOR_WHITE 

White.

FONT_COLOR_BROWN 

Dark brown.

FONT_COLOR_YELLOW 

Yellow.

FONT_COLOR_CYAN 

Cyan.

FONT_COLOR_GREEN 

Green.

FONT_COLOR_BROWN_OPAQUE 

Opaque dark brown.

FONT_COLOR_GOLD 

Gold.

FONT_COLOR_GREY 

Grey.

FONT_COLOR_MAGENTA 

Magenta.

Definition at line 14 of file gameutil.hpp.

◆ MotionKeyType

What a motion key list sets, as Mot_List::type holds it.

Enumerator
MOTION_KEY_ROTATION 

Rotation.

MOTION_KEY_SCALE 

Scale.

MOTION_KEY_TRANSLATION 

Translation.

MOTION_KEY_VERTEX 

Vertices.

MOTION_KEY_CAMERA_POSITION 

Camera position.

MOTION_KEY_CAMERA_TARGET 

Camera target.

MOTION_KEY_CAMERA_ROLL 

Camera roll.

MOTION_KEY_CAMERA_FOV 

Camera field of view.

MOTION_KEY_MATERIAL_ALPHA 

Material alpha.

MOTION_KEY_MATERIAL_COLOR 

Material colour.

MOTION_KEY_VISIBLE 

Visibility.

MOTION_KEY_UNK_33 

Visibility, with the other pair of draw modes.

MOTION_KEY_SKIP 

Skipped.

Definition at line 32 of file gameutil.hpp.

Function Documentation

◆ ezMidiInit()

int ezMidiInit ( )

Connects the EE client to the EZMIDI RPC server.

Mangled name:
ezMidiInit__Fv
Address:
0x147970
Size:
0x88

Definition at line 37 of file gameutil.cpp.

◆ ezMidi()

int ezMidi ( int  command,
int  argument 
)

Sends one command to the EZMIDI RPC server and returns its response word.

Mangled name:
ezMidi__Fii
Address:
0x147A00
Size:
0xD4

Definition at line 63 of file gameutil.cpp.

◆ ezTransToIOP()

int ezTransToIOP ( void *  iop_address,
void *  ee_address,
int  size 
)

Transfers a buffer from EE memory into IOP memory and waits for completion.

Mangled name:
ezTransToIOP__FPvPvi
Address:
0x147AE0
Size:
0x90

Definition at line 86 of file gameutil.cpp.

◆ LookAt() [1/2]

int LookAt ( CFrameVu1 *  frame,
float *  target,
_FRAMECONSTRAINT  constraint 
)

Turns a model frame gradually towards a world-space target position.

Mangled name:
LookAt__FP9CFrameVu1Pf16_FRAMECONSTRAINT
Address:
0x149910
Size:
0x2BC

Definition at line 816 of file gameutil.cpp.

◆ LookAt() [2/2]

int LookAt ( CFrameVu1 *  frame,
CFrameVu1 *  target,
_FRAMECONSTRAINT  constraint 
)

Turns a model frame gradually towards another frame's world position.

Mangled name:
LookAt__FP9CFrameVu1P9CFrameVu116_FRAMECONSTRAINT
Address:
0x149BD0
Size:
0x54

Definition at line 890 of file gameutil.cpp.

◆ set2DSprite_Start()

void set2DSprite_Start ( sceVif1Packet *  packet,
CTexture *  texture 
)

Opens a batch of textured two-dimensional sprites in a VIF1 packet.

Mangled name:
set2DSprite_Start__FP13sceVif1PacketP8CTexture
Address:
0x14C220
Size:
0x19C

Definition at line 2032 of file gameutil.cpp.

◆ set2DSprite_End()

void set2DSprite_End ( sceVif1Packet *  packet,
CTexture *  texture 
)

Closes the current two-dimensional sprite batch and fixes its tag lengths.

Mangled name:
set2DSprite_End__FP13sceVif1PacketP8CTexture
Address:
0x14C4F0
Size:
0xA4

Definition at line 2099 of file gameutil.cpp.

◆ SetClut()

void SetClut ( sceVif1Packet *  packet,
CTexture *  texture,
i *  clut 
)

Uploads a texture's 16-by-16 colour lookup table through a VIF1 packet.

Mangled name:
SetClut__FP13sceVif1PacketP8CTextureP1i
Address:
0x14C5A0
Size:
0x60

Definition at line 2118 of file gameutil.cpp.

◆ CreateAnimeDataEX()

int CreateAnimeDataEX ( tagMOTION_TYPE *  motion,
CDataAlloc2< 1 > *  arena,
MOTION_FILE_INFO *  files 
)

Takes a motion's animation data out of an arena and fills it from its files.

Mangled name:
CreateAnimeDataEX__FP14tagMOTION_TYPEP14CDataAlloc2_1_P16MOTION_FILE_INFO
Address:
0x149090
Size:
0x264

Takes a motion's animation data out of an arena and fills it from a file.

Mangled name:
CreateAnimeDataEX__FP14tagMOTION_TYPEP14CDataAlloc2_1_P16MOTION_FILE_INFO
Address:
0x149090
Size:
0x264

Definition at line 587 of file gameutil.cpp.

◆ AnimeDataInit() [1/2]

void AnimeDataInit ( CFrame *  frame,
tagMOTION_TYPE *  motion,
CDataAlloc2< 1 > *  arena,
tagFRAME_INF **  frame_info 
)

Builds the per-frame animation table a model's motion needs.

Mangled name:
AnimeDataInit__FP6CFrameP14tagMOTION_TYPEP14CDataAlloc2_1_PP12tagFRAME_INF
Address:
0x149300
Size:
0x98

Definition at line 695 of file gameutil.cpp.

◆ AnimeDataInit() [2/2]

int AnimeDataInit ( CFrame *  frame,
tagMOTION_TYPE *  motion,
CDataAlloc2< 1 > *  arena,
tagFRAME_INF *  frame_info 
)

Builds the per-frame animation table into storage already set aside.

Mangled name:
AnimeDataInit__FP6CFrameP14tagMOTION_TYPEP14CDataAlloc2_1_P12tagFRAME_INF
Address:
0x1493A0
Size:
0x318

Definition at line 707 of file gameutil.cpp.

◆ MotionProc()

Mot_List * MotionProc ( CFrame *  frame,
MOTION_STATE *  state,
Mot_List *  list 
)

Applies one motion's frame to a model's frame hierarchy, and gives back the next driver in the list.

Mangled name:
MotionProc__FP6CFrameP12MOTION_STATEP8Mot_List
Address:
0x147D20
Size:
0xB34

Definition at line 179 of file gameutil.cpp.

◆ MotionProc2()

Mot_List * MotionProc2 ( CFrame *  frame,
tagMOTION_TYPE *  motion,
tagFRAME_INF *  frame_info,
Mot_List *  list 
)

Skins one bone of a model: moves each weighted vertex toward the bone's transform, and gives back the next driver in the list.

Mangled name:
MotionProc2__FP6CFrameP14tagMOTION_TYPEP12tagFRAME_INFP8Mot_List
Address:
0x148860
Size:
0x498

Definition at line 401 of file gameutil.cpp.

◆ SetMotionEX()

void SetMotionEX ( CFrame *  frame,
tagMOTION_TYPE *  motion,
MOTION_INFO *  info,
MOTION_STATE *  state,
tagFRAME_INF *  frame_info 
)

Puts a model on the frame that its motion state stands on.

Mangled name:
SetMotionEX__FP6CFrameP14tagMOTION_TYPEP11MOTION_INFOP12MOTION_STATEP12tagFRAME_INF
Address:
0x148D00
Size:
0x390

Definition at line 509 of file gameutil.cpp.

◆ NextMotionTime_GET_EX()

int NextMotionTime_GET_EX ( MOTION_INFO *  info,
MOTION_STATE *  state 
)

Maps how far the playing motion has run onto the requested motion's frames.

Mangled name:
NextMotionTime_GET_EX__FP11MOTION_INFOP12MOTION_STATE
Address:
0x1496C0
Size:
0xC4

Definition at line 776 of file gameutil.cpp.

◆ CheckHits()

int CheckHits ( CCPoly *  poly,
int  count,
float *  from,
float *  to,
int  max,
int *  hit_poly,
float(*)  hit_point[4],
int  sort,
int  mode 
)

Finds where a line from one point to another crosses a set of polygons, and gives back how many crossings it found.

Mangled name:
CheckHits__FP6CCPolyiPfPfiPiPA4_fii
Address:
0x14A230
Size:
0x444

Definition at line 1085 of file gameutil.cpp.

◆ CheckHitVertical()

int CheckHitVertical ( CCPoly *  poly,
int  count,
float *  from,
float  depth,
float *  hit_point,
int  mode 
)

Finds the polygon straight below a point, and gives back which one it is.

Mangled name:
CheckHitVertical__FP6CCPolyiPffPfi
Address:
0x14A080
Size:
0x1A4

Definition at line 1046 of file gameutil.cpp.

◆ GetScrPosFromChar()

void GetScrPosFromChar ( CCharacter *  chara,
int *  out_pos 
)

Works out where a character stands on screen, in pixels.

Mangled name:
GetScrPosFromChar__FP10CCharacterPi
Address:
0x14C980
Size:
0x88
Return type:
Not recovered.

Definition at line 2197 of file gameutil.cpp.

◆ NameRegistCodeJtoE()

int NameRegistCodeJtoE ( int  code)

Maps one character of a registered name from its Japanese code to the external-character code the English font draws it with.

Mangled name:
NameRegistCodeJtoE__Fi
Address:
0x14CA60
Size:
0xC4

Definition at line 2219 of file gameutil.cpp.

◆ Color2Clut()

unsigned int Color2Clut ( unsigned int  colour)

Gives the font palette entry that holds one colour, or the first entry.

Mangled name:
Color2Clut__FUi
Address:
0x14CA10
Size:
0x4C

Definition at line 2209 of file gameutil.cpp.

◆ RollPos()

void RollPos ( float *  centre,
float *  point,
float  angle,
float *  out 
)

Turns one point about another by an angle, and writes where it lands.

Mangled name:
RollPos__FPfPffPf
Address:
0x14C690
Size:
0x1E4

Definition at line 2157 of file gameutil.cpp.

◆ set2DSprite_Core()

void set2DSprite_Core ( sceVif1Packet *  packet,
CTexture *  texture,
const CRect_i_ &  screen,
const CRect_i_ &  texel,
unsigned char  red,
unsigned char  green,
unsigned char  blue,
unsigned char  alpha 
)

Draws one part of a texture into a rectangle of the screen, at one colour.

Mangled name:
set2DSprite_Core__FP13sceVif1PacketP8CTextureRC8CRect_i_RC8CRect_i_UcUcUcUc
Address:
0x14C3C0
Size:
0x128

Definition at line 2078 of file gameutil.cpp.

◆ CheckPosInOutForRect()

int CheckPosInOutForRect ( RECT *  rect,
int  x,
int  y 
)

Tells whether a point lies inside a rectangle.

Mangled name:
CheckPosInOutForRect__FP4RECTii
Address:
0x14C880
Size:
0x7C

Definition at line 2167 of file gameutil.cpp.

◆ GetDisPosToRect()

float GetDisPosToRect ( RECT *  rect,
int  x,
int  y 
)

Gives back how far a point lies from a rectangle.

Mangled name:
GetDisPosToRect__FP4RECTii
Address:
0x14C900
Size:
0x80

Definition at line 2190 of file gameutil.cpp.

◆ LinerInterpolation()

float LinerInterpolation ( float  from,
float  to,
float  at 
)

Gives back the point that lies a fraction of the way from one to another.

Mangled name:
LinerInterpolation__Ffff
Address:
0x14C600
Size:
0x14

Definition at line 2123 of file gameutil.cpp.

◆ AreaAddPos()

void AreaAddPos ( int *  area,
int *  pos,
int *  out 
)

Widens a rectangle so that it also covers a point.

Mangled name:
AreaAddPos__FPiPiPi
Address:
0x14C620
Size:
0x70
Return type:
Not recovered.

Definition at line 2127 of file gameutil.cpp.

◆ MoveCheck()

int MoveCheck ( float *  pos,
float *  velocity,
float *  out_pos,
MoveCheckInfo *  out_info,
CCPoly *  polys,
int  poly_num,
int  mode 
)

Slides a position along a velocity, against a list of collision polygons.

Mangled name:
MoveCheck__FPfPfPfP13MoveCheckInfoP6CCPolyii
Address:
0x14A680
Size:
0x530

Definition at line 1181 of file gameutil.cpp.

◆ GetFootPoly()

int GetFootPoly ( float *  position,
float  depth,
CCPoly *  found,
float *  ground,
CCPoly *  polys,
int  count,
int  mode 
)

Finds the collision polygon below a point and combines its surface attributes.

Mangled name:
GetFootPoly__FPffP6CCPolyPfP6CCPolyii
Address:
0x14ABB0
Size:
0x1DC

Finds the polygon under a position, within a drop of the given height, and gives back the surface it is made of.

Mangled name:
GetFootPoly__FPffP6CCPolyPfP6CCPolyii
Address:
0x14ABB0
Size:
0x1DC

Definition at line 1320 of file gameutil.cpp.

◆ CheckWidth()

int CheckWidth ( CCPoly *  polys,
int  count,
float *  position,
float  radius,
float *  out,
int  flags 
)

Pushes a position out of the polygons within a radius of it.

Mangled name:
CheckWidth__FP6CCPolyiPffPfi
Address:
0x14AF70
Size:
0x8B8

Definition at line 1407 of file gameutil.cpp.

◆ GetEventPoly()

int GetEventPoly ( float *  position,
float *  velocity,
CCPoly *  found,
int *  found_no,
float *  hit,
CCPoly *  polys,
int  count,
int  mode 
)

Finds the event polygon that a step crosses, and gives back the kind of ground it is.

Mangled name:
GetEventPoly__FPfPfP6CCPolyPiPfP6CCPolyii
Address:
0x14AD90
Size:
0x1E0

Definition at line 1364 of file gameutil.cpp.

◆ CheckCameraWidth()

int CheckCameraWidth ( CCPoly *  polys,
int  count,
float *  position,
float  radius,
float *  out,
int  flags 
)

Pushes the camera out of the polygons within a radius of it, counting only the polygons that face the way it is pushed.

Mangled name:
CheckCameraWidth__FP6CCPolyiPffPfi
Address:
0x14B830
Size:
0x9EC

Definition at line 1603 of file gameutil.cpp.

Variable Documentation

◆ MesWinClut

u32 MesWinClut[256]
extern

Palette the message window's font draws out of.

Definition at line 1800 of file gameutil.cpp.

◆ GaijiDataTbl

s32 GaijiDataTbl[158][8]
extern

Where each external character of the message window's font sits, one row of eight words each.

Definition at line 1809 of file gameutil.cpp.

◆ FontColorTbl

u32 FontColorTbl[16]
extern

Colour each palette entry of the message window's font draws with.

Definition at line 2006 of file gameutil.cpp.

◆ Mes1MakeFlg

int Mes1MakeFlg
extern

Whether the first message window is still being built, one step per frame.

Definition at line 2014 of file gameutil.cpp.

◆ Mes2MakeFlg

int Mes2MakeFlg
extern

Whether the second message window is still being built, one step per frame.

Definition at line 2015 of file gameutil.cpp.

◆ MesAbsDrawOff

int MesAbsDrawOff
extern

Whether the message windows skip drawing themselves entirely.

Definition at line 2016 of file gameutil.cpp.

◆ MesWinTexBuff_02

u8 MesWinTexBuff_02[0x100]
extern

The message window font's texture work area.

Texture buffer the second common menu message window draws its glyphs from.

Definition at line 2021 of file gameutil.cpp.

◆ MesWinTexBuff_01

u8 MesWinTexBuff_01[0x100]
extern

The texture each message window builds itself in.

Texture buffer the first common menu message window draws its glyphs from.

Definition at line 2019 of file gameutil.cpp.

◆ MesWinTexBuff_11

u8 MesWinTexBuff_11[0x100]
extern

Texture buffer the third common menu message window draws its glyphs from.

Definition at line 2023 of file gameutil.cpp.

◆ MesWinTexBuff_12

u8 MesWinTexBuff_12[0x100]
extern

Texture buffer the name message window draws its glyphs from.

Definition at line 2025 of file gameutil.cpp.