Hacking Maxternal's WiiFlow plugins and Java apps.

Wiimpathy

Well-Known Member
Member
Joined
Mar 3, 2010
Messages
1,013
Trophies
2
XP
3,131
Country
France
Ok, thanks. I already tried the neek2o plugin for GC but no luck either. It won't be good for Quadforce anyway.
I keep your idea with wad manager + dml booter plugin.
It's not so important just for a few games, but I hope you get your Priimios idea working someday.
 

Wiimpathy

Well-Known Member
Member
Joined
Mar 3, 2010
Messages
1,013
Trophies
2
XP
3,131
Country
France
Well, some kind of solution to launch Quadforce games in Wiiflow (real nand) through sneek boot2. There's surely 1000 times better, but here's one way to do it. The advantages for me were to avoid the automatic wad install, and having gc/triforce games as plugins. I'll try to sum up the steps:

- Make channels with DIOS-MIOS Booter in autoboot mode for each game. In main.cpp, rename sd:/bootmii/armboot.bin to sd:/bootmii/armbootsneek.bin. Rename sd:/sneek/kernel.bin to sd:/sneek/kernelfzero.bin and so on... Install them on the emunand.

- Modify sneek2o source code to have 1 kernel.bin for each game. In es/main.c, int _main , write an ID for each channel installed. For ex., F-Zero channel (UFAX): u64 TitleIDz = 0x0001000155464158LL; Then, use LaunchTitle(TitleIDz) to launch it.

- Make a wiiflow plugin with dummy .quad files in /wiiflow/GC (like the dml booter plugin) that will check the name given as an argument ({name}=GFZJ8P.quad). Then, it renames sd:/bootmii/armbootsneek.bin to sd:/bootmii/armboot.bin, and sd:/sneek/kernelfzero.bin to sd:/sneek/kernel.bin for instance. Finally, it resets the wii and launch the channel in the emunand.

I know it may sound unclear and useless, but it's just a reminder and waiting for cleaner and better solutions.
 

Maxternal

Peanut Gallery Spokesman
OP
Member
Joined
Nov 15, 2011
Messages
5,210
Trophies
0
Age
40
Location
Deep in GBAtemp addiction
Website
gbadev.googlecode.com
XP
1,709
Country
Well, some kind of solution to launch Quadforce games in Wiiflow (real nand) through sneek boot2. There's surely 1000 times better, but here's one way to do it. The advantages for me were to avoid the automatic wad install, and having gc/triforce games as plugins. I'll try to sum up the steps:

- Make channels with DIOS-MIOS Booter in autoboot mode for each game. In main.cpp, rename sd:/bootmii/armboot.bin to sd:/bootmii/armbootsneek.bin. Rename sd:/sneek/kernel.bin to sd:/sneek/kernelfzero.bin and so on... Install them on the emunand.

- Modify sneek2o source code to have 1 kernel.bin for each game. In es/main.c, int _main , write an ID for each channel installed. For ex., F-Zero channel (UFAX): u64 TitleIDz = 0x0001000155464158LL; Then, use LaunchTitle(TitleIDz) to launch it.

- Make a wiiflow plugin with dummy .quad files in /wiiflow/GC (like the dml booter plugin) that will check the name given as an argument ({name}=GFZJ8P.quad). Then, it renames sd:/bootmii/armbootsneek.bin to sd:/bootmii/armboot.bin, and sd:/sneek/kernelfzero.bin to sd:/sneek/kernel.bin for instance. Finally, it resets the wii and launch the channel in the emunand.

I know it may sound unclear and useless, but it's just a reminder and waiting for cleaner and better solutions.
Well, to slightly simplify that process, I don't think there's any need to have a separate kernel.bin for each game since the channel autoboot in neek2o DOES work (it's the direct launching argument for a disk game through DI that's broken) so you could autoboot each DM(L) Booter channel just fine and have THEM run the GC disk game, like you said

this could be even further simplified by having a DM(L) Booter channel (maybe a hidden channel would be ideal) made to also check a memory address for the GameID it autoboots (finding a good memory address that wouldn't be overwritten, of course) so that way we could still pass the GameID to it directly from our plugin DOL and save the extra channels per game

BUT

the other thing that is broken with the last few official releases of neek2o is the correct selection of diosmios.bin, quadforce.bin, and diosmioslite.bin (for me the traditional installation of just replacing the APP file for BC doesn't even work) so unless that has been fixed in one of the most recent betas that I haven't tested, that's still a roadblock.
 

DEFIANT

a daft old man who stole a magic box and ran away
Member
Joined
Dec 9, 2008
Messages
364
Trophies
1
Location
Gallifrey
Website
www.youtube.com
XP
1,390
Country
United States
hi

i'm using your neek2o plugin for cfg loader and it's not allowing cheats to work with virtual console or wiiware. my cheats do however work with other loaders usblgx and postloader. is there a debug i could run to help you sort this issue out?
 

Maxternal

Peanut Gallery Spokesman
OP
Member
Joined
Nov 15, 2011
Messages
5,210
Trophies
0
Age
40
Location
Deep in GBAtemp addiction
Website
gbadev.googlecode.com
XP
1,709
Country
hi

i'm using your neek2o plugin for cfg loader and it's not allowing cheats to work with virtual console or wiiware. my cheats do however work with other loaders usblgx and postloader. is there a debug i could run to help you sort this issue out?
Actually, I don't know that there is a way to tell Neek2o to use cheats through an autoboot.

I'm not sure if postloader has found a way around it but USBLoaderGX Can't use Neek2o autobooting yet. It uses a similar method to how the MightyChannels plugin does it for CFG so I think you'd have to set the games you want to use cheats with to use THAT plugin, instead. If you wanted to use cheats on a game that wasn't compatible with that plugin, you're only option would then be installing it into your real NAND (and I don't actually remember how CFG handles those, if at all.)
 
  • Like
Reactions: DEFIANT

DEFIANT

a daft old man who stole a magic box and ran away
Member
Joined
Dec 9, 2008
Messages
364
Trophies
1
Location
Gallifrey
Website
www.youtube.com
XP
1,390
Country
United States
i see, shame. neek2o plugin works rather well too. gotta have my cheats. thank you for your time and answer. i will try mighty plugin again, but as of yet, i can't seem to get it to work.
 

spacepimp

Pathalogical Fantasist
Member
Joined
Feb 20, 2012
Messages
457
Trophies
1
Location
Off the Island
XP
434
Country
I've posted something similar in a quiet corner, but as it's particularly relevant here:
Under the spoiler is the (very short!) source for bootopera. It looks for a "cfg.url" file and boots (installed) opera to the url contained in that file. As it already accepts arguments, I was wondering if it might be modified to accept arguments from wiiflow instead. perhaps loading ".url" files
I could then set it up as a wiiflow plugin, with a small coverflow of bookmarks to wii suitable web content - (m.facebook, orisinal, yippy, etc.)

BootOpera:
http://wiibrew.org/wiki/BootOpera
#include <gccore.h>
#include <wiiuse/wpad.h>
#include <ogc/ios.h>
#include <fat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

static void *xfb = NULL;
static GXRModeObj *vmode = NULL;
char * url = "";

void setupVideo() {

VIDEO_Init();
vmode = VIDEO_GetPreferredMode(NULL);
VIDEO_Configure(vmode);
xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(vmode));
console_init (xfb, 20, 20, vmode->fbWidth, vmode->xfbHeight, vmode->fbWidth*VI_DISPLAY_PIX_SZ);
VIDEO_Configure(vmode);
VIDEO_ClearFrameBuffer(vmode, xfb, COLOR_BLACK);
VIDEO_SetNextFramebuffer(xfb);
VIDEO_SetBlack(0);
VIDEO_Flush();
VIDEO_WaitVSync();
if (vmode->viTVMode & VI_NON_INTERLACE)
VIDEO_WaitVSync();

}

s32 launchTitle(u64 TitleID, char * url) {
WII_Initialize();
if (url[0] != 0) {
//Load title with specified URL as an argument
return WII_LaunchTitleWithArgs(TitleID, 0, url, NULL);
} else {
return WII_LaunchTitle(TitleID);
}
}

s32 readCfg(char * path) {
int c = 0;
int i = 0;
FILE *f = fopen(path, "r");
if (f == NULL)
return 0;
fseek(f , 0 , SEEK_END);
u32 size = ftell(f);
rewind(f);
url = (char*) malloc(sizeof(char)*size);
while (c != EOF) {
c = fgetc(f);
if (31 < c && c < 127)
url[i++] = c;
}
url = '\0';
fclose(f);
return 1;
}

int main(int argc, char **argv) {
setupVideo();
fatInitDefault();
s32 ret;
if (argc > 0) {
char path[MAXPATHLEN];
int len = strlen(argv[0]);
int i = 0;
for(i = len; argv[0] != '/'; i--);
if(i < 1)
readCfg("sd:/url.cfg");
else {
argv[0] = 0;
sprintf(path, "%s/url.cfg", argv[0]);
readCfg(path);
}
}
ret = launchTitle(0x0001000148414445LL, url);
if (ret < 0) {
ret = launchTitle(0x000100014841444ALL, url);
}
if (ret < 0) {
ret = launchTitle(0x0001000148414450LL, url);
}
return ret;
}

Thanks for having a look.

