Hacking USB Loader with Multiple Boxart Images.

cdreams

Well-Known Member
Member
Joined
Nov 3, 2008
Messages
580
Trophies
0
Location
Edinburgh, Scotland
Website
www.shaunpauljohnston.com
XP
99
Country
I just tried my image on my tv and it looks really nice. Sure I could work on the quality of the reflections that was just a quick test to see how it looked before.

Has anyone managed to fix the smaller images problem yet. Applebelly your the one who had the original code and said you had it working, can you help out here?
 

nIxx

Well-Known Member
Member
Joined
Sep 30, 2007
Messages
1,544
Trophies
0
Location
Germany
Website
Visit site
XP
337
Country
Gambia, The
There is a simple solution for the image size use the FreeImage library
http://melpo.googlecode.com/files/FreeImage-Wii.zip
It´s only to manipulate images
wink.gif
 

cdreams

Well-Known Member
Member
Joined
Nov 3, 2008
Messages
580
Trophies
0
Location
Edinburgh, Scotland
Website
www.shaunpauljohnston.com
XP
99
Country
nixx I don't have a problem with resizing images, I have a problem that the smaller images are not loading either side of the main image. It has never worked. Applebelly mentioned something in the code but I don't understand how to use code and change it so I need someone to check it and make sure it is correct and does indeed work.
 

cdreams

Well-Known Member
Member
Joined
Nov 3, 2008
Messages
580
Trophies
0
Location
Edinburgh, Scotland
Website
www.shaunpauljohnston.com
XP
99
Country
This is what Applebelly wrote about it working, but which noyone else seems to be able to get to work.

QUOTE said:
Well two options really for the smaller images:

1) Code it so it uses the normal image, but just displays it smaller

2) Have another copy of the images as a smaller version .

I tried for ages to try and get (1), but i wanted to have something to show, so ended up going for option (2). Below is the code i'm using, if anyone can suggest an alturnative so i can do (1) then ow!

CODE
/* Select PNG data - this is the magic line */
snprintf(imgPath, sizeof(imgPath), "fat0:/images/small/small%c%c%c%c%c%c.png", ascii(header->id[0]), ascii(header->id[1]), ascii(header->id[2]), ascii(header->id[3]), ascii(header->id[4]), ascii(header->id[5]));
ctx = PNGU_SelectImageFromDevice(imgPath);
if (!ctx) {
return;
}

/* Get image properties */
ret = PNGU_GetImageProperties(ctx, &imgProp);
if (ret != PNGU_OK) {
PNGU_ReleaseImageContext(ctx);

/* No game image available so use default */
ctx = PNGU_SelectImageFromDevice("fat0:/images/small/smallnoimage.png");
if (!ctx)
return;

/* Get image properties */
ret = PNGU_GetImageProperties(ctx, &imgProp);
if (ret != PNGU_OK)
return;
}

/* Draw image */
//Video_DrawPng(ctx, imgProp, 60, 110);
Video_DrawPng(ctx, imgProp, 80, 138);


/* Free image context */
PNGU_ReleaseImageContext(ctx);

And also guys, certain people will prefer a loader that have displays, other don't. We're lucky that a lot of people are working on loader, taking it in many different directions. What may interest you may not be anything like this, but it may be suitable to some. Mynext intention is to try and get a grid with 9ish games on there, so it will be easier to navigate.

Hoping that you know how to fix and then I have the perfect loader
biggrin.gif
 

RahFah

Well-Known Member
Newcomer
Joined
Apr 10, 2009
Messages
72
Trophies
1
Age
12
XP
689
Country
Brazil
I fixed the problem of the small box don't show. I put in the small folder ONLY the box of games I have installed in HD. If I put more or all small box (400) don't show anything.
Help in my case.
 

Viro

Active Member
Newcomer
Joined
Sep 21, 2008
Messages
43
Trophies
0
Age
39
Location
New Jersey
XP
144
Country
United States
Yeh seems I'm having the small image problem too. I set up the small images in SD Root/images/small and put "small" in each file "smallABCD.png" but they still show up as blanks on the loader.
 

nIxx

Well-Known Member
Member
Joined
Sep 30, 2007
Messages
1,544
Trophies
0
Location
Germany
Website
Visit site
XP
337
Country
Gambia, The
This works

Code:
static s32 gameSelected = 0, gameStart = 0;
static s32 gameSelected2 = 1;
static s32 gameSelected3 = -1;

