Help - Search - Members - Calendar
Full Version: Chism FAT drvier and Dualis r19.1 & 20
1Emulation.Com > Official Emulator Forums > Dualis
alekmaul
Hello all,
My emulator MarcaDS works fine with Dualis R19 but freeze on the game list with Dualis R19.1 and Dualis R20... I think the problem is when I open the game rom file to see if a screen shot is available.
I use the last chism driver version : 2006/03/03
Can't with use these dualis versions with this chism's driver ?
Robert
I never heard of MarcaDS... turns out it's an arcade emulator that runs on a DS. Nice site too... (in French grr).
mic
The only thing regarding FAT that I've changed in those versions is that I increased the limit for number of files and added support for long filenames.
alekmaul
QUOTE (Robert @ Apr 20 2006, 09:36 AM)
I never heard of MarcaDS....
*

Yes, I am French, sorry about that tongue.gif
MarcaDS is an arcade emulator like Mame but it does not use the mame source code (too huge for DS). So you can play at games like Pacman, Donkey Kong, arkanoid, and so on (the list is in the zip file).
It is emulated about 40 games for now.
You can download the last version, you will have a readme file in Englsh too biggrin.gif !

For mic, this is very strange... unsure.gif, I have change nothing.
MarcaDS freeze if you use UP and Down keys on the list. I will try do locate the code which is responsible of the problem.

[EDIT]I have found where is the problem, it is in my zip reader, but I don't know why it does not works now.
Here is the code :
CODE
   if (_zipFile != NULL) {
     free(_zipFile);
   }
   _zipFile = NULL;
   FAT_chdir(szFATDir);
   FAT_FILE* handle = FAT_fopen(path, "r");  
   if (handle != NULL) {
     int iSSize=FAT_GetFileSize();
     _zipFile = (char*) malloc (iSSize+1);
     FAT_fread((void*) _zipFile, iSSize, 1, handle);
     FAT_fclose(handle);
   }

path is a const char * var which have the real zip filename.
mic
You could try putting printf's in front of each statement in that code to see which exact statement it freezes on.
alekmaul
OK, I have put debug mode on.
Here is the screenshot of Dualis before it is crashing (drwatson...)

The FAT_GetFileSize is ok, it is 218142 for 1942.zip arcade game.
So, I think the pb is the FAT_fread, because it crashed just after when I want to check the ZIP header (and the size of the zip file seems ok).
CODE
 if (_zipFile != NULL) {
   if ( (*_zipFile != 0x50) || (*(_zipFile + 1) != 0x4B) || (*(_zipFile + 2) != 0x03) || (*(_zipFile + 3) != 0x04) ) {
     if (isFATSystem) {
       free(_zipFile);
     }
#ifdef VERBOSE
     iprintf("Not zip file %08x\n",_zipFile);
#endif
     return 0xF0;
   }

Of course, I have made NO modification to chism's FAT driver.

Any suggestion ?
alekmaul
Also, even if it will not help you, MarcaDS is compatible with GBFS and it works fine with Dualis R20.
The problem is only with FAT driver.
mic
I have fixed a couple of bugs in the FAT emulation today. I don't know if they have anything to do with your problem, since I don't have the latest version of MarcaDS to test with.
Robert
http://www.portabledev.com/

But I can't seem to find the download section.
alekmaul
mic, I've got a bad news for you... sad.gif....

NOW, IT IS GOOD !!! tongue.gif !!!! Thanks a lot for your fast release with the fix, you're the best clapping.gif

Robert, here is the web page about MarcaDS, with download section on the bottom of the page : MarcaDS Web Page
Also, you can find others emulator i've made on my web site, a vectrex emulator and a coleco emulator.
Here are the links :
Coleco Emulator
Vectrex emulator
Also, the PSG emulation of the unreleased V0.3 of colecoDS works fine with sound in Dualis laugh.gif
At least, mic, I saw a little bug in your emulator, the video emulation works even if we access it in 8 bits (for exemple, when we are changing tiles video ram, like in MarcaDS), but it is bad because the hardware only wants 16 bits access. So some homebrew works on your emulator if we make access in 8 bits to the video memory but are not working if we use a real DS (glitchs on screen or black screen).
Robert
Thanks Alekmaul smile.gif
Mighty Max
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.
mic
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).
Mighty Max
QUOTE (mic @ Apr 23 2006, 05:21 PM)
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...
mic
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.
Mighty Max
QUOTE (mic @ Apr 24 2006, 11:21 AM)
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.
*


The latest release seems to have the seek problem fixed. Looks like it was the faulty div.
teo95gr
Off topic, a link to marca ds?
Robert
In post #10
knight0fdragon
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....
CODE
#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);
}
Mighty Max
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)

CODE
// 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
Mighty Max
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.

biggrin.gif

Proof:
All images loaded biggrin.gif
ficedula
*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?
mic
If you have an .nds file that shows the GetFileSize error that you want to make available online, I can test it and see where it ends up reading from.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.