• HomeBoards
  • RulesRules
  • HelpHelp
  • WikiWiki
  • Donate

Author Topic: Guide: How to compile apps for Dingoo native OS without the SDK  (Read 12001 times)

Harteex (OP)

  • * Administrator
  • Posts: 713
    • Harteex Productions
Guide: How to compile apps for Dingoo native OS without the SDK
« on: October 16, 2009, 07:26:48 pm »
PLEASE NOTE: This is an old post, and it's now recommended to use the new SDK at http://code.google.com/p/dingoo-sdk/ instead.


This guide will help you to compile apps for the native dingoo OS (not linux) without the use of the SDK (except entry.a).
Thanks goes out to flatmush for helping me with this, and for creating these libraries we're going to use.

--- Files to download ---
* Cygwin
* AstroLander or SameGoo (SameGoo includes more things such as sound)
* toolchain (mirror)


--- Installation ---
* Cygwin
During the setup of Cygwin, you will need to select additional packages under the category devel. I don't know exactly which ones you'll need since I was lazy and just picked the whole devel category. I know for sure you at least need to select "make".
You will need to add the Cygwin bin folder to your PATH environment variable. If you installed Cygwin in the default directory, that would be C:\cygwin\bin.

* toolchain
Unpack it into your cygwin directory and call it mipseltools. The folder mipseltools should have bin, include etc in it.
You have to add the bin directory of mipseltools to your PATH aswell. If you're using the default directories, that would be C:\cygwin\mipseltools\bin.
You will also need two additional environment variables as below:
MIPSLIB = "c:/cygwin/mipseltools/lib"
MIPSTOOLS = "c:/cygwin/mipseltools/include"
(note: you need either frontslash or double backslashes here)

Finally go to the directory C:\cygwin\mipseltools\lib\gcc\mipsel-linux\4.1.2 and copy the file libgcc.a to C:\cygwin\mipseltools\lib.

* AstroLander or SameGoo
Just unpack it where ever your want.


--- Compile ---
Open up a command prompt and point it to the compile folder for your chosen game.
Run rebuild. If everything goes well you will not see any errors and you should end up with a target.app file.
dlmake produces some weird characters during the end of the compile but it's nothing to worry about.


--- Try it on the Dingoo ---
Copy over target.app to somewhere on your Dingoo. You may rename it if you wish.
For Astrolander, also copy font.tga and splash.tga from the data directory (inside the compile directory) to the same directory as target.app


--- Things to keep in mind ---
Be careful and make sure you free all allocated memory when you exit your application, otherwise it will cause newer Dingoos to crash. The OS does not automatically reclaim allocated memory.


--- FAQ ---
Q: How to fix "No medium found" errors?
A: Put a disk in your D drive (CD drive) and try again. (Thanks to HnkyTnkButcher)

Q: How to make SIM-files?
A: Have a look at the source of the Gnuboy port from Joyrider.
« Last Edit: May 04, 2010, 05:23:12 pm by Harteex »

gp2xs

  • Guest
Re: Guide: How to compile apps for Dingoo native OS without the SDK
« Reply #1 on: October 17, 2009, 10:27:25 pm »
Thanks for this.

How do you address the Dingoo's Power Button?
This is when you slide the power button up while in games to bring up the menu.

control.h defines all the buttons and d-pad, what about the power slider-button?

Thanks.


Harteex (OP)

  • * Administrator
  • Posts: 713
    • Harteex Productions
Re: Guide: How to compile apps for Dingoo native OS without the SDK
« Reply #2 on: October 17, 2009, 10:55:08 pm »
I've actually added it recently to my updated version of the libraries :)

Here it is:
#define CONTROL_POWER         7

nobnet

  • Guest
Re: Guide: How to compile apps for Dingoo native OS without the SDK
« Reply #3 on: October 30, 2009, 04:32:34 pm »
Hi Harteex, I am programmer C/C++ under VC6 for windows , but I never have used cygwin before and I am having difficulty in compiler yours sources. I have had that put (" ") in each string of directory in makefile too, because without that, I had more errors.

