Adding support for Yellow and fixing other bugs

This commit is contained in:
The Gears of Progress
2024-06-07 13:55:01 -04:00
parent e0f78a3195
commit 2cfec76b3c
15 changed files with 143 additions and 61 deletions

View File

@@ -2,6 +2,7 @@
#include <cstring>
#include "sprite_data.h"
#include "text_engine.h"
#define CBB 0
#define SBB 24
@@ -14,4 +15,30 @@ void background_frame()
REG_BG0HOFS = x;
REG_BG0VOFS = y;
}
void set_textbox_large()
{
tte_set_pos(40, 24);
tte_set_margins(40, 24, 206, 104);
tte_erase_rect(0, 0, H_MAX, V_MAX);
REG_BG2VOFS = 0;
}
void set_textbox_small()
{
tte_set_margins(LEFT, TOP, RIGHT, BOTTOM);
tte_erase_rect(0, 0, H_MAX, V_MAX);
REG_BG2VOFS = 96;
}
void show_textbox()
{
REG_BG0CNT = (REG_BG0CNT & ~BG_PRIO_MASK) | BG_PRIO(3);
REG_BG2CNT = (REG_BG2CNT & ~BG_PRIO_MASK) | BG_PRIO(2);
}
void hide_textbox()
{
REG_BG0CNT = (REG_BG0CNT & ~BG_PRIO_MASK) | BG_PRIO(2);
REG_BG2CNT = (REG_BG2CNT & ~BG_PRIO_MASK) | BG_PRIO(3);
}