Skip to content

Commit

Permalink
Format files using clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
uyjulian committed Jan 25, 2020
1 parent ba0e320 commit 80e8f5e
Show file tree
Hide file tree
Showing 209 changed files with 44,465 additions and 40,765 deletions.
8 changes: 4 additions & 4 deletions ee_core/include/asm.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
#include <kernel.h>
#include <sifdma.h>

u32 Hook_SifSetDma(SifDmaTransfer_t *sdd, s32 len);
int Hook_SifSetReg(u32 register_num, int register_value);
int Hook_ExecPS2(void *entry, void *gp, int num_args, char *args[]);
int Hook_CreateThread(ee_thread_t *thread_param);
u32 Hook_SifSetDma(SifDmaTransfer_t *sdd, s32 len);
int Hook_SifSetReg(u32 register_num, int register_value);
int Hook_ExecPS2(void *entry, void *gp, int num_args, char *args[]);
int Hook_CreateThread(ee_thread_t *thread_param);
void Hook_Exit(s32 exit_code);
void CleanExecPS2(void *epc, void *gp, int argc, char **argv);
void iResetEE(u32 init_bitfield);
Expand Down
1 change: 0 additions & 1 deletion ee_core/include/cd_igr_rpc.h
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
int oplIGRShutdown(int poff);

4 changes: 2 additions & 2 deletions ee_core/include/cheat_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ void DisableCheats(void);
*/
typedef struct
{
u32 addr;
u32 val;
u32 addr;
u32 val;
} code_t;

#endif /* _CHEATAPI_H_ */
4 changes: 2 additions & 2 deletions ee_core/include/cheat_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#ifndef _CHEATENGINE_H_
#define _CHEATENGINE_H_

#define MAX_HOOKS 5
#define MAX_CODES 250
#define MAX_HOOKS 5
#define MAX_CODES 250
#define MAX_CHEATLIST (MAX_HOOKS * 2 + MAX_CODES * 2)

extern void (*Old_SetupThread)(void *gp, void *stack, s32 stack_size, void *args, void *root_func);
Expand Down
4 changes: 2 additions & 2 deletions ee_core/include/dve_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#define _DVE_REG_H_

void dve_prepare_bus(void);
int dve_get_reg(u32 reg);
int dve_set_reg(u32 reg, u32 val);
int dve_get_reg(u32 reg);
int dve_set_reg(u32 reg, u32 val);

#endif
44 changes: 23 additions & 21 deletions ee_core/include/ee_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@
#ifdef __EESIO_DEBUG
#include <sio.h>
#define DPRINTF(args...) sio_printf(args)
#define DINIT() sio_init(38400, 0, 0, 0, 0)
#define DINIT() sio_init(38400, 0, 0, 0, 0)
#else
#define DPRINTF(args...) \
do { \
} while (0)
do \
{ \
} while (0)
#define DINIT() \
do { \
} while (0)
do \
{ \
} while (0)
#endif

extern int set_reg_hook;
Expand All @@ -41,23 +43,23 @@ extern int iop_reboot_count;
extern int padOpen_hooked;

enum ETH_OP_MODES {
ETH_OP_MODE_AUTO = 0,
ETH_OP_MODE_100M_FDX,
ETH_OP_MODE_100M_HDX,
ETH_OP_MODE_10M_FDX,
ETH_OP_MODE_10M_HDX,
ETH_OP_MODE_AUTO = 0,
ETH_OP_MODE_100M_FDX,
ETH_OP_MODE_100M_HDX,
ETH_OP_MODE_10M_FDX,
ETH_OP_MODE_10M_HDX,

ETH_OP_MODE_COUNT
ETH_OP_MODE_COUNT
};

#define IPCONFIG_MAX_LEN 64
char g_ipconfig[IPCONFIG_MAX_LEN];
int g_ipconfig_len;
char g_ps2_ip[16];
char g_ps2_netmask[16];
char g_ps2_gateway[16];
char g_ipconfig[IPCONFIG_MAX_LEN];
int g_ipconfig_len;
char g_ps2_ip[16];
char g_ps2_netmask[16];
char g_ps2_gateway[16];
unsigned char g_ps2_ETHOpMode;
u32 g_compat_mask;
u32 g_compat_mask;

