this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

some text formatting for the help

Nesbox f724c8c9 8f17ae25

+68 -33
+6 -6
include/tic80_config.h
··· 78 78 # define TIC_WREN_DEF(macro) 79 79 #endif 80 80 81 - #define SCRIPT_LIST(macro) \ 82 - TIC_LUA_DEF(macro) \ 83 - TIC_MOON_DEF(macro) \ 84 - TIC_FENNEL_DEF(macro) \ 85 - TIC_JS_DEF(macro) \ 81 + #define SCRIPT_LIST(macro) \ 82 + TIC_LUA_DEF (macro) \ 83 + TIC_MOON_DEF (macro) \ 84 + TIC_FENNEL_DEF (macro) \ 85 + TIC_JS_DEF (macro) \ 86 86 TIC_SQUIRREL_DEF(macro) \ 87 - TIC_WREN_DEF(macro) 87 + TIC_WREN_DEF (macro) 88 88 89 89 #if defined(__APPLE__) 90 90 // TODO: this disables macos config
+62 -27
src/studio/screens/console.c
··· 121 121 "To make a retro styled game the whole process of creation takes place under some technical limitations: " 122 122 "240x136 pixels display, 16 color palette, 256 8x8 color sprites, 4 channel sound and etc."; 123 123 124 - static const char* SpecText = 125 - "DISPLAY: 240x136 pixels, 16 colors palette.\n" 126 - "INPUT: 4 gamepads with 8 buttons / mouse / keyboard.\n" 127 - "SPRITES: 256 8x8 tiles and 256 8x8 sprites.\n" 128 - "MAP: 240x136 cells, 1920x1088 pixels.\n" 129 - "SOUND: 4 channels with configareble waveforms.\n" 130 - "CODE: 64KB of Lua, Moonscript, JS, Wren, Fennel or Squirrel."; 124 + static const struct SpecRow {const char* section; const char* info;} SpecText1[] = 125 + { 126 + {"DISPLAY", "240x136 pixels, 16 colors palette."}, 127 + {"INPUT", "4 gamepads with 8 buttons / mouse / keyboard."}, 128 + {"SPRITES", "256 8x8 tiles and 256 8x8 sprites."}, 129 + {"MAP", "240x136 cells, 1920x1088 pixels."}, 130 + {"SOUND", "4 channels with configareble waveforms."}, 131 + {"CODE", "64KB of" 132 + #define SCRIPT_DEF(name, ...) " "#name 133 + SCRIPT_LIST(SCRIPT_DEF) 134 + #undef SCRIPT_DEF 135 + "." 136 + }, 137 + }; 131 138 132 139 static const char* TermsText = 133 140 "## Terms of Use\n" ··· 283 290 return isspace(sym); 284 291 } 285 292 286 - static void consolePrint(Console* console, const char* text, u8 color) 293 + static void consolePrintOffset(Console* console, const char* text, u8 color, s32 wrapLineOffset) 287 294 { 288 295 #ifndef BAREMETALPI 289 296 printf("%s", text); ··· 309 316 while(*cur && !iswrap(*cur++)) len--; 310 317 311 318 if(len > 0 && len <= console->cursor.pos.x) 319 + { 312 320 nextLine(console); 321 + console->cursor.pos.x = wrapLineOffset; 322 + } 313 323 } 314 324 315 325 setSymbol(console, symbol, iswrap(symbol) ? tic_color_dark_grey : color, cursorOffset(console)); ··· 325 335 console->input.pos = 0; 326 336 } 327 337 338 + static void consolePrint(Console* console, const char* text, u8 color) 339 + { 340 + consolePrintOffset(console, text, color, 0); 341 + } 342 + 328 343 static void printBack(Console* console, const char* text) 329 344 { 330 345 consolePrint(console, text, CONSOLE_BACK_TEXT_COLOR); ··· 352 367 353 368 static void commandDoneLine(Console* console, bool newLine) 354 369 { 355 - if(newLine) 356 - printLine(console); 370 + if(!console->args.cli) 371 + { 372 + if(newLine) 373 + printLine(console); 357 374 358 - char dir[TICNAME_MAX]; 359 - tic_fs_dir(console->fs, dir); 360 - if(strlen(dir)) 361 - printBack(console, dir); 375 + char dir[TICNAME_MAX]; 376 + tic_fs_dir(console->fs, dir); 377 + if(strlen(dir)) 378 + printBack(console, dir); 362 379 363 - printFront(console, ">"); 380 + printFront(console, ">"); 381 + } 364 382 365 383 console->active = true; 366 384 ··· 2769 2787 { 2770 2788 ptr += sprintf(ptr, "# " TIC_NAME_FULL "\n" TIC_VERSION"\n" TIC_COPYRIGHT"\n"); 2771 2789 ptr += sprintf(ptr, "\n## Welcome\n%s\n", WelcomeText); 2772 - ptr += sprintf(ptr, "\n## Specification\n%s\n```", SpecText); 2790 + ptr += sprintf(ptr, "\n## Specification\n```\n"); 2791 + 2792 + FOR(const struct SpecRow*, row, SpecText1) 2793 + ptr += sprintf(ptr, "%-10s%s\n", row->section, row->info); 2794 + 2795 + ptr += sprintf(ptr, "```\n```\n"); 2773 2796 ptr += createRamTable(ptr); 2774 2797 ptr += sprintf(ptr, "```\n```"); 2775 2798 ptr += createVRamTable(ptr); ··· 3012 3035 static void onHelp_spec(Console* console) 3013 3036 { 3014 3037 printLine(console); 3015 - printBack(console, SpecText); 3038 + 3039 + char buf[TICNAME_MAX]; 3040 + 3041 + FOR(const struct SpecRow*, row, SpecText1) 3042 + { 3043 + #define OFFSET 8 3044 + sprintf(buf, "%-" DEF2STR(OFFSET) "s%s\n", row->section, row->info); 3045 + consolePrintOffset(console, buf, tic_color_grey, OFFSET); 3046 + #undef OFFSET 3047 + } 3016 3048 } 3017 3049 3018 3050 static void onHelp_welcome(Console* console) ··· 3023 3055 3024 3056 static void onHelp_startup(Console* console) 3025 3057 { 3026 - printLine(console); 3027 - char buf[16]; 3028 - 3058 + char buf[TICNAME_MAX]; 3059 + printFront(console, "\nStartup options:\n"); 3029 3060 FOR(const struct StartupOption*, opt, StartupOptions) 3030 3061 { 3031 - sprintf(buf, "--%-10s", opt->name); 3032 - printFront(console, buf); 3033 - printBack(console, " "); 3034 - printBack(console, opt->help); 3035 - printLine(console); 3062 + #define OFFSET 12 3063 + #define PREFIX "--" 3064 + sprintf(buf, PREFIX "%-" DEF2STR(OFFSET) "s%s\n", opt->name, opt->help); 3065 + consolePrintOffset(console, buf, tic_color_grey, OFFSET + STRLEN(PREFIX)); 3066 + #undef PREFIX 3067 + #undef OFFSET 3036 3068 } 3037 3069 } 3038 3070 ··· 3150 3182 3151 3183 console->args.cmd = next; 3152 3184 3153 - printFront(console, command); 3185 + if(!console->args.cli) 3186 + printFront(console, command); 3187 + 3154 3188 processCommand(console, command); 3155 3189 } 3156 3190 ··· 3546 3580 { 3547 3581 loadDemo(console, 0); 3548 3582 3549 - if(!console->args.skip) 3583 + if(!console->args.cli) 3550 3584 { 3551 3585 printBack(console, "\n hello! type "); 3552 3586 printFront(console, "help"); ··· 3715 3749 memset(console->color, TIC_COLOR_BG, CONSOLE_BUFFER_SIZE); 3716 3750 memset(console->desc, 0, sizeof(CommandDesc)); 3717 3751 3752 + if(!console->args.cli) 3718 3753 { 3719 3754 Start* start = getStartScreen(); 3720 3755