-fixed wii game time (how did nobody report that?)

-speed up wii disc booting
-if booting from a wii disc and a general video mode is set, wiiflow will automatically use normal video patching to prevent game freezing
-added the vwii widescreen fix by tueidj (thanks alot for releasing that) and a vwii detection by crediar, thanks to his nintendont source
This commit is contained in:
fix94.1 2013-12-18 18:33:40 +00:00
parent 3ef191d196
commit 0509e80edd
8 changed files with 36 additions and 19 deletions

View File

@ -16,16 +16,17 @@
/* Constants */ /* Constants */
#define PART_INFO_OFFSET 0x10000 #define PART_INFO_OFFSET 0x10000
s32 Disc_Open() s32 Disc_Open(u8 type)
{ {
/* Reset drive */ if(type > 0)
s32 ret = WDVD_Reset(); { /* Reset drive */
if(ret < 0) s32 ret = WDVD_Reset();
return ret; if(ret < 0)
return ret;
}
/* Read disc ID */ /* Read disc ID */
ret = WDVD_ReadDiskId((u8*)Disc_ID); return WDVD_ReadDiskId((u8*)Disc_ID);
return ret;
} }
void Disc_SetLowMemPre() void Disc_SetLowMemPre()
@ -136,12 +137,6 @@ s32 Disc_FindPartition(u32 *outbuf)
return 0; return 0;
} }
void Disc_SetTime()
{
/* Set proper time */
settime(secs_to_ticks(time(NULL) - 946684800));
}
GXRModeObj *Disc_SelectVMode(u8 videoselected, u32 *rmode_reg) GXRModeObj *Disc_SelectVMode(u8 videoselected, u32 *rmode_reg)
{ {
GXRModeObj *rmode = VIDEO_GetPreferredMode(0); GXRModeObj *rmode = VIDEO_GetPreferredMode(0);

View File

@ -6,13 +6,12 @@
extern "C" { extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
s32 Disc_Open(); s32 Disc_Open(u8 type);
s32 Disc_FindPartition(u32 *outbuf); s32 Disc_FindPartition(u32 *outbuf);
s32 Disc_SetUSB(const u8 *id, bool frag); s32 Disc_SetUSB(const u8 *id, bool frag);
void Disc_SetLowMemPre(); void Disc_SetLowMemPre();
void Disc_SetLowMem(u32 IOS); void Disc_SetLowMem(u32 IOS);
void Disc_SetLowMemChan(); void Disc_SetLowMemChan();
void Disc_SetTime();
GXRModeObj *Disc_SelectVMode(u8 videoselected, u32 *rmode_reg); GXRModeObj *Disc_SelectVMode(u8 videoselected, u32 *rmode_reg);
void Disc_SetVMode(GXRModeObj *rmode, u32 rmode_reg); void Disc_SetVMode(GXRModeObj *rmode, u32 rmode_reg);

View File

@ -90,6 +90,8 @@ int main()
Disc_SetUSB(NULL, false); Disc_SetUSB(NULL, false);
if(CurrentIOS.Type == IOS_TYPE_HERMES) if(CurrentIOS.Type == IOS_TYPE_HERMES)
Hermes_Disable_EHC(); Hermes_Disable_EHC();
if(normalCFG.vidMode > 1) //forcing a video mode
normalCFG.patchVidMode = 1; //always normal patching
} }
else else
{ {
@ -98,7 +100,7 @@ int main()
Hermes_shadow_mload(); Hermes_shadow_mload();
} }
prog(20); prog(20);
Disc_Open(); Disc_Open(normalCFG.GameBootType);
u32 offset = 0; u32 offset = 0;
Disc_FindPartition(&offset); Disc_FindPartition(&offset);
WDVD_OpenPartition(offset, &GameIOS); WDVD_OpenPartition(offset, &GameIOS);
@ -125,9 +127,6 @@ int main()
if(normalCFG.BootType == TYPE_CHANNEL && AppEntrypoint != 0x3400) if(normalCFG.BootType == TYPE_CHANNEL && AppEntrypoint != 0x3400)
Disc_SetLowMemChan(); /* Real DOL without appldr */ Disc_SetLowMemChan(); /* Real DOL without appldr */
/* Set time */
Disc_SetTime();
/* Set an appropriate video mode */ /* Set an appropriate video mode */
Disc_SetVMode(vmode, vmode_reg); Disc_SetVMode(vmode, vmode_reg);

View File

@ -91,6 +91,8 @@ void WiiFlow_ExternalBooter(u8 vidMode, bool vipatch, bool countryString, u8 pat
DCFlushRange(BooterConfig, sizeof(the_CFG)); DCFlushRange(BooterConfig, sizeof(the_CFG));
/* Wii Games will need it */ /* Wii Games will need it */
net_wc24cleanup(); net_wc24cleanup();
/* Set proper time */
settime(secs_to_ticks(time(NULL) - 946684800));
/* Boot it */ /* Boot it */
JumpToEntry(EXT_ENTRY); JumpToEntry(EXT_ENTRY);
} }

