TODO update and miscellaneous style

This commit is contained in:
lephe 2019-07-16 18:34:10 -04:00
parent 8dbdd32adb
commit ff2db385a8
11 changed files with 35 additions and 68 deletions

28
TODO
View File

@ -1,30 +1,30 @@
On the bootlog.
* Better review of .pretext to make sure everything fits in 4k
* Move topti to .pretext to use it in the bootlog, also update() and dclear()
* Use topti in the error message for the missing mappings (hurray o/)
* Use a serious formatted printing function
Crucial, missing things.
! core: the four basic memory functions
! core: build an exception handler and a TLB miss handler
! core: gint_switch() (driver contexts on stack; arbitrary code?)
! bopti: fxcg50 version
! syscalls: fxcg50 BFile calls
! gray: the gray engine on fx9860g
Tests to run.
* core: run the alignment/size automated tests
* core: run the alignment/size automated tests for memory functions
* bopti: more sizes, gray
* topti: all charsets, colors
Completeness elements on existing code.
* keyboard: finish the interface
* clock: spread spectrum on fxcg50
* core: use topti in the error message for missing mappings
* core: find the #ifdef FX9860G|FXCG50 that have a cross-platform def
* topti: support Unicode fonts
* hardware: fill in the HWMEM_FITTLB flag
* keyboard: think of extended functions
* cpg: spread spectrum on fxcg50
* bopti: blending modes for monochrome bitmaps (use topti assembler)
* display: use more of topti's assembler in drect()
* core: use cmp/str for memchr()
* stdio: serious formatted printing function
* timer: try putting the definitions in <gint/mpu/tmu.h>
* timer: try putting addresses in <gint/mpu/tmu.h>
* r61524: brightness control and clean the file
Keep in mind.
* keyboard: make keysc.c@state static and review globals in the project
* prizm: don't hardcode stack address in fxcg50.ld
* prizm: detect P1 static RAM (stack) in TLB
* core: prove and use qdiv10() instead of __sdivsi3
@ -35,10 +35,8 @@ Keep in mind.
* core: document the SH7305 PFC in <gint/mpu/pfc.h>
Future directions.
* File management
* Gray engine
* A complete file system abstraction
* Integrate overclock management
* A library for profiling with manual calls
* Audio playback using Martin Poupe's method
* Serial communication [SCIF] [SCIFA]
* USB communication [USB]

View File

@ -18,7 +18,7 @@
/* Expose the VRAM variable if GINT_NEED_VRAM is defined. It must always point
to a 32-aligned buffer of size 177408. Any function can use it freely to
perform rendering or store data when not drawing. Triple buffering is
already implemened in gint, see the dvram() function below.
already implemented in gint, see the dvram() function below.
In this module, colors are in the 16-bit R5G6B5 format, as it is the format
used by the display controller. */

View File

@ -186,7 +186,7 @@ void dsize(const char *str, font_t const * font, int *w, int *h);
able to render several characters at once.
This is not a printf()-family function so [str] cannot contain formats like
"%d" and you cannot pass aditional arguments.
"%d" and you cannot pass additional arguments.
@x @y Coordinates of top-left corner of the rendered string
@str String to display

View File

@ -41,7 +41,7 @@ static void print(int x, int y, const char *format, ...)
va_list args;
va_start(args, format);
vsprintf(str + 2, format, args);
vsnprintf(str + 2, 43, format, args);
#ifdef FX9860G
dtext(6 * (x-1) + 1, 8 * (y-1), str + 2, C_BLACK, C_WHITE);

View File