EDIT:
Although he's expressed a lack of interest, Wiimpathy has kindly had a look and suggested replacing
sprintf(path, "%s/url.cfg", argv[0]);
With
sprintf(path, "%s", argv[1]);
Although I'm not absolutely sure if i should change all examples of argv[0] to argv[1].
I had wanted to try these and other variations to see if anything worked, but can't find a guide specific enough to the wii to help me compile the main.c with the required libraries into a .dol file.

Can you point me to a guide, or better still, tell me how to do it?

Thanks!

p.s. I had look another look at the homebrew guides on wiibrew, but as there are about a dozen, of quite dense material(!), I got completely intimidated and didn't know where to start.
 
  • Like
Reactions: Maxternal

Wiimpathy

Well-Known Member
Member
Joined
Mar 3, 2010
Messages
1,013
Trophies
2
XP
3,131
Country
France
There's no guide that gives details regarding makefiles, because it's not wii specific. It can be used on any platforms to compile an executable.
For a simple project, you can use the makefile from the examples, installed with DevkitPRO (in C:\devkitPRO\examples\wii\template).

Here's how to link an installed library to your project. The libraries are in C:\devkitPRO\libogc\lib\wii.
For ex., you need to access SD or USB. The lib for this is libfat.a. You tell the compiler to use it this way : -lfat
In the makefile, you add -lfat to the "LIBS :=" line. Note that the order of the libs is important, it should before -logc at least.
Same thing with other libs, for mp3 libmad.a will be -lmad, etc...

You shouldn't have to change anything else, except the libs in the makefile in order to compile only this file.
For the code itself, I already gave you some hints/explanations. The argc being the nbr of arguments, the argv are the arguments (an array of strings). The 1rst argv (argv[0]) is generally the exe name/path. You'd better use argv[1] which is the parameter you send through your plugin.ini with arguments={device}:/{path}/{name}. That'd be the path to your .cfg file that contains the url.
It's up to you to test, and find a solution that suits you now...
 

spacepimp

Pathalogical Fantasist
Member
Joined
Feb 20, 2012
Messages
457
Trophies
1
Location
Off the Island
XP
434
Country
Wiimpathy got it to compile about midnight last night - what a buzz! - and I just tried the plugin loading google from a coverflow - it works :D !
Your suggested edit worked first time - thanks, merci, danke, arigato and gracias - beaucoup! - for this and the help compiling, and just for being a good sort generally.
 
  • Like
Reactions: Maxternal

Maxternal

Peanut Gallery Spokesman
OP
Member
Joined
Nov 15, 2011
Messages
5,210
Trophies
0
Age
40
Location
Deep in GBAtemp addiction
Website
gbadev.googlecode.com
XP
1,709
Country
Wiimpathy got it to compile about midnight last night - what a buzz! - and I just tried the plugin loading google from a coverflow - it works :D !
Your suggested edit worked first time - thanks, merci, danke, arigato and gracias - beaucoup! - for this and the help compiling, and just for being a good sort generally.
Curious, does this mean you have a working BootOpera plugin DOL ?
Good job guys :D
 
  • Like
Reactions: spacepimp

spacepimp

Pathalogical Fantasist
Member
Joined
Feb 20, 2012
Messages
457
Trophies
1
Location
Off the Island
XP
434
Country

Maxternal

Peanut Gallery Spokesman
OP
Member
Joined
Nov 15, 2011
Messages
5,210
Trophies
0
Age
40
Location
Deep in GBAtemp addiction
Website
gbadev.googlecode.com
XP
1,709
Country
YES! :)

http://www.mediafire.com/view/u6hkzvtzvc2hbu8/bootopera.ini

http://www.mediafire.com/download/7dirlsopb99kaeb/bootopera.dol

I've don'e the plugin.ini slightly differently from how wiipathy suggested, so there's a link to that also.

FYI, The magic number is based on the hex for "pera" as in "Opera" ("O"'s hex value has a letter in it)

i'm just putting together some .url files for testing now!
Cool.
and definitely post in the main WiiFlow thread when you feel you've tested enough. I'm sure others (like AbdallahTerro for example) would love to have this in their collection.
 
  • Like
Reactions: spacepimp

Maxternal

Peanut Gallery Spokesman
OP
Member
Joined
Nov 15, 2011
Messages
5,210
Trophies
0
Age
40
Location
Deep in GBAtemp addiction
Website
gbadev.googlecode.com
XP
1,709
Country
My kids have recently pointed out to me that the DesMuMe plugin doesn't render well for some games.
This was because I had made it ALWAYS use the GX hardware rendering option. While it's a little bit faster for most games, some games (E.G. New Super Mario Bros.) are completely unplayable because off graphical issues.

I've now made a command line option to choose software or hardware rendering (and included 2 INI files, one for each option with different magic #'s)

