Author Topic: Platform Independant Dingoo SDK  (Read 52934 times)

flatmush (OP)

  • *
  • Posts: 283
Re: Platform Independant Dingoo SDK
« Reply #75 on: January 09, 2011, 04:40:19 pm »
Done.

flatmush (OP)

  • *
  • Posts: 283
Re: Platform Independant Dingoo SDK
« Reply #76 on: February 12, 2011, 12:28:28 am »
There's been an important update to the SDK, it can be downloaded from googlecode as usual:
Code: [Select]
Added libmad library for MP3 decoding.
Added smlgui library which provided an on-screen virtual keyboard including sample.
Updated AstroLander with 3D and particle effects.
New install/update system.
Implemented getcwd.

Download Here
« Last Edit: February 12, 2011, 10:25:26 am by flatmush »

Harteex

  • * Administrator
  • Posts: 709
    • Harteex Productions
Re: Platform Independant Dingoo SDK
« Reply #77 on: February 13, 2011, 02:24:03 am »

flatmush (OP)

  • *
  • Posts: 283
Re: Platform Independant Dingoo SDK
« Reply #78 on: February 16, 2011, 10:37:51 pm »
The latest SDK version (r324) has been uploaded and is available in the usual place:
http://code.google.com/p/dingoo-sdk/downloads/detail?name=dingoo_sdk_r324.zip

Code: [Select]
Updated fgl to support non-power-of-two texture sizes, this fixes the astrolander bonus build.
Replaced internal print and sprintf functions with more robust/standard versions.
Implemented realpath(), rename(), unlink() and partial stat().

flatmush (OP)

  • *
  • Posts: 283
Re: Platform Independant Dingoo SDK
« Reply #79 on: February 24, 2011, 10:58:33 pm »
We now have a wikipedia page, which can be found here:
http://en.wikipedia.org/wiki/Dingoo_SDK

If people can help by keeping it alive and up-to-date then that'd be great.
« Last Edit: February 24, 2011, 11:05:45 pm by flatmush »

protomank

  • *
  • Posts: 96
    • Rockbot Game Engine
Re: Platform Independant Dingoo SDK
« Reply #80 on: July 27, 2012, 01:38:24 am »
Unfortunally, the C++ support does not currently support iostreams and exceptions.

Any tips on how can I get around this, or if there are any progress in porting full C++ support?
My code have lots of iostream and sstrings that would be a bit hard to convert to C-equivalent.
Rockbot Lead game designer.

flatmush (OP)

  • *
  • Posts: 283
Re: Platform Independant Dingoo SDK
« Reply #81 on: September 11, 2012, 06:05:37 pm »
Not much movement on this really, it's one of those things where if you want/need it then you'll need to add it yourself or contact one of the C++ guys specifically, I remember spiller did a lot of C++ stuff way back.

Exceptions can be done in a similar way in C using setjmp, an example of that is:

exc.h:
Code: [Select]
#ifndef __exc_h__
#define __exc_h__

#include <noreturn.h>
#include <setjmp.h>

#ifdef __cplusplus
extern "C" {
#endif

#define try if(setjmp(*_try()) == 0)
#define catch(exc) else if(_catch(&exc))


extern jmp_buf* _try();
extern int _catch(void* exc);
extern noreturn void throw(void* exc);

#ifdef __cplusplus
}
#endif

#endif

exc.c:
Code: [Select]
#include <stdlib.h>
#include <stdio.h>
#include <setjmp.h>



typedef struct {
jmp_buf env;
void*   ret;
void*   next;
} _exc_t;

static _exc_t* _exc_stack = NULL;



jmp_buf* _try() {
_exc_t* ctx = (_exc_t*)malloc(sizeof(_exc_t));
if(ctx == NULL) {
fprintf(stderr, "Error: Failed to allocate context.");
abort();
}
ctx->next = _exc_stack;
_exc_stack = ctx;
return &ctx->env;
}

int _catch(void** exc) {
if(_exc_stack == NULL) {
fprintf(stderr, "Error: Context stack empty.");
return 0;
}
_exc_t ctx = *_exc_stack;
free(_exc_stack);
_exc_stack = ctx.next;
*exc = ctx.ret;
return 1;
}

void throw(void* exc) {
if(_exc_stack == NULL) {
fprintf(stderr, "Error: Context stack empty.");
abort();
}
_exc_stack->ret = exc;
longjmp(_exc_stack->env, 1);
}

noreturn.h:
Code: [Select]
#ifndef __noreturn_h__
#define __noreturn_h__

#if defined(__BORLANDC__) || (_MSC_VER >= 1310)
# define noreturn _declspec(noreturn)
#elif (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 5))
# define noreturn __attribute__ ((noreturn))
/*#elif (__cplusplus >= ???)
# define noreturn [[noreturn]]
#elif (__STDC_VERSION__ >= 201ymmL)
# define noreturn _Noreturn*/
#else
#define noreturn
#endif

#endif

As for iostreams I don't understand why fwrite/fprintf would be much harder.

protomank

  • *
  • Posts: 96
    • Rockbot Game Engine
Re: Platform Independant Dingoo SDK
« Reply #82 on: September 11, 2012, 08:34:45 pm »
It isn't that C file system is harder or anything like that, but my project WAS written in ANSI-C and I rewrote in C++ to be easier to develop and mantain. Returning the code for ANSI-C is a drawback, that while in some parts (like file read/write) is OK, on some others like stringstreams, is really really bad :)
Rockbot Lead game designer.