View unanswered posts | View active topics It is currently Sat Dec 20, 2014 6:49 pm



Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
 Why SDL can't load an image via wiiload instead of sd card ? 
Author Message

Joined: Fri Aug 19, 2011 8:17 am
Posts: 12
hi
I'm having a hard time loading an image with the SDL library via wiiload ... but when i put the image on sd card it works well .. so .. is there anyway to load the image using SDL directly form my laptop ( using wiiload ) ?? or the only way is using sd card

this is the code when I use sd card :

Code:
background = SDL_LoadBMP("sd:/apps/SDL/background.bmp");

but when I use this :

Code:
background = SDL_LoadBMP("background.bmp");

it does not work

please help


Fri Aug 26, 2011 6:41 am
Profile
Site Admin

Joined: Tue Aug 09, 2005 3:21 am
Posts: 1142
Location: UK
No, currently you can't load files via wiiload other than from the SD card as you've been doing.

I've just modified wiiload so you can set argv0 from the command line though, this will let you change the initial working directory set when the SD card is initialised. You can either build wiiload yourself, it's in SVN at http://devkitpro.svn.sourceforge.net/vi ... i/wiiload/ , or you can grab the builds I've just put up at https://sourceforge.net/projects/devkitpro/files/misc/ . The tarball only has wiiload 0.5.1 binaries for win32 & OSX atm, I didn't have time to build the linux versions. The binaries are still showing as pending atm but should hopefully be live soon.

when you're running the new wiiload just add the path you want as the first parameter after the dol
Code:
wiiload mysdlapp.dol sd:/apps/SDL/mysdlapp.dol


Adding the name of the dol isn't necessary but the trailing slash is.

_________________
devkitPro IRC support
Personal Blog


Fri Aug 26, 2011 1:49 pm
Profile ICQ WWW

Joined: Fri Aug 19, 2011 8:17 am
Posts: 12
thank you so much ... but as you can see .. I'm a totally noob to consoles programming .. so i have one question :
Is the way that you just did to modify wiiload .. is it going to solve my problem ?? if it is ... please can you explain in details a little bit because I really have no idea what you are talking about .

one more question ... what do you think is the most efficient and easiest library to use with wii programming other than SDL ??


Sat Aug 27, 2011 1:38 am
Profile
Site Admin

Joined: Tue Aug 09, 2005 3:21 am
Posts: 1142
Location: UK
Yes, this mod will solve your problem.

When the wii SDL port starts up the SD card it will attempt to set the working directory using the path it finds in argv[0]. When you run directly from SD card via HBC then that path is set to the path of the dol you just loaded i.e. sd:/apps/SDL/test.dol When running via wiiload argv[0] is normally just set to the name of the dol which leads to the directory being set to sd:/.

What I did allows you to set argv[0] directly so you can effectively specify the working directory your application is in when it starts up. This means you need to have your data files on the SD card already but since these change less often than the code it's much less inconvenient than having to copy the DOL to SD every time you want to test.

Stick with SDL, at least that way you'll learn something useful while you still need "efficient and easy". There are other libraries around but if you attempt to get Wii specific while not really understanding the underlying code then you'll end up extremely frustrated when you start looking at programming other things.

_________________
devkitPro IRC support
Personal Blog


Sun Aug 28, 2011 10:58 am
Profile ICQ WWW

Joined: Fri Aug 19, 2011 8:17 am
Posts: 12
I know that i'm a pain in the ass but actually all what I need is a well explained steps on what to do with the new WiiLoad that you just made and how to make it work with SDL for loading images directly .

by the way : what do you think in MLib ??


Wed Aug 31, 2011 9:58 am
Profile

Joined: Fri Aug 19, 2011 8:17 am
Posts: 12
I said that I don't know what to do in the previous post :

- Because I don't know how to set argv0 from the command line ? and what do you mean by that ?

- And I don't know what to do with the files in the second link , where you said that " or you can grab the builds I've just put up at https://sourceforge.net/projects/devkitpro/files/misc/ " . it only contains a source file and a makefile , and I have no idea what the heck to do with them .

- And where can I find this code :
Code:
wiiload mysdlapp.dol sd:/apps/SDL/mysdlapp.dol


thank you so much man :D


Wed Aug 31, 2011 10:17 am
Profile
Site Admin

Joined: Tue Aug 09, 2005 3:21 am
Posts: 1142
Location: UK
Most libraries there are out there which claim to make writing Wii games easier are a pile of complete and utter nonsense, generally they should be avoided at all costs. I'm quite reluctant to even recommend SDL but at least with that library you can learn something relatively useful.

You need to download wiiload-0.5.1.tar.bz2, inside that archive are binaries of wilload for OSX and Windows. Replace the wiiload in your devkitPPC/bin folder with the appropriate binary. These binaries will be available inside the next toolchain update.

In the Makefile for your project you should see a line like this :-
Code:
#---------------------------------------------------------------------------------
run:
   wiiload $(TARGET).dol


add something lke sd:/apps/SDL/$(TARGET).dol to the end of that line, it should be the path you used for SDL_LoadBMP originally.

You should then be able to run your code using "make run" from the command line, assuming you have the WIILOAD environment variable set appropriately. You should also be able to add a command to your editor so that it works directly from there.

Unfortunately I really have to say that the whole toolchain setup right now probably isn't suitable for someone who's a complete beginner. You may possibly be better off learning to program SDL on a PC and coming back later when you have more experience and we have some more documentation suitable for beginners.

_________________
devkitPro IRC support
Personal Blog


Wed Aug 31, 2011 4:20 pm
Profile ICQ WWW

Joined: Fri Aug 19, 2011 8:17 am
Posts: 12
- I replaced the old wiiload 0.5 with the new wiiload 0.5.1

- I set the image in the same file as the template.elf and template.dol

- this is my image load code :

Code:
background = SDL_LoadBMP("texture.bmp");


- this is my makefile code :

Code:
run:
   wiiload $(TARGET).dol texture.bmp


- And finally the result is a nice Black Screen and nothing alse.

- do you have any idea what to do ???


Wed Aug 31, 2011 6:27 pm
Profile
Site Admin

Joined: Tue Aug 09, 2005 3:21 am
Posts: 1142
Location: UK
No, put the image files on the SD card.

Your original loadBMP command was
Code:
background = SDL_LoadBMP("sd:/apps/SDL/background.bmp");


So, make sure you have the /apps/SDL/ directory on your SD card, place your image files in there and put sd:/apps/SDL/ where you currently have texture.bmp in the makefile. That first parameter is a path, not a file - normally it should be the full path and name of the dol you're executing but obviously in this case we're transferring the dol via wiiload.

Please don't start new threads to ask the same questions, they will be deleted.

_________________
devkitPro IRC support
Personal Blog


Wed Aug 31, 2011 8:56 pm
Profile ICQ WWW

Joined: Fri Aug 19, 2011 8:17 am
Posts: 12
but you said that you found a solution in post number 4 for loading images directly via wiiload !!! :?: I already know how to load via sd card

anyways thanks man for everything I really appreciate your help ... thanks again


Wed Aug 31, 2011 9:59 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 18 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: Google [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
  Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.
Get devkitPro at SourceForge.net. Fast, secure and Free Open Source software downloads