Skip to content

Commit

Permalink
kit: Decompile kitoutlinefunc.c, kitoutlineprog.c, and packet.c
Browse files Browse the repository at this point in the history
  • Loading branch information
entriphy committed Jul 15, 2024
1 parent faf1723 commit 61307c8
Show file tree
Hide file tree
Showing 13 changed files with 560 additions and 121 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ set_target_properties(PS2_CRT0 PROPERTIES OUTPUT_NAME "crt0.o")
set(EXECUTABLES)

# C files
set(SUBDIRS abe harada hato hoshino kazuya nakano okanoyo taka take okanoyo/debug vtusr vtusr/taro okanoyo/linux)
set(SUBDIRS abe harada hato hoshino kazuya nakano okanoyo taka take okanoyo/debug vtusr hoshino/kit vtusr/taro okanoyo/linux)
foreach (SUBDIR IN LISTS SUBDIRS)
file(GLOB files src/${SUBDIR}/*.c)
foreach (file ${files})
Expand Down
115 changes: 115 additions & 0 deletions include/kit.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
#ifndef KIT_H
#define KIT_H

#include "types.h"
#include "ps2.h"

typedef struct { // 0x10
/* 0x0 */ u64 data;
/* 0x8 */ u64 addr;
} kitADDR_DATA;

typedef struct { // 0x10
/* 0x0 */ u64 lower;
/* 0x8 */ u64 upper;
} kitGIFTAG;

typedef struct { // 0x10
/* 0x0 */ u64 lower;
/* 0x8 */ u64 upper;
} kitPACKED;

typedef union { // 0x10
/* 0x0 */ u128 ul128;
/* 0x0 */ u64 ul[2];
/* 0x0 */ u32 ui[4];
/* 0x0 */ s32 in[4];
/* 0x0 */ f32 fl[4];
/* 0x0 */ u8 uc[8];
/* 0x0 */ char ch[8];
/* 0x0 */ kitADDR_DATA ad;
} kitDMAPACKET;

typedef struct { // 0x60
/* 0x00 */ sceVu0IVECTOR bbox[4];
/* 0x40 */ u32 fr_page;
/* 0x44 */ u32 fr_block;
/* 0x48 */ u64 xyoffset;
/* 0x50 */ u64 spritez;
/* 0x58 */ u32 partsnum;
/* 0x5c */ u8 status;
/* 0x5d */ u8 alpha;
} kitOutlineDrawEnv;

typedef struct { // 0x8
/* 0x0 */ u32 partsmax;
/* 0x4 */ u8 *status;
} kitOutlineObjEnv;

typedef struct { // 0x40
/* 0x00 */ kitADDR_DATA giftag;
/* 0x10 */ kitADDR_DATA frame;
/* 0x20 */ kitADDR_DATA zbuf;
/* 0x30 */ kitADDR_DATA xyoffset;
} kitEffectBufEnablePacket;

typedef struct { // 0x40
/* 0x00 */ kitADDR_DATA giftag1;
/* 0x10 */ kitADDR_DATA frame;
/* 0x20 */ kitADDR_DATA zbuf;
/* 0x30 */ kitADDR_DATA xyoffset;
} kitEffectBufDisablePacket;

typedef struct { // 0x80
/* 0x00 */ kitADDR_DATA giftag1;
/* 0x10 */ kitADDR_DATA test1;
/* 0x20 */ kitADDR_DATA zubf1;
/* 0x30 */ kitADDR_DATA alpha1;
/* 0x40 */ kitADDR_DATA sprite[2];
/* 0x60 */ kitADDR_DATA zbuf2;
/* 0x70 */ kitADDR_DATA test2;
} kitInitEffectBufBPacket;

typedef struct { // 0x4b0
/* 0x000 */ kitADDR_DATA giftag1;
/* 0x010 */ kitADDR_DATA test1;
/* 0x020 */ kitADDR_DATA rgba;
/* 0x030 */ kitADDR_DATA fba;
/* 0x040 */ kitADDR_DATA giftag2;
/* 0x050 */ kitADDR_DATA sprite[70];
} kitInitEffectBufAllPacket;

