Author Topic: New Dingoo SDK : SIM file ?  (Read 11229 times)

alekmaul (OP)

  • Posts: 330
    • Portabledev
New Dingoo SDK : SIM file ?
« on: April 10, 2010, 07:24:24 am »
I tried to compile smsggoo with the new SDK and two problems occured :
- i don't know how to make sim file, flatmush do you have a solution (except renaming .app to .sim ^^) ?
- the .app is really huge (1.3Mb , the old one was 200Kb ...), for this pb,  i will check lib that are in makefile to make sure that i do not include unused lib but if you have some tips flatmush, you're welcome ;)

xdpirate

  • Posts: 490
Re: New Dingoo SDK : SIM file ?
« Reply #1 on: April 10, 2010, 10:51:30 am »
I'm not flatmush lawls, but here's what you got to smack in your code for .SIM:

Code: [Select]
#ifndef WIN32
typedef struct tagSYMBOLENTRY
{
unsigned long address;
const char* name;
} SYMBOLENTRY;

#define DL_EXPORT_SYM(sym) \
__attribute__ ((section (".export_string"))) \
static const char _string_##sym[] = #sym;\
__attribute__ ((section (".export_table"))) \
static const SYMBOLENTRY _sym_##sym = { (unsigned long)&sym, _string_##sym };

/* file extension name */
int GetFileType(char* pname)
{
if (pname)
strcpy(pname, "EXT"); // Emulator ROM extensions (use "EXT|EXT|EXT" for several file-type associations)
return 0;
}

/* to get default path */
int GetDefaultPath(char* path)
{
if (path)
strcpy(path, "A:\\GAME");
return 0;
}
/* module description, optional */
int GetModuleName(char* name, int code_page)
{
if (name && (0 == code_page)) // ansi
strcpy(name, "EMULATORNAME.SIM");  //your emulator file name
return 0;
}
DL_EXPORT_SYM(GetFileType)
DL_EXPORT_SYM(GetDefaultPath)
DL_EXPORT_SYM(GetModuleName)
#endif /* WIN32 */

flatmush

  • Posts: 288
Re: New Dingoo SDK : SIM file ?
« Reply #2 on: April 10, 2010, 03:52:29 pm »
Quote
I'm not flatmush lawls
Turns out you were better in this case, I didn't know that, thanks for the info.

Alek, I dunno why your app is so large, unless you're embedding data into your app using bin2.h, or using every part of the SDK (very unlikely). If you send me what you got so far, or where you think the problem is then I'll have a look.

Harteex

  • * Administrator
  • Posts: 713
    • Harteex Productions
Re: New Dingoo SDK : SIM file ?
« Reply #3 on: April 10, 2010, 04:25:56 pm »
To ensure that your makefile is error free you could always copy the one from any sample, such as AstroLander, and work your way from there.

alekmaul (OP)

  • Posts: 330
    • Portabledev
Re: New Dingoo SDK : SIM file ?
« Reply #4 on: April 10, 2010, 06:57:46 pm »
I'm not flatmush lawls, but here's what you got to smack in your code for .SIM:

Thanks for the tip but i know that, all my emus use this thing to launch files. ;)
Tjhe pb is that the .app/.sim file is not recognise, when i want to run it with, for example .gg file, it 's not ok. It was ok with the previous sdk.
About large file, i'm not using something about sdk, only your new sdk (i do a fresh install of cygwin and your sdk flatmush), i will check the map file to know where the pb is.

flatmush

  • Posts: 288
Re: New Dingoo SDK : SIM file ?
« Reply #5 on: April 10, 2010, 07:16:14 pm »
I think that the SIM problem is todo with the linking used in the new SDK and the fact that it uses elf2app rather than dlmake.

I'll have a look into it but it's not my strongpoint so if anyone has any ideas then I'd love to hear them.

alekmaul (OP)

  • Posts: 330
    • Portabledev
Re: New Dingoo SDK : SIM file ?
« Reply #6 on: April 10, 2010, 07:32:31 pm »
ok, i will try to find how to do .sim files (and yes, the pb is in elf2app for me also).
About file size, i think the data are now is the same section than the code (.text ?), so now when you declare something like unsigned short temp1[320*240], it increases the code size of 2*320*240 bytes ...
I do not have same behaviour with previous sdk.
Perhaps a pb with my dingoo.xn file ? i will check it also ...

flatmush

  • Posts: 288
Re: New Dingoo SDK : SIM file ?
« Reply #7 on: April 10, 2010, 08:59:09 pm »
Data should only be included with the code if it's initialized, but not sure. I always malloc large data at runtime as needed.

I've decoded the app/sim file format so I'm making a better elf2app which should work better, so this may not be a problem soon.

alekmaul (OP)

  • Posts: 330
    • Portabledev
Re: New Dingoo SDK : SIM file ?
« Reply #8 on: April 11, 2010, 06:03:10 am »
Data should only be included with the code if it's initialized, but not sure. I always malloc large data at runtime as needed.

