View unanswered posts | View active topics It is currently Fri Jul 20, 2018 5:28 pm



Reply to topic  [ 7 posts ] 
 fseek() doesn't work any more as it should 
Author Message

Joined: Sun Dec 28, 2008 3:07 pm
Posts: 8
Hi,
I just updated devkitpro to the new version, and now my small homebrew project for the NDS doesn't work anymore on the No$GBA. To be precise, the line
Code:
fseek (f , 0 , SEEK_END);

returns garbage now - it returns a size in the range of ~2GB.
But it fails only on the No$GBA! (I use the same steps as described here.) On the NDS, my project does fine. I tried to recompile the fcsr.dldi, but that didn't help either.
Regards,
ain


Sun Mar 01, 2009 8:24 pm
Profile

Joined: Fri Mar 20, 2009 1:51 am
Posts: 7
i has the same issue when using ftell(). Tested both on ideas and no$gba. On real hard works nice...
Anyone knows how to fix it ?


Mon Mar 23, 2009 10:22 pm
Profile

Joined: Sun Dec 28, 2008 3:07 pm
Posts: 8
I got a solution for my problem, don't know if it helps in your case.

I now include filesystem.h and write the following:

Code:
if(!nitroFSInit())
{
   if(!fatInitDefault())
   return false;
}


... instead of initialising libfat only. This way it works on No$GBA and on hardware.

HTH,
ain


Tue Mar 24, 2009 2:23 pm
Profile

Joined: Fri Mar 20, 2009 1:51 am
Posts: 7
Hi!
Including #include <filesystem.h> then adding you code i just get a erro compiling

1>main.o: In function `main':
1>c:/NDS/projects/nflib/nflib/source/main.cpp(29): undefined reference to `nitroFSInit()'
1>collect2: ld returned 1 exit status
1>make[1]: *** [/c/NDS/projects/nflib/nflib/nflib.elf] Error 1
1>make: *** [build] Error 2

Im using makefile from FAT example of R25 and Visual C++ 2005 Express to compile.

I fixed (for now) by using old version of fat.h & fat.o, but i get some warning at compile, but it works at least on no$gba.
Hope this will be fixed, it's realy usefull can test code on the emulator.


Tue Mar 24, 2009 4:47 pm
Profile

Joined: Sun Dec 28, 2008 3:07 pm
Posts: 8
NightFox wrote:
Including #include <filesystem.h> then adding you code i just get a erro compiling


You get a linker error, not compiler error. :) You need to add the filesystem lib to your make file, just set "-lfilesystem" before "-lfat".

HTH,
ain


Wed Mar 25, 2009 10:03 pm
Profile

Joined: Fri Mar 20, 2009 1:51 am
Posts: 7
Ok
Still not working, ftell() still returning a size of 2112157696 bytes (when real size of file is 24576 bytes) running it on no$gba or ideas.
by the way, to can compile with filesystem.h, i detected a small bug on filesystem.h to can compile right with Visual C++

The filesystem.h that comes with R25 is

Code:
#ifndef _filesystem_h_

bool nitroFSInit();

#endif // _filesystem_h_


And to can compile under C++ should be

Code:
#ifndef _filesystem_h_

#ifdef __cplusplus
extern "C" {
#endif

bool nitroFSInit();

#ifdef __cplusplus
}
#endif

#endif // _filesystem_h_


By the way, it still not working on emu ^^

Regards

Fox


Wed Mar 25, 2009 11:10 pm
Profile

Joined: Sun Dec 28, 2008 3:07 pm
Posts: 8
Works for me. :/


Fri Mar 27, 2009 1:19 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
  Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.
Get devkitPro at SourceForge.net. Fast, secure and Free Open Source software downloads