// Struct had to be changed, hmm...
typedef struct { // 0xa0
/* 0x00 */ kitADDR_DATA giftag1;
/* 0x10 */ kitADDR_DATA tex0;
/* 0x20 */ kitADDR_DATA texflush;
/* 0x30 */ kitADDR_DATA test1;
/* 0x48 */ kitADDR_DATA rgba;
/* 0x50 */ kitADDR_DATA giftag2;
/* 0x60 */ kitADDR_DATA tri[4];
} kitDrawSpritePacket;

typedef struct { // 0x60
/* 0x00 */ kitADDR_DATA giftag1;
/* 0x10 */ kitADDR_DATA clamp1;
/* 0x20 */ kitADDR_DATA tex01;
/* 0x30 */ kitADDR_DATA frame;
/* 0x40 */ kitADDR_DATA fba;
/* 0x50 */ kitADDR_DATA alpha1;
} kitDrawSpriteRegSetPacket;

typedef struct { // 0xa0
/* 0x00 */ kitADDR_DATA giftag1;
/* 0x10 */ kitADDR_DATA test1;
/* 0x20 */ kitADDR_DATA frame1;
/* 0x30 */ kitADDR_DATA zbuf1;
/* 0x40 */ kitADDR_DATA alpha1;
/* 0x50 */ kitADDR_DATA sprite[2];
/* 0x70 */ kitADDR_DATA frame2;
/* 0x80 */ kitADDR_DATA zbuf2;
/* 0x90 */ kitADDR_DATA test2;
} kitInitAlphaPlanePacket;


#endif
1 change: 1 addition & 0 deletions include/ps2.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <eeregs.h>
#include <libgraph.h>
#include <libvu0.h>
#include <libipu.h>
#else
#include "ps2_stubs.h"
#endif
Expand Down
108 changes: 1 addition & 107 deletions include/sfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,113 +3,7 @@

#include "types.h"
#include "ps2.h"

typedef struct { // 0x10
/* 0x0 */ u64 data;
/* 0x8 */ u64 addr;
} kitADDR_DATA;

typedef struct { // 0x10
/* 0x0 */ u64 lower;
/* 0x8 */ u64 upper;
} kitGIFTAG;

typedef struct { // 0x10
/* 0x0 */ u64 lower;
/* 0x8 */ u64 upper;
} kitPACKED;

typedef union { // 0x10
/* 0x0 */ u128 ul128;
/* 0x0 */ u_long ul[2];
/* 0x0 */ u_int ui[4];
/* 0x0 */ int in[4];
/* 0x0 */ float fl[4];
/* 0x0 */ u_char uc[8];
/* 0x0 */ char ch[8];
/* 0x0 */ kitADDR_DATA ad;
} kitDMAPACKET;

typedef struct { // 0x60
/* 0x00 */ sceVu0IVECTOR bbox[4];
/* 0x40 */ u32 fr_page;
/* 0x44 */ u32 fr_block;
/* 0x48 */ u64 xyoffset;
/* 0x50 */ u64 spritez;
/* 0x58 */ u32 partsnum;
/* 0x5c */ u8 status;
/* 0x5d */ u8 alpha;
} kitOutlineDrawEnv;

typedef struct { // 0x8
/* 0x0 */ u32 partsmax;
/* 0x4 */ u8 *status;
} kitOutlineObjEnv;

typedef struct { // 0x40
/* 0x00 */ kitADDR_DATA giftag;
/* 0x10 */ kitADDR_DATA frame;
/* 0x20 */ kitADDR_DATA zbuf;
/* 0x30 */ kitADDR_DATA xyoffset;
} kitEffectBufEnablePacket;

