Compare commits

...

10 commits

Author SHA1 Message Date
Gwenhael Le Moine
579d9fe0ae
use a bool
Some checks failed
C/C++ CI / build (push) Has been cancelled
2024-09-11 15:07:49 +02:00
Gwenhael Le Moine
d539fe6285
code colors in hex, drop unused a channel 2024-09-11 15:00:17 +02:00
Gwenhael Le Moine
901ec9d8f4
use less variables 2024-09-11 14:15:57 +02:00
Gwenhael Le Moine
780de5f458
split step_instruction() into smaller functions 2024-09-11 13:40:51 +02:00
Gwenhael Le Moine
7653154c34
oops, redo sdl screenshot at --scale=1 2024-09-10 21:02:05 +02:00
Gwenhael Le Moine
bb699baae1
new SDL2 screenshot with latest version 2024-09-10 20:58:21 +02:00
Gwenhael Le Moine
2427ff39af
re-create annunciators' textures after changing contrast 2024-09-10 20:46:50 +02:00
Gwenhael Le Moine
12b07d0d51
placement of serial devices text 2024-09-10 16:45:50 +02:00
Gwenhael Le Moine
4c5706f368
add some lowercase letters to small_font to display serial devices 2024-09-10 16:13:11 +02:00
Gwenhael Le Moine
6f96983a96
move symbols up in small_font to free places for regular lowercase letters 2024-09-10 15:42:00 +02:00
8 changed files with 2891 additions and 2579 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 27 KiB

File diff suppressed because it is too large Load diff

View file

@ -12,7 +12,7 @@ bool opt_gx = false;
bool opt_49 = false;
unsigned int rom_size = 0;
int read_rom_file( const char* name, unsigned char** mem, unsigned int* size )
bool read_rom_file( const char* name, unsigned char** mem, unsigned int* size )
{
struct stat st;
FILE* fp;
@ -25,19 +25,19 @@ int read_rom_file( const char* name, unsigned char** mem, unsigned int* size )
*size = 0;
if ( NULL == ( fp = fopen( name, "r" ) ) ) {
fprintf( stderr, "can\'t open %s\n", name );
return 0;
return false;
}
if ( stat( name, &st ) < 0 ) {
fprintf( stderr, "can\'t stat %s\n", name );
fclose( fp );
return 0;
return false;
}
if ( fread( four, 1, 4, fp ) != 4 ) {
fprintf( stderr, "can\'t read first 4 bytes of %s\n", name );
fclose( fp );
return 0;
return false;
}
if ( four[ 0 ] == 0x02 && four[ 1 ] == 0x03 && four[ 2 ] == 0x06 && four[ 3 ] == 0x09 ) {
@ -53,14 +53,14 @@ int read_rom_file( const char* name, unsigned char** mem, unsigned int* size )
} else {
fprintf( stderr, "%s is not a HP48 ROM\n", name );
fclose( fp );
return 0;
return false;
}
if ( fseek( fp, 0, 0 ) < 0 ) {
fprintf( stderr, "can\'t fseek to position 0 in %s\n", name );
*size = 0;
fclose( fp );
return 0;
return false;
}
*mem = ( unsigned char* )malloc( *size );
@ -75,7 +75,7 @@ int read_rom_file( const char* name, unsigned char** mem, unsigned int* size )
*mem = NULL;
*size = 0;
fclose( fp );
return 0;
return false;
}
} else {
/*
@ -88,7 +88,7 @@ int read_rom_file( const char* name, unsigned char** mem, unsigned int* size )
*mem = NULL;
*size = 0;
fclose( fp );
return 0;
return false;
}
if ( NULL == ( tmp_mem = ( unsigned char* )malloc( ( size_t )st.st_size ) ) ) {
@ -99,7 +99,7 @@ int read_rom_file( const char* name, unsigned char** mem, unsigned int* size )
*mem = NULL;
*size = 0;
fclose( fp );
return 0;
return false;
}
( *mem )[ j++ ] = byte & 0xf;
( *mem )[ j++ ] = ( byte >> 4 ) & 0xf;
@ -112,7 +112,7 @@ int read_rom_file( const char* name, unsigned char** mem, unsigned int* size )
*size = 0;
fclose( fp );
free( tmp_mem );
return 0;
return false;
}
for ( i = 0, j = 0; i < *size / 2; i++ ) {
@ -129,10 +129,7 @@ int read_rom_file( const char* name, unsigned char** mem, unsigned int* size )
if ( ( *mem )[ 0x29 ] == 0x00 ) {
if ( *size == ROM_SIZE_GX ) {
opt_gx = true;
} else if ( *size == 4 * ROM_SIZE_GX ) {
fprintf( stderr, "%s seems to be HP49 ROM, but size is 0x%x\n", name, *size );
opt_49 = true;
} else if ( *size == 8 * ROM_SIZE_GX ) {
} else if ( ( *size == 4 * ROM_SIZE_GX ) || ( *size == 8 * ROM_SIZE_GX ) ) {
fprintf( stderr, "%s seems to be HP49 ROM, but size is 0x%x\n", name, *size );
opt_49 = true;
} else {
@ -140,7 +137,7 @@ int read_rom_file( const char* name, unsigned char** mem, unsigned int* size )
free( *mem );
*mem = NULL;
*size = 0;
return 0;
return false;
}
} else {
if ( *size == ROM_SIZE_SX ) {
@ -150,9 +147,9 @@ int read_rom_file( const char* name, unsigned char** mem, unsigned int* size )
free( *mem );
*mem = NULL;
*size = 0;
return 0;
return false;
}
}
return 1;
return true;
}

View file

@ -7,6 +7,6 @@ extern bool opt_gx;
extern bool opt_49;
extern unsigned int rom_size;
extern int read_rom_file( const char* name, unsigned char** mem, unsigned int* size );
extern bool read_rom_file( const char* name, unsigned char** mem, unsigned int* size );
#endif /* !_ROMIO_H */

632
src/ui.c
View file

@ -12,37 +12,37 @@ unsigned char lcd_nibbles_buffer[ DISP_ROWS ][ NIBS_PER_BUFFER_ROW ];
letter_t small_font[ 128 ] = {
{0, 0, 0 },
{nl_gx_width, nl_gx_height, nl_gx_bits }, /* \001 == \n gx */
{comma_gx_width, comma_gx_height, comma_gx_bits }, /* \002 == comma gx */
{arrow_gx_width, arrow_gx_height, arrow_gx_bits }, /* \003 == \-> gx */
{equal_gx_width, equal_gx_height, equal_gx_bits }, /* \004 == equal gx */
{pi_gx_width, pi_gx_height, pi_gx_bits }, /* \005 == pi gx */
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 }, /* # 16 */
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 },
{nl_gx_width, nl_gx_height, nl_gx_bits }, /* \x01 == \n gx */
{comma_gx_width, comma_gx_height, comma_gx_bits }, /* \x02 == comma gx */
{arrow_gx_width, arrow_gx_height, arrow_gx_bits }, /* \x03 == \-> gx */
{equal_gx_width, equal_gx_height, equal_gx_bits }, /* \x04 == equal gx */
{pi_gx_width, pi_gx_height, pi_gx_bits }, /* \x05 == pi gx */
{arrow_width, arrow_height, arrow_bits }, /* \x06 == left arrow */
{diff_width, diff_height, diff_bits }, /* \x07 == differential */
{integral_width, integral_height, integral_bits }, /* \x08 == integral */
{sigma_width, sigma_height, sigma_bits }, /* \x09 == sigma */
{sqr_width, sqr_height, sqr_bits }, /* \x0a == sqr */
{root_width, root_height, root_bits }, /* \x0b == root */
{pow10_width, pow10_height, pow10_bits }, /* \x0c == pow10 */
{exp_width, exp_height, exp_bits }, /* \x0d == exp */
{prog_width, prog_height, prog_bits }, /* \x0e == << >> */
{string_width, string_height, string_bits }, /* \x0f == " " */
{nl_width, nl_height, nl_bits }, /* \x10 == New Line # 16 */
{pi_width, pi_height, pi_bits }, /* \x11 == pi */
{angle_width, angle_height, angle_bits }, /* \x12 == angle */
{sqr_gx_width, sqr_gx_height, sqr_gx_bits }, /* \x13 == sqr gx */
{root_gx_width, root_gx_height, root_gx_bits }, /* \x14 == root gx */
{pow10_gx_width, pow10_gx_height, pow10_gx_bits }, /* \x15 == pow10 gx */
{exp_gx_width, exp_gx_height, exp_gx_bits }, /* \x16 == exp gx */
{parens_gx_width, parens_gx_height, parens_gx_bits }, /* \x17 == ( ) gx */
{hash_gx_width, hash_gx_height, hash_gx_bits }, /* \x18 == # gx */
{bracket_gx_width, bracket_gx_height, bracket_gx_bits }, /* \x19 == [] gx */
{under_gx_width, under_gx_height, under_gx_bits }, /* \x1a == _ gx */
{prog_gx_width, prog_gx_height, prog_gx_bits }, /* \x1b == << >> gx */
{quote_gx_width, quote_gx_height, quote_gx_bits }, /* \x1c == " " gx */
{curly_gx_width, curly_gx_height, curly_gx_bits }, /* \x1d == {} gx */
{colon_gx_width, colon_gx_height, colon_gx_bits }, /* \x1e == :: gx */
{angle_gx_width, angle_gx_height, angle_gx_bits }, /* \x1f == angle gx */
{blank_width, blank_height, blank_bits }, /* # 32 */
{0, 0, 0 },
{0, 0, 0 },
@ -108,37 +108,37 @@ letter_t small_font[ 128 ] = {
{0, 0, 0 },
{under_width, under_height, under_bits },
{0, 0, 0 }, /* # 96 */
{arrow_width, arrow_height, arrow_bits }, /* a == left arrow */
{diff_width, diff_height, diff_bits }, /* b == differential */
{integral_width, integral_height, integral_bits }, /* c == integral */
{sigma_width, sigma_height, sigma_bits }, /* d == sigma */
{sqr_width, sqr_height, sqr_bits }, /* e == sqr */
{root_width, root_height, root_bits }, /* f == root */
{pow10_width, pow10_height, pow10_bits }, /* g == pow10 */
{exp_width, exp_height, exp_bits }, /* h == exp */
{prog_width, prog_height, prog_bits }, /* i == << >> */
{string_width, string_height, string_bits }, /* j == " " */
{nl_width, nl_height, nl_bits }, /* k == New Line */
{pi_width, pi_height, pi_bits }, /* l == pi */
{angle_width, angle_height, angle_bits }, /* m == angle */
{sqr_gx_width, sqr_gx_height, sqr_gx_bits }, /* n == sqr gx */
{root_gx_width, root_gx_height, root_gx_bits }, /* o == root gx */
{pow10_gx_width, pow10_gx_height, pow10_gx_bits }, /* p == pow10 gx */
{exp_gx_width, exp_gx_height, exp_gx_bits }, /* q == exp gx */
{parens_gx_width, parens_gx_height, parens_gx_bits }, /* r == ( ) gx */
{hash_gx_width, hash_gx_height, hash_gx_bits }, /* s == # gx */
{bracket_gx_width, bracket_gx_height, bracket_gx_bits }, /* t == [] gx */
{under_gx_width, under_gx_height, under_gx_bits }, /* u == _ gx */
{prog_gx_width, prog_gx_height, prog_gx_bits }, /* v == << >> gx */
{quote_gx_width, quote_gx_height, quote_gx_bits }, /* w == " " gx */
{curly_gx_width, curly_gx_height, curly_gx_bits }, /* x == {} gx */
{colon_gx_width, colon_gx_height, colon_gx_bits }, /* y == :: gx */
{angle_gx_width, angle_gx_height, angle_gx_bits }, /* z == angle gx */
{0, 0, 0 }, /* a */
{0, 0, 0 }, /* b */
{0, 0, 0 }, /* c */
{d_width, d_height, d_bits },
{e_width, e_height, e_bits },
{0, 0, 0 }, /* f */
{0, 0, 0 }, /* g */
{0, 0, 0 }, /* h */
{i_width, i_height, i_bits },
{0, 0, 0 }, /* j */
{0, 0, 0 }, /* k */
{0, 0, 0 }, /* l */
{0, 0, 0 }, /* m */
{0, 0, 0 }, /* n */
{0, 0, 0 }, /* o */
{p_width, p_height, p_bits },
{0, 0, 0 }, /* q */
{r_width, r_height, r_bits },
{s_width, s_height, s_bits },
{t_width, t_height, t_bits },
{0, 0, 0 }, /* u */
{v_width, v_height, v_bits },
{w_width, w_height, w_bits },
{0, 0, 0 }, /* x */
{y_width, y_height, y_bits },
{0, 0, 0 }, /* z */
{lcurly_width, lcurly_height, lcurly_bits },
{0, 0, 0 },
{rcurly_width, rcurly_height, rcurly_bits },
{0, 0, 0 },
{0, 0, 0 }
{0, 0, 0 }, /* 127 */
};
letter_t big_font[ 128 ] = {
@ -276,405 +276,365 @@ color_t colors_sx[ NB_COLORS ] = {
{
/* #ffffff */
.name = "white",
.r = 255,
.g = 255,
.b = 255,
.a = 255,
.mono_rgb = 255,
.gray_rgb = 255,
.r = 0xff,
.g = 0xff,
.b = 0xff,
.mono_rgb = 0xff,
.gray_rgb = 0xff,
},
{
/* #ffa600 */
.name = "left",
.r = 255,
.g = 166,
.b = 0,
.a = 255,
.mono_rgb = 255,
.gray_rgb = 230,
.r = 0xff,
.g = 0xa6,
.b = 0x00,
.mono_rgb = 0xff,
.gray_rgb = 0xe6,
},
{
/* #00d2ff */
.name = "right",
.r = 0,
.g = 210,
.b = 255,
.a = 255,
.mono_rgb = 255,
.gray_rgb = 169,
.r = 0x00,
.g = 0xd2,
.b = 0xff,
.mono_rgb = 0xff,
.gray_rgb = 0xa9,
},
{
/* #6d5d5d */
.name = "but_top",
.r = 109,
.g = 93,
.b = 93,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 91,
.r = 0x6d,
.g = 0x5d,
.b = 0x5d,
.mono_rgb = 0x00,
.gray_rgb = 0x5b,
},
{
/* #5a4d4d */
.name = "button",
.r = 90,
.g = 77,
.b = 77,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 81,
.r = 0x5a,
.g = 0x4d,
.b = 0x4d,
.mono_rgb = 0x00,
.gray_rgb = 0x51,
},
{
/* #4c4141 */
.name = "but_bot",
.r = 76,
.g = 65,
.b = 65,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 69,
.r = 0x4c,
.g = 0x41,
.b = 0x41,
.mono_rgb = 0x00,
.gray_rgb = 0x45,
},
{
/* #cadd5c */
.name = "lcd_col",
.r = 202,
.g = 221,
.b = 92,
.a = 255,
.mono_rgb = 255,
.gray_rgb = 205,
.r = 0xca,
.g = 0xdd,
.b = 0x5c,
.mono_rgb = 0xff,
.gray_rgb = 0xcd,
},
{
/* #000080 */
.name = "pix_col",
.r = 0,
.g = 0,
.b = 128,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 20,
.r = 0x00,
.g = 0x00,
.b = 0x80,
.mono_rgb = 0x00,
.gray_rgb = 0x14,
},
{
/* #6d4e4e */
.name = "pad_top",
.r = 109,
.g = 78,
.b = 78,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 88,
.r = 0x6d,
.g = 0x4e,
.b = 0x4e,
.mono_rgb = 0x00,
.gray_rgb = 0x58,
},
{
/* #5a4040 */
.name = "pad",
.r = 90,
.g = 64,
.b = 64,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 73,
.r = 0x5a,
.g = 0x40,
.b = 0x40,
.mono_rgb = 0x00,
.gray_rgb = 0x49,
},
{
/* #4c3636 */
.name = "pad_bot",
.r = 76,
.g = 54,
.b = 54,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 60,
.r = 0x4c,
.g = 0x36,
.b = 0x36,
.mono_rgb = 0x00,
.gray_rgb = 0x3c,
},
{
/* #9b7654 */
.name = "disp_pad_top",
.r = 155,
.g = 118,
.b = 84,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 124,
.r = 0x9b,
.g = 0x76,
.b = 0x54,
.mono_rgb = 0x00,
.gray_rgb = 0x7c,
},
{
/* #7c5e43 */
.name = "disp_pad",
.r = 124,
.g = 94,
.b = 67,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 99,
.r = 0x7c,
.g = 0x5e,
.b = 0x43,
.mono_rgb = 0x00,
.gray_rgb = 0x63,
},
{
/* #644b35 */
.name = "disp_pad_bot",
.r = 100,
.g = 75,
.b = 53,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 79,
.r = 0x64,
.g = 0x4b,
.b = 0x35,
.mono_rgb = 0x00,
.gray_rgb = 0x4f,
},
{
/* #cca96b */
.name = "logo",
.r = 204,
.g = 169,
.b = 107,
.a = 255,
.mono_rgb = 255,
.gray_rgb = 172,
.r = 0xcc,
.g = 0xa9,
.b = 0x6b,
.mono_rgb = 0xff,
.gray_rgb = 0xac,
},
{
/* #404040 */
.name = "logo_back",
.r = 64,
.g = 64,
.b = 64,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 65,
.r = 0x40,
.g = 0x40,
.b = 0x40,
.mono_rgb = 0x00,
.gray_rgb = 0x41,
},
{
/* #cab890 */
.name = "label",
.r = 202,
.g = 184,
.b = 144,
.a = 255,
.mono_rgb = 255,
.gray_rgb = 185,
.r = 0xca,
.g = 0xb8,
.b = 0x90,
.mono_rgb = 0xff,
.gray_rgb = 0xb9,
},
{
/* #000000 */
.name = "frame",
.r = 0,
.g = 0,
.b = 0,
.a = 255,
.mono_rgb = 255,
.gray_rgb = 0,
.r = 0x00,
.g = 0x00,
.b = 0x00,
.mono_rgb = 0xff,
.gray_rgb = 0x00,
},
{
/* #3c2a2a */
.name = "underlay",
.r = 60,
.g = 42,
.b = 42,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 48,
.r = 0x3c,
.g = 0x2a,
.b = 0x2a,
.mono_rgb = 0x00,
.gray_rgb = 0x30,
},
{
/* #000000 */
.name = "black",
.r = 0,
.g = 0,
.b = 0,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 0,
.r = 0x00,
.g = 0x00,
.b = 0x00,
.mono_rgb = 0x00,
.gray_rgb = 0x00,
},
};
color_t colors_gx[ NB_COLORS ] = {
{
/* #FFFFFF */
/* #ffffff */
.name = "white",
.r = 255,
.g = 255,
.b = 255,
.a = 255,
.mono_rgb = 255,
.gray_rgb = 255,
.r = 0xff,
.g = 0xff,
.b = 0xff,
.mono_rgb = 0xff,
.gray_rgb = 0xff,
},
{
/* #ffbaff */
.name = "left",
.r = 255,
.g = 186,
.b = 255,
.a = 255,
.mono_rgb = 255,
.gray_rgb = 220,
.r = 0xff,
.g = 0xba,
.b = 0xff,
.mono_rgb = 0xff,
.gray_rgb = 0xdc,
},
{
/* #00ffcc */
.name = "right",
.r = 0,
.g = 255,
.b = 204,
.a = 255,
.mono_rgb = 255,
.gray_rgb = 169,
.r = 0x00,
.g = 0xff,
.b = 0xcc,
.mono_rgb = 0xff,
.gray_rgb = 0xa9,
},
{
/* #646464 */
.name = "but_top",
.r = 104,
.g = 104,
.b = 104,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 104,
.r = 0x64,
.g = 0x64,
.b = 0x64,
.mono_rgb = 0x00,
.gray_rgb = 0x68,
},
{
/* #585858 */
.name = "button",
.r = 88,
.g = 88,
.b = 88,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 88,
.r = 0x58,
.g = 0x58,
.b = 0x58,
.mono_rgb = 0x00,
.gray_rgb = 0x58,
},
{
/* #4a4a4a */
.name = "but_bot",
.r = 74,
.g = 74,
.b = 74,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 74,
.r = 0x4a,
.g = 0x4a,
.b = 0x4a,
.mono_rgb = 0x00,
.gray_rgb = 0x4a,
},
{
/* #cadd5c */
.name = "lcd_col",
.r = 202,
.g = 221,
.b = 92,
.a = 255,
.mono_rgb = 255,
.gray_rgb = 205,
.r = 0xca,
.g = 0xdd,
.b = 0x5c,
.mono_rgb = 0xff,
.gray_rgb = 0xcd,
},
{
/* #000080 */
.name = "pix_col",
.r = 0,
.g = 0,
.b = 128,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 20,
.r = 0x00,
.g = 0x00,
.b = 0x80,
.mono_rgb = 0x00,
.gray_rgb = 0x14,
},
{
/* #585858 */
.name = "pad_top",
.r = 88,
.g = 88,
.b = 88,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 88,
.r = 0x58,
.g = 0x58,
.b = 0x58,
.mono_rgb = 0x00,
.gray_rgb = 0x58,
},
{
/* #4a4a4a */
.name = "pad",
.r = 74,
.g = 74,
.b = 74,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 74,
.r = 0x4a,
.g = 0x4a,
.b = 0x4a,
.mono_rgb = 0x00,
.gray_rgb = 0x4a,
},
{
/* #404040 */
.name = "pad_bot",
.r = 64,
.g = 64,
.b = 64,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 64,
.r = 0x40,
.g = 0x40,
.b = 0x40,
.mono_rgb = 0x00,
.gray_rgb = 0x40,
},
{
/* #808080 */
.name = "disp_pad_top",
.r = 128,
.g = 128,
.b = 138,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 128,
.r = 0x80,
.g = 0x80,
.b = 0x80,
.mono_rgb = 0x00,
.gray_rgb = 0x80,
},
{
/* #68686E */
.name = "disp_pad",
.r = 104,
.g = 104,
.b = 110,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 104,
.r = 0x68,
.g = 0x68,
.b = 0x6E,
.mono_rgb = 0x00,
.gray_rgb = 0x68,
},
{
/* #54545a */
.name = "disp_pad_bot",
.r = 84,
.g = 84,
.b = 90,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 84,
.r = 0x54,
.g = 0x54,
.b = 0x5a,
.mono_rgb = 0x00,
.gray_rgb = 0x54,
},
{
/* #b0b0b8 */
.name = "logo",
.r = 176,
.g = 176,
.b = 184,
.a = 255,
.mono_rgb = 255,
.gray_rgb = 176,
.r = 0xb0,
.g = 0xb0,
.b = 0xb8,
.mono_rgb = 0xff,
.gray_rgb = 0xb0,
},
{
/* #68686e */
.name = "logo_back",
.r = 104,
.g = 104,
.b = 110,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 104,
.r = 0x68,
.g = 0x68,
.b = 0x6e,
.mono_rgb = 0x00,
.gray_rgb = 0x68,
},
{
/* #f0f0f0 */
.name = "label",
.r = 240,
.g = 240,
.b = 240,
.a = 255,
.mono_rgb = 255,
.gray_rgb = 240,
.r = 0xf0,
.g = 0xf0,
.b = 0xf0,
.mono_rgb = 0xff,
.gray_rgb = 0xf0,
},
{
/* #000000 */
.name = "frame",
.r = 0,
.g = 0,
.b = 0,
.a = 255,
.mono_rgb = 255,
.gray_rgb = 0,
.r = 0x00,
.g = 0x00,
.b = 0x00,
.mono_rgb = 0xff,
.gray_rgb = 0x00,
},
{
/* #68686e */
.name = "underlay",
.r = 104,
.g = 104,
.b = 110,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 104,
.r = 0x68,
.g = 0x68,
.b = 0x6e,
.mono_rgb = 0x00,
.gray_rgb = 0x68,
},
{
/* #000000 */
.name = "black",
.r = 0,
.g = 0,
.b = 0,
.a = 255,
.mono_rgb = 0,
.gray_rgb = 0,
.r = 0x00,
.g = 0x00,
.b = 0x00,
.mono_rgb = 0x00,
.gray_rgb = 0x00,
},
};
@ -917,9 +877,9 @@ button_t buttons_sx[ NB_KEYS ] = {
.lh = 0,
.lb = 0,
.letter = "O",
.left = "aQ",
.left = "\x80Q",
.is_menu = 0,
.right = "aNUM",
.right = "\x80NUM",
.sub = 0 },
{.name = "LEFT",
.x = 150,
@ -984,7 +944,7 @@ button_t buttons_sx[ NB_KEYS ] = {
.letter = "S",
.left = "ASIN",
.is_menu = 0,
.right = "b",
.right = "\x07",
.sub = 0 },
{.name = "COS",
.x = 50,
@ -1000,7 +960,7 @@ button_t buttons_sx[ NB_KEYS ] = {
.letter = "T",
.left = "ACOS",
.is_menu = 0,
.right = "c",
.right = "\x08",
.sub = 0 },
{.name = "TAN",
.x = 100,
@ -1016,7 +976,7 @@ button_t buttons_sx[ NB_KEYS ] = {
.letter = "U",
.left = "ATAN",
.is_menu = 0,
.right = "d",
.right = "\x09",
.sub = 0 },
{.name = "SQRT",
.x = 150,
@ -1030,9 +990,9 @@ button_t buttons_sx[ NB_KEYS ] = {
.lh = sqrt_height,
.lb = sqrt_bitmap,
.letter = "V",
.left = "e",
.left = "\x0a",
.is_menu = 0,
.right = "f",
.right = "\x0b",
.sub = 0 },
{.name = "POWER",
.x = 200,
@ -1046,7 +1006,7 @@ button_t buttons_sx[ NB_KEYS ] = {
.lh = power_height,
.lb = power_bitmap,
.letter = "W",
.left = "g",
.left = "\x0c",
.is_menu = 0,
.right = "LOG",
.sub = 0 },
@ -1062,7 +1022,7 @@ button_t buttons_sx[ NB_KEYS ] = {
.lh = inv_height,
.lb = inv_bitmap,
.letter = "X",
.left = "h",
.left = "\x0d",
.is_menu = 0,
.right = "LN",
.sub = 0 },
@ -1386,9 +1346,9 @@ button_t buttons_sx[ NB_KEYS ] = {
.lh = minus_height,
.lb = minus_bitmap,
.letter = 0,
.left = "i",
.left = "\x0e",
.is_menu = 0,
.right = "j",
.right = "\x0f",
.sub = 0 },
{.name = "ON",
@ -1421,7 +1381,7 @@ button_t buttons_sx[ NB_KEYS ] = {
.letter = 0,
.left = "= ",
.is_menu = 0,
.right = " a",
.right = " \x80",
.sub = 0 },
{.name = "PERIOD",
.x = 120,
@ -1437,7 +1397,7 @@ button_t buttons_sx[ NB_KEYS ] = {
.letter = 0,
.left = ",",
.is_menu = 0,
.right = " k",
.right = " \x10",
.sub = 0 },
{.name = "SPC",
.x = 180,
@ -1451,9 +1411,9 @@ button_t buttons_sx[ NB_KEYS ] = {
.lh = 0,
.lb = 0,
.letter = 0,
.left = "l ",
.left = "\x11 ",
.is_menu = 0,
.right = " m",
.right = " \x12",
.sub = 0 },
{.name = "PLUS",
.x = 240,
@ -1712,7 +1672,7 @@ button_t buttons_gx[ NB_KEYS ] = {
.lh = 0,
.lb = 0,
.letter = "O",
.left = "aNUM",
.left = "\x06NUM",
.is_menu = 0,
.right = "UNDO",
.sub = 0 },
@ -1779,7 +1739,7 @@ button_t buttons_gx[ NB_KEYS ] = {
.letter = "S",
.left = "ASIN",
.is_menu = 0,
.right = "b",
.right = "\x07",
.sub = 0 },
{.name = "COS",
.x = 50,
@ -1795,7 +1755,7 @@ button_t buttons_gx[ NB_KEYS ] = {
.letter = "T",
.left = "ACOS",
.is_menu = 0,
.right = "c",
.right = "\x08",
.sub = 0 },
{.name = "TAN",
.x = 100,
@ -1811,7 +1771,7 @@ button_t buttons_gx[ NB_KEYS ] = {
.letter = "U",
.left = "ATAN",
.is_menu = 0,
.right = "d",
.right = "\x09",
.sub = 0 },
{.name = "SQRT",
.x = 150,
@ -1825,9 +1785,9 @@ button_t buttons_gx[ NB_KEYS ] = {
.lh = sqrt_height,
.lb = sqrt_bitmap,
.letter = "V",
.left = "n",
.left = "\x13",
.is_menu = 0,
.right = "o",
.right = "\x14",
.sub = 0 },
{.name = "POWER",
.x = 200,
@ -1841,7 +1801,7 @@ button_t buttons_gx[ NB_KEYS ] = {
.lh = power_height,
.lb = power_bitmap,
.letter = "W",
.left = "p",
.left = "\x15",
.is_menu = 0,
.right = "LOG",
.sub = 0 },
@ -1857,7 +1817,7 @@ button_t buttons_gx[ NB_KEYS ] = {
.lh = inv_height,
.lb = inv_bitmap,
.letter = "X",
.left = "q",
.left = "\x16",
.is_menu = 0,
.right = "LN",
.sub = 0 },
@ -2019,9 +1979,9 @@ button_t buttons_gx[ NB_KEYS ] = {
.lh = div_height,
.lb = div_bitmap,
.letter = 0,
.left = "r ",
.left = "\x17 ",
.is_menu = 0,
.right = "s",
.right = "\x18",
.sub = 0 },
{.name = "SHL",
@ -2100,9 +2060,9 @@ button_t buttons_gx[ NB_KEYS ] = {
.lh = mul_height,
.lb = mul_bitmap,
.letter = 0,
.left = "t ",
.left = "\x19 ",
.is_menu = 0,
.right = "u",
.right = "\x1a",
.sub = 0 },
{.name = "SHR",
@ -2181,9 +2141,9 @@ button_t buttons_gx[ NB_KEYS ] = {
.lh = minus_height,
.lb = minus_bitmap,
.letter = 0,
.left = "v ",
.left = "\x1b ",
.is_menu = 0,
.right = "w",
.right = "\x1c",
.sub = 0 },
{.name = "ON",
@ -2214,9 +2174,9 @@ button_t buttons_gx[ NB_KEYS ] = {
.lh = 0,
.lb = 0,
.letter = 0,
.left = "\004 ",
.left = "\x04 ",
.is_menu = 0,
.right = "\003",
.right = "\x03",
.sub = 0 },
{.name = "PERIOD",
.x = 120,
@ -2230,9 +2190,9 @@ button_t buttons_gx[ NB_KEYS ] = {
.lh = 0,
.lb = 0,
.letter = 0,
.left = "\002 ",
.left = "\x02 ",
.is_menu = 0,
.right = "\001",
.right = "\x01",
.sub = 0 },
{.name = "SPC",
.x = 180,
@ -2246,9 +2206,9 @@ button_t buttons_gx[ NB_KEYS ] = {
.lh = 0,
.lb = 0,
.letter = 0,
.left = "\005 ",
.left = "\x05 ",
.is_menu = 0,
.right = "z",
.right = "\x1f",
.sub = 0 },
{.name = "PLUS",
.x = 240,
@ -2262,9 +2222,9 @@ button_t buttons_gx[ NB_KEYS ] = {
.lh = plus_height,
.lb = plus_bitmap,
.letter = 0,
.left = "x ",
.left = "\x1d ",
.is_menu = 0,
.right = "y",
.right = "\x1e",
.sub = 0 },
};

View file

@ -85,6 +85,66 @@ static unsigned char nine_bits[] = {
#define small_colon_height 7
static unsigned char small_colon_bits[] = { 0x00, 0x03, 0x03, 0x00, 0x03, 0x03, 0x00 };
#define d_width 5
#define d_height 7
static unsigned char d_bits[] = {
16, 16, 30, 17, 17, 30, 0,
};
#define e_width 5
#define e_height 7
static unsigned char e_bits[] = {
0, 14, 17, 15, 1, 14, 0,
};
#define i_width 5
#define i_height 7
static unsigned char i_bits[] = {
4, 0, 6, 4, 4, 14, 0,
};
#define p_width 5
#define p_height 7
static unsigned char p_bits[] = {
0, 15, 17, 17, 15, 1, 1,
};
#define r_width 5
#define r_height 7
static unsigned char r_bits[] = {
0, 29, 3, 1, 1, 1, 0,
};
#define s_width 5
#define s_height 7
static unsigned char s_bits[] = {
0, 30, 1, 14, 16, 15, 0,
};
#define t_width 5
#define t_height 7
static unsigned char t_bits[] = {
2, 15, 2, 2, 2, 12, 0,
};
#define v_width 5
#define v_height 7
static unsigned char v_bits[] = {
0, 17, 17, 10, 10, 4, 0,
};
#define w_width 5
#define w_height 7
static unsigned char w_bits[] = {
0, 17, 17, 21, 21, 10, 0,
};
#define y_width 5
#define y_height 7
static unsigned char y_bits[] = {
0, 0, 17, 17, 30, 16, 15,
};
#define A_width 5
#define A_height 7
static unsigned char A_bits[] = { 0x0e, 0x11, 0x11, 0x1f, 0x11, 0x11, 0x11 };

View file

@ -43,7 +43,7 @@ typedef struct letter_t {
typedef struct color_t {
const char* name;
int r, g, b, a;
int r, g, b;
int mono_rgb;
int gray_rgb;
} color_t;

View file

@ -101,13 +101,13 @@ static SDL_Texture* bitmap_to_texture( unsigned int w, unsigned int h, unsigned
static void __draw_pixel( int x, int y, int color )
{
SDL_SetRenderDrawColor( renderer, colors[ color ].r, colors[ color ].g, colors[ color ].b, colors[ color ].a );
SDL_SetRenderDrawColor( renderer, colors[ color ].r, colors[ color ].g, colors[ color ].b, 0xff );
SDL_RenderDrawPoint( renderer, x, y );
}
static void __draw_line( int x1, int y1, int x2, int y2, int color )
{
SDL_SetRenderDrawColor( renderer, colors[ color ].r, colors[ color ].g, colors[ color ].b, colors[ color ].a );
SDL_SetRenderDrawColor( renderer, colors[ color ].r, colors[ color ].g, colors[ color ].b, 0xff );
SDL_RenderDrawLine( renderer, x1, y1, x2, y2 );
}
@ -119,7 +119,7 @@ static void __draw_rect( int x, int y, int w, int h, int color )
rect.w = w;
rect.h = h;
SDL_SetRenderDrawColor( renderer, colors[ color ].r, colors[ color ].g, colors[ color ].b, colors[ color ].a );
SDL_SetRenderDrawColor( renderer, colors[ color ].r, colors[ color ].g, colors[ color ].b, 0xff );
SDL_RenderFillRect( renderer, &rect );
}
@ -826,7 +826,6 @@ static void _show_key( int hpkey )
static void _draw_serial_devices_path( void )
{
int i = 0;
char text[ 1024 ] = "";
if ( config.verbose ) {
@ -835,29 +834,19 @@ static void _draw_serial_devices_path( void )
}
if ( wire_name ) {
char wire_name_uppercase[ strlen( wire_name ) ];
strcpy( wire_name_uppercase, wire_name );
for ( i = 0; i < ( int )strlen( wire_name ); i++ )
wire_name_uppercase[ i ] = toupper( wire_name_uppercase[ i ] );
strcat( text, "WIRE: " );
strcat( text, wire_name_uppercase );
strcat( text, "wire: " );
strcat( text, wire_name );
}
if ( ir_name ) {
char ir_name_uppercase[ strlen( ir_name ) ];
strcpy( ir_name_uppercase, ir_name );
for ( i = 0; i < ( int )strlen( ir_name ); i++ )
ir_name_uppercase[ i ] = toupper( ir_name_uppercase[ i ] );
if ( strlen( text ) > 0 )
strcat( text, " | " );
strcat( text, "IR: " );
strcat( text, ir_name_uppercase );
strcat( text, ir_name );
}
if ( strlen( text ) > 0 )
write_with_small_font( 10, 250, text, WHITE, DISP_PAD );
write_with_small_font( SIDE_SKIP, KEYBOARD_OFFSET_Y - ( DISP_KBD_SKIP / 2 ), text, WHITE, DISP_PAD );
}
static void sdl_draw_nibble( int nx, int ny, int val )
@ -1070,6 +1059,7 @@ void sdl_adjust_contrast( void )
// redraw annunc
last_annunc_state = -1;
create_annunciators_textures();
sdl_draw_annunc();
}