# display character size...(quite urgent..)

• 07-11-2007
karthi
display character size...(quite urgent..)
Hi friends,

i have a function in my program to dispaly the character with color whatever i put..

i am using this in my game boy program..

by this function i can display the character with color..

but i want to display my character as big size..how to i display my character in the screen as big size then now..

is there any function to make character big to display..

is there any formula to display the character as big then now.??

please if u have any example coding or any information regarding this..

this is quite urgent..

the code is following..
--------------------------------------------------------------------------------------------
Code:

void printfC(u32 address, u8 x, u8 y, char *str, enum COLOUR colour)

//x, y    - co-ordinate determines location in array

// (0,0) = 0;  (1,0) = 1;  ... (29,0) = 29;  (30,0) = 30;  (31,0) = 31;
// (0,1) = 32; (1,1) = 33; ... (29,1) = 61;  (30,1) = 62;  (31,1) = 63;
// (0,2) = 64; (1,2) = 65; ... (29,2) = 93;  (30,2) = 94;  (31,2) = 95;
// (0,3) = 96; (1,3) = 97; ... (29,3) = 125; (30,3) = 126; (31,3) = 127;
// so (x,y) = (x + (y * 32));
{
if (strlen(str) == 0)
return;

u16 *pDst;

u16 location;

location = (x + (y * 32));

u16 len = strlen(str) + location;
u8 value;

for (u16 i = location; i < len; i++)
{
if (*str == 32)
value = (*str - 32);
else if (((*str) >= 48) && ((*str) <= 57))
{
value = *str;

switch (colour)
{
case GREEN:
value += 73; //121 - 48
break;
case RED:
value += 109;
break;
case BLUE:
value += 145;
break;
}
}
else
{
value = *str;

switch (colour)
{
case GREEN:
value += 30; //95 - 65
break;
case RED:
value += 66;
break;
case BLUE:
value += 102;
break;
}
}
pDst[i] = value;
str++;
}

}

with regarding,
karthi..
• 07-11-2007
MacGyver
Wow.... an urgent request to alter gameboy code. I don't think I've ever seen that.

Are you expecting expert gameboy programmers to be active here and able to help you? RTM and STW. If you'd like some help with it, you might want to point us to the documentation associated with the libraries you're using. ;)

No guarentee people will feel like searching through them, but it's possible.
• 07-11-2007
and just to reinforce something macgyver touched on, when you title your thread as urgent, you wont get much more help than that given above. youll may get someone saying how you wont get much help when you post your thread urgent, though.

i havent really 'looked' at the code but ive glanced at it and it looks properly formed so thats good. however, use more coherent sentences in your post. dont just end each sentence with an ellipsis, and dont be afraid to use the entire line. im not trying to pick on you im trying to help you get help in the future--good luck :)
• 07-11-2007
zacs7
If you wrote it, I'm pretty sure you'd know how to fix it too.
• 07-11-2007
dwks
Code:

if (strlen(str) == 0)
Why not just
Code:

if(str[0] == '\0')
or even this?
Code:

if(!*str)
Code:

else if (((*str) >= 48) && ((*str) <= 57))
isdigit() from <ctype.h> is much more portable than that. http://www.cppreference.com/stdstring/isdigit.html

Also, declaring variables in the middle of a block is C99. You can do it, you should just be aware that it's a feature of a newer version of C.
• 07-11-2007
karthi
this is whole function source code..
in this i just want to add , one more fucntion to make the character big, may be we get the from the function paramater..but afterthat how to make character as big to display. i need this concept..

the function value i pass currently

Code:

PASS", GREEN);

after i can display pass in my screen..but the displsy is small,, but i want to display more big to see clearly..

with regards,
kar..
• 07-11-2007
dwks
So you want to display some text in a larger font?

Well, the code snippet that you posted has no control over what font is used, as far as I can see.
• 07-11-2007
karthi
Hi dwks,

i didn't use any font control..

and i dn't know how to use also

because i am new to c programming..

so if u have idea please forward the code , and how to use font control in this and make to display as larger??

with regards,
kar..
• 07-11-2007
dwks
I have no idea if that's what you need. I was just guessing.

Are you able to change the screen mode of your display? If you used a lower resolution, everything would seem larger (and blockier, but that's the price you'd pay).

Where do you load your font, if anywhere? What library are you using? How much code do you have; can you post more of it?

 Are you using the GBDK compiler? Does it come with documentation? [/edit]
• 07-11-2007
karthi
Hi,

i don't have other source with me..

i just need to added this function here..

without font control can we make larger the character?

using any method or any new function to make larger?

if u have anything please post to me..

with regards,
kar..
• 07-11-2007
dwks
Quote:

without font control can we make larger the character?

using any method or any new function to make larger?
I don't know. I've never programmed anything for the Game Boy.

But I might be able to find something about that if you can give me some more information about your program, like what compiler you are using. My educated guess is GDBK, based on LCC, which I linked to in my edit. Is that the one you are using?

So that's allf of the source code you have? That's not a complete program. Where's the rest of the source? Do you have access to it?

 Are you using these functions? http://gbdk.sourceforge.net/doc/html/console.h.html