typedef struct { // 0x40
/* 0x00 */ kitADDR_DATA giftag1;
/* 0x10 */ kitADDR_DATA frame;
/* 0x20 */ kitADDR_DATA zbuf;
/* 0x30 */ kitADDR_DATA xyoffset;
} kitEffectBufDisablePacket;

typedef struct { // 0x80
/* 0x00 */ kitADDR_DATA giftag1;
/* 0x10 */ kitADDR_DATA test1;
/* 0x20 */ kitADDR_DATA zubf1;
/* 0x30 */ kitADDR_DATA alpha1;
/* 0x40 */ kitADDR_DATA sprite[2];
/* 0x60 */ kitADDR_DATA zbuf2;
/* 0x70 */ kitADDR_DATA test2;
} kitInitEffectBufBPacket;

typedef struct { // 0x4b0
/* 0x000 */ kitADDR_DATA giftag1;
/* 0x010 */ kitADDR_DATA test1;
/* 0x020 */ kitADDR_DATA rgba;
/* 0x030 */ kitADDR_DATA fba;
/* 0x040 */ kitADDR_DATA giftag2;
/* 0x050 */ kitADDR_DATA sprite[70];
} kitInitEffectBufAllPacket;

// Struct had to be changed, hmm...
typedef struct { // 0xa0
/* 0x00 */ kitADDR_DATA giftag1;
/* 0x10 */ kitADDR_DATA tex0;
/* 0x20 */ kitADDR_DATA texflush;
/* 0x30 */ kitADDR_DATA test1;
/* 0x48 */ kitADDR_DATA rgba;
/* 0x50 */ kitADDR_DATA giftag2;
/* 0x60 */ kitADDR_DATA tri[4];
} kitDrawSpritePacket;

typedef struct { // 0x60
/* 0x00 */ kitADDR_DATA giftag1;
/* 0x10 */ kitADDR_DATA clamp1;
/* 0x20 */ kitADDR_DATA tex01;
/* 0x30 */ kitADDR_DATA frame;
/* 0x40 */ kitADDR_DATA fba;
/* 0x50 */ kitADDR_DATA alpha1;
} kitDrawSpriteRegSetPacket;

typedef struct { // 0xa0
/* 0x00 */ kitADDR_DATA giftag1;
/* 0x10 */ kitADDR_DATA test1;
/* 0x20 */ kitADDR_DATA frame1;
/* 0x30 */ kitADDR_DATA zbuf1;
/* 0x40 */ kitADDR_DATA alpha1;
/* 0x50 */ kitADDR_DATA sprite[2];
/* 0x70 */ kitADDR_DATA frame2;
/* 0x80 */ kitADDR_DATA zbuf2;
/* 0x90 */ kitADDR_DATA test2;
} kitInitAlphaPlanePacket;
#include "kit.h"

typedef struct tagCOORD { // 0xb0
/* 0x00 */ sceVu0FVECTOR Rot;
Expand Down
28 changes: 28 additions & 0 deletions include/vtusr.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#ifndef VTUSR_H
#define VTUSR_H

#include "common.h"

typedef struct { // 0x50
/* 0x00 */ void *movie_data_buf[8];
/* 0x20 */ void *wave_data_buf;
/* 0x24 */ void *spray_data_buf;
/* 0x28 */ sceGsTex0 tex0[4];
} vtDataPtr;

typedef struct { // 0x30
/* 0x00 */ s8 field_0x00;
/* 0x04 */ s32 field_0x04;
/* 0x08 */ s32 field_0x08;
/* 0x0c */ s32 field_0x0c;
/* 0x10 */ s32 field_0x10;
/* 0x14 */ s32 field_0x14;
/* 0x18 */ f32 field_0x18;
/* 0x1c */ f32 field_0x1c;
/* 0x20 */ f32 field_0x20;
/* 0x24 */ f32 field_0x24;
/* 0x28 */ f32 field_0x28;
/* 0x2c */ f32 field_0x2c;
} vtUnkStruct;

#endif
Loading

0 comments on commit 61307c8

Please sign in to comment.