Skip to content

Commit 28e600b

Browse files
committed
ascii art tables
1 parent 05ee1a5 commit 28e600b

File tree

1 file changed

+16
-29
lines changed

1 file changed

+16
-29
lines changed

src/studio/screens/console.c

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3061,15 +3061,14 @@ static void tabCompleteHelp(TabCompleteData* data)
30613061
finishTabComplete(data);
30623062
}
30633063

3064-
30653064
static s32 createRamTable(char* buf)
30663065
{
30673066
char* ptr = buf;
3068-
ptr += sprintf(ptr, "\n.-----------------------------------."
3069-
"\n| 80KB RAM LAYOUT |"
3070-
"\n|-----------------------------------|"
3067+
ptr += sprintf(ptr, "\n,-----------------------------------."
3068+
"\n| --= 80KB RAM LAYOUT =-- |"
3069+
"\n:===================================:"
30713070
"\n| ADDR | INFO | BYTES |"
3072-
"\n|-----------------------------------|");
3071+
"\n|-------+-------------------+-------|");
30733072

30743073
static const struct Row {s32 addr; const char* info;} Rows[] =
30753074
{
@@ -3110,11 +3109,11 @@ static s32 createRamTable(char* buf)
31103109
static s32 createVRamTable(char* buf)
31113110
{
31123111
char* ptr = buf;
3113-
ptr += sprintf(ptr, "\n.-----------------------------------."
3114-
"\n| 16KB VRAM LAYOUT |"
3115-
"\n|-----------------------------------|"
3112+
ptr += sprintf(ptr, "\n,-----------------------------------."
3113+
"\n| --= 16KB VRAM LAYOUT =-- |"
3114+
"\n:===================================:"
31163115
"\n| ADDR | INFO | BYTES |"
3117-
"\n|-----------------------------------|");
3116+
"\n|-------+-------------------+-------|");
31183117

31193118
static const struct Row {s32 addr; const char* info;} Rows[] =
31203119
{
@@ -3140,9 +3139,9 @@ static s32 createVRamTable(char* buf)
31403139
static s32 createKeysTable(char* buf)
31413140
{
31423141
char* ptr = buf;
3143-
ptr += sprintf(ptr, "\n.-----------------. .-----------------."
3142+
ptr += sprintf(ptr, "\n,-----------------. ,-----------------."
31443143
"\n|CODE| KEY | |CODE| KEY |"
3145-
"\n|-----------------| |-----------------|");
3144+
"\n|----+------------| |----+------------|");
31463145

31473146
static const struct Row {s32 code; const char* key;} Rows[] =
31483147
{
@@ -3255,9 +3254,9 @@ static s32 createKeysTable(char* buf)
32553254
static s32 createButtonsTable(char* buf)
32563255
{
32573256
char* ptr = buf;
3258-
ptr += sprintf(ptr, "\n.----------------------------."
3257+
ptr += sprintf(ptr, "\n,----------------------------."
32593258
"\n| ACTION | P1 | P2 | P3 | P4 |"
3260-
"\n|----------------------------|");
3259+
"\n|--------+----+----+----+----|");
32613260

32623261
static const struct Row {const char* action;} Rows[] =
32633262
{
@@ -3308,10 +3307,8 @@ static void onExport_help(Console* console, const char* param, const char* name,
33083307
FOR(const struct SpecRow*, row, SpecText1)
33093308
ptr += sprintf(ptr, "%-10s%s\n", row->section, row->info);
33103309

3311-
ptr += sprintf(ptr, "```\n```\n");
3312-
ptr += createRamTable(ptr);
3313-
ptr += sprintf(ptr, "```\n```");
33143310
ptr += createVRamTable(ptr);
3311+
ptr += createRamTable(ptr);
33153312
ptr += sprintf(ptr, "```\n\n## Console commands\n");
33163313

33173314
FOR(const Command*, cmd, Commands)
@@ -3548,19 +3545,9 @@ static void printTable(Console* console, const char* text)
35483545
nextLine(console);
35493546
else
35503547
{
3551-
u8 color = 0;
3552-
3553-
switch(symbol)
3554-
{
3555-
case '\'':
3556-
case '.':
3557-
case '|':
3558-
case '-':
3559-
color = tic_color_dark_grey;
3560-
break;
3561-
default:
3562-
color = CONSOLE_FRONT_TEXT_COLOR;
3563-
}
3548+
u8 color = strchr("'=:+.|-,", symbol)
3549+
? tic_color_dark_grey
3550+
: CONSOLE_FRONT_TEXT_COLOR;
35643551

35653552
setSymbol(console, symbol, color, cursorOffset(console));
35663553

0 commit comments

Comments
 (0)