A brief summary of what’s been done on the gsoc2008_nds branch thus far:
After a wild goose chase searching for a mysterious bug in the graphics
driver, a simple 2D software renderer has been added using the SDL 1.3
graphics driver paradigm. This driver uses the Nintendo DS framebuffer
and is largely unoptimized; its main use for now is to provide some kind
of functional video output while other features are added. From the
looks of it, the design of SDL 1.3 video drivers seems to be consistent
with some of the ideas I’ve had for implementing a DS-optimized driver,
and should make it easier than it would’ve been to make such an
optimized driver for SDL 1.2.
Other future plans regarding work on the NDS video driver include some
way for the OpenGL-ish 3D interface provided by libnds to be able to be
used in tandem with SDL; this probably means that I should implement
another driver that uses said GL-ish interface to do the actual
rendering, as the existing OpenGL drivers for SDL already do. (Perhaps
I could even simply add some code to those existing GL drivers instead!)
Beyond video, I’ve duplicated the joystick functionality from the 1.2
port with a few minor changes/fixes to work well and as one would
expect. From there, I used the existing joystick implementation as a
skeleton for a touchscreen API, so that it would be consistent with the
joystick API in terms of use. It’s still rough around the edges and I’m
currently working on refining the way it reports events – anyone who’s
seen the footage of my touch demo (and who has very good eyes to see
through the poor quality) might be able to tell that the SDL event loop
I used didn’t always catch the “down” and “released” actions.
In designing the touch API, I tried to keep multi-touch in mind. I
don’t have any multi-touch capable devices, so I have no real means of
testing my designs, but nonetheless I have the code able to allow for an
arbitrary amount of touches, given any maximum number of touches. The
coordinates given by the touch API for each touch point are
(x,y,pressure), where x and y are signed integers between -32768 and
32767, and (0,0) is the center of the screen; pressure is an unsigned
integer between 1 and 65535 when the screen is being touched and 0 when
it is not being touched. This should hopefully provide sufficient
precision when larger and more precise touchscreens are available, so
long as the machines can handle 16-bit integer arithmetic.
I also plan to have some sort of flag that enables “mouse emulation” by
the SDL touchscreen API, where it would report mouse events rather than
touchscreen events. This should allow for better compatibility with
legacy programs. Thoughts on this?
Also, here are a couple of (poor quality, sorry!) videos showing some
test programs running on the hardware.
Darren
http://lifning.americankryptonite.net/blag/