Fixed some font formats. Minor changes in README, headers.

This commit is contained in:
lephe 2017-01-01 17:41:16 +01:00
parent 4fceab4533
commit 28f790bade
4 changed files with 28 additions and 27 deletions

View File

@ -19,13 +19,14 @@ access to the low-level MPU features, among which:
office applications and event-driven decisions for games
* Hardware timers running at over 10 MHz, allowing microsecond-level control
* Unlimited mappings of callbacks to Real-Time Clock events (requires build)
* Access to processor register for debugging information, determination of
* Access to processor registers for debugging information, determination of
processor speed (overclock is on the TODO list), backlight management...
The library also offers powerful higher-level features:
* A gray engine that works by rapidly swapping monochrome images
* Blazingly fast drawing functions when working with the fxSDK
* C Standard functions such as the `printf()` family.
* Blazingly fast drawing functions when working with the fxSDK (10 times faster
image rendering that MonochromeLib)
* C Standard functions such as the `printf()` family
Interrupt handler

2
TODO
View File

@ -5,9 +5,9 @@ Bugs to fix:
Simple improvements:
- demo: Try 284x124 at (-60, -28) (all disadvantages)
- display: Rectangle-based drawing functions
- tales: Test all font encodings
- time: Compute CLOCKS_PER_SEC
- core: Add VBR handlers debugging information (if possible)
- events: Introduce KeyRepeat events
Larger improvements:
- errno: Introduce errno and use it more or less everywhere
- bopti: Monochrome bitmaps blending modes

View File

@ -161,24 +161,6 @@ enum GetkeyOpt
Getkey_RepeatAllKeys = 0xf0,
};
/*
keylast()
Returns the matrix code of the last pressed key. If repeat_count is
non-NULL, it is set to the number of repetitions.
*/
int keylast(int *repeat_count);
/*
keystate()
Returns the address of the keyboard state array. The keyboard state
consists in 10 bytes, in which every key is represented as a bit.
The returned address is the original buffer address. You should avoid
editing the array. It wouldn't influence the behavior of the keyboard
functions, but the buffer data is very volatile. Therefore, data
written to the buffer could be replaced anytime.
*/
volatile unsigned char *keystate(void);
/*
getkey()
Blocking function with auto-repeat and SHIFT modifying functionalities.
@ -190,10 +172,10 @@ int getkey(void);
/*
getkey_opt()
Enhances getkey() with most general functionalities. An OR-combination
of options may be given as second argument.
of options may be given as first argument.
If max_cycles is non-zero and positive, getkey_opt() will return
KEY_NOEVENT if no event occurs during max_cycle analysis.
As getkey(), returns the pressed key matrix code, possibly with
KEY_NOEVENT if no event occurs during max_cycle analyzes.
Like getkey(), returns the pressed key matrix code, possibly with
modifiers depending on the options.
*/
int getkey_opt(enum GetkeyOpt options, int max_cycles);
@ -231,6 +213,24 @@ int getkey_opt(enum GetkeyOpt options, int max_cycles);
*/
void multigetkey(int *keys, int count, int max_cycles);
/*
keylast()
Returns the matrix code of the last pressed key. If repeat_count is
non-NULL, it is set to the number of repetitions.
*/
int keylast(int *repeat_count);
/*
keystate()
Returns the address of the keyboard state array. The keyboard state
consists in 10 bytes, in which every key is represented as a bit.
The returned address is the original buffer address. You should avoid
editing the array. It wouldn't influence the behavior of the keyboard
functions, but the buffer data is very volatile. Therefore, data
written to the buffer could be replaced anytime.
*/
volatile unsigned char *keystate(void);
//---

View File

@ -55,12 +55,12 @@ int getCharacterIndex(int c)
break;
case FontFormat_Letters:
if(!isalpha(c)) return -1;
index = c - 'A' - ('a' - 'z') * (c >= 'a');
index = c - 'A' - ('a' - 'Z') * (c >= 'a');
break;
case FontFormat_Common:
if(!isalnum(c)) return -1;
index = c - '0' - ('A' - '9') * (c >= 'A') -
('a' - 'z') * (c >= 'a');
('a' - 'Z') * (c >= 'a');
break;
case FontFormat_Unknown:
default: