Thread: display character size...(quite urgent..)

  1. #1
    Registered User
    Join Date
    May 2007
    Posts
    5

    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..

    please forward me..

    this is quite urgent..


    the code is following..
    --------------------------------------------------------------------------------------------
    Code:
    void printfC(u32 address, u8 x, u8 y, char *str, enum COLOUR colour)
    
    //address - destination address (i.e.: map address)
    //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;
    	pDst = (u16*)address;
    
    	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++;
    	}
    
    }
    waiting for your valuable reply..


    with regarding,
    karthi..

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    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.

  3. #3
    Registered User
    Join Date
    Oct 2006
    Location
    Canada
    Posts
    1,243
    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

  4. #4
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    If you wrote it, I'm pretty sure you'd know how to fix it too.

  5. #5
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    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.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  6. #6
    Registered User
    Join Date
    May 2007
    Posts
    5
    HI nadroj,
    Thanks for your reply..
    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:
    	printfC(MAP_ADDRESS, 0, 1, "
    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..

    waiitng for your valuable reply..

    with regards,
    kar..

  7. #7
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    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.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  8. #8
    Registered User
    Join Date
    May 2007
    Posts
    5
    Hi dwks,

    Thanks for your quick reply..

    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??

    i am really in deadline..

    Please help me..

    waiting for your reply..

    with regards,
    kar..

  9. #9
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    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?

    [edit] Are you using the GBDK compiler? Does it come with documentation? [/edit]
    Last edited by dwks; 07-11-2007 at 09:34 PM.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  10. #10
    Registered User
    Join Date
    May 2007
    Posts
    5
    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..

  11. #11
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    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?

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

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Code review
    By Elysia in forum C++ Programming
    Replies: 71
    Last Post: 05-13-2008, 09:42 PM
  2. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  3. syntax error when defining vectors
    By starkhorn in forum C++ Programming
    Replies: 5
    Last Post: 09-22-2004, 12:46 PM
  4. mygets
    By Dave_Sinkula in forum C Programming
    Replies: 6
    Last Post: 03-23-2003, 07:23 PM
  5. File Size and File Size on Disk
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 12-15-2001, 08:03 PM