mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-16 00:15:08 +01:00
7e0e4cab5c
*Added option for file splitting on install. 2GB, 4GB and on ntfs/ext2/3/4 partitions no splitting at all option. *Fixed the install dir naming patterns option for fat32/ntfs/ext2/3/4 game installs *Changed/Fixed Home Menu exit to loader / shutdown *Added reload of game list on SD button click *Fixed language file loading on startup *Changed browse for theme path to file browser instead of OnScreenKeyboard Several settings were changed in this revision. It is recommended to reset the configs before using this rev. Forwarder Channel Update: *Use of IOS58 and AHBPROT *Complete change of forwarder. Using same as on WiiXplorer now. *Looking for dol in every primary fat/ntfs partition in the known paths (/apps/usbloader_gx/ and /apps/usbloadergx/). (Booting loader from ntfs will be usefull once images and settings can also be stored on ntfs.) Here is a download link for the channel: http://www.mediafire.com/?r11bwt1occlanmk The channel will be uploaded to the download section later when it is thoroughly tested.
63 lines
1.5 KiB
C
63 lines
1.5 KiB
C
#include <malloc.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <ogc/machine/processor.h>
|
|
#include <gccore.h>
|
|
#include <dirent.h>
|
|
#include <string.h>
|
|
|
|
#include "dolloader.h"
|
|
|
|
typedef struct _dolheader {
|
|
u32 text_pos[7];
|
|
u32 data_pos[11];
|
|
u32 text_start[7];
|
|
u32 data_start[11];
|
|
u32 text_size[7];
|
|
u32 data_size[11];
|
|
u32 bss_start;
|
|
u32 bss_size;
|
|
u32 entry_point;
|
|
} dolheader;
|
|
|
|
u32 load_dol_image(const void *dolstart, struct __argv *argv)
|
|
{
|
|
u32 i;
|
|
dolheader *dolfile;
|
|
|
|
if (dolstart)
|
|
{
|
|
dolfile = (dolheader *) dolstart;
|
|
for (i = 0; i < 7; i++)
|
|
{
|
|
if ((!dolfile->text_size[i]) || (dolfile->text_start[i] < 0x100))
|
|
continue;
|
|
|
|
VIDEO_WaitVSync();
|
|
memmove((void *) dolfile->text_start[i], dolstart + dolfile->text_pos[i], dolfile->text_size[i]);
|
|
DCFlushRange ((void *) dolfile->text_start[i], dolfile->text_size[i]);
|
|
ICInvalidateRange((void *) dolfile->text_start[i], dolfile->text_size[i]);
|
|
}
|
|
|
|
for (i = 0; i < 11; i++)
|
|
{
|
|
if ((!dolfile->data_size[i]) || (dolfile->data_start[i] < 0x100))
|
|
continue;
|
|
|
|
VIDEO_WaitVSync();
|
|
memmove((void *) dolfile->data_start[i], dolstart + dolfile->data_pos[i], dolfile->data_size[i]);
|
|
DCFlushRange((void *) dolfile->data_start[i],
|
|
dolfile->data_size[i]);
|
|
}
|
|
|
|
if (argv && argv->argvMagic == ARGV_MAGIC)
|
|
{
|
|
void *new_argv = (void *) (dolfile->entry_point + 8);
|
|
memmove(new_argv, argv, sizeof(*argv));
|
|
DCFlushRange(new_argv, sizeof(*argv));
|
|
}
|
|
return dolfile->entry_point;
|
|
}
|
|
return 0;
|
|
}
|