#define COMPAT_MODE_1 0x01
#define COMPAT_MODE_2 0x02
Expand All @@ -69,15 +71,15 @@ u32 g_compat_mask;
#define COMPAT_MODE_8 0x80

char GameID[16];
int GameMode;
int GameMode;
#define USB_MODE 0
#define ETH_MODE 1
#define HDD_MODE 2

char ExitPath[32];
int HDDSpindown;
int EnableGSMOp;
int EnableCheatOp;
int HDDSpindown;
int EnableGSMOp;
int EnableCheatOp;
#ifdef PADEMU
int EnablePadEmuOp;
int PadEmuSettings;
Expand Down
1 change: 0 additions & 1 deletion ee_core/include/gsm_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ void Disable_GSBreakpoint(void);
void EnableGSM(void);
void DisableGSM(void);
void setdve_576P(void);

15 changes: 7 additions & 8 deletions ee_core/include/gsm_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@
.equ GS_BGCOLOUR, 0x00E0
.equ GS_CSR, 0x1000

# Add-on video modes (made possible by SP193 and reprep)
#Add - on video modes(made possible by SP193 and reprep)
GS_MODE_DTV_576P=0x53

# GSMSourceSetGsCrt
#GSMSourceSetGsCrt
.equ Source_INT, 0 # HALF
.equ Source_MODE, 2 # HALF
.equ Source_FFMD, 4 # HALF

# GSMDestSetGsCrt
#GSMDestSetGsCrt
.equ Target_INT, 0 # HALF
.equ Target_MODE, 2 # HALF
.equ Target_FFMD, 4 # HALF

# GSMSourceGSRegs
#GSMSourceGSRegs
.equ Source_PMODE, 0 # DWORD
.equ Source_SMODE1, 8 # DWORD
.equ Source_SMODE2, 16 # DWORD
Expand All @@ -56,7 +56,7 @@ GS_MODE_DTV_576P=0x53
.equ Source_DISPFB2, 72 # DWORD
.equ Source_DISPLAY2, 80 # DWORD

# GSMDestGSRegs
#GSMDestGSRegs
.equ Target_PMODE, 0 # DWORD
.equ Target_SMODE1, 8 # DWORD
.equ Target_SMODE2, 16 # DWORD
Expand All @@ -69,7 +69,7 @@ GS_MODE_DTV_576P=0x53
.equ Target_DISPFB2, 72 # DWORD
.equ Target_DISPLAY2, 80 # DWORD

# GSMFlags
#GSMFlags
.equ X_offset, 0 # WORD
.equ Y_offset, 4 # WORD
.equ ADAPTATION_fix, 8 # BYTE
Expand All @@ -84,9 +84,8 @@ GS_MODE_DTV_576P=0x53
.equ FIELD_fix, 17 # BYTE
.equ gs576P_param, 18 # BYTE

# GSMAdapts
#GSMAdapts
.equ Adapted_DISPLAY1, 0 # DWORD
.equ Adapted_DISPLAY2, 8 # DWORD
.equ Interlace_FRAME_Mode_Flag, 16 # BYTE -> Double Height for SMODE2's INT=1 (Interlace Mode) and FFMD=1 (FRAME Mode. Read every line)
.equ SMODE2_adaptation, 17 # BYTE -> Adapted SMODE2 patch value

152 changes: 76 additions & 76 deletions ee_core/include/igs_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,30 @@
#include <stdio.h>

#define GS_BITBLTBUF 0x50
#define GS_TRXPOS 0x51
#define GS_TRXREG 0x52
#define GS_TRXDIR 0x53
#define GS_FINISH 0x61
#define GS_TRXPOS 0x51
#define GS_TRXREG 0x52
#define GS_TRXDIR 0x53
#define GS_FINISH 0x61

