Merge branch 'Rainchus:main' into main

This commit is contained in:
CreateSource 2023-12-05 21:36:32 -05:00 committed by GitHub
commit b9ecf229e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 2171 additions and 21 deletions

View file

@ -316,6 +316,150 @@ game/sreset.c:
.sdata start:0x801D3658 end:0x801D3670
.sbss start:0x801D3EB8 end:0x801D3ED0
game/board/main.c:
.text start:0x8005B150 end:0x80061F44
.rodata start:0x8011DD60 end:0x8011DD90
.data start:0x80139798 end:0x80139898
.bss start:0x8019D7E0 end:0x8019D968
.sdata start:0x801D3670 end:0x801D3680
.sbss start:0x801D3ED0 end:0x801D3F20
.sdata2 start:0x801D5148 end:0x801D51F8
game/board/board.c:
.text start:0x80061F44 end:0x8006D248
.rodata start:0x8011DD90 end:0x8011DE60
.data start:0x80139898 end:0x80139AA0
.bss start:0x8019D968 end:0x8019D998
.sdata start:0x801D3680 end:0x801D36E0
.sbss start:0x801D3F20 end:0x801D3F58
.sdata2 start:0x801D51F8 end:0x801D5300
game/board/model.c:
.text start:0x8006D248 end:0x8006FD7C
.sbss start:0x801D3F58 end:0x801D3F68
.sdata2 start:0x801D5300 end:0x801D5318
game/board/window.c:
.text start:0x8006FD7C end:0x800714F8
.rodata start:0x8011DE60 end:0x8011DED0
.data start:0x80139AA0 end:0x80139B00
.bss start:0x8019D998 end:0x8019D9F8
.sdata start:0x801D36E0 end:0x801D36F0
.sbss start:0x801D3F68 end:0x801D3F98
.sdata2 start:0x801D5318 end:0x801D5328
game/board/com.c:
.text start:0x800714F8 end:0x800729A4
.data start:0x80139B00 end:0x80139BC8
.sdata start:0x801D36F0 end:0x801D36F8
.sdata2 start:0x801D5328 end:0x801D5350
game/board/overhead.c:
.text start:0x800729A4 end:0x80073FF4
.rodata start:0x8011DED0 end:0x8011DEF0
.data start:0x80139BC8 end:0x80139CC8
.bss start:0x8019D9F8 end:0x8019DA10
.sdata start:0x801D36F8 end:0x801D3700
.sbss start:0x801D3F98 end:0x801D3FB0
.sdata2 start:0x801D5350 end:0x801D53C0
game/board/space.c:
.text start:0x80073FF4 end:0x80077AAC
.data start:0x80139CC8 end:0x80139D08
.bss start:0x8019DA10 end:0x801A4A60
.sdata start:0x801D3700 end:0x801D3708
.sbss start:0x801D3FB0 end:0x801D3FE8
.sdata2 start:0x801D53C0 end:0x801D5440
game/board/shop.c:
.text start:0x80077AAC end:0x8007A83C
.data start:0x80139D08 end:0x80139E88
.bss start:0x801A4A60 end:0x801A4A90
.sdata start:0x801D3708 end:0x801D3728
.sbss start:0x801D3FE8 end:0x801D4008
.sdata2 start:0x801D5440 end:0x801D5510
game/board/lottery.c:
.text start:0x8007A83C end:0x8007FB50
.rodata start:0x8011DEF0 end:0x8011E020
.data start:0x80139E88 end:0x8013A1F0
.bss start:0x801A4A90 end:0x801A4AC0
.sdata start:0x801D3728 end:0x801D3748
.sbss start:0x801D4008 end:0x801D4028
.sdata2 start:0x801D5510 end:0x801D56A0
game/board/basic_space.c:
.text start:0x8007FB50 end:0x80080D54
.data start:0x8013A1F0 end:0x8013A228
.sdata2 start:0x801D56A0 end:0x801D5730
game/board/warp.c:
.text start:0x80080D54 end:0x800816CC
.rodata start:0x8011E020 end:0x8011E040
.data start:0x8013A228 end:0x8013A248
.bss start:0x801A4AC0 end:0x801A4AD0
.sdata start:0x801D3748 end:0x801D3758
.sbss start:0x801D4028 end:0x801D4040
.sdata2 start:0x801D5730 end:0x801D5780
game/board/char_roulette.c:
.text start:0x800816CC end:0x80082C90
.data start:0x8013A248 end:0x8013A2B0
.sdata start:0x801D3758 end:0x801D3760
.sbss start:0x801D4040 end:0x801D4060
.sdata2 start:0x801D5780 end:0x801D5810
game/board/mushroom_space.c:
.text start:0x80082C90 end:0x80083EDC
.sdata start:0x801D3760 end:0x801D3770
.sbss start:0x801D4060 end:0x801D4070
.sdata2 start:0x801D5810 end:0x801D5898
game/board/star.c:
.text start:0x80083EDC end:0x80085CC8
.rodata start:0x8011E040 end:0x8011E0B0
.data start:0x8013A2B0 end:0x8013A368
.bss start:0x801A4AD0 end:0x801A4AE0
.sdata start:0x801D3770 end:0x801D3778
.sbss start:0x801D4070 end:0x801D4088
.sdata2 start:0x801D5898 end:0x801D5938
game/board/dice_roll.c:
.text start:0x80085CC8 end:0x8008831C
.rodata start:0x8011E0B0 end:0x8011E118
.data start:0x8013A368 end:0x8013A408
.bss start:0x801A4AE0 end:0x801A4AF0
.sdata start:0x801D3778 end:0x801D3790
.sbss start:0x801D4088 end:0x801D40A8
.sdata2 start:0x801D5938 end:0x801D59E0
game/board/ui.c:
.text start:0x8008831C end:0x8008DF68
.rodata start:0x8011E118 end:0x8011E200
.data start:0x8013A408 end:0x8013A608
.bss start:0x801A4AF0 end:0x801A4B80
.sdata start:0x801D3790 end:0x801D3798
.sbss start:0x801D40A8 end:0x801D40E0
.sdata2 start:0x801D59E0 end:0x801D5AA0
game/board/hidden_block.c:
.text start:0x8008DF68 end:0x8008EE28
.rodata start:0x8011E200 end:0x8011E220
.data start:0x8013A608 end:0x8013A620
.bss start:0x801A4B80 end:0x801A4BA8
.sdata start:0x801D3798 end:0x801D37A0
.sbss start:0x801D40E0 end:0x801D40F8
.sdata2 start:0x801D5AA0 end:0x801D5AF8
game/board/item.c:
.text start:0x8008EE28 end:0x800975AC
.rodata start:0x8011E220 end:0x8011E238
.data start:0x8013A620 end:0x8013AA10
.bss start:0x801A4BA8 end:0x801A4BE8
.sdata start:0x801D37A0 end:0x801D37B0
.sbss start:0x801D40F8 end:0x801D4138
.sdata2 start:0x801D5AF8 end:0x801D5D30
dolphin/PPCArch.c:
.text start:0x800B42F4 end:0x800B439C