I get this erros:
mipsel-linux-ld    "../lib"/entry.a -lm -lgcc -Bstatic -g -T link.xn -o downenv.elf -Map downenv.map -Ttext 0x80a00000 -L"../lib" -Lc:/cygwin/mipseltools/lib -zmuldefs
mipsel-linux-objcopy -O binary -R .export_table -R .export_string -R \
.import_table -R .import_string -R .section_info downenv.elf downenv.bin
process_begin: CreateProcess((null), mipsel-linux-objcopy -O binary -R .export_table -R .export_string -R .import_table -R .import_string -R .section_info downenv.elf downenv.bin, ...) failed.
make (e=2): O sistema n?o pode encontrar o arquivo especificado.
make: *** [downenv.bin] Error 2

Can you help me? Sorry for my english. It's too bad

Harteex (OP)

  • * Administrator
  • Posts: 713
    • Harteex Productions
Re: Guide: How to compile apps for Dingoo native OS without the SDK
« Reply #4 on: October 30, 2009, 08:21:42 pm »
Did you do this step?
Quote
Finally go to the directory C:\cygwin\mipseltools\lib\gcc\mipsel-linux\4.1.2 and copy the file libgcc.a to C:\cygwin\mipseltools\lib.

Could you write the errors you get with an unmodified makefile?

nobnet

  • Guest
Re: Guide: How to compile apps for Dingoo native OS without the SDK
« Reply #5 on: October 31, 2009, 06:51:47 pm »
Hi Harteex. yes, I did that. the libgcc.a is in C:\cygwin\mipseltools\lib. the erros with an unmodified makefile are:

