GP32 GpTextOut16...


RTj

Member
Joined
Mar 17, 2003
Messages
104
Age
52
Argh!!
I've been at this problem now for about 3 days and its driving me insane!!! :angry:

I'm in 16bit mode... If i use GpTextOut then i get some weird looking text (obviously coz i'm using 8bit mode text on a 16bit mode screen) but when i use GpTextOut16 i get nothing! :huh:

Here's the line i'm using:
GpTextOut16(NULL, &gpDraw[1], 10, 10, (char*)"some test text...", 0x0);

This displays no text on my screen and, yes, i've included the gpfont16.h :D
I've made it the last thing i do before my screen flip.

So... same line with GpTextOut gives me (weird) text, same line but with GpTextOut16 gives me nothing...

Any ideas???
 
did u add to your gplib directory : libgpfont16.a ?

how many surfaces do you have ? Did you try : GpTextOut16(NULL, &gpDraw[0], 10, 10, (char*)"some test text...", 0);

the gpfont16.h must be with all the other gp include file.

Have you modify your makefile to compile the libgpfont16.a ?

like this :

LDBASEFLAGS = -Tlnkscript -lgpfont -lgpfont16 -lm -lgpstdlib -lgpos -lgpgraphic -lgpgraphic16 -lgpstdio -lgpsound -lgpmem


if something below is missing in what you did then you have your solution.
:)
 
yep... done all that... :(

libgpfont16 is installed.
gpfont16.h is in the same dir as gpgraphic16 (which i can use no probs).
Yep, my libgpfont16 is in my gp32.mk file.
I'm using three screens gpDraw[0], gpDraw[1] and a background screen.
Tried GpTextOut16 on all three screens. Nothing...
<_<

I don't get any errors when i compile and, as i said, i can use GpTextOut no probs. Just GpTextOut16 that wont do what its s'posed to.... :blink:

It's times like this that i hate C for being so unfriendly... :angry:

Thank you for the reply Pekele. :)
 
and what about your makefile ?
You added the lgpfont16 ?

If all that is good, i wonder if it is not a wrong surface where you are trying to write.
It would explain the good compilation

I'm using GCC and i use GpTextOut16 with no pb.....

So it is probably in your code.
 
i don't have the lgpfont16 in my makefile but it IS in my gp32.mk file (which is included in my makefile). :)

I only have three surfaces open gpDraw0 and 1 and a background screen. I've tried writing to all of them with no luck... :( if i drop the 16 and use 8bit text on my 16bit screen that works (weird) but i put back the GpTextOut16 and i get nothing... :(

Spiv suggested (on #gp32dev) something wrong with my gpstart.c file (which i didnt even know i had!) but after finding it and replacing it with the one inside the 16bit patch still nothing! :angry:

It's getting to the point now where i'm thinking of just packing it in... more hassle than its worth... it really is... :( but i quite enjoy the challenge of programming, its just compiler problems that put me off it... <_<

See i thought maybe i was writing the text then blitting over it but i'm writing the text right before i do the screen flip so i'm definitely not overwriting it before i get to see it. Again i can use GpTextOut and i can see (weird) text no problem... :huh:
 
Make sure your text color is in 16 bit 0x0000 and not 0x00.

I dont think i have tried the 16bit textouts, ive always used 8bit for initialization then changed to 16bit afterwards. i think my textout was broken when i got the 16bit lib, so i dint really try.
 
then write a simple "hello world !" in 16 bpp with only one surface and look if it works.
It will answer you if it comes from your code or from a bad configuration of the environement :)
 
1:

GpTextOut16(NULL, &gpDraw[1], 10, 10, (char*)"some test text...", 0x0);

Just FYI it's technically (const char*) and this is implied, you don't need to put it.

2:

The compiler should auto-convert 0x00 to 0x0000 for 16-bit, hmm

3:

A lot of things are broken with the GCC includes, like the FX lib. If it still doesn't work try 8-bit, or write your own text functions :)
 
i've taken the code back to a Hello World example and nothing. No 16bit text.
I can use 8bit GpTextOut but nothing from GpTextOut16... :huh:

I'm beginning to think this command is a duffer.... :(

@Rico: if i use (const char*) i get a warning message (in GCC). Nothing drastic though... ;)