View File

@ -2,11 +2,13 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <malloc.h> #include <malloc.h>
#include <ogc/machine/processor.h>
#include "memory/mem2.hpp" #include "memory/mem2.hpp"
#include "video.hpp" #include "video.hpp"
#include "pngu.h" #include "pngu.h"
#include "Gekko.h" #include "Gekko.h"
#include "gecko/gecko.hpp" #include "gecko/gecko.hpp"
#include "loader/sys.h"
#include "loader/utils.h" #include "loader/utils.h"
#define DEFAULT_FIFO_SIZE (256 * 1024) #define DEFAULT_FIFO_SIZE (256 * 1024)
@ -154,6 +156,13 @@ void CVideo::init(void)
if(CONF_GetDisplayOffsetH(&hoffset) == 0) if(CONF_GetDisplayOffsetH(&hoffset) == 0)
m_rmode->viXOrigin += hoffset; m_rmode->viXOrigin += hoffset;
/* Widescreen Fix by tueidj, WiiU Check by crediar, thanks alot */
if(m_wide && AHBRPOT_Patched() && IsOnWiiU())
{
write32(0xd8006a0, 0x30000004);
mask32(0xd8006a8, 0, 2);
}
/* GX Init */ /* GX Init */
m_frameBuf[0] = MEM_K0_TO_K1(SYS_AllocateFramebuffer(m_rmode)); m_frameBuf[0] = MEM_K0_TO_K1(SYS_AllocateFramebuffer(m_rmode));
m_frameBuf[1] = MEM_K0_TO_K1(SYS_AllocateFramebuffer(m_rmode)); m_frameBuf[1] = MEM_K0_TO_K1(SYS_AllocateFramebuffer(m_rmode));

View File

@ -140,6 +140,17 @@ bool AHBRPOT_Patched(void)
return (*HW_AHBPROT == 0xFFFFFFFF); return (*HW_AHBPROT == 0xFFFFFFFF);
} }
/* WiiU Check by crediar, thanks */
bool IsOnWiiU(void)
{
if((*HW_PROCESSOR >> 16) == 0xCAFE)
{
gprintf("vWii Mode\n");
return true;
}
return false;
}
void Sys_SetNeekPath(const char *Path) void Sys_SetNeekPath(const char *Path)
{ {
NeekPath = Path; NeekPath = Path;

View File

@ -42,6 +42,7 @@ void Open_Inputs(void);
void Close_Inputs(void); void Close_Inputs(void);
bool AHBRPOT_Patched(void); bool AHBRPOT_Patched(void);
bool IsOnWiiU(void);
/* All our extern C stuff */ /* All our extern C stuff */
extern void __exception_setreload(int t); extern void __exception_setreload(int t);

View File

@ -35,6 +35,7 @@
#define HW_GPIO_OUT ((vu32*)0xCD8000E0) #define HW_GPIO_OUT ((vu32*)0xCD8000E0)
#define HW_GPIOB_OUT ((vu32*)0xCD8000C0) #define HW_GPIOB_OUT ((vu32*)0xCD8000C0)
#define HW_AHBPROT ((vu32*)0xCD800064) #define HW_AHBPROT ((vu32*)0xCD800064)
#define HW_PROCESSOR ((vu32*)0xCD8005A0)
#define MEM_PROT ((vu32)0xCD8B420A) #define MEM_PROT ((vu32)0xCD8B420A)
#define HW_AES_CMD ((vu32)0x0D020000) #define HW_AES_CMD ((vu32)0x0D020000)