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.

Coding > Stray font characters....

#91901 - SukiStrider - Mon Jul 10, 2006 2:45 pm

Hi everyone,

I'm learning to program the GBA using J.S.Harbour pdf book.
The problem is when i draw my own 8x8 font characters in the right order
and try to use the example code in the book to view them they don't show properly

for example if I gave the DrawChar() function this string "This is"
the GBA show "Sghr hr".

I am using Visual HAM IDE

I wrote a C code to show me the values DrawChar() function is recieving
it turn out the equation

(letter - 32) * 64 + y * 8 + x

is producing out of range values. This is the ouput:

Code:

CHAR     DEC      Equa

T             84      26624
h           104      -28672
a             97     -32256
t            116     -22528
'           39         3584
s           115      -23040
             32           0
a            97      -32256
l           108       -26624
l           108       -26624
            32             0
f          102       -29696
o         111        -25088
l          108        -26624
k          107       -27136
s          115        -23040
             32             0
=           61        14848
]            93        31232


Please help.
Thanks In Advance

#91918 - xproductions - Mon Jul 10, 2006 4:03 pm

I heard the J Harbour books sucks (teaches poor programming practices), use Tonc tutorials.
_________________
If you would not be forgotten
as soon as you are dead and rotten,
either write things worth reading
or do things worth writing.

-- Benjamin Franklin

#91923 - DrkMatter_ - Mon Jul 10, 2006 4:24 pm

"Sghr hr" is "This is", but one letter behind on each character. Try adding 1.