//Pixel storage format
#define GS_PSM_CT32 0x00 //32 bits = 4 bytes Example: SLUS_202.73 (Namco Museum 50th Anniversary)
#define GS_PSM_CT24 0x01 //24 bits = 3 bytes Example: SLPS_250.88 (Final Fantasy X International)
#define GS_PSM_CT16 0x02 //16 bits = 2 bytes Example: SLUS_215.56 (Konami Kids Playground: Dinosaurs Shapes & Colors)
#define GS_PSM_CT32 0x00 //32 bits = 4 bytes Example: SLUS_202.73 (Namco Museum 50th Anniversary)
#define GS_PSM_CT24 0x01 //24 bits = 3 bytes Example: SLPS_250.88 (Final Fantasy X International)
#define GS_PSM_CT16 0x02 //16 bits = 2 bytes Example: SLUS_215.56 (Konami Kids Playground: Dinosaurs Shapes & Colors)
#define GS_PSM_CT16S 0x0A //16 bits = 2 bytes Example: SLUS_215.41 (Ratatouille)

//Channel #1 (VIF1)
#define GS_VIF1_STAT ((volatile u32 *)(0x10003c00)) // VIF Status Register
#define GS_VIF1_STAT_FDR (1 << 23) // VIF1-FIFO transfer direction: VIF1 -> Main memory/SPRAM"
#define GS_VIF1_STAT ((volatile u32 *)(0x10003c00)) // VIF Status Register
#define GS_VIF1_STAT_FDR (1 << 23) // VIF1-FIFO transfer direction: VIF1 -> Main memory/SPRAM"
#define GS_VIF1_MSKPATH3(mask) ((u32)(mask) | ((u32)0x06 << 24))
#define GS_VIF1_NOP 0
#define GS_VIF1_FLUSHA (((u32)0x13 << 24))
#define GS_VIF1_DIRECT(count) ((u32)(count) | ((u32)(0x50) << 24))
#define GS_VIF1_FIFO ((volatile u128 *)(0x10005000))
#define GS_VIF1_NOP 0
#define GS_VIF1_FLUSHA (((u32)0x13 << 24))
#define GS_VIF1_DIRECT(count) ((u32)(count) | ((u32)(0x50) << 24))
#define GS_VIF1_FIFO ((volatile u128 *)(0x10005000))

//DMA CH1 REGISTERS (Linked to VIF1)
#define GS_D1_CHCR ((volatile u32 *)(0x10009000))
#define GS_D1_MADR ((volatile u32 *)(0x10009010))
#define GS_D1_QWC ((volatile u32 *)(0x10009020))
#define GS_D1_QWC ((volatile u32 *)(0x10009020))
#define GS_D1_TADR ((volatile u32 *)(0x10009030))
#define GS_D1_ASR0 ((volatile u32 *)(0x10009040))
#define GS_D1_ASR1 ((volatile u32 *)(0x10009050))
Expand All @@ -66,81 +66,81 @@
#define GS_GIF_AD 0x0e

#define GS_GIFTAG(NLOOP, EOP, PRE, PRIM, FLG, NREG) \
((u64)(NLOOP) << 0) | \
((u64)(EOP) << 15) | \
((u64)(PRE) << 46) | \
((u64)(PRIM) << 47) | \
((u64)(FLG) << 58) | \
((u64)(NREG) << 60)
((u64)(NLOOP) << 0) | \
((u64)(EOP) << 15) | \
((u64)(PRE) << 46) | \
((u64)(PRIM) << 47) | \
((u64)(FLG) << 58) | \
((u64)(NREG) << 60)

//GS Registers
#define GS_GSBITBLTBUF_SET(sbp, sbw, spsm, dbp, dbw, dpsm) \
((u64)(sbp) | ((u64)(sbw) << 16) | \
((u64)(spsm) << 24) | ((u64)(dbp) << 32) | \
((u64)(dbw) << 48) | ((u64)(dpsm) << 56))
((u64)(sbp) | ((u64)(sbw) << 16) | \
((u64)(spsm) << 24) | ((u64)(dbp) << 32) | \
((u64)(dbw) << 48) | ((u64)(dpsm) << 56))

