Dolphin, the GameCube and Wii emulator - Forums

Full Version: [PATCH] F-Zero and Phantasy Star Online Memory Card Manager support
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(09-24-2012, 07:33 AM)LPFaint99 Wrote: [ -> ]I haven't compiled/tested with the latest source of gcmm, but I was able to run the original 1.0/1.1 source compiled in wii mode, with the .elf file.
With most homebrew it is necessary to enable real External Frame Buffer (hacks tab of graphics config)

Thanks, enabling real external frame buffer makes the trick, even with the dol file. I looked for the option before (I read it was needed for homebrew), but I didn't see it.

Now I can work on animated banner display for GCMM ^^

(09-24-2012, 07:33 AM)LPFaint99 Wrote: [ -> ]edit: forgot to mention the icons, offhand I know that I have seen it, and haven't ever looked into it, the icon display code was written before I started work on it

Maybe, even if it isn't the best way to do it, clearing the buffer before reading a new icon fixes it.


edit: I forgot to mention that wii's and gamecube's zelda twilight princess savegames are compatible, I know it's a single game thing, but I think it is interesting to have an import/export feature for it in dolphin:
http://gbatemp.net/topic/333938-convert-gc-twilight-princess-save-to-wii/
I've got some japanese versions of the F-zero and PSO games to test if the patch worked by myself and I've noticed that Phantasy Star Online III patch is messed in two ways:

1.- I forgot to change how the filename is got for PSO3
2.- You changed the "goto" for some if/else statements and even if I didn't mess it up it still wouldn't work.

Here's the correct code for PSO_MakeSaveGameValid(), the following block of code:

Code:
// check for PSO1&2 system file
        if (strcmp((char*)direntry.Filename,"PSO_SYSTEM")!=0)
        {
                // check for PSO3 system file
                if (strcmp((char*)&FileBuffer[0].block[0x08],"PSO3_SYSTEM")==0)
                {
                        // PSO3 data block size adjustment                              
                        pso3offset = 0x10;
                }
                else
                {
                        // nothing to do
                        return 0;                                                      
                }
        }

Should be like this:

Code:
// check for PSO1&2 system file
        if (strcmp((char*)direntry.Filename,"PSO_SYSTEM")!=0)
        {
        }
        // check for PSO3 system file
        else if (strcmp((char*)direntry.Filename,"PSO3_SYSTEM")!=0)
            // PSO3 data block size adjustment                              
            pso3offset = 0x10;
        }
        else
        {
            // nothing to do
            return 0;                                                      
        }

Also, regarding icon retrieving, I finally know how to properly get the icons. There is some comment about time splitters 3 having the banner format bits in an "special" configuration, but I'm pretty sure that only bits 1,2 and 3 are used, so the content of the other ones is meaningless.

This also happens with wario ware inc., but in the icon format bytes. The "format check" that the memory card manager currently performs saves this icon, but icon retrieving stops under another condition, thus the bit pattern doesn't matter at all because there aren't any icons.

Expanding Wario Ware Inc., if we only look at the icon format u16 we may think that there are 8 icons, but there are only 4, the u16 that determines how many icons are present is actually the animation speed u16, which is what stores the number of icons and its speed, format is retrieved in reference to the animation speed u16, and not the other way around.

I don't know if I explained myself very well, but I have a patch already, I'll upload later.

I'm not certain what is wrong with the if/else that I had, if the savename is psosystem, it skips the block and offset=0 otherwise if the filename is pso3_system the offset is 0x10.

maybe the != should be == in your fix, but in that case the two are the same (except for what is being compared in pso3)
Your code seems to skip everything that does not have the PSO_SYSTEM, than checks to make sure that it is PSO3_SYSTEM, which will never happen, and it returns

I think I understand what you are saying about the icons, but in case I misunderstand, I will wait to see your patch
(10-15-2012, 03:48 AM)LPFaint99 Wrote: [ -> ]maybe the != should be == in your fix, but in that case the two are the same (except for what is being compared in pso3)
Your code seems to skip everything that does not have the PSO_SYSTEM, than checks to make sure that it is PSO3_SYSTEM, which will never happen, and it returns

Yeah, sorry, you are right, the code is fine, I didn't notice the != at the first statement and got confused. I was testing PSO3 and it didn't work, so I checked the code and erroniously thought that there was a mistake...