void __Menu_ShowGameImage(void)
{
ÂÂÂÂstruct discHdr *header = NULL;
ÂÂÂÂstruct discHdr *header1 = NULL;
ÂÂÂÂstruct discHdr *header2 = NULL;
ÂÂÂÂchar imgPath[100];
ÂÂÂÂchar imgPath2[100];
ÂÂÂÂchar imgPath3[100];
ÂÂÂÂPNGUPROP imgProp;
ÂÂÂÂPNGUPROP imgProp2;
ÂÂÂÂPNGUPROP imgProp3;
ÂÂÂÂIMGCTX ctx;
ÂÂÂÂIMGCTX ctx2;
ÂÂÂÂIMGCTX ctx3;
ÂÂÂÂs32 ret;
ÂÂÂÂs32 ret2;
ÂÂÂÂs32 ret3;
ÂÂÂÂ
ÂÂÂÂ// No game list 
ÂÂÂÂif (!gameCnt)
ÂÂÂÂÂÂÂÂreturn;

//Get the disk info struct, which has the disk id we need:
ÂÂÂÂ// Get selected game 
ÂÂÂÂheader ÂÂÂÂÂÂÂÂÂÂÂÂ= &gameList[gameSelected];
ÂÂÂÂ
ÂÂÂÂ//Previous Game selected
ÂÂÂÂheader1 ÂÂÂÂÂÂÂÂ= &gameList[gameSelected3];
ÂÂÂÂ
ÂÂÂÂ//Next Game selected
ÂÂÂÂheader2 ÂÂÂÂÂÂÂÂ= &gameList[gameSelected2];

//Create the image path:
ÂÂ 
/* Select PNG data - this is the magic line! */
ÂÂÂÂsnprintf(imgPath, sizeof(imgPath), "fat0:/images/%c%c%c%c%c%c.png", ascii(header->id[0]), ascii(header->id[1]), ascii(header->id[2]), ascii(header->id[3]), ascii(header->id[4]), ascii(header->id[5]));
ÂÂÂÂctx = PNGU_SelectImageFromDevice(imgPath);
ÂÂÂÂif (!ctx){
ÂÂÂÂÂÂÂÂreturn;
ÂÂÂÂ}
ÂÂÂÂ
ÂÂÂÂ/* Get image properties */
ÂÂÂÂret = PNGU_GetImageProperties(ctx, &imgProp);
ÂÂÂÂif (ret != PNGU_OK){
ÂÂÂÂÂÂÂÂPNGU_ReleaseImageContext(ctx);

ÂÂÂÂÂÂÂÂ/* No game image available so use default */
ÂÂÂÂÂÂÂÂctx = PNGU_SelectImageFromDevice("fat0:/images/noimage.png");
ÂÂÂÂÂÂÂÂif (!ctx)
ÂÂÂÂÂÂÂÂÂÂÂÂreturn;

ÂÂÂÂÂÂÂÂ/* Get image properties */
ÂÂÂÂÂÂÂÂret = PNGU_GetImageProperties(ctx, &imgProp);
ÂÂÂÂÂÂÂÂif (ret != PNGU_OK)
ÂÂÂÂÂÂÂÂÂÂÂÂreturn;
ÂÂÂÂ}
ÂÂÂÂ
ÂÂÂÂ//Select Previous img
ÂÂÂÂsnprintf(imgPath2, sizeof(imgPath2), "fat0:/images/small%c%c%c%c%c%c.png", ascii(header1->id[0]), ascii(header1->id[1]), ascii(header1->id[2]), ascii(header1->id[3]), ascii(header1->id[4]), ascii(header1->id[5]));
ÂÂÂÂctx2 = PNGU_SelectImageFromDevice(imgPath2);
ÂÂÂÂif (!ctx2){
ÂÂÂÂÂÂÂÂreturn;
ÂÂÂÂ}
ÂÂÂÂ
ÂÂÂÂ/* Get image properties */
ÂÂÂÂret2 = PNGU_GetImageProperties(ctx2, &imgProp2);
ÂÂÂÂif (ret2 != PNGU_OK){
ÂÂÂÂÂÂÂÂPNGU_ReleaseImageContext(ctx2);

ÂÂÂÂÂÂÂÂ/* No game image available so use default */
ÂÂÂÂÂÂÂÂctx2 = PNGU_SelectImageFromDevice("fat0:/images/noimage.png");
ÂÂÂÂÂÂÂÂif (!ctx2)
ÂÂÂÂÂÂÂÂÂÂÂÂreturn;

ÂÂÂÂÂÂÂÂ/* Get image properties */
ÂÂÂÂÂÂÂÂret2 = PNGU_GetImageProperties(ctx2, &imgProp2);
ÂÂÂÂÂÂÂÂif (ret2 != PNGU_OK)
ÂÂÂÂÂÂÂÂÂÂÂÂreturn;
ÂÂÂÂ}
ÂÂÂÂ
ÂÂÂÂ//Select next img
ÂÂÂÂsnprintf(imgPath3, sizeof(imgPath3), "fat0:/images/small%c%c%c%c%c%c.png", ascii(header2->id[0]), ascii(header2->id[1]), ascii(header2->id[2]), ascii(header2->id[3]), ascii(header2->id[4]), ascii(header2->id[5]));
ÂÂÂÂctx3 = PNGU_SelectImageFromDevice(imgPath3);
ÂÂÂÂif (!ctx3){
ÂÂÂÂÂÂÂÂreturn;
ÂÂÂÂ}
ÂÂÂÂ
ÂÂÂÂ/* Get image properties */
ÂÂÂÂret3 = PNGU_GetImageProperties(ctx3, &imgProp3);
ÂÂÂÂif (ret3 != PNGU_OK){
ÂÂÂÂÂÂPNGU_ReleaseImageContext(ctx3);

ÂÂÂÂÂÂÂÂ/* No game image available so use default */
ÂÂÂÂÂÂÂÂctx3 = PNGU_SelectImageFromDevice("fat0://images/noimage.png");
ÂÂÂÂÂÂÂÂif (!ctx3)
ÂÂÂÂÂÂÂÂÂÂÂÂreturn;

ÂÂÂÂÂÂÂÂ/* Get image properties */
ÂÂÂÂÂÂÂÂret3 = PNGU_GetImageProperties(ctx3, &imgProp3);
ÂÂÂÂÂÂÂÂif (ret3 != PNGU_OK)
ÂÂÂÂÂÂÂÂÂÂÂÂreturn;
ÂÂÂÂ}
ÂÂÂÂ
ÂÂÂÂ/* Draw image */
ÂÂÂÂ
ÂÂÂÂ//Draw previous image
ÂÂÂÂVideo_DrawPng(ctx2, imgProp2, 60, 110);
ÂÂÂÂ
ÂÂÂÂ//Draw current image
ÂÂÂÂVideo_DrawPng(ctx, imgProp, 240, 110);
ÂÂÂÂ
ÂÂÂÂ//Draw next image
ÂÂÂÂVideo_DrawPng(ctx3, imgProp3, 420, 110);
ÂÂÂÂ
ÂÂÂÂ/* Free image context */
ÂÂÂÂÂÂ PNGU_ReleaseImageContext(ctx);
ÂÂÂÂPNGU_ReleaseImageContext(ctx2);
ÂÂÂÂPNGU_ReleaseImageContext(ctx3);
ÂÂÂÂ//Get image properties, draw the image, release the context...
}

