Author Topic: gnuboy SDL for native builds and runs  (Read 5287 times)

clach04 (OP)

  • Posts: 256
gnuboy SDL for native builds and runs
« on: October 30, 2010, 06:30:30 am »
I've dug out all the original (i.e. non forking ports) gnuboy source code I could fine and made them available via svn. This includes the unreleased 1.0.4 code that fixes compatibility for a few games. I've tidied it up and made a 1.0.5 version that works under Windows and (x86) Linux and SDL, it should run fine on all the other platforms too, like MSDOS :-)

The project page is http://code.google.com/p/gnuboy/

Some of the under the covers features of 1.0.5 is easier porting. Using the same code that the Windows release has I've made an initial proof of concept build for Dingoo native OS http://code.google.com/p/gnuboy/downloads/ so you can try it out on your device.

More information about the Dingoo version is at http://code.google.com/p/gnuboy/wiki/DingooPort (and check out the rest of the wiki).

It runs, performance isn't quite full speed and sound is "icky". I'm not yet sure what the performance is as I've not got an fps indicator going yet :-)

I'm hoping to do some more playing with this on Sunday, not sure when the next visible milestone will be but I thought I'd share what I have so far (and in case anyone wants to join in). Part of the project may involve ways of improving the SDK we have (e.g. memcpy performance along with some of the file stdio file functions).

Thanks to Joyrider and SiENcE for sharing their code, I used (a modified version of) Joyrider's approach to RTC saves. Almost everything else is currently plain old gnuboy code.

pcercuei

  • Posts: 1689
    • My devblog
Re: gnuboy SDL for native builds and runs
« Reply #1 on: October 30, 2010, 07:51:51 am »
I think it would be nice to synchronize the builds for native and dingux.
The only required step to do that is to create a Makefile for dingux.

Oh, by the way, your commit r35 does not work :)

Edit:
And here's the makefile (thanks SiENcE, it's yours):
http://pastebin.com/YEiVD5pi
« Last Edit: October 30, 2010, 08:14:12 am by Ayla »

clach04 (OP)

  • Posts: 256
Re: gnuboy SDL for native builds and runs
« Reply #2 on: October 30, 2010, 05:52:03 pm »
I think it would be nice to synchronize the builds for native and dingux.
The only required step to do that is to create a Makefile for dingux.

Oh, by the way, your commit r35 does not work :)

Darn :-( Thanks for catching that. I've spotted at least 2 problems with my change:

1) it uses the new "fast" loader all the time (it is supposed to be configurable)
2) if there is a file IO/memory error, the new routine returns different results than the original
3) I should rename SLOW_AND_SAFE_LOADER and make the fast one the default but allow builders to choose the old one.

Are those the problems you meant, or (gulp) are there more?

Thanks for taking the time to read through the changes.

Quote
And here's the makefile (thanks SiENcE, it's yours):
http://pastebin.com/YEiVD5pi

Great! I've posted it as http://code.google.com/p/gnuboy/source/detail?r=59 (I've not got a Dingux build chain to test with though)

clach04 (OP)

  • Posts: 256
Re: gnuboy SDL for native builds and runs
« Reply #3 on: November 01, 2010, 02:19:55 am »
New test build available, now includes FPS display controlled by rc variables. See the included sample gnuboy.rc file http://code.google.com/p/gnuboy/downloads/detail?name=gnuboy_1.0.5_svn_r98_dingoo_a320_native.zip&can=2&q=#makechanges

I've also updated the code to handle some Pandora keys/buttons (but the configure/makefile needs an update and I don't yet have a Linux build chain). So there may be a new Pandora release soon (to be clear, I'm not planning on releasing one, I do not have a Pandora).

The one problem I'm getting is that it appears to run too fast (which may explain the sound problems). I'm getting 100fps on my dingoo, my (much faster) desktop is stable at 60. So I think there is a timing/throttle problem (it could even by my fps calculations). I'm not sure when I'm going to have time to work on this next as work is busy next week and next weekend is already fully booked :-(

I tried a GBC game (Bomberman Max Blue) and it appears to play at 60 fps on the Dingoo (the audio was slightly wacky).

If anyone has ideas on the timing issues, I'll be interested to hear opinions.

Chris

pcercuei

  • Posts: 1689
    • My devblog
Re: gnuboy SDL for native builds and runs
« Reply #4 on: November 01, 2010, 10:02:40 am »
AFAIK gnuboy synchronises itself on the sound.
To say it simply, it won't start to calculate the next frame if the samples calculated for the previous frame hasn't already been submitted to SDL.

clach04 (OP)

  • Posts: 256
Re: gnuboy SDL for native builds and runs
« Reply #5 on: November 02, 2010, 05:00:14 am »
AFAIK gnuboy synchronises itself on the sound.

Thanks Ayla, this confirms something I was thinking last night.

I've managed to get no sound to work (yeah weird, getting no sound was harder than with sound) and getting NO sound working meant fixing some issues with timing. No sound runs between 66 and 70 fps. With sound runs about 100 fps and with sound is noticeably faster (not massive but noticeably with the eye). I.e. n sound appears to have more accurate timings. My guess is that the sound routines are completing sooner. I'm still working out what is going on here.

Having your comment reinforces that I'm heading in about the right direction.

To be clear this is all with no scaling and with a mono GB game, I don't want any confusion over this magically being the fastest port of gnuboy! It is most likely the slowest port at the moment :-)

Chris