I've decoded the app/sim file format so I'm making a better elf2app which should work better, so this may not be a problem soon.
If you only declare unsigned short temp[320*240], it will be, actually, included with code, even if it's not initialized. It's only a little pb because we can modify the content of data, but the .app is really huge :/.
Nice to see that you will modify elf2app ;)

flatmush

  • Posts: 288
Re: New Dingoo SDK : SIM file ?
« Reply #9 on: April 11, 2010, 07:40:19 pm »
Download the latest version of the SDK (rev 83) from googlecode (zip or svn), it should work with SIM files, and removes the allocated data from the file. So it should work, don't use those export macros though, they shouldn't be needed.

Code: [Select]
typedef struct tagSYMBOLENTRY
{
unsigned long address;
const char* name;
} SYMBOLENTRY;

/* file extension name */
int GetFileType(char* pname)
{
if (pname)
strcpy(pname, "EXT"); // Emulator ROM extensions (use "EXT|EXT|EXT" for several file-type associations)
return 0;
}

/* to get default path */
int GetDefaultPath(char* path)
{
if (path)
strcpy(path, "A:\\GAME");
return 0;
}
/* module description, optional */
int GetModuleName(char* name, int code_page)
{
if (name && (0 == code_page)) // ansi
strcpy(name, "EMULATORNAME.SIM");  //your emulator file name
return 0;
}

Just that bit of code needed.

alekmaul (OP)

  • Posts: 330
    • Portabledev
Re: New Dingoo SDK : SIM file ?
« Reply #10 on: April 12, 2010, 06:06:40 am »
ok, it works, file is now 260kb and my dingoo can recognize .sim emulator again  !
Thanks a lot flatmush, you're great !!!

Just a little pb, file is renamed .app even if i use some predicate in Makefile with .sim, like that :
Quote
all : $(APP_NAME).sim

$(APP_NAME).sim : $(APP_NAME).elf
   $(DINGOO_SDK)/tools/elf2app/elf2app $(APP_NAME)

I have now to fix timing pb, sound threading and keys  that are not ok with new sdk.

flatmush

  • Posts: 288
Re: New Dingoo SDK : SIM file ?
« Reply #11 on: April 12, 2010, 01:20:00 pm »
Yeah, elf2app just takes the app name and appends .elf to get the elf file to read, and .app to write the output. For the min you'll just have to add:
Code: [Select]
mv $(APPNAME).app $(APPNAME).sim
I'll add a commandline switch or something at some point.

flatmush

  • Posts: 288
Re: New Dingoo SDK : SIM file ?
« Reply #12 on: April 12, 2010, 04:22:29 pm »
There's now a sample of how to build SIM files in the SDK, it's a tga viewer.

yefeng

  • Posts: 33
Re: New Dingoo SDK : SIM file ?
« Reply #13 on: April 13, 2010, 06:31:16 am »
yeah,it's very simple,thank you flatmush,from your example i learn a way how to write a *.sim application, ;D,But he tga_viewer.sim can't read dingoo_sdk\samples\fgl_sphere_demo\earth.tga,I don't know where is the error!

flatmush

  • Posts: 288
Re: New Dingoo SDK : SIM file ?
« Reply #14 on: April 13, 2010, 01:42:40 pm »
I threw together the TGA viewer pretty quick and neglected to check if the size of the TGA was bigger than the screen, if the TGA is larger than the screen then it will crash, I'll fix it at a later date.

Harteex

  • * Administrator
  • Posts: 713
    • Harteex Productions
Re: New Dingoo SDK : SIM file ?
« Reply #15 on: April 13, 2010, 06:24:36 pm »
Fixed in r102.

The problem was that it tried to draw images in negative x and y positions (if they were larger than the screen). The draw function now ignores those pixels which are at negative coords.

Nickeng

  • Guest
Re: New Dingoo SDK : SIM file ?
« Reply #16 on: April 14, 2010, 12:49:44 pm »
ok, it works, file is now 260kb and my dingoo can recognize .sim emulator again  !
Thanks a lot flatmush, you're great !!!

Just a little pb, file is renamed .app even if i use some predicate in Makefile with .sim, like that :
Quote
all : $(APP_NAME).sim

$(APP_NAME).sim : $(APP_NAME).elf
   $(DINGOO_SDK)/tools/elf2app/elf2app $(APP_NAME)

I have now to fix timing pb, sound threading and keys  that are not ok with new sdk.

Are you looking to do some development again Alek, I thought you had stopped on the A320.
Miss the work you do on it..

kswildside

  • Guest
Re: New Dingoo SDK : SIM file ?
« Reply #17 on: April 14, 2010, 04:23:21 pm »
I think Alek always intended to come back just had projects to work on ;)

alekmaul (OP)

  • Posts: 330
    • Portabledev
Re: New Dingoo SDK : SIM file ?
« Reply #18 on: April 14, 2010, 06:48:32 pm »
I think Alek always intended to come back just had projects to work on ;)
exact, i'm also a developper on DS so i need some time to share between DS and Dingoo ^^

 

Post a new topic
Post a new topic