Microsoft Windows XP [vers?o 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\user>cd C:\StopWatch\compile

C:\StopWatch\compile>build.bat

C:\StopWatch\compile>del *.dl
N?o foi poss?vel encontrar C:\StopWatch\compile\*.dl

C:\StopWatch\compile>del *.tab

C:\StopWatch\compile>del *.str

C:\StopWatch\compile>del *.dsc

C:\StopWatch\compile>make   2>&1  | tee err.txt
mipsel-linux-gcc -g -c -O3 -I../lib/stdlib -I../lib -Ic:/cygwin/mipseltools/incl
ude/mipsel-linux/include -I -mips32 -Wall -finline-functions -fomit-frame-pointe
r -msoft-float -fno-builtin -fno-exceptions -mno-abicalls -fno-pic -pipe -G 0 -D
_DEBUG -DMPU_JZ4740 -o ctype.o ../lib/stdlib/ctype.c
process_begin: CreateProcess((null), mipsel-linux-gcc -g -c -O3 -I../lib/stdlib
-I../lib -Ic:/cygwin/mipseltools/include/mipsel-linux/include -I -mips32 -Wall -
finline-functions -fomit-frame-pointer -msoft-float -fno-builtin -fno-exceptions
 -mno-abicalls -fno-pic -pipe -G 0 -D_DEBUG -DMPU_JZ4740 -o ctype.o ../lib/stdli
b/ctype.c, ...) failed.
make (e=2): O sistema n?o pode encontrar o arquivo especificado.
make: *** [ctype.o] Error 2

C:\StopWatch\compile>dlmake dlmake.ini
******************************?╩?┤┤‗░?┐?╩╝!**********************************
?╩?┤╬─╝■??╩?: 0
******************************?╩?┤┤‗░???╩?!**********************************
********************end of dlmake,press any key to exit! ********************

And all the StopWatch directories are there.When I put (" ") in the strings of directories in makefile, this erros don't happen.
Thanks for help me. I always wanted learn to make programs to embbed systems  ;D.

Harteex (OP)

  • * Administrator
  • Posts: 713
    • Harteex Productions
Re: Guide: How to compile apps for Dingoo native OS without the SDK
« Reply #6 on: October 31, 2009, 09:00:19 pm »
Unfortunally I'm not really a cygwin expert.
But the error should afaik mean that mipsel-linux-gcc could not be run. Now we have to figure out why it cannot be run.

Let's check your environment variables. Write set in a command prompt. I'm interested in MIPSLIB, MIPSTOOLS and Path.

nobnet

  • Guest
Re: Guide: How to compile apps for Dingoo native OS without the SDK
« Reply #7 on: October 31, 2009, 10:39:24 pm »
Hi Harteex, I'm so sorry for this problems ;D. But I am really interested in learning.
My environment variables:

MIPSLIB=c:/cygwin/mipseltools/lib
MIPSTOOLS=c:/cygwin/mipseltools/include

Path=C:\Arquivos de programas\MiKTeX 2.7\miktex\bin;C:\WINDOWS\system32;C:\WINDO
WS;C:\WINDOWS\System32\Wbem;c:\Arquivos de programas\Microsoft SQL Server\90\Too
ls\binn\;C:\UnxUtils\usr\local\wbin;c:\cygwin\bin;c:\cygwin\mipseltools\bin;C:\A
rquivos de programas\TortoiseSVN\bin;C:\Arquivos de programas\K-Lite Codec Pack\
QuickTime\QTSystem\;C:\Arquivos de programas\cvsnt

Harteex (OP)

  • * Administrator
  • Posts: 713
    • Harteex Productions
Re: Guide: How to compile apps for Dingoo native OS without the SDK
« Reply #8 on: October 31, 2009, 11:47:13 pm »
Ok that seems fine.
I'm starting to run out of ideas but...

if you just write mipsel-linux-gcc, does it respond "mipsel-linux-gcc: no input files" ?

Are you logged in as an administrator? If not, try that.

Do you have an old version of make or something else that could conflict in your UnxUtils folder (C:\UnxUtils\usr\local\wbin) ?
If so, try to remove that entry from the path variable, and restart the command prompt and try again.


In case you're going to experiment more with the " " trick you used, does it generate .o files correctly in the compile directory, do you find control.o, ctype.o, display.o etc?


If nothing of this helps I could ask flatmush to check it out, he probably knows more than I do.
Or hope someone else responds.

nobnet

  • Guest
Re: Guide: How to compile apps for Dingoo native OS without the SDK
« Reply #9 on: November 02, 2009, 09:16:20 pm »
Quote
if you just write mipsel-linux-gcc, does it respond "mipsel-linux-gcc: no input files" ?
Yes, it does.
Quote
Are you logged in as an administrator? If not, try that.
yes, I guess. I am logged in as user. This is default user of Windows xp that it has administrator's privilege
Quote
If so, try to remove that entry from the path variable, and restart the command prompt and try again.
I did, but same erros continues.
Quote
In case you're going to experiment more with the " " trick you used, does it generate .o files correctly in the compile directory, do you find control.o, ctype.o, display.o etc?
It doesn't. it generate only downenv.map and downenv.elf.

Quote
If nothing of this helps I could ask flatmush to check it out, he probably knows more than I do.
Or hope someone else responds.
Thank you for all your assistance

nobnet

  • Guest
Re: Guide: How to compile apps for Dingoo native OS without the SDK
« Reply #10 on: November 03, 2009, 11:39:01 am »
Quote
Do you have an old version of make or something else that could conflict in your UnxUtils folder (C:\UnxUtils\usr\local\wbin) ?
I think that could be the make. I'm going to test that.

Thanks

Harteex (OP)

  • * Administrator
  • Posts: 713
    • Harteex Productions
Re: Guide: How to compile apps for Dingoo native OS without the SDK
« Reply #11 on: November 03, 2009, 11:51:45 am »
Another option could be to install the development tools in a virtual machine.

nobnet

  • Guest
Re: Guide: How to compile apps for Dingoo native OS without the SDK
« Reply #12 on: November 03, 2009, 12:29:01 pm »
Hi Harteex, thank you for your prompt reply.
It was the make. I downloaded a new make and it's working!
I hope I don't have fill your post with idiot questions. I'm so sorry for this.
Thank you again for everything you?ve done.

Harteex (OP)

  • * Administrator
  • Posts: 713
    • Harteex Productions
Re: Guide: How to compile apps for Dingoo native OS without the SDK
« Reply #13 on: November 03, 2009, 02:05:37 pm »
Great :)
No problems.

Feel free to post again (or create a topic) if you have any other problems / questions about it.

Btw, if you're going to make a game or something, StopWatch is pretty stripped down, so I would recommend you to build upon something with more features such as SameGoo.