#define GS_GSTRXREG_SET(rrw, rrh) \
((u64)(rrw) | ((u64)(rrh) << 32))
((u64)(rrw) | ((u64)(rrh) << 32))

#define GS_GSTRXPOS_SET(ssax, ssay, dsax, dsay, dir) \
((u64)(ssax) | ((u64)(ssay) << 16) | \
((u64)(dsax) << 32) | ((u64)(dsay) << 48) | \
((u64)(dir) << 59))
((u64)(ssax) | ((u64)(ssay) << 16) | \
((u64)(dsax) << 32) | ((u64)(dsay) << 48) | \
((u64)(dir) << 59))

#define GS_GSTRXDIR_SET(xdr) ((u64)(xdr))

#define GS_GSBITBLTBUF 0x50
#define GS_GSFINISH 0x61
#define GS_GSTRXPOS 0x51
#define GS_GSTRXREG 0x52
#define GS_GSTRXDIR 0x53
#define GS_GSFINISH 0x61
#define GS_GSTRXPOS 0x51
#define GS_GSTRXREG 0x52
#define GS_GSTRXDIR 0x53

//GS Priviledge Registers
#define GS_CSR_FINISH (1 << 1)
#define GS_CSR (volatile u64 *)0x12001000 // GS CSR (GS System Status) Register
#define GS_IMR (volatile u64 *)0x12001010 // GS IMR (GS Interrupt Mask) Register
#define GS_BUSDIR (volatile u64 *)0x12001040 // GS BUSDIR (GS Bus Direction) Register

#define GET_PMODE_EN1(x) (u8)((x >> 0) & 0x1)
#define GET_PMODE_EN2(x) (u8)((x >> 1) & 0x1)
#define GET_SMODE2_INT(x) (u8)((x >> 0) & 0x1)
#define GET_SMODE2_FFMD(x) (u8)((x >> 1) & 0x1)
#define GET_SMODE2_DPMS(x) (u8)((x >> 2) & 0x3)
#define GS_CSR (volatile u64 *)0x12001000 // GS CSR (GS System Status) Register
#define GS_IMR (volatile u64 *)0x12001010 // GS IMR (GS Interrupt Mask) Register
#define GS_BUSDIR (volatile u64 *)0x12001040 // GS BUSDIR (GS Bus Direction) Register

#define GET_PMODE_EN1(x) (u8)((x >> 0) & 0x1)
#define GET_PMODE_EN2(x) (u8)((x >> 1) & 0x1)
#define GET_SMODE2_INT(x) (u8)((x >> 0) & 0x1)
#define GET_SMODE2_FFMD(x) (u8)((x >> 1) & 0x1)
#define GET_SMODE2_DPMS(x) (u8)((x >> 2) & 0x3)
#define GET_SMODE2_INTFFMD(x) (u8)((x >> 0) & 0x3)
#define GET_DISPFB_FBP(x) (u16)((x >> 0) & 0x1FF)
#define GET_DISPFB_FBW(x) (u8)((x >> 9) & 0x3F)
#define GET_DISPFB_PSM(x) (u8)((x >> 15) & 0x1F)
#define GET_DISPFB_DBX(x) (u16)((x >> 32) & 0x7FF)
#define GET_DISPFB_DBY(x) (u16)((x >> 43) & 0x7FF)
#define GET_DISPLAY_DH(x) (u16)((x >> 44) & 0x7FF)
#define GET_DISPFB_FBP(x) (u16)((x >> 0) & 0x1FF)
#define GET_DISPFB_FBW(x) (u8)((x >> 9) & 0x3F)
#define GET_DISPFB_PSM(x) (u8)((x >> 15) & 0x1F)
#define GET_DISPFB_DBX(x) (u16)((x >> 32) & 0x7FF)
#define GET_DISPFB_DBY(x) (u16)((x >> 43) & 0x7FF)
#define GET_DISPLAY_DH(x) (u16)((x >> 44) & 0x7FF)

