Closed GoogleCodeExporter closed 9 years ago
Thank you very much for noticing, I didn't have twilight princess for gamecube,
so I guess I never got the chance of this happening to me.
I'll fix this in a couple hours.
ps: sorry for the late response, I saw this last week, but I didn't have time
to correct the bug since today.
Btw, what is the incorrect behavior? I'm gonna test it, I'm curious to see what
happens.
Original comment by sulokuTDCmago@gmail.com
on 3 Sep 2013 at 8:46
[deleted comment]
I've been checking the code and even in the case when trying to open gczelda
file from the memory card and the code stomps with gczelda2, then it checks the
gamecode, and as it is different, it should proceed to the next file in the
entri list...
So, what is exactly the incorrect behavior and how to reproduce it?
ps: still, I agree it is better to just use stricmp
Original comment by sulokuTDCmago@gmail.com
on 3 Sep 2013 at 9:09
A more thourough testing has revealed that the problem wasn't with the strnicmp
function, but with gamecode detection, as I stated earlier it should prevent
the behavior you experienced.
Your fix does indeed fix the bug, but the bug remains if you have 2 savegames
of the same game but from different regions, so the problem is with gamecode
detection.
I hope I can fix it soon.
Original comment by sulokuTDCmago@gmail.com
on 3 Sep 2013 at 10:14
Ok, I think I nailed it. I (and others before me) incorrectly assumed that
CARD_init()can be used to set the company and the gamecode and that it can be
called as many times as wanted to change it. But that is wrong, this function
only works the first time, which makes sense, as a game will only use a single
company and gamecode for its savefiles.
I just need to change all the card_init calls for Card_setcompany and
card_setgamecode and card_getfilenum will work correctly, no need to change it
(as it is part of libogc I'd prefer to leave it as unchanged as possible).
The program has been working because the first call to card_init is made with
null params, so this allows to list all entries in the card. In fact I myself
fixed savegame restoring (which sometimes worked and sometimes didn't) by using
card_setcompany and card_setgamecode, and then I took on GCMM. Silly me I
didn't notice then.
Original comment by sulokuTDCmago@gmail.com
on 3 Sep 2013 at 11:34
Done. I lost an mc in the process, I think it is because its old, as the
problems appear with older versions of gcmm and only in this mc (not a nintendo
MC).
_card_sectorerase failed whenever I tried to restore an image to that MC, I
couldn't find out why.
But the filename/region bug is fixed. Thanks again for noticing.
Original comment by sulokuTDCmago@gmail.com
on 3 Sep 2013 at 3:26
That make sense, I wasn't using CARD_init to set the gamecode or company
Original comment by antidote.crk@gmail.com
on 6 Sep 2013 at 5:36
Original issue reported on code.google.com by
antidote.crk@gmail.com
on 23 Aug 2013 at 8:42