Basic GBA coding queries

Discussion in 'Nintendo Game Development' started by splith, Jun 19, 2013.

  1. splith

    splith Resolute Member

    Joined:
    May 2, 2010
    Messages:
    997
    Likes Received:
    4
    So, after a few years of planning wonderful ideas with a GC and GBA dev kits and realising that they'd never come to fruitation, I've recently decided to start fiddling around with my GBA dev kit and put the C I learnt to use! But I've been having some problems... (Sidenote: Does anyone have any GBA programmer documentation? There's quite a few bits for the GC along with some very in depth tutorials I 'acquired' but I can't seem to find anything for GBA).

    So, I'm using the SN systems compiler and my first idea was to start with the font example as a base... After a few hours I came to the conclusion that the reason why I couldn't get it to change how it put characters out was because all the darn example really does is load in a BMP image and just print it out :/.

    So, I loaded up the joyboot_thread example and hacked that to pieces removing most references to joyboot (I can't seem to get it to compile properly if I fully remove the joyboot parts from the makefiles, not sure why). I've tried simple things with buttons like how to register one button press then ignore it until it's released (Yes I know it doesn't take bounce into consideration) but for some reason it ignores the checks I've put in place and holding a button keeps the loop executed. Also, if I add in a while() pause for when a button is pressed, it lags the display update and so misses out showing the character on the screen, yet the actual source file has no mention (that I can see) of where abouts or when the screen is actually updated, anyone got any ideas on this?

    Any help willl be greatly appreciated! :)
     
    Last edited: Jun 19, 2013
  2. splith

    splith Resolute Member

    Joined:
    May 2, 2010
    Messages:
    997
    Likes Received:
    4
    I noticed that I overlooked the 'Trg = ReadData & (ReadData ^ Cont);' line which does exactly what I wanted with much less hacking :).
    Also the reason this never worked is because the global variables were set when they were declared, I'm not sure if it's a bug or what but declaring the variables there means each time the function is ran, they are the values of those variables, you need to split it up to;
    's8 Num1, Num2;
    u8 Sign, Selector, Ignore;
    s16 Num3 ;'
    In the variable declaration and
    'Num1 = 0;
    Num2 = 0;
    Sign = 0;
    Selector = 0;
    Ignore = 0;
    Num3 = 0;'
    Inside the main function before the while loop.
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page