Mighty Max Posted April 23, 2006 Share Posted April 23, 2006 Hey mic, could you check if BytesPerCluster is in Synch with SectorPerCluster? That's the only difference i can see atm that fseek (which is still not working correct here) with the in fread() included seek to next sector differs. Link to comment Share on other sites More sharing options...
mic Posted April 23, 2006 Share Posted April 23, 2006 Do you mean filesysBytePerClus ? It's calculated in chishm's library as filesysBytePerSec * filesysSecPerClus, where filesysBytePerSec is hardcoded as 512 (same sector size I use in dualis) and filesysSecPerClus is taken from the master boot record (this is set to 16 in dualis). Link to comment Share on other sites More sharing options...
Mighty Max Posted April 24, 2006 Share Posted April 24, 2006 Do you mean filesysBytePerClus ? It's calculated in chishm's library as filesysBytePerSec * filesysSecPerClus, where filesysBytePerSec is hardcoded as 512 (same sector size I use in dualis) and filesysSecPerClus is taken from the master boot record (this is set to 16 in dualis).<{POST_SNAPBACK}> hmm, yeah you'r right... darn that bastard has to hide somewhere... Link to comment Share on other sites More sharing options...
mic Posted April 24, 2006 Share Posted April 24, 2006 You could try modifying fseek to print out the values of certain variables at strategic places and compare them to what you'd expect them to be. Link to comment Share on other sites More sharing options...
Mighty Max Posted May 3, 2006 Share Posted May 3, 2006 You could try modifying fseek to print out the values of certain variables at strategic places and compare them to what you'd expect them to be.<{POST_SNAPBACK}> The latest release seems to have the seek problem fixed. Looks like it was the faulty div. Link to comment Share on other sites More sharing options...
teo95gr Posted May 16, 2006 Share Posted May 16, 2006 Off topic, a link to marca ds? Link to comment Share on other sites More sharing options...
Robert Posted May 16, 2006 Share Posted May 16, 2006 In post #10 Link to comment Share on other sites More sharing options...
knight0fdragon Posted May 29, 2006 Share Posted May 29, 2006 (edited) i dont know if anyone is experiencing this, but when I FAT_fopen(..."r") then close it, then FAT_fopen(..."w") dualis seems to crash when i want to write to the file on the DS, i believe that it just freezes on the DS, but that may just be because its having the issues with the writing to begin with, just something that should be looked into perhaps ??? thanks for ur time fixed ds bug, seems like an emu issue what the code looks like....#include <nds.h> #include "../../general/command.h" #include <nds/arm9/console.h> //basic print funcionality #include <stdio.h> #include <stdlib.h> #include <gbfs.h> // filesystem functions #include "gba_nds_fat/gba_nds_fat.h" FAT_FILE *fps; int main(void) { //irqs are nice lcdMainOnBottom(); FAT_InitFiles(); fps = FAT_fopen("a.txt","r"); FAT_fclose(fps); fps = FAT_fopen("a.txt","w"); int wasWritten = FAT_fwrite("0",1, 1, fps); FAT_fclose(fps); } Edited May 29, 2006 by knight0fdragon Link to comment Share on other sites More sharing options...
Mighty Max Posted May 30, 2006 Share Posted May 30, 2006 (edited) I got another error with Chishm's Fat driver on dualis. (Its related to the crash i told you on IRC, mic) I added a log-write to what bitmaps i am reading, and the result was not what i expected on dualis. (I added HW and dualis results at the end) // all images LPORDEREDLIST bitmaps = 0; void LoadImages(void) { #define LOGME FAT_FILE *lst = FAT_fopen("bmp.lst","r"); #ifdef LOGME FAT_FILE *log = FAT_fopen("bmp.log","w+"); #endif if (lst==0) return; bitmaps = new ORDEREDLIST(); char *line = new char[100]; while (!FAT_feof(lst)) { FAT_fgets(&line[0],100,lst); #ifdef LOGME FAT_fputs("Read line:",log); FAT_fputs(line,log); FAT_fputs("\n",log); #endif int id,flag,r,g,b; char bmpname[100]; if ((line[0]>32) && (line[0]!='#')) { sscanf(&line[0],"%d %s %d %d %d %d",&id,&bmpname[0],&flag,&r,&g,&b); LPBITMAP tmp = new BITMAP(bmpname); if (flag & 1) tmp->ApplyKeycolor(RGB15(r >> 3,g >> 3,b >> 3)); bitmaps->AddEntry(id,tmp); #ifdef LOGME FAT_fputs("Bitmap load\n",log); } else { FAT_fputs("It's a comment\n",log); #endif }; }; delete line; FAT_fclose(lst); FAT_fclose(log); }; That results in this log.txt on dualis: http://mightymax.org/Dualis_BMP.logand on hardware: http://mightymax.org/HW_BMP.log The original bmp.lst file both tests used is http://mightymax.org/bmp.lst Edited May 30, 2006 by Mighty Max Link to comment Share on other sites More sharing options...
Mighty Max Posted May 30, 2006 Share Posted May 30, 2006 As you mentioned on IRC that you can't tell if it isn't some sideeffekt through the interlacing read&writes etc... i updated my sources to read the whole.lst in one buffer and manually go through the lines. That works just fine on Dualis. Proof: All images loaded Link to comment Share on other sites More sharing options...
ficedula Posted June 17, 2006 Share Posted June 17, 2006 *bump* Another problem I'm having with Dualis - using the latest version of Chism's code, the GetFileSize() function appears to return 0 when I use it under Dualis? FileOpen/Read etc. is all OK, just GetFileSize is wrong. Anybody else had this problem? Any known workarounds? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now