Skip to content

Commit 77cc3b4

Browse files
committed
ee_core: fix patch system, leave only device independent patches
1 parent e68bdd7 commit 77cc3b4

File tree

6 files changed

+96
-270
lines changed

6 files changed

+96
-270
lines changed

ee/ee_core/include/interface.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,15 @@ typedef struct
3636
#define EECORE_FLAG_GSM_C_2 (1<<15) // GSM: Enable FIELD flip type 2
3737
#define EECORE_FLAG_GSM_C_3 (1<<16) // GSM: Enable FIELD flip type 3
3838

39-
// Backing stores, only used by patches!
40-
#define BDM_ILK_MODE (1<< 0)
41-
#define BDM_M4S_MODE (1<< 1)
42-
#define BDM_USB_MODE (1<< 2)
43-
#define BDM_UDP_MODE (1<< 3)
44-
#define BDM_ATA_MODE (1<< 4)
45-
#define BDM_NOP_MODE (1<<31)
46-
4739
// Interface to loader
4840
#define EEC_MOD_CHECKSUM_COUNT 32
4941
struct ee_core_data
5042
{
5143
// Magic number to find
5244
uint32_t magic;
5345

54-
uint32_t ee_core_flags;
46+
uint32_t flags;
5547
char GameID[16];
56-
int GameMode;
57-
58-
void *initUserMemory;
5948

6049
int *CheatList;
6150

ee/ee_core/src/gsm_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ void EnableGSM(void)
496496
{
497497
vu32 *v_debug = (vu32 *)0x80000100;
498498

499-
state.flags = eec.ee_core_flags;
499+
state.flags = eec.flags;
500500

501501
// Hook SetGsCrt
502502
state.org_SetGsCrt = GetSyscallHandler(__NR_SetGsCrt);
@@ -523,7 +523,7 @@ void EnableGSM(void)
523523
// 0x1fffff5f = mask
524524
// 0x1fffef5f = mask + CSR
525525
_ee_mtdab(0x12000000);
526-
if (eec.ee_core_flags & (EECORE_FLAG_GSM_C_1 | EECORE_FLAG_GSM_C_2 | EECORE_FLAG_GSM_C_3)) {
526+
if (eec.flags & (EECORE_FLAG_GSM_C_1 | EECORE_FLAG_GSM_C_2 | EECORE_FLAG_GSM_C_3)) {
527527
// For FIELD flipping we need to also set a breakpoint for CSR register
528528
_ee_mtdabm(0x1fffef5f);
529529
} else {

ee/ee_core/src/iopmgr.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void services_exit()
5050

5151
//---------------------------------------------------------------------------
5252
// Simple module storage checksum
53-
void module_checksum()
53+
static void module_checksum()
5454
{
5555
int i, j;
5656
u32 *pms = (u32 *)eec.ModStorageStart;
@@ -284,7 +284,7 @@ u32 New_SifSetDma(SifDmaTransfer_t *sdd, s32 len)
284284
module_checksum();
285285

286286
// Start services, some games hang here becouse the IOP is not responding
287-
if (eec.ee_core_flags & EECORE_FLAG_DBC)
287+
if (eec.flags & EECORE_FLAG_DBC)
288288
*GS_REG_BGCOLOR = COLOR_LBLUE;
289289

290290
// Reboot the IOP
@@ -295,12 +295,12 @@ u32 New_SifSetDma(SifDmaTransfer_t *sdd, s32 len)
295295
sbv_patch_enable_lmb();
296296

297297
// Reboot the IOP with neutrino modules
298-
if (eec.ee_core_flags & EECORE_FLAG_DBC)
298+
if (eec.flags & EECORE_FLAG_DBC)
299299
*GS_REG_BGCOLOR = COLOR_MAGENTA;
300300
New_Reset_Iop(NULL, 0);
301301

302302
// Reboot the IOP with neutrino modules and IOPRP
303-
if (eec.ee_core_flags & EECORE_FLAG_DBC)
303+
if (eec.flags & EECORE_FLAG_DBC)
304304
*GS_REG_BGCOLOR = COLOR_YELLOW;
305305
New_Reset_Iop(reset_pkt->arg, reset_pkt->arglen);
306306

@@ -311,7 +311,7 @@ u32 New_SifSetDma(SifDmaTransfer_t *sdd, s32 len)
311311
set_reg_hook = 4;
312312
get_reg_hook = 1;
313313

314-
if (eec.ee_core_flags & EECORE_FLAG_DBC)
314+
if (eec.flags & EECORE_FLAG_DBC)
315315
*GS_REG_BGCOLOR = COLOR_BLACK;
316316

317317
return 1;
@@ -333,7 +333,7 @@ static int Hook_SifSetReg(u32 register_num, int register_value)
333333
return 0;
334334
} else if (set_reg_hook == 1 && register_num == SIF_SYSREG_SUBADDR && register_value == (int)NULL) {
335335
set_reg_hook--;
336-
if (eec.ee_core_flags & EECORE_FLAG_UNHOOK) {
336+
if (eec.flags & EECORE_FLAG_UNHOOK) {
337337
//
338338
// Call kernel functions directly, becouse we are already in kernel mode
339339
//

ee/ee_core/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ int main(int argc, char **argv)
5454

5555
// DINIT(); // In PCSX2 I see double messages after this call, why?
5656
DPRINTF("EE core start!\n");
57-
g_ee_core_flags = eec.ee_core_flags;
57+
g_ee_core_flags = eec.flags;
5858

5959
// Enable cheat engine
6060
if (eec.CheatList != NULL)
6161
EnableCheats();
6262

6363
// Enable GSM, only possible when kernel hooks are allowed
64-
if (((eec.ee_core_flags & (EECORE_FLAG_GSM_FLD_FP | EECORE_FLAG_GSM_FRM_FP1 | EECORE_FLAG_GSM_FRM_FP2)) != 0) && ((eec.ee_core_flags & EECORE_FLAG_UNHOOK) == 0))
64+
if (((eec.flags & (EECORE_FLAG_GSM_FLD_FP | EECORE_FLAG_GSM_FRM_FP1 | EECORE_FLAG_GSM_FRM_FP2)) != 0) && ((eec.flags & EECORE_FLAG_UNHOOK) == 0))
6565
EnableGSM();
6666

6767
/* installing kernel hooks */

0 commit comments

Comments
 (0)