View file

@ -1294,13 +1294,13 @@ fn_8006FDA0 = .text:0x8006FDA0; // type:function size:0x34
fn_8006FDD4 = .text:0x8006FDD4; // type:function size:0x24
fn_8006FDF8 = .text:0x8006FDF8; // type:function size:0x6C
fn_8006FE64 = .text:0x8006FE64; // type:function size:0x514
BoardMessChoiceGet = .text:0x80070378; // type:function size:0xC
BoardWinChoiceGet = .text:0x80070378; // type:function size:0xC
fn_80070384 = .text:0x80070384; // type:function size:0xC
fn_80070390 = .text:0x80070390; // type:function size:0x1A0
BoardMessCreate = .text:0x80070530; // type:function size:0x1A0
BoardWinCreate = .text:0x80070530; // type:function size:0x1A0
fn_800706D0 = .text:0x800706D0; // type:function size:0x18
BoardMessWait = .text:0x800706E8; // type:function size:0x50
BoardMessKill = .text:0x80070738; // type:function size:0x38
BoardWinWait = .text:0x800706E8; // type:function size:0x50
BoardWinKill = .text:0x80070738; // type:function size:0x38
fn_80070770 = .text:0x80070770; // type:function size:0x48
fn_800707B8 = .text:0x800707B8; // type:function size:0x48
fn_80070800 = .text:0x80070800; // type:function size:0x1C
@ -1338,7 +1338,7 @@ fn_800713E8 = .text:0x800713E8; // type:function size:0x28
fn_80071410 = .text:0x80071410; // type:function size:0xE8
fn_800714F8 = .text:0x800714F8; // type:function size:0x100
fn_800715F8 = .text:0x800715F8; // type:function size:0x120
CpuDecideItemPurchaseInner = .text:0x80071718; // type:function size:0x74
BoardCOMGetItemWeight = .text:0x80071718; // type:function size:0x74
fn_8007178C = .text:0x8007178C; // type:function size:0xD0
fn_8007185C = .text:0x8007185C; // type:function size:0x6C
fn_800718C8 = .text:0x800718C8; // type:function size:0x68
@ -1375,7 +1375,7 @@ fn_80073FC4 = .text:0x80073FC4; // type:function size:0x30
fn_80073FF4 = .text:0x80073FF4; // type:function size:0x8
fn_80073FFC = .text:0x80073FFC; // type:function size:0x8
fn_80074004 = .text:0x80074004; // type:function size:0x8
RunEvent = .text:0x8007400C; // type:function size:0x48
BoardSpaceExecPassEvent = .text:0x8007400C; // type:function size:0x48
fn_80074054 = .text:0x80074054; // type:function size:0x60
fn_800740B4 = .text:0x800740B4; // type:function size:0x10
fn_800740C4 = .text:0x800740C4; // type:function size:0x44
@ -1437,7 +1437,7 @@ fn_80079864 = .text:0x80079864; // type:function size:0xA0
fn_80079904 = .text:0x80079904; // type:function size:0x14C
fn_80079A50 = .text:0x80079A50; // type:function size:0x1C8
fn_80079C18 = .text:0x80079C18; // type:function size:0x60
CpuDecideItemPurchase = .text:0x80079C78; // type:function size:0x158
COMGetShopItemSelect = .text:0x80079C78; // type:function size:0x158 scope:local
fn_80079DD0 = .text:0x80079DD0; // type:function size:0x30
fn_80079E00 = .text:0x80079E00; // type:function size:0x188
fn_80079F88 = .text:0x80079F88; // type:function size:0xC
@ -5161,8 +5161,8 @@ lbl_80139A70 = .data:0x80139A70; // type:object size:0x30
lbl_80139AA0 = .data:0x80139AA0; // type:object size:0x24
lbl_80139AC4 = .data:0x80139AC4; // type:object size:0x24
lbl_80139AE8 = .data:0x80139AE8; // type:object size:0x18
CharacterItemPreferences = .data:0x80139B00; // type:object size:0x60
CPUItemUsageTimingFunctions = .data:0x80139B60; // type:object size:0x38
COMItemWeightTbl = .data:0x80139B00; // type:object size:0x60 scope:local
COMItemUseCheckFuncTbl = .data:0x80139B60; // type:object size:0x38 scope:local
lbl_80139B98 = .data:0x80139B98; // type:object size:0x30
lbl_80139BC8 = .data:0x80139BC8; // type:object size:0xB8
lbl_80139C80 = .data:0x80139C80; // type:object size:0x24
@ -5171,7 +5171,7 @@ lbl_80139CC8 = .data:0x80139CC8; // type:object size:0xC
lbl_80139CD4 = .data:0x80139CD4; // type:object size:0xC
jumptable_80139CE0 = .data:0x80139CE0; // type:object size:0x28 scope:local
lbl_80139D08 = .data:0x80139D08; // type:object size:0x24
ItemPrices = .data:0x80139D2C; // type:object size:0x10
ItemPriceTbl = .data:0x80139D2C; // type:object size:0x10 scope:local
lbl_80139D3C = .data:0x80139D3C; // type:object size:0x6C
lbl_80139DA8 = .data:0x80139DA8; // type:object size:0xB0
lbl_80139E58 = .data:0x80139E58; // type:object size:0x30 data:float
@ -5192,7 +5192,7 @@ lbl_8013A248 = .data:0x8013A248; // type:object size:0x58
lbl_8013A2A0 = .data:0x8013A2A0; // type:object size:0x10
lbl_8013A2B0 = .data:0x8013A2B0; // type:object size:0x20
lbl_8013A2D0 = .data:0x8013A2D0; // type:object size:0x48
lbl_8013A318 = .data:0x8013A318; // type:object size:0x50
lbl_8013A318 = .data:0x8013A318; // type:object size:0x50 noreloc
lbl_8013A368 = .data:0x8013A368; // type:object size:0xC data:4byte
lbl_8013A374 = .data:0x8013A374; // type:object size:0xC data:4byte
lbl_8013A380 = .data:0x8013A380; // type:object size:0xC
@ -5399,7 +5399,8 @@ HuSprOrder = .bss:0x8015AE90; // type:object size:0x1800
bmpNoCC = .bss:0x8015C690; // type:object size:0x20 scope:local
HuSprLayerDrawNo = .bss:0x8015C6B0; // type:object size:0x10 scope:local
Model = .bss:0x8015C6C0; // type:object size:0x80
head = .bss:0x8015C740; // type:object size:0x240
head = .bss:0x8015C740; // type:object size:0xB0
rgba = .bss:0x8015C7F0; // type:object size:0x190
lbl_8015C980 = .bss:0x8015C980; // type:object size:0x300 scope:local data:byte
DrawObjData = .bss:0x8015CC80; // type:object size:0x9000 scope:local
BmpPtrBak = .bss:0x80165C80; // type:object size:0x20 scope:local data:4byte
@ -5500,7 +5501,7 @@ lbl_8019D998 = .bss:0x8019D998; // type:object size:0x20
lbl_8019D9B8 = .bss:0x8019D9B8; // type:object size:0x40
lbl_8019D9F8 = .bss:0x8019D9F8; // type:object size:0xC data:float
lbl_8019DA04 = .bss:0x8019DA04; // type:object size:0xC data:4byte
SpaceData = .bss:0x8019DA10; // type:object size:0x7000 data:float
SpaceData = .bss:0x8019DA10; // type:object size:0x7000 scope:local data:float
lbl_801A4A10 = .bss:0x801A4A10; // type:object size:0x50
lbl_801A4A60 = .bss:0x801A4A60; // type:object size:0x14 data:4byte
lbl_801A4A74 = .bss:0x801A4A74; // type:object size:0x1C
@ -6259,7 +6260,7 @@ lbl_801D3F04 = .sbss:0x801D3F04; // type:object size:0x4 data:4byte
lbl_801D3F08 = .sbss:0x801D3F08; // type:object size:0x4 data:4byte
lbl_801D3F0C = .sbss:0x801D3F0C; // type:object size:0x4 data:4byte
lbl_801D3F10 = .sbss:0x801D3F10; // type:object size:0x4 data:4byte
rngSeed = .sbss:0x801D3F14; // type:object size:0x4 data:4byte
boardRandSeed = .sbss:0x801D3F14; // type:object size:0x4 scope:local data:4byte
lbl_801D3F18 = .sbss:0x801D3F18; // type:object size:0x8 data:4byte
lbl_801D3F20 = .sbss:0x801D3F20; // type:object size:0x4 data:4byte
lbl_801D3F24 = .sbss:0x801D3F24; // type:object size:0x4 data:4byte

