Join us on Discord!
You can help CodeWalrus stay online by donating here.

Ivoah's GBA programming thread [GBA]

Started by Ivoah, October 30, 2015, 02:57:24 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

alexgt

  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

Dream of Omnimaga

OOh that looks cool. :D Do you think the text speed can be improved?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Ivoah

Quote from: DJ Omnimaga on November 02, 2015, 04:08:40 AM
OOh that looks cool. :D Do you think the text speed can be improved?

I'm sure it could be improved, but I probably won't bother. Here's the rom for anyone that's interested: https://sr.ht/qrIf.gba
  • Calculators owned: TI-86 (now broken), TI SR-56, TI-Nspire CX CAS, TI-84+ SE, TI-84+ SE, TI-85, TI-73 Explorer VS, ViewScreen, TI-84+ CSE, TI-83+ SE

Dream of Omnimaga

As long as games that you make don't have text this slow I am fine :P (sprite-based games I mean. Imagine if the score took longer to display than the map XD)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

novenary

I suppose this text library uses software rendering which should explain why it's so slow.

Dream of Omnimaga

YEah that could be it. That reminds me, have you gotten any luck displaying sprites, ivoah? Also does the GBA have scrolling routines?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Ivoah

#21
Quote from: Streetwalrus on November 02, 2015, 09:07:55 AM
I suppose this text library uses software rendering which should explain why it's so slow.

I've changed some code up a bit and now it runs much better:


I replaced
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;
}


with
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;
}


Quote from: DJ Omnimaga on November 03, 2015, 04:27:44 AM
YEah that could be it. That reminds me, have you gotten any luck displaying sprites, ivoah? Also does the GBA have scrolling routines?

I haven't gotten around to doing anything beyond messing with the text output yet.
  • Calculators owned: TI-86 (now broken), TI SR-56, TI-Nspire CX CAS, TI-84+ SE, TI-84+ SE, TI-85, TI-73 Explorer VS, ViewScreen, TI-84+ CSE, TI-83+ SE

Dream of Omnimaga

I see. By the way nice speed improvement. Does the text engine support background color for individual characters and foreground?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

novenary

I don't think it needs any kind of scrolling routines, the hardware is designed to draw sprites at any place on the screen. If I recall correctly it supports a couple background and map layers, and standalone sprites. So whatever you do it's going to be fast.

Dream of Omnimaga

Yeah I was wondering because I wasn't sure if redrawing a tilemap every frame caused massive slowdowns.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Powered by EzPortal