Skip to content

Commit

Permalink
- Improve Wii detection somewhat.
Browse files Browse the repository at this point in the history
  • Loading branch information
Extrems committed Dec 22, 2023
1 parent acea68a commit 41e0420
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions cube/swiss/include/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,15 @@ enum setupStream
#define DVD_STACK_SIZE 1024

//Console Version Type Helpers
#define GC_CPU_VERSION01 0x00083214
#define GC_CPU_VERSION02 0x00083410
#ifndef mfpvr
#define mfpvr() ({unsigned int rval; asm volatile("mfpvr %0" : "=r" (rval)); rval;})
#endif

#define is_gamecube() (((mfpvr() == GC_CPU_VERSION01)||((mfpvr() == GC_CPU_VERSION02))))
static inline bool is_gamecube(void)
{
u32 pvr = mfpvr();
return ((pvr >> 16) & 0xFFFF) == 0x0008 && ((pvr >> 12) & 0xF) != 0x7;
}

#define MAX_MULTIGAME 128
#define MULTIGAME_TABLE_OFFSET 64
Expand Down
4 changes: 2 additions & 2 deletions cube/swiss/source/gui/info.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ uiDrawObj_t * info_draw_page(int page_num) {
DrawAddChild(container, DrawLabel(30, 55, "System Info (1/3):"));
// Model
DrawAddChild(container, DrawStyledLabel(640/2, 90, (char*)"MODEL", 0.65f, true, defaultColor));
if(is_gamecube()) {
if(!strncmp(IPLInfo, "(C) ", 4)) {
if(driveInfo.dev_code == 0x0201) {
strcpy(topStr, "NPDP-GDEV (GCT-0100)");
}
Expand Down Expand Up @@ -77,7 +77,7 @@ uiDrawObj_t * info_draw_page(int page_num) {
DrawAddChild(container, DrawStyledLabel(640/2, 106, topStr, 0.75f, true, defaultColor));
// IPL version string
DrawAddChild(container, DrawStyledLabel(640/2, 130, (char*)"IPL VERSION", 0.65f, true, defaultColor));
if(is_gamecube()) {
if(!strncmp(IPLInfo, "(C) ", 4)) {
if(!IPLInfo[0x55]) {
strcpy(topStr, "NTSC Revision 1.0");
}
Expand Down

0 comments on commit 41e0420

Please sign in to comment.