CODEvoid __Menu_MoveEntry(s8 delta)
{
ÂÂÂÂs32 index;

ÂÂÂÂ/* No game list */
ÂÂÂÂif (!gameCnt)
ÂÂÂÂÂÂÂÂreturn;
ÂÂÂÂÂÂÂÂ
if(delta>0)
ÂÂÂÂ{
ÂÂÂÂÂÂÂÂif(gameSelected == gameCnt - 1)
ÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂgameSelected = 0;
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂelse
ÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂgameSelected +=delta;
ÂÂÂÂÂÂÂÂÂÂÂÂif(gameSelected >= gameCnt)
ÂÂÂÂÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂgameSelected = (gameCnt - 1);ÂÂÂÂÂÂÂÂ
ÂÂÂÂÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂ}
ÂÂÂÂelse
ÂÂÂÂ{
ÂÂÂÂÂÂÂÂif(!gameSelected)
ÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂgameSelected = gameCnt - 1;ÂÂÂÂÂÂÂÂÂÂÂÂ
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂelse
ÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂgameSelected +=delta;
ÂÂÂÂÂÂÂÂÂÂÂÂif(gameSelected < 0)
ÂÂÂÂÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂgameSelected = 0;
ÂÂÂÂÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂ}

if(delta>0)
ÂÂÂÂ{
ÂÂÂÂÂÂÂÂif(gameSelected2 == gameCnt - 1)
ÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂgameSelected2 = 0;
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂelse
ÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂgameSelected2 +=delta;
ÂÂÂÂÂÂÂÂÂÂÂÂif(gameSelected2 >= gameCnt)
ÂÂÂÂÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂgameSelected2 = (gameCnt - 1);ÂÂÂÂÂÂÂÂ
ÂÂÂÂÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂ}
ÂÂÂÂelse
ÂÂÂÂ{
ÂÂÂÂÂÂÂÂif(!gameSelected2)
ÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂgameSelected2 = gameCnt - 1;ÂÂÂÂÂÂÂÂÂÂÂÂ
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂelse
ÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂgameSelected2 +=delta;
ÂÂÂÂÂÂÂÂÂÂÂÂif(gameSelected2 < 0)
ÂÂÂÂÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂgameSelected2 = 0;
ÂÂÂÂÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂ}

if(delta>0)
ÂÂÂÂ{
ÂÂÂÂÂÂÂÂif(gameSelected3 == gameCnt - 1)
ÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂgameSelected3 = 0;
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂelse
ÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂgameSelected3 +=delta;
ÂÂÂÂÂÂÂÂÂÂÂÂif(gameSelected3 >= gameCnt)
ÂÂÂÂÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂgameSelected3 = (gameCnt - 1);ÂÂÂÂÂÂÂÂ
ÂÂÂÂÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂ}
ÂÂÂÂelse
ÂÂÂÂ{
ÂÂÂÂÂÂÂÂif(!gameSelected3)
ÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂgameSelected3 = gameCnt - 1;ÂÂÂÂÂÂÂÂÂÂÂÂ
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂelse
ÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂgameSelected3 +=delta;
ÂÂÂÂÂÂÂÂÂÂÂÂif(gameSelected3 < 0)
ÂÂÂÂÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂgameSelected3 = 0;
ÂÂÂÂÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂ}

the rest as always

Here the main.c (most likely you need to change the position of the small pictures)
http://www.zshare.net/download/58471270e6bd8d3d/
and the dol
http://www.zshare.net/download/584713972521b836/
 

Viro

Active Member
Newcomer
Joined
Sep 21, 2008
Messages
43
Trophies
0
Age
39
Location
New Jersey
XP
144
Country
United States
would ya by chance have a .dol with that programmed in? fraid i'm not familiar how to implement the coding. my apologies heh
 

cdreams

Well-Known Member
Member
Joined
Nov 3, 2008
Messages
580
Trophies
0
Location
Edinburgh, Scotland
Website
www.shaunpauljohnston.com
XP
99
Country
Yeah a dol with it implemented would be perfect. I don't know how to deal with code either. I apologise for hassling and given more work and it's greatly appreciated.

I am trying to contribute by fixing this image to look as neat as possible.

Do you think you would be able to add the idea I had for the info page (check a few pages back for what I mean)?
 

nIxx

Well-Known Member
Member
Joined
Sep 30, 2007
Messages
1,544
Trophies
0
Location
Germany
Website
Visit site
XP
337
Country
Gambia, The
Don´t forget that you will possibly need to change the postition of the small*.png pictures
For example
Code:
//Draw previous image at position 60, 110
Video_DrawPng(ctx2, imgProp2, 60, 110);
 

TrickyTony

Well-Known Member
Member
Joined
Oct 8, 2008
Messages
374
Trophies
1
XP
364
Country
United States
cdreams, I am giving this a few days to develop but I like what you are doing, do those reflections actually reflect the cover art or will it just be that white gradient?
 

cdreams

Well-Known Member
Member
Joined
Nov 3, 2008
Messages
580
Trophies
0
Location
Edinburgh, Scotland
Website
www.shaunpauljohnston.com
XP
99
Country
Ok I just tried the new dol you posted and it's still not showing any of the small images.

I put them in the main images folder and I also put them inside Root/images/small/ and nothing showed at all. The main image works fine.

nIxx, can I possibly ask you to use my image and get it to work where the images show large and small. I know it's a bit much to ask but I can't do the code stuff myself. I'm also on a Mac which doesn't help at all when trying to alter stuff.

Regarding the info page, is it possible to code into the loader that if you press say button 1, it could load a totally seperate background that would show information on what each button does and how the loader works, then by pressing again it would go back to the original background with the game pictures?

Posts merged

TrickyTony, they will just be as they are, I don't know how to code that kind of stuff so unless someone makes that then it's all I can offer unfortunately.
In fact I think I could work out a way to do it just with edited images but it would mean making all the cover again but just adding the reflection there on the actual image, but you would probably have to lose the outline around the boxes. Tricky one so it is lol.
 

AppleBelly

Well-Known Member
OP
Newcomer
Joined
Apr 20, 2007
Messages
80
Trophies
0
XP
201
Country
Where are you putting the small files and can you list here a full name of one? Upload some and i will try.

Should be sd:/images/small/ and file name smallXXXX.png

I managed to get network download of images integrated last night, so all this work of having to download images and place them on an SD card could be old news! Need to clean up the code a bit and then will post.

Need to speak to djtax about getting smaller versions of his images on the site as well.

If anyone has any ideas about how to make the normal images just appear slightly smaller, please speak now!
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Psionic Roshambo @ Psionic Roshambo: https://m.youtube.com/watch?v=UyxeZ7JYwZs&pp=ygUJVnIgaXMgZ2F5 +1