GP2X Minimal Library Sdk V0.9 Out


rlyeh

Certified Guru
Joined
Mar 25, 2003
Messages
277
Age
45
Location
49°9' East latitude, 126°43' South longitude: in y
Website
www.retrodev.info
grab it from http://www.retrodev.info

last changes:

Code:
  0.9: initial FIFO message system for dual cpu cores.
       initial 48 Mb support.
       initial quadruple buffering in 8bbp mode.

  0.8: initial dual cores cpu support.
       added very basic blit functions by popular demand;-)
       added hsync & vsync waiting code (thanks Reesy)
       bugfixed a stupid typo in 8bpp mode (thanks Franxis for the bug report)

Feel free to submit any bug you find.

PS: I should really start to write tutorials & documentation. Any volunteer to help me in the wiki page to share efforts?
 
Nice. Thank you very much. The dual core functionality should come in very handy once I work it all out.

I found a compiler error immediately.
Code:
.\src\minilib\minimal.c(213): error: conflicting types for 'gp2x_dualcore_launch_program'
.\src\minilib\/minimal.h(89): error: previous declaration of 'gp2x_dualcore_launch_program' was here
The size parameter is declared as int in the header and unsigned long in the source. GCC barfs on that. I'm guessing they should both be unsigned long. After fixing that, it all compiled fine.
 
slygamer posted on Dec 8 2005 at 12:37 PM said:
Nice. Thank you very much. The dual core functionality should come in very handy once I work it all out.

I found a compiler error immediately.
Code:
.\src\minilib\minimal.c(213): error: conflicting types for 'gp2x_dualcore_launch_program'
.\src\minilib\/minimal.h(89): error: previous declaration of 'gp2x_dualcore_launch_program' was here
The size parameter is declared as int in the header and unsigned long in the source. GCC barfs on that. I'm guessing they should both be unsigned long. After fixing that, it all compiled fine.

yep, that's it... declare both as unsigned long.
minor bug :)
 
Last edited by a moderator:
Thanks for saving a lo of us the footwork; I'd planned to do the same thing pretty much, so many thanks :)

/me waits for 2x..

jeff
 
BTW, would it be possible to change the clockspeeds of the CPUs right now? Or is it not supported by the firmware?

Because IMO one of the most important things for the future is to have programs use the lowest CPU speed they need for saving the battery power.

Note: I'm not trying to nag or whine, I just want to know if it's possible, impossible, or simply unknown. ;-)
 
So this dual FIFO, does it play ur game in one CPU and the library on the other?
 
You extract it somewhere on your PC that can be found by your compiler. You then use the functions provided by the Minimal Lib to make the GP2X do stuff.

Rlyeh, one bug (four times) and two improvements I think could be made.

1. gp2x_blitter_rect15() and gp2x_blitter_rect8() do not blit correctly.
Code:
  while(y--)
  {
    x=r->w;
    while(x--)
      *offset++=*data++;
    offset+=320-x;  // x is not what you expect here
  }
When going to the next line, it adds 320 - x to the offset. But x is always -1 from the previous while loop. This should read
Code:
    offset+=320-r->w;
in all four cases where this occurs (twice in each blit function).

2. gp2x_video_wait_vsync() and gp2x_video_wait_hsync() require gp2x_memregs to be declared. minimal.h should declare gp2x_memregs as an extern.

3. gp2x_rect could put data15 and data8 into a union since both will not be used at the same time.
 
i don't think anyone will mind me posting this here :)

well i have used this lib and done some additions to it to put it simply i have added d3d if you compile it with vc.net for windows without any code change from the gp2x version
uses vc express for the gp build but i guess you could put both builds in there just havn't tested that yet.

// todo:
sound
8bit mode
the dualcore part

i hope this eliminates some debugging problems

D3DGP2XCross.rar
 
FredrikH posted on Dec 10 2005 at 07:26 PM said:
i don't think anyone will mind me posting this here :)

well i have used this lib and done some additions to it to put it simply i have added d3d if you compile it with vc.net for windows without any code change from the gp2x version
uses vc express for the gp build but i guess you could put both builds in there just havn't tested that yet.

// todo:
sound
8bit mode
the dualcore part

i hope this eliminates some debugging problems

D3DGP2XCross.rar
THANK YOU!!! that's going to make debugging so much easier (I've gotten spoilt with visual studio's awesome debugger :))
 
Last edited by a moderator:
FredrikH posted on Dec 11 2005 at 01:26 PM said:
i don't think anyone will mind me posting this here :)

well i have used this lib and done some additions to it to put it simply i have added d3d if you compile it with vc.net for windows without any code change from the gp2x version
uses vc express for the gp build but i guess you could put both builds in there just havn't tested that yet.

// todo:
sound
8bit mode
the dualcore part

i hope this eliminates some debugging problems

D3DGP2XCross.rar

What exactly does it mean by D3D? My mind says Direct3D. But, i don't think that is likely.
 
Last edited by a moderator:
I think it will be Direct3D. It allows you to compile the same source for Windows and debug it on your local PC.

FredrikH, I cannot download that RAR file since Firefox 1.5 thinks it is a RealAudio file. Is it possible to post a ZIP file?
 
yes its direct3d nothing more than locking the backbuffer though ;)

added joystick support (only tested with an psx controller)
and early 8bit mode havn't figgured out how the palette works yet
also removed the need for the pitch variable all you need to do now is the normal *320 :)
i think thats all

D3DGP2XCross0.2.zip

[edit] fixed the url + removed the intellisense files
 
FredrikH posted on Dec 12 2005 at 10:07 AM said:
The link text says zip. The URL says rar. :)

To make the zip file smaller, you can remove the ncb files. They are auto-generated by Visual Studio, along with the .user and .suo files. The .old files could also be removed.
 
Last edited by a moderator:
Back
Top