I'm trully sorry.

Anyways, this is still wrong (from my patch):

if (strcmp((char*)&FileBuffer[0].block[0x08],"PSO3_SYSTEM")==0)

should be

if (strcmp((char*)direntry.Filename,"PSO3_SYSTEM")==0)

This is almost surely why the code is failing for PSO3

Sorry for the trouble...
no problem Smile glad to have that cleared up
I guess I'll just use this thread instead of a new one.

Here's a patch with proper icon retrieving, or at least I think so. It also has the "repeating icon" bug fixed (it was just that for rgb icons the buffer adress wasn't updated).

By the way, the patch is for gcn-memcard-manager git this time, not dolphin-emu.

Here's the list of changes:

- Icon alpha background color is white, so banner and icons with alpha cahnnel seem transparent
- Added a new wilcard for importing savegames, which basically shows all saves (gci, gcs and sav). This is set as default (I really got frustrated of having to change the type every single time when making tests for GCMM, and I think it makes more sense at user level to just show all saves regardless the format)
- AnimSpeed in debug mode is shown as as bitmask, as icon format (which makes more sense)
- In icon retrieving I removed the "format check" as it shouldn't really matter to have mixed icon formats. Also removed the "Time splitters hack" as there's no reason for it since we are only checking the last 3 bits and I'm pretty sure having bits 1 and 2 set is the same as having them unset.
- Icon retrieving uses AnimSpeed as stop signal (every icon must have an speed set, the first speed that is 0 means there are no more icons)
- Also, in icon retrieving I added support for "blank frames"(Luigi's Mansion and Pikmin that I know of). With this the base for icon animation is complete.
- In debug mode I added showing the real flash ID as well as the scrambled flash ID. I increased a little the size of the window. By the way, I think scrolling should be added to be able to view the full bat map of the card, but I don't know how to do it.
- Fixed PSOIII savegame patch which was wrong before.

That's all I think, I'd like to add icon animation, but I've never worked with GUIs before and I'm not really sure where the code should go, actually, I think the windows is generated once and there's no loop at all, so I'm clueless about how to add animation.

Also, in the comments it said this:

// To ensure only one type of icon is used
// Sonic Heroes it the only game I have seen that tries to use a CI8 and RGB5A3 icon

But I checked Sonic heores savegame (the three regions) (and some other sonic games in case the title was wrong) and it only uses one kind of icon :S

Oh, almost forgot, when comipiling under linux, for some reason the rows don't have the propper height and icon/banners overlap. I tried to look at it but I was unable to find anything, any clue?
[attachment=8376]i don't have time at the moment to review the patch, but it sounds great. For animation, I have written simple animation code for a wxpanel, but i have not found a way to have an animated icon in the listbox. i can either edit or post the information in the next couple of days from my work, but am not sure how to best rearrange the gui. if i remember correctly I created a class with wxpanel as a parent, overloaded the paint method, and used a wxtimer and corresponding events to call paint on the object on a specified interval.
if you are unfamiliar with wxwidgets this may be too vague, but unfortunately i in class all day today.

EDIT: The code looks good, and icons look great now. I'm not sure if the background color change is ok for the dolphin because it is used in quite a few other places, maybe adding another argument to the function with the background color to use, with the default as the old value would work
we already have a function for getting the flashid in dolphin but it writes it directly to sram.
I applied your patch to the repository.

I have also attached a very ugly patch from when i started work on animated icons, it may be a starting point, or it may be useless. It is only a small amount of work, mainly because i got busy with other things and couldnt decide how to modify the layout of the gui
[attachment=8376]
I've finally taken a look at dolphin, the ColorUtil:Big Grinecode5A3 function is only used when loading icons and banners, so it shouldn't be a problem, even more, I'd say that dolphin UI will benefit from the same: banners will seem transparent, as they where supposed to be on the first place.

You can always submit wihtout changing that though.

I'm a little busy right now and I haven't looked at your work yet, if I get some time to document on wxwidgets I may take a look and see if something can be done without rewritting everything...
I don't know how I misread dolphin's source; there happens to be another function Decode5A3, but in a different namespace. I will commit the patch to dolphin in a little bit
Pages: 1 2