#define GS_WRITEBACK_DCACHE 0

//GSM Stuff
struct GSMSourceSetGsCrt
{
unsigned int interlace;
unsigned int mode;
unsigned int ffmd;
unsigned int interlace;
unsigned int mode;
unsigned int ffmd;
};

struct GSMSourceGSRegs
{
u64 pmode;
u64 smode1;
u64 smode2;
u64 srfsh;
u64 synch1;
u64 synch2;
u64 syncv;
u64 dispfb1;
u64 display1;
u64 dispfb2;
u64 display2;
u64 pmode;
u64 smode1;
u64 smode2;
u64 srfsh;
u64 synch1;
u64 synch2;
u64 syncv;
u64 dispfb1;
u64 display1;
u64 dispfb2;
u64 display2;
};

extern struct GSMSourceSetGsCrt GSMSourceSetGsCrt;
extern struct GSMSourceGSRegs GSMSourceGSRegs;
extern struct GSMSourceGSRegs GSMSourceGSRegs;

// BMP File Structure and example
// https://www.siggraph.org/education/materials/HyperVis/asp_data/compimag/bmpfile.htm
Expand All @@ -150,21 +150,21 @@ extern struct GSMSourceGSRegs GSMSourceGSRegs;

typedef struct
{
/* 42 4D = "BM" */
u32 filesize; /* B6 01 00 00 = 438 bytes = 384 bytes (image) + 54 bytes (header) */
u32 reserved; /* 00 00 00 00 */
u32 headersize; /* 36 00 00 00 = 54 bytes */
u32 infoSize; /* 28 00 00 00 = 40 bytes = 54 bytes (header size) - 14 bytes */
u32 width; /* 10 00 00 00 = 16 pixels */
u32 depth; /* 08 00 00 00 = 8 pixels */
u16 biPlanes; /* 01 00 = 1 (for 24 bit images) */
u16 bits; /* 18 00 = 24 (for 24 bit images) */
u32 biCompression; /* 00 00 00 00 = 0 (no compression) */
u32 biSizeImage; /* 80 01 00 00 = Image Size = width x (bits/8) x height = 16 x 8 x 3 = 384 bytes */
u32 biXPelsPerMeter; /* 00 00 00 00 */
u32 biYPelsPerMeter; /* 00 00 00 00 */
u32 biClrUsed; /* 00 00 00 00 */
u32 biClrImportant; /* 00 00 00 00 */
/* 42 4D = "BM" */
u32 filesize; /* B6 01 00 00 = 438 bytes = 384 bytes (image) + 54 bytes (header) */
u32 reserved; /* 00 00 00 00 */
u32 headersize; /* 36 00 00 00 = 54 bytes */
u32 infoSize; /* 28 00 00 00 = 40 bytes = 54 bytes (header size) - 14 bytes */
u32 width; /* 10 00 00 00 = 16 pixels */
u32 depth; /* 08 00 00 00 = 8 pixels */
u16 biPlanes; /* 01 00 = 1 (for 24 bit images) */
u16 bits; /* 18 00 = 24 (for 24 bit images) */
u32 biCompression; /* 00 00 00 00 = 0 (no compression) */
u32 biSizeImage; /* 80 01 00 00 = Image Size = width x (bits/8) x height = 16 x 8 x 3 = 384 bytes */
u32 biXPelsPerMeter; /* 00 00 00 00 */
u32 biYPelsPerMeter; /* 00 00 00 00 */
u32 biClrUsed; /* 00 00 00 00 */
u32 biClrImportant; /* 00 00 00 00 */
} BmpHeader;
/* Image example */
/* 24 1C ED 24 1C ED 24 1C ED 24 1C ED 24 1C ED 24 1C ED 24 1C ED 24 1C ED 24 1C ED 24 1C ED 24 1C ED 24 1C ED 24 1C ED 24 1C ED 24 1C ED 24 1C ED */
Expand Down
Loading

0 comments on commit 80e8f5e

Please sign in to comment.