mirror of
https://gitlab.com/Nanolx/homebrewfilter.git
synced 2024-11-24 18:16:56 +01:00
killa da whitespacegit diff!
This commit is contained in:
parent
f022f66fa4
commit
812df71ef1
@ -239,7 +239,7 @@ int BootHomebrew()
|
||||
//we can't use check_uneek_fs
|
||||
//as we already shut down the uneek_fs system
|
||||
//so it will always return false
|
||||
|
||||
|
||||
if (in_neek == false)
|
||||
{
|
||||
if(Settings.force_reload != "")
|
||||
|
@ -69,7 +69,7 @@ u32 load_elf_image (void *addr)
|
||||
|| shdr->sh_addr == 0 || shdr->sh_size == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
shdr->sh_addr &= 0x3FFFFFFF;
|
||||
shdr->sh_addr |= 0x80000000;
|
||||
|
||||
|
@ -25,14 +25,14 @@ bool font_dl = false;
|
||||
int MenuSettingsFont()
|
||||
{
|
||||
int menu = MENU_NONE;
|
||||
|
||||
|
||||
int ret = -1;
|
||||
int activated = -1;
|
||||
int i = 0;
|
||||
int focus = 0;
|
||||
|
||||
|
||||
OptionList options;
|
||||
|
||||
|
||||
sprintf(options.name[i], tr("STANDARD"));
|
||||
if(stricmp(Options.temp_font.c_str(), tr("STANDARD")) == 0)
|
||||
{
|
||||
@ -56,7 +56,7 @@ int MenuSettingsFont()
|
||||
if(temp.length() > 3 && stricmp(temp.substr(temp.length() -4, 4).c_str(), ".ttf") == 0)
|
||||
{
|
||||
sprintf(options.name[i], temp.c_str());
|
||||
|
||||
|
||||
if(stricmp(Options.temp_font.c_str(), temp.c_str()) == 0)
|
||||
{
|
||||
sprintf (options.value[i], tr("activated"));
|
||||
@ -64,7 +64,7 @@ int MenuSettingsFont()
|
||||
}
|
||||
else
|
||||
sprintf (options.value[i], " ");
|
||||
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
@ -137,7 +137,7 @@ int MenuSettingsFont()
|
||||
w.Append(&backBtn);
|
||||
mainWindow->Append(&w);
|
||||
mainWindow->Append(&optionBrowser);
|
||||
|
||||
|
||||
mainWindow->ChangeFocus(&optionBrowser);
|
||||
ResumeGui();
|
||||
|
||||
@ -176,12 +176,12 @@ int MenuSettingsFont()
|
||||
}
|
||||
HaltResumeGui();
|
||||
}
|
||||
|
||||
|
||||
if(downloadBtn.GetState() == STATE_CLICKED)
|
||||
{
|
||||
downloadBtn.ResetState();
|
||||
string fontdownload = checkFontsPrompt();
|
||||
|
||||
|
||||
if(fontdownload != "NULL")
|
||||
{
|
||||
if(font_folder_exists())
|
||||
@ -192,16 +192,16 @@ int MenuSettingsFont()
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(okBtn.GetState() == STATE_CLICKED)
|
||||
{
|
||||
Options.temp_last_setting = 1;
|
||||
Options.temp_font = options.name[activated];
|
||||
menu = MENU_SETTINGS_FILE;
|
||||
}
|
||||
|
||||
|
||||
if(backBtn.GetState() == STATE_CLICKED)
|
||||
{
|
||||
Options.temp_last_setting = 1;
|
||||
|
@ -24,14 +24,14 @@ bool language_dl = false;
|
||||
int MenuSettingsLanguage()
|
||||
{
|
||||
int menu = MENU_NONE;
|
||||
|
||||
|
||||
int ret = -1;
|
||||
int activated = -1;
|
||||
int i = 0;
|
||||
int focus = 0;
|
||||
|
||||
|
||||
OptionList options;
|
||||
|
||||
|
||||
sprintf(options.name[i], tr("STANDARD"));
|
||||
if(stricmp(Options.temp_language.c_str(), tr("STANDARD")) == 0)
|
||||
{
|
||||
@ -45,7 +45,7 @@ int MenuSettingsLanguage()
|
||||
|
||||
DIR *dirHandle;
|
||||
struct dirent * dirEntry;
|
||||
|
||||
|
||||
dirHandle = opendir(check_path(Settings.device_dat + ":/config/HBF/Languages").c_str());
|
||||
if (dirHandle)
|
||||
{
|
||||
@ -58,7 +58,7 @@ int MenuSettingsLanguage()
|
||||
{
|
||||
temp.erase(temp.length() -5, 5); // endung entfernen
|
||||
sprintf(options.name[i], temp.c_str());
|
||||
|
||||
|
||||
if(stricmp(Options.temp_language.c_str(), temp.c_str()) == 0)
|
||||
{
|
||||
sprintf (options.value[i], tr("activated"));
|
||||
@ -66,7 +66,7 @@ int MenuSettingsLanguage()
|
||||
}
|
||||
else
|
||||
sprintf (options.value[i], " ");
|
||||
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
@ -139,7 +139,7 @@ int MenuSettingsLanguage()
|
||||
w.Append(&backBtn);
|
||||
mainWindow->Append(&w);
|
||||
mainWindow->Append(&optionBrowser);
|
||||
|
||||
|
||||
mainWindow->ChangeFocus(&optionBrowser);
|
||||
ResumeGui();
|
||||
|
||||
@ -178,12 +178,12 @@ int MenuSettingsLanguage()
|
||||
}
|
||||
HaltResumeGui();
|
||||
}
|
||||
|
||||
|
||||
if(downloadBtn.GetState() == STATE_CLICKED)
|
||||
{
|
||||
downloadBtn.ResetState();
|
||||
string languagedownload = checkLanguagesPrompt();
|
||||
|
||||
|
||||
if(languagedownload != "NULL" && language_folder_exists())
|
||||
{
|
||||
languageDownload(languagedownload);
|
||||
@ -192,14 +192,14 @@ int MenuSettingsLanguage()
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(okBtn.GetState() == STATE_CLICKED)
|
||||
{
|
||||
Options.temp_last_setting = 1;
|
||||
Options.temp_language = options.name[activated];
|
||||
menu = MENU_SETTINGS_FILE;
|
||||
}
|
||||
|
||||
|
||||
if(backBtn.GetState() == STATE_CLICKED)
|
||||
{
|
||||
Options.temp_last_setting = 1;
|
||||
|
@ -2,9 +2,9 @@
|
||||
struct s_move
|
||||
{
|
||||
int page;
|
||||
int nr;
|
||||
int nr;
|
||||
int nr_selected;
|
||||
bool new_app;
|
||||
bool new_app;
|
||||
};
|
||||
extern struct s_move move;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -37,9 +37,9 @@ void ExitApp();
|
||||
|
||||
|
||||
|
||||
int boot_neek2o()
|
||||
int boot_neek2o()
|
||||
{
|
||||
int allfound = 0;
|
||||
int allfound = 0;
|
||||
s32 nresult;
|
||||
u32 kernel_size;
|
||||
int ferr;
|
||||
@ -60,7 +60,7 @@ int boot_neek2o()
|
||||
}
|
||||
}
|
||||
if (allfound == 0)
|
||||
{
|
||||
{
|
||||
strcpy(filepath,"usb1:/sneek/kernel.bin");
|
||||
if (FileExist(filepath))
|
||||
{
|
||||
@ -85,13 +85,13 @@ int boot_neek2o()
|
||||
if ((kpath[0] == 's')||(kpath[0] == 'S'))
|
||||
{
|
||||
strcpy(n2oSettings.nanddisc,"sd1:/");
|
||||
strcpy(n2oSettings.nandfolder,"/");
|
||||
strcpy(n2oSettings.nandfolder,"/");
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(n2oSettings.nanddisc,"usb1:/");
|
||||
strcpy(n2oSettings.nandfolder,"/");
|
||||
}
|
||||
}
|
||||
}
|
||||
nresult = adjust_nandpath();
|
||||
if((nresult == -2) || (nresult == -3))
|
||||
@ -107,7 +107,7 @@ int boot_neek2o()
|
||||
}
|
||||
if (nresult == -2)
|
||||
{
|
||||
gprintf("Will use nandcfg.bin nand or rootnand instead\n");
|
||||
gprintf("Will use nandcfg.bin nand or rootnand instead\n");
|
||||
}
|
||||
if (nresult == -3)
|
||||
{
|
||||
@ -162,4 +162,3 @@ int boot_neek2o()
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -13,69 +13,69 @@
|
||||
|
||||
//#define KERNEL_SIZE 168920
|
||||
|
||||
void DoMini(u8* kbuf, size_t kernel_size)
|
||||
{
|
||||
void DoMini(u8* kbuf, size_t kernel_size)
|
||||
{
|
||||
//temporary test
|
||||
//copy kernel.bin
|
||||
|
||||
|
||||
//copy kernel.bin
|
||||
|
||||
|
||||
kernel_size +=3;
|
||||
kernel_size &= 0xFFFFFFFC;
|
||||
kernel_size &= 0xFFFFFFFC;
|
||||
//memcpy((void*)0x91000000,kernel_bin,KERNEL_SIZE);
|
||||
//DCFlushRange( (void *)0x91000000, KERNEL_SIZE );
|
||||
|
||||
|
||||
// char* mini = (char*) memalign( 32, armboot_bin_size +KERNEL_SIZE + 4 );
|
||||
u8* mini = (u8*) memalign( 32, armboot_size +kernel_size + 4 );
|
||||
|
||||
if( !mini )
|
||||
{
|
||||
return;
|
||||
}
|
||||
gprintf( "mini buffer: %p\n", mini );
|
||||
|
||||
|
||||
|
||||
// char* mini = (char*) memalign( 32, armboot_bin_size +KERNEL_SIZE + 4 );
|
||||
u8* mini = (u8*) memalign( 32, armboot_size +kernel_size + 4 );
|
||||
|
||||
if( !mini )
|
||||
{
|
||||
return;
|
||||
}
|
||||
gprintf( "mini buffer: %p\n", mini );
|
||||
|
||||
|
||||
// memcpy( mini, kernel_bin,KERNEL_SIZE);
|
||||
// DCFlushRange( mini, KERNEL_SIZE );
|
||||
// memcpy( mini+KERNEL_SIZE+4, armboot_bin, armboot_bin_size );
|
||||
// DCFlushRange( mini+KERNEL_SIZE+4, armboot_bin_size );
|
||||
// DCFlushRange( mini, KERNEL_SIZE );
|
||||
// memcpy( mini+KERNEL_SIZE+4, armboot_bin, armboot_bin_size );
|
||||
// DCFlushRange( mini+KERNEL_SIZE+4, armboot_bin_size );
|
||||
|
||||
memcpy( mini, kbuf,kernel_size);
|
||||
DCFlushRange( mini, kernel_size );
|
||||
DCFlushRange( mini, kernel_size );
|
||||
free(kbuf);
|
||||
memcpy( mini+kernel_size+4, armboot, armboot_size );
|
||||
DCFlushRange( mini+kernel_size+4, armboot_size );
|
||||
|
||||
gprintf( "armboot.bin copied\n" );
|
||||
*(u32*)0xc150f000 = 0x424d454d;
|
||||
asm volatile( "eieio" );
|
||||
|
||||
// physical address for armboot.bin. ( virtualToPhysical() )
|
||||
// *(u32*)0xc150f004 = MEM_VIRTUAL_TO_PHYSICAL( mini+KERNEL_SIZE+4 );
|
||||
*(u32*)0xc150f004 = MEM_VIRTUAL_TO_PHYSICAL( mini+kernel_size+4 );
|
||||
memcpy( mini+kernel_size+4, armboot, armboot_size );
|
||||
DCFlushRange( mini+kernel_size+4, armboot_size );
|
||||
|
||||
asm volatile( "eieio" );
|
||||
|
||||
gprintf( "physical memory address: %08x\n", MEM_VIRTUAL_TO_PHYSICAL( mini ) );
|
||||
gprintf( "loading bootmii IOS\n" );
|
||||
|
||||
|
||||
// pass position of kernel.bin to mini
|
||||
gprintf( "armboot.bin copied\n" );
|
||||
*(u32*)0xc150f000 = 0x424d454d;
|
||||
asm volatile( "eieio" );
|
||||
|
||||
// physical address for armboot.bin. ( virtualToPhysical() )
|
||||
// *(u32*)0xc150f004 = MEM_VIRTUAL_TO_PHYSICAL( mini+KERNEL_SIZE+4 );
|
||||
*(u32*)0xc150f004 = MEM_VIRTUAL_TO_PHYSICAL( mini+kernel_size+4 );
|
||||
|
||||
asm volatile( "eieio" );
|
||||
|
||||
gprintf( "physical memory address: %08x\n", MEM_VIRTUAL_TO_PHYSICAL( mini ) );
|
||||
gprintf( "loading bootmii IOS\n" );
|
||||
|
||||
|
||||
// pass position of kernel.bin to mini
|
||||
*(u32*)0x8132FFF0 = MEM_VIRTUAL_TO_PHYSICAL( mini );
|
||||
asm volatile( "eieio" );
|
||||
asm volatile( "eieio" );
|
||||
DCFlushRange((void*)0x8132FFF0,4);
|
||||
|
||||
// pass length of kernel.bin to mini
|
||||
// pass length of kernel.bin to mini
|
||||
*(u32*)0x8132FFF4 = kernel_size;
|
||||
asm volatile( "eieio" );
|
||||
asm volatile( "eieio" );
|
||||
DCFlushRange((void*)0x8132FFF4,4);
|
||||
|
||||
|
||||
|
||||
IOS_ReloadIOS( 0xfe );
|
||||
|
||||
gprintf( "well shit. this shouldnt happen\n" );
|
||||
|
||||
free( mini );
|
||||
|
||||
IOS_ReloadIOS( 0xfe );
|
||||
|
||||
gprintf( "well shit. this shouldnt happen\n" );
|
||||
|
||||
free( mini );
|
||||
}
|
||||
|
||||
|
@ -22,25 +22,25 @@ but it's better to stay on the safe area.
|
||||
rev. 1.04 fourth draft.
|
||||
shutdown function is now a stub as some programs call it before they end to force a remount
|
||||
exit_uneek_fs added to properly shutdown the uneek_usb_fs file system.
|
||||
max_write_sectors increased to speedup things. Transfer speed from wiixplorer gone up
|
||||
from 20KB/s to 265KB/s.
|
||||
max_write_sectors increased to speedup things. Transfer speed from wiixplorer gone up
|
||||
from 20KB/s to 265KB/s.
|
||||
|
||||
rev. 1.05 fifth draft
|
||||
added "is_uneek" function
|
||||
|
||||
rev. 1.06 sixth draft
|
||||
added "is_neek2" and "is_neek3" functions
|
||||
Crediar changed the boot2 version back from 5 to 4.
|
||||
Crediar changed the boot2 version back from 5 to 4.
|
||||
The is_uneek function will not detect those neek versions anymore.
|
||||
Stfour created the is_neek2 method to detect if neek is running.
|
||||
JoostinOnline and GiantPune created the is_neek3 which is a little less code.
|
||||
So, you should use either is_neek2 or is_neek3
|
||||
|
||||
|
||||
rev. 1.07 seventh draft
|
||||
added "is_neek4" function
|
||||
Dj_Skual created the is_neek4 method to detect if neek is running.
|
||||
|
||||
added WII_launch_Channel. It's not really uneek_fs related, but it could be handy
|
||||
added WII_launch_Channel. It's not really uneek_fs related, but it could be handy
|
||||
|
||||
|
||||
Copyright (C) 2011 Obcd
|
||||
@ -77,7 +77,7 @@ distribution.
|
||||
//#include <ogc/disc_io.h>
|
||||
|
||||
|
||||
//#define SHOW_GECKO_DEBUG 1
|
||||
//#define SHOW_GECKO_DEBUG 1
|
||||
|
||||
#ifdef SHOW_GECKO_DEBUG
|
||||
#include "gecko.h"
|
||||
@ -168,7 +168,7 @@ bool __io_uns_ReadSectors(u32 sector, u32 count, void *buffer)
|
||||
buf = (u8 *)memalign(64, 512 * amount);
|
||||
|
||||
while(done < count)
|
||||
{
|
||||
{
|
||||
whence = 0;
|
||||
if ((sec & 0x80000000)!= 0)
|
||||
{
|
||||
@ -177,13 +177,13 @@ bool __io_uns_ReadSectors(u32 sector, u32 count, void *buffer)
|
||||
}
|
||||
#ifdef CACHE_SECTOR_LOCATION
|
||||
if ((sector + done) != seek_cache)
|
||||
{
|
||||
#endif
|
||||
{
|
||||
#endif
|
||||
ISFS_Seek(fu,sec,whence);
|
||||
#ifdef CACHE_SECTOR_LOCATION
|
||||
seek_cache = sector + done;
|
||||
#ifdef CACHE_SECTOR_LOCATION
|
||||
seek_cache = sector + done;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
s32 ret = ISFS_Read(fu,buf,512*amount);
|
||||
if (ret == (s32)(512*amount))
|
||||
{
|
||||
@ -191,9 +191,9 @@ bool __io_uns_ReadSectors(u32 sector, u32 count, void *buffer)
|
||||
memcpy(resultbuf,buf,512*amount);
|
||||
done+=amount;
|
||||
sec = sector + done;
|
||||
#ifdef CACHE_SECTOR_LOCATION
|
||||
seek_cache = sector + done;
|
||||
#endif
|
||||
#ifdef CACHE_SECTOR_LOCATION
|
||||
seek_cache = sector + done;
|
||||
#endif
|
||||
if((count-done)<=MAX_READ_SECTORS)
|
||||
{
|
||||
amount = count - done;
|
||||
@ -205,11 +205,11 @@ bool __io_uns_ReadSectors(u32 sector, u32 count, void *buffer)
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef CACHE_SECTOR_LOCATION
|
||||
seek_cache = 0xfffffff8;
|
||||
#endif
|
||||
#ifdef CACHE_SECTOR_LOCATION
|
||||
seek_cache = 0xfffffff8;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
free(buf);
|
||||
if (usb_verbose) {
|
||||
@ -245,7 +245,7 @@ bool __io_uns_WriteSectors(u32 sector, u32 count, void *buffer)
|
||||
buf = (u8 *)memalign(64, 512 * amount);
|
||||
|
||||
while(done < count)
|
||||
{
|
||||
{
|
||||
whence = 0;
|
||||
if ((sec & 0x80000000)!= 0)
|
||||
{
|
||||
@ -254,13 +254,13 @@ bool __io_uns_WriteSectors(u32 sector, u32 count, void *buffer)
|
||||
}
|
||||
#ifdef CACHE_SECTOR_LOCATION
|
||||
if ((sector + done) != seek_cache)
|
||||
{
|
||||
#endif
|
||||
{
|
||||
#endif
|
||||
ISFS_Seek(fu,sec,whence);
|
||||
#ifdef CACHE_SECTOR_LOCATION
|
||||
seek_cache = sector + done;
|
||||
#ifdef CACHE_SECTOR_LOCATION
|
||||
seek_cache = sector + done;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
resultbuf = (u8*)buffer + (done * 512);
|
||||
memcpy(buf,resultbuf,512*amount);
|
||||
s32 ret = ISFS_Write(fu,buf,512*amount);
|
||||
@ -268,9 +268,9 @@ bool __io_uns_WriteSectors(u32 sector, u32 count, void *buffer)
|
||||
{
|
||||
done+=amount;
|
||||
sec = sector + done;
|
||||
#ifdef CACHE_SECTOR_LOCATION
|
||||
seek_cache = sector + done;
|
||||
#endif
|
||||
#ifdef CACHE_SECTOR_LOCATION
|
||||
seek_cache = sector + done;
|
||||
#endif
|
||||
if((count-done)<=MAX_WRITE_SECTORS)
|
||||
{
|
||||
amount = count - done;
|
||||
@ -282,13 +282,13 @@ bool __io_uns_WriteSectors(u32 sector, u32 count, void *buffer)
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef CACHE_SECTOR_LOCATION
|
||||
seek_cache = 0xfffffff8;
|
||||
#endif
|
||||
#ifdef CACHE_SECTOR_LOCATION
|
||||
seek_cache = 0xfffffff8;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
free(buf);
|
||||
if (usb_verbose) {
|
||||
printf("usb-r: %x [%d]\n", sector, count);
|
||||
@ -348,9 +348,9 @@ bool init_uneek_fs(u32 mode)
|
||||
}
|
||||
if ((pstat->file_length == 0xfffffff0)&&(pstat->file_pos == 0xfffffff8)&&(fu>=0))
|
||||
{
|
||||
#ifdef CACHE_SECTOR_LOCATION
|
||||
#ifdef CACHE_SECTOR_LOCATION
|
||||
seek_cache = 0xfffffff8;
|
||||
#endif
|
||||
#endif
|
||||
if (mode & ISFS_OPEN_WRITE)
|
||||
{
|
||||
__io_usbstorage.ioType = DEVICE_TYPE_WII_USB;
|
||||
@ -378,12 +378,12 @@ bool init_uneek_fs(u32 mode)
|
||||
free (buf);
|
||||
return true;
|
||||
}
|
||||
//sneek
|
||||
//sneek
|
||||
else if ((pstat->file_length == 0xfffffff1)&&(pstat->file_pos == 0xfffffff8)&&(fu>=0))
|
||||
{
|
||||
#ifdef CACHE_SECTOR_LOCATION
|
||||
#ifdef CACHE_SECTOR_LOCATION
|
||||
seek_cache = 0xfffffff8;
|
||||
#endif
|
||||
#endif
|
||||
uneek_fs_type = UNEEK_FS_SD;
|
||||
if (mode & ISFS_OPEN_WRITE)
|
||||
{
|
||||
@ -395,7 +395,7 @@ bool init_uneek_fs(u32 mode)
|
||||
__io_wiisd.writeSectors = (FN_MEDIUM_WRITESECTORS)&__io_uns_WriteSectors;
|
||||
__io_wiisd.clearStatus = (FN_MEDIUM_CLEARSTATUS)&__io_uns_ClearStatus;
|
||||
__io_wiisd.shutdown = (FN_MEDIUM_SHUTDOWN)&__io_uns_Shutdown;
|
||||
|
||||
|
||||
//usb and sd will be treated equally
|
||||
//needed for joyflow with the sd only setup
|
||||
|
||||
@ -498,23 +498,23 @@ bool exit_uneek_fs(void)
|
||||
}
|
||||
|
||||
|
||||
bool SenseSneek (bool isfsinit)
|
||||
{
|
||||
bool ret = true;
|
||||
char path[ISFS_MAXPATH] ATTRIBUTE_ALIGN(32);
|
||||
|
||||
strcpy (path, "/SNEEK/kernel.bin");
|
||||
|
||||
if (isfsinit) ISFS_Initialize ();
|
||||
|
||||
s32 fd = ISFS_Open(path, ISFS_OPEN_READ);
|
||||
if (fd < 0)
|
||||
ret = false;
|
||||
else
|
||||
ISFS_Close (fd);
|
||||
|
||||
if (isfsinit) ISFS_Deinitialize();
|
||||
return ret;
|
||||
bool SenseSneek (bool isfsinit)
|
||||
{
|
||||
bool ret = true;
|
||||
char path[ISFS_MAXPATH] ATTRIBUTE_ALIGN(32);
|
||||
|
||||
strcpy (path, "/SNEEK/kernel.bin");
|
||||
|
||||
if (isfsinit) ISFS_Initialize ();
|
||||
|
||||
s32 fd = ISFS_Open(path, ISFS_OPEN_READ);
|
||||
if (fd < 0)
|
||||
ret = false;
|
||||
else
|
||||
ISFS_Close (fd);
|
||||
|
||||
if (isfsinit) ISFS_Deinitialize();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -526,7 +526,7 @@ bool is_neek(void)
|
||||
if(confirm_neek1 == 5)
|
||||
{
|
||||
ES_GetBoot2Version(&boot2version);
|
||||
if(boot2version < 5)
|
||||
if(boot2version < 5)
|
||||
confirm_neek1 = false;
|
||||
else
|
||||
confirm_neek1 = true;
|
||||
@ -535,51 +535,51 @@ bool is_neek(void)
|
||||
}
|
||||
|
||||
|
||||
bool is_neek2 (bool isfsinit)
|
||||
{
|
||||
|
||||
char path[ISFS_MAXPATH] ATTRIBUTE_ALIGN(32);
|
||||
|
||||
bool is_neek2 (bool isfsinit)
|
||||
{
|
||||
|
||||
char path[ISFS_MAXPATH] ATTRIBUTE_ALIGN(32);
|
||||
|
||||
if(confirm_neek2 == 5)
|
||||
{
|
||||
confirm_neek2 = true;
|
||||
strcpy (path, "/SNEEK/kernel.bin");
|
||||
|
||||
if (isfsinit) ISFS_Initialize ();
|
||||
|
||||
s32 fd = ISFS_Open(path, ISFS_OPEN_READ);
|
||||
if (fd < 0)
|
||||
confirm_neek2 = false;
|
||||
else
|
||||
ISFS_Close (fd);
|
||||
|
||||
if (isfsinit) ISFS_Deinitialize ();
|
||||
}
|
||||
confirm_neek2 = true;
|
||||
strcpy (path, "/SNEEK/kernel.bin");
|
||||
|
||||
if (isfsinit) ISFS_Initialize ();
|
||||
|
||||
s32 fd = ISFS_Open(path, ISFS_OPEN_READ);
|
||||
if (fd < 0)
|
||||
confirm_neek2 = false;
|
||||
else
|
||||
ISFS_Close (fd);
|
||||
|
||||
if (isfsinit) ISFS_Deinitialize ();
|
||||
}
|
||||
return confirm_neek2;
|
||||
}
|
||||
|
||||
//! New method for determining if this is a real or emu nand.
|
||||
//! New method for determining if this is a real or emu nand.
|
||||
//! Works with new versions of classic Crediar NEEK
|
||||
bool is_neek3(bool isfsinit)
|
||||
{
|
||||
bool is_neek3(bool isfsinit)
|
||||
{
|
||||
u32 num = 0;
|
||||
|
||||
//! Thanks goes to the almighty giantpune for this
|
||||
//! Thanks goes to the almighty giantpune for this
|
||||
if(confirm_neek3 == 5)
|
||||
{
|
||||
if (isfsinit) ISFS_Initialize ();
|
||||
if (isfsinit) ISFS_Initialize ();
|
||||
if(ISFS_ReadDir("/Sneek", NULL, &num)==0)
|
||||
confirm_neek3 = true;
|
||||
else
|
||||
confirm_neek3 = false;
|
||||
if (isfsinit) ISFS_Deinitialize ();
|
||||
}
|
||||
confirm_neek3 = false;
|
||||
if (isfsinit) ISFS_Deinitialize ();
|
||||
}
|
||||
return confirm_neek3;
|
||||
}
|
||||
|
||||
bool is_neek4(bool isfsinit)
|
||||
{
|
||||
|
||||
bool is_neek4(bool isfsinit)
|
||||
{
|
||||
|
||||
u32 ownerID;
|
||||
u16 groupID;
|
||||
u8 attributes;
|
||||
@ -590,13 +590,13 @@ bool is_neek4(bool isfsinit)
|
||||
if(confirm_neek4 == 5)
|
||||
{
|
||||
confirm_neek4 = false;
|
||||
if(isfsinit) ISFS_Initialize();
|
||||
if(isfsinit) ISFS_Initialize();
|
||||
ISFS_GetAttr("/shared1/00000000.app", &ownerID, &groupID, &attributes, &ownerperm, &groupperm, &otherperm);
|
||||
if(otherperm)
|
||||
confirm_neek4 = true;
|
||||
|
||||
|
||||
if(isfsinit) ISFS_Deinitialize();
|
||||
}
|
||||
}
|
||||
return confirm_neek4;
|
||||
}
|
||||
|
||||
@ -613,18 +613,18 @@ bool WII_Launch_Channel(char* which)
|
||||
u32 title_lsb;
|
||||
}lsbstuff;
|
||||
|
||||
|
||||
|
||||
wlen = strlen(which);
|
||||
if ((wlen != 4) && (wlen != 16))
|
||||
{
|
||||
#ifdef SHOW_GECKO_DEBUG
|
||||
gprintf("Title %s has an invalid length\n",which);
|
||||
#endif
|
||||
gprintf("Title %s has an invalid length\n",which);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
if (wlen == 4)
|
||||
{
|
||||
titlemsb = 0x00010001;
|
||||
titlemsb = 0x00010001;
|
||||
strncpy(lsbstuff.titlename,which,4);
|
||||
titlelsb = lsbstuff.title_lsb;
|
||||
}
|
||||
@ -645,7 +645,7 @@ bool WII_Launch_Channel(char* which)
|
||||
gprintf("WII_LaunchTitle returned %d\r\n",lret);
|
||||
#else
|
||||
WII_LaunchTitle(title_id);
|
||||
#endif
|
||||
#endif
|
||||
// basically, it shouldn't get here I assume
|
||||
#endif //HW_RVL
|
||||
return false;
|
||||
|
@ -23,7 +23,7 @@ added "is_uneek" function
|
||||
|
||||
rev. 1.06 sixth draft
|
||||
added "is_neek2" and "is_neek3" functions
|
||||
Crediar changed the boot2 version back from 5 to 4.
|
||||
Crediar changed the boot2 version back from 5 to 4.
|
||||
The is_uneek function will not detect those neek versions anymore.
|
||||
Stfour created the is_neek2 method to detect if neek is running.
|
||||
JoostinOnline and GiantPune created the is_neek3 which is a little less code.
|
||||
@ -33,7 +33,7 @@ rev. 1.07 seventh draft
|
||||
added "is_neek4" function
|
||||
Dj_Skual created the is_neek4 method to detect if neek is running.
|
||||
|
||||
added WII_launch_Channel. It's not really uneek_fs related, but it could be handy
|
||||
added WII_launch_Channel. It's not really uneek_fs related, but it could be handy
|
||||
|
||||
|
||||
Copyright (C) 2011 Obcd
|
||||
@ -60,7 +60,7 @@ distribution.
|
||||
-------------------------------------------------------------*/
|
||||
|
||||
#ifndef _UNEEK_FS_H_
|
||||
#define _UNEEK_FS_H_
|
||||
#define _UNEEK_FS_H_
|
||||
|
||||
#include <ogcsys.h>
|
||||
#include <ogc/isfs.h>
|
||||
@ -81,9 +81,9 @@ bool check_uneek_fs(void);
|
||||
s32 check_uneek_fs_type(void);
|
||||
bool exit_uneek_fs(void);
|
||||
bool is_neek(void);
|
||||
bool is_neek2 (bool isfsinit);
|
||||
bool is_neek3 (bool isfsinit);
|
||||
bool is_neek4 (bool isfsinit);
|
||||
bool is_neek2 (bool isfsinit);
|
||||
bool is_neek3 (bool isfsinit);
|
||||
bool is_neek4 (bool isfsinit);
|
||||
bool WII_Launch_Channel(char* which);
|
||||
|
||||
|
||||
|
@ -22,18 +22,18 @@ bool FileExist (char *fn)
|
||||
fclose(f);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool DirExist (char *path)
|
||||
{
|
||||
DIR *dir;
|
||||
|
||||
|
||||
dir=opendir(path);
|
||||
if (dir)
|
||||
{
|
||||
closedir(dir);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -45,10 +45,10 @@ u8 *ReadFile2Buffer (char *path, size_t *filesize, int *err)
|
||||
int bytes;
|
||||
int block = 65536;
|
||||
FILE* f = NULL;
|
||||
|
||||
|
||||
if (filesize) *filesize = 0;
|
||||
if (err) *err = 0;
|
||||
|
||||
|
||||
f = fopen(path, "rb");
|
||||
if (!f)
|
||||
{
|
||||
@ -60,27 +60,27 @@ u8 *ReadFile2Buffer (char *path, size_t *filesize, int *err)
|
||||
fseek( f, 0, SEEK_END);
|
||||
size = ftell(f);
|
||||
if (filesize) *filesize = size;
|
||||
|
||||
|
||||
if (size <= 0)
|
||||
{
|
||||
if (err != NULL) *err = -2;
|
||||
fclose (f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
// Return to beginning....
|
||||
fseek( f, 0, SEEK_SET);
|
||||
|
||||
|
||||
//buff = malloc (size);
|
||||
buff = memalign(32,size);
|
||||
|
||||
if (buff == NULL)
|
||||
buff = memalign(32,size);
|
||||
|
||||
if (buff == NULL)
|
||||
{
|
||||
if (err != NULL) *err = -3;
|
||||
fclose (f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
bytes = 0;
|
||||
do
|
||||
{
|
||||
@ -89,17 +89,17 @@ u8 *ReadFile2Buffer (char *path, size_t *filesize, int *err)
|
||||
while (bytes < size);
|
||||
|
||||
fclose (f);
|
||||
|
||||
|
||||
return buff;
|
||||
}
|
||||
|
||||
/*
|
||||
this function will check if a folder "may" contain a valid nand
|
||||
*/
|
||||
*/
|
||||
bool IsNandFolder (char *path)
|
||||
{
|
||||
char npath[300];
|
||||
|
||||
|
||||
sprintf (npath, "%s/TITLE", path);
|
||||
if (!DirExist(npath)) return false;
|
||||
|
||||
@ -146,7 +146,7 @@ s32 adjust_nandpath (void)
|
||||
//nandpath.bin should have priority above root folder nand
|
||||
//isn't backwards compatibility fun?
|
||||
if(n2oSettings.neeknandpath[0] != 0)
|
||||
{
|
||||
{
|
||||
strcpy(nandpath,n2oSettings.nanddisc);
|
||||
strcat(nandpath,"/sneek/nandpath.bin");
|
||||
if (FileExist(nandpath))
|
||||
@ -183,7 +183,7 @@ s32 adjust_nandpath (void)
|
||||
strcpy(nandpath,n2oSettings.nanddisc);
|
||||
if (get_nand_folder(nandpath))
|
||||
{
|
||||
//so, if we have a valid path in nandpath.bin,
|
||||
//so, if we have a valid path in nandpath.bin,
|
||||
//use that for channel launch adjustment
|
||||
strcpy(n2oSettings.nandfolder,nandpath);
|
||||
//we have a nandpath.bin
|
||||
@ -207,12 +207,12 @@ s32 adjust_nandpath (void)
|
||||
|
||||
void create_dipath(void)
|
||||
{
|
||||
|
||||
char dipath[64];
|
||||
|
||||
char dipath[64];
|
||||
FILE *fp = NULL;
|
||||
|
||||
|
||||
strcpy(dipath,n2oSettings.nanddisc);
|
||||
strcat(dipath,"/sneek/dipath.bin");
|
||||
strcat(dipath,"/sneek/dipath.bin");
|
||||
if (FileExist(dipath))
|
||||
{
|
||||
remove(dipath);
|
||||
@ -304,8 +304,8 @@ void xml_set_default(void)
|
||||
strcpy(n2oSettings.nandfolder,"/");
|
||||
n2oSettings.neekbootchannel[0]= 0;
|
||||
n2oSettings.neekdipath[0]= 0;
|
||||
|
||||
|
||||
|
||||
|
||||
// strcpy(n2oSettings.neeknandpath,"usb://nands/nand1");
|
||||
// strcpy(n2oSettings.nanddisc,"usb:/");
|
||||
// strcpy(n2oSettings.nandfolder,"/nands/nand1");
|
||||
@ -334,7 +334,7 @@ s32 get_nand_folder(char* nandpath)
|
||||
strcpy(nandpathfile, nandpath);
|
||||
strcat(nandpathfile,"/sneek/nandpath.bin");
|
||||
nandpath[0] = 0;
|
||||
fp = fopen(nandpathfile, "rb");
|
||||
fp = fopen(nandpathfile, "rb");
|
||||
if(fp)
|
||||
{
|
||||
fseek (fp, 0, SEEK_END);
|
||||
@ -348,7 +348,7 @@ s32 get_nand_folder(char* nandpath)
|
||||
fclose (fp);
|
||||
for (counter=0;counter<len;counter++)
|
||||
{
|
||||
if ((buffer[counter] == 13)||(buffer[counter] == 10)||(buffer[counter] == 32))
|
||||
if ((buffer[counter] == 13)||(buffer[counter] == 10)||(buffer[counter] == 32))
|
||||
{
|
||||
buffer[counter] = 0;
|
||||
}
|
||||
|
@ -55,13 +55,13 @@ void CreateXmlFile(const char* filename, struct SSettingsNeek2o *Settings)
|
||||
mxmlElementSetAttr(data, "nandbootargument",Settings->nandbootargument);
|
||||
mxmlElementSetAttr(data, "neekbootargument",Settings->neekbootargument);
|
||||
|
||||
|
||||
|
||||
/*save the xml file to a file*/
|
||||
FILE *fp;
|
||||
fp = fopen(filename, "w");
|
||||
|
||||
mxmlSaveFile(xml, fp, MXML_NO_CALLBACK);
|
||||
|
||||
|
||||
/*clean up*/
|
||||
fclose(fp);
|
||||
mxmlDelete(data);
|
||||
@ -79,8 +79,8 @@ int LoadXmlFile(const char* filename, struct SSettingsNeek2o *Settings)
|
||||
//u32 last,teller;
|
||||
/*Load our xml file! */
|
||||
fp = fopen(filename, "r");
|
||||
|
||||
if (fp==NULL)
|
||||
|
||||
if (fp==NULL)
|
||||
{
|
||||
//WindowPrompt(filename, "Fehler", "Back",0);
|
||||
fclose(fp);
|
||||
@ -92,7 +92,7 @@ int LoadXmlFile(const char* filename, struct SSettingsNeek2o *Settings)
|
||||
/*Load and printf our values! */
|
||||
/* As a note, its a good idea to normally check if node* is NULL */
|
||||
data = mxmlFindElement(tree, tree, "neek2oconfig", NULL, NULL, MXML_DESCEND);
|
||||
|
||||
|
||||
//snprintf(Settings->type,8,"%s",mxmlElementGetAttr(data,"type"));
|
||||
snprintf(Settings->neeknandpath,64,"%s",mxmlElementGetAttr(data,"neeknandpath"));
|
||||
snprintf(Settings->neekdipath,64,"%s",mxmlElementGetAttr(data,"neekdipath"));
|
||||
@ -106,14 +106,14 @@ int LoadXmlFile(const char* filename, struct SSettingsNeek2o *Settings)
|
||||
snprintf(Settings->neekbootdescription,80,"%s",mxmlElementGetAttr(data,"neekbootdescription"));
|
||||
snprintf(Settings->nandbootargument,80,"%s",mxmlElementGetAttr(data,"nandbootargument"));
|
||||
snprintf(Settings->neekbootargument,80,"%s",mxmlElementGetAttr(data,"neekbootargument"));
|
||||
|
||||
|
||||
//strcpy(Settings->SMB_PWD,mxmlElementGetAttr(data,"password"));
|
||||
//snprintf(Settings->SMB_PWD,64,"%s",mxmlElementGetAttr(data,"password"));
|
||||
//strcpy(Settings->SMB_SHARE,mxmlElementGetAttr(data,"smbsharename"));
|
||||
//snprintf(Settings->SMB_SHARE,64,"%s",mxmlElementGetAttr(data,"smbsharename"));
|
||||
//strcpy(Settings->SMB_IP,(char*)mxmlElementGetAttr(data,"smbip"));
|
||||
//snprintf(Settings->SMB_IP,20,"%s",mxmlElementGetAttr(data,"smbip"));
|
||||
|
||||
//strcpy(Settings->SMB_IP,(char*)mxmlElementGetAttr(data,"smbip"));
|
||||
//snprintf(Settings->SMB_IP,20,"%s",mxmlElementGetAttr(data,"smbip"));
|
||||
|
||||
mxmlDelete(data);
|
||||
mxmlDelete(tree);
|
||||
|
||||
@ -125,7 +125,7 @@ int LoadXmlFile(const char* filename, struct SSettingsNeek2o *Settings)
|
||||
for (counter=0;counter<3;counter++)
|
||||
{
|
||||
temppath[counter] = toupper((int)(temppath[counter]));
|
||||
}
|
||||
}
|
||||
if (strncmp(temppath,"USB",3)==0)
|
||||
{
|
||||
strcpy(Settings->nanddisc,"usb1:/");
|
||||
|
@ -48,13 +48,13 @@ void CreateXmlFile(const char* filename, struct SSettingsNeek2o *Settings)
|
||||
|
||||
mxmlElementSetAttr(data, "neekbootchannel",Settings->neekbootchannel);
|
||||
mxmlElementSetAttr(data, "neekselection",Settings->neekselection);
|
||||
|
||||
|
||||
/*save the xml file to a file*/
|
||||
FILE *fp;
|
||||
fp = fopen(filename, "w");
|
||||
|
||||
mxmlSaveFile(xml, fp, MXML_NO_CALLBACK);
|
||||
|
||||
|
||||
/*clean up*/
|
||||
fclose(fp);
|
||||
mxmlDelete(data);
|
||||
@ -69,8 +69,8 @@ int LoadXmlFile(const char* filename, struct SSettingsNeek2o *Settings)
|
||||
//u32 last,teller;
|
||||
/*Load our xml file! */
|
||||
fp = fopen(filename, "r");
|
||||
|
||||
if (fp==NULL)
|
||||
|
||||
if (fp==NULL)
|
||||
{
|
||||
//WindowPrompt(filename, "Fehler", "Back",0);
|
||||
fclose(fp);
|
||||
@ -82,7 +82,7 @@ int LoadXmlFile(const char* filename, struct SSettingsNeek2o *Settings)
|
||||
/*Load and printf our values! */
|
||||
/* As a note, its a good idea to normally check if node* is NULL */
|
||||
data = mxmlFindElement(tree, tree, "neek2oconfig", NULL, NULL, MXML_DESCEND);
|
||||
|
||||
|
||||
snprintf(Settings->type,8,"%s",mxmlElementGetAttr(data,"type"));
|
||||
snprintf(Settings->neeknandpath,64,"%s",mxmlElementGetAttr(data,"neeknandpath"));
|
||||
snprintf(Settings->neekdipath,64,"%s",mxmlElementGetAttr(data,"neekdipath"));
|
||||
@ -92,14 +92,14 @@ int LoadXmlFile(const char* filename, struct SSettingsNeek2o *Settings)
|
||||
snprintf(Settings->neekbootapplication,64,"%s",mxmlElementGetAttr(data,"neekbootapplication"));
|
||||
snprintf(Settings->neekbootchannel,16,"%s",mxmlElementGetAttr(data,"neekbootchannel"));
|
||||
snprintf(Settings->neekselection,2,"%s",mxmlElementGetAttr(data,"neekselection"));
|
||||
|
||||
|
||||
//strcpy(Settings->SMB_PWD,mxmlElementGetAttr(data,"password"));
|
||||
//snprintf(Settings->SMB_PWD,64,"%s",mxmlElementGetAttr(data,"password"));
|
||||
//strcpy(Settings->SMB_SHARE,mxmlElementGetAttr(data,"smbsharename"));
|
||||
//snprintf(Settings->SMB_SHARE,64,"%s",mxmlElementGetAttr(data,"smbsharename"));
|
||||
//strcpy(Settings->SMB_IP,(char*)mxmlElementGetAttr(data,"smbip"));
|
||||
//snprintf(Settings->SMB_IP,20,"%s",mxmlElementGetAttr(data,"smbip"));
|
||||
|
||||
//strcpy(Settings->SMB_IP,(char*)mxmlElementGetAttr(data,"smbip"));
|
||||
//snprintf(Settings->SMB_IP,20,"%s",mxmlElementGetAttr(data,"smbip"));
|
||||
|
||||
mxmlDelete(data);
|
||||
mxmlDelete(tree);
|
||||
|
||||
|
@ -39,7 +39,7 @@ int read_gecko_data(int s, /* connected socket */
|
||||
int bcount; /* counts bytes read */
|
||||
int br; /* bytes read this pass */
|
||||
u32 t;
|
||||
|
||||
|
||||
t = ticks_to_millisecs(gettime()) + timeout;
|
||||
|
||||
bcount= 0;
|
||||
@ -50,7 +50,7 @@ int read_gecko_data(int s, /* connected socket */
|
||||
{
|
||||
bcount += br; /* increment byte counter */
|
||||
buf += br; /* move buffer ptr for next read */
|
||||
|
||||
|
||||
}
|
||||
else if (br < 0) /* signal an error to the caller */
|
||||
{
|
||||
@ -91,9 +91,9 @@ static void * gecko_l_callback(void *arg)
|
||||
u8 *bfr[READ_SIZE];
|
||||
u32 tms;
|
||||
bool compress = false;
|
||||
|
||||
|
||||
channel = EXI_CHANNEL_1;
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
if(geckoHalt)
|
||||
@ -105,14 +105,14 @@ static void * gecko_l_callback(void *arg)
|
||||
else
|
||||
{
|
||||
//gprintf("wiiload_gecko thread running\n");
|
||||
int temp = usb_recvbuffer_safe_ex(channel,(char *)&read,4,100);
|
||||
int temp = usb_recvbuffer_safe_ex(channel,(char *)&read,4,100);
|
||||
if(temp == 4)
|
||||
{
|
||||
|
||||
|
||||
gprintf("4 bytes received from usb buffer\n");
|
||||
GuiImage * progressImg = new GuiImage(new GuiImageData(Theme.progress));
|
||||
progressImg->SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
|
||||
|
||||
GXColor ImgColor[4];
|
||||
|
||||
ImgColor[0] = (GXColor){Theme.progressbar_color1_1, Theme.progressbar_color1_2, Theme.progressbar_color1_3, 200}; // oben links
|
||||
@ -120,70 +120,70 @@ static void * gecko_l_callback(void *arg)
|
||||
ImgColor[2] = (GXColor){Theme.progressbar_color2_1, Theme.progressbar_color2_2, Theme.progressbar_color2_3, 200}; // unten rechts
|
||||
ImgColor[3] = ImgColor[2]; // unten links
|
||||
|
||||
|
||||
|
||||
GuiImage * progressbarImg = new GuiImage(0, 38, (GXColor *) &ImgColor);
|
||||
progressbarImg->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
||||
progressbarImg->SetPosition((screenwidth - progressImg->GetWidth()) /2 +36, 2);
|
||||
|
||||
|
||||
GuiText * PercentTxt = new GuiText("0%", 20, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
PercentTxt->SetAlignment(ALIGN_RIGHT, ALIGN_MIDDLE);
|
||||
PercentTxt->SetPosition(-((screenwidth - progressImg->GetWidth()) /2 +36), 38);
|
||||
|
||||
|
||||
|
||||
float Percent = 0.0f;
|
||||
|
||||
|
||||
HaltGui();
|
||||
mainWindow->SetState(STATE_DISABLED);
|
||||
mainWindow->Append(progressImg);
|
||||
mainWindow->Append(progressbarImg);
|
||||
mainWindow->Append(PercentTxt);
|
||||
ResumeGui();
|
||||
|
||||
|
||||
if(read == 1212242008) // 1212242008 -> 48415858 -> HAXX -> wiiload
|
||||
{
|
||||
compress = true;
|
||||
// printf("HAXX\n");
|
||||
|
||||
|
||||
gprintf("reading version\n");
|
||||
|
||||
|
||||
read_gecko_data(channel, (char *)&read, 4,1000);
|
||||
// int WIILOAD_VERSION_MAYOR = (u8)(((u16)(read >> 16)) >> 8);
|
||||
// int WIILOAD_VERSION_MINOR = (u8)(((u16)(read >> 16)) & 0xFF);
|
||||
// int a = (u8)(((u16)(read & 0xFFFF)) >> 8);
|
||||
// int b = (u8)(((u16)(read & 0xFFFF)) & 0xFF);
|
||||
|
||||
|
||||
// printf("wiiload v%x.%x\n", WIILOAD_VERSION_MAYOR, WIILOAD_VERSION_MINOR);
|
||||
// printf("args %x08\n", read);
|
||||
// printf("args a=%x b=%x\n", a, b);
|
||||
|
||||
|
||||
gprintf("reading size\n");
|
||||
|
||||
read_gecko_data(channel, (char *)&size, 4, 1000);
|
||||
|
||||
|
||||
gprintf("reading uncompressed size\n");
|
||||
|
||||
|
||||
read_gecko_data(channel, (char *)&uncfilesize, 4, 1000);
|
||||
}
|
||||
else
|
||||
size = read;
|
||||
|
||||
|
||||
offset = 0;
|
||||
while(offset < size && (read = read_gecko_data(channel, (char *)bfr, (size - offset) > READ_SIZE ? READ_SIZE : (size - offset), 2000)) > 0)
|
||||
{
|
||||
gprintf("finished reading block at offset %x\n",offset);
|
||||
gprintf("finished reading block at offset %x\n",offset);
|
||||
memcpy(gdata + offset, bfr, READ_SIZE);
|
||||
offset += read;
|
||||
|
||||
|
||||
Percent = 100.0f * offset/size;
|
||||
progressbarImg->SetSize(Percent*3.27f, 38);
|
||||
|
||||
|
||||
char buffer[6];
|
||||
sprintf(buffer, "%i %%", (int)Percent);
|
||||
PercentTxt->SetText(buffer);
|
||||
}
|
||||
if (offset >= size)
|
||||
{
|
||||
//again, free gift from postloader
|
||||
//again, free gift from postloader
|
||||
|
||||
// These are the arguments....
|
||||
tms = ticks_to_millisecs(gettime());
|
||||
@ -203,9 +203,9 @@ static void * gecko_l_callback(void *arg)
|
||||
u8 *zdata = (u8 *) malloc(uncfilesize);
|
||||
if(!zdata)
|
||||
return NULL;
|
||||
|
||||
|
||||
uLongf zdatalen = uncfilesize;
|
||||
|
||||
|
||||
int res = uncompress (zdata, &zdatalen, gdata, (uLongf)size);
|
||||
|
||||
if (res != Z_OK)
|
||||
@ -221,13 +221,13 @@ static void * gecko_l_callback(void *arg)
|
||||
// free(zdata);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CopyHomebrewMemory(gdata, 0, size);
|
||||
if(gdata)
|
||||
free(gdata);
|
||||
// if(zdata)
|
||||
// free(zdata);
|
||||
|
||||
|
||||
mainWindow->Remove(PercentTxt);
|
||||
mainWindow->Remove(progressbarImg);
|
||||
mainWindow->Remove(progressImg);
|
||||
@ -248,7 +248,7 @@ static void * gecko_l_callback(void *arg)
|
||||
mainWindow->Remove(progressImg);
|
||||
mainWindow->SetState(STATE_DEFAULT);
|
||||
ResumeGui();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -66,12 +66,12 @@ void OnScreenCodeboard(char * var, u16 maxlen)
|
||||
while(save == -1)
|
||||
{
|
||||
usleep(100);
|
||||
|
||||
|
||||
if(strlen(codeboard.kbtextstr) == 4)
|
||||
okBtn.SetClickable(true);
|
||||
else
|
||||
okBtn.SetClickable(false);
|
||||
|
||||
|
||||
if(okBtn.GetState() == STATE_CLICKED)
|
||||
save = 1;
|
||||
else if(cancelBtn.GetState() == STATE_CLICKED)
|
||||
|
@ -21,7 +21,7 @@ string AddApp(const char *AppName)
|
||||
{
|
||||
bool stop = true;
|
||||
string kategoriename = AvailableCategory.categories[kategorieInt];
|
||||
|
||||
|
||||
GuiTrigger trigA;
|
||||
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
|
||||
GuiTrigger trigB;
|
||||
@ -99,26 +99,26 @@ string AddApp(const char *AppName)
|
||||
kategorieInt++;
|
||||
if ( kategorieInt >= (signed)AvailableCategory.categories.size() )
|
||||
kategorieInt = 1;
|
||||
|
||||
|
||||
kategoriename = AvailableCategory.categories[kategorieInt];
|
||||
zeile3Txt.SetText(kategoriename.c_str());
|
||||
HaltResumeGui();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_L)
|
||||
{
|
||||
kategorieInt--;
|
||||
if ( kategorieInt < 1 )
|
||||
kategorieInt = AvailableCategory.categories.size() -1;
|
||||
|
||||
|
||||
kategoriename = AvailableCategory.categories[kategorieInt];
|
||||
zeile3Txt.SetText(kategoriename.c_str());
|
||||
HaltResumeGui();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(ok.GetState() == STATE_CLICKED)
|
||||
stop = false;
|
||||
|
||||
|
||||
if(back.GetState() == STATE_CLICKED)
|
||||
{
|
||||
kategoriename = "NULL";
|
||||
@ -130,7 +130,7 @@ string AddApp(const char *AppName)
|
||||
mainWindow->Remove(&promptWindow);
|
||||
mainWindow->SetState(STATE_DEFAULT);
|
||||
ResumeGui();
|
||||
|
||||
|
||||
return kategoriename;
|
||||
}
|
||||
|
||||
|
@ -28,11 +28,11 @@ MetaEdit(string dir)
|
||||
|
||||
dir += "meta.xml";
|
||||
string line, quelltext;
|
||||
|
||||
|
||||
ifstream in(dir.c_str());
|
||||
while(getline(in, line))
|
||||
quelltext += line + "\n";
|
||||
|
||||
|
||||
GuiWindow promptWindow(520,360);
|
||||
promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
promptWindow.SetPosition(0, -10);
|
||||
@ -58,15 +58,15 @@ MetaEdit(string dir)
|
||||
upTxt.SetFont(symbol_ttf, symbol_ttf_size);
|
||||
upTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
upTxt.SetPosition(0, y -20);
|
||||
|
||||
|
||||
GuiText downTxt("d", 22, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
downTxt.SetFont(symbol_ttf, symbol_ttf_size);
|
||||
downTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
downTxt.SetPosition(0, y + (place * (number-1)) + 15);
|
||||
|
||||
|
||||
GuiButton * Entrie[number];
|
||||
GuiText * EntrieTxt[number];
|
||||
|
||||
|
||||
for(i=0; i < number && i < (signed)meta.line.size(); i++)
|
||||
{
|
||||
EntrieTxt[i] = new GuiText(meta.line[i].c_str(), 18, (GXColor) {Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
@ -99,16 +99,16 @@ MetaEdit(string dir)
|
||||
|
||||
promptWindow.Append(&dialogBoxImg);
|
||||
promptWindow.Append(&titleTxt);
|
||||
|
||||
|
||||
for(int x=0; x < i; x++)
|
||||
promptWindow.Append(Entrie[x]);
|
||||
|
||||
|
||||
if((signed)meta.line.size() >= number)
|
||||
{
|
||||
promptWindow.Append(&upTxt);
|
||||
promptWindow.Append(&downTxt);
|
||||
}
|
||||
|
||||
|
||||
promptWindow.Append(&back);
|
||||
|
||||
HaltGui();
|
||||
@ -124,66 +124,66 @@ MetaEdit(string dir)
|
||||
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP)
|
||||
{
|
||||
startline = meta.text_up();
|
||||
|
||||
|
||||
for(int x=0; x < i; x++)
|
||||
EntrieTxt[x]->SetText(meta.line[x + startline].c_str());
|
||||
|
||||
|
||||
HaltResumeGui();
|
||||
}
|
||||
|
||||
|
||||
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN)
|
||||
{
|
||||
startline = meta.text_down(number);
|
||||
|
||||
|
||||
for(int x=0; x < i; x++)
|
||||
EntrieTxt[x]->SetText(meta.line[x + startline].c_str());
|
||||
|
||||
|
||||
HaltResumeGui();
|
||||
}
|
||||
|
||||
if(back.GetState() == STATE_CLICKED)
|
||||
choice = 0;
|
||||
|
||||
|
||||
for(int x=0; x < i; x++)
|
||||
{
|
||||
if(Entrie[x]->GetState() == STATE_CLICKED)
|
||||
{
|
||||
Entrie[x]->ResetState();
|
||||
|
||||
|
||||
string temp = meta.line[x + startline];
|
||||
while((signed)temp.find("\n") != -1)
|
||||
temp.replace(temp.find("\n"), 1, "¶");
|
||||
|
||||
|
||||
char new_text[256];
|
||||
sprintf (new_text, "%s", temp.c_str());
|
||||
OnScreenKeyboard(new_text, 256, true);
|
||||
|
||||
|
||||
mainWindow->SetState(STATE_DISABLED);
|
||||
promptWindow.SetState(STATE_DEFAULT);
|
||||
|
||||
|
||||
if(strcasecmp(new_text,"NULL") != 0 )
|
||||
{
|
||||
changed = true;
|
||||
meta.line[x + startline] = new_text;
|
||||
while((signed)meta.line[x + startline].find("¶") != -1)
|
||||
meta.line[x + startline].replace(meta.line[x + startline].find("¶"), 1, "\n");
|
||||
|
||||
|
||||
EntrieTxt[x]->SetText(meta.line[x + startline].c_str());
|
||||
|
||||
|
||||
quelltext.clear();
|
||||
for(int a = 0; a < (signed)meta.line.size(); a++)
|
||||
quelltext += meta.line[a];
|
||||
|
||||
|
||||
meta.text(quelltext, 18, 440);
|
||||
for(int x=0; x < i; x++)
|
||||
EntrieTxt[x]->SetText(meta.line[x + startline].c_str());
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(changed)
|
||||
{
|
||||
ofstream datei(dir.c_str());
|
||||
|
@ -20,7 +20,7 @@ string eraseCategory()
|
||||
bool stop = true;
|
||||
int kategorieInt = 1;
|
||||
string kategoriename = AvailableCategory.categories[kategorieInt];
|
||||
|
||||
|
||||
GuiTrigger trigA;
|
||||
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
|
||||
GuiTrigger trigB;
|
||||
@ -42,7 +42,7 @@ string eraseCategory()
|
||||
GuiText zeile2Txt(AvailableCategory.categories[1].c_str(), 24, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
zeile2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
zeile2Txt.SetPosition(0, -10);
|
||||
|
||||
|
||||
GuiText zeile4Txt(tr("Select Category (-/+)"), 22, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
zeile4Txt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
zeile4Txt.SetPosition(0, 60);
|
||||
@ -93,26 +93,26 @@ string eraseCategory()
|
||||
kategorieInt++;
|
||||
if ( kategorieInt >= (signed)AvailableCategory.categories.size() )
|
||||
kategorieInt = 1;
|
||||
|
||||
|
||||
kategoriename = AvailableCategory.categories[kategorieInt];
|
||||
zeile2Txt.SetText(kategoriename.c_str());
|
||||
HaltResumeGui();
|
||||
}
|
||||
|
||||
|
||||
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_L)
|
||||
{
|
||||
kategorieInt--;
|
||||
if ( kategorieInt < 1 )
|
||||
kategorieInt = AvailableCategory.categories.size() -1;
|
||||
|
||||
|
||||
kategoriename = AvailableCategory.categories[kategorieInt];
|
||||
zeile2Txt.SetText(kategoriename.c_str());
|
||||
HaltResumeGui();
|
||||
}
|
||||
|
||||
|
||||
if(ok.GetState() == STATE_CLICKED)
|
||||
stop = false;
|
||||
|
||||
|
||||
if(back.GetState() == STATE_CLICKED)
|
||||
{
|
||||
kategoriename = "NULL";
|
||||
@ -124,7 +124,7 @@ string eraseCategory()
|
||||
mainWindow->Remove(&promptWindow);
|
||||
mainWindow->SetState(STATE_DEFAULT);
|
||||
ResumeGui();
|
||||
|
||||
|
||||
return kategoriename;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ bool eraseDir(const char *AppName)
|
||||
{
|
||||
bool stop = true;
|
||||
bool auswahl = false;
|
||||
|
||||
|
||||
GuiWindow promptWindow(520,360);
|
||||
promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
promptWindow.SetPosition(0, -10);
|
||||
@ -35,17 +35,17 @@ bool eraseDir(const char *AppName)
|
||||
GuiText zeile2Txt(tr("Delete Forever?"), 22, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
zeile2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
zeile2Txt.SetPosition(0,-10);
|
||||
|
||||
|
||||
// image
|
||||
GuiImageData btn(Theme.button_small);
|
||||
GuiImage btn1Img(&btn);
|
||||
GuiImage btn2Img(&btn);
|
||||
|
||||
|
||||
// image over
|
||||
GuiImageData btn_over(Theme.button_small_focus);
|
||||
GuiImage btn1ImgOver(&btn_over);
|
||||
GuiImage btn2ImgOver(&btn_over);
|
||||
|
||||
|
||||
// papierkorb
|
||||
GuiImageData recycle_bin_data(Theme.recycle_bin);
|
||||
GuiImage recycle_bin(&recycle_bin_data);
|
||||
@ -90,13 +90,13 @@ bool eraseDir(const char *AppName)
|
||||
while(stop)
|
||||
{
|
||||
usleep(100);
|
||||
|
||||
|
||||
if(btn1.GetState() == STATE_CLICKED)
|
||||
{
|
||||
auswahl = true;
|
||||
stop = false;
|
||||
}
|
||||
|
||||
|
||||
if(btn2.GetState() == STATE_CLICKED)
|
||||
stop = false;
|
||||
}
|
||||
@ -105,7 +105,7 @@ bool eraseDir(const char *AppName)
|
||||
mainWindow->Remove(&promptWindow);
|
||||
mainWindow->SetState(STATE_DEFAULT);
|
||||
ResumeGui();
|
||||
|
||||
|
||||
return auswahl;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ void fontDownload(string fontname)
|
||||
promptWindow.SetPosition(0, -10);
|
||||
GuiTrigger trigA;
|
||||
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
|
||||
|
||||
|
||||
|
||||
GuiImageData dialogBox(Theme.dialog_background);
|
||||
GuiImage dialogBoxImg(&dialogBox);
|
||||
@ -44,11 +44,11 @@ void fontDownload(string fontname)
|
||||
GuiImageData btnOutline(Theme.button_small);
|
||||
GuiImage btn1Img(&btnOutline);
|
||||
GuiImage btn2Img(&btnOutline);
|
||||
|
||||
|
||||
GuiImageData btnOutlineOver(Theme.button_small_focus);
|
||||
GuiImage btn1ImgOver(&btnOutlineOver);
|
||||
GuiImage btn2ImgOver(&btnOutlineOver);
|
||||
|
||||
|
||||
GuiText titleTxt(tr("Download"), 26, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
titleTxt.SetPosition(0, 40);
|
||||
@ -64,7 +64,7 @@ void fontDownload(string fontname)
|
||||
GuiButton btn1(btnOutline.GetWidth(), btnOutline.GetHeight());
|
||||
|
||||
btn1.SetAlignment(ALIGN_CENTRE, ALIGN_BOTTOM);
|
||||
btn1.SetPosition(0, -25);
|
||||
btn1.SetPosition(0, -25);
|
||||
btn1.SetLabel(&btn1Txt);
|
||||
btn1.SetImage(&btn1Img);
|
||||
btn1.SetImageOver(&btn1ImgOver);
|
||||
@ -86,7 +86,7 @@ void fontDownload(string fontname)
|
||||
|
||||
char buffer[100];
|
||||
msgTxt.SetText(fontname.c_str());
|
||||
sprintf(buffer, "http://www.nanolx.org/hbf/Fonts/%s", fontname.c_str());
|
||||
sprintf(buffer, "http://www.nanolx.org/hbf/Fonts/%s", fontname.c_str());
|
||||
struct block file = downloadfile(buffer);
|
||||
if (file.data && file.size > 0 && folder_exists())
|
||||
{
|
||||
@ -99,7 +99,7 @@ void fontDownload(string fontname)
|
||||
}
|
||||
if(file.data)
|
||||
free(file.data);
|
||||
|
||||
|
||||
msgTxt.SetText("");
|
||||
downloadTxt.SetText(tr("finished"));
|
||||
|
||||
@ -124,29 +124,29 @@ string FontList()
|
||||
{
|
||||
string downloadfont = "error";
|
||||
bool stop = false;
|
||||
|
||||
|
||||
char buffer[100];
|
||||
sprintf(buffer, "http://www.nanolx.org/hbf/Fonts/");
|
||||
sprintf(buffer, "http://www.nanolx.org/hbf/Fonts/");
|
||||
|
||||
struct block file = downloadfile(buffer);
|
||||
if (file.data != NULL)
|
||||
{
|
||||
string source_fonts = (char*)file.data;
|
||||
vector<string> fonts;
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
if((signed)source_fonts.find("../Fonts/") == -1)
|
||||
break;
|
||||
|
||||
|
||||
source_fonts.erase(0, source_fonts.find("../Fonts/"));
|
||||
source_fonts.erase(0, source_fonts.find("s/") +2);
|
||||
|
||||
|
||||
fonts.push_back(source_fonts.substr(0, source_fonts.find("\"")));
|
||||
|
||||
|
||||
source_fonts.erase(0, source_fonts.find("<"));
|
||||
}
|
||||
|
||||
|
||||
free(file.data);
|
||||
|
||||
GuiText titleTxt(tr("Download"), 26, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
@ -169,7 +169,7 @@ string FontList()
|
||||
int selection = 0;
|
||||
int textScrollPos = 0;
|
||||
int selctionPos = y;
|
||||
|
||||
|
||||
GuiText selectionTxt(">> <<", 20, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
selectionTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
selectionTxt.SetPosition(0, y);
|
||||
@ -178,14 +178,14 @@ string FontList()
|
||||
upTxt.SetFont(symbol_ttf, symbol_ttf_size);
|
||||
upTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
upTxt.SetPosition(0, y -20);
|
||||
|
||||
|
||||
GuiText downTxt("d", 22, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
downTxt.SetFont(symbol_ttf, symbol_ttf_size);
|
||||
downTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
downTxt.SetPosition(0, y + (place * (number-1)) + 15);
|
||||
|
||||
|
||||
GuiText * Entrie[number];
|
||||
|
||||
|
||||
for(i=0; i < number && i < (signed)fonts.size(); i++)
|
||||
{
|
||||
Entrie[i] = new GuiText(fonts[i].c_str(), 20, (GXColor) {Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
@ -198,10 +198,10 @@ string FontList()
|
||||
promptWindow.Append(&dialogBoxImg);
|
||||
promptWindow.Append(&titleTxt);
|
||||
promptWindow.Append(&selectionTxt);
|
||||
|
||||
|
||||
for(int x=0; x < i; x++)
|
||||
promptWindow.Append(Entrie[x]);
|
||||
|
||||
|
||||
if((signed)fonts.size() >= number)
|
||||
{
|
||||
promptWindow.Append(&upTxt);
|
||||
@ -218,7 +218,7 @@ string FontList()
|
||||
while(!stop)
|
||||
{
|
||||
usleep(100);
|
||||
|
||||
|
||||
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP)
|
||||
{
|
||||
selection--;
|
||||
@ -228,15 +228,15 @@ string FontList()
|
||||
textScrollPos--;
|
||||
if(textScrollPos < 0)
|
||||
textScrollPos = 0;
|
||||
|
||||
|
||||
for(int x=0; x < number && x < (signed)fonts.size(); x++)
|
||||
Entrie[x]->SetText(fonts[x + textScrollPos].c_str());
|
||||
}
|
||||
selectionTxt.SetPosition(0, selection * place + selctionPos);
|
||||
|
||||
|
||||
HaltResumeGui();
|
||||
}
|
||||
|
||||
|
||||
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN)
|
||||
{
|
||||
selection++;
|
||||
@ -248,12 +248,12 @@ string FontList()
|
||||
textScrollPos++;
|
||||
if(textScrollPos > (signed)fonts.size() - number)
|
||||
textScrollPos = fonts.size() - number;
|
||||
|
||||
|
||||
for(int x=0; x < number && x < (signed)fonts.size(); x++)
|
||||
Entrie[x]->SetText(fonts[x + textScrollPos].c_str());
|
||||
}
|
||||
selectionTxt.SetPosition(0, selection * place + selctionPos);
|
||||
|
||||
|
||||
HaltResumeGui();
|
||||
}
|
||||
|
||||
@ -262,7 +262,7 @@ string FontList()
|
||||
downloadfont = fonts[selection + textScrollPos];
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B)
|
||||
{
|
||||
downloadfont = "NULL";
|
||||
@ -277,7 +277,7 @@ string FontList()
|
||||
mainWindow->SetState(STATE_DEFAULT);
|
||||
ResumeGui();
|
||||
}
|
||||
|
||||
|
||||
return downloadfont;
|
||||
}
|
||||
|
||||
@ -292,10 +292,10 @@ string checkFontsPrompt()
|
||||
|
||||
GuiImageData btnOutline(Theme.button_small);
|
||||
GuiImage btn1Img(&btnOutline);
|
||||
|
||||
|
||||
GuiImageData btnOutlineOver(Theme.button_small_focus);
|
||||
GuiImage btn1ImgOver(&btnOutlineOver);
|
||||
|
||||
|
||||
// ok button
|
||||
GuiText backTxt(tr("OK"), 22, (GXColor){Theme.button_small_text_1, Theme.button_small_text_2, Theme.button_small_text_3, 255});
|
||||
GuiImage backImg(&btnOutline);
|
||||
@ -303,7 +303,7 @@ string checkFontsPrompt()
|
||||
GuiButton back(btnOutline.GetWidth(), btnOutline.GetHeight());
|
||||
GuiTrigger trigA;
|
||||
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
|
||||
|
||||
|
||||
back.SetAlignment(ALIGN_CENTRE, ALIGN_BOTTOM);
|
||||
back.SetPosition(0, -25);
|
||||
back.SetLabel(&backTxt);
|
||||
@ -335,12 +335,12 @@ string checkFontsPrompt()
|
||||
{
|
||||
msgTxt.SetText(tr("No network connection"));
|
||||
bool stop = false;
|
||||
|
||||
|
||||
promptWindow.Append(&back);
|
||||
while(!stop)
|
||||
{
|
||||
usleep(100);
|
||||
|
||||
|
||||
if(back.GetState() == STATE_CLICKED)
|
||||
stop = true;
|
||||
}
|
||||
@ -354,12 +354,12 @@ string checkFontsPrompt()
|
||||
downloadfont = "NULL";
|
||||
msgTxt.SetText(tr("Error while reading file"));
|
||||
bool stop = false;
|
||||
|
||||
|
||||
promptWindow.Append(&back);
|
||||
while(!stop)
|
||||
{
|
||||
usleep(100);
|
||||
|
||||
|
||||
if(back.GetState() == STATE_CLICKED)
|
||||
stop = true;
|
||||
}
|
||||
@ -371,6 +371,6 @@ string checkFontsPrompt()
|
||||
mainWindow->Remove(&promptWindow);
|
||||
mainWindow->SetState(STATE_DEFAULT);
|
||||
ResumeGui();
|
||||
|
||||
|
||||
return downloadfont;
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ infoPrompt()
|
||||
Entrie[i]->SetPosition(x,y);
|
||||
i++;
|
||||
y += 32;
|
||||
|
||||
|
||||
Entrie[i] = new GuiText("- Dimok", 20, (GXColor) {Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
Entrie[i]->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
||||
Entrie[i]->SetPosition(x+50,y);
|
||||
@ -97,21 +97,21 @@ infoPrompt()
|
||||
|
||||
char Rev[50];
|
||||
sprintf(Rev, "Rev. %i", SvnRev());
|
||||
|
||||
|
||||
GuiText RevTxt(Rev, 20, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
RevTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
||||
RevTxt.SetPosition(30,24);
|
||||
|
||||
|
||||
char RunsIos[50];
|
||||
if((*(volatile unsigned int*)HW_ARMIRQMASK)&&(*(volatile unsigned int*)HW_ARMIRQFLAG))
|
||||
sprintf(RunsIos, "IOS %i Rev. %i (HW_AHBPROT)", IOS_GetVersion(), IOS_GetRevision());
|
||||
else
|
||||
sprintf(RunsIos, "IOS %i Rev. %i", IOS_GetVersion(), IOS_GetRevision());
|
||||
|
||||
|
||||
GuiText RunsIosTxt(RunsIos, 14, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
RunsIosTxt.SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
|
||||
RunsIosTxt.SetPosition(-30,24);
|
||||
|
||||
|
||||
GuiText backTxt(tr("Back"), 24, (GXColor){Theme.button_tiny_text_1, Theme.button_tiny_text_2, Theme.button_tiny_text_3, 255});
|
||||
GuiImage backImg(&btnOutline);
|
||||
GuiImage backImgOver(&btnOutlineOver);
|
||||
@ -125,10 +125,10 @@ infoPrompt()
|
||||
back.SetTrigger(&trigB);
|
||||
|
||||
promptWindow.Append(&dialogBoxImg);
|
||||
|
||||
|
||||
for(int i = 0; i < CreditEntries; i++)
|
||||
promptWindow.Append(Entrie[i]);
|
||||
|
||||
|
||||
promptWindow.Append(&RevTxt);
|
||||
promptWindow.Append(&RunsIosTxt);
|
||||
promptWindow.Append(&back);
|
||||
|
@ -36,7 +36,7 @@ void languageDownload(string languagename)
|
||||
promptWindow.SetPosition(0, -10);
|
||||
GuiTrigger trigA;
|
||||
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
|
||||
|
||||
|
||||
|
||||
GuiImageData dialogBox(Theme.dialog_background);
|
||||
GuiImage dialogBoxImg(&dialogBox);
|
||||
@ -44,11 +44,11 @@ void languageDownload(string languagename)
|
||||
GuiImageData btnOutline(Theme.button_small);
|
||||
GuiImage btn1Img(&btnOutline);
|
||||
GuiImage btn2Img(&btnOutline);
|
||||
|
||||
|
||||
GuiImageData btnOutlineOver(Theme.button_small_focus);
|
||||
GuiImage btn1ImgOver(&btnOutlineOver);
|
||||
GuiImage btn2ImgOver(&btnOutlineOver);
|
||||
|
||||
|
||||
GuiText titleTxt(tr("Download"), 26, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
titleTxt.SetPosition(0, 40);
|
||||
@ -64,7 +64,7 @@ void languageDownload(string languagename)
|
||||
GuiButton btn1(btnOutline.GetWidth(), btnOutline.GetHeight());
|
||||
|
||||
btn1.SetAlignment(ALIGN_CENTRE, ALIGN_BOTTOM);
|
||||
btn1.SetPosition(0, -25);
|
||||
btn1.SetPosition(0, -25);
|
||||
btn1.SetLabel(&btn1Txt);
|
||||
btn1.SetImage(&btn1Img);
|
||||
btn1.SetImageOver(&btn1ImgOver);
|
||||
@ -86,7 +86,7 @@ void languageDownload(string languagename)
|
||||
|
||||
char buffer[100];
|
||||
msgTxt.SetText(languagename.c_str());
|
||||
sprintf(buffer, "http://www.nanolx.org/hbf/Languages/%s", languagename.c_str());
|
||||
sprintf(buffer, "http://www.nanolx.org/hbf/Languages/%s", languagename.c_str());
|
||||
struct block file = downloadfile(buffer);
|
||||
if (file.data && file.size > 0 && folder_exists())
|
||||
{
|
||||
@ -99,7 +99,7 @@ void languageDownload(string languagename)
|
||||
}
|
||||
if(file.data)
|
||||
free(file.data);
|
||||
|
||||
|
||||
msgTxt.SetText("");
|
||||
downloadTxt.SetText(tr("finished"));
|
||||
|
||||
@ -124,29 +124,29 @@ string LanguageList()
|
||||
{
|
||||
string downloadlanguage = "error";
|
||||
bool stop = false;
|
||||
|
||||
|
||||
char buffer[100];
|
||||
sprintf(buffer, "http://www.nanolx.org/hbf/Languages/");
|
||||
sprintf(buffer, "http://www.nanolx.org/hbf/Languages/");
|
||||
|
||||
struct block file = downloadfile(buffer);
|
||||
if (file.data != NULL)
|
||||
{
|
||||
string source_languages = (char*)file.data;
|
||||
vector<string> languages;
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
if((signed)source_languages.find("../Languages/") == -1)
|
||||
break;
|
||||
|
||||
|
||||
source_languages.erase(0, source_languages.find("../Languages/"));
|
||||
source_languages.erase(0, source_languages.find("s/") +2);
|
||||
|
||||
|
||||
languages.push_back(source_languages.substr(0, source_languages.find("\"")));
|
||||
|
||||
|
||||
source_languages.erase(0, source_languages.find("<"));
|
||||
}
|
||||
|
||||
|
||||
free(file.data);
|
||||
|
||||
GuiText titleTxt(tr("Download"), 26, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
@ -169,7 +169,7 @@ string LanguageList()
|
||||
int selection = 0;
|
||||
int textScrollPos = 0;
|
||||
int selctionPos = y;
|
||||
|
||||
|
||||
GuiText selectionTxt(">> <<", 20, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
selectionTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
selectionTxt.SetPosition(0, y);
|
||||
@ -178,14 +178,14 @@ string LanguageList()
|
||||
upTxt.SetFont(symbol_ttf, symbol_ttf_size);
|
||||
upTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
upTxt.SetPosition(0, y -20);
|
||||
|
||||
|
||||
GuiText downTxt("d", 22, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
downTxt.SetFont(symbol_ttf, symbol_ttf_size);
|
||||
downTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
downTxt.SetPosition(0, y + (place * (number-1)) + 15);
|
||||
|
||||
|
||||
GuiText * Entrie[number];
|
||||
|
||||
|
||||
for(i=0; i < number && i < (signed)languages.size(); i++)
|
||||
{
|
||||
Entrie[i] = new GuiText(languages[i].c_str(), 20, (GXColor) {Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
@ -199,10 +199,10 @@ string LanguageList()
|
||||
promptWindow.Append(&dialogBoxImg);
|
||||
promptWindow.Append(&titleTxt);
|
||||
promptWindow.Append(&selectionTxt);
|
||||
|
||||
|
||||
for(int x=0; x < i; x++)
|
||||
promptWindow.Append(Entrie[x]);
|
||||
|
||||
|
||||
if((signed)languages.size() >= number)
|
||||
{
|
||||
promptWindow.Append(&upTxt);
|
||||
@ -219,7 +219,7 @@ string LanguageList()
|
||||
while(!stop)
|
||||
{
|
||||
usleep(100);
|
||||
|
||||
|
||||
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP)
|
||||
{
|
||||
selection--;
|
||||
@ -229,15 +229,15 @@ string LanguageList()
|
||||
textScrollPos--;
|
||||
if(textScrollPos < 0)
|
||||
textScrollPos = 0;
|
||||
|
||||
|
||||
for(int x=0; x < number && x < (signed)languages.size(); x++)
|
||||
Entrie[x]->SetText(languages[x + textScrollPos].c_str());
|
||||
}
|
||||
selectionTxt.SetPosition(0, selection * place + selctionPos);
|
||||
|
||||
|
||||
HaltResumeGui();
|
||||
}
|
||||
|
||||
|
||||
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN)
|
||||
{
|
||||
selection++;
|
||||
@ -249,12 +249,12 @@ string LanguageList()
|
||||
textScrollPos++;
|
||||
if(textScrollPos > (signed)languages.size() - number)
|
||||
textScrollPos = languages.size() - number;
|
||||
|
||||
|
||||
for(int x=0; x < number && x < (signed)languages.size(); x++)
|
||||
Entrie[x]->SetText(languages[x + textScrollPos].c_str());
|
||||
}
|
||||
selectionTxt.SetPosition(0, selection * place + selctionPos);
|
||||
|
||||
|
||||
HaltResumeGui();
|
||||
}
|
||||
|
||||
@ -263,7 +263,7 @@ string LanguageList()
|
||||
downloadlanguage = languages[selection + textScrollPos];
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B)
|
||||
{
|
||||
downloadlanguage = "NULL";
|
||||
@ -278,7 +278,7 @@ string LanguageList()
|
||||
mainWindow->SetState(STATE_DEFAULT);
|
||||
ResumeGui();
|
||||
}
|
||||
|
||||
|
||||
return downloadlanguage;
|
||||
}
|
||||
|
||||
@ -293,10 +293,10 @@ string checkLanguagesPrompt()
|
||||
|
||||
GuiImageData btnOutline(Theme.button_small);
|
||||
GuiImage btn1Img(&btnOutline);
|
||||
|
||||
|
||||
GuiImageData btnOutlineOver(Theme.button_small_focus);
|
||||
GuiImage btn1ImgOver(&btnOutlineOver);
|
||||
|
||||
|
||||
// ok button
|
||||
GuiText backTxt(tr("OK"), 22, (GXColor){Theme.button_small_text_1, Theme.button_small_text_2, Theme.button_small_text_3, 255});
|
||||
GuiImage backImg(&btnOutline);
|
||||
@ -304,7 +304,7 @@ string checkLanguagesPrompt()
|
||||
GuiButton back(btnOutline.GetWidth(), btnOutline.GetHeight());
|
||||
GuiTrigger trigA;
|
||||
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
|
||||
|
||||
|
||||
back.SetAlignment(ALIGN_CENTRE, ALIGN_BOTTOM);
|
||||
back.SetPosition(0, -25);
|
||||
back.SetLabel(&backTxt);
|
||||
@ -336,12 +336,12 @@ string checkLanguagesPrompt()
|
||||
{
|
||||
msgTxt.SetText(tr("No network connection"));
|
||||
bool stop = false;
|
||||
|
||||
|
||||
promptWindow.Append(&back);
|
||||
while(!stop)
|
||||
{
|
||||
usleep(100);
|
||||
|
||||
|
||||
if(back.GetState() == STATE_CLICKED)
|
||||
stop = true;
|
||||
}
|
||||
@ -355,12 +355,12 @@ string checkLanguagesPrompt()
|
||||
downloadlanguage = "NULL";
|
||||
msgTxt.SetText(tr("Error while reading file"));
|
||||
bool stop = false;
|
||||
|
||||
|
||||
promptWindow.Append(&back);
|
||||
while(!stop)
|
||||
{
|
||||
usleep(100);
|
||||
|
||||
|
||||
if(back.GetState() == STATE_CLICKED)
|
||||
stop = true;
|
||||
}
|
||||
@ -372,6 +372,6 @@ string checkLanguagesPrompt()
|
||||
mainWindow->Remove(&promptWindow);
|
||||
mainWindow->SetState(STATE_DEFAULT);
|
||||
ResumeGui();
|
||||
|
||||
|
||||
return downloadlanguage;
|
||||
}
|
||||
|
@ -43,15 +43,15 @@ void MoveCategory(int moveCategoryNr, string &Kategorie1, bool &vor, string &Kat
|
||||
GuiText zeile2Txt(tr("Move"), 22, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
zeile2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
zeile2Txt.SetPosition(0, -70);
|
||||
|
||||
|
||||
GuiText zeile3_1Txt("< >", 22, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
zeile3_1Txt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
zeile3_1Txt.SetPosition(0, -30);
|
||||
|
||||
|
||||
GuiText zeile3_2Txt(tr("before"), 22, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
zeile3_2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
zeile3_2Txt.SetPosition(0, -30);
|
||||
|
||||
|
||||
GuiText zeile4Txt("c", 30, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
zeile4Txt.SetFont(symbol_ttf, symbol_ttf_size);
|
||||
zeile4Txt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
@ -115,43 +115,43 @@ void MoveCategory(int moveCategoryNr, string &Kategorie1, bool &vor, string &Kat
|
||||
{
|
||||
vor = false;
|
||||
zeile3_2Txt.SetText(tr("after"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_L)
|
||||
{
|
||||
vor = true;
|
||||
zeile3_2Txt.SetText(tr("before"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP)
|
||||
{
|
||||
CategoryInt--;
|
||||
|
||||
|
||||
if ( CategoryInt < 1 )
|
||||
CategoryInt = AvailableCategory.categories.size() -1;
|
||||
|
||||
|
||||
zeile5Txt.SetText(AvailableCategory.categories[CategoryInt].c_str());
|
||||
HaltResumeGui();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN)
|
||||
{
|
||||
CategoryInt++;
|
||||
|
||||
|
||||
if (CategoryInt == (signed)AvailableCategory.categories.size())
|
||||
CategoryInt = 1;
|
||||
|
||||
|
||||
zeile5Txt.SetText(AvailableCategory.categories[CategoryInt].c_str());
|
||||
HaltResumeGui();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(ok.GetState() == STATE_CLICKED)
|
||||
{
|
||||
Kategorie1 = AvailableCategory.categories[moveCategoryNr];
|
||||
Kategorie2 = AvailableCategory.categories[CategoryInt];
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
if(back.GetState() == STATE_CLICKED)
|
||||
stop = true;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ bool RemoveApp(const char *AppName)
|
||||
{
|
||||
bool stop = true;
|
||||
bool auswahl = false;
|
||||
|
||||
|
||||
GuiTrigger trigA;
|
||||
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
|
||||
GuiTrigger trigB;
|
||||
@ -39,7 +39,7 @@ bool RemoveApp(const char *AppName)
|
||||
|
||||
GuiText zeile2Txt(tr("Really remove?"), 22, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
zeile2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
|
||||
|
||||
GuiText okTxt(tr("Yes"), 22, (GXColor){Theme.button_small_text_1, Theme.button_small_text_2, Theme.button_small_text_3, 255});
|
||||
GuiImage okImg(&btnOutline);
|
||||
GuiImage okImgOver(&btnOutlineOver);
|
||||
@ -79,13 +79,13 @@ bool RemoveApp(const char *AppName)
|
||||
while(stop)
|
||||
{
|
||||
usleep(100);
|
||||
|
||||
|
||||
if(ok.GetState() == STATE_CLICKED)
|
||||
{
|
||||
auswahl = true;
|
||||
stop = false;
|
||||
}
|
||||
|
||||
|
||||
if(back.GetState() == STATE_CLICKED)
|
||||
stop = false;
|
||||
}
|
||||
@ -94,7 +94,7 @@ bool RemoveApp(const char *AppName)
|
||||
mainWindow->Remove(&promptWindow);
|
||||
mainWindow->SetState(STATE_DEFAULT);
|
||||
ResumeGui();
|
||||
|
||||
|
||||
return auswahl;
|
||||
}
|
||||
|
||||
|
@ -48,14 +48,14 @@ revtext(const char *msg)
|
||||
upTxt.SetFont(symbol_ttf, symbol_ttf_size);
|
||||
upTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
upTxt.SetPosition(0, y -20);
|
||||
|
||||
|
||||
GuiText downTxt("d", 22, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
downTxt.SetFont(symbol_ttf, symbol_ttf_size);
|
||||
downTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
downTxt.SetPosition(0, y + (place * (number-1)) + 15);
|
||||
|
||||
|
||||
GuiText * Entrie[number];
|
||||
|
||||
|
||||
for(i=0; i < number && i < (signed)revtext.line.size(); i++)
|
||||
{
|
||||
Entrie[i] = new GuiText(revtext.line[i].c_str(), 20, (GXColor) {Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
@ -84,16 +84,16 @@ revtext(const char *msg)
|
||||
|
||||
promptWindow.Append(&dialogBoxImg);
|
||||
promptWindow.Append(&titleTxt);
|
||||
|
||||
|
||||
for(int x=0; x < i; x++)
|
||||
promptWindow.Append(Entrie[x]);
|
||||
|
||||
|
||||
if((signed)revtext.line.size() >= number)
|
||||
{
|
||||
promptWindow.Append(&upTxt);
|
||||
promptWindow.Append(&downTxt);
|
||||
}
|
||||
|
||||
|
||||
promptWindow.Append(&back);
|
||||
|
||||
HaltGui();
|
||||
@ -109,18 +109,18 @@ revtext(const char *msg)
|
||||
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP)
|
||||
{
|
||||
int z = revtext.text_up();
|
||||
|
||||
|
||||
for(int x=0; x < i; x++)
|
||||
Entrie[x]->SetText(revtext.line[x + z].c_str());
|
||||
|
||||
|
||||
|
||||
HaltResumeGui();
|
||||
}
|
||||
|
||||
|
||||
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN)
|
||||
{
|
||||
int z = revtext.text_down(number);
|
||||
|
||||
|
||||
for(int x=0; x < i; x++)
|
||||
Entrie[x]->SetText(revtext.line[x + z].c_str());
|
||||
|
||||
|
@ -39,7 +39,7 @@ int sortPrompt()
|
||||
GuiImage btn3Img(&btn);
|
||||
GuiImage btn4Img(&btn);
|
||||
GuiImage backImg(&btn);
|
||||
|
||||
|
||||
// Buttons over data
|
||||
GuiImageData btn_over(Theme.button_small_focus);
|
||||
GuiImage btn1ImgOver(&btn_over);
|
||||
@ -56,7 +56,7 @@ int sortPrompt()
|
||||
btn1.SetImage(&btn1Img);
|
||||
btn1.SetImageOver(&btn1ImgOver);
|
||||
btn1.SetTrigger(&trigA);
|
||||
|
||||
|
||||
GuiText btn2Txt(tr("Name ( Z - A )"), 22, (GXColor){Theme.button_small_text_1, Theme.button_small_text_2, Theme.button_small_text_3, 255});
|
||||
GuiButton btn2(btn.GetWidth(), btn.GetHeight());
|
||||
btn2.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
@ -65,7 +65,7 @@ int sortPrompt()
|
||||
btn2.SetImage(&btn2Img);
|
||||
btn2.SetImageOver(&btn2ImgOver);
|
||||
btn2.SetTrigger(&trigA);
|
||||
|
||||
|
||||
GuiText btn3Txt(tr("Folder ( A - Z )"), 22, (GXColor){Theme.button_small_text_1, Theme.button_small_text_2, Theme.button_small_text_3, 255});
|
||||
GuiButton btn3(btn.GetWidth(), btn.GetHeight());
|
||||
btn3.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
@ -74,7 +74,7 @@ int sortPrompt()
|
||||
btn3.SetImage(&btn3Img);
|
||||
btn3.SetImageOver(&btn3ImgOver);
|
||||
btn3.SetTrigger(&trigA);
|
||||
|
||||
|
||||
GuiText btn4Txt(tr("Folder ( Z - A )"), 22, (GXColor){Theme.button_small_text_1, Theme.button_small_text_2, Theme.button_small_text_3, 255});
|
||||
GuiButton btn4(btn.GetWidth(), btn.GetHeight());
|
||||
btn4.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
@ -83,7 +83,7 @@ int sortPrompt()
|
||||
btn4.SetImage(&btn4Img);
|
||||
btn4.SetImageOver(&btn4ImgOver);
|
||||
btn4.SetTrigger(&trigA);
|
||||
|
||||
|
||||
GuiText backTxt(tr("Back"), 22, (GXColor){Theme.button_small_text_1, Theme.button_small_text_2, Theme.button_small_text_3, 255});
|
||||
GuiButton back(btn.GetWidth(), btn.GetHeight());
|
||||
back.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
@ -117,25 +117,25 @@ int sortPrompt()
|
||||
device = NAME_A_Z;
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
if(btn2.GetState() == STATE_CLICKED)
|
||||
{
|
||||
device = NAME_Z_A;
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
if(btn3.GetState() == STATE_CLICKED)
|
||||
{
|
||||
device = FOLDERNAME_A_Z;
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
if(btn4.GetState() == STATE_CLICKED)
|
||||
{
|
||||
device = FOLDERNAME_Z_A;
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
if(back.GetState() == STATE_CLICKED)
|
||||
stop = true;
|
||||
}
|
||||
|
@ -51,21 +51,21 @@ int systemPrompt()
|
||||
GuiImage wii_BtnImgOver(&wii_BtnImgDataOver);
|
||||
GuiImage gc_BtnImgOver(&gc_BtnImgDataOver);
|
||||
GuiImage wii_gc_BtnImgOver(&wii_gc_BtnImgDataOver);
|
||||
|
||||
|
||||
GuiButton wii_Btn(wii_BtnImgData.GetWidth(), wii_BtnImgData.GetHeight());
|
||||
wii_Btn.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
||||
wii_Btn.SetPosition(8, 0);
|
||||
wii_Btn.SetImage(&wii_BtnImg);
|
||||
wii_Btn.SetImageOver(&wii_BtnImgOver);
|
||||
wii_Btn.SetTrigger(&trigA);
|
||||
|
||||
|
||||
GuiButton gc_Btn(gc_BtnImgData.GetWidth(), gc_BtnImgData.GetHeight());
|
||||
gc_Btn.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
gc_Btn.SetPosition(0, 0);
|
||||
gc_Btn.SetImage(&gc_BtnImg);
|
||||
gc_Btn.SetImageOver(&gc_BtnImgOver);
|
||||
gc_Btn.SetTrigger(&trigA);
|
||||
|
||||
|
||||
GuiButton wii_gc_Btn(wii_gc_BtnImgData.GetWidth(), wii_gc_BtnImgData.GetHeight());
|
||||
wii_gc_Btn.SetAlignment(ALIGN_RIGHT, ALIGN_MIDDLE);
|
||||
wii_gc_Btn.SetPosition(-8, 0);
|
||||
@ -97,19 +97,19 @@ int systemPrompt()
|
||||
system = 0;
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
if(gc_Btn.GetState() == STATE_CLICKED)
|
||||
{
|
||||
system = 1;
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
if(wii_gc_Btn.GetState() == STATE_CLICKED)
|
||||
{
|
||||
system = 2;
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
if(back.GetState() == STATE_CLICKED)
|
||||
stop = true;
|
||||
}
|
||||
@ -118,7 +118,7 @@ int systemPrompt()
|
||||
mainWindow->Remove(&promptWindow);
|
||||
mainWindow->SetState(STATE_DEFAULT);
|
||||
ResumeGui();
|
||||
|
||||
|
||||
return system;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ updatePrompt(string rev)
|
||||
promptWindow.SetPosition(0, -10);
|
||||
GuiTrigger trigA;
|
||||
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
|
||||
|
||||
|
||||
|
||||
GuiImageData dialogBox(Theme.dialog_background);
|
||||
GuiImage dialogBoxImg(&dialogBox);
|
||||
@ -50,11 +50,11 @@ updatePrompt(string rev)
|
||||
GuiImageData btnOutline(Theme.button_small);
|
||||
GuiImage btn1Img(&btnOutline);
|
||||
GuiImage btn2Img(&btnOutline);
|
||||
|
||||
|
||||
GuiImageData btnOutlineOver(Theme.button_small_focus);
|
||||
GuiImage btn1ImgOver(&btnOutlineOver);
|
||||
GuiImage btn2ImgOver(&btnOutlineOver);
|
||||
|
||||
|
||||
GuiText titleTxt(tr("Update"), 26, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
titleTxt.SetPosition(0, 40);
|
||||
@ -70,7 +70,7 @@ updatePrompt(string rev)
|
||||
GuiButton btn1(btnOutline.GetWidth(), btnOutline.GetHeight());
|
||||
|
||||
btn1.SetAlignment(ALIGN_LEFT, ALIGN_BOTTOM);
|
||||
btn1.SetPosition(20, -25);
|
||||
btn1.SetPosition(20, -25);
|
||||
btn1.SetLabel(&btn1Txt);
|
||||
btn1.SetImage(&btn1Img);
|
||||
btn1.SetImageOver(&btn1ImgOver);
|
||||
@ -82,7 +82,7 @@ updatePrompt(string rev)
|
||||
GuiButton btn2(btnOutline.GetWidth(), btnOutline.GetHeight());
|
||||
|
||||
btn2.SetAlignment(ALIGN_RIGHT, ALIGN_BOTTOM);
|
||||
btn2.SetPosition(-20, -25);
|
||||
btn2.SetPosition(-20, -25);
|
||||
btn2.SetLabel(&btn2Txt);
|
||||
btn2.SetImage(&btn2Img);
|
||||
btn2.SetImageOver(&btn2ImgOver);
|
||||
@ -137,7 +137,7 @@ updatePrompt(string rev)
|
||||
if(file.data)
|
||||
free(file.data);
|
||||
}
|
||||
|
||||
|
||||
HaltGui();
|
||||
mainWindow->Remove(&promptWindow);
|
||||
mainWindow->SetState(STATE_DEFAULT);
|
||||
@ -148,7 +148,7 @@ string choiceRev(string revs)
|
||||
{
|
||||
bool stop = false;
|
||||
string rev = "NULL";
|
||||
|
||||
|
||||
TextLine versions;
|
||||
versions.list(revs);
|
||||
|
||||
@ -171,7 +171,7 @@ string choiceRev(string revs)
|
||||
int number = 5;
|
||||
int selection = 0;
|
||||
int selctionPos = y;
|
||||
|
||||
|
||||
GuiText selectionTxt(">> <<", 20, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
selectionTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
selectionTxt.SetPosition(0, y);
|
||||
@ -180,14 +180,14 @@ string choiceRev(string revs)
|
||||
upTxt.SetFont(symbol_ttf, symbol_ttf_size);
|
||||
upTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
upTxt.SetPosition(0, y -20);
|
||||
|
||||
|
||||
GuiText downTxt("d", 22, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
downTxt.SetFont(symbol_ttf, symbol_ttf_size);
|
||||
downTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
downTxt.SetPosition(0, y + (place * (number-1)) + 15);
|
||||
|
||||
|
||||
GuiText * Entrie[number];
|
||||
|
||||
|
||||
for(i=0; i < number && i < (signed)versions.line.size(); i++)
|
||||
{
|
||||
Entrie[i] = new GuiText(versions.line[i].c_str(), 20, (GXColor) {Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
@ -199,10 +199,10 @@ string choiceRev(string revs)
|
||||
promptWindow.Append(&dialogBoxImg);
|
||||
promptWindow.Append(&titleTxt);
|
||||
promptWindow.Append(&selectionTxt);
|
||||
|
||||
|
||||
for(int x=0; x < i; x++)
|
||||
promptWindow.Append(Entrie[x]);
|
||||
|
||||
|
||||
if((signed)versions.line.size() >= number)
|
||||
{
|
||||
promptWindow.Append(&upTxt);
|
||||
@ -219,39 +219,39 @@ string choiceRev(string revs)
|
||||
while(!stop)
|
||||
{
|
||||
usleep(100);
|
||||
|
||||
|
||||
if(WPAD_ButtonsHeld(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP)
|
||||
{
|
||||
|
||||
|
||||
selection--;
|
||||
if(selection < 0)
|
||||
{
|
||||
selection = 0;
|
||||
|
||||
|
||||
int z = versions.text_up();
|
||||
for(int x=0; x < i; x++)
|
||||
Entrie[x]->SetText(versions.line[x + z].c_str());
|
||||
}
|
||||
selectionTxt.SetPosition(0, selection * place + selctionPos);
|
||||
|
||||
|
||||
HaltResumeGui();
|
||||
usleep(100000);
|
||||
}
|
||||
|
||||
|
||||
if(WPAD_ButtonsHeld(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN)
|
||||
{
|
||||
|
||||
|
||||
selection++;
|
||||
if(selection > number -1)
|
||||
{
|
||||
selection = number -1;
|
||||
|
||||
|
||||
int z = versions.text_down(number);
|
||||
for(int x=0; x < i; x++)
|
||||
Entrie[x]->SetText(versions.line[x + z].c_str());
|
||||
}
|
||||
selectionTxt.SetPosition(0, selection * place + selctionPos);
|
||||
|
||||
|
||||
HaltResumeGui();
|
||||
usleep(100000);
|
||||
}
|
||||
@ -261,7 +261,7 @@ string choiceRev(string revs)
|
||||
rev = versions.line[selection + versions.textScrollPos];
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B)
|
||||
stop = true;
|
||||
}
|
||||
@ -286,10 +286,10 @@ string checkUpdatePrompt()
|
||||
|
||||
GuiImageData btnOutline(Theme.button_small);
|
||||
GuiImage btn1Img(&btnOutline);
|
||||
|
||||
|
||||
GuiImageData btnOutlineOver(Theme.button_small_focus);
|
||||
GuiImage btn1ImgOver(&btnOutlineOver);
|
||||
|
||||
|
||||
// ok button
|
||||
GuiText backTxt(tr("OK"), 22, (GXColor){Theme.button_small_text_1, Theme.button_small_text_2, Theme.button_small_text_3, 255});
|
||||
GuiImage backImg(&btnOutline);
|
||||
@ -297,7 +297,7 @@ string checkUpdatePrompt()
|
||||
GuiButton back(btnOutline.GetWidth(), btnOutline.GetHeight());
|
||||
GuiTrigger trigA;
|
||||
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
|
||||
|
||||
|
||||
back.SetAlignment(ALIGN_CENTRE, ALIGN_BOTTOM);
|
||||
back.SetPosition(0, -25);
|
||||
back.SetLabel(&backTxt);
|
||||
@ -329,12 +329,12 @@ string checkUpdatePrompt()
|
||||
{
|
||||
msgTxt.SetText(tr("No network connection"));
|
||||
bool stop = false;
|
||||
|
||||
|
||||
promptWindow.Append(&back);
|
||||
while(!stop)
|
||||
{
|
||||
usleep(100);
|
||||
|
||||
|
||||
if(back.GetState() == STATE_CLICKED)
|
||||
stop = true;
|
||||
}
|
||||
@ -347,12 +347,12 @@ string checkUpdatePrompt()
|
||||
{
|
||||
msgTxt.SetText(tr("Error while reading file"));
|
||||
bool stop = false;
|
||||
|
||||
|
||||
promptWindow.Append(&back);
|
||||
while(!stop)
|
||||
{
|
||||
usleep(100);
|
||||
|
||||
|
||||
if(back.GetState() == STATE_CLICKED)
|
||||
stop = true;
|
||||
}
|
||||
@ -361,7 +361,7 @@ string checkUpdatePrompt()
|
||||
else
|
||||
rev = choiceRev(revs);
|
||||
}
|
||||
|
||||
|
||||
HaltGui();
|
||||
mainWindow->Remove(&promptWindow);
|
||||
mainWindow->SetState(STATE_DEFAULT);
|
||||
|
@ -27,17 +27,17 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label, const ch
|
||||
promptWindow.SetPosition(0, -10);
|
||||
GuiTrigger trigA;
|
||||
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
|
||||
|
||||
|
||||
|
||||
GuiImageData dialogBox(Theme.dialog_background);
|
||||
GuiImage dialogBoxImg(&dialogBox);
|
||||
|
||||
GuiImageData btnOutline(Theme.button_small);
|
||||
GuiImage btn1Img(&btnOutline);
|
||||
|
||||
|
||||
GuiImageData btnOutlineOver(Theme.button_small_focus);
|
||||
GuiImage btn1ImgOver(&btnOutlineOver);
|
||||
|
||||
|
||||
GuiText titleTxt(title, 26, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
|
||||
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
titleTxt.SetPosition(0,40);
|
||||
|
@ -29,7 +29,7 @@ bool SetupDefaultFont(const char *path)
|
||||
{
|
||||
bool result = false;
|
||||
FILE *pfile = NULL;
|
||||
|
||||
|
||||
ClearFontData();
|
||||
|
||||
if(path)
|
||||
|
@ -10,7 +10,7 @@ void Screenshot()
|
||||
int i = 0;
|
||||
bool stop = false;
|
||||
char temp[100];
|
||||
|
||||
|
||||
DIR *pDir;
|
||||
bool Exists = false;
|
||||
|
||||
@ -34,12 +34,12 @@ void Screenshot()
|
||||
FILE * f= fopen (temp,"r");
|
||||
if (!f)
|
||||
stop = true;
|
||||
else
|
||||
else
|
||||
i++;
|
||||
|
||||
|
||||
fclose(f); // dann ging's. Also wieder zu damit
|
||||
}
|
||||
|
||||
|
||||
TakeScreenshot(temp);
|
||||
}
|
||||
}
|
@ -97,8 +97,8 @@ void add(string device, string apps_path)
|
||||
force_reload[0] = '/';
|
||||
force_reload[1] = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
size_t amount_read;
|
||||
FILE *fp = fopen(iconpath.c_str(),"r"); //open the png file
|
||||
if(fp) //make sure the file exists
|
||||
|
@ -13,17 +13,17 @@ void AvailableCategoryLoad(string pfad)
|
||||
s32 fd;
|
||||
static fstats filestats ATTRIBUTE_ALIGN(32);
|
||||
static u8 filearray[1024] ATTRIBUTE_ALIGN(32);
|
||||
|
||||
|
||||
fd = ISFS_Open(pfad.c_str(), ISFS_OPEN_READ);
|
||||
if (fd <= 0)
|
||||
ISFS_Close(fd);
|
||||
|
||||
|
||||
ISFS_GetFileStats(fd, &filestats);
|
||||
|
||||
|
||||
ISFS_Read(fd, filearray, filestats.file_length);
|
||||
|
||||
|
||||
ISFS_Close(fd);
|
||||
|
||||
|
||||
string line, source, temp;
|
||||
istringstream in((char*)filearray);
|
||||
while(getline(in, line))
|
||||
@ -59,7 +59,7 @@ void AvailableCategoryLoad(string pfad)
|
||||
transform(temp2.begin(), temp2.end(), temp2.begin(),::tolower); // in kleinebuchstaben umwandeln
|
||||
AvailableCategory.apps[i].push_back(temp2);
|
||||
temp.erase(0,temp.find("*") +1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ void AvailableCategorySave(string pfad)
|
||||
if (file > 0)
|
||||
{
|
||||
stringstream save_category;
|
||||
|
||||
|
||||
// alle Kategorien durchlaufen außer "Alle"
|
||||
for(int i = 1; i < (signed)AvailableCategory.categories.size(); i++)
|
||||
{
|
||||
@ -84,17 +84,17 @@ void AvailableCategorySave(string pfad)
|
||||
// Zeilenumbruch nach Kategorie
|
||||
save_category << endl;
|
||||
}
|
||||
|
||||
|
||||
char *pbuf = NULL;
|
||||
unsigned int psize = save_category.str().size();
|
||||
|
||||
pbuf = (char*)memalign( 32, sizeof(char) *psize );
|
||||
memset( pbuf, 0, sizeof(char) *psize );
|
||||
|
||||
|
||||
char text[psize];
|
||||
sprintf(text, "%s", save_category.str().c_str());
|
||||
strcpy(pbuf, text);
|
||||
|
||||
|
||||
ISFS_Write(file, pbuf, sizeof(char) *psize);
|
||||
}
|
||||
ISFS_Close(file);
|
||||
@ -133,14 +133,14 @@ void KategorieEinfuegen(string Kategorie)
|
||||
void KategorieEntfernen(string Kategorie)
|
||||
{
|
||||
int del_nr = 0;
|
||||
|
||||
|
||||
if(AvailableCategory.categories[KategorieNr(Kategorie)] == Kategorie)
|
||||
del_nr = KategorieNr(Kategorie);
|
||||
del_nr = KategorieNr(Kategorie);
|
||||
|
||||
vector<string>::iterator pos = find(AvailableCategory.categories.begin(), AvailableCategory.categories.end(), Kategorie);
|
||||
if ( pos != AvailableCategory.categories.end() )
|
||||
{
|
||||
AvailableCategory.categories.erase(pos);
|
||||
AvailableCategory.categories.erase(pos);
|
||||
for(int i = del_nr; i < (signed)AvailableCategory.categories.size() +1; i++)
|
||||
AvailableCategory.apps[i] = AvailableCategory.apps[i +1];
|
||||
}
|
||||
@ -149,7 +149,7 @@ void KategorieEntfernen(string Kategorie)
|
||||
void KategorieUmbenennen(string suchen, string ersetzen)
|
||||
{
|
||||
if(KategorieNr(suchen) != -1)
|
||||
AvailableCategory.categories[KategorieNr(suchen)] = ersetzen;
|
||||
AvailableCategory.categories[KategorieNr(suchen)] = ersetzen;
|
||||
}
|
||||
|
||||
void KategorieVerschieben(string Kategorie1, bool vor, string Kategorie2)
|
||||
@ -160,7 +160,7 @@ void KategorieVerschieben(string Kategorie1, bool vor, string Kategorie2)
|
||||
// apps temporär speichen und Kategorie entfernen
|
||||
vector<string> temp_apps = AvailableCategory.apps[a];
|
||||
KategorieEntfernen(Kategorie1);
|
||||
|
||||
|
||||
vector<string>::iterator pos = find(AvailableCategory.categories.begin(), AvailableCategory.categories.end(), Kategorie2);
|
||||
if(vor)
|
||||
AvailableCategory.categories.insert(pos, Kategorie1);
|
||||
@ -189,7 +189,7 @@ void KategorieVerschieben(string Kategorie1, bool vor, string Kategorie2)
|
||||
AvailableCategory.apps[a].clear();
|
||||
// apps befüllen
|
||||
for(int i = 0; i < (signed)temp_apps.size(); i++)
|
||||
AvailableCategory.apps[a].push_back(temp_apps[i]);
|
||||
AvailableCategory.apps[a].push_back(temp_apps[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,9 +199,9 @@ void AppEinfuegen(string Kategorie, string App)
|
||||
App.erase(App.find_last_of("/"));
|
||||
if((signed)App.find_last_of("/") != -1)
|
||||
App.erase(0,App.find_last_of("/") +1);
|
||||
|
||||
|
||||
// kategorie auswählen
|
||||
|
||||
|
||||
int i = KategorieNr(Kategorie);
|
||||
if(i != -1)
|
||||
{
|
||||
@ -224,7 +224,7 @@ void AppEntfernen(string Kategorie, string App)
|
||||
if((signed)App.find_last_of("/") != -1)
|
||||
App.erase(0,App.find_last_of("/") +1);
|
||||
std::transform(App.begin(),App.end(),App.begin(),::tolower); // in kleinebuchstaben umwandeln
|
||||
|
||||
|
||||
// Kategorie auswählen
|
||||
int i = KategorieNr(Kategorie);
|
||||
if(i != -1)
|
||||
@ -232,7 +232,7 @@ void AppEntfernen(string Kategorie, string App)
|
||||
// überprüfen, ob App in Kategorie ist
|
||||
vector<string>::iterator pos = find(AvailableCategory.apps[i].begin(), AvailableCategory.apps[i].end(), App);
|
||||
if ( pos != AvailableCategory.apps[i].end() )
|
||||
AvailableCategory.apps[i].erase(pos);
|
||||
AvailableCategory.apps[i].erase(pos);
|
||||
}
|
||||
}
|
||||
|
||||
@ -256,7 +256,7 @@ void AppVerschieben(string Kategorie, string AppOrdner1, bool vor, string AppOrd
|
||||
vector<string>::iterator pos = find(AvailableCategory.apps[i].begin(), AvailableCategory.apps[i].end(), AppOrdner1);
|
||||
if ( pos != AvailableCategory.apps[i].end() )
|
||||
AvailableCategory.apps[i].erase(pos);
|
||||
|
||||
|
||||
if(vor)
|
||||
{
|
||||
pos = find(AvailableCategory.apps[i].begin(), AvailableCategory.apps[i].end(), AppOrdner2);
|
||||
|
@ -6,7 +6,7 @@
|
||||
void DeleteDir(const char* dirname){
|
||||
DIR *hdir;
|
||||
struct dirent *entry;
|
||||
|
||||
|
||||
hdir = opendir(dirname);
|
||||
do
|
||||
{
|
||||
@ -18,7 +18,7 @@ void DeleteDir(const char* dirname){
|
||||
if(remove(erase) == -1)
|
||||
DeleteDir(erase);
|
||||
remove(erase);
|
||||
}
|
||||
}
|
||||
} while (entry);
|
||||
closedir(hdir);
|
||||
remove(dirname);
|
||||
|
@ -11,9 +11,9 @@ string get_setting(string source, string search)
|
||||
source.erase(0, source.find(search + " = ") + search.length() +4);
|
||||
source.erase(source.find("\""));
|
||||
}
|
||||
else
|
||||
else
|
||||
return "";
|
||||
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
@ -25,66 +25,66 @@ void load()
|
||||
static fstats filestats_appios ATTRIBUTE_ALIGN(32);
|
||||
static u8 filearray_settings[1024] ATTRIBUTE_ALIGN(32);
|
||||
static u8 filearray_appios[1024] ATTRIBUTE_ALIGN(32);
|
||||
|
||||
|
||||
Settings.ios_dat = "/title/00010001/54484246/data/appios.dat";
|
||||
Settings.dir_dat = "/title/00010001/54484246/data/list.dat";
|
||||
Settings.settings_dat = "/title/00010001/54484246/data/settings.dat";
|
||||
|
||||
AvailableCategoryLoad(Settings.dir_dat);
|
||||
|
||||
|
||||
// get settings
|
||||
fd = ISFS_Open(Settings.settings_dat.c_str(), ISFS_OPEN_READ);
|
||||
if (fd <= 0)
|
||||
ISFS_Close(fd);
|
||||
|
||||
|
||||
ISFS_GetFileStats(fd, &filestats_settings);
|
||||
|
||||
|
||||
file_size = ISFS_Read(fd, filearray_settings, filestats_settings.file_length);
|
||||
|
||||
|
||||
ISFS_Close(fd);
|
||||
|
||||
|
||||
if(file_size >= 0)
|
||||
{
|
||||
string source = (char*)filearray_settings;
|
||||
|
||||
|
||||
if(get_setting(source, "device_dat") != "")
|
||||
Settings.device_dat = get_setting(source, "device_dat");
|
||||
|
||||
|
||||
if (get_setting(source, "theme") != "")
|
||||
{
|
||||
sprintf (Options.theme, get_setting(source, "theme").c_str());
|
||||
theme(check_path(Settings.device_dat + ":/config/HBF/themes/") + Options.theme + "/");
|
||||
}
|
||||
|
||||
|
||||
if(get_setting(source, "language") != "")
|
||||
{
|
||||
sprintf (Options.language, get_setting(source, "language").c_str());
|
||||
ini_Open(check_path(Settings.device_dat + ":/config/HBF/languages/") + Options.language + ".lang");
|
||||
AvailableCategory.categories[0] = tr(Settings.category_name_all);
|
||||
}
|
||||
|
||||
|
||||
if(get_setting(source, "font") != "")
|
||||
sprintf (Options.font, get_setting(source, "font").c_str());
|
||||
|
||||
|
||||
if(get_setting(source, "slide_effect") != "")
|
||||
Options.slide_effect = atoi(get_setting(source, "slide_effect").c_str());
|
||||
|
||||
|
||||
if(get_setting(source, "last_category_name") != "")
|
||||
{
|
||||
if(KategorieNr(get_setting(source, "last_category_name")) != -1)
|
||||
Settings.current_category = KategorieNr(get_setting(source, "last_category_name").c_str());
|
||||
}
|
||||
|
||||
|
||||
if(get_setting(source, "last_category") != "")
|
||||
{
|
||||
Options.last_category = atoi(get_setting(source, "last_category").c_str());
|
||||
if(Options.last_category == 1)
|
||||
Options.last_category = Settings.current_category +1;
|
||||
}
|
||||
|
||||
|
||||
if(get_setting(source, "last_app_name") != "")
|
||||
Settings.startingAppName = get_setting(source, "last_app_name");
|
||||
|
||||
|
||||
if(get_setting(source, "apps_nr") != "")
|
||||
{
|
||||
Options.apps = atoi(get_setting(source, "apps_nr").c_str());
|
||||
@ -93,7 +93,7 @@ void load()
|
||||
else if(Options.apps < 4)
|
||||
Options.apps = 4;
|
||||
}
|
||||
|
||||
|
||||
if(get_setting(source, "quick_start") != "")
|
||||
Options.quick_start = atoi(get_setting(source, "quick_start").c_str());
|
||||
|
||||
@ -102,59 +102,59 @@ void load()
|
||||
|
||||
if(get_setting(source, "navigation") != "")
|
||||
Options.navigation = atoi(get_setting(source, "navigation").c_str());
|
||||
|
||||
|
||||
if(get_setting(source, "network") != "")
|
||||
{
|
||||
Options.network = atoi(get_setting(source, "network").c_str());
|
||||
Options.temp_network = Options.network;
|
||||
}
|
||||
|
||||
|
||||
if(get_setting(source, "newrevtext") != "")
|
||||
{
|
||||
Options.newrevtext = atoi(get_setting(source, "newrevtext").c_str());
|
||||
Options.temp_newrevtext = Options.newrevtext;
|
||||
}
|
||||
|
||||
|
||||
if(get_setting(source, "code") != "")
|
||||
{
|
||||
sprintf (Settings.code, get_setting(source, "code").c_str());
|
||||
strcpy (Options.temp_code, Settings.code);
|
||||
}
|
||||
|
||||
|
||||
if(get_setting(source, "grid") != "")
|
||||
Settings.grid = atoi(get_setting(source, "grid").c_str());
|
||||
|
||||
|
||||
if(get_setting(source, "device") != "")
|
||||
Settings.device = get_setting(source, "device");
|
||||
|
||||
|
||||
if(get_setting(source, "device_icon") != "")
|
||||
Options.device_icon = atoi(get_setting(source, "device_icon").c_str());
|
||||
|
||||
|
||||
if(get_setting(source, "system") != "")
|
||||
Settings.system = atoi(get_setting(source, "system").c_str());
|
||||
|
||||
|
||||
if(get_setting(source, "top") != "")
|
||||
Settings.top = atoi(get_setting(source, "top").c_str());
|
||||
|
||||
|
||||
if(get_setting(source, "bottom") != "")
|
||||
Settings.bottom = atoi(get_setting(source, "bottom").c_str());
|
||||
|
||||
|
||||
if(get_setting(source, "left") != "")
|
||||
Settings.left = atoi(get_setting(source, "left").c_str());
|
||||
|
||||
|
||||
if(get_setting(source, "right") != "")
|
||||
Settings.right = atoi(get_setting(source, "right").c_str());
|
||||
}
|
||||
|
||||
|
||||
// get appios
|
||||
fd = ISFS_Open(Settings.ios_dat.c_str(), ISFS_OPEN_READ);
|
||||
if (fd <= 0)
|
||||
ISFS_Close(fd);
|
||||
|
||||
ISFS_GetFileStats(fd, &filestats_appios);
|
||||
|
||||
|
||||
file_size = ISFS_Read(fd, filearray_appios, filestats_appios.file_length);
|
||||
|
||||
|
||||
ISFS_Close(fd);
|
||||
|
||||
if(file_size >= 0)
|
||||
@ -162,6 +162,6 @@ void load()
|
||||
string line;
|
||||
istringstream in((char*)filearray_appios);
|
||||
while(getline(in, line))
|
||||
appios.push_back(app_ios(line.substr(0, line.find(" = ")), atoi(line.substr(line.find(" = ") +3).c_str())));
|
||||
appios.push_back(app_ios(line.substr(0, line.find(" = ")), atoi(line.substr(line.find(" = ") +3).c_str())));
|
||||
}
|
||||
}
|
||||
|
@ -20,16 +20,16 @@ void sort_apps()
|
||||
folder.erase(folder.find_last_of("/"));
|
||||
if((signed)folder.find_last_of("/") != -1)
|
||||
folder.erase(0, folder.find_last_of("/") +1);
|
||||
|
||||
|
||||
vector<string>::iterator pos = find(AvailableCategory.apps[category].begin(), AvailableCategory.apps[category].end(), folder);
|
||||
if ( pos != AvailableCategory.apps[category].end() )
|
||||
AvailableCategory.apps[category].erase(pos);
|
||||
|
||||
|
||||
AvailableCategory.apps[category].insert(AvailableCategory.apps[category].begin(), folder);
|
||||
}
|
||||
|
||||
|
||||
copy_app_in_category();
|
||||
|
||||
|
||||
switch (_sort)
|
||||
{
|
||||
case NAME_A_Z:
|
||||
@ -56,46 +56,46 @@ bool sort_name_a_z(const homebrew_list& a, const homebrew_list& b)
|
||||
_sort = NAME_A_Z;
|
||||
string str1 = a.name;
|
||||
string str2 = b.name;
|
||||
|
||||
|
||||
transform(str1.begin(),str1.end(),str1.begin(),::tolower); // in kleinebuchstaben umwandeln
|
||||
transform(str2.begin(),str2.end(),str2.begin(),::tolower); // in kleinebuchstaben umwandeln
|
||||
|
||||
|
||||
return str1 < str2;
|
||||
}
|
||||
|
||||
|
||||
bool sort_name_z_a(const homebrew_list& a, const homebrew_list& b)
|
||||
{
|
||||
{
|
||||
_sort = NAME_Z_A;
|
||||
string str1 = a.name;
|
||||
string str2 = b.name;
|
||||
|
||||
|
||||
transform(str1.begin(),str1.end(),str1.begin(),::tolower); // in kleinebuchstaben umwandeln
|
||||
transform(str2.begin(),str2.end(),str2.begin(),::tolower); // in kleinebuchstaben umwandeln
|
||||
|
||||
|
||||
return str1 > str2;
|
||||
}
|
||||
|
||||
bool sort_foldername_a_z(const homebrew_list& a, const homebrew_list& b)
|
||||
{
|
||||
{
|
||||
_sort = FOLDERNAME_A_Z;
|
||||
string str1 = a.foldername;
|
||||
string str2 = b.foldername;
|
||||
|
||||
|
||||
transform(str1.begin(),str1.end(),str1.begin(),::tolower); // in kleinebuchstaben umwandeln
|
||||
transform(str2.begin(),str2.end(),str2.begin(),::tolower); // in kleinebuchstaben umwandeln
|
||||
|
||||
|
||||
return str1 < str2;
|
||||
}
|
||||
|
||||
bool sort_foldername_z_a(const homebrew_list& a, const homebrew_list& b)
|
||||
{
|
||||
{
|
||||
_sort = FOLDERNAME_Z_A;
|
||||
string str1 = a.foldername;
|
||||
string str2 = b.foldername;
|
||||
|
||||
|
||||
transform(str1.begin(),str1.end(),str1.begin(),::tolower); // in kleinebuchstaben umwandeln
|
||||
transform(str2.begin(),str2.end(),str2.begin(),::tolower); // in kleinebuchstaben umwandeln
|
||||
|
||||
|
||||
return str1 > str2;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ void TextLine::text(string text, int size, int maxWidth)
|
||||
{
|
||||
textScrollPos = 0;
|
||||
line.clear();
|
||||
|
||||
|
||||
while((signed)text.find("\r\n") != -1)
|
||||
text.replace(text.find("\r\n"), 2, "\n");
|
||||
|
||||
@ -20,7 +20,7 @@ void TextLine::text(string text, int size, int maxWidth)
|
||||
int lastSpaceIndex = -1;
|
||||
wchar_t *wtext = charToWideChar(text.c_str());
|
||||
wchar_t *textDynRow = new wchar_t[maxWidth];
|
||||
|
||||
|
||||
while(ch < txtlen)
|
||||
{
|
||||
textDynRow[i] = wtext[ch];
|
||||
@ -42,16 +42,16 @@ void TextLine::text(string text, int size, int maxWidth)
|
||||
{
|
||||
while(text.substr(lastSpaceIndex, 1) != " " && text.substr(lastSpaceIndex, 1) != "\n")
|
||||
lastSpaceIndex++;
|
||||
|
||||
|
||||
line.push_back(text.substr(0, lastSpaceIndex +1));
|
||||
|
||||
|
||||
text.erase(0, lastSpaceIndex +1);
|
||||
|
||||
|
||||
ch = lastSpace; // go backwards to the last space
|
||||
lastSpace = -1; // we have used this space
|
||||
lastSpaceIndex = -1;
|
||||
}
|
||||
|
||||
|
||||
i = -1;
|
||||
}
|
||||
else if(ch == txtlen-1)
|
||||
@ -59,7 +59,7 @@ void TextLine::text(string text, int size, int maxWidth)
|
||||
line.push_back(text);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ch++;
|
||||
i++;
|
||||
}
|
||||
@ -68,14 +68,14 @@ void TextLine::text(string text, int size, int maxWidth)
|
||||
void TextLine::list(string text)
|
||||
{
|
||||
textScrollPos = 0;
|
||||
|
||||
|
||||
text.erase(text.rfind("end"));
|
||||
|
||||
while(1)
|
||||
{
|
||||
if((signed)text.find("\n") == -1)
|
||||
break;
|
||||
|
||||
|
||||
line.push_back(text.substr(0, text.find("\n") -1));
|
||||
text.erase(0, text.find("\n") +1);
|
||||
}
|
||||
@ -86,7 +86,7 @@ int TextLine::text_up()
|
||||
textScrollPos--;
|
||||
if(textScrollPos < 0)
|
||||
textScrollPos = 0;
|
||||
|
||||
|
||||
return textScrollPos;
|
||||
}
|
||||
|
||||
@ -94,11 +94,11 @@ int TextLine::text_down(int number)
|
||||
{
|
||||
textScrollPos++;
|
||||
int temp = line.size() - number;
|
||||
|
||||
|
||||
if(temp < 0)
|
||||
textScrollPos = 0;
|
||||
else if(textScrollPos > temp)
|
||||
textScrollPos = temp;
|
||||
|
||||
|
||||
return textScrollPos;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
|
||||
#include <string>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
@ -8,10 +8,10 @@ class TextLine
|
||||
public:
|
||||
void text(string text, int FontSize, int maxWidth);
|
||||
void list(string text);
|
||||
|
||||
|
||||
int text_up();
|
||||
int text_down(int number);
|
||||
std::vector<string> line;
|
||||
int textScrollPos;
|
||||
|
||||
|
||||
};
|
@ -76,7 +76,7 @@ struct STheme
|
||||
const u8* scrollbar_arrowdown_over;
|
||||
const u8* scrollbar_arrowup;
|
||||
const u8* scrollbar_arrowup_over;
|
||||
|
||||
|
||||
// color
|
||||
int category_1; // Alle
|
||||
int category_2;
|
||||
@ -91,8 +91,8 @@ struct STheme
|
||||
int title_2;
|
||||
int title_3;
|
||||
int program_name_1; // Homebrew Filter
|
||||
int program_name_2;
|
||||
int program_name_3;
|
||||
int program_name_2;
|
||||
int program_name_3;
|
||||
int apps_1; // Apps
|
||||
int apps_2;
|
||||
int apps_3;
|
||||
@ -107,10 +107,10 @@ struct STheme
|
||||
int button_tiny_text_3;
|
||||
int progressbar_color1_1; // Ladebalken oben
|
||||
int progressbar_color1_2;
|
||||
int progressbar_color1_3;
|
||||
int progressbar_color1_3;
|
||||
int progressbar_color2_1; // Ladebalken unten
|
||||
int progressbar_color2_2;
|
||||
int progressbar_color2_3;
|
||||
int progressbar_color2_3;
|
||||
};
|
||||
extern struct STheme Theme;
|
||||
|
||||
|
@ -23,15 +23,15 @@ void ResumeThrobberThread()
|
||||
if(throbberHalt)
|
||||
{
|
||||
throbberHalt = false;
|
||||
|
||||
|
||||
throbberImg = new GuiImage(new GuiImageData(Theme.throbber));
|
||||
throbberImg->SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
|
||||
|
||||
HaltGui();
|
||||
mainWindow->SetState(STATE_DISABLED);
|
||||
mainWindow->Append(throbberImg);
|
||||
ResumeGui();
|
||||
|
||||
|
||||
LWP_ResumeThread(throbberthread);
|
||||
}
|
||||
}
|
||||
@ -42,7 +42,7 @@ void HaltThrobberThread()
|
||||
{
|
||||
spin = 0;
|
||||
throbberHalt = true;
|
||||
|
||||
|
||||
HaltGui();
|
||||
mainWindow->Remove(throbberImg);
|
||||
mainWindow->SetState(STATE_DEFAULT);
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
#include <dirent.h>
|
||||
#include <string>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
|
||||
@ -20,7 +20,7 @@ void ini_Open(string filename)
|
||||
{
|
||||
while((signed)line.find("\r") != -1)
|
||||
line.erase(line.find("\r"), 1);
|
||||
|
||||
|
||||
quelltext.push_back(line);
|
||||
}
|
||||
}
|
||||
@ -54,7 +54,7 @@ string ini_GetString(string key)
|
||||
while(value.substr(0, 1) == " ")
|
||||
value.erase(0, 1);
|
||||
}
|
||||
return value;
|
||||
return value;
|
||||
}
|
||||
|
||||
const char* tr(string translate)
|
||||
|
@ -31,7 +31,7 @@ distribution.
|
||||
#include <gccore.h>
|
||||
#include <ogc/machine/processor.h>
|
||||
#include "gecko.h"
|
||||
|
||||
|
||||
|
||||
#define CHECK_AHB 0x0D800064
|
||||
#define MEM2_PROT 0x0D8B420A
|
||||
@ -52,17 +52,17 @@ s32 Patch_ahbprot(void)
|
||||
*(u32*)0x80002174 = 0x60000000;
|
||||
|
||||
if (read32(CHECK_AHB) != 0xffffffff)
|
||||
{
|
||||
{
|
||||
gprintf("AHBPROT doesn't seem to be disabled.\n");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
u16 *patchme;
|
||||
write16(MEM2_PROT, 2);
|
||||
for (patchme=ES_MODULE_START; patchme < ES_MODULE_START+0x4000; patchme++)
|
||||
for (patchme=ES_MODULE_START; patchme < ES_MODULE_START+0x4000; patchme++)
|
||||
{
|
||||
if (!memcmp(patchme, ticket_check, sizeof(ticket_check)))
|
||||
if (!memcmp(patchme, ticket_check, sizeof(ticket_check)))
|
||||
{
|
||||
gprintf("Found TMD Access rights check at %p\n", patchme);
|
||||
// write16/uncached poke doesn't work for this. Go figure.
|
||||
|
@ -844,7 +844,7 @@ class GuiKeyboard : public GuiWindow
|
||||
GuiImageData * keyLarge;
|
||||
GuiImageData * keyLargeOver;
|
||||
GuiTrigger * trigA;
|
||||
|
||||
|
||||
int letterPos;
|
||||
};
|
||||
|
||||
|
@ -78,7 +78,7 @@ GuiImage::GuiImage(int w, int h, GXColor c)
|
||||
int len = w*h*4;
|
||||
if(len%32) len += (32-len%32);
|
||||
DCFlushRange(image, len);
|
||||
|
||||
|
||||
color[0] = c;
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ GuiImage::GuiImage(int w, int h, GXColor * c)
|
||||
int len = w*h*4;
|
||||
if(len%32) len += (32-len%32);
|
||||
DCFlushRange(image, len);
|
||||
|
||||
|
||||
for(int i = 0; i < 4; i++)
|
||||
color[i] = c[i];
|
||||
|
||||
|
@ -24,7 +24,7 @@ static GXColor presetColor = (GXColor){255, 255, 255, 255};
|
||||
/**
|
||||
* Constructor for the GuiText class.
|
||||
*/
|
||||
|
||||
|
||||
GuiText::GuiText(const char * t, int s, GXColor c)
|
||||
{
|
||||
text = NULL;
|
||||
@ -44,7 +44,7 @@ GuiText::GuiText(const char * t, int s, GXColor c)
|
||||
|
||||
alignmentHor = ALIGN_CENTRE;
|
||||
alignmentVert = ALIGN_MIDDLE;
|
||||
|
||||
|
||||
if(t)
|
||||
{
|
||||
text = charToWideChar(t);
|
||||
@ -74,7 +74,7 @@ GuiText::GuiText(const wchar_t * t, int s, GXColor c)
|
||||
|
||||
alignmentHor = ALIGN_CENTRE;
|
||||
alignmentVert = ALIGN_MIDDLE;
|
||||
|
||||
|
||||
if(t)
|
||||
{
|
||||
text = new (std::nothrow) wchar_t[wcslen(t)+1];
|
||||
@ -109,7 +109,7 @@ GuiText::GuiText(const char * t)
|
||||
|
||||
alignmentHor = presetAlignmentHor;
|
||||
alignmentVert = presetAlignmentVert;
|
||||
|
||||
|
||||
if(t)
|
||||
{
|
||||
text = charToWideChar(t);
|
||||
@ -312,7 +312,7 @@ int GuiText::GetTextWidthToPosition(int pos)
|
||||
// letterPos = 0;
|
||||
if(pos < 0 )
|
||||
return 0;
|
||||
|
||||
|
||||
int i = 0, currentWidth = 0;
|
||||
|
||||
int newSize = size * GetScale() * GetFontScale();
|
||||
@ -325,7 +325,7 @@ int GuiText::GetTextWidthToPosition(int pos)
|
||||
letterPos = i;
|
||||
if(i == pos)
|
||||
return currentWidth;
|
||||
|
||||
|
||||
currentWidth += (font ? font : fontSystem)->getCharWidth(text[i], currentSize, i > 0 ? text[i-1] : 0x0000);
|
||||
i++;
|
||||
}
|
||||
@ -343,7 +343,7 @@ int GuiText::GetTextMaxWidth(int width)
|
||||
letterPos = 0;
|
||||
if(width <= 0)
|
||||
return 0;
|
||||
|
||||
|
||||
int i = 0, tempWidth = 0, currentWidth = 0;
|
||||
|
||||
int newSize = size * GetScale() * GetFontScale();
|
||||
@ -357,7 +357,7 @@ int GuiText::GetTextMaxWidth(int width)
|
||||
tempWidth += (font ? font : fontSystem)->getCharWidth(text[i], currentSize, i > 0 ? text[i-1] : 0x0000);
|
||||
if(tempWidth >= width)
|
||||
return currentWidth;
|
||||
|
||||
|
||||
currentWidth = tempWidth;
|
||||
i++;
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ struct SSettings
|
||||
int total_page;
|
||||
int checkrev;
|
||||
char code[5];
|
||||
|
||||
|
||||
string device_dat;
|
||||
string dir_dat;
|
||||
string settings_dat;
|
||||
@ -89,14 +89,14 @@ struct SSettings
|
||||
string startingAppName;
|
||||
string forwarder_arg;
|
||||
string force_reload;
|
||||
|
||||
|
||||
int Apps_from;
|
||||
int Apps_to;
|
||||
|
||||
|
||||
bool grid;
|
||||
bool unassigned;
|
||||
int system; // 0 = GC / 1 = Wii / 2 = Wii/GC
|
||||
|
||||
|
||||
int temp_width;
|
||||
int temp_height;
|
||||
int temp_horizontal;
|
||||
@ -115,7 +115,7 @@ struct SOptions
|
||||
char temp_code[5];
|
||||
int temp_network;
|
||||
int temp_newrevtext;
|
||||
|
||||
|
||||
int last_category; // letzte kategorie merken
|
||||
int slide_effect;
|
||||
char theme[256];
|
||||
|
@ -136,7 +136,7 @@ UpdateGUI (void *arg)
|
||||
{
|
||||
if(Settings.forwarder_path != "the homebrew channel")
|
||||
LoadHomebrew(Settings.forwarder_path.c_str());
|
||||
|
||||
|
||||
string startingAppName = Settings.forwarder_path;
|
||||
if((signed)startingAppName.rfind("/") != -1)
|
||||
startingAppName.erase(startingAppName.rfind("/"));
|
||||
@ -147,15 +147,15 @@ UpdateGUI (void *arg)
|
||||
if (!goneek2o)
|
||||
ExitApp();
|
||||
}
|
||||
|
||||
|
||||
// sd check
|
||||
if(Settings.device == "sd1")
|
||||
check_sd();
|
||||
|
||||
|
||||
// usb check
|
||||
else if(Settings.device == "usb1")
|
||||
check_usb();
|
||||
|
||||
|
||||
// sd und usb check
|
||||
else if(Settings.device == "sd_usb")
|
||||
{
|
||||
@ -172,7 +172,7 @@ UpdateGUI (void *arg)
|
||||
check_usb();
|
||||
check_dvd();
|
||||
}
|
||||
|
||||
|
||||
// screenshoot
|
||||
if(WPAD_ButtonsDown(0) & WPAD_BUTTON_1 && WPAD_ButtonsDown(0) & WPAD_BUTTON_2)
|
||||
Screenshot();
|
||||
@ -198,7 +198,7 @@ InitGUIThreads()
|
||||
void MainMenu(int menu)
|
||||
{
|
||||
int currentMenu = menu;
|
||||
|
||||
|
||||
// position der letzten app
|
||||
for(int i = 0; i < (signed)vechomebrew_list_category[Settings.current_category].size(); i++)
|
||||
{
|
||||
@ -206,7 +206,7 @@ void MainMenu(int menu)
|
||||
if((signed)name.rfind("/") != -1)
|
||||
name.erase(name.rfind("/"));
|
||||
name.erase(0, name.rfind("/") +1);
|
||||
|
||||
|
||||
if(name == Settings.startingAppName)
|
||||
{
|
||||
Settings.last_app_pos = i;
|
||||
@ -216,7 +216,7 @@ void MainMenu(int menu)
|
||||
|
||||
bgImg = new GuiImage(new GuiImageData(Theme.background));
|
||||
mainWindow->Append(bgImg);
|
||||
|
||||
|
||||
while(currentMenu != MENU_EXIT)
|
||||
{
|
||||
switch (currentMenu)
|
||||
@ -224,52 +224,52 @@ void MainMenu(int menu)
|
||||
case MENU_MAIN:
|
||||
currentMenu = MenuMain();
|
||||
break;
|
||||
|
||||
|
||||
case MENU_SETTINGS:
|
||||
currentMenu = MenuSettings();
|
||||
break;
|
||||
|
||||
|
||||
case MENU_SETTINGS_FILE:
|
||||
currentMenu = MenuSettingsFile();
|
||||
break;
|
||||
|
||||
|
||||
case MENU_SETTINGS_THEME:
|
||||
currentMenu = MenuSettingsTheme();
|
||||
break;
|
||||
|
||||
|
||||
case MENU_SETTINGS_LANGUAGE:
|
||||
currentMenu = MenuSettingsLanguage();
|
||||
break;
|
||||
|
||||
|
||||
case MENU_SETTINGS_FONT:
|
||||
currentMenu = MenuSettingsFont();
|
||||
break;
|
||||
|
||||
|
||||
case MENU_SETTINGS_DISPLAY:
|
||||
currentMenu = MenuSettingsDisplay();
|
||||
break;
|
||||
|
||||
|
||||
case MENU_SETTINGS_CHILDLOCK:
|
||||
currentMenu = MenuSettingsChildlock();
|
||||
break;
|
||||
|
||||
|
||||
case MENU_SETTINGS_NETWORK:
|
||||
currentMenu = MenuSettingsNetwork();
|
||||
break;
|
||||
|
||||
|
||||
default: // unrecognized menu
|
||||
currentMenu = MenuMain();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ResumeGui();
|
||||
ExitRequested = 1;
|
||||
HaltGui();
|
||||
|
||||
delete mainWindow;
|
||||
|
||||
|
||||
delete pointer;
|
||||
|
||||
|
||||
mainWindow = NULL;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ struct _IMGCTX
|
||||
png_structp png_ptr;
|
||||
png_infop info_ptr;
|
||||
FILE *fd;
|
||||
|
||||
|
||||
png_bytep *row_pointers;
|
||||
png_bytep img_data;
|
||||
};
|
||||
@ -175,7 +175,7 @@ int PNGU_DecodeToYCbYCr (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *buff
|
||||
for (x = 0; x < (width / 2); x++)
|
||||
((PNGU_u32 *)buffer)[y*buffWidth+x] = PNGU_RGB8_TO_YCbYCr (*(ctx->row_pointers[y]+x*6), *(ctx->row_pointers[y]+x*6+1), *(ctx->row_pointers[y]+x*6+2),
|
||||
*(ctx->row_pointers[y]+x*6+3), *(ctx->row_pointers[y]+x*6+4), *(ctx->row_pointers[y]+x*6+5));
|
||||
|
||||
|
||||
// Free resources
|
||||
free (ctx->img_data);
|
||||
free (ctx->row_pointers);
|
||||
@ -189,7 +189,7 @@ int PNGU_DecodeToRGB565 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *buff
|
||||
{
|
||||
int result;
|
||||
PNGU_u32 x, y, buffWidth;
|
||||
|
||||
|
||||
result = pngu_decode (ctx, width, height, 1);
|
||||
if (result != PNGU_OK)
|
||||
return result;
|
||||
@ -199,11 +199,11 @@ int PNGU_DecodeToRGB565 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *buff
|
||||
// Copy image to the output buffer
|
||||
for (y = 0; y < height; y++)
|
||||
for (x = 0; x < width; x++)
|
||||
((PNGU_u16 *)buffer)[y*buffWidth+x] =
|
||||
(((PNGU_u16) (ctx->row_pointers[y][x*3] & 0xF8)) << 8) |
|
||||
(((PNGU_u16) (ctx->row_pointers[y][x*3+1] & 0xFC)) << 3) |
|
||||
((PNGU_u16 *)buffer)[y*buffWidth+x] =
|
||||
(((PNGU_u16) (ctx->row_pointers[y][x*3] & 0xF8)) << 8) |
|
||||
(((PNGU_u16) (ctx->row_pointers[y][x*3+1] & 0xFC)) << 3) |
|
||||
(((PNGU_u16) (ctx->row_pointers[y][x*3+2] & 0xF8)) >> 3);
|
||||
|
||||
|
||||
// Free resources
|
||||
free (ctx->img_data);
|
||||
free (ctx->row_pointers);
|
||||
@ -217,7 +217,7 @@ int PNGU_DecodeToRGBA8 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *buffe
|
||||
{
|
||||
int result;
|
||||
PNGU_u32 x, y, buffWidth;
|
||||
|
||||
|
||||
result = pngu_decode (ctx, width, height, 0);
|
||||
if (result != PNGU_OK)
|
||||
return result;
|
||||
@ -236,13 +236,13 @@ int PNGU_DecodeToRGBA8 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *buffe
|
||||
// No alpha channel present, copy image to the output buffer
|
||||
for (y = 0; y < height; y++)
|
||||
for (x = 0; x < width; x++)
|
||||
((PNGU_u32 *)buffer)[y*buffWidth+x] =
|
||||
(((PNGU_u32) ctx->row_pointers[y][x*3]) << 24) |
|
||||
(((PNGU_u32) ctx->row_pointers[y][x*3+1]) << 16) |
|
||||
(((PNGU_u32) ctx->row_pointers[y][x*3+2]) << 8) |
|
||||
((PNGU_u32 *)buffer)[y*buffWidth+x] =
|
||||
(((PNGU_u32) ctx->row_pointers[y][x*3]) << 24) |
|
||||
(((PNGU_u32) ctx->row_pointers[y][x*3+1]) << 16) |
|
||||
(((PNGU_u32) ctx->row_pointers[y][x*3+2]) << 8) |
|
||||
((PNGU_u32) default_alpha);
|
||||
}
|
||||
|
||||
|
||||
// Free resources
|
||||
free (ctx->img_data);
|
||||
free (ctx->row_pointers);
|
||||
@ -276,37 +276,37 @@ int PNGU_DecodeTo4x4RGB565 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *b
|
||||
|
||||
PNGU_u64 field64 = *((PNGU_u64 *)(ctx->row_pointers[y*4]+x*12));
|
||||
PNGU_u64 field32 = (PNGU_u64) *((PNGU_u32 *)(ctx->row_pointers[y*4]+x*12+8));
|
||||
((PNGU_u64 *) buffer)[blockbase] =
|
||||
(((field64 & 0xF800000000000000ULL) | ((field64 & 0xFC000000000000ULL) << 3) | ((field64 & 0xF80000000000ULL) << 5)) |
|
||||
(((field64 & 0xF800000000ULL) << 8) | ((field64 & 0xFC000000ULL) << 11) | ((field64 & 0xF80000ULL) << 13)) |
|
||||
((PNGU_u64 *) buffer)[blockbase] =
|
||||
(((field64 & 0xF800000000000000ULL) | ((field64 & 0xFC000000000000ULL) << 3) | ((field64 & 0xF80000000000ULL) << 5)) |
|
||||
(((field64 & 0xF800000000ULL) << 8) | ((field64 & 0xFC000000ULL) << 11) | ((field64 & 0xF80000ULL) << 13)) |
|
||||
(((field64 & 0xF800ULL) << 16) | ((field64 & 0xFCULL) << 19) | ((field32 & 0xF8000000ULL) >> 11)) |
|
||||
(((field32 & 0xF80000ULL) >> 8) | ((field32 & 0xFC00ULL) >> 5) | ((field32 & 0xF8ULL) >> 3)));
|
||||
|
||||
field64 = *((PNGU_u64 *)(ctx->row_pointers[y*4+1]+x*12));
|
||||
field32 = (PNGU_u64) *((PNGU_u32 *)(ctx->row_pointers[y*4+1]+x*12+8));
|
||||
((PNGU_u64 *) buffer)[blockbase+1] =
|
||||
(((field64 & 0xF800000000000000ULL) | ((field64 & 0xFC000000000000ULL) << 3) | ((field64 & 0xF80000000000ULL) << 5)) |
|
||||
(((field64 & 0xF800000000ULL) << 8) | ((field64 & 0xFC000000ULL) << 11) | ((field64 & 0xF80000ULL) << 13)) |
|
||||
((PNGU_u64 *) buffer)[blockbase+1] =
|
||||
(((field64 & 0xF800000000000000ULL) | ((field64 & 0xFC000000000000ULL) << 3) | ((field64 & 0xF80000000000ULL) << 5)) |
|
||||
(((field64 & 0xF800000000ULL) << 8) | ((field64 & 0xFC000000ULL) << 11) | ((field64 & 0xF80000ULL) << 13)) |
|
||||
(((field64 & 0xF800ULL) << 16) | ((field64 & 0xFCULL) << 19) | ((field32 & 0xF8000000ULL) >> 11)) |
|
||||
(((field32 & 0xF80000ULL) >> 8) | ((field32 & 0xFC00ULL) >> 5) | ((field32 & 0xF8ULL) >> 3)));
|
||||
|
||||
field64 = *((PNGU_u64 *)(ctx->row_pointers[y*4+2]+x*12));
|
||||
field32 = (PNGU_u64) *((PNGU_u32 *)(ctx->row_pointers[y*4+2]+x*12+8));
|
||||
((PNGU_u64 *) buffer)[blockbase+2] =
|
||||
(((field64 & 0xF800000000000000ULL) | ((field64 & 0xFC000000000000ULL) << 3) | ((field64 & 0xF80000000000ULL) << 5)) |
|
||||
(((field64 & 0xF800000000ULL) << 8) | ((field64 & 0xFC000000ULL) << 11) | ((field64 & 0xF80000ULL) << 13)) |
|
||||
((PNGU_u64 *) buffer)[blockbase+2] =
|
||||
(((field64 & 0xF800000000000000ULL) | ((field64 & 0xFC000000000000ULL) << 3) | ((field64 & 0xF80000000000ULL) << 5)) |
|
||||
(((field64 & 0xF800000000ULL) << 8) | ((field64 & 0xFC000000ULL) << 11) | ((field64 & 0xF80000ULL) << 13)) |
|
||||
(((field64 & 0xF800ULL) << 16) | ((field64 & 0xFCULL) << 19) | ((field32 & 0xF8000000ULL) >> 11)) |
|
||||
(((field32 & 0xF80000ULL) >> 8) | ((field32 & 0xFC00ULL) >> 5) | ((field32 & 0xF8ULL) >> 3)));
|
||||
|
||||
field64 = *((PNGU_u64 *)(ctx->row_pointers[y*4+3]+x*12));
|
||||
field32 = (PNGU_u64) *((PNGU_u32 *)(ctx->row_pointers[y*4+3]+x*12+8));
|
||||
((PNGU_u64 *) buffer)[blockbase+3] =
|
||||
(((field64 & 0xF800000000000000ULL) | ((field64 & 0xFC000000000000ULL) << 3) | ((field64 & 0xF80000000000ULL) << 5)) |
|
||||
(((field64 & 0xF800000000ULL) << 8) | ((field64 & 0xFC000000ULL) << 11) | ((field64 & 0xF80000ULL) << 13)) |
|
||||
((PNGU_u64 *) buffer)[blockbase+3] =
|
||||
(((field64 & 0xF800000000000000ULL) | ((field64 & 0xFC000000000000ULL) << 3) | ((field64 & 0xF80000000000ULL) << 5)) |
|
||||
(((field64 & 0xF800000000ULL) << 8) | ((field64 & 0xFC000000ULL) << 11) | ((field64 & 0xF80000ULL) << 13)) |
|
||||
(((field64 & 0xF800ULL) << 16) | ((field64 & 0xFCULL) << 19) | ((field32 & 0xF8000000ULL) >> 11)) |
|
||||
(((field32 & 0xF80000ULL) >> 8) | ((field32 & 0xFC00ULL) >> 5) | ((field32 & 0xF8ULL) >> 3)));
|
||||
}
|
||||
|
||||
|
||||
// Free resources
|
||||
free (ctx->img_data);
|
||||
free (ctx->row_pointers);
|
||||
@ -347,7 +347,7 @@ int PNGU_DecodeTo4x4RGB5A3 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *b
|
||||
PNGU_u64 fieldA = *((PNGU_u64 *)(ctx->row_pointers[y*4]+x*16));
|
||||
PNGU_u64 fieldB = *((PNGU_u64 *)(ctx->row_pointers[y*4]+x*16+8));
|
||||
// If first pixel is opaque set MSB to 1 and encode colors in RGB555, else set MSB to 0 and encode colors in ARGB3444
|
||||
if ((fieldA & 0xE000000000ULL) == 0xE000000000ULL)
|
||||
if ((fieldA & 0xE000000000ULL) == 0xE000000000ULL)
|
||||
tmp = 0x8000000000000000ULL | ((fieldA & 0xF800000000000000ULL) >> 1) | ((fieldA & 0xF8000000000000ULL) << 2) | ((fieldA & 0xF80000000000ULL) << 5);
|
||||
else
|
||||
tmp = ((fieldA & 0xE000000000ULL) << 23) | ((fieldA & 0xF000000000000000ULL) >> 4) | (fieldA & 0xF0000000000000ULL) | ((fieldA & 0xF00000000000ULL) << 4);
|
||||
@ -481,34 +481,34 @@ int PNGU_DecodeTo4x4RGB5A3 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *b
|
||||
|
||||
PNGU_u64 field64 = *((PNGU_u64 *)(ctx->row_pointers[y*4]+x*12));
|
||||
PNGU_u64 field32 = (PNGU_u64) *((PNGU_u32 *)(ctx->row_pointers[y*4]+x*12+8));
|
||||
((PNGU_u64 *) buffer)[blockbase] =
|
||||
((PNGU_u64 *) buffer)[blockbase] =
|
||||
alphaMask | ((field64 & 0xF800000000000000ULL) >> 1) | ((field64 & 0xF8000000000000ULL) << 2) |
|
||||
((field64 & 0xF80000000000ULL) << 5) | ((field64 & 0xF800000000ULL) << 7) | ((field64 & 0xF8000000ULL) << 10) |
|
||||
((field64 & 0xF80000ULL) << 13) | ((field64 & 0xF800ULL) << 15) | ((field64 & 0xF8ULL) << 18) |
|
||||
((field64 & 0xF80000ULL) << 13) | ((field64 & 0xF800ULL) << 15) | ((field64 & 0xF8ULL) << 18) |
|
||||
((field32 & 0xF8000000ULL) >> 11) | ((field32 & 0xF80000ULL) >> 9) | ((field32 & 0xF800ULL) >> 6) | ((field32 & 0xF8ULL) >> 3);
|
||||
|
||||
field64 = *((PNGU_u64 *)(ctx->row_pointers[y*4+1]+x*12));
|
||||
field32 = (PNGU_u64) *((PNGU_u32 *)(ctx->row_pointers[y*4+1]+x*12+8));
|
||||
((PNGU_u64 *) buffer)[blockbase+1] =
|
||||
((PNGU_u64 *) buffer)[blockbase+1] =
|
||||
alphaMask | ((field64 & 0xF800000000000000ULL) >> 1) | ((field64 & 0xF8000000000000ULL) << 2) |
|
||||
((field64 & 0xF80000000000ULL) << 5) | ((field64 & 0xF800000000ULL) << 7) | ((field64 & 0xF8000000ULL) << 10) |
|
||||
((field64 & 0xF80000ULL) << 13) | ((field64 & 0xF800ULL) << 15) | ((field64 & 0xF8ULL) << 18) |
|
||||
((field64 & 0xF80000ULL) << 13) | ((field64 & 0xF800ULL) << 15) | ((field64 & 0xF8ULL) << 18) |
|
||||
((field32 & 0xF8000000ULL) >> 11) | ((field32 & 0xF80000ULL) >> 9) | ((field32 & 0xF800ULL) >> 6) | ((field32 & 0xF8ULL) >> 3);
|
||||
|
||||
field64 = *((PNGU_u64 *)(ctx->row_pointers[y*4+2]+x*12));
|
||||
field32 = (PNGU_u64) *((PNGU_u32 *)(ctx->row_pointers[y*4+2]+x*12+8));
|
||||
((PNGU_u64 *) buffer)[blockbase+2] =
|
||||
((PNGU_u64 *) buffer)[blockbase+2] =
|
||||
alphaMask | ((field64 & 0xF800000000000000ULL) >> 1) | ((field64 & 0xF8000000000000ULL) << 2) |
|
||||
((field64 & 0xF80000000000ULL) << 5) | ((field64 & 0xF800000000ULL) << 7) | ((field64 & 0xF8000000ULL) << 10) |
|
||||
((field64 & 0xF80000ULL) << 13) | ((field64 & 0xF800ULL) << 15) | ((field64 & 0xF8ULL) << 18) |
|
||||
((field64 & 0xF80000ULL) << 13) | ((field64 & 0xF800ULL) << 15) | ((field64 & 0xF8ULL) << 18) |
|
||||
((field32 & 0xF8000000ULL) >> 11) | ((field32 & 0xF80000ULL) >> 9) | ((field32 & 0xF800ULL) >> 6) | ((field32 & 0xF8ULL) >> 3);
|
||||
|
||||
field64 = *((PNGU_u64 *)(ctx->row_pointers[y*4+3]+x*12));
|
||||
field32 = (PNGU_u64) *((PNGU_u32 *)(ctx->row_pointers[y*4+3]+x*12+8));
|
||||
((PNGU_u64 *) buffer)[blockbase+3] =
|
||||
((PNGU_u64 *) buffer)[blockbase+3] =
|
||||
alphaMask | ((field64 & 0xF800000000000000ULL) >> 1) | ((field64 & 0xF8000000000000ULL) << 2) |
|
||||
((field64 & 0xF80000000000ULL) << 5) | ((field64 & 0xF800000000ULL) << 7) | ((field64 & 0xF8000000ULL) << 10) |
|
||||
((field64 & 0xF80000ULL) << 13) | ((field64 & 0xF800ULL) << 15) | ((field64 & 0xF8ULL) << 18) |
|
||||
((field64 & 0xF80000ULL) << 13) | ((field64 & 0xF800ULL) << 15) | ((field64 & 0xF8ULL) << 18) |
|
||||
((field32 & 0xF8000000ULL) >> 11) | ((field32 & 0xF80000ULL) >> 9) | ((field32 & 0xF800ULL) >> 6) | ((field32 & 0xF8ULL) >> 3);
|
||||
}
|
||||
}
|
||||
@ -526,39 +526,39 @@ int PNGU_DecodeTo4x4RGB5A3 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *b
|
||||
|
||||
PNGU_u64 field64 = *((PNGU_u64 *)(ctx->row_pointers[y*4]+x*12));
|
||||
PNGU_u64 field32 = (PNGU_u64) *((PNGU_u32 *)(ctx->row_pointers[y*4]+x*12+8));
|
||||
((PNGU_u64 *) buffer)[blockbase] =
|
||||
alphaMask | ((field64 & 0xF000000000000000ULL) >> 4) | (field64 & 0xF0000000000000ULL) | ((field64 & 0xF00000000000ULL) << 4) |
|
||||
((field64 & 0xF000000000ULL) << 4) | ((field64 & 0xF0000000ULL) << 8) | ((field64 & 0xF00000ULL) << 12) |
|
||||
((field64 & 0xF000ULL) << 12) | ((field64 & 0xF0ULL) << 16) | ((field32 & 0xF0000000ULL) >> 12) |
|
||||
((PNGU_u64 *) buffer)[blockbase] =
|
||||
alphaMask | ((field64 & 0xF000000000000000ULL) >> 4) | (field64 & 0xF0000000000000ULL) | ((field64 & 0xF00000000000ULL) << 4) |
|
||||
((field64 & 0xF000000000ULL) << 4) | ((field64 & 0xF0000000ULL) << 8) | ((field64 & 0xF00000ULL) << 12) |
|
||||
((field64 & 0xF000ULL) << 12) | ((field64 & 0xF0ULL) << 16) | ((field32 & 0xF0000000ULL) >> 12) |
|
||||
((field32 & 0xF00000ULL) >> 12) | ((field32 & 0xF000ULL) >> 8) | ((field32 & 0xF0ULL) >> 4);
|
||||
|
||||
field64 = *((PNGU_u64 *)(ctx->row_pointers[y*4+1]+x*12));
|
||||
field32 = (PNGU_u64) *((PNGU_u32 *)(ctx->row_pointers[y*4+1]+x*12+8));
|
||||
((PNGU_u64 *) buffer)[blockbase+1] =
|
||||
alphaMask | ((field64 & 0xF000000000000000ULL) >> 4) | (field64 & 0xF0000000000000ULL) | ((field64 & 0xF00000000000ULL) << 4) |
|
||||
((field64 & 0xF000000000ULL) << 4) | ((field64 & 0xF0000000ULL) << 8) | ((field64 & 0xF00000ULL) << 12) |
|
||||
((field64 & 0xF000ULL) << 12) | ((field64 & 0xF0ULL) << 16) | ((field32 & 0xF0000000ULL) >> 12) |
|
||||
((PNGU_u64 *) buffer)[blockbase+1] =
|
||||
alphaMask | ((field64 & 0xF000000000000000ULL) >> 4) | (field64 & 0xF0000000000000ULL) | ((field64 & 0xF00000000000ULL) << 4) |
|
||||
((field64 & 0xF000000000ULL) << 4) | ((field64 & 0xF0000000ULL) << 8) | ((field64 & 0xF00000ULL) << 12) |
|
||||
((field64 & 0xF000ULL) << 12) | ((field64 & 0xF0ULL) << 16) | ((field32 & 0xF0000000ULL) >> 12) |
|
||||
((field32 & 0xF00000ULL) >> 12) | ((field32 & 0xF000ULL) >> 8) | ((field32 & 0xF0ULL) >> 4);
|
||||
|
||||
field64 = *((PNGU_u64 *)(ctx->row_pointers[y*4+2]+x*12));
|
||||
field32 = (PNGU_u64) *((PNGU_u32 *)(ctx->row_pointers[y*4+2]+x*12+8));
|
||||
((PNGU_u64 *) buffer)[blockbase+2] =
|
||||
alphaMask | ((field64 & 0xF000000000000000ULL) >> 4) | (field64 & 0xF0000000000000ULL) | ((field64 & 0xF00000000000ULL) << 4) |
|
||||
((field64 & 0xF000000000ULL) << 4) | ((field64 & 0xF0000000ULL) << 8) | ((field64 & 0xF00000ULL) << 12) |
|
||||
((field64 & 0xF000ULL) << 12) | ((field64 & 0xF0ULL) << 16) | ((field32 & 0xF0000000ULL) >> 12) |
|
||||
((PNGU_u64 *) buffer)[blockbase+2] =
|
||||
alphaMask | ((field64 & 0xF000000000000000ULL) >> 4) | (field64 & 0xF0000000000000ULL) | ((field64 & 0xF00000000000ULL) << 4) |
|
||||
((field64 & 0xF000000000ULL) << 4) | ((field64 & 0xF0000000ULL) << 8) | ((field64 & 0xF00000ULL) << 12) |
|
||||
((field64 & 0xF000ULL) << 12) | ((field64 & 0xF0ULL) << 16) | ((field32 & 0xF0000000ULL) >> 12) |
|
||||
((field32 & 0xF00000ULL) >> 12) | ((field32 & 0xF000ULL) >> 8) | ((field32 & 0xF0ULL) >> 4);
|
||||
|
||||
field64 = *((PNGU_u64 *)(ctx->row_pointers[y*4+3]+x*12));
|
||||
field32 = (PNGU_u64) *((PNGU_u32 *)(ctx->row_pointers[y*4+3]+x*12+8));
|
||||
((PNGU_u64 *) buffer)[blockbase+3] =
|
||||
alphaMask | ((field64 & 0xF000000000000000ULL) >> 4) | (field64 & 0xF0000000000000ULL) | ((field64 & 0xF00000000000ULL) << 4) |
|
||||
((field64 & 0xF000000000ULL) << 4) | ((field64 & 0xF0000000ULL) << 8) | ((field64 & 0xF00000ULL) << 12) |
|
||||
((field64 & 0xF000ULL) << 12) | ((field64 & 0xF0ULL) << 16) | ((field32 & 0xF0000000ULL) >> 12) |
|
||||
((PNGU_u64 *) buffer)[blockbase+3] =
|
||||
alphaMask | ((field64 & 0xF000000000000000ULL) >> 4) | (field64 & 0xF0000000000000ULL) | ((field64 & 0xF00000000000ULL) << 4) |
|
||||
((field64 & 0xF000000000ULL) << 4) | ((field64 & 0xF0000000ULL) << 8) | ((field64 & 0xF00000ULL) << 12) |
|
||||
((field64 & 0xF000ULL) << 12) | ((field64 & 0xF0ULL) << 16) | ((field32 & 0xF0000000ULL) >> 12) |
|
||||
((field32 & 0xF00000ULL) >> 12) | ((field32 & 0xF000ULL) >> 8) | ((field32 & 0xF0ULL) >> 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Free resources
|
||||
free (ctx->img_data);
|
||||
free (ctx->row_pointers);
|
||||
@ -597,10 +597,10 @@ int PNGU_DecodeTo4x4RGBA8 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *bu
|
||||
|
||||
PNGU_u64 fieldA = *((PNGU_u64 *)(ctx->row_pointers[y*4]+x*16));
|
||||
PNGU_u64 fieldB = *((PNGU_u64 *)(ctx->row_pointers[y*4]+x*16+8));
|
||||
((PNGU_u64 *) buffer)[blockbase] =
|
||||
((fieldA & 0xFF00000000ULL) << 24) | ((fieldA & 0xFF00000000000000ULL) >> 8) |
|
||||
((fieldA & 0xFFULL) << 40) | ((fieldA & 0xFF000000ULL) << 8) |
|
||||
((fieldB & 0xFF00000000ULL) >> 8) | ((fieldB & 0xFF00000000000000ULL) >> 40) |
|
||||
((PNGU_u64 *) buffer)[blockbase] =
|
||||
((fieldA & 0xFF00000000ULL) << 24) | ((fieldA & 0xFF00000000000000ULL) >> 8) |
|
||||
((fieldA & 0xFFULL) << 40) | ((fieldA & 0xFF000000ULL) << 8) |
|
||||
((fieldB & 0xFF00000000ULL) >> 8) | ((fieldB & 0xFF00000000000000ULL) >> 40) |
|
||||
((fieldB & 0xFFULL) << 8) | ((fieldB & 0xFF000000ULL) >> 24);
|
||||
((PNGU_u64 *) buffer)[blockbase+4] =
|
||||
((fieldA & 0xFFFF0000000000ULL) << 8) | ((fieldA & 0xFFFF00ULL) << 24) |
|
||||
@ -608,10 +608,10 @@ int PNGU_DecodeTo4x4RGBA8 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *bu
|
||||
|
||||
fieldA = *((PNGU_u64 *)(ctx->row_pointers[y*4+1]+x*16));
|
||||
fieldB = *((PNGU_u64 *)(ctx->row_pointers[y*4+1]+x*16+8));
|
||||
((PNGU_u64 *) buffer)[blockbase+1] =
|
||||
((fieldA & 0xFF00000000ULL) << 24) | ((fieldA & 0xFF00000000000000ULL) >> 8) |
|
||||
((fieldA & 0xFFULL) << 40) | ((fieldA & 0xFF000000ULL) << 8) |
|
||||
((fieldB & 0xFF00000000ULL) >> 8) | ((fieldB & 0xFF00000000000000ULL) >> 40) |
|
||||
((PNGU_u64 *) buffer)[blockbase+1] =
|
||||
((fieldA & 0xFF00000000ULL) << 24) | ((fieldA & 0xFF00000000000000ULL) >> 8) |
|
||||
((fieldA & 0xFFULL) << 40) | ((fieldA & 0xFF000000ULL) << 8) |
|
||||
((fieldB & 0xFF00000000ULL) >> 8) | ((fieldB & 0xFF00000000000000ULL) >> 40) |
|
||||
((fieldB & 0xFFULL) << 8) | ((fieldB & 0xFF000000ULL) >> 24);
|
||||
((PNGU_u64 *) buffer)[blockbase+5] =
|
||||
((fieldA & 0xFFFF0000000000ULL) << 8) | ((fieldA & 0xFFFF00ULL) << 24) |
|
||||
@ -619,10 +619,10 @@ int PNGU_DecodeTo4x4RGBA8 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *bu
|
||||
|
||||
fieldA = *((PNGU_u64 *)(ctx->row_pointers[y*4+2]+x*16));
|
||||
fieldB = *((PNGU_u64 *)(ctx->row_pointers[y*4+2]+x*16+8));
|
||||
((PNGU_u64 *) buffer)[blockbase+2] =
|
||||
((fieldA & 0xFF00000000ULL) << 24) | ((fieldA & 0xFF00000000000000ULL) >> 8) |
|
||||
((fieldA & 0xFFULL) << 40) | ((fieldA & 0xFF000000ULL) << 8) |
|
||||
((fieldB & 0xFF00000000ULL) >> 8) | ((fieldB & 0xFF00000000000000ULL) >> 40) |
|
||||
((PNGU_u64 *) buffer)[blockbase+2] =
|
||||
((fieldA & 0xFF00000000ULL) << 24) | ((fieldA & 0xFF00000000000000ULL) >> 8) |
|
||||
((fieldA & 0xFFULL) << 40) | ((fieldA & 0xFF000000ULL) << 8) |
|
||||
((fieldB & 0xFF00000000ULL) >> 8) | ((fieldB & 0xFF00000000000000ULL) >> 40) |
|
||||
((fieldB & 0xFFULL) << 8) | ((fieldB & 0xFF000000ULL) >> 24);
|
||||
((PNGU_u64 *) buffer)[blockbase+6] =
|
||||
((fieldA & 0xFFFF0000000000ULL) << 8) | ((fieldA & 0xFFFF00ULL) << 24) |
|
||||
@ -630,10 +630,10 @@ int PNGU_DecodeTo4x4RGBA8 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *bu
|
||||
|
||||
fieldA = *((PNGU_u64 *)(ctx->row_pointers[y*4+3]+x*16));
|
||||
fieldB = *((PNGU_u64 *)(ctx->row_pointers[y*4+3]+x*16+8));
|
||||
((PNGU_u64 *) buffer)[blockbase+3] =
|
||||
((fieldA & 0xFF00000000ULL) << 24) | ((fieldA & 0xFF00000000000000ULL) >> 8) |
|
||||
((fieldA & 0xFFULL) << 40) | ((fieldA & 0xFF000000ULL) << 8) |
|
||||
((fieldB & 0xFF00000000ULL) >> 8) | ((fieldB & 0xFF00000000000000ULL) >> 40) |
|
||||
((PNGU_u64 *) buffer)[blockbase+3] =
|
||||
((fieldA & 0xFF00000000ULL) << 24) | ((fieldA & 0xFF00000000000000ULL) >> 8) |
|
||||
((fieldA & 0xFFULL) << 40) | ((fieldA & 0xFF000000ULL) << 8) |
|
||||
((fieldB & 0xFF00000000ULL) >> 8) | ((fieldB & 0xFF00000000000000ULL) >> 40) |
|
||||
((fieldB & 0xFFULL) << 8) | ((fieldB & 0xFF000000ULL) >> 24);
|
||||
((PNGU_u64 *) buffer)[blockbase+7] =
|
||||
((fieldA & 0xFFFF0000000000ULL) << 8) | ((fieldA & 0xFFFF00ULL) << 24) |
|
||||
@ -653,8 +653,8 @@ int PNGU_DecodeTo4x4RGBA8 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *bu
|
||||
|
||||
PNGU_u64 field64 = *((PNGU_u64 *)(ctx->row_pointers[y*4]+x*12));
|
||||
PNGU_u64 field32 = (PNGU_u64) *((PNGU_u32 *)(ctx->row_pointers[y*4]+x*12+8));
|
||||
((PNGU_u64 *) buffer)[blockbase] =
|
||||
(((field64 & 0xFF00000000000000ULL) >> 8) | (field64 & 0xFF00000000ULL) |
|
||||
((PNGU_u64 *) buffer)[blockbase] =
|
||||
(((field64 & 0xFF00000000000000ULL) >> 8) | (field64 & 0xFF00000000ULL) |
|
||||
((field64 & 0xFF00ULL) << 8) | ((field32 & 0xFF0000ULL) >> 16) | alphaMask);
|
||||
((PNGU_u64 *) buffer)[blockbase+4] =
|
||||
(((field64 & 0xFFFF0000000000ULL) << 8) | ((field64 & 0xFFFF0000ULL) << 16) |
|
||||
@ -662,8 +662,8 @@ int PNGU_DecodeTo4x4RGBA8 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *bu
|
||||
|
||||
field64 = *((PNGU_u64 *)(ctx->row_pointers[y*4+1]+x*12));
|
||||
field32 = (PNGU_u64) *((PNGU_u32 *)(ctx->row_pointers[y*4+1]+x*12+8));
|
||||
((PNGU_u64 *) buffer)[blockbase+1] =
|
||||
(((field64 & 0xFF00000000000000ULL) >> 8) | (field64 & 0xFF00000000ULL) |
|
||||
((PNGU_u64 *) buffer)[blockbase+1] =
|
||||
(((field64 & 0xFF00000000000000ULL) >> 8) | (field64 & 0xFF00000000ULL) |
|
||||
((field64 & 0xFF00ULL) << 8) | ((field32 & 0xFF0000ULL) >> 16) | alphaMask);
|
||||
((PNGU_u64 *) buffer)[blockbase+5] =
|
||||
(((field64 & 0xFFFF0000000000ULL) << 8) | ((field64 & 0xFFFF0000ULL) << 16) |
|
||||
@ -671,8 +671,8 @@ int PNGU_DecodeTo4x4RGBA8 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *bu
|
||||
|
||||
field64 = *((PNGU_u64 *)(ctx->row_pointers[y*4+2]+x*12));
|
||||
field32 = (PNGU_u64) *((PNGU_u32 *)(ctx->row_pointers[y*4+2]+x*12+8));
|
||||
((PNGU_u64 *) buffer)[blockbase+2] =
|
||||
(((field64 & 0xFF00000000000000ULL) >> 8) | (field64 & 0xFF00000000ULL) |
|
||||
((PNGU_u64 *) buffer)[blockbase+2] =
|
||||
(((field64 & 0xFF00000000000000ULL) >> 8) | (field64 & 0xFF00000000ULL) |
|
||||
((field64 & 0xFF00ULL) << 8) | ((field32 & 0xFF0000ULL) >> 16) | alphaMask);
|
||||
((PNGU_u64 *) buffer)[blockbase+6] =
|
||||
(((field64 & 0xFFFF0000000000ULL) << 8) | ((field64 & 0xFFFF0000ULL) << 16) |
|
||||
@ -680,15 +680,15 @@ int PNGU_DecodeTo4x4RGBA8 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *bu
|
||||
|
||||
field64 = *((PNGU_u64 *)(ctx->row_pointers[y*4+3]+x*12));
|
||||
field32 = (PNGU_u64) *((PNGU_u32 *)(ctx->row_pointers[y*4+3]+x*12+8));
|
||||
((PNGU_u64 *) buffer)[blockbase+3] =
|
||||
(((field64 & 0xFF00000000000000ULL) >> 8) | (field64 & 0xFF00000000ULL) |
|
||||
((PNGU_u64 *) buffer)[blockbase+3] =
|
||||
(((field64 & 0xFF00000000000000ULL) >> 8) | (field64 & 0xFF00000000ULL) |
|
||||
((field64 & 0xFF00ULL) << 8) | ((field32 & 0xFF0000ULL) >> 16) | alphaMask);
|
||||
((PNGU_u64 *) buffer)[blockbase+7] =
|
||||
(((field64 & 0xFFFF0000000000ULL) << 8) | ((field64 & 0xFFFF0000ULL) << 16) |
|
||||
((field64 & 0xFFULL) << 24) | ((field32 & 0xFF000000ULL) >> 8) | (field32 & 0xFFFFULL));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Free resources
|
||||
free (ctx->img_data);
|
||||
free (ctx->row_pointers);
|
||||
@ -914,7 +914,7 @@ void ExtractBlock( PNGU_u8 *inPtr, int y, int x, PNGU_u32 width, int i, PNGU_u8
|
||||
/**
|
||||
* by usptactical
|
||||
* Converts a 4x4 RGBA8 image to CMPR.
|
||||
*/
|
||||
*/
|
||||
int PNGU_4x4RGBA8_To_CMPR(void *buf_rgb, PNGU_u32 width, PNGU_u32 height, void *buf_cmpr)
|
||||
{
|
||||
PNGU_u8 srcBlock[16 * 4];
|
||||
@ -926,7 +926,7 @@ int PNGU_4x4RGBA8_To_CMPR(void *buf_rgb, PNGU_u32 width, PNGU_u32 height, void *
|
||||
|
||||
width = width & ~7u;
|
||||
height = height & ~7u;
|
||||
|
||||
|
||||
// loop over blocks
|
||||
//CMPR needs 4x4 block of pixels:
|
||||
//image row 0: 0, 1, 2, 3 (first 16 block)
|
||||
@ -1063,7 +1063,7 @@ int PNGU_EncodeFromYCbYCr (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *bu
|
||||
ctx->propRead = 0;
|
||||
|
||||
// Check if the user has selected a file to write the image
|
||||
if (ctx->source == PNGU_SOURCE_BUFFER);
|
||||
if (ctx->source == PNGU_SOURCE_BUFFER);
|
||||
|
||||
else if (ctx->source == PNGU_SOURCE_DEVICE)
|
||||
{
|
||||
@ -1106,7 +1106,7 @@ int PNGU_EncodeFromYCbYCr (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *bu
|
||||
}
|
||||
|
||||
// Setup output file properties
|
||||
png_set_IHDR (ctx->png_ptr, ctx->info_ptr, width, height, 8, PNG_COLOR_TYPE_RGB,
|
||||
png_set_IHDR (ctx->png_ptr, ctx->info_ptr, width, height, 8, PNG_COLOR_TYPE_RGB,
|
||||
PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
|
||||
|
||||
// Allocate memory to store the image in RGB format
|
||||
@ -1139,7 +1139,7 @@ int PNGU_EncodeFromYCbYCr (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *bu
|
||||
ctx->row_pointers[y] = ctx->img_data + (y * rowbytes);
|
||||
|
||||
for (x = 0; x < (width / 2); x++)
|
||||
PNGU_YCbYCr_TO_RGB8 ( ((PNGU_u32 *)buffer)[y*buffWidth+x],
|
||||
PNGU_YCbYCr_TO_RGB8 ( ((PNGU_u32 *)buffer)[y*buffWidth+x],
|
||||
((PNGU_u8 *) ctx->row_pointers[y]+x*6), ((PNGU_u8 *) ctx->row_pointers[y]+x*6+1),
|
||||
((PNGU_u8 *) ctx->row_pointers[y]+x*6+2), ((PNGU_u8 *) ctx->row_pointers[y]+x*6+3),
|
||||
((PNGU_u8 *) ctx->row_pointers[y]+x*6+4), ((PNGU_u8 *) ctx->row_pointers[y]+x*6+5) );
|
||||
@ -1174,14 +1174,14 @@ PNGU_u32 PNGU_RGB8_TO_YCbYCr (PNGU_u8 r1, PNGU_u8 g1, PNGU_u8 b1, PNGU_u8 r2, PN
|
||||
y1 = (299 * r1 + 587 * g1 + 114 * b1) / 1000;
|
||||
cb1 = (-16874 * r1 - 33126 * g1 + 50000 * b1 + 12800000) / 100000;
|
||||
cr1 = (50000 * r1 - 41869 * g1 - 8131 * b1 + 12800000) / 100000;
|
||||
|
||||
|
||||
y2 = (299 * r2 + 587 * g2 + 114 * b2) / 1000;
|
||||
cb2 = (-16874 * r2 - 33126 * g2 + 50000 * b2 + 12800000) / 100000;
|
||||
cr2 = (50000 * r2 - 41869 * g2 - 8131 * b2 + 12800000) / 100000;
|
||||
|
||||
|
||||
cb = (cb1 + cb2) >> 1;
|
||||
cr = (cr1 + cr2) >> 1;
|
||||
|
||||
|
||||
return (PNGU_u32) ((y1 << 24) | (cb << 16) | (y2 << 8) | cr);
|
||||
}
|
||||
|
||||
@ -1281,7 +1281,7 @@ int pngu_info (IMGCTX ctx)
|
||||
if (!ctx->propRead)
|
||||
{
|
||||
png_get_IHDR(ctx->png_ptr, ctx->info_ptr, &width, &height,
|
||||
(int *) &(ctx->prop.imgBitDepth),
|
||||
(int *) &(ctx->prop.imgBitDepth),
|
||||
(int *) &(ctx->prop.imgColorType),
|
||||
NULL, NULL, NULL);
|
||||
|
||||
@ -1359,7 +1359,7 @@ int pngu_info (IMGCTX ctx)
|
||||
ctx->prop.trans = malloc (sizeof (PNGUCOLOR) * ctx->prop.numTrans);
|
||||
if (ctx->prop.trans)
|
||||
for (i = 0; i < ctx->prop.numTrans; i++)
|
||||
ctx->prop.trans[i].r = ctx->prop.trans[i].g = ctx->prop.trans[i].b =
|
||||
ctx->prop.trans[i].r = ctx->prop.trans[i].g = ctx->prop.trans[i].b =
|
||||
trans_values[i].gray / scale;
|
||||
else
|
||||
ctx->prop.numTrans = 0;
|
||||
@ -1384,7 +1384,7 @@ int pngu_decode_add_alpha (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, PNGU_u32
|
||||
int rowsLeft;
|
||||
png_bytep *curRow;
|
||||
int mem_err = 0;
|
||||
|
||||
|
||||
|
||||
// Read info if it hasn't been read before
|
||||
if (!ctx->infoRead)
|
||||
@ -1523,7 +1523,7 @@ void pngu_read_data_from_buffer (png_structp png_ptr, png_bytep data, png_size_t
|
||||
if (ctx->buf_size && (ctx->cursor + length > ctx->buf_size))
|
||||
{
|
||||
static char err_str[40];
|
||||
snprintf(err_str, sizeof(err_str), "read error (%x/%x)",
|
||||
snprintf(err_str, sizeof(err_str), "read error (%x/%x)",
|
||||
ctx->cursor + length, ctx->buf_size);
|
||||
png_error(png_ptr, err_str);
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ typedef struct
|
||||
|
||||
// Image context, always initialize with SelectImageFrom* and free with ReleaseImageContext
|
||||
struct _IMGCTX;
|
||||
typedef struct _IMGCTX *IMGCTX;
|
||||
typedef struct _IMGCTX *IMGCTX;
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
@ -111,7 +111,7 @@ int PNGU_GetImageProperties (IMGCTX ctx, PNGUPROP *fileproperties);
|
||||
* Image conversion *
|
||||
****************************************************************************/
|
||||
|
||||
// Expands selected image into an YCbYCr buffer. You need to specify context, image dimensions,
|
||||
// Expands selected image into an YCbYCr buffer. You need to specify context, image dimensions,
|
||||
// destination address and stride in pixels (stride = buffer width - image width).
|
||||
int PNGU_DecodeToYCbYCr (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *buffer, PNGU_u32 stride);
|
||||
|
||||
@ -121,7 +121,7 @@ int PNGU_DecodeToYCbYCr (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *buff
|
||||
PNGU_DecodeToYCbYCr (ctx, imgWidth, imgHeight, ((void *) buffer) + (coordY) * (bufferWidth) * 2 + \
|
||||
(coordX) * 2, (bufferWidth) - (imgWidth))
|
||||
|
||||
// Expands selected image into a linear RGB565 buffer. You need to specify context, image dimensions,
|
||||
// Expands selected image into a linear RGB565 buffer. You need to specify context, image dimensions,
|
||||
// destination address and stride in pixels (stride = buffer width - image width).
|
||||
int PNGU_DecodeToRGB565 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *buffer, PNGU_u32 stride);
|
||||
|
||||
@ -131,8 +131,8 @@ int PNGU_DecodeToRGB565 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *buff
|
||||
PNGU_DecodeToRGB565 (ctx, imgWidth, imgHeight, ((void *) buffer) + (coordY) * (bufferWidth) * 2 + \
|
||||
(coordX) * 2, (bufferWidth) - (imgWidth))
|
||||
|
||||
// Expands selected image into a linear RGBA8 buffer. You need to specify context, image dimensions,
|
||||
// destination address, stride in pixels and default alpha value, which is used if the source image
|
||||
// Expands selected image into a linear RGBA8 buffer. You need to specify context, image dimensions,
|
||||
// destination address, stride in pixels and default alpha value, which is used if the source image
|
||||
// doesn't have an alpha channel.
|
||||
int PNGU_DecodeToRGBA8 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *buffer, PNGU_u32 stride, PNGU_u8 default_alpha);
|
||||
|
||||
@ -159,7 +159,7 @@ int PNGU_DecodeTo4x4RGB5A3 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *b
|
||||
// destination address and default alpha value, which is used if the source image doesn't have an alpha channel.
|
||||
int PNGU_DecodeTo4x4RGBA8 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *buffer, PNGU_u8 default_alpha);
|
||||
|
||||
// Encodes an YCbYCr image in PNG format and stores it in the selected device or memory buffer. You need to
|
||||
// Encodes an YCbYCr image in PNG format and stores it in the selected device or memory buffer. You need to
|
||||
// specify context, image dimensions, destination address and stride in pixels (stride = buffer width - image width).
|
||||
int PNGU_EncodeFromYCbYCr (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *buffer, PNGU_u32 stride);
|
||||
|
||||
|
@ -34,7 +34,7 @@ struct _IMGCTX
|
||||
png_structp png_ptr;
|
||||
png_infop info_ptr;
|
||||
FILE *fd;
|
||||
|
||||
|
||||
png_bytep *row_pointers;
|
||||
png_bytep img_data;
|
||||
};
|
||||
|
@ -6,7 +6,7 @@
|
||||
// the author takes on no responsibility or liability for any use.
|
||||
//
|
||||
// QUICK DOCUMENTATION
|
||||
//
|
||||
//
|
||||
// (see also the full documentation at http://sigslot.sourceforge.net/)
|
||||
//
|
||||
// #define switches
|
||||
@ -45,7 +45,7 @@
|
||||
// errors that aren't really there. If you feel like investigating this,
|
||||
// please contact the author.
|
||||
//
|
||||
//
|
||||
//
|
||||
// THREADING MODES
|
||||
//
|
||||
// single_threaded - Your program is assumed to be single threaded from the point of view
|
||||
@ -549,7 +549,7 @@ namespace sigslot {
|
||||
|
||||
m_senders.erase(m_senders.begin(), m_senders.end());
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
sender_set m_senders;
|
||||
};
|
||||
@ -624,7 +624,7 @@ namespace sigslot {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool connected()
|
||||
{
|
||||
return m_connected_slots.size() != 0;
|
||||
@ -670,7 +670,7 @@ namespace sigslot {
|
||||
}
|
||||
|
||||
protected:
|
||||
connections_list m_connected_slots;
|
||||
connections_list m_connected_slots;
|
||||
};
|
||||
|
||||
template<class arg1_type, class mt_policy>
|
||||
@ -790,7 +790,7 @@ namespace sigslot {
|
||||
|
||||
|
||||
protected:
|
||||
connections_list m_connected_slots;
|
||||
connections_list m_connected_slots;
|
||||
};
|
||||
|
||||
template<class arg1_type, class arg2_type, class mt_policy>
|
||||
@ -910,7 +910,7 @@ namespace sigslot {
|
||||
}
|
||||
|
||||
protected:
|
||||
connections_list m_connected_slots;
|
||||
connections_list m_connected_slots;
|
||||
};
|
||||
|
||||
template<class arg1_type, class arg2_type, class arg3_type, class mt_policy>
|
||||
@ -1030,7 +1030,7 @@ namespace sigslot {
|
||||
}
|
||||
|
||||
protected:
|
||||
connections_list m_connected_slots;
|
||||
connections_list m_connected_slots;
|
||||
};
|
||||
|
||||
template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy>
|
||||
@ -1150,7 +1150,7 @@ namespace sigslot {
|
||||
}
|
||||
|
||||
protected:
|
||||
connections_list m_connected_slots;
|
||||
connections_list m_connected_slots;
|
||||
};
|
||||
|
||||
template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
|
||||
@ -1272,7 +1272,7 @@ namespace sigslot {
|
||||
}
|
||||
|
||||
protected:
|
||||
connections_list m_connected_slots;
|
||||
connections_list m_connected_slots;
|
||||
};
|
||||
|
||||
template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
|
||||
@ -1394,7 +1394,7 @@ namespace sigslot {
|
||||
}
|
||||
|
||||
protected:
|
||||
connections_list m_connected_slots;
|
||||
connections_list m_connected_slots;
|
||||
};
|
||||
|
||||
template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
|
||||
@ -1516,7 +1516,7 @@ namespace sigslot {
|
||||
}
|
||||
|
||||
protected:
|
||||
connections_list m_connected_slots;
|
||||
connections_list m_connected_slots;
|
||||
};
|
||||
|
||||
template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
|
||||
@ -1639,7 +1639,7 @@ namespace sigslot {
|
||||
}
|
||||
|
||||
protected:
|
||||
connections_list m_connected_slots;
|
||||
connections_list m_connected_slots;
|
||||
};
|
||||
|
||||
|
||||
@ -1704,7 +1704,7 @@ namespace sigslot {
|
||||
m_pobject = pobject;
|
||||
m_pmemfun = pmemfun;
|
||||
}
|
||||
|
||||
|
||||
virtual ~_connection1()
|
||||
{
|
||||
;
|
||||
|
@ -174,7 +174,7 @@ InitVideo ()
|
||||
GX_SetCopyClear (background, 0x00ffffff);
|
||||
GX_SetDispCopyGamma (GX_GM_1_0);
|
||||
GX_SetCullMode (GX_CULL_NONE);
|
||||
|
||||
|
||||
ResetVideo_Menu();
|
||||
// Finally, the video is up and ready for use :)
|
||||
}
|
||||
@ -296,7 +296,7 @@ void Menu_DrawRectangle(f32 x, f32 y, f32 width, f32 height, GXColor * color, bo
|
||||
for(i=0; i<n; i++)
|
||||
{
|
||||
GX_Position3f32(v[i].x, v[i].y, v[i].z);
|
||||
|
||||
|
||||
if(multicolor)
|
||||
GX_Color4u8(color[i].r, color[i].g, color[i].b, color[i].a);
|
||||
else
|
||||
@ -315,7 +315,7 @@ s32 TakeScreenshot(const char *path)
|
||||
IMGCTX ctx = PNGU_SelectImageFromDevice (path);
|
||||
s32 ret = PNGU_EncodeFromYCbYCr(ctx, vmode->fbWidth, vmode->viHeight, xfb[whichfb], 1);
|
||||
PNGU_ReleaseImageContext (ctx);
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user