http://www.mediafire.com/download/mtnlmpa7754llaw/DeSmuMe+plugin+r253+v2.zip

enjoy.
 

spacepimp

Pathalogical Fantasist
Member
Joined
Feb 20, 2012
Messages
457
Trophies
1
Location
Off the Island
XP
434
Country
I neglected to post the source - rectified!
It's short enough to go under a spoiler - the edited line changed from the bootopera source is in bold
#include <gccore.h>
#include <wiiuse/wpad.h>
#include <ogc/ios.h>
#include <fat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

static void *xfb = NULL;
static GXRModeObj *vmode = NULL;
char * url = "";

void setupVideo() {

VIDEO_Init();
vmode = VIDEO_GetPreferredMode(NULL);
VIDEO_Configure(vmode);
xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(vmode));
console_init (xfb, 20, 20, vmode->fbWidth, vmode->xfbHeight, vmode->fbWidth*VI_DISPLAY_PIX_SZ);
VIDEO_Configure(vmode);
VIDEO_ClearFrameBuffer(vmode, xfb, COLOR_BLACK);
VIDEO_SetNextFramebuffer(xfb);
VIDEO_SetBlack(0);
VIDEO_Flush();
VIDEO_WaitVSync();
if (vmode->viTVMode & VI_NON_INTERLACE)
VIDEO_WaitVSync();

}

s32 launchTitle(u64 TitleID, char * url) {
WII_Initialize();
if (url[0] != 0) {
//Load title with specified URL as an argument
return WII_LaunchTitleWithArgs(TitleID, 0, url, NULL);
} else {
return WII_LaunchTitle(TitleID);
}
}

s32 readCfg(char * path) {
int c = 0;
int i = 0;
FILE *f = fopen(path, "r");
if (f == NULL)
return 0;
fseek(f , 0 , SEEK_END);
u32 size = ftell(f);
rewind(f);
url = (char*) malloc(sizeof(char)*size);
while (c != EOF) {
c = fgetc(f);
if (31 < c && c < 127)
url[i++] = c;
}
url = '\0';
fclose(f);
return 1;
}

int main(int argc, char **argv) {
setupVideo();
fatInitDefault();
s32 ret;
if (argc > 0) {
char path[MAXPATHLEN];
int len = strlen(argv[0]);
int i = 0;
for(i = len; argv[0] != '/'; i--);
if(i < 1)
readCfg("sd:/url.cfg");
else {
argv[0] = 0;
sprintf(path, "%s", argv[1]);
readCfg(path);
}
}
ret = launchTitle(0x0001000148414445LL, url);
if (ret < 0) {
ret = launchTitle(0x000100014841444ALL, url);
}
if (ret < 0) {
ret = launchTitle(0x0001000148414450LL, url);
}
return ret;
}


Download the main.c here.
or, for the less adventurous ;), the whole package of makefile, dol etc. here

I edited a project file and a makefile from the devkit examples as suggested by Wiimpathy.

I also struggled to find and add to the makefile the stdlib.h etc...but google is my friend (at least ;)).

Experimenting with the order of libraries was key - for your reference i ended up with LIBS:= -lfat -lgcc -lwiiuse -logc

I kept getting errors, persevered, and when it eventually compiled I actually laughed aloud.

EDIT: Links updated!
 

spacepimp

Pathalogical Fantasist
Member
Joined
Feb 20, 2012
Messages
457
Trophies
1
Location
Off the Island
XP
434
Country
Maxternal I have a feature request for the source menu editor - Could you add a function to copy the BUTTON number to the first 2 characters of each title - and also delete the first two characters from the title (if they're numbers!).
It's obviously an implementation of your idea to enable button ordering in the sourceflow - I can't see Fledge looking at it anytime soon :)
 

spacepimp

Pathalogical Fantasist
Member
Joined
Feb 20, 2012
Messages
457
Trophies
1
Location
Off the Island
XP
434
Country
source editor already has a move button feature just select an icon and click move then select new location and the 2 buttons will be switched.
This made my life easy when I rearranged the source menu.
Thanks Max :)

Thanks for the pointer, but I was actually referring to the sourceflow, which only displays the sources alphabetically. By adding the [BUTTON] number to the beginning of the title, the alphabetical order will match the button order. You could even call it a "Sourceflow compatible ordering" function :) - although it is unlikely you would want to.
EDIT: The "adding the button number to the title" workaround was maxternal's idea. Thanks for that!
EDIT: " Add/Remove Button Number from Title " ?
 

spacepimp

Pathalogical Fantasist
Member
Joined
Feb 20, 2012
Messages
457
Trophies
1
Location
Off the Island
XP
434
Country
numbers take precedent in alpha/numerical ordering, no? are we getting wires crossed?
I'm referring to adding the number to the title line, just so we're clear
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: @BigOnYa, me neither