Skip to content

Posts by Manuel

3
Aug

Changes

So loooong time from my last post!
But at least i’ve a good reason for that: back in may, Philipp and i switched work. We’ve been pretty busy in setting up things so that we’ve decided to put on hold our projects and still we have to decide when to resume them: they’ve been three fresh and nice months, so it feels really good.
I recently finished developing our gallery component in ActionScript 3: i never took Flash/AS development seriously too much, mainly due to the lack of a good object-orientation, but that was until now.
I took the time to explore the major improvements on it, especially its new, stronger, object-orientation and the introduction of the display list as well as a major speedup in the VM. Lovely job! That was the big rewrite going on at Adobe labs, although some issues as the nasty BitmapFilter and mouse events thing, all in all, are pretty annoying.

Anyway, i’m currently writing a simple simulation in order to get my foot more wet with it, i’ll post it soon, promised!

24
Jan

The lost art of fixed-point math – Part One

Long time before floating point numbers were so commonly in use as today, fixed point representation was far more popular due to its high performance and accuracy, even on low-powered computers.
Since then, fixed point representation have become something like a “lost art”, at least on PC and full-sized game consoles (although it shouldn’t be nonsense saying some PSX games made use of it): the actual market offers powerful and cheap GPU that lets a programmer compute a 3d dot-product between two vectors in a single instruction, so why bother with fixed point anymore?
The growing popularity of cellphones and hand-held computers brings fixed point math back to the forefront of game and 3d graphics development: specifically, the market pressure to hardware manufacturers to make small and low-cost embedded chips eliminates the possibility of having a dedicated FPU for some time to come, but… hey! The ALU is still there!

Fixed point (fp) numbers are based upon the computer representation of integers and are used to represent a subset of the real numbers: like integers representation which fixed point rely on, fp numbers are finite, so its physically impossible to be able to represent the whole set of real numbers.
Nevertheless, computing range and precision limitation of a fixed point representation is actually really simple and we’ll get to this later on: now let’s review an 8-bit unsigned value binary representation:

27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1

You should be familiar with this: each bit represents twice the value of the bit at its right, with the LSb representing 1.
This representation is the one of integral values, where no fractional values are involved at all, so, how an integer can be used to represent both integral and fractional quantities?
As long as decimal numbers can have a decimal point representing the break between integral and fractional values, binary values can have a binary point as well, or generically, a radix point.
In fact, looking to the aforementioned bit-table for an 8-bit unsigned value, you are indeed looking to a fixed point representation where the radix point is to the right of the rightmost bit!
If you still can’t get it and you feel confused, think about that invisible radix point, now we are going to visualize it:

27 26 25 24 23 22 21 20 .
128 64 32 16 8 4 2 1

Simply put, if you used integer math, you always used fixed point math, but without knowing it: so, you got the point. ;)
Who said the radix point does have to be placed there? In fact, you are free to decide where to move it and this is what we are going to do right now: we’ll move the radix point to the middle of the integer representation, giving this way some bit-space for representing fractional values as well at the expense of loosing bit-space for the integral values representation.
Fixing the radix point to an n-bit position as we’ll do, clearly gives sense to the so-called “fixed point arithmetic”.
So, let’s define our first fixed point format to be the one resulting from moving the radix point to the left just to be able to end up with 4 bits on its left and 4 bits on its right:

23 22 21 20 . 2-1 2-2 2-3 2-4
8 4 2 1 1/2 1/4 1/8 1/16

The standard nomenclature for a fixed point format is M-dot-N, thus we are dealing with an 4-dot-4 fixed point format; “M” stands for the number of integral bits while “N” stands for the number of fractional bits.
Still every bit represents twice the value of the bit at its right, but now we are representing 1/16 (0.0625) with the rightmost bit: this is the scaling factor for the 4-dot-4 format and represents its precision granularity; so a simple 32-bit integer can be thought as a 32-dot-0 fixed point format, where its precision granularity is 1.

In the next part i’ll address how to convert Integral and Real types to a fixed point representation, how to compute the four basic operations between two fixed point numbers and how to overcome overflow and underflow situations with precision reduction and how to compute numerical limits for a given fixed point format.

15
Nov

pocketSand v0.8.3

Well, i finally managed to have some time to work on pocketSand and i’m releasing a couple of fixes.

  • Under some circumstances pocketSand won’t startup.
  • Added pixel-doubling feature in order to gain more speed, primarily on VGA devices where the higher resolution involve too much calculations: the switch is also available for QVGA devices as well. That feature is *enabled by default* on VGA devices!
  • A screen-clearing icon (trashcan) has been added.
  • The main application icon has been added.
  • Credits moved.

Also, all versions are available for win32-desktop too (GDI only), but i never released them, i just thought you already had one ;)
So, i really hope Shane H. and Crayfish will be able to play with this new version, let me know!

v0.8.3
( ppc setup | ppc cab | win32-zip )

11
Nov

Time of update!

This version should run slightly faster than the previous one and hopefully rather good on most of the VGA devices: also it should work on WM5 devices too.
Thank you all for feedback and reports, always appreciated!

– Switched VGA approach: it will be handled only by using RawFrameBufferInfo information.

- It appears the WM5-platform runtime library implements the “rand()” function differently than on the WM2003/SE one, and also noticeably slower. This has been substituted with a “Mersenne Twister” random number generator (ref. “M. Matsumoto and T. Nishimura, ‘Mersenne Twister: A 623-Dimensionally Equidistributed Uniform Pseudo-Random Number Generator’, ACM Transactions on Modeling and Computer Simulation, Vol. 8, No. 1, January 1998, pp 3-30.”).

v0.8.2 (WM2003/SE/2005)
( exe | cab )

3
Nov

pocketSand v0.8 released

pocketSandI’m happy to say that [tag]pocketSand[/tag] is now available for download!

This build is still a development version, so you could expect some bugs coming up: also, you are encouraged to report any malfunction.
The installer is a Windows-desktop one: once launched, the usual “Add/Remove” programs window of the WindowsCE manager will appear and you should just follow the on-screen instructions.

Download pocketSand v0.8dev
Download pocketsand_v0.8dev (.cab)
(WM2003/2003SE/2005 only)
NOTE
If you are having any problems running it, please contact me at _manuel_.bua@bit-fire.com (be sure to remove the underscores thing) attaching the game-generated logfile called aqua_log.txt in the game’s folder.

2006/11/07 UPDATE
With the help of some helpful people i’m trying to address a VGA issue that exhibits a severe stylus misalignment (Dell Axim x50v/x51v are the most reported devices): stay tuned for updates.

2006/11/08 UPDATE
A .cab file has been provided.
Also, VGA and misalignment issues should be resolved in the next version.