mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-11-27 13:44:15 +01:00
-set back homebrew boot size to 16mb and reverted all the lower
mem2 experiments
This commit is contained in:
parent
a95fe25030
commit
2bb24b2575
Binary file not shown.
@ -8,7 +8,7 @@ OUTPUT_ARCH(powerpc:common)
|
||||
ENTRY(_start)
|
||||
|
||||
SECTIONS {
|
||||
. = 0x93000000;
|
||||
. = 0x93100000;
|
||||
|
||||
.start : { crt0.o(*) }
|
||||
.text : { *(.text) }
|
||||
|
@ -10,8 +10,8 @@
|
||||
#include "elfloader.h"
|
||||
#include "sync.h"
|
||||
|
||||
#define EXECUTABLE_MEM_ADDR 0x91000000
|
||||
#define SYSTEM_ARGV ((struct __argv *) 0x93200000)
|
||||
#define EXECUTABLE_MEM_ADDR 0x92000000
|
||||
#define SYSTEM_ARGV ((struct __argv *)0x93200000)
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
@ -10,8 +10,8 @@
|
||||
#include "banner/AnimatedBanner.h"
|
||||
#include "gecko/gecko.hpp"
|
||||
|
||||
#define EXECUTE_ADDR ((u8 *)0x91000000)
|
||||
#define BOOTER_ADDR ((u8 *)0x93000000)
|
||||
#define EXECUTE_ADDR ((u8 *)0x92000000)
|
||||
#define BOOTER_ADDR ((u8 *)0x93100000)
|
||||
#define ARGS_ADDR ((u8 *)0x93200000)
|
||||
#define BOOTER_ENTRY ((entry)BOOTER_ADDR)
|
||||
|
||||
@ -23,7 +23,7 @@ extern const u32 app_booter_bin_size;
|
||||
extern const u8 stub_bin[];
|
||||
extern const u32 stub_bin_size;
|
||||
|
||||
u32 buffer_size = 0;
|
||||
u8 valid = 0;
|
||||
|
||||
static vector<string> Arguments;
|
||||
|
||||
@ -48,23 +48,24 @@ void AddBootArgument(const char * argv)
|
||||
|
||||
int LoadHomebrew(const char *filepath)
|
||||
{
|
||||
if(!filepath)
|
||||
if(filepath == NULL)
|
||||
return -1;
|
||||
|
||||
FILE *file = fopen(filepath ,"rb");
|
||||
if(!file)
|
||||
FILE *file = fopen(filepath, "rb");
|
||||
if(file == NULL)
|
||||
return -2;
|
||||
|
||||
fseek(file, 0, SEEK_END);
|
||||
u32 filesize = ftell(file);
|
||||
rewind(file);
|
||||
|
||||
buffer_size = filesize;
|
||||
fread(EXECUTE_ADDR, 1, buffer_size, file);
|
||||
DCFlushRange(EXECUTE_ADDR, buffer_size);
|
||||
if(filesize <= ((u32)BOOTER_ADDR - (u32)EXECUTE_ADDR))
|
||||
{
|
||||
rewind(file);
|
||||
valid = (fread(EXECUTE_ADDR, 1, filesize, file) == filesize);
|
||||
DCFlushRange(EXECUTE_ADDR, filesize);
|
||||
}
|
||||
fclose(file);
|
||||
|
||||
return 1;
|
||||
return valid;
|
||||
}
|
||||
|
||||
int SetupARGV(struct __argv * args)
|
||||
|
@ -16,14 +16,14 @@ u32 MALLOC_MEM2 = 0;
|
||||
void *MEM1_lo_start = (void*)0x80004000;
|
||||
void *MEM1_lo_end = (void*)0x80620000;
|
||||
|
||||
void *MEM2_lo_start = (void*)0x90000000;
|
||||
void *MEM2_lo_end = (void*)0x90600000;
|
||||
/*void *MEM2_lo_start = (void*)0x90000000;
|
||||
void *MEM2_lo_end = (void*)0x90600000;*/
|
||||
|
||||
void *MEM2_start = (void*)0x90600000;
|
||||
void *MEM2_start = (void*)0x90200000;
|
||||
void *MEM2_end = (void*)0x93100000;
|
||||
|
||||
static CMEM2Alloc g_mem1lo;
|
||||
static CMEM2Alloc g_mem2lo_gp;
|
||||
/*static CMEM2Alloc g_mem2lo_gp;*/
|
||||
static CMEM2Alloc g_mem2gp;
|
||||
|
||||
extern "C"
|
||||
@ -41,10 +41,10 @@ void MEM_init()
|
||||
g_mem1lo.init(MEM1_lo_start, MEM1_lo_end); //about 6mb
|
||||
g_mem1lo.clear();
|
||||
|
||||
g_mem2lo_gp.init(MEM2_lo_start, MEM2_lo_end); //about 6mb
|
||||
g_mem2lo_gp.clear();
|
||||
/*g_mem2lo_gp.init(MEM2_lo_start, MEM2_lo_end); //about 6mb
|
||||
g_mem2lo_gp.clear();*/
|
||||
|
||||
g_mem2gp.init(MEM2_start, MEM2_end); //about 43mb
|
||||
g_mem2gp.init(MEM2_start, MEM2_end); //about 47mb
|
||||
g_mem2gp.clear();
|
||||
}
|
||||
|
||||
@ -96,24 +96,27 @@ unsigned int MEM1_freesize()
|
||||
|
||||
void *MEM2_lo_alloc(unsigned int s)
|
||||
{
|
||||
return g_mem2lo_gp.allocate(s);
|
||||
return MEM2_alloc(s);
|
||||
/*return g_mem2lo_gp.allocate(s);*/
|
||||
}
|
||||
|
||||
void *MEM2_lo_realloc(void *p, unsigned int s)
|
||||
{
|
||||
return g_mem2lo_gp.reallocate(p, s);
|
||||
return MEM2_realloc(p, s);
|
||||
/*return g_mem2lo_gp.reallocate(p, s);*/
|
||||
}
|
||||
|
||||
void MEM2_lo_free(void *p)
|
||||
{
|
||||
if(!p)
|
||||
MEM2_free(p);
|
||||
/*if(!p)
|
||||
return;
|
||||
g_mem2lo_gp.release(p);
|
||||
g_mem2lo_gp.release(p);*/
|
||||
}
|
||||
|
||||
unsigned int MEM2_lo_freesize()
|
||||
{
|
||||
return g_mem2lo_gp.FreeSize();
|
||||
return 0;//g_mem2lo_gp.FreeSize();
|
||||
}
|
||||
|
||||
|
||||
@ -216,10 +219,10 @@ void __wrap_free(void *p)
|
||||
|
||||
if(((u32)p & 0x10000000) != 0)
|
||||
{
|
||||
if(p > MEM2_start)
|
||||
g_mem2gp.release(p);
|
||||
else
|
||||
g_mem2lo_gp.release(p);
|
||||
//if(p > MEM2_start)
|
||||
g_mem2gp.release(p);
|
||||
//else
|
||||
//g_mem2lo_gp.release(p);
|
||||
}
|
||||
else
|
||||
MEM1_free(p);
|
||||
|
@ -964,16 +964,20 @@ void CMenu::_launchHomebrew(const char *filepath, vector<string> arguments)
|
||||
Playlog_Delete();
|
||||
cleanup(); // wifi and sd gecko doesnt work anymore after cleanup
|
||||
|
||||
LoadHomebrew(filepath);
|
||||
AddBootArgument(filepath);
|
||||
for(u32 i = 0; i < arguments.size(); ++i)
|
||||
if(LoadHomebrew(filepath) == 1)
|
||||
{
|
||||
gprintf("Argument: %s\n", arguments[i].c_str());
|
||||
AddBootArgument(arguments[i].c_str());
|
||||
AddBootArgument(filepath);
|
||||
for(u32 i = 0; i < arguments.size(); ++i)
|
||||
{
|
||||
gprintf("Argument: %s\n", arguments[i].c_str());
|
||||
AddBootArgument(arguments[i].c_str());
|
||||
}
|
||||
loadIOS(58, false);
|
||||
ShutdownBeforeExit();
|
||||
BootHomebrew();
|
||||
}
|
||||
loadIOS(58, false);
|
||||
ShutdownBeforeExit();
|
||||
BootHomebrew();
|
||||
else
|
||||
Sys_Exit();
|
||||
}
|
||||
|
||||
int CMenu::_loadIOS(u8 gameIOS, int userIOS, string id, bool RealNAND_Channels)
|
||||
|
Loading…
Reference in New Issue
Block a user