Currently there seems to be no DMA at all on fx9860g. Further
investigation would be required, because this would be the first major
difference between the SH7305's found in fx9860g and fxcg50 models.
An automated peripheral register discovery strategy might help, but
identifying discovered registers would be non trivial.
Also use the pruning ability of the Makefile to avoid troublesome
ifdef's in the code.
This change introduces two new mechanismes for executing user code when
an exception occurs.
* This first is the custom panic message, which usually displays "System
ERROR". The function that performs this task can now be user-defined.
It is also run in user mode because the exception handler rte's into
it, allowing it to execute any kind of interrupt-inducing task. The
behavior is undefined if this function raises an exception.
* The second is an exception-catching function, which (when set) is
called every time an exception occurs, and is granted the chance of
handling the exception to continue execution normally. It can be used
in various ways, the most primitive of which is recording the
exception and going back. It runs in interrupt mode and must not raise
any kind of exception.
Behave like Basic's Horizontal and Vertical commands. Internal dline()
optimizations are renamed gint_dhline() and gint_dvline().
Also supports ghline() and gvline() in the gray engine.
Optimization cases here are amost negligible due to limiting RAM access
frequencies and the very limited amount of work accomplished in the
functions. Code maintainability is prioritized by using dline().
This change introduces exception handlers that default to a fatal error
with an on-screen description of the exception and some debugging
information.
It also adds the dprint() function as a definitely-needed helper and
removes bootlog_unmapped() by using the exception handler for the fatal
error display. (Also printf() is now required in all gint add-ins; this
is sad, but space is not as much of a constraint as debugging.)
Finally, the exception handler is used to handle an interrupt which is
an exception in practice, the DMA address error. On fx-CG 50, additional
DMA-related information is displayed on the screen. This is left out on
fx-9860G as there is not enough space.
This commit introduces bopti for fxcg50 with the first basic 16-bit
formats. The performance is rather slow, especially for large images,
and will need refinements and/or overclock to be really efficient in
full-screen real-time applications.
This commit introduces bopti for fx-CG 50. Currently the only
interfaces are the bopti_render_{clip,noclip} functions, and the
only supported formats are r5g6b5 and r5g6b5a.
The algorithm for r5g6b5 is optimized to perform longword accesses
using movua.l, whereas the algorithm for r5g6b5a uses plain word
accesses because transparency checks feel more difficult than one
more loop iteration.
These algorithms are still slow for large surfaces and struggle to
keep up 25 FPS in full-screen, so possible improvements with the
DMA should definitely be tested before restorting to overclock.
This change finally introduces gray image rendering with bopti. This
is the final iteration of bopti v2 and certainly the fastest so far.
All four profiles are supported, without change to the format.
Light and dark were erroneously swapped in my documentation's
formulae, but not in the way operands were cancelled when x=0,
leading to strange results.
When a key is being held and repeated, ignore other key presses
until it is released. Without this, new keys would take priority.
This is the desired behavior because pressing other keys by
accident, especially on the directional pad, is common. Besdeis
this is the system's behavior.
When the size of the input buffer is not specified, the default was
INT_MAX; however this will cause the pointer value to overflow in many
situations, causing kprint_flush() to flush prematurely and write NUL
bytes at inappropriate places.
This commit changes the default size to 65535. Morale: never use
sprintf() or vsprintf()...
This is based on a port of kprint, which supports standard formats and
options, except for:
* Large parameters (ll)
* Floating-point types (%e, %E, %f, %F, %g, %G, %a, %A)
This commit introduces three timer driver changes:
* Export the definitions of the timer structures to a detailed header at
<gint/mpu/tmu.h>, and re-use them in the driver.
This integration is still limited as the driver keeps its own address
definitions and event codes.
* Clean the timer stop routine that is used in the interrupt handler. Up
until now the interrupt handler would only stop TSTR, which is not
enough to cleanly leave the timer (need TCOR=TCNT=-1) and is not even
sound with respect to gint's semantics as UNIE stays enabled so the
timer is not made available again.
The interrupt handler now calls into C code when the timer stop
condition is met (callback returns non-zero) to keep this clean. This
unsurprisingly solves problems that occurred in certain situations
when a timer was used repeatedly.
* Expose timer addresses using a timer_address() function, compensating
for the lack of address definitions in <gint/mpu/tmu.h>. This
interface is likely to evolve in the future to better integrate the
address in the MPU headers and move them out of the driver.
This makes it possible to write application code without specifying the
target machine, which is especially useful for libraries. The first user
of this system is libprof.
Since Memallox's newlib port is currently unstable, gint has to
provide some standard functions on its own. Instead of a single
<gint/std.h> header, this commit makes a gint/std directory containing
headers under standard names.