Friday, July 17, 2009

Little problems and new stuff

Small update :)
I have rewritten the console output unit and now it should be more flexible. Rewriting it, I have noticed a bug on the font's palette handling, that should be fixed now. In the meanwhile, in order to test the console unit, I have worked on the high scores unit. I have decided to arrange them as an "old school style" arcade (hey, it is an arcade compo, after all!), so there will be only 5 chars for the name and a max of 8 scores. The scores are arranged in an array of packed record and each record stores two fields:

type
TBestScore = record // 72 bits = 9 bytes
name: array [0..4] of char; // 5 * 8 = 40 bits
// 40 bits = 5 bytes
score: integer; // 32 bits = 4 bytes
end;

var
Scores: array [0..7] of TBestScore;
// 8*72 = 576 bits
// 576 bits = 72 bytes

The whole score tab takes 72 bytes, that fits nicely in 72/4=18 words longints. That's good, because the nds' architecture is more performing if operates on 4 byte aligned values.

I'm a bit unsatisfied about the font and I would like to change it, because it is unreadable when displayed over a colored background. A solution could be to make a black border around the chars, but we are talking about 8x8 pixels wide fonts and 1 pixel for the border is problematic to arrange nicely. I'm open to suggestions :)

No comments:

Post a Comment