@ -40,11 +40,7 @@
/* OS version */
___os_version:
mov.l syscall_table, r2
mov.l 1f, r0
jmp @r2
nop
1: .long 0x02ee
syscall(0x02ee)
/* Dynamic allocation */
@ -61,51 +57,27 @@ _realloc:
# int BFile_Remove(const uint16_t *file)
_BFile_Remove:
mov.l 1f, r0
mov.l syscall_table, r1
jmp @r1
mov #0, r5
1: .long 0x0439
syscall(0x0439)
# int BFile_Create(uint16_t *file, enum { file = 1, folder = 5 }, int *size)
_BFile_Create:
mov.l 1f, r0
mov.l syscall_table, r1
jmp @r1
nop
1: .long 0x0434
syscall(0x0434)
# int BFile_Open(const uint16_t *file, int mode)
_BFile_Open:
mov.l 1f, r0
mov.l syscall_table, r1
jmp @r1
mov #0, r6
1: .long 0x042c
syscall(0x042c)
# int BFile_Close(int handle)
_BFile_Close:
mov.l 1f, r0
mov.l syscall_table, r1
jmp @r1
nop
1: .long 0x042d
syscall(0x042d)
# int BFile_Write(int handle, const void *ram_buffer, int even_size)
_BFile_Write:
mov.l 1f, r0
mov.l syscall_table, r1
jmp @r1
nop
1: .long 0x0435
syscall(0x0435)
# int BFile_Read(int handle, void *ram_buffer, int size, int whence)
_BFile_Read:
mov.l 1f, r0
mov.l syscall_table, r1
jmp @r1
nop
1: .long 0x0432
syscall(0x0432)
syscall_table:
.long 0x80010070
@ -117,11 +89,7 @@ syscall_table:
/* OS version */
___os_version:
mov.l syscall_table, r2
mov.l 1f, r0
jmp @r2
nop
1: .long 0x1406
syscall(0x1406)
/* Dynamic allocation */

View File

@ -127,7 +127,7 @@ static void sh7305_probe(void)
static const char *cpg_status(void)
{
static char status[18];
sprintf(status, "I%3d B%3d P%3d C%c",
sprintf(status, "I%03d B%03d P%03d C%c",
freq.Iphi_f / 1000000,
freq.Bphi_f / 1000000,
freq.Pphi_f / 1000000,

View File

@ -24,7 +24,7 @@
get a correct result. As a consequence, if an event cannot be generated
(whatever the reason), the driver's internal copy of the keyboard state must
not be updated (probably the event will be re-emitted at the next scan). */
GDATA volatile uint8_t state[12] = { 0 };
GDATA static volatile uint8_t state[12] = { 0 };
/* A driver event, which is a change in a full row instead of a single key. */
typedef struct
@ -45,7 +45,7 @@ GDATA static int buffer_start = 0;
GDATA static int buffer_end = 0;
/* Current time, in keyboard-scanning ticks */
GDATA int time = 0;
GDATA static int time = 0;
/* buffer_push() - add an event in the keyboard buffer
Returns non-zero if the event cannot be pushed. */
@ -71,7 +71,7 @@ static int buffer_poll(driver_event_t *ev)
}
/* keysc_frame() - generate a round of events for the current frame */
void keysc_frame(void)
static void keysc_frame(void)
{
GALIGNED(2) uint8_t scan[12] = { 0 };

View File

@ -288,7 +288,7 @@ static const char *r61524_status(void)
uint16_t dev = read();
static char str[8];
sprintf(str, "%4xF-b", dev);
sprintf(str, "%04xF-b", dev);
return str;
}

View File

@ -27,8 +27,8 @@ font_t const * topti_font = &gint_font8x9;
@dataw Glyph width
@fg @bg Foreground and background colors */
GSECTION(".pretext")
void topti_glyph(uint16_t *vram, uint32_t const * data, int left, int top,
int width, int height, int dataw, int fg, int bg)
static void topti_glyph(uint16_t *vram, uint32_t const * data, int left,
int top, int width, int height, int dataw, int fg, int bg)
{
int index = top * dataw + left;

View File

@ -1,5 +1,6 @@
.global _topti_asm_text
.section .pretext
# REGISTER ALLOCATION:
# r0: x or ~x

View File

@ -11,7 +11,7 @@ font_t const * gint_default_font = &gint_font5x7;
font_t const * topti_font = &gint_font5x7;
/* topti_split(): Split glyph data into lines
This function splits the data from [glyph] inyo lines and writes a bit of
This function splits the data from [glyph] into lines and writes a bit of
each line in [operators]. This operation is meant to be used multiple times
in a row, so [free] represents the number of free low bits in [operators].
@ -22,11 +22,11 @@ font_t const * topti_font = &gint_font5x7;
@operators VRAM operands
Returns the number of free bits in [operators] after the operation. If it's
0, call topti_draw() and reset the operators. If it's neative, call
0, call topti_draw() and reset the operators. If it's negative, call
topti_draw() then do another pass of topti_split() to recover the missing
information. */
GSECTION(".pretext")
int topti_split(uint32_t const * glyph, int width, int height, int free,
static int topti_split(uint32_t const * glyph, int width, int height, int free,
uint32_t *operators)
{
/* Extracts [width] bits on the left of [*glyph] */