Jump to content

Chism FAT drvier and Dualis r19.1 & 20


alekmaul

Recommended Posts

  • Replies 22
  • Created
  • Last Reply

Top Posters In This Topic

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

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).

 

 

hmm, yeah you'r right... darn that bastard has to hide somewhere...

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 2 weeks later...

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 by knight0fdragon
Link to comment
Share on other sites

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.log

and on hardware: http://mightymax.org/HW_BMP.log

 

The original bmp.lst file both tests used is http://mightymax.org/bmp.lst

Edited by Mighty Max
Link to comment
Share on other sites

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.

 

:banghead:

 

Proof:

All images loaded ;)

dualis01.png

Link to comment
Share on other sites

  • 3 weeks later...

*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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...