*sigh* just my luck... :(
 
ok... i think GpTextOut16 is knackered... :(

I've just done an 8bit hello world example and everything was fine. :)
(all bit commands of course)

I then put the screen into 16bit mode, drew a GpRectFill16 and that was fine, as expected. :)
Then added in my GpTextOut and got the expected (weird looking) result. :blink:

Changed the GpTextOut to GpTextOut16 and.... no text! :angry:

So i'm almost positive that GpTextOut16 just doesnt work! :blink:
I hope someone can prove me wrong here... as i really want to use text in my 16bit mode prog...
:(
 
Looks like it...

What I meant by (const char *) is that is what you're passing to the function, but you shouldn't have to do any cast at all.
 
from what i remember...

edit C:\devkitadv\gp32.mk (this is for Rico's devkitadvance!)

where its says:

GPLIBS=-lgpsdk -lgpgraphic -lgpmem -lgpos -lgpstdlib -lgpstdio -lgpsound -lgpfont -lgpg_ex01

add -lgpgraphic16 and -lgpfont16 to the list

then extract the .a to:

C:\devkitadv\arm-agb-elf\lib

and yes, extract the .h and .c to:

C:\devkitadv\arm-agb-elf\include\gp32

the last bit if i remember correctly, you have to 'make' the MakeFile:

C:\devkitadv\arm-agb-elf\lib\gpsdk\MakeFile

good luck!

C:\devkitadv\bin\make C:\devkitadv\arm-agb-elf\lib\gpsdk\MakeFile

should remake everything that's new from the 16bit zip

you should overwrite C:\devkitadv\arm-agb-elf\lib\gpsdk\gpstart\gpstart.c with the new one that has the line:
GpFontInit16 (&mInfo);
 
failing that then backup the object files (.o), maybe by renameing them .ox
then run make again, it should not say 'nothing to be done' this time

16bit fonts definately do work!
 
@feeblez: well thats good news since i need 16bit fonts, but bad news coz its means theres something wrong with my installation of the 16bit patch... :(

I checked my gpstart.c file and it DOES contain the fontinit thing you mentioned in the PM.
 
C:\devkitadv\bin\make C:\devkitadv\arm-agb-elf\lib\gpsdk\MakeFile

should remake everything that's new from the 16bit zip

you should overwrite C:\devkitadv\arm-agb-elf\lib\gpsdk\gpstart\gpstart.c with the new one that has the line:
  GpFontInit16 (&mInfo);
I am trying this simple hello world (from either Rico or CHN) modified for GpTextOut16. It does not work in GeePee32. Should it?
Code:
#include <stdlib.h>
#include "gpdef.h"
#include "gpstdlib.h"
#include "gpgraphic16.h"
#include "gpmain.h"
#include "gpstdio.h"
#include "gpfont16.h"

void GpMain(void *arg)
{
  int i;
  GpClockSpeedChange(132000000, 0x24001, 2);        /* speed = 133 Mhz */
	GpGraphicModeSet(16, 0);
	nflip = 1;

	/* Enable and clear LCD screen */	
  for(i = 0; i < 2; i++)
	{
  GpLcdSurfaceGet(&gpDraw[i], i); 
	} 
	GpRectFill16(NULL, &gpDraw[nflip], 0, 0, gpDraw[nflip].buf_w, gpDraw[nflip].buf_h, 0xff);
	
	GpSurfaceSet(&gpDraw[0]);
	
	srand(36547);                /* seed random numbers */

	while(1)
	{

	GpTextOut16(NULL, &gpDraw[nflip], 5, 5, "What did you expect? A freaking", 0);
	GpTextOut16(NULL, &gpDraw[nflip], 5, 21, "Hello World message?", 0);
    /* flip the page */
    GpSurfaceFlip(&gpDraw[nflip++]);
    nflip &= 0x01;
  }
}
 
Last edited by a moderator:
I am trying this simple hello world (from either Rico or CHN) modified for GpTextOut16. It does not work in GeePee32. Should it?
Yes, you idiot! It should work and does! Why don't you next time try reading all the posts! sheesh I am ashamed to be you!

P.S. (I forgot to look for the fontinit16 in gpstart.c)
 
Last edited by a moderator:
C:\devkitadv\bin\make C:\devkitadv\arm-agb-elf\lib\gpsdk\MakeFile

should remake everything that's new from the 16bit zip

you should overwrite C:\devkitadv\arm-agb-elf\lib\gpsdk\gpstart\gpstart.c with the new one that has the line:
GpFontInit16 (&mInfo);
ok, i stuffed up a bit on my instructions earlier... :rolleyes:

to re-make all the gcc gamepark libs just make sure you are in the 'C:\devkitadv\arm-agb-elf\lib\gpsdk\' folder and then run 'C:\devkitadv\bin\make'
 
Last edited by a moderator:
ah! Finally!
16bit text!!!!
Hurrah! :D

Many thanks to Feeblez for finding the solution.
As he said in his posts you need to remake the gpstart.o file.
Now done and GpTextOut16 works. :D

@ M^4 : whoa... whats YOUR problem? The 16bit patch files dont come with ANY instructions/readme file so how the hell am i (a beginner) meant to know how to use them? Hm??
You show me the posts regarding installation of 16bit patch files (which mention gpstart) and i'll read them.
Your ashamed to be me? Just as well you aren't me... i wouldn't want to have your bad attitude...
chill out man...

Big thanks to all the people who posted suggestions on this topic...
 
@ M^4 : whoa... whats YOUR problem? The 16bit patch files dont come with ANY instructions/readme file so how the hell am i (a beginner) meant to know how to use them? Hm??
Umm I think u misread my messages. as you can see I am quoting my own post so I am talking about myself. I had thought by quoting my own message it would be quite clear as to what I meant.
 
Last edited by a moderator:
well... calling yourself an idiot is fair enough... :D
Although a bit crazy! ;)

Apologies if i offended you... :(
 
Back
Top