View file

@ -245,7 +245,7 @@ config.libs = [
Object(Matching, "game/process.c"),
Object(Matching, "game/sprman.c"),
Object(Matching, "game/sprput.c"),
Object(NonMatching, "game/hsfload.c"),
Object(Matching, "game/hsfload.c"),
Object(NonMatching, "game/hsfdraw.c"),
Object(NonMatching, "game/hsfman.c"),
Object(NonMatching, "game/hsfmotion.c"),
@ -280,6 +280,24 @@ config.libs = [
Object(NonMatching, "game/flag.c"),
Object(NonMatching, "game/saveload.c"),
Object(NonMatching, "game/sreset.c"),
Object(NonMatching, "game/board/main.c"),
Object(NonMatching, "game/board/board.c"),
Object(NonMatching, "game/board/model.c"),
Object(NonMatching, "game/board/window.c"),
Object(NonMatching, "game/board/com.c"),
Object(NonMatching, "game/board/overhead.c"),
Object(NonMatching, "game/board/space.c"),
Object(NonMatching, "game/board/shop.c"),
Object(NonMatching, "game/board/lottery.c"),
Object(NonMatching, "game/board/basic_space.c"),
Object(NonMatching, "game/board/warp.c"),
Object(NonMatching, "game/board/char_roulette.c"),
Object(NonMatching, "game/board/mushroom_space.c"),
Object(NonMatching, "game/board/star.c"),
Object(NonMatching, "game/board/dice_roll.c"),
Object(NonMatching, "game/board/ui.c"),
Object(NonMatching, "game/board/hidden_block.c"),
Object(NonMatching, "game/board/item.c"),
],
},
DolphinLib(

51
include/ctype.h Normal file
View file

@ -0,0 +1,51 @@
#ifndef _CTYPE_H
#define _CTYPE_H
extern unsigned char __ctype_map[256];
extern unsigned char __lower_map[256];
extern unsigned char __upper_map[256];
#define __control_char 0x01
#define __motion_char 0x02
#define __space_char 0x04
#define __punctuation 0x08
#define __digit 0x10
#define __hex_digit 0x20
#define __lower_case 0x40
#define __upper_case 0x80
#define __letter (__lower_case | __upper_case)
#define __alphanumeric (__letter | __digit)
#define __graphic (__alphanumeric | __punctuation)
#define __printable (__graphic | __space_char)
#define __whitespace (__motion_char | __space_char)
#define __control (__motion_char | __control_char)
#ifdef __cplusplus
extern "C"
{
#endif
__declspec(weak) int isalpha(int __c);
__declspec(weak) int isdigit(int __c);
__declspec(weak) int isspace(int __c);
__declspec(weak) int isupper(int __c);
__declspec(weak) int isxdigit(int __c);
__declspec(weak) int tolower(int __c);
__declspec(weak) int toupper(int __c);
// added underscore to avoid naming conflicts
inline int _isalpha(int c) { return (int)(__ctype_map[(u8)c] & __letter); }
inline int _isdigit(int c) { return (int)(__ctype_map[(u8)c] & __digit); }
inline int _isspace(int c) { return (int)(__ctype_map[(u8)c] & __whitespace); }
inline int _isupper(int c) { return (int)(__ctype_map[(u8)c] & __upper_case); }
inline int _isxdigit(int c) { return (int)(__ctype_map[(u8)c] & __hex_digit); }
inline int _tolower(int c) { return (c == -1 ? -1 : (int)__lower_map[(u8)c]); }
inline int _toupper(int c) { return (c == -1 ? -1 : (int)__upper_map[(u8)c]); }
#ifdef __cplusplus
}
#endif
#endif

View file

@ -53,9 +53,9 @@ void fn_8004D6F4(s16 arg);
s32 _CheckFlag(u32 flag);
void BoardMessCreate(s16, s32, s32);
void BoardMessKill(void);
void BoardMessWait(void);
void BoardWinCreate(s16, s32, s32);
void BoardWinKill(void);
void BoardWinWait(void);
s32 HuTHPFrameGet(void);

373
include/game/hsfformat.h Normal file
View file

@ -0,0 +1,373 @@
#ifndef _GAME_HSFFORMAT_H
#define _GAME_HSFFORMAT_H
#include "dolphin.h"
#define HSF_OBJ_NULL1 0
#define HSF_OBJ_REPLICA 1
#define HSF_OBJ_MESH 2
#define HSF_OBJ_ROOT 3
#define HSF_OBJ_JOINT 4
#define HSF_OBJ_NULL2 5
#define HSF_OBJ_NULL3 6
#define HSF_OBJ_NONE1 7
#define HSF_OBJ_NONE2 8
#define HSF_OBJ_MAP 9
#define HSF_TRACK_TRANSFORM 2
#define HSF_TRACK_MORPH 3
#define HSF_TRACK_CLUSTER 5
#define HSF_TRACK_CLUSTER_WEIGHT 6
#define HSF_TRACK_MATERIAL 9
#define HSF_TRACK_ATTRIBUTE 10
#define HSF_CURVE_STEP 0
#define HSF_CURVE_LINEAR 1
#define HSF_CURVE_BEZIER 2
#define HSF_CURVE_BITMAP 3
#define HSF_CURVE_CONST 4
typedef struct hsf_vector3f {
float x;
float y;
float z;
} HsfVector3f;
typedef struct hsf_vector2f {
float x;
float y;
} HsfVector2f;
typedef struct hsf_section {
s32 ofs;
s32 count;
} HsfSection;
typedef struct hsf_header {
char magic[8];
HsfSection scene;
HsfSection color;
HsfSection material;
HsfSection attribute;
HsfSection vertex;
HsfSection normal;
HsfSection st;
HsfSection face;
HsfSection object;
HsfSection bitmap;
HsfSection palette;
HsfSection motion;
HsfSection cenv;
HsfSection skeleton;
HsfSection part;
HsfSection cluster;
HsfSection shape;
HsfSection mapAttr;
HsfSection matrix;
HsfSection symbol;
HsfSection string;
} HsfHeader;
typedef struct hsf_scene {
GXColor unk0;
f32 unk4;
f32 unk8;
u32 unkC;
} HsfScene;
typedef struct hsf_bitmap {
char *name;
s32 maxLod;
u8 dataFmt;
u8 pixSize;
s16 sizeX;
s16 sizeY;
s16 palSize;
GXColor tint;
void *palData;
u32 unk;
void *data;
} HsfBitmap;
typedef struct hsf_palette {
char *name;
s32 unk;
u32 palSize;
u16 *data;
} HsfPalette;
typedef struct hsf_attribute {
char *name;
u8 unk4[96];
u32 wrap_s;
u32 wrap_t;
u8 unk6C[16];
u32 flag;
HsfBitmap *bitmap;
} HsfAttribute;
typedef struct hsf_material {
char *name;
u8 unk4[4];
u16 pass;
u8 vtxMode;
u8 litColor[3];
u8 color[3];
u8 shadowColor[3];
float hilite_scale;
float unk18;
float invAlpha;
float unk20[2];
float refAlpha;
float unk2C;
u32 flags;
u32 numAttrs;
HsfAttribute **attrs;
} HsfMaterial;
typedef struct hsf_vertex_buf {
char *name;
s32 count;
void *data;
} HsfBuffer;
typedef struct hsf_tristrip {
u16 data[4];
} HsfTristrip;
typedef struct hsf_face {
u16 type;
u16 mat;
u16 indices[12];
union {
struct {
u32 count;
HsfTristrip *data;
} strip;
u16 ext_indices[4];
};
float nbt[3];
} HsfFace;
typedef struct hsf_const_data {
u32 flags;
u8 unk4[64];
} HsfConstData;
typedef struct hsf_transform {
HsfVector3f pos;
HsfVector3f rot;
HsfVector3f scale;
} HsfTransform;
typedef struct hsf_cenv_single {
u32 target;
u16 pos;
u16 posCnt;
u16 normal;
u16 normalCnt;
} HsfCenvSingle;
typedef struct hsf_cenv_dual_weight {
float weight;
u16 pos;
u16 posCnt;
u16 normal;
u16 normalCnt;
} HsfCenvDualWeight;
typedef struct hsf_cenv_dual {
u32 target1;
u32 target2;
u32 weightCnt;
HsfCenvDualWeight *weight;
} HsfCenvDual;
typedef struct hsf_cenv_multi_weight {
u32 target;
float value;
} HsfCenvMultiWeight;
typedef struct hsf_cenv_multi {
u32 weightCnt;
u16 pos;
u16 posCnt;
u16 normal;
u16 normalCnt;
HsfCenvMultiWeight *weight;
} HsfCenvMulti;
typedef struct hsf_cenv {
char *name;
HsfCenvSingle *singleData;
HsfCenvDual *dualData;
HsfCenvMulti *multiData;
u32 singleCount;
u32 dualCount;
u32 multiCount;
u32 vtxCount;
u32 copyCount;
} HsfCenv;
typedef struct hsf_part {
char *name;
u32 count;
u16 *vertex;
} HsfPart;
typedef struct hsf_cluster {
char *name[2];
union {
char *targetName;
u32 target;
};
HsfPart *part;
u8 unk10[132];
u8 adjusted;
u8 unk95;
u16 type;
u32 vertexCnt;
HsfBuffer **vertex;
} HsfCluster;
typedef struct hsf_shape {
char *name;
union {
u16 count16[2];
u32 vertexCnt;
};
HsfBuffer **vertex;
} HsfShape;
typedef struct hsf_object_data {
struct hsf_object *parent;
u32 childrenCount;
struct hsf_object **children;
HsfTransform base;
HsfTransform curr;
union {
struct {
HsfVector3f min;
HsfVector3f max;
float baseMorph;
float *morphWeight[33];
} mesh;
struct hsf_object *replica;
};
HsfBuffer *face;
HsfBuffer *vertex;
HsfBuffer *normal;
HsfBuffer *color;
HsfBuffer *st;
HsfMaterial *material;
HsfAttribute *attribute;
u8 unk120[2];
u8 shapeType;
u32 vertexShapeCnt;
HsfBuffer **vertexShape;
u32 clusterCnt;
HsfCluster **cluster;
u32 hook;
HsfCenv *cenv;
void *file[2];
} HsfObjectData;
typedef struct hsf_object {
char *name;
s32 type;
HsfConstData *constData;
u32 flags;
HsfObjectData data;
} HsfObject;
typedef struct hsf_skeleton {
char *name;
HsfTransform transform;
} HsfSkeleton;
typedef struct hsf_bitmap_keyframe {
float time;
HsfBitmap *data;
} HsfBitmapKey;
typedef struct hsf_track {
u8 type;
u8 start;
u16 target;
u16 param;
u16 channel;
u16 curveType;
u16 numKeyframes;
union {
float value;
void *data;
};
} HsfTrack;
typedef struct hsf_motion {
char *name;
u32 numTracks;
HsfTrack *track;
float len;
} HsfMotion;
typedef struct hsf_map_attr {
float minX;
float minZ;
float maxX;
float maxZ;
s16 *data;
u32 dataLen;
} HsfMapAttr;
typedef struct hsf_matrix {
u32 base_idx;
u32 count;
Mtx *data;
} HsfMatrix;
typedef struct hsf_data {
u8 magic[8];
HsfScene *scene;
HsfAttribute *attribute;
HsfMaterial *material;
HsfBuffer *vertex;
HsfBuffer *normal;
HsfBuffer *st;
HsfBuffer *color;
HsfBuffer *face;
HsfBitmap *bitmap;
HsfPalette *palette;
HsfObject *root;
HsfCenv *cenv;
HsfSkeleton *skeleton;
HsfCluster *cluster;
HsfPart *part;
HsfShape *shape;
HsfMotion *motion;
HsfObject *object;
HsfMapAttr *mapAttr;
HsfMatrix *matrix;
s16 sceneCnt;
s16 attributeCnt;
s16 materialCnt;
s16 vertexCnt;
s16 normalCnt;
s16 stCnt;
s16 colorCnt;
s16 faceCnt;
s16 bitmapCnt;
s16 paletteCnt;
s16 objectCnt;
s16 cenvCnt;
s16 skeletonCnt;
s16 clusterCnt;
s16 partCnt;
s16 shapeCnt;
s16 mapAttrCnt;
s16 motionCnt;
s16 matrixCnt;
} HsfData;
#endif

12
include/game/hsfload.h Normal file
View file

@ -0,0 +1,12 @@
#ifndef _GAME_HSFLOAD_H
#define _GAME_HSFLOAD_H
#include "game/hsfformat.h"
HsfData *LoadHSF(void *data);
void ClusterAdjustObject(HsfData *model, HsfData *src_model);
char *SetName(u32 *str_ofs);
char *MakeObjectName(char *name);
int CmpObjectName(char *name1, char *name2);
#endif

18
include/string.h Normal file
View file

@ -0,0 +1,18 @@
#ifndef _STRING_H_
#define _STRING_H_
typedef unsigned long size_t;
void* memcpy(void* dst, const void* src, size_t n);
void* memset(void* dst, int val, size_t n);
char* strrchr(const char* str, int c);
char* strchr(const char* str, int c);
int strncmp(const char* str1, const char* str2, size_t n);
int strcmp(const char* str1, const char* str2);
char* strcat(char* dst, const char* src);
char* strncpy(char* dst, const char* src, size_t n);
char* strcpy(char* dst, const char* src);
size_t strlen(const char* str);
#endif

View file

@ -31,9 +31,9 @@ void fn_1_BA0(s32 arg0) {
var_r31 = 6;
break;
}
BoardMessCreate(var_r31, arg0, -1);
BoardMessWait();
BoardMessKill();
BoardWinCreate(var_r31, arg0, -1);
BoardWinWait();
BoardWinKill();
}
void fn_1_C10(s16 arg0) {

1533
src/game/hsfload.c Normal file

File diff suppressed because it is too large Load diff