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 Jul 6, 2020
1 parent d466c30 commit ee1a828
Show file tree
Hide file tree
Showing 85 changed files with 1,350 additions and 1,523 deletions.
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);

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

3 changes: 1 addition & 2 deletions ee_core/src/cd_igr_rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ int oplIGRShutdown(int poff)
if (r < 0)
return -E_SIF_RPC_BIND;

*(s32*)UNCACHED_SEG(&poffData) = poff;
*(s32 *)UNCACHED_SEG(&poffData) = poff;
if (SifCallRpc(&_igr_cd, 1, SIF_RPC_M_NOWBDC, &poffData, sizeof(poffData), NULL, 0, NULL, NULL) < 0)
return -E_SIF_RPC_CALL;

return 0;
}

13 changes: 6 additions & 7 deletions ee_core/src/gsm_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extern void (*Old_SetGsCrt)(short int interlace, short int mode, short int ffmd)
// NTSC
#define GS_MODE_NTSC 0x02
// PAL
#define GS_MODE_PAL 0x03
#define GS_MODE_PAL 0x03

struct GSMDestSetGsCrt
{
Expand Down Expand Up @@ -205,11 +205,10 @@ void DisableGSM(void)
/* Set up the DVE for 576P mode */
/*--------------------------------------------*/
void setdve_576P(void)
{ //The parameters are exactly the same as the 480P mode's. Regardless of the model, GS revision or region.
dve_prepare_bus();
{ //The parameters are exactly the same as the 480P mode's. Regardless of the model, GS revision or region.
dve_prepare_bus();

dve_set_reg(0x77, 0x11);
dve_set_reg(0x93, 0x01);
dve_set_reg(0x91, 0x02);
dve_set_reg(0x77, 0x11);
dve_set_reg(0x93, 0x01);
dve_set_reg(0x91, 0x02);
}

5 changes: 4 additions & 1 deletion ee_core/src/igs_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ static void Screenshot(u16 sbp, u8 sbw, u8 spsm, u16 width, u16 height, u32 dime
GS_BGCOLOUR = 0xCCFFFF; //Light Yellow

static u32 EnableGIFPATH3[4] ALIGNED(16) = {
GS_VIF1_MSKPATH3(0), GS_VIF1_NOP, GS_VIF1_NOP, GS_VIF1_NOP,
GS_VIF1_MSKPATH3(0),
GS_VIF1_NOP,
GS_VIF1_NOP,
GS_VIF1_NOP,
};

u32 DMAChain[20 * 2] ALIGNED(16);
Expand Down
4 changes: 1 addition & 3 deletions ee_core/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ int main(int argc, char **argv)
{
int argOffset;

if(isInit)
{ //Ignore argv[0], as it contains the name of this module ("EELOAD"), as passed by the LoadExecPS2 syscall itself (2nd invocation and later will be from LoadExecPS2).
if (isInit) { //Ignore argv[0], as it contains the name of this module ("EELOAD"), as passed by the LoadExecPS2 syscall itself (2nd invocation and later will be from LoadExecPS2).
argv++;
argc--;

Expand All @@ -155,4 +154,3 @@ int main(int argc, char **argv)

return 0;
}

4 changes: 2 additions & 2 deletions ee_core/src/modmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ int LoadElf(const char *path, t_ExecData *data)

if (arg.epc != 0) {
data->epc = arg.epc;
data->gp = arg.gp;
data->gp = arg.gp;

return 0;
} else
return -SCE_ELOADMISS;
return -SCE_ELOADMISS;
}

/*----------------------------------------------------------------------------------------*/
Expand Down
20 changes: 9 additions & 11 deletions ee_core/src/padhook.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static void IGR_Thread(void *arg)
#ifdef IGS
|| ((Pad_Data.combo_type == IGR_COMBO_UP) && (EnableGSMOp))
#endif
) {
) {

if (!DisableDebug)
GS_BGCOLOUR = 0xFF8000; // Blue sky
Expand Down Expand Up @@ -286,7 +286,7 @@ static int IGR_Intc_Handler(int cause)
#ifdef IGS
|| ((pad_pos_combo2 == IGR_COMBO_UP) && (EnableGSMOp)) // UP combo, so take IGS
#endif
)
)

Pad_Data.combo_type = pad_pos_combo2;
}
Expand Down Expand Up @@ -349,7 +349,8 @@ static int IGR_Intc_Handler(int cause)

*R_EE_GS_CSR = 0x100; //Reset GS
asm volatile("sync.l\n");
while(*R_EE_GS_CSR & 0x100){};
while (*R_EE_GS_CSR & 0x100) {
};

//Disable interrupts & reset some peripherals, back to a standard state.
//Call ResetEE(0x7F) from an interrupt handler.
Expand Down Expand Up @@ -420,8 +421,7 @@ void Install_IGR(void)
Pad_Data.prev_frame = 0x00;

// Do not install the IGR thread or interrupt handler more than once.
if (IGR_Thread_ID < 0)
{
if (IGR_Thread_ID < 0) {
// Create and start IGR thread
thread_param.gp_reg = &_gp;
thread_param.func = IGR_Thread;
Expand All @@ -433,8 +433,7 @@ void Install_IGR(void)
StartThread(IGR_Thread_ID, NULL);
}

if (IGR_Intc_ID < 0)
{
if (IGR_Intc_ID < 0) {
// Create IGR interrupt handler
IGR_Intc_ID = AddIntcHandler(kINTC_VBLANK_END, IGR_Intc_Handler, 0);
EnableIntc(kINTC_VBLANK_END);
Expand Down Expand Up @@ -484,8 +483,7 @@ static int Hook_scePad2CreateSocket(pad2socketparam_t *SocketParam, void *addr)
ret = scePad2CreateSocket(SocketParam, addr);

// Install IGR with libpad2 parameters
if ((SocketParam == NULL) || (SocketParam->port == 0 && SocketParam->slot == 0))
{
if ((SocketParam == NULL) || (SocketParam->port == 0 && SocketParam->slot == 0)) {
Install_IGR();
Set_libpad_Params(addr);
}
Expand Down Expand Up @@ -554,7 +552,7 @@ int Install_PadOpen_Hook(u32 mem_start, u32 mem_end, int mode)
// Search & patch for calls to PadOpen
ptr2 = (u32 *)mem_start;
while (ptr2) {
mem_size2 = (u32)((u8*)mem_end - (u8*)ptr2);
mem_size2 = (u32)((u8 *)mem_end - (u8 *)ptr2);

ptr2 = find_pattern_with_mask(ptr2, mem_size2, pattern, mask, sizeof(pattern));
if (ptr2) {
Expand Down Expand Up @@ -598,7 +596,7 @@ int Install_PadOpen_Hook(u32 mem_start, u32 mem_end, int mode)
// Search & patch for PadOpen function address
ptr2 = (u32 *)mem_start;
while (ptr2) {
mem_size2 = (u32)((u8*)mem_end - (u8*)ptr2);
mem_size2 = (u32)((u8 *)mem_end - (u8 *)ptr2);

ptr2 = find_pattern_with_mask(ptr2, mem_size2, pattern, mask, sizeof(pattern));
if (ptr2) {
Expand Down
Loading

0 comments on commit ee1a828

Please sign in to comment.