#153630 - HyperHacker - Thu Apr 03, 2008 5:45 am
I don't know if people have been just not seeing my posts or ignoring them or what but one of these things is definitely broken.
The hardware all works fine; I've tested on 2 different DSes (DS and DS Lite) with 2 different MicroSD cards (the included one and a 2GB Kingston) and 2 different GnMs, and have tried both DLDI patches.
This is a simple test case. Since the ARM9 code is ~12 lines (excluding comments and whitespace) and the ARM7 code is a simple infinite loop I am extremely doubtful it has a bug. I used a zip file to preserve the directory structure, makefile etc but the relevant code fits nicely in this post:
ARM9:
ARM7:
It simply turns one screen red, calls fatInitDefault() in a loop, and if it succeeds, turns the screen green and loops forever. It never succeeds.
The problem is not as simple as "will not mount", though. This app won't mount. However, others do with varying degrees of success.
The app I'm working on now: At first it wouldn't mount at all. Then it randomly would. Now it does every time (though sometimes taking several seconds) but stat() hangs. Previously it was returning -1, which is not an error code I could find anywhere, now it just doesn't return at all.
The boot menu included with Chishm's loader: Works fine.
LMP v1.02: Was working fine, but recently has been freezing at random. Sometimes after hours, sometimes after one second. It never did this on GBAMP.
Every app randomly takes between ~1 and ~15 seconds to mount.
Now there's an obvious pattern here:
1) My app is compiled with the latest versions of libFAT and libNDS, and it works, but stat() hangs.
2) The test case also uses the latest versions, and does almost nothing, and it doesn't work at all.
3) LMP uses older versions, and it works but randomly crashes.
4) Chishm's menu uses older versions (most likely not the same as LMP), and it works.
My guess is that some routine has changed and the DLDIs don't like it (leaving the hardware in an unexpected state or something), and that most every app calls this routine at least once. Though I've tried twiddling various bits in REG_EXMEMCNT to no avail.
I haven't been changing much of anything. Basically just adding on-screen debug output to the app to see what's going on. One or two files on the card get modified every now and then. In other words the effects seem to be fairly random.
Is nobody else having these problems? Am I the only one using this crappy card? Am I invisible?
[edit] Yeah, the test program works fine after fixing the glaringly obvious bug that I can't believe nobody else pointed out. -_-; *hangs head in shame for not seeing that sooner* Even stat() works fine there. Time to figure out who's stomping my memory.
_________________
I'm a PSP hacker now, but I still <3 DS.
The hardware all works fine; I've tested on 2 different DSes (DS and DS Lite) with 2 different MicroSD cards (the included one and a 2GB Kingston) and 2 different GnMs, and have tried both DLDI patches.
This is a simple test case. Since the ARM9 code is ~12 lines (excluding comments and whitespace) and the ARM7 code is a simple infinite loop I am extremely doubtful it has a bug. I used a zip file to preserve the directory structure, makefile etc but the relevant code fits nicely in this post:
ARM9:
Code: |
int main(int argc, char** argv)
{ //sysSetBusOwners(true, true); //REG_IME = 0; videoSetMode(MODE_0_2D | DISPLAY_BG0_ACTIVE); vramSetMainBanks(VRAM_A_MAIN_BG_0x06000000, VRAM_B_LCD, VRAM_C_LCD, VRAM_D_LCD); BG0_CR = BG_TILE_BASE(1) | BG_MAP_BASE(1); BG0_X0 = -1; BG0_Y0 = -1; BG_PALETTE[0] = RGB15(31, 0, 0); do { swiWaitForVBlank(); } while(!fatInitDefault()); BG_PALETTE[0] = RGB15(0, 31, 0); while(true) swiWaitForVBlank(); return 0; } |
ARM7:
Code: |
int main(int argc, char** argv)
{ while(true) swiWaitForVBlank(); return 0; } |
It simply turns one screen red, calls fatInitDefault() in a loop, and if it succeeds, turns the screen green and loops forever. It never succeeds.
The problem is not as simple as "will not mount", though. This app won't mount. However, others do with varying degrees of success.
The app I'm working on now: At first it wouldn't mount at all. Then it randomly would. Now it does every time (though sometimes taking several seconds) but stat() hangs. Previously it was returning -1, which is not an error code I could find anywhere, now it just doesn't return at all.
The boot menu included with Chishm's loader: Works fine.
LMP v1.02: Was working fine, but recently has been freezing at random. Sometimes after hours, sometimes after one second. It never did this on GBAMP.
Every app randomly takes between ~1 and ~15 seconds to mount.
Now there's an obvious pattern here:
1) My app is compiled with the latest versions of libFAT and libNDS, and it works, but stat() hangs.
2) The test case also uses the latest versions, and does almost nothing, and it doesn't work at all.
3) LMP uses older versions, and it works but randomly crashes.
4) Chishm's menu uses older versions (most likely not the same as LMP), and it works.
My guess is that some routine has changed and the DLDIs don't like it (leaving the hardware in an unexpected state or something), and that most every app calls this routine at least once. Though I've tried twiddling various bits in REG_EXMEMCNT to no avail.
I haven't been changing much of anything. Basically just adding on-screen debug output to the app to see what's going on. One or two files on the card get modified every now and then. In other words the effects seem to be fairly random.
Is nobody else having these problems? Am I the only one using this crappy card? Am I invisible?
[edit] Yeah, the test program works fine after fixing the glaringly obvious bug that I can't believe nobody else pointed out. -_-; *hangs head in shame for not seeing that sooner* Even stat() works fine there. Time to figure out who's stomping my memory.
_________________
I'm a PSP hacker now, but I still <3 DS.