Emulator Issues #853
closedMake WADs appear in the browser
0%
Description
Since WAD emulation works better and better, I thought it would be nice of
the WADs were displayed in the browser instead of opening them manually.
Thanks.
Updated by sl1nk3.s over 15 years ago
- Status changed from New to Accepted
yep, Would be really nice to have
Updated by lpfaint99 over 15 years ago
marc...@cox.net: do you not have any dumped wads from your wii?
if you need some to test with and have dumped a wii game you can extract
RVL-NigaoeNR-v4.wad.out.wad (Mii channel) from the update partition
Updated by sl1nk3.s over 15 years ago
Maybe we should add a SubMenu in the File menu with somes CheckItem like "Show Wii
Games" "Show GC Games" "Show Wad Files" ?
These sounds easy to add.
To support wad files in the GameList, we'll need good documentation about wad files,
to retrieve wad's name, animation etc...
Updated by marcus over 15 years ago
ah. Thanks for the tip about the mii channel. I'll test it.
Updated by Valentin.Meriel over 15 years ago
I think it isn't difficult read them .Wad .
There are programs with their source code anywhere who can create or edit Wad.
Wad file contains information such as a wii games on DVD.
With their name, identification numbers (4 character) and baniere.bin .
In fact you can create a channel for the wii format .Wad from a game for the run via
the usb loader directly from your desktop.
Updated by marcus over 15 years ago
- Issue type set to Feature request
- Priority set to Normal
- Category set to ui
- Relates to usability set to Yes
- Operating system N/A added
Updated by XTra.KrazzY over 15 years ago
WAD files don't have GameIDs or game names AFAIK
Updated by daco65 over 15 years ago
in a quick notice i made dolphin add wads to the list but the problem is getting the
info from the wad (gameid if it has that, the title & notes are the most important)
anyone?
note: to disable the wad loading comment the #define WAD_LOAD in GameListCtrl.cpp
Updated by marcus over 15 years ago
Shoot, I'll have to look it up and see if I can find anything.
Updated by marcus over 15 years ago
game id: 3728-3731 (FAGE for super mario bros, HACA for mii channel. someone will
have to make sure this correct)
The game name and notes are probably in the encrypted header
(http://wiibrew.org/wiki/WAD). Where/when in a Dolphin runtime would I look for a
decrypted header? Like, if I loaded a wad, what variable contains the decrypted
header? Do I just look somewhere in the game memory of the dolphin-debugger window?
Updated by marcus over 15 years ago
Oh, and this page may be of use:
http://wiibrew.org/wiki/Tmd_file_structure
Updated by daco65 over 15 years ago
ye i think it might be best to start a different class (wads). ill change that in a bit
Updated by marcus over 15 years ago
(by "header", I meant everything before the game data, including ticket, tmd, and cert)
Updated by daco65 over 15 years ago
updated a bit. moved it to isofile
should be better in the end :)
just need to figure out how to do it (and read alot about the wad :P )
Updated by death2droid over 15 years ago
daco65 that patch stuffs up some of the tabs in ISOFile.cpp
Updated by death2droid over 15 years ago
Open up the patch file and check you're self :P
Updated by daco65 over 15 years ago
the tabbing is fine, i added an extra if and so an extra tab...
unless the patch upload is fucked it should be fine
Updated by daco65 over 15 years ago
added some hacky shit making the title the filename for now so its easier to know
which wad is which
Updated by death2droid over 15 years ago
Cool.
Thanks for uploading.
I'll see if i can do anything to improve it.
Using the file name is a good idea :P
Updated by death2droid over 15 years ago
Ok managed to repair the properties menu for the wad but it also brakes all the
features of the properties menu for now. :P
Updated by death2droid over 15 years ago
Ok I'm going to make the iso and wad stuff separated.
Updated by death2droid over 15 years ago
Ok just need to get it implemented into game list control
If anyone can do it for me that would be great!
Updated by Anonymous over 15 years ago
Use the second 32bit value from the wad's tmd titleID entry for the gameID (it is an
ascii value) -
would be a lot better than using a hash imo
Updated by daco65 over 15 years ago
i agree on shuffle here, using that titleid should be waaay better then a hash
Updated by death2droid over 15 years ago
Yeah it defiantly would be.
i have no experience with that sort of stuff tho
Updated by death2droid over 15 years ago
Ok i made some modifications so if a wad is selected it won't show the option to view
properties or compress/decompress.
If anyone can get me the code for getting that 32bit value I would be happy :)
Updated by death2droid over 15 years ago
Ok I'll upload it in a as soon as possible.
Updated by death2droid over 15 years ago
Nothing special about the patch besides the checks to disable features that don't
work for wads for the time being...
Updated by daco65 over 15 years ago
i just wanna be in sync with your work to see what you do and how you did it
Updated by daco65 over 15 years ago
note, if you are going to make a new class for wad files then change everything will
ya. like, in gamelistctrl you decide wether to use iso or wad class, and use its own
check for validation (and maybe make WadFile.h / cpp)
Updated by death2droid over 15 years ago
I ended up ditching that idea.
I couldn't get it to work as i wanted it to.
There's a patch with the files i made
http://dolphin-emu.googlecode.com/issues/attachment?aid=-2867406310439739810&name=Patch.patch
Updated by daco65 over 15 years ago
so basicly you made everything that existed for iso and made it for wad? o.o
Updated by death2droid over 15 years ago
No
I was just trying to get the basics done for it but i couldn't get it to be
implemented game list control :(
Updated by sl1nk3.s over 15 years ago
It looks like each Wad file contains a sort of Unencrypted Wii opening.bnr file right
after the encrypted app data.
So actually, you should be able to read the name of the game from there as well as
the banner.bin, the icon.bin and the sound.bin...
This opening.bnr starts at :
Header Size + Cert size + ticket size + TMD size + App Size
Each one aligned to 0x40 bytes, these sizes can be read in the header (see
http://wiibrew.org/wiki/WAD_files)
As an example, on World of goo it starts at : 0x40 + 0xA00 + 0x2C0 + 0x340 + 0x2B68B00
on the Opera browser it's 0x40 + 0xA00 + 0x2C0 + 0x3C0 + 0x234BA80
etc...
From there we can read the name of the wad in every language, and we could even use
the banner.bin or icon.bin...
Hopefully it'll give this wad browser a kick start, if this wasn't already known, of
course :P
Updated by Valentin.Meriel over 15 years ago
Ho thank you for your explanation, I looked how his throughout a weekend. Now thanks
to this clarification I can do something.
I shall be working tonight.
Updated by daco65 over 15 years ago
ill look into it this weekend if i remember :P
Updated by Valentin.Meriel over 15 years ago
I worked on it and I soon finished, but I display the name of the wad but not other
thing (I haven't the level to make more) andmy code is not really beautiful.
Updated by death2droid over 15 years ago
Upload what you have got when you can :P
I'll look to see it.
Updated by Valentin.Meriel over 15 years ago
I finished my little piece of code and works perfectly well.
But there is a small problem: when you resize the window of the emulator we would say
that my code reads the name of all that wad is that it seems that the emulator break.
Updated by death2droid over 15 years ago
Upload the source code then.
I'll look into it.
Updated by Valentin.Meriel over 15 years ago
My patch is not god but it contains my code.
Updated by daco65 over 15 years ago
works fine for me man o_O;
and nice job
next time keep it english comments/code ok? :)
some things done make sense to me tho, why make a bool "true"(vrai) and give it value
false?
also, im going to clean it up a bit and try to translate some if my french wont be
failing me XD
Updated by Valentin.Meriel over 15 years ago
ok you can clean my code vrai is just a bool variable I think vrai may be replaced by
offset_found (name of variable) because this variable tells us if it is true or false.
Updated by daco65 over 15 years ago
which i replaced with while(1) & break; , but im still trying to get it cleaner. once
thats done im going to post this here
so to finish it we still need description/country(if thats available in
wads)/company. now the question is if the wads contain such data
Updated by Valentin.Meriel over 15 years ago
wad not have country flag or description (I haven't see their) but i think un banner
could be read from wad.
Updated by daco65 over 15 years ago
probably. so we'll only have to add the content/title id (if they are unique ) so we
can use the properties like any other game and/or cache it
also, here is the patch back a bit cleaned up from all those variables :P
it still lacks a check if the wad is real or not. can be easly done by checking the
first 6 bytes. should be 0x00 0x00 0x00 0x20 0x49 0x73 ... (ill do that later on )
Updated by lpfaint99 over 15 years ago
is defining WAD_LOAD necessary?
I would prefer m_IsNotWad to be m_IsWad otherwise m_IsNotWad = false reads as a
double negative. just my $0.02
Updated by daco65 over 15 years ago
lol, i even ignored that stuff. (the double negative, which is always stupid)
the define is handy for me (public builds or private) , you guys dont have to use it :P
Updated by lpfaint99 over 15 years ago
lol, forgot you do the public builds. I assume it will be removed when its commited.
There's a few changes that I would like to add, just need to get home and make sure
they compile :P
I think the region is stored in the header,maybe the fourth digit of the titleid? I
don't have any wads here to test with
Updated by daco65 over 15 years ago
ye the define will be removed when comitting :P
also, get wad from wii games?
Updated by marcus over 15 years ago
Yeah, you can dump them from Brawl or something like that. nigao (mii channel) is
the only one that works (not really, it only boots and shows some messed-up video
output).
Updated by marcus over 15 years ago
Actually, you can get a sysmenu and an ios wad from every single wii game (afaik).
Updated by lpfaint99 over 15 years ago
that would require having a game here :P. I don't have VS or any games here at work
Updated by Valentin.Meriel over 15 years ago
I think you made a mistake in your patch in get cert size you forgot
fseek ( pFile, 0x10, SEEK_SET );
and your while(1) I don't understand if while is always true you couldn't go out of
while ??? no (ou alors je comprend rien lol)
Updated by lpfaint99 over 15 years ago
the while (1) ends when break; is reached
Updated by daco65 over 15 years ago
ye i did lol, i noticed it while i was trying stuff XD its added back in this patch
and it shouldn't load fake wads now
also while(1) just means itll keep looping untill you force it to stop ( break; )
Updated by Valentin.Meriel over 15 years ago
ok I'm a noob.
I made this small patch to learn programming. In fact val532 that's me lol. Therefore
is not the first that I did.
Updated by daco65 over 15 years ago
hey, im still learning while programming myself :)
that fgets i just knew from my other project ;D
at least you did something very nice XD
Updated by Valentin.Meriel over 15 years ago
For Title ID I think is in TMD and encrypted but when you save game this title ID is
the name of the folder where is the save and I think dolphin créate a "banner.bin" we
could use it right?
Updated by sl1nk3.s over 15 years ago
Bien joué :D
Except for a few things, as said
(http://code.google.com/p/dolphin-emu/issues/detail?id=853#c48)
this : offset = 0x40 + cert_size + tik_size + tmd_size + app_size; should be aligned
to 0x40 bytes (that's why the header size which is always 20 becomes 40)
Once that's done you can remove the "look for IMET" part and just read from the
beginning of the "sort of" opening.bnr as you would then have an accurate address.
Also, how did you get that "0x71 is the distance to "I" (IMET) to first leter of
name" ? on all of my WiiWare, it's 0x28 :( anyway, as i said you should just read
from the beginning of the opening.bnr, the offset to the english name should be 0x157
Another thing, i'm sure the code can be cleaned up using the current ISO code, maybe
move it to DiscIO > Volume too ? this way we can use the volume code etc.. ?
Updated by Valentin.Meriel over 15 years ago
In fact we read the second name of wad because the first is in japan !!!
(sinon je comprend pas trop cette histoire d'alignement à 0x40 et si j'ai fait
recherché IMET c'est parce que la distance entre le I et la première lettre du second
Nom est toujours identique alors que la distance entre l'adresse d'offset et IMET
varie selon les wad j'ai fait plusieurs test)
(au faite c'est pas interdit de parlé en français pour d'autre français parce que
j'ai mal au crane à force de pensé en anglais pour corrigé google trad pour que ce
soit à peut prés compréhensible et comme on peut le remarqué je suis pas une fléché
non plus en français)
Updated by Valentin.Meriel over 15 years ago
a litle up date for patch now you can sort wad game wii game and GC game in tree
category.
The .XPM is ugly but you can improve it.
Updated by sl1nk3.s over 15 years ago
- Status changed from Accepted to Work started
Updated by death2droid over 15 years ago
une-adre...@hotmail.fr that newer patch would break the platform column plus WAD is
for wii :P
Updated by lpfaint99 over 15 years ago
patch "wad name 2" updated for r3334, simplified a tiny bit of code
Updated by lpfaint99 over 15 years ago
also une-adre...@hotmail.fr your 'Platform_Wad.xpm' file is missing from your patch,
so It is also missing from mine.
will not compile until either your xpm file is added to the patch
or commenting out lines 76, and changing line 90 to load a different xpm like
Platform_Wii_xpm
Updated by daco65 over 15 years ago
some1 made a typo when assigning the wad xpm :P but thats minor. i like what im seeing ;D
Updated by daco65 over 15 years ago
so this should be a up to date patch with the xpm
Updated by death2droid over 15 years ago
You can probably fine somewhere where cert_size and stuff could remain :P
And call them as functions
Updated by daco65 over 15 years ago
that can get better lol
give me 5minutes d2d
Updated by Valentin.Meriel over 15 years ago
That's what I wanted to do at the beginning: a function to an action.
But it was a bit complicated for me to create.
Mii wad is probably different.
Updated by Valentin.Meriel over 15 years ago
I just discovered something.
When you create a save game wad file banner.bin that is created and it contains
everything you need.
It just remains to be read by the emulator file when scanning the wad file.
The rest of the code is still useful but a bit less now.
Updated by Valentin.Meriel over 15 years ago
There should be a version adapted for the wad of:
// check if we can get some infos from the banner file too
DiscIO::IFileSystem* pFileSystem = DiscIO::CreateFileSystem(pVolume);
if (pFileSystem != NULL)
{
DiscIO::IBannerLoader* pBannerLoader = DiscIO::CreateBannerLoader(*pFileSystem);
if (pBannerLoader != NULL)
{
if (pBannerLoader->IsValid())
{
pBannerLoader->GetName(m_Name); //m_Country == DiscIO::IVolume::COUNTRY_JAP ?
1 : 0);
pBannerLoader->GetCompany(m_Company);
pBannerLoader->GetDescription(m_Description);
if (pBannerLoader->GetBanner(g_ImageTemp))
{
m_ImageSize = DVD_BANNER_WIDTH * DVD_BANNER_HEIGHT * 3;
m_pImage = new u8[m_ImageSize]; //(u8*)malloc(m_ImageSize);
for (size_t i = 0; i < DVD_BANNER_WIDTH * DVD_BANNER_HEIGHT; i++)
{
m_pImage[i * 3 + 0] = (g_ImageTemp[i] & 0xFF0000) >> 16;
m_pImage[i * 3 + 1] = (g_ImageTemp[i] & 0x00FF00) >> 8;
m_pImage[i * 3 + 2] = (g_ImageTemp[i] & 0x0000FF) >> 0;
}
}
}
delete pBannerLoader;
}
delete pFileSystem;
Updated by daco65 over 15 years ago
this is much better d2d :P
less memory usage (wtf was that pFile2 all about?!!!?) and now cert,tik & tmd share
the same function as they did the same calculation anyway :)
Updated by marcus over 15 years ago
lp: You just need a wii game ISO (it doesn't have to boot or anything...) and then
you can right click on it and extract the wads that you want from the update
partition.
hondza: Yes, it crashes. The point is that we can see the data inside it even if
it's not bootable in dolphin (or crashes right after booting).
Updated by marcus over 15 years ago
lp: wait, I just looked up at the top of the comments and saw that it was YOU who
told me about the mii channel booting and how to extract it XD. I guess you don't
need me to baby-talk you through it then.
Updated by XTra.KrazzY over 15 years ago
IMHO we should ALWAYS extract the banners as we load the game list for the first time
(i.e. creating the cache). This way, we won't have a "NO BANNER" on every wii game we
didn't save in...
Updated by XTra.KrazzY over 15 years ago
OK I'm almost done with my auto-extractor, which will make WADs show up with
information. The only thing I have to do is extract the banner.bin from opening.bnr.
Updated by sl1nk3.s over 15 years ago
Here is a cleaner patch using the same path that the current IVolume code use, it can
thus read the banner.bin from the Wii FS, and can also open the Wii save folder, now
we need a better "wad" image and someone to finish XK's job :D
Updated by sl1nk3.s over 15 years ago
- Status changed from Work started to Fixed
committed in r3348, please find bugs :D
Updated by Valentin.Meriel over 15 years ago
The code made by XTra.KrazzY for banner.bin reading is not finished right?
Otherwise now that you can read the information would wad it may be time to include
the title ID to sav state?
Updated by daco65 over 15 years ago
everything of wads should work now (slinkes finished it)
there is still 1 or 2 bugs but it works ;D
not sure if he completed XK's source tho, didn't look yet
Updated by lpfaint99 over 15 years ago
there are some wads that cause dolphin to close without error, I will try and
debug this later today
Updated by XTra.KrazzY over 15 years ago
My code just makes the banner.bin recognized without saving a game, which is pretty
useful for games which don't boot or to play the actual wii menu animation
Updated by Valentin.Meriel over 15 years ago
Dolphin is also close without error for any reason for at certain time.
Like when I stop a game and I want to change settings pressing a button and is closed
dolphin. So the GUI is very unstable.
Updated by sl1nk3.s over 15 years ago
yes, it seems like stopping a game is still rather unstable, if you don't wait a bit
before using the GUI it sometimes crash for no reasons, but that's another problem :p
What about the wads that close dolphin without error ? sounds odd, when/how does it
happen ?
Updated by lpfaint99 over 15 years ago
as mentioned on irc, crash occurs when getmakerid returns "" for wads with a makerid
of 0x0000