gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
gbdk-support/romusage/src/banks_color.h
1 // This is free and unencumbered software released into the public domain.
2 // For more information, please refer to <https://unlicense.org>
3 // bbbbbr 2022
4
5
6 #ifndef _BANKS_COLOR_H
7 #define _BANKS_COLOR_H
8
9 #include "banks.h"
10
11
12 // VT100 color codes
13 // https://misc.flogisoft.com/bash/tip_colors_and_formatting
14
15 // Windows Console Virtual Terminal Sequences
16 // https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences
17
18 #define VT_ATTR_ALL_RESET 0
19 #define VT_ATTR_DIM 2
20 #define VT_ATTR_DIM_RESET 22
21
22 // 0 Default Returns all attributes to the default state prior to modification
23 // 1 Bold/Bright Applies brightness/intensity flag to foreground color
24 // 22 No bold/bright Removes brightness/intensity flag from foreground color
25 #define WINCON_ATTR_BRIGHT 1
26 #define WINCON_ATTR_BRIGHT_RESET 22
27
28 #define VT_COLOR_GREY_LIGHT 37
29 #define VT_COLOR_RED_LIGHT 91
30 #define VT_COLOR_GREEN_LIGHT 92
31 #define VT_COLOR_YELLOW_LIGHT 93
32 #define VT_COLOR_BLUE_LIGHT 94
33 #define VT_COLOR_MAGENTA_LIGHT 95
34 #define VT_COLOR_CYAN_LIGHT 96
35
36
37 #define VT_COLOR_GREY_DARK 90
38 #define VT_COLOR_RED_DARK 31
39 #define VT_COLOR_GREEN_DARK 32
40 #define VT_COLOR_YELLOW_DARK 33
41 #define VT_COLOR_BLUE_DARK 34
42 #define VT_COLOR_MAGENTA_DARK 35
43 #define VT_COLOR_CYAN_DARK 36
44
45 // Note: The preset Default color just uses the "reset to no attributes" code
46 // which should revert to the user's default terminal font color.
47 // -> Using VT_COLOR_GREY_LIGHT is also an option
48 #define PRINT_COLOR_DEFAULT (VT_ATTR_ALL_RESET)
49 #define PRINT_COLOR_ROM_DEFAULT (VT_COLOR_GREEN_LIGHT)
50 #define PRINT_COLOR_VRAM_DEFAULT (PRINT_COLOR_DEFAULT)
51 #define PRINT_COLOR_WRAM_DEFAULT (VT_COLOR_MAGENTA_LIGHT)
52 #define PRINT_COLOR_SRAM_DEFAULT (VT_COLOR_YELLOW_LIGHT)
53 #define PRINT_COLOR_HRAM_DEFAULT (VT_COLOR_CYAN_LIGHT)
54
55 typedef enum {
56 PRINT_REGION_ROW_START,
57 PRINT_REGION_ROW_MIDDLE_START,
58 PRINT_REGION_ROW_MIDDLE_END,
59 PRINT_REGION_ROW_END,
60 } bank_print_regions;
61
62 typedef struct color_pal_t {
63 uint8_t default_color;
64 uint8_t rom;
65 uint8_t vram;
66 uint8_t sram;
67 uint8_t wram;
68 uint8_t hram;
69 } color_pal_t;
70
71 bool colors_try_windows_enable_virtual_term_for_vt_codes(void);
72
73 void bank_render_color(bank_item * p_bank, int mode);
74
75 bool set_option_custom_bank_colors(char * arg_str);
76
77 #endif // _BANKS_PRINT_H
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.