gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > My first DS dev test, need testing/questions answered

#102500 - AM - Thu Sep 14, 2006 6:35 pm

Hey guys!

I'm new to all this DS development stuff. Actually, I've barely started as I haven't even got a DS yet - so far I've only been playing around with emulators (sort of dipping my toe in the DS homebrew pool and testing the water before I decide whether to get a DS or not).

Anyhow, this is my first err... thing for the DS: It's an attempt to do parallax mapping in the framebuffer mode. Problem is I'm getting really crappy framerates with the Dualis emulator (not to mention other emulators where it either won't work at all or only results in even more terrible FPS).

So I guess what I'm wondering is:
1) Anyone feel like giving it a try to see if it runs at all on real DS hardware, and if so what kind of framerates you get with parallax on vs. off?
2) Is it feasable to, with proper optimization, achieve a full 60 FPS rate doing this kind of thing on the DS or should I abandon this project altogether?

Well, thanks in advance.

[Images not permitted - Click here to view it]
download .nds file

P.S. the parallax effect isn't particularly obvious using this XOR texture but that's beside the point as this is just a speed test so far...

#102512 - 0xtob - Thu Sep 14, 2006 8:47 pm

Without parallax mapping: 1.5fps
with parallay mapping: 0.9fps

I'm sure this effect could be done way faster (and better looking) using the DS's graphics hardware. You would need to optimize pretty much to make it 120x faster, so it runs with 60fps in both screens :-) Remember that high-level optimizations are generally more effctive than low level ones.

But it looks nice so far. Make it faster, add some chiptunes and scrollers and you have a small intro :-)

#102519 - AM - Thu Sep 14, 2006 9:54 pm

Ok, I think I've located the primary culprit responsible for the poor performance: divisions. I gotta figure out a way to do this without so many divisions, or do divisions faster (currently using the div32 function but apparently that's not enough).

0xtob: just to make this perfectly clear: your running it on the DS not the emulator? Bummer if so, I was hoping by some voodoo magic everything would work out when run on hardware. ;) Oh well, back to the drawing board.

#102522 - 0xtob - Thu Sep 14, 2006 10:13 pm

Yep, these are figures from my DS. General divisions are terribly slow, but you can use bitshifts for divisions by powers of two.

#102534 - AM - Thu Sep 14, 2006 11:24 pm

0xtob wrote:
Yep, these are figures from my DS. General divisions are terribly slow, but you can use bitshifts for divisions by powers of two.

Already doing that, I also have some divisions where the denominator is constant (in some cases the screen width, in some cases the screen height) so I'm looking into using precalculated tables for that. So far not working so good though...

#102539 - tepples - Fri Sep 15, 2006 12:10 am

AM wrote:
I also have some divisions where the denominator is constant (in some cases the screen width, in some cases the screen height) so I'm looking into using precalculated tables for that.

For those, multiplication by the reciprocal might be best.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#102568 - kusma - Fri Sep 15, 2006 9:45 am

AM wrote:
Hey guys!
2) Is it feasable to, with proper optimization, achieve a full 60 FPS rate doing this kind of thing on the DS or should I abandon this project altogether?


Considering the fact that I got it to run at 30fps on the GBA in "Newton never did this, BITCH" (http://www.pouet.net/prod.php?which=19030), yeah.

#102606 - AM - Fri Sep 15, 2006 4:12 pm

edit: err... nevermind, fixed it

#102668 - tepples - Fri Sep 15, 2006 11:47 pm

Why don't these graphic demos, even the years-old ones such as "fr018: aGb", have any source code?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#102977 - PypeBros - Mon Sep 18, 2006 12:11 pm

tepples wrote:
Why don't these graphic demos, even the years-old ones such as "fr018: aGb", have any source code?


heh. the demoscene has never been very open-source :P Those guys work hard to get the latest bits of optimization so that they can beat concurrent demogroups and win the competition. That leaves little room for open-sourcing your code ...
_________________
SEDS: Sprite Edition on DS :: modplayer

#102988 - tepples - Mon Sep 18, 2006 1:47 pm

PypeBros wrote:
the demoscene has never been very open-source :P Those guys work hard to get the latest bits of optimization so that they can beat concurrent demogroups and win the competition. That leaves little room for open-sourcing your code ...

Then why isn't source released even years after the competition? Per the policies of at least one major online encyclopedia, having a Free demo is bound to get your demogroup more exposure.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#103043 - 0xtob - Mon Sep 18, 2006 9:16 pm

I think it just this "no one does it, so why should we" thinking. Another factor may be the dirtyness of demo code (I can tell :-) But actually, demosceners aren't so strict about their "secrets". At demo parties you can just ask any famous coder you run into about the effects of their demos and they will happily tell you in every little detail. I've asked lots of stupid questions, and no one has ever said something like "That's ultra-secret group internal information. Learn OpenGL, noob!"

But yeah, more open source demos would be very nice!