mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-11-23 19:59:16 +01:00
-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:
parent
3ef191d196
commit
0509e80edd
@ -16,16 +16,17 @@
|
||||
/* Constants */
|
||||
#define PART_INFO_OFFSET 0x10000
|
||||
|
||||
s32 Disc_Open()
|
||||
s32 Disc_Open(u8 type)
|
||||
{
|
||||
/* Reset drive */
|
||||
s32 ret = WDVD_Reset();
|
||||
if(ret < 0)
|
||||
return ret;
|
||||
if(type > 0)
|
||||
{ /* Reset drive */
|
||||
s32 ret = WDVD_Reset();
|
||||
if(ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Read disc ID */
|
||||
ret = WDVD_ReadDiskId((u8*)Disc_ID);
|
||||
return ret;
|
||||
return WDVD_ReadDiskId((u8*)Disc_ID);
|
||||
}
|
||||
|
||||
void Disc_SetLowMemPre()
|
||||
@ -136,12 +137,6 @@ s32 Disc_FindPartition(u32 *outbuf)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Disc_SetTime()
|
||||
{
|
||||
/* Set proper time */
|
||||
settime(secs_to_ticks(time(NULL) - 946684800));
|
||||
}
|
||||
|
||||
GXRModeObj *Disc_SelectVMode(u8 videoselected, u32 *rmode_reg)
|
||||
{
|
||||
GXRModeObj *rmode = VIDEO_GetPreferredMode(0);
|
||||
|
@ -6,13 +6,12 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
s32 Disc_Open();
|
||||
s32 Disc_Open(u8 type);
|
||||
s32 Disc_FindPartition(u32 *outbuf);
|
||||
s32 Disc_SetUSB(const u8 *id, bool frag);
|
||||
void Disc_SetLowMemPre();
|
||||
void Disc_SetLowMem(u32 IOS);
|
||||
void Disc_SetLowMemChan();
|
||||
void Disc_SetTime();
|
||||
|
||||
GXRModeObj *Disc_SelectVMode(u8 videoselected, u32 *rmode_reg);
|
||||
void Disc_SetVMode(GXRModeObj *rmode, u32 rmode_reg);
|
||||
|
@ -90,6 +90,8 @@ int main()
|
||||
Disc_SetUSB(NULL, false);
|
||||
if(CurrentIOS.Type == IOS_TYPE_HERMES)
|
||||
Hermes_Disable_EHC();
|
||||
if(normalCFG.vidMode > 1) //forcing a video mode
|
||||
normalCFG.patchVidMode = 1; //always normal patching
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -98,7 +100,7 @@ int main()
|
||||
Hermes_shadow_mload();
|
||||
}
|
||||
prog(20);
|
||||
Disc_Open();
|
||||
Disc_Open(normalCFG.GameBootType);
|
||||
u32 offset = 0;
|
||||
Disc_FindPartition(&offset);
|
||||
WDVD_OpenPartition(offset, &GameIOS);
|
||||
@ -125,9 +127,6 @@ int main()
|
||||
if(normalCFG.BootType == TYPE_CHANNEL && AppEntrypoint != 0x3400)
|
||||
Disc_SetLowMemChan(); /* Real DOL without appldr */
|
||||
|
||||
/* Set time */
|
||||
Disc_SetTime();
|
||||
|
||||
/* Set an appropriate video mode */
|
||||
Disc_SetVMode(vmode, vmode_reg);
|
||||
|
||||
|
@ -91,6 +91,8 @@ void WiiFlow_ExternalBooter(u8 vidMode, bool vipatch, bool countryString, u8 pat
|
||||
DCFlushRange(BooterConfig, sizeof(the_CFG));
|
||||
/* Wii Games will need it */
|
||||
net_wc24cleanup();
|
||||
/* Set proper time */
|
||||
settime(secs_to_ticks(time(NULL) - 946684800));
|
||||
/* Boot it */
|
||||
JumpToEntry(EXT_ENTRY);
|
||||
}
|
||||
|
@ -2,11 +2,13 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <malloc.h>
|
||||
#include <ogc/machine/processor.h>
|
||||
#include "memory/mem2.hpp"
|
||||
#include "video.hpp"
|
||||
#include "pngu.h"
|
||||
#include "Gekko.h"
|
||||
#include "gecko/gecko.hpp"
|
||||
#include "loader/sys.h"
|
||||
#include "loader/utils.h"
|
||||
|
||||
#define DEFAULT_FIFO_SIZE (256 * 1024)
|
||||
@ -154,6 +156,13 @@ void CVideo::init(void)
|
||||
if(CONF_GetDisplayOffsetH(&hoffset) == 0)
|
||||
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 */
|
||||
m_frameBuf[0] = MEM_K0_TO_K1(SYS_AllocateFramebuffer(m_rmode));
|
||||
m_frameBuf[1] = MEM_K0_TO_K1(SYS_AllocateFramebuffer(m_rmode));
|
||||
|
@ -140,6 +140,17 @@ bool AHBRPOT_Patched(void)
|
||||
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)
|
||||
{
|
||||
NeekPath = Path;
|
||||
|
@ -42,6 +42,7 @@ void Open_Inputs(void);
|
||||
void Close_Inputs(void);
|
||||
|
||||
bool AHBRPOT_Patched(void);
|
||||
bool IsOnWiiU(void);
|
||||
|
||||
/* All our extern C stuff */
|
||||
extern void __exception_setreload(int t);
|
||||
|
@ -35,6 +35,7 @@
|
||||
#define HW_GPIO_OUT ((vu32*)0xCD8000E0)
|
||||
#define HW_GPIOB_OUT ((vu32*)0xCD8000C0)
|
||||
#define HW_AHBPROT ((vu32*)0xCD800064)
|
||||
#define HW_PROCESSOR ((vu32*)0xCD8005A0)
|
||||
#define MEM_PROT ((vu32)0xCD8B420A)
|
||||
|
||||
#define HW_AES_CMD ((vu32)0x0D020000)
|
||||
|
Loading…
Reference in New Issue
Block a user