diff --git a/new-UI/BIOS-glyphs.bmp b/new-UI/BIOS-glyphs.bmp new file mode 120000 index 0000000..f779539 --- /dev/null +++ b/new-UI/BIOS-glyphs.bmp @@ -0,0 +1 @@ +../tiny-menu/BIOS-glyphs.bmp \ No newline at end of file diff --git a/new-UI/Makefile b/new-UI/Makefile new file mode 120000 index 0000000..02f1413 --- /dev/null +++ b/new-UI/Makefile @@ -0,0 +1 @@ +Makefile.emu \ No newline at end of file diff --git a/new-UI/Makefile.emu b/new-UI/Makefile.emu new file mode 100644 index 0000000..f57672b --- /dev/null +++ b/new-UI/Makefile.emu @@ -0,0 +1,59 @@ + +# Skeleton Makefile for DSO Quad applications + +NAME = new-UI + +PARTS = font.o input.o nice_font.o UI.o main.o + +DELIVERABLES = $(NAME) + +# Options for the linker. "-L support" helps the linker find the .lds files +LFLAGS = -L../support + +# "-I support" is so that make can find the DSO Quad platform files +CFLAGS = -I../support -I../lib -I../font-demo/bw +CFLAGS += $(shell pkg-config --cflags sdl) + +# Optimization & debug settings +CFLAGS += -fno-common -Os -std=gnu99 + +# Compiler warnings +CFLAGS += -Wall -Wno-unused + +# Avoid including the Cortex-specific headers: +CFLAGS += -D__EMULATED -D__CM3_CORE_H__ -D__IO= -D__I= # -D__STM32F10x_H + +CFLAGS += $(DEBUG) + +LIBS = $(shell pkg-config --libs sdl) + +.SILENT: + +# The directory for .o files and such. Keep it in RAM for speed and to reduce +# flash disc wear +TDIR = /tmp/$(NAME) + +# Add the support files to the list of objects to build: +PARTS += BIOS-emu.o + +# Tell make where to find transitional files: +VPATH = ../support:../lib:../font-demo/bw:$(TDIR) + +$(NAME): $(PARTS) + $(CC) $(CFLAGS) -o $@ $(PARTS) $(LFLAGS) $(LIBS) + +# Rebuild all parts if any header or the Makefile changes: +.c.o: *.h Makefile.emu + $(CC) $(CFLAGS) -c -o $@ $< + +.S.o: | $(TDIR) + $(CC) $(AFLAGS) -c -o $@ $< + +all: $(DELIVERABLES) main.c + +$(TDIR): + mkdir $(TDIR) + +clean: + rm -f *.o ../font-demo/bw/font.o $(TDIR)/*.o $(TDIR)/*.map $(DELIVERABLES) + diff --git a/new-UI/Makefile.quad b/new-UI/Makefile.quad new file mode 100644 index 0000000..f218577 --- /dev/null +++ b/new-UI/Makefile.quad @@ -0,0 +1,74 @@ + +# Skeleton Makefile for DSO Quad applications + +NAME = new-UI + +PARTS = font.o input.o nice_font.o UI.o main.o + +DELIVERABLES = PAGE18.HEX + +# Options for the linker. "-L support" helps the linker find the .lds files +LFLAGS = -L../support + +#LIBS = -lm + +# "-I support" is so that make can find the DSO Quad platform files +CFLAGS = -I../support -I../lib -I../font-demo/bw + +# Processor type +CFLAGS += -mcpu=cortex-m3 -mthumb -mno-thumb-interwork + +# Optimization & debug settings +CFLAGS += -fno-common -Os -std=gnu99 + +# Compiler warnings +CFLAGS += -Wall -Wno-unused + +CFLAGS += $(DEBUG) + +# Default linker arguments (disables GCC-provided startup.c, creates .map file) +LFLAGS += -nostartfiles -Wl,-Map=$(TDIR)/$(NAME).map -eReset_Handler + +.SILENT: + +# The directory for .o files and such. Keep it in RAM for speed and to reduce +# flash disc wear +TDIR = /tmp/$(NAME) + +# Add the support files to the list of objects to build: +PARTS += startup.o BIOS.o Interrupt.o + +# Names of the toolchain programs +CC = arm-none-eabi-gcc +OBJCOPY = arm-none-eabi-objcopy +SIZE = arm-none-eabi-size + +# Tell make where to find transitional files: +VPATH = ../support:../lib:../font-demo/bw:$(TDIR) + +# How to make .HEX files from .elf files: +%.HEX: %.elf + $(OBJCOPY) -O ihex $< $@ + +%.bin: %.elf + $(OBJCOPY) -O binary $< $@ + +%.elf: %.lds $(PARTS) | $(TDIR) + $(CC) $(CFLAGS) -o $@ $(PARTS) $(LFLAGS) $(LIBS) -T $< + +# Rebuild all parts if any header or the Makefile changes: +.c.o: *.h Makefile + $(CC) $(CFLAGS) -c -o $@ $< + +.S.o: | $(TDIR) + $(CC) $(AFLAGS) -c -o $@ $< + +all: $(DELIVERABLES) + $(SIZE) PAGE18.elf + +$(TDIR): + mkdir $(TDIR) + +clean: + rm -f $(TDIR)/*.o $(TDIR)/*.map $(DELIVERABLES) + diff --git a/new-UI/PAGE18.lds b/new-UI/PAGE18.lds new file mode 100644 index 0000000..3b9a39a --- /dev/null +++ b/new-UI/PAGE18.lds @@ -0,0 +1,8 @@ +/* Define memory regions. */ +MEMORY +{ + rom (rx) : ORIGIN = 0x0801e000, LENGTH = 8K + ram (rwx) : ORIGIN = 0x20003000, LENGTH = 32K /* Total size is 36K, leave 4K for stack */ +} + +INCLUDE main.lds diff --git a/new-UI/UI.c b/new-UI/UI.c new file mode 100644 index 0000000..32a4e10 --- /dev/null +++ b/new-UI/UI.c @@ -0,0 +1,408 @@ + +#include "UI.h" +#include "core.h" +#include "font.h" +#include "display.h" +#include "nice_font.h" +#include "main.h" + + +typedef struct +{ + char *label; + u8 value; +} +SelectOption; + +typedef struct +{ + SelectOption const *option; + int options; + int selected; +} +SelectContext; + + +void fill_rect( Area *area, u16 color) +{ + __LCD_DMA_Ready(); + u16 left = area->lower_left.x; + u16 bottom = area->lower_left.y; + u16 width = area->extents.x; + u16 height = area->extents.y; + __LCD_Set_Block( left, (left + width), bottom, (bottom + height)); + int i; + for ( i = 0; i < (width * height); i += 1) + { + __LCD_SetPixl( color); + } +} + + +Area const button1_area = { lower_left:{ 67*0, TOP_LINE}, extents:{ 67, NICE_FONT_HEIGHT} }; +Area const button2_area = { lower_left:{ 67*1, TOP_LINE}, extents:{ 67, NICE_FONT_HEIGHT} }; +Area const button3_area = { lower_left:{ 67*2, TOP_LINE}, extents:{ 67, NICE_FONT_HEIGHT} }; +Area const button4_area = { lower_left:{ 67*3, TOP_LINE}, extents:{ 67, NICE_FONT_HEIGHT} }; +Area const left_rocker_area = { lower_left:{ 67*4, TOP_LINE}, extents:{ 66, NICE_FONT_HEIGHT} }; +Area const right_rocker_area = { lower_left:{ 67*4+66, TOP_LINE}, extents:{ 66, NICE_FONT_HEIGHT} }; +Area const second_line_area = { lower_left:{ 0, SECOND_LINE}, extents:{ SCREEN_WIDTH, NICE_FONT_HEIGHT} }; + +// Forward declarations of functions referenced by buttons: +InputHandler static open_setup_menu, setup_channel, more_setup, quit_setup, list_channels, broken_button, change_percentage, change_selection; +IndicatorRenderer static render_button, render_percentage, render_selector; +IndicatorRenderer brightness_changed, volume_changed; + +#define BUTTON( var, nm, ar, ip) Editor const var = { indicator:{ name:nm, area:&ar, render:render_button }, input:ip } + +BUTTON( blank_button, "", button3_area, broken_button); + +BUTTON( hold_button, "Hold", button1_area, broken_button); +BUTTON( save_button, "Save", button2_area, broken_button); +BUTTON( setup_button, "Setup", button4_area, open_setup_menu); + +BUTTON( list_channels_button, "Channel", button1_area, list_channels); +BUTTON( setup_trigger_button, "Trigg", button2_area, more_setup); +BUTTON( measure_button, "Measure", button3_area, broken_button); +BUTTON( more_button, "More", button4_area, more_setup); + +BUTTON( setup_channel_A_button, "Ch A", button1_area, setup_channel); +BUTTON( setup_channel_B_button, "Ch B", button2_area, setup_channel); +BUTTON( setup_channel_C_button, "Ch C", button3_area, setup_channel); +BUTTON( setup_channel_D_button, "Ch D", button4_area, setup_channel); + +BUTTON( setup_generator_button, "Generator", button1_area, broken_button); +BUTTON( setup_backlight_button, "Bright&Vol", button2_area, broken_button); +BUTTON( back_button, "Back", button4_area, quit_setup); + + +Editor brightness_editor = { + indicator: { + name: "Screen brightness", + area: &left_rocker_area, + render: render_percentage, + context: &brightness_context, + }, + input: change_percentage, +}; + +Editor volume_editor = { + indicator: { + name: "Beep volume", + area: &right_rocker_area, + render: render_percentage, + context: &volume_context, + }, + input: change_percentage, +}; + +SelectOption const trigger_source_options[] = +{ + { label:"falling", value: 0 }, + { label:"rising", value: 1 }, + { label:"low", value: 2 }, + { label:"high", value: 3 }, +}; + +#define SELECT_CONTEXT( var_name, option_list) SelectContext var_name = { option:option_list, options:ITEMS_IN_ARRAY(option_list), selected:0 } + +SELECT_CONTEXT( trigger_source_context, trigger_source_options); + +Editor trigger_source_editor = { + indicator: { + name: "Trigger source", + area: &right_rocker_area, + render: render_selector, + context: &trigger_source_context, + }, + input: change_selection, +}; + +// The first four slots are hard-coded for buttons 1 through 4 +Indicator *indicator[8]; +u8 static indicators = 0; + +// These pointers remember which editors are attached to the actual buttons at +// the moment. +Editor *button[4]; + + +// Each rocker has a list of editors that can be cycled through by pressing +// down on the rocker. +// +typedef struct +{ + Editor *editor[ 4]; + u8 editors; + u8 cursor; +} +EditorList; + + +EditorList left_editor_list; +EditorList right_editor_list; + + +void static begin_editor_list( EditorList *list) +{ + list->editors = 0; + list->cursor = 0; +} + +void static add_editor_to_list( EditorList *list, Editor *editor) +{ + if ( ITEMS_IN_ARRAY(list->editor) <= list->editors) + return; + list->editor[ list->editors] = editor; + list->editors += 1; +} + +Editor static *chosen_editor( EditorList *list) +{ + return list->editor[ list->cursor]; +} + +Editor static *next_editor( EditorList *list) +{ + list->cursor = (list->cursor + 1) % list->editors; + return chosen_editor( list); +} + + +void init_UI() +{ + __Clear_Screen( BLACK); + + use_font( &nice_font); + + quit_setup( NULL, NO_INPUT); + indicator[ 4] = &brightness_editor.indicator; + indicator[ 5] = &volume_editor.indicator; + indicators = 6; + + begin_editor_list( &left_editor_list); + add_editor_to_list( &left_editor_list, &brightness_editor); + begin_editor_list( &right_editor_list); + add_editor_to_list( &right_editor_list, &trigger_source_editor); + add_editor_to_list( &right_editor_list, &volume_editor); +} + + +void check_for_input() +{ + InputEvent ev; + + check_event( &ev); + + if ( INPUT_PRESSED == ev.state) + { + Editor *left_editor = chosen_editor( &left_editor_list); + Editor *right_editor = chosen_editor( &right_editor_list); + + switch( ev.input) + { + case BUTTON1: + button[0]->input( &button[0]->indicator, ev.input); + break; + case BUTTON2: + button[1]->input( &button[1]->indicator, ev.input); + break; + case BUTTON3: + button[2]->input( &button[2]->indicator, ev.input); + break; + case BUTTON4: + button[3]->input( &button[3]->indicator, ev.input); + break; + case LROCKER_LEFT: + left_editor->input( &left_editor->indicator, ev.input); + break; + case LROCKER_RIGHT: + left_editor->input( &left_editor->indicator, ev.input); + break; + case LROCKER_DOWN: + indicator[ 4] = &next_editor( &left_editor_list)->indicator; + break; + case RROCKER_LEFT: + right_editor->input( &right_editor->indicator, ev.input); + break; + case RROCKER_RIGHT: + right_editor->input( &right_editor->indicator, ev.input); + break; + case RROCKER_DOWN: + indicator[ 5] = &next_editor( &right_editor_list)->indicator; + break; + case NO_INPUT: + break; + } + } +} + + +void render() +{ + int i; + for ( i = indicators - 1; 0 <= i; i -= 1) + { + Indicator *idct = indicator[ i]; + idct->render( idct); + } +} + +// Assigns the given editor to the specified button. +// +void static task_button( int bt, Editor const *editor) +{ + // some buttons are declared const so they need not be copied to RAM, + // although some editors are mutable and thus need to be in RAM, so they + // can't all be declared const, hence the cast: + button[ bt] = (Editor*) editor; + indicator[ bt] = (Indicator*) &editor->indicator; +} + +void static task_buttons( Editor const *b1, Editor const *b2, Editor const *b3, Editor const *b4) +{ + task_button( 0, b1); + task_button( 1, b2); + task_button( 2, b3); + task_button( 3, b4); +} + +// Shared between render_button and render_choice. +// +void static render_label( Area const *area, char const *label) +{ + Point const ll = area->lower_left; + render_text( ll.x, ll.y, WHITE, INVERSE, label); + Area space; + space.lower_left = area->lower_left; + space.extents = area->extents; + u16 consumed = width_of_text( label); + space.lower_left.x += consumed; + space.extents.x -= consumed; + fill_rect( &space, BLACK); +} + +// This is a generic renderer that can render any button. +// +void static render_button( Indicator *idct) +{ + render_label( idct->area, idct->name); +} + + + +void static render_percentage( Indicator *idct) +{ + Point const ll = idct->area->lower_left; + char text[4+1]; + PercentContext *ct = idct->context; + u8 value = *ct->value; + text[0]='0'+ value / 100; + text[1]='0'+ value / 10 % 10; + text[2]='0'+ (value % 10); + text[3]='%'; + text[4]=0; + render_text( ll.x, ll.y, WHITE, INVERSE, text); +} + + +// Given an input from one of the rocker switches, provides generic LEFT or +// RIGHT inputs so that code can be independent on the rocker they're attached +// to. +// +Pushed static direction_of( Input ip) +{ + switch ( ip) + { + case LROCKER_LEFT: + case RROCKER_LEFT: + return PUSHED_LEFT; + case LROCKER_RIGHT: + case RROCKER_RIGHT: + return PUSHED_RIGHT; + default: + return NOT_PUSHED; + } +} + +void static change_percentage( Indicator *idct, Input ip) +{ + PercentContext *ct = idct->context; + + switch( direction_of(ip) ) + { + case PUSHED_LEFT: + *ct->value -= 10; + break; + case PUSHED_RIGHT: + *ct->value += 10; + break; + default: + break; + } + + if ( *ct->value < ct->min) *ct->value = ct->min; + if ( ct->max < *ct->value) *ct->value = ct->max; + + ct->update( idct); +} + + +void static setup_channel( Indicator *idct, Input input) +{ + // load editors for channel A..D depending on which button (input) was pressed + quit_setup( NULL, NO_INPUT); +} + +void static list_channels( Indicator *idct, Input ip) +{ + task_buttons( &setup_channel_A_button, &setup_channel_B_button, + &setup_channel_C_button, &setup_channel_D_button); +} + +void static broken_button( Indicator *idct, Input ip) +{ +} + +void static more_setup( Indicator *idct, Input ip) +{ + task_buttons( &setup_generator_button, &setup_backlight_button, &blank_button, &back_button); +} + +void static open_setup_menu( Indicator *idct, Input ip) +{ + task_buttons( &list_channels_button, &setup_trigger_button, &measure_button, &more_button); +} + +void static quit_setup( Indicator *idct, Input ip) +{ + task_buttons( &hold_button, &save_button, &blank_button, &setup_button); +} + +void static render_selector( Indicator *idct) +{ + SelectContext *ct = idct->context; + + render_label( idct->area, ct->option[ct->selected].label); +} + +void static change_selection( Indicator *idct, Input ip) +{ + SelectContext *ct = idct->context; + + switch( direction_of(ip) ) + { + case PUSHED_LEFT: + ct->selected -= 1; + if ( ct->selected < 0) + ct->selected = ct->options - 1; + break; + case PUSHED_RIGHT: + ct->selected += 1; + if ( ct->options <= ct->selected) + ct->selected = 0; + break; + default: + break; + } +} + diff --git a/new-UI/UI.h b/new-UI/UI.h new file mode 100644 index 0000000..9d751e5 --- /dev/null +++ b/new-UI/UI.h @@ -0,0 +1,103 @@ + +#ifndef __UI_H +#define __UI_H + + +#include "BIOS.h" +#include "input.h" + + +#define INVERSE 1 + +#define NICE_FONT_HEIGHT 10 +#define TOP_LINE (SCREEN_HEIGHT - NICE_FONT_HEIGHT) +#define SECOND_LINE (SCREEN_HEIGHT - NICE_FONT_HEIGHT * 2) + + +// Represents a point on screen +typedef struct +{ + u16 x; + u16 y; +} +Point, Dimensions; + + +// Represents an area on screen +typedef struct +{ + Point lower_left; + Dimensions extents; +} +Area; + + +// A User Interface element, an area on screen such as a button. +// name: shown on screen +// area: the area of the screen that this indicator uses. It's a pointer +// because the same indicator might sometimes show in one area and +// sometimes in another +// render: the function that renders this indicator +// context: a pointer to an Indicator-specific structure. This makes it +// possible to share rendering code, so that code to show the +// percentage of screen brightness can be also be used to show beep +// volume +typedef struct Indicator +{ + char const *name; + Area const *area; + void (*render)( struct Indicator *idct); + void *context; +} +Indicator; + + +typedef void IndicatorRenderer( Indicator *idct); + +typedef void InputHandler( Indicator *idct, Input ip); + + +typedef enum +{ + PUSHED_LEFT, + PUSHED_RIGHT, + NOT_PUSHED, +} +Pushed; + + +typedef struct +{ + Indicator indicator; + InputHandler *input; +} +Editor; + + +typedef struct +{ + s8 *value; + u8 min; + u8 max; + void (*update)( Indicator *idct); +} +PercentContext; + + +extern +void init_UI() +; + + +extern +void check_for_input() +; + + +extern +void render() +; + + +#endif + diff --git a/new-UI/main.c b/new-UI/main.c new file mode 100644 index 0000000..c9adfa7 --- /dev/null +++ b/new-UI/main.c @@ -0,0 +1,160 @@ + +/* +Screen layout: + + + Top row is ( from L to R): labels for four buttons then left editor and right editor under the rockers + + Next row is configurable display slots ( to show batt remain, Vpp, etc.), OR + + maybe instead of general-purpose, need to think of scenarios. when want to set up wave gen, prob want to edit form, freq and duty all at once + + could use DOWN to cycle between a few editor attached to (say) left rocker. since DOWN on either rocker could change editors attached to BOTH rockers, or DOWN on LROCKER could mean "finished setting up" + + + Scenarios: + + set up channel. first choose channel ( often only want to conf one) + + coupling AC/DC/off + + V per div + + time per div + + xpos + + ypos + + choose trigger ( source, condition) + + cap buf size and cap mode + + measure wave ( v1,v2,t1,t2) + + pan view of buffer ( maybe only in HOLD mode) + + setup wave generator + + setup backlight and volume ( prob not often) + + + maybe long hold rocker down could mean "finished setting up, return to panning view pls" + + maybe black buttons on white bg will make the soft button labels look more attached to the physical buttons + + press Setup. shows opts for buts 1..3. but4 changes to More. press but4 to get more opts for buts1..3. when run out of opts but4 says "Back", which goes back to normal mode. Option "channel" presents new menu where buts1..4 select channel A..D to load in to rocker editor + + when press rocker down to cycle editors, briefly shows what the editor is, such as "coupling" + +Editors: + + + backlight: 0 - 100 in steps of 10 + + volume: as backlight + + V1, V2 + + T1, T2 + + pan view of capture buffer + + trigg event: rising, falling, Vt, TL, TH ΔT = T2 - T1 + + trigg source: channel A-D + + size of cap buffer: 360 .5k 1k 2k 4k + + cap mode: AUTO, NORM, SINGL, NONE, SCAN + + gen wave: square, tri, saw, sine + + gen freq: 10, 20 50 100 200 500 1k 2k 5k 10k 20k + + gen dut: 50-90 in step 10 + +For each channel: + + + off/AC/DC + + V per div + + time per div + + xpos + + ypos + +Displays: + + + V1 + + V2 + + T1 + + T2 + + Delta T + + Delta V + + battery time remaining + cute icon. always + + Vpp peak2peak? + + Vdc ( average V) + + RMS + + Min/Max V + + FRQ ( frequency) + + CIR ( period?) + + DUT ( duty cycle) + + TH ( time high?) + + TL ( time low) + +Help text explaining labels + + +There is the concept of "widgets". Each widget is set up with its location on +screen and knows how to render itself. Instead of a monolithic render() +function, the display can be rendered by instructing each widget in a list to +render itself. + +An *indicator* is a widget that shows some information. + +An *editor* is a widget that is attached to either the left or right rocker +switches and that changes a value in response to input from the switch. + +*/ + +#include +#include "BIOS.h" +#include "input.h" +#include "UI.h" + + +void static when_counter3_overflows() +{ + // The buttons are read only every 20 milliseconds to overcome switch bounce + u8 static when_to_read_inputs = 20; // milliseconds from now + + if ( 0 < when_to_read_inputs) + { + when_to_read_inputs -= 1; + } + else { + check_inputs(); + when_to_read_inputs = 20; + } +} + + +void TIM3_IRQHandler(void) +{ + when_counter3_overflows(); + __Set( KEY_IF_RST, 0); // Clear TIM3 interrupt flag +} + + +s8 brightness = 80; // of the screen +s8 volume = 30; // of the beeper +s8 duty_cycle = 50; // for the wave form generator + + +void brightness_changed( Indicator *idct) +{ + PercentContext *ct = idct->context; + __Set( BACKLIGHT, *ct->value); +} + +PercentContext brightness_context = { + value: &brightness, + min: 10, + max: 100, + update: brightness_changed, +}; + + +void volume_changed( Indicator *idct) +{ + PercentContext *ct = idct->context; + __Set( BEEP_VOLUME, *ct->value); +} + +PercentContext volume_context = { + value: &volume, + min: 0, + max: 100, + update: volume_changed, +}; + + +int main() +{ + __Set( BEEP_VOLUME, 0); + + init_UI(); + + while( true) + { + check_for_input(); + render(); + } +} + diff --git a/new-UI/main.h b/new-UI/main.h new file mode 100644 index 0000000..24d00fb --- /dev/null +++ b/new-UI/main.h @@ -0,0 +1,10 @@ + +#ifndef __MAIN_H +#define __MAIN_H + + +extern PercentContext brightness_context, volume_context; + + +#endif + diff --git a/new-UI/nice_font.c b/new-UI/nice_font.c new file mode 100644 index 0000000..9b386d8 --- /dev/null +++ b/new-UI/nice_font.c @@ -0,0 +1,141 @@ + +#include "font.h" + +Glyph const nice_font_glyphs[] = { + { data:0x0000, width:3, height:0, lift:0}, + { data:0x0000, width:2, height:7, lift:2}, + { data:0x0002, width:5, height:3, lift:6}, + { data:0x0004, width:6, height:9, lift:1}, + { data:0x000b, width:5, height:6, lift:2}, + { data:0x000f, width:5, height:6, lift:2}, + { data:0x0013, width:6, height:7, lift:2}, + { data:0x0019, width:3, height:3, lift:6}, + { data:0x001b, width:4, height:10, lift:0}, + { data:0x0020, width:4, height:10, lift:0}, + { data:0x0025, width:5, height:5, lift:2}, + { data:0x0029, width:6, height:5, lift:2}, + { data:0x002d, width:3, height:3, lift:1}, + { data:0x002f, width:4, height:1, lift:4}, + { data:0x0030, width:2, height:2, lift:2}, + { data:0x0031, width:4, height:7, lift:2}, + { data:0x0035, width:6, height:7, lift:2}, + { data:0x003b, width:4, height:7, lift:2}, + { data:0x003f, width:5, height:7, lift:2}, + { data:0x0044, width:5, height:7, lift:2}, + { data:0x0049, width:5, height:7, lift:2}, + { data:0x004e, width:5, height:7, lift:2}, + { data:0x0053, width:5, height:7, lift:2}, + { data:0x0058, width:5, height:7, lift:2}, + { data:0x005d, width:5, height:7, lift:2}, + { data:0x0062, width:5, height:7, lift:2}, + { data:0x0067, width:2, height:5, lift:2}, + { data:0x0069, width:3, height:6, lift:1}, + { data:0x006c, width:4, height:5, lift:2}, + { data:0x006f, width:4, height:3, lift:3}, + { data:0x0071, width:4, height:5, lift:2}, + { data:0x0074, width:6, height:7, lift:2}, + { data:0x007a, width:6, height:7, lift:2}, + { data:0x0080, width:7, height:7, lift:2}, + { data:0x0087, width:5, height:7, lift:2}, + { data:0x008c, width:5, height:7, lift:2}, + { data:0x0091, width:5, height:7, lift:2}, + { data:0x0096, width:5, height:7, lift:2}, + { data:0x009b, width:5, height:7, lift:2}, + { data:0x00a0, width:5, height:7, lift:2}, + { data:0x00a5, width:5, height:7, lift:2}, + { data:0x00aa, width:2, height:7, lift:2}, + { data:0x00ac, width:3, height:7, lift:2}, + { data:0x00af, width:5, height:7, lift:2}, + { data:0x00b4, width:5, height:7, lift:2}, + { data:0x00b9, width:7, height:7, lift:2}, + { data:0x00c0, width:6, height:7, lift:2}, + { data:0x00c6, width:5, height:7, lift:2}, + { data:0x00cb, width:5, height:7, lift:2}, + { data:0x00d0, width:5, height:7, lift:2}, + { data:0x00d5, width:5, height:7, lift:2}, + { data:0x00da, width:5, height:7, lift:2}, + { data:0x00df, width:6, height:7, lift:2}, + { data:0x00e5, width:5, height:7, lift:2}, + { data:0x00ea, width:6, height:7, lift:2}, + { data:0x00f0, width:7, height:7, lift:2}, + { data:0x00f7, width:5, height:7, lift:2}, + { data:0x00fc, width:6, height:7, lift:2}, + { data:0x0102, width:5, height:7, lift:2}, + { data:0x0107, width:3, height:10, lift:0}, + { data:0x010b, width:4, height:7, lift:2}, + { data:0x010f, width:3, height:10, lift:0}, + { data:0x0113, width:6, height:3, lift:7}, + { data:0x0116, width:5, height:1, lift:2}, + { data:0x0117, width:3, height:3, lift:7}, + { data:0x0119, width:5, height:5, lift:2}, + { data:0x011d, width:5, height:7, lift:2}, + { data:0x0122, width:5, height:5, lift:2}, + { data:0x0126, width:5, height:7, lift:2}, + { data:0x012b, width:5, height:5, lift:2}, + { data:0x012f, width:4, height:7, lift:2}, + { data:0x0133, width:5, height:7, lift:0}, + { data:0x0138, width:5, height:7, lift:2}, + { data:0x013d, width:2, height:7, lift:2}, + { data:0x013f, width:3, height:9, lift:0}, + { data:0x0143, width:5, height:7, lift:2}, + { data:0x0148, width:3, height:7, lift:2}, + { data:0x014b, width:7, height:5, lift:2}, + { data:0x0150, width:5, height:5, lift:2}, + { data:0x0154, width:5, height:5, lift:2}, + { data:0x0158, width:5, height:7, lift:0}, + { data:0x015d, width:5, height:7, lift:0}, + { data:0x0162, width:5, height:5, lift:2}, + { data:0x0166, width:5, height:5, lift:2}, + { data:0x016a, width:4, height:6, lift:2}, + { data:0x016d, width:5, height:5, lift:2}, + { data:0x0171, width:6, height:5, lift:2}, + { data:0x0175, width:7, height:5, lift:2}, + { data:0x017a, width:6, height:5, lift:2}, + { data:0x017e, width:5, height:7, lift:0}, + { data:0x0183, width:6, height:5, lift:2}, + { data:0x0187, width:4, height:10, lift:0}, + { data:0x018c, width:2, height:8, lift:1}, + { data:0x018e, width:4, height:10, lift:0}, + { data:0x0193, width:5, height:2, lift:7}, + { data:0x0195, width:4, height:6, lift:2}, +}; + +u8 const nice_font_data[] = { + /* 0x0000 */ 0xfb, 0x3d, 0x3f, 0x7e, 0x60, 0xe4, 0x7d, 0x9e, 0xef, 0x89, 0x01, 0xd2, 0x2f, 0xfd, 0x12, 0xb3, + /* 0x0010 */ 0xcd, 0x6c, 0x33, 0xb6, 0x7c, 0xd3, 0x3a, 0x2a, 0x00, 0xb9, 0x01, 0x78, 0xf8, 0x77, 0x78, 0x80, + /* 0x0020 */ 0x01, 0x1e, 0xee, 0x1f, 0x1e, 0xf5, 0xbb, 0x5f, 0x01, 0x84, 0xfc, 0x4f, 0x08, 0xb9, 0x01, 0x0f, + /* 0x0030 */ 0x0f, 0x83, 0x0f, 0x1f, 0x0c, 0xbe, 0x7f, 0x33, 0xfb, 0xf7, 0x01, 0xa1, 0xff, 0x3f, 0x00, 0xa3, + /* 0x0040 */ 0x73, 0x33, 0x1f, 0x03, 0xa2, 0x71, 0xf2, 0x6f, 0x03, 0x1c, 0xde, 0xfb, 0x4b, 0x00, 0xf8, 0x7c, + /* 0x0050 */ 0xf2, 0x69, 0x04, 0xbe, 0x7f, 0xf2, 0x69, 0x00, 0xc0, 0xe3, 0x17, 0x0f, 0x06, 0xb6, 0x7f, 0xf2, + /* 0x0060 */ 0x6f, 0x03, 0xb8, 0x7e, 0xf1, 0xef, 0x03, 0x7b, 0x03, 0xc1, 0x6d, 0x03, 0xc4, 0xed, 0x08, 0x6d, + /* 0x0070 */ 0x0b, 0x71, 0x3b, 0x02, 0x20, 0x70, 0xb1, 0x89, 0x87, 0x01, 0xbe, 0x7f, 0x30, 0x9b, 0xc7, 0x01, + /* 0x0080 */ 0x83, 0x87, 0x4f, 0xee, 0x7b, 0x0c, 0x00, 0xff, 0x7f, 0xf2, 0x6f, 0x03, 0xbe, 0x7f, 0x70, 0x2c, + /* 0x0090 */ 0x02, 0xff, 0x7f, 0xf0, 0xef, 0x03, 0xff, 0x7f, 0x32, 0x19, 0x04, 0xff, 0x3f, 0x12, 0x09, 0x04, + /* 0x00a0 */ 0xbe, 0x7f, 0xf0, 0x7c, 0x02, 0xff, 0x3f, 0xe2, 0xff, 0x07, 0xff, 0x3f, 0x81, 0xbf, 0x1f, 0xff, + /* 0x00b0 */ 0xbf, 0xef, 0x3e, 0x06, 0xff, 0x7f, 0x20, 0x10, 0x00, 0xff, 0x3f, 0x0c, 0x03, 0xfb, 0xff, 0x01, + /* 0x00c0 */ 0xff, 0x3f, 0x0c, 0xf3, 0xff, 0x03, 0xbe, 0x7f, 0xf0, 0xef, 0x03, 0xff, 0x3f, 0x91, 0x8f, 0x03, + /* 0x00d0 */ 0xbe, 0xff, 0xf1, 0xdf, 0x03, 0xff, 0x3f, 0xf1, 0xbf, 0x03, 0xb1, 0x7c, 0xf2, 0x69, 0x04, 0x40, + /* 0x00e0 */ 0xe0, 0xff, 0x0f, 0x04, 0x02, 0xfe, 0x7f, 0xe0, 0xef, 0x07, 0x60, 0xfe, 0xe7, 0xc3, 0x07, 0x03, + /* 0x00f0 */ 0xff, 0xbf, 0x81, 0x61, 0xf8, 0xff, 0x01, 0xe3, 0x3b, 0xe7, 0x3e, 0x06, 0x60, 0xf8, 0xe7, 0x03, + /* 0x0100 */ 0x07, 0x03, 0xc3, 0x63, 0x37, 0x1e, 0x06, 0xff, 0xff, 0x1f, 0x20, 0x60, 0x9c, 0x63, 0x00, 0x01, + /* 0x0110 */ 0xfe, 0xff, 0x3f, 0x99, 0xbd, 0x00, 0x1f, 0x7e, 0x00, 0xe2, 0xd6, 0xff, 0x00, 0xff, 0x7f, 0xe4, + /* 0x0120 */ 0xe3, 0x00, 0xee, 0xc7, 0xad, 0x00, 0x8e, 0x4f, 0xe4, 0xff, 0x07, 0xee, 0xd7, 0xce, 0x00, 0x90, + /* 0x0130 */ 0xdf, 0x1f, 0x0a, 0xb8, 0x7e, 0xf1, 0xef, 0x07, 0xff, 0x3f, 0xe4, 0xf3, 0x00, 0xdf, 0x2f, 0x01, + /* 0x0140 */ 0xfe, 0xfa, 0x05, 0xff, 0xbf, 0x63, 0x13, 0x01, 0xfe, 0x7f, 0x00, 0xff, 0x63, 0x86, 0xff, 0x03, + /* 0x0150 */ 0xff, 0xc3, 0xff, 0x00, 0xee, 0xc7, 0xef, 0x00, 0xff, 0x3f, 0x91, 0x8f, 0x03, 0x38, 0x3e, 0xf1, + /* 0x0160 */ 0xff, 0x07, 0xff, 0x23, 0x08, 0x01, 0xa9, 0xd7, 0x2b, 0x00, 0x90, 0xff, 0x47, 0xfe, 0x87, 0xff, + /* 0x0170 */ 0x01, 0x90, 0xbf, 0xc7, 0x21, 0xfc, 0x0f, 0x33, 0x3e, 0x07, 0x71, 0x3b, 0xb7, 0x23, 0xf9, 0xfe, + /* 0x0180 */ 0xc1, 0xcf, 0x07, 0x71, 0xde, 0x9e, 0x23, 0x30, 0xf8, 0xf7, 0x7c, 0x80, 0xff, 0xff, 0x01, 0x3e, + /* 0x0190 */ 0xef, 0x1f, 0x0c, 0x79, 0x02, 0x7f, 0x18, 0xfe +}; + +Font const nice_font = +{ + height:10, + first_character:' ', + glyphs:96, + glyph:nice_font_glyphs, + glyph_data:nice_font_data, + absent_code:127 +}; + diff --git a/new-UI/nice_font.h b/new-UI/nice_font.h new file mode 100644 index 0000000..1a42dc0 --- /dev/null +++ b/new-UI/nice_font.h @@ -0,0 +1,12 @@ + +#ifndef __NICE_FONT_H +#define __NICE_FONT_H + + +extern +Font const nice_font +; + + +#endif +