Welcome
Welcome to a320

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, join our community today!

New C99 Hello World sample without s2dsdk

Only for posting new releases of Dingoo OS based software.

Moderator: Moderators

New C99 Hello World sample without s2dsdk

Postby flatmush on Sat May 16, 2009 3:07 am

This sample shows you how to compile C programs which directly access the frame-buffer and controls, so that you don't have to use the s2dsdk. This gives you full control of the machine so be careful, I still have things to work out but for my first day with an a320 I think it's pretty good.

If you look at the code included with all the other samples most of it is unused bloat, from other PMP's, my code is a fraction of the size and simpler to understand.

Download the sample from: http://flatmush.juliusparishy.com/a320/HelloWorld.zip
Once you run the sample it will simply change the color of the screen dependent on what buttons you press.

Any questions?

Tomorrow I will upload my software graphics library so that we can get some proper games running, hopefully astro lander by the end of the week from me.
C99 samples without using s2dsdk | MineSweeper | AstroLander
For help with dingoo programming or just in general, join our IRC at irc://irc.freenode.net/#dingoo-a320
flatmush
 
Posts: 35
Joined: Thu May 14, 2009 1:29 pm
Location: Manchester, UK

Re: New C99 Hello World sample without s2dsdk

Postby Uukrul on Sat May 16, 2009 5:03 am

Many thanks!

flatmush wrote:Any questions?


Now we only need sound, file I/O and figure out some of the functions from the entry.a lib (I asked about them at the S2D forum but they never replied :( )
Uukrul
 
Posts: 23
Joined: Sat Mar 14, 2009 6:22 pm

Re: New C99 Hello World sample without s2dsdk

Postby flatmush on Sat May 16, 2009 8:16 am

I don't think those should be too much hassle, there are only a small number of functions to figure out. I think I can get fileIO right now, the pcm functions need a bit of work though.
C99 samples without using s2dsdk | MineSweeper | AstroLander
For help with dingoo programming or just in general, join our IRC at irc://irc.freenode.net/#dingoo-a320
flatmush
 
Posts: 35
Joined: Thu May 14, 2009 1:29 pm
Location: Manchester, UK

Re: New C99 Hello World sample without s2dsdk

Postby Bingo83 on Sat May 16, 2009 12:11 pm

Good work fella, will be great to see some new homebrew on the Dingoo.
Image
Bingo83
Moderator
 
Posts: 209
Joined: Sat Mar 21, 2009 2:59 pm

Re: New C99 Hello World sample without s2dsdk

Postby flatmush on Sat May 16, 2009 12:16 pm

Ok, I worked out some new information regarding the display system, my last sample did not use double buffering but I worked out how it works.

_lcd_get_frame() returns the address of the display buffer.
_lcd_set_frame() updates the lcd with the contents of the display buffer.
g_pGameDecodeBuf contains the address of the draw buffer.

To draw to the display correctly you have to:
- Draw to the draw buffer.
- Copy the draw buffer into the display buffer.
- Writeback the dcache.
- Call _lcd_set_frame to update the display.

I have a new sample of this working correctly, located here: http://flatmush.juliusparishy.com/a320/DoubleBuffer.zip

Edit: This is duplicated from openhandhelds forums, but I don't want anybody to miss this info.
C99 samples without using s2dsdk | MineSweeper | AstroLander
For help with dingoo programming or just in general, join our IRC at irc://irc.freenode.net/#dingoo-a320
flatmush
 
Posts: 35
Joined: Thu May 14, 2009 1:29 pm
Location: Manchester, UK

Re: New C99 Hello World sample without s2dsdk

Postby flatmush on Sat May 16, 2009 1:15 pm

Here is another sample, this one loads a texture and displays it on the screen, get it here: http://flatmush.juliusparishy.com/a320/Texture.zip

The texture "test.tga" has to be located on the root of the internal drive, it has to be a 24-bit tga top-left to bottom right at the minute, since extra code would just bloat the sample.
C99 samples without using s2dsdk | MineSweeper | AstroLander
For help with dingoo programming or just in general, join our IRC at irc://irc.freenode.net/#dingoo-a320
flatmush
 
Posts: 35
Joined: Thu May 14, 2009 1:29 pm
Location: Manchester, UK

Re: New C99 Hello World sample without s2dsdk

Postby SiENcE on Mon May 18, 2009 5:45 pm

Hm.. nice. Now it would be more fun to port SDL to Dingoo. I know Linux everybody is waiting for linux. But i like to have it on the simple working Dingoo OS too.
Last edited by SiENcE on Mon May 18, 2009 7:47 pm, edited 1 time in total.
SiENcE
 
Posts: 70
Joined: Wed Apr 29, 2009 9:19 am
Location: Berlin/Germany

Re: New C99 Hello World sample without s2dsdk

Postby flatmush on Mon May 18, 2009 6:14 pm

Yeah, checkout my minesweeper game source code for the latest version of all the files here, I'm still trying to rewrite gccint and libc for the dingoo so that we can get normal programs running but the minesweeper code is a better start than the samples here.
C99 samples without using s2dsdk | MineSweeper | AstroLander
For help with dingoo programming or just in general, join our IRC at irc://irc.freenode.net/#dingoo-a320
flatmush
 
Posts: 35
Joined: Thu May 14, 2009 1:29 pm
Location: Manchester, UK

Re: New C99 Hello World sample without s2dsdk

Postby schanall on Tue May 19, 2009 3:57 pm

Thank you very much or sharing this with us. The sdk didn't work for me, but now I can try it without :!:
schanall
 
Posts: 63
Joined: Wed Apr 08, 2009 9:38 am

Re: New C99 Hello World sample without s2dsdk

Postby schanall on Tue May 26, 2009 3:04 pm

I hope this is not a stupid question, but how do I compile it? I'm using Linux...

Can somebody help me? Or did someone get the SDK under Linux to work?
schanall
 
Posts: 63
Joined: Wed Apr 08, 2009 9:38 am


Return to Dingoo OS Releases

Who is online

Users browsing this forum: No registered users and 1 guest