Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions source/fileop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ static bool MountFAT(int device, int silent)

while(retry)
{
if(disc->startup(disc) && fatMountSimple(name, disc))
if(fatMountSimple(name, disc))
mounted = true;

if(mounted || silent)
Expand Down Expand Up @@ -324,12 +324,8 @@ bool MountDVD(bool silent)

#ifdef HW_DOL
DVD_Mount();
s32 dvdstatus = DVD_GetDriveStatus();

if (dvdstatus == DVD_STATE_NO_DISK)
#else
if(!dvd->isInserted(dvd))
#endif
if(!dvd->isInserted(dvd))
{
if(silent)
break;
Expand Down
9 changes: 1 addition & 8 deletions source/mem2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,15 @@

#ifdef HW_RVL

#include <ogc/machine/asm.h>
#include <ogc/lwp_heap.h>
#include <ogc/system.h>
#include <ogc/machine/processor.h>

static heap_cntrl mem2_heap;

u32 InitMem2Manager ()
{
int size = (42*1024*1024);
u32 level;
_CPU_ISR_Disable(level);
size &= ~0x1f; // round down, because otherwise we may exceed the area
void *mem2_heap_ptr = (void *)((u32)SYS_GetArena2Hi()-size);
SYS_SetArena2Hi(mem2_heap_ptr);
_CPU_ISR_Restore(level);
void *mem2_heap_ptr = SYS_AllocArenaMem2Hi(size, 32);
size = __lwp_heap_init(&mem2_heap, mem2_heap_ptr, size, 32);
return size;
}
Expand Down
7 changes: 3 additions & 4 deletions source/networkop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ static int netHalt = 0;
***************************************************************************/

static lwp_t networkthread = LWP_THREAD_NULL;
static u8 netstack[32768] ATTRIBUTE_ALIGN (32);

static void * netcb (void *arg)
{
Expand Down Expand Up @@ -95,7 +94,7 @@ static void * netcb (void *arg)
hostip.s_addr = net_gethostip();
if (hostip.s_addr)
{
strcpy(wiiIP, inet_ntoa(hostip));
inet_ntoa_r(hostip, wiiIP, sizeof(wiiIP));
networkInit = true;
prevInit = true;
}
Expand All @@ -115,7 +114,7 @@ void StartNetworkThread()
netHalt = 0;

if(networkthread == LWP_THREAD_NULL)
LWP_CreateThread(&networkthread, netcb, NULL, netstack, 8192, 40);
LWP_CreateThread(&networkthread, netcb, NULL, NULL, 0, 40);
else
LWP_ResumeThread(networkthread);
}
Expand All @@ -131,7 +130,7 @@ void StopNetworkThread()
return;

netHalt = 2;
LWP_ResumeThread(networkthread);
LWP_ContinueThread(networkthread);

// wait for thread to finish
LWP_JoinThread(networkthread, NULL);
Expand Down
2 changes: 1 addition & 1 deletion source/preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ DefaultSettings ()
if(GCSettings.language == LANG_TRAD_CHINESE)
GCSettings.language = LANG_SIMP_CHINESE;
#else
GCSettings.language = LANG_ENGLISH;
GCSettings.language = SYS_GetLanguage() + LANG_ENGLISH;
#endif
GCSettings.OffsetMinutesUTC = 0;
GCSettings.GBHardware = 0;
Expand Down
2 changes: 1 addition & 1 deletion source/utils/oggplayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ static private_data_ogg private_ogg;

#define STACKSIZE 8192

static u8 oggplayer_stack[STACKSIZE];
static u8 oggplayer_stack[STACKSIZE] ATTRIBUTE_ALIGN(8);
static lwpq_t oggplayer_queue = LWP_TQUEUE_NULL;
static lwp_t h_oggplayer = LWP_THREAD_NULL;
static int ogg_thread_running = 0;
Expand Down
13 changes: 4 additions & 9 deletions source/vbagx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void ExitApp()
ExitCleanup();

if(ShutdownRequested) {
SYS_ResetSystem(SYS_POWEROFF_STANDBY, 0, 0);
SYS_ResetSystem(SYS_POWEROFF_STANDBY, 0, FALSE);
}
else if(GCSettings.AutoloadGame) {
if( !!*(u32*)0x80001800 )
Expand All @@ -103,7 +103,7 @@ void ExitApp()
else
{
// Wii channel support
SYS_ResetSystem( SYS_RETURNTOMENU, 0, 0 );
SYS_ResetSystem(SYS_RETURNTOMENU, 0, FALSE);
}
}
else {
Expand All @@ -128,16 +128,11 @@ void ExitApp()

if(GCSettings.ExitAction == 1) // Exit to Menu
{
#ifdef HW_RVL
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
#else
#define SOFTRESET_ADR ((volatile u32*)0xCC003024)
*SOFTRESET_ADR = 0x00000000;
#endif
SYS_ResetSystem(SYS_RETURNTOMENU, 0, FALSE);
}
else if(GCSettings.ExitAction == 2) // Shutdown Wii
{
SYS_ResetSystem(SYS_POWEROFF_STANDBY, 0, 0);
SYS_ResetSystem(SYS_POWEROFF_STANDBY, 0, FALSE);
}
else // Exit to Loader
{
Expand Down
39 changes: 11 additions & 28 deletions source/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ static camera cam = { {0.0F, 0.0F, 0.0F},
/****************************************************************************
* VideoThreading
***************************************************************************/
#define TSTACK 16384
static lwp_t vbthread;
static unsigned char vbstack[TSTACK];

/****************************************************************************
* vbgetback
Expand Down Expand Up @@ -168,7 +166,7 @@ static inline void draw_init(void)
GX_InitTexObj(&texobj, texturemem, vwidth, vheight, GX_TF_RGB565,
GX_CLAMP, GX_CLAMP, GX_FALSE);
if (GCSettings.render == 2)
GX_InitTexObjLOD(&texobj,GX_NEAR,GX_NEAR_MIP_NEAR,2.5,9.0,0.0,GX_FALSE,GX_FALSE,GX_ANISO_1); // original/unfiltered video mode: force texture filtering OFF
GX_InitTexObjFilterMode(&texobj,GX_NEAR,GX_NEAR); // original/unfiltered video mode: force texture filtering OFF
}

static inline void draw_vert(u8 pos, u8 c, f32 s, f32 t)
Expand Down Expand Up @@ -254,7 +252,7 @@ static inline void draw_cursor(Mtx v)
GX_InitTexObj(&texobj, texturemem, vwidth, vheight, GX_TF_RGB565,
GX_CLAMP, GX_CLAMP, GX_FALSE);
if (GCSettings.render == 2)
GX_InitTexObjLOD(&texobj,GX_NEAR,GX_NEAR_MIP_NEAR,2.5,9.0,0.0,GX_FALSE,GX_FALSE,GX_ANISO_1); // original/unfiltered video mode: force texture filtering OFF
GX_InitTexObjFilterMode(&texobj,GX_NEAR,GX_NEAR); // original/unfiltered video mode: force texture filtering OFF
}
#endif

Expand All @@ -268,7 +266,7 @@ void StopGX()
GX_AbortFrame();
GX_Flush();

VIDEO_SetBlack(TRUE);
VIDEO_SetBlack(true);
VIDEO_Flush();
}

Expand Down Expand Up @@ -305,20 +303,11 @@ static GXRModeObj * FindVideoMode()
break;
default:
mode = VIDEO_GetPreferredMode(NULL);

#ifdef HW_DOL
/* we have component cables, but the preferred mode is interlaced
* why don't we switch into progressive?
* on the Wii, the user can do this themselves on their Wii Settings */
if(VIDEO_HaveComponentCable())
mode = &TVNtsc480Prog;
#endif

break;
}

// check for progressive scan
if (mode->viTVMode == VI_TVMODE_NTSC_PROG)
if ((mode->viTVMode & 3) == VI_PROGRESSIVE)
progressive = true;
else
progressive = false;
Expand Down Expand Up @@ -363,15 +352,9 @@ static void SetupVideoMode(GXRModeObj * mode)
VIDEO_ClearFrameBuffer (mode, xfb[1], COLOR_BLACK);
VIDEO_SetNextFramebuffer (xfb[0]);

VIDEO_SetBlack (FALSE);
VIDEO_SetBlack (false);
VIDEO_Flush ();
VIDEO_WaitVSync ();

if (mode->viTVMode & VI_NON_INTERLACE)
VIDEO_WaitVSync();
else
while (VIDEO_GetNextField())
VIDEO_WaitVSync();
VIDEO_WaitForFlush ();

VIDEO_SetPostRetraceCallback ((VIRetraceCallback)copy_to_xfb);
vmode = mode;
Expand Down Expand Up @@ -400,13 +383,13 @@ InitializeVideo ()
GXRModeObj *rmode = FindVideoMode();
SetupVideoMode(rmode);

LWP_CreateThread (&vbthread, vbgetback, NULL, vbstack, TSTACK, 68);
LWP_CreateThread (&vbthread, vbgetback, NULL, NULL, 0, 68);

// Initialise GX
GXColor background = { 0, 0, 0, 0xff };
memset (gp_fifo, 0, DEFAULT_FIFO_SIZE);
GX_Init (&gp_fifo, DEFAULT_FIFO_SIZE);
GX_SetCopyClear (background, 0x00ffffff);
GX_SetCopyClear (background, GX_MAX_Z24);
GX_SetDispCopyGamma (GX_GM_1_0);
GX_SetCullMode (GX_CULL_NONE);
}
Expand Down Expand Up @@ -569,7 +552,7 @@ ResetVideo_Emu ()
GX_InvalidateTexAll ();
GX_InitTexObj (&texobj, texturemem, vwidth, vheight, GX_TF_RGB565, GX_CLAMP, GX_CLAMP, GX_FALSE); // initialize the texture obj we are going to use
if (GCSettings.render == 2)
GX_InitTexObjLOD(&texobj,GX_NEAR,GX_NEAR_MIP_NEAR,2.5,9.0,0.0,GX_FALSE,GX_FALSE,GX_ANISO_1); // original/unfiltered video mode: force texture filtering OFF
GX_InitTexObjFilterMode(&texobj,GX_NEAR,GX_NEAR); // original/unfiltered video mode: force texture filtering OFF

GX_Flush();
draw_init();
Expand Down Expand Up @@ -792,7 +775,7 @@ ResetVideo_Menu ()

// clears the bg to color and clears the z buffer
GXColor background = {0, 0, 0, 255};
GX_SetCopyClear (background, 0x00ffffff);
GX_SetCopyClear (background, GX_MAX_Z24);

yscale = GX_GetYScaleFactor(vmode->efbHeight,vmode->xfbHeight);
xfbHeight = GX_SetDispCopyYScale(yscale);
Expand Down Expand Up @@ -854,7 +837,7 @@ void Menu_Render()
GX_DrawDone();
VIDEO_SetNextFramebuffer(xfb[whichfb]);
VIDEO_Flush();
VIDEO_WaitVSync();
VIDEO_WaitForFlush();
}

/****************************************************************************
Expand Down