Skip to content

Commit

Permalink
Merge pull request #28 from israpps/gsbgrreg-macro
Browse files Browse the repository at this point in the history
replace background color change constants with macros
  • Loading branch information
rickgaiser authored Jul 8, 2024
2 parents 8f9476f + d702c12 commit 6c8bdf0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions ee/ee_core/include/ee_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ extern int GameMode;
extern int EnableDebug;
#define GS_BGCOLOUR *((volatile unsigned long int *)0x120000E0)

#define BGR_PURPLE 0xFF00FF
#define BGR_YELLOW 0x00FFFF
#define BGR_BLACK 0x000000
#define BGR_BLUE 0xFF0000
#define BGR_GREEN 0x00FF00
#define BGR_WHITE 0xFFFFFF

extern int *gCheatList; // Store hooks/codes addr+val pairs

#endif
6 changes: 3 additions & 3 deletions ee/ee_core/src/iopmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int New_Reset_Iop(const char *arg, int arglen)
#endif

if (EnableDebug)
GS_BGCOLOUR = 0xFF00FF; // Purple
GS_BGCOLOUR = BGR_PURPLE;

iop_reboot_count++;

Expand Down Expand Up @@ -168,7 +168,7 @@ int New_Reset_Iop(const char *arg, int arglen)
}

if (EnableDebug)
GS_BGCOLOUR = 0x00FFFF; // Yellow
GS_BGCOLOUR = BGR_YELLOW;

DPRINTF("Exiting services...\n");
SifExitIopHeap();
Expand All @@ -183,7 +183,7 @@ int New_Reset_Iop(const char *arg, int arglen)
}

if (EnableDebug)
GS_BGCOLOUR = 0x000000; // Black
GS_BGCOLOUR = BGR_BLACK;

return 1;
}
2 changes: 1 addition & 1 deletion ee/ee_core/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static int eecoreInit(int argc, char **argv)
Install_Kernel_Hooks();

if (EnableDebug)
GS_BGCOLOUR = 0xff0000; // Blue
GS_BGCOLOUR = BGR_BLUE;

SifExitRpc();

Expand Down
4 changes: 2 additions & 2 deletions ee/ee_core/src/syshook.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void sysLoadElf(char *filename, int argc, char **argv)
DPRINTF("t_loadElf: elf path = '%s'\n", filename);

if (EnableDebug)
GS_BGCOLOUR = 0x00ff00; // Green
GS_BGCOLOUR = BGR_GREEN;

DPRINTF("t_loadElf: cleaning user memory...");

Expand Down Expand Up @@ -114,7 +114,7 @@ void sysLoadElf(char *filename, int argc, char **argv)
DPRINTF(" failed, error code = -%x\n", -r);

// Error
GS_BGCOLOUR = 0xffffff; // White - shouldn't happen.
GS_BGCOLOUR = BGR_WHITE;
SleepThread();
}

Expand Down

0 comments on commit 6c8bdf0

Please sign in to comment.