sync back from ui4x

This commit is contained in:
Gwenhael Le Moine 2024-09-25 10:37:14 +02:00
parent 807292bc9f
commit 4e80ba7ea8
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
19 changed files with 154 additions and 154 deletions

View file

@ -50,12 +50,12 @@ DOTOS = src/cpu.o \
src/serial.o \
src/x_func.o
DOTOS_UI48 = src/ui48_config.o \
src/ui48_common.o \
src/ui48_sdl2.o \
src/ui48_ncurses.o \
src/ui48_emulator.o \
src/ui48_main.o
DOTOS_UI4x = src/ui4x_config.o \
src/ui4x_common.o \
src/ui4x_sdl2.o \
src/ui4x_ncurses.o \
src/ui4x_emulator.o \
src/ui4x_main.o
MSFS = src/MSFs/cpu.msf \
src/MSFs/debug.msf \
@ -120,7 +120,7 @@ all: libChf/libChf.a dist/saturn dist/saturn.cat docs
libChf/libChf.a:
make -C libChf
dist/saturn: $(DOTOS) $(DOTOS_UI48) libChf/libChf.a
dist/saturn: $(DOTOS) $(DOTOS_UI4x) libChf/libChf.a
$(CC) $^ -o $@ $(CFLAGS) $(LIBS) $(SDLLIBS) $(NCURSESLIBS)
dist/pack: src/pack.o src/disk_io.o src/debug.o libChf/libChf.a

View file

@ -126,7 +126,7 @@
#include <stdbool.h>
#include "ui48_config.h"
#include "ui4x_config.h"
/* CHF_EXTENDED_INFO:
Define this symbol if extended information is desired during condition

View file

@ -1,6 +0,0 @@
#ifndef _UI48_NCURSES_H
#define _UI48_NCURSES_H 1
extern void setup_frontend_ncurses( void );
#endif /* _UI48_NCURSES_H */

View file

@ -1,6 +0,0 @@
#ifndef _UI48_SDL2_H
#define _UI48_SDL2_H 1
extern void setup_frontend_sdl( void );
#endif /* _UI48_SDL2_H */

View file

@ -1,5 +1,5 @@
#ifndef _UI48_BITMAPS_BIG_FONT_H
#define _UI48_BITMAPS_BIG_FONT_H 1
#ifndef _UI4x_BITMAPS_BIG_FONT_H
#define _UI4x_BITMAPS_BIG_FONT_H 1
#define big_font_dot_width 8
#define big_font_dot_height 13
@ -169,4 +169,4 @@ static unsigned char big_font_X_bits[] = {
51, 51, 30, 30, 12, 12, 30, 30, 51, 51,
};
#endif /* _UI48_BITMAPS_BIG_FONT_H 1 */
#endif /* _UI4x_BITMAPS_BIG_FONT_H 1 */

View file

@ -1,5 +1,5 @@
#ifndef _UI48_BITMAPS_MISC_H
#define _UI48_BITMAPS_MISC_H 1
#ifndef _UI4x_BITMAPS_MISC_H
#define _UI4x_BITMAPS_MISC_H 1
#define hp_width 96
#define hp_height 24
@ -221,4 +221,4 @@ static unsigned char last_bitmap[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x29, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xc9, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80 };
#endif /* _UI48_BITMAPS_MISC_H 1 */
#endif /* _UI4x_BITMAPS_MISC_H 1 */

View file

@ -1,5 +1,5 @@
#ifndef _UI48_BITMAPS_SMALL_FONT_H
#define _UI48_BITMAPS_SMALL_FONT_H 1
#ifndef _UI4x_BITMAPS_SMALL_FONT_H
#define _UI4x_BITMAPS_SMALL_FONT_H 1
#define blank_width 4
#define blank_height 7
@ -330,94 +330,94 @@ static unsigned char lcurly_bits[] = { 0x18, 0x04, 0x04, 0x02, 0x04, 0x04, 0x18
#define rcurly_height 7
static unsigned char rcurly_bits[] = { 0x03, 0x04, 0x04, 0x08, 0x04, 0x04, 0x03 };
#define sqr_gx_width 11
#define sqr_gx_height 13
static unsigned char sqr_gx_bits[] = { 0x00, 0x03, 0x80, 0x04, 0x00, 0x04, 0x00, 0x02, 0x00, 0x01, 0x80, 0x07, 0x00,
#define sqr_48gx_width 11
#define sqr_48gx_height 13
static unsigned char sqr_48gx_bits[] = { 0x00, 0x03, 0x80, 0x04, 0x00, 0x04, 0x00, 0x02, 0x00, 0x01, 0x80, 0x07, 0x00,
0x00, 0x66, 0x00, 0x14, 0x00, 0x08, 0x00, 0x14, 0x00, 0x53, 0x00, 0x21, 0x00 };
#define root_gx_width 18
#define root_gx_height 15
static unsigned char root_gx_bits[] = { 0x66, 0x00, 0x00, 0x14, 0x00, 0x00, 0x08, 0x00, 0x00, 0x14, 0x00, 0x00, 0x53, 0xfe, 0x03,
#define root_48gx_width 18
#define root_48gx_height 15
static unsigned char root_48gx_bits[] = { 0x66, 0x00, 0x00, 0x14, 0x00, 0x00, 0x08, 0x00, 0x00, 0x14, 0x00, 0x00, 0x53, 0xfe, 0x03,
0x21, 0x02, 0x02, 0x00, 0x02, 0x00, 0x00, 0x99, 0x00, 0x00, 0x91, 0x00, 0x10, 0x91, 0x00,
0xa0, 0x50, 0x00, 0xc0, 0x60, 0x00, 0x80, 0x20, 0x00, 0x00, 0x14, 0x00, 0x00, 0x0c, 0x00 };
#define pow10_gx_width 13
#define pow10_gx_height 12
static unsigned char pow10_gx_bits[] = { 0x00, 0x12, 0x00, 0x0c, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x09, 0x32, 0x00,
#define pow10_48gx_width 13
#define pow10_48gx_height 12
static unsigned char pow10_48gx_bits[] = { 0x00, 0x12, 0x00, 0x0c, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x09, 0x32, 0x00,
0x4b, 0x00, 0x4a, 0x00, 0x4a, 0x00, 0x4a, 0x00, 0x4a, 0x00, 0x32, 0x00 };
#define exp_gx_width 13
#define exp_gx_height 12
static unsigned char exp_gx_bits[] = { 0x00, 0xfb, 0x00, 0xf6, 0x00, 0xe6, 0x00, 0xf6, 0x80, 0xed, 0x18, 0xe0,
#define exp_48gx_width 13
#define exp_48gx_height 12
static unsigned char exp_48gx_bits[] = { 0x00, 0xfb, 0x00, 0xf6, 0x00, 0xe6, 0x00, 0xf6, 0x80, 0xed, 0x18, 0xe0,
0x36, 0xe0, 0x36, 0xe0, 0x1f, 0xe0, 0x03, 0xe0, 0x13, 0xe0, 0x0e, 0xe0 };
#define parens_gx_width 20
#define parens_gx_height 12
static unsigned char parens_gx_bits[] = { 0x0c, 0x00, 0x03, 0x06, 0x00, 0x06, 0x06, 0x00, 0x06, 0x03, 0x00, 0x0c,
#define parens_48gx_width 20
#define parens_48gx_height 12
static unsigned char parens_48gx_bits[] = { 0x0c, 0x00, 0x03, 0x06, 0x00, 0x06, 0x06, 0x00, 0x06, 0x03, 0x00, 0x0c,
0x03, 0x00, 0x0c, 0x03, 0x00, 0x0c, 0x03, 0x00, 0x0c, 0x03, 0x00, 0x0c,
0x03, 0x00, 0x0c, 0x06, 0x00, 0x06, 0x06, 0x00, 0x06, 0x0c, 0x00, 0x03 };
#define hash_gx_width 8
#define hash_gx_height 12
static unsigned char hash_gx_bits[] = { 0x00, 0x00, 0x48, 0x48, 0xfe, 0x24, 0x24, 0x7f, 0x12, 0x12, 0x00, 0x00 };
#define hash_48gx_width 8
#define hash_48gx_height 12
static unsigned char hash_48gx_bits[] = { 0x00, 0x00, 0x48, 0x48, 0xfe, 0x24, 0x24, 0x7f, 0x12, 0x12, 0x00, 0x00 };
#define bracket_gx_width 12
#define bracket_gx_height 12
static unsigned char bracket_gx_bits[] = { 0x0f, 0x0f, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c,
#define bracket_48gx_width 12
#define bracket_48gx_height 12
static unsigned char bracket_48gx_bits[] = { 0x0f, 0x0f, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c,
0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x0f, 0x0f };
#define under_gx_width 10
#define under_gx_height 12
static unsigned char under_gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
#define under_48gx_width 10
#define under_48gx_height 12
static unsigned char under_48gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0xff, 0x03 };
#define prog_gx_width 24
#define prog_gx_height 12
static unsigned char prog_gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xc3, 0x18,
#define prog_48gx_width 24
#define prog_48gx_height 12
static unsigned char prog_48gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xc3, 0x18,
0x8c, 0x81, 0x31, 0xc6, 0x00, 0x63, 0x63, 0x00, 0xc6, 0xc6, 0x00, 0x63,
0x8c, 0x81, 0x31, 0x18, 0xc3, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
#define quote_gx_width 12
#define quote_gx_height 12
static unsigned char quote_gx_bits[] = { 0x05, 0x0a, 0x05, 0x0a, 0x05, 0x0a, 0x05, 0x0a, 0x00, 0x00, 0x00, 0x00,
#define quote_48gx_width 12
#define quote_48gx_height 12
static unsigned char quote_48gx_bits[] = { 0x05, 0x0a, 0x05, 0x0a, 0x05, 0x0a, 0x05, 0x0a, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
#define curly_gx_width 14
#define curly_gx_height 12
static unsigned char curly_gx_bits[] = { 0x0c, 0x0c, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x03, 0x30,
#define curly_48gx_width 14
#define curly_48gx_height 12
static unsigned char curly_48gx_bits[] = { 0x0c, 0x0c, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x03, 0x30,
0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x0c, 0x0c };
#define colon_gx_width 8
#define colon_gx_height 12
static unsigned char colon_gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0x00, 0x00, 0xc3, 0xc3, 0x00 };
#define colon_48gx_width 8
#define colon_48gx_height 12
static unsigned char colon_48gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0x00, 0x00, 0xc3, 0xc3, 0x00 };
#define angle_gx_width 12
#define angle_gx_height 12
static unsigned char angle_gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x01, 0xc0, 0x00, 0xe0, 0x01,
#define angle_48gx_width 12
#define angle_48gx_height 12
static unsigned char angle_48gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x01, 0xc0, 0x00, 0xe0, 0x01,
0xb0, 0x03, 0x18, 0x03, 0x0c, 0x03, 0x06, 0x03, 0xff, 0x0f, 0xff, 0x0f };
#define pi_gx_width 10
#define pi_gx_height 12
static unsigned char pi_gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0x03, 0xff, 0x01,
#define pi_48gx_width 10
#define pi_48gx_height 12
static unsigned char pi_48gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0x03, 0xff, 0x01,
0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00 };
#define nl_gx_width 18
#define nl_gx_height 12
static unsigned char nl_gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x03, 0xf0, 0x00, 0x03,
#define nl_48gx_width 18
#define nl_48gx_height 12
static unsigned char nl_48gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x03, 0xf0, 0x00, 0x03,
0xfc, 0x00, 0x03, 0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0xfc, 0x00, 0x00,
0xf0, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
#define comma_gx_width 3
#define comma_gx_height 12
static unsigned char comma_gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x04, 0x04, 0x02 };
#define comma_48gx_width 3
#define comma_48gx_height 12
static unsigned char comma_48gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x04, 0x04, 0x02 };
#define arrow_gx_width 18
#define arrow_gx_height 12
static unsigned char arrow_gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x3c, 0x00,
#define arrow_48gx_width 18
#define arrow_48gx_height 12
static unsigned char arrow_48gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x3c, 0x00,
0x00, 0xfc, 0x00, 0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0x00, 0xfc, 0x00,
0x00, 0x3c, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
#define equal_gx_width 8
#define equal_gx_height 12
static unsigned char equal_gx_bits[] = { 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00 };
#define equal_48gx_width 8
#define equal_48gx_height 12
static unsigned char equal_48gx_bits[] = { 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00 };
#endif /* _UI48_BITMAPS_SMALL_FONT_H 1 */
#endif /* _UI4x_BITMAPS_SMALL_FONT_H 1 */

View file

@ -1,17 +1,17 @@
#include <stdlib.h>
#include "ui48_common.h"
#include "ui48_inner.h"
#include "ui48_sdl2.h"
#include "ui48_ncurses.h"
#include "ui4x_common.h"
#include "ui4x_inner.h"
#include "ui4x_sdl2.h"
#include "ui4x_ncurses.h"
letter_t small_font[ 128 ] = {
{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 */
{nl_48gx_width, nl_48gx_height, nl_48gx_bits }, /* \x01 == \n gx */
{comma_48gx_width, comma_48gx_height, comma_48gx_bits }, /* \x02 == comma gx */
{arrow_48gx_width, arrow_48gx_height, arrow_48gx_bits }, /* \x03 == \-> gx */
{equal_48gx_width, equal_48gx_height, equal_48gx_bits }, /* \x04 == equal gx */
{pi_48gx_width, pi_48gx_height, pi_48gx_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 */
@ -25,19 +25,19 @@ letter_t small_font[ 128 ] = {
{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 */
{sqr_48gx_width, sqr_48gx_height, sqr_48gx_bits }, /* \x13 == sqr gx */
{root_48gx_width, root_48gx_height, root_48gx_bits }, /* \x14 == root gx */
{pow10_48gx_width, pow10_48gx_height, pow10_48gx_bits }, /* \x15 == pow10 gx */
{exp_48gx_width, exp_48gx_height, exp_48gx_bits }, /* \x16 == exp gx */
{parens_48gx_width, parens_48gx_height, parens_48gx_bits }, /* \x17 == ( ) gx */
{hash_48gx_width, hash_48gx_height, hash_48gx_bits }, /* \x18 == # gx */
{bracket_48gx_width, bracket_48gx_height, bracket_48gx_bits }, /* \x19 == [] gx */
{under_48gx_width, under_48gx_height, under_48gx_bits }, /* \x1a == _ gx */
{prog_48gx_width, prog_48gx_height, prog_48gx_bits }, /* \x1b == << >> gx */
{quote_48gx_width, quote_48gx_height, quote_48gx_bits }, /* \x1c == " " gx */
{curly_48gx_width, curly_48gx_height, curly_48gx_bits }, /* \x1d == {} gx */
{colon_48gx_width, colon_48gx_height, colon_48gx_bits }, /* \x1e == :: gx */
{angle_48gx_width, angle_48gx_height, angle_48gx_bits }, /* \x1f == angle gx */
{blank_width, blank_height, blank_bits }, /* # 32 */
{0, 0, 0 },
{0, 0, 0 },
@ -267,7 +267,7 @@ letter_t big_font[ 128 ] = {
{0, 0, 0 }
};
color_t colors_sx[ NB_COLORS ] = {
color_t colors_48sx[ NB_COLORS ] = {
{
/* #ffffff */
.name = "white",
@ -470,7 +470,7 @@ color_t colors_sx[ NB_COLORS ] = {
},
};
color_t colors_gx[ NB_COLORS ] = {
color_t colors_48gx[ NB_COLORS ] = {
{
/* #FFFFFF */
.name = "white",
@ -673,7 +673,7 @@ color_t colors_gx[ NB_COLORS ] = {
},
};
button_t buttons_sx[ NB_KEYS ] = {
button_t buttons_48sx[ NB_KEYS ] = {
{.name = "A",
.x = 0,
.y = 0,
@ -1468,7 +1468,7 @@ button_t buttons_sx[ NB_KEYS ] = {
.sub = 0 },
};
button_t buttons_gx[ NB_KEYS ] = {
button_t buttons_48gx[ NB_KEYS ] = {
{.name = "A",
.x = 0,
.y = 0,

View file

@ -1,7 +1,7 @@
#ifndef _UI48_COMMON_H
#define _UI48_COMMON_H 1
#ifndef _UI4x_COMMON_H
#define _UI4x_COMMON_H 1
#include "ui48_config.h"
#include "ui4x_config.h"
/*************************************************/
/* public API: if it's there it's used elsewhere */
@ -15,4 +15,4 @@ extern void ( *ui_stop )( void );
extern void setup_ui( config_t* config );
extern void close_and_exit( void );
#endif /* !_UI48_COMMON_H */
#endif /* !_UI4x_COMMON_H */

View file

@ -10,10 +10,10 @@
#include <getopt.h>
#include "ui48_config.h"
#include "ui4x_config.h"
static config_t config = {
.progname = ( char* )"ui48",
.progname = ( char* )"ui4x",
.model = MODEL_48GX,
.verbose = false,

View file

@ -1,5 +1,5 @@
#ifndef _UI48_CONFIG_H
#define _UI48_CONFIG_H 1
#ifndef _UI4x_CONFIG_H
#define _UI4x_CONFIG_H 1
#include <stdbool.h>
@ -52,4 +52,4 @@ typedef struct {
/*************/
extern config_t* config_init( int argc, char* argv[] );
#endif /* !_UI48_CONFIG_H */
#endif /* !_UI4x_CONFIG_H */

View file

@ -2,8 +2,8 @@
#include <stdlib.h>
#include <string.h>
#include "ui48_config.h"
#include "ui48_emulator.h"
#include "ui4x_config.h"
#include "ui4x_emulator.h"
#include "config.h"
#include "keyb.h"

View file

@ -1,9 +1,9 @@
#ifndef _UI48_EMULATOR_H
#define _UI48_EMULATOR_H 1
#ifndef _UI4x_EMULATOR_H
#define _UI4x_EMULATOR_H 1
#include <stdbool.h>
#include "ui48_config.h"
#include "ui4x_config.h"
// Keys
#define HPKEY_A 0
@ -100,4 +100,4 @@ extern bool get_display_state( void );
extern void get_lcd_buffer( int* target );
extern int get_contrast( void );
#endif /* !_UI48_EMULATOR_H */
#endif /* !_UI4x_EMULATOR_H */

View file

@ -1,11 +1,11 @@
#ifndef _UI48_INNER_H
#define _UI48_INNER_H 1
#ifndef _UI4x_INNER_H
#define _UI4x_INNER_H 1
#include "ui48_emulator.h"
#include "ui4x_emulator.h"
#include "ui48_bitmaps_misc.h"
#include "ui48_bitmaps_small_font.h"
#include "ui48_bitmaps_big_font.h"
#include "ui4x_bitmaps_misc.h"
#include "ui4x_bitmaps_small_font.h"
#include "ui4x_bitmaps_big_font.h"
// Colors
/* SX GX */
@ -75,11 +75,11 @@ typedef struct button_t {
extern letter_t small_font[ 128 ];
extern letter_t big_font[ 128 ];
extern color_t colors_sx[ NB_COLORS ];
extern color_t colors_gx[ NB_COLORS ];
extern color_t colors_48sx[ NB_COLORS ];
extern color_t colors_48gx[ NB_COLORS ];
extern button_t buttons_sx[ NB_KEYS ];
extern button_t buttons_gx[ NB_KEYS ];
extern button_t buttons_48sx[ NB_KEYS ];
extern button_t buttons_48gx[ NB_KEYS ];
#define small_ascent 8
#define small_descent 4
@ -90,4 +90,4 @@ extern button_t buttons_gx[ NB_KEYS ];
extern int SmallTextWidth( const char* string, unsigned int length );
extern int BigTextWidth( const char* string, unsigned int length );
#endif /* _UI48_INNER_H */
#endif /* _UI4x_INNER_H */

View file

@ -6,15 +6,15 @@
#include <time.h>
#include <sys/time.h>
#include "ui48_config.h"
#include "ui48_emulator.h"
#include "ui48_common.h"
#include "ui4x_config.h"
#include "ui4x_emulator.h"
#include "ui4x_common.h"
#include "config.h"
#include "cpu.h"
#include "monitor.h"
#define SPEED_HZ_UI 64
#define UI_REFRESH_RATE_Hz 64
/* Chf condition codes (main program only) */
@ -191,9 +191,9 @@ int main( int argc, char** argv )
*/
struct itimerval it;
it.it_interval.tv_sec = 0;
it.it_interval.tv_usec = 1000000 / SPEED_HZ_UI;
it.it_value.tv_sec = 0;
it.it_value.tv_usec = 1000000 / SPEED_HZ_UI;
it.it_interval.tv_usec = 1000000 / UI_REFRESH_RATE_Hz;
it.it_value.tv_sec = it.it_interval.tv_sec;
it.it_value.tv_usec = it.it_interval.tv_usec;
setitimer( ITIMER_REAL, &it, ( struct itimerval* )0 );
if ( config.monitor )

View file

@ -14,13 +14,13 @@
#include <curses.h>
#include "ui48_config.h"
#include "ui48_emulator.h"
#include "ui48_common.h"
#include "ui48_inner.h"
#include "ui4x_config.h"
#include "ui4x_emulator.h"
#include "ui4x_common.h"
#include "ui4x_inner.h"
#define COLORS ( config.model == MODEL_48GX ? colors_gx : colors_sx )
#define BUTTONS ( config.model == MODEL_48GX ? buttons_gx : buttons_sx )
#define COLORS ( config.model == MODEL_48GX ? colors_48gx : colors_48sx )
#define BUTTONS ( config.model == MODEL_48GX ? buttons_48gx : buttons_48sx )
#define LCD_OFFSET_X 1
#define LCD_OFFSET_Y 1

6
src/ui4x_ncurses.h Normal file
View file

@ -0,0 +1,6 @@
#ifndef _UI4x_NCURSES_H
#define _UI4x_NCURSES_H 1
extern void setup_frontend_ncurses( void );
#endif /* _UI4x_NCURSES_H */

View file

@ -2,13 +2,13 @@
#include <SDL2/SDL.h>
#include "ui48_config.h"
#include "ui48_emulator.h"
#include "ui48_common.h"
#include "ui48_inner.h"
#include "ui4x_config.h"
#include "ui4x_emulator.h"
#include "ui4x_common.h"
#include "ui4x_inner.h"
#define COLORS ( config.model == MODEL_48GX ? colors_gx : colors_sx )
#define BUTTONS ( config.model == MODEL_48GX ? buttons_gx : buttons_sx )
#define COLORS ( config.model == MODEL_48GX ? colors_48gx : colors_48sx )
#define BUTTONS ( config.model == MODEL_48GX ? buttons_48gx : buttons_48sx )
#define KEYBOARD_HEIGHT ( BUTTONS[ LAST_HPKEY ].y + BUTTONS[ LAST_HPKEY ].h )
#define KEYBOARD_WIDTH ( BUTTONS[ LAST_HPKEY ].x + BUTTONS[ LAST_HPKEY ].w )

6
src/ui4x_sdl2.h Normal file
View file

@ -0,0 +1,6 @@
#ifndef _UI4x_SDL2_H
#define _UI4x_SDL2_H 1
extern void setup_frontend_sdl( void );
#endif /* _UI4x_SDL2_H */