As of version 0.3.5 of the Homebrew Browser, it now allows users to access other repositories than the CodeMii one which can be useful if say you are developing a game and you wish to let your users test out your latest revision with the ability to have all previous revisions available too.
How the Homebrew Browser works
The way the homebrew browser works is it requests a text file from the server. In this text file, homebrew applications are listed with descriptions, file sizes, folders to create, etc. The HBB then parses this list and categories it into 5 categories which are Demos, Emulators, Games, Media and Utilities as you may already know. Once you open up a homebrew application in the HBB and select download, it downloads the zip file and the icon.png image and then extracts that zip file to the correct folder. Once complete, it deletes that zip file.
To have your repository added to HBB, you need to create a listing file, create zip files for each application and have the applications icon.png file available too. This will all be explained below.
Listing file – Application format
It’s important to make sure the listing file is all correct as any mistakes may cause the HBB to crash. Below is an example program in the listing file. An example listing file can be found here.
fceugx 1248957612 8367 5529824 dol 4460665 124625 5 wwwwgncs /fceugx;/fceugx/roms;/fceugx/saves FCE Ultra GX Tantric 3.0.8 5555718 Nintendo Emulator This is a port of FCE Ultra 0.98.12 to the Wii.
It isn’t an XML listing file but rather just a simple file, with spaces and some lines. Lets go ahead and read this application.
The first line is the application’s folder name “fceugx”, this is the name of the folder where this application is stored and is the same name which is given to the zip file.
We see a number next to it “1248957612” this is the unix time stamp of when this application version was created.You can generate a unix timestamp from a date here.
The next number “5529824” is the actual file size of the boot.dol or boot.elf file.
After that we see “dol”, this tells HBB that the file we look for is boot.dol (for boot.elf it would just have “elf”).
After that we have “4460665” which is the folder size of the zip file and icon.png file, this helps HBB correctly display how much MB is remaining to a user when they are downloading an application.
Next we have “124625” which is the number of downloads this application has had which is taken from a database, however in your case you should set this to “0”.
After that is “5” which is the average user rating, again you should set this to “0”.
The controllers support come next “wwwwgncs”, this one shows 4 wiimotes are supports (“wwww”). To set to one wiimote only have “w”, for 2 have “ww”, etc. “g” stands for gamecube. “n” stands for nunchuck. “c” stands for classic controller. “s” stands for SDHC compatible. “k” (not shown) stands for keyboard. “z” (not shown) stands for Wii Zapper.
Next up is the folders to create “/fceugx;/fceugx/roms;/fceugx/saves”. As you can see they always need to start with a slash “/” and if you have more than one folder to create place a “;” to indicate the end of the directory and start of a new one. The directories should be listed top down, meaning you can’t have “/fceugx/roms” first as “/fceugx” won’t exist before that and it will fail. It will create “/fceugx” and then “/fceugx/roms” and then “/fceugx/saves”
Next line down is the application name “FCE Ultra GX”. Next line down is the application’s author “Tantric” and then version “3.0.8” and then the total folder size of the application once it’s been extracted “5555718”. After that we have a short description “Nintendo Emulator” which should be kept quite short otherwise the text will run off the screen and finally the applications long description “This is a port of FCE Ultra 0.98.12 to the Wii” which will be shown once a user clicks into that application. (If you have the text running off the screen which can happen, insert some spaces before the word that runs off the screen).
And we are finally done for just that one application, long wasn’t it? Lucky you have this guide and I will be providing you a PHP script used to generate the numbers fairly quickly which is what I currently use.
Listing file – Categories
As I mentioned above there are 5 categories. The listing file starts off with this first line of which only “Homebrew” is of importance but you are still required to have this complete line:
Homebrew 0 0 .
After that line the HBB knows the games category applications listing begins (you must have at least one here). You then list applications as set up as above. Once you are done with the applications in the games category you end it off with:
Next up is the emulator applications and ends off with:
And repeat for the rest of these:
If you have no applications for a category, you must leave the =<category_name>= but you just don’t list any applications before it.
You can have a look at the official CodeMii list file here: http://www.codemii.com/hbb/homebrew_browser/listv035.txt
The folder structure is important to have correct, otherwise when users try to download an application it will immediately fail.
Say your “root” directory is /hbb and you would like to allow users to download an application called “fceugx” (this is shown above in application format, it’s on the first line and is the first word in that line). You would create an fceugx directory under /hbb and in that directory will be a fceugx.zip file and an icon.png file. Also as well as icon.png you need a fceugx.png file to place in the /hbb directory, this is the image that will show up in HBB. Here is how it should look:
Zip folder structure
Now we talk about the actual folder structure inside our example “fceugx.zip” file. The structure is as it would be on the root of the SD/USB device, this is so applications can use folders outside of the main application folder like /data or /fceugx/roms, etc. Make sure that you do not include the icon.png file in the zip. Below is an example zip folder structure for fceugx.
Here is an example repository which may help you understand this all a bit better: http://hbbtest.bravehost.com/hbbtest/listv030.txt
As you can see this repository only has applications in the games categories. The first application is ShootMii and the ShootMii.zip, icon.png and ShootMii.png are accessible here:
Woah… this is all too complicated
Luckily for you if you have Apache and PHP (e.g. WAMP which is easy to install), you can download my PHP scripts which will fill in the file sizes, time stamps, image size, folder size; mostly all the easy bits which would otherwise take forever to do manually. This means all you need to do is fill in the actual content like name, author, controllers, description, etc.
Here is an example repo with my PHP and bat scripts: repo_example
Submit your repositiory
Before submitting your repository please note that repositories will be routinely checked for any content deemed illegal and if this content is found, your repository will need to be removed for legal reasons.
Double check that you’ve got all the text and numbers in the right places and compare your listing file to the example one given above.
Email me at firstname.lastname@example.org with the subject “Add repository” and I’ll check that it firstly works ok and then add it in the repository list. This may take 1 to 2 days.