-now using compiler directives to make it easy to compile wiiflow lite or wfl_as wiiiflow. just uncomment line 5 in sys.h to compile as wfl as wiiflow.

This commit is contained in:
Fledge68 2018-11-03 12:10:34 -05:00
parent c48ea85348
commit 143cb7e941
6 changed files with 28 additions and 3 deletions

BIN
data/wfstub.bin Normal file

Binary file not shown.

View File

@ -1,10 +1,16 @@
#include "loader/sys.h"
#define APP_NAME "WiiFlow Lite"
#define APP_VERSION "4.5.0"
#define SVN_REV "1162"
#define APP_DATA_DIR "wiiflow"
#ifdef APP_WIIFLOW
#define APPS_DIR "apps/wiiflow"
#else
#define APPS_DIR "apps/wiiflow_lite"
#endif
//#define EMU_NANDS_DIR "nands"
#define GAMES_DIR "%s:/wbfs"

View File

@ -7,6 +7,7 @@
#include <vector>
#include <string>
#include "homebrew.h"
#include "loader/sys.h"
#include "banner/AnimatedBanner.h"
#include "fileOps/fileOps.h"
#include "gecko/gecko.hpp"
@ -26,8 +27,13 @@ u8 *appbooter_ptr = NULL;
u32 appbooter_size = 0;
using namespace std;
#ifdef APP_WIIFLOW
extern const u8 wfstub_bin[];
extern const u32 wfstub_bin_size;
#else
extern const u8 stub_bin[];
extern const u32 stub_bin_size;
#endif
u8 valid = 0;
@ -136,7 +142,11 @@ void writeStub()
/* Extract our stub */
u32 StubSize = 0;
#ifdef APP_WIIFLOW
u8 *Stub = DecompressCopy(wfstub_bin, wfstub_bin_size, &StubSize);
#else
u8 *Stub = DecompressCopy(stub_bin, stub_bin_size, &StubSize);
#endif
/* Copy our own stub into memory */
memcpy((void*)0x80001800, Stub, StubSize);

View File

@ -2,6 +2,8 @@
#ifndef _SYS_H_
#define _SYS_H_
//#define APP_WIIFLOW
#include "utils.h"
#ifdef __cplusplus

View File

@ -385,8 +385,13 @@ bool CMenu::init()
m_locked = m_cfg.getString("GENERAL", "parent_code", "").size() >= 4;
/* Switch the WFLA and DWFA when using official wiiflow */
#ifdef APP_WIIFLOW
if(m_cfg.getString("GENERAL", "returnto", "DWFA") == "WFLA")
m_cfg.setString("GENERAL", "returnto", "DWFA");
#else
if(m_cfg.getString("GENERAL", "returnto", "WFLA") == "DWFA")
m_cfg.setString("GENERAL", "returnto", "WFLA");
#endif
/* set WIIFLOW_DEF exit to option */
/* 0 thru 2 of exit to enum (EXIT_TO_MENU, EXIT_TO_HBC, EXIT_TO_WIIU) in sys.h */

View File

@ -225,9 +225,11 @@ bool CMenu::_ExitTo(void)
}
else
{
//if(m_cfg.getBool("NEEK2O", "launchwiiflow", true))
// exitHandler(EXIT_TO_WFNK2O);
//else
#ifdef APP_WIIFLOW
if(m_cfg.getBool("NEEK2O", "launchwiiflow", true))
exitHandler(EXIT_TO_WFNK2O);
else
#endif
exitHandler(EXIT_TO_SMNK2O);
/* if exiting to Neek2o we must set the EmuNand Path for sys_exit() in sys.c */
const char *EmuNandPath = NULL;