I recently got an EZ-Flash IV GBA flash cart. It lets me run custom roms on real GBA hardware. So far this is what I've made:

You just move the '#' around with the dpad.
Oh, very cool! What programming language do you use? Are there a lot of resources that exist to help you learn? If the GBA processor is similar to the z80, like the original Gameboy (pardon my ignorance), did you find that calculator programming helped your GBA programming intuition?
I believe the GBA has both an ARM and a z80, with the ARM for "new games" and the z80 for old ones.
KermMartian wrote:
Oh, very cool! What programming language do you use? Are there a lot of resources that exist to help you learn? If the GBA processor is similar to the z80, like the original Gameboy (pardon my ignorance), did you find that calculator programming helped your GBA programming intuition?


There's an easy to use toolchain + libraries for the GBA called devKitPro that I use. The GBA has an ARM processor and is programmed in C (you might be able to use C++), but also has a z80-like co-processor for running GB games. I don't think the z80 is accessible from the ARM though.
Woo! I got sl running (albeit very slowly)
What sorts of graphical techniques exist on the GBA to prevent tearing like that?
elfprince13 wrote:
What sorts of graphical techniques exist on the GBA to prevent tearing like that?
To elaborate, can you do things like double-buffering? It looks like you're primarily working with an ncurses-like console at this point, perhaps the equivalent of text mode in DOS or graphing calculators' homescreen. I assume that there's also the equivalent of the graphscreen, via some 2D and/or 3D graphical libraries?
KermMartian wrote:
It looks like you're primarily working with an ncurses-like console at this point, perhaps the equivalent of text mode in DOS or graphing calculators' homescreen. I assume that there's also the equivalent of the graphscreen, via some 2D and/or 3D graphical libraries?


Exactly, this is only using an ANSI console library. The reason for the tearing is that it's just running super slowly. After changing the code a bit, I've sped it up to normal speeds:
I'd be interested to see what sorts of changes had to be made to get those improvements!
Here's what I changed:

Code:
//current
int my_mvaddstr(int y, int x, char *str)
{
    for ( ; x < 0; ++x, ++str)
        if (*str == '\0')  return ERR;
 
    if (x >= COLS || x < 0 || y >= LINES || y < 0) return ERR;
    iprintf("\033[%d;%dH%.*s", y, x, COLS - x, str);
 
    return OK;
}
 
//previous
int mvaddch(int y, int x, const char ch)
{
    if (x >= COLS || x < 0 || y >= LINES || y < 0) return ERR;
    iprintf("\033[%d;%dH%c", y, x, ch);
    return OK;
}
 
int my_mvaddstr(int y, int x, char *str)
{
    for ( ; x < 0; ++x, ++str)
        if (*str == '\0')  return ERR;
    for ( ; *str != '\0'; ++str, ++x)
        if (mvaddch(y, x, *str) == ERR)  return ERR;
    return OK;
}
Ah, cool, so you're basically just implementing curses API calls.
elfprince13 wrote:
Ah, cool, so you're basically just implementing curses API calls.

Only one, but yeah.
Bumpity

I've made another GBA project: https://cemete.ch/t13666
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement