Commit Graph

34 Commits

Author SHA1 Message Date
Lephe 78bf9dac7d
gray: expose pointers to the screen buffers 2021-05-12 09:17:24 +02:00
Lephe c37f150600
use GINT_CALL() in every API that has callbacks
* Change gint_inth_callback()
* Add intc_handler_function() to use C functions as handlers instead of
  writing assembler, and use it in the RTC and USB

* Revisit the TMU handlers, which after moving out the callbacks, now
  fit into 3 gates (great!), and adapt the ETMU handler
* Improve the timer driver (less code = better code, removed magic
  constants assuming the VBR layout on SH3/SH4, etc.)
* Remove 2 gates and a gap from the compact scheme on SH3

* Define timer_configure() to replace timer_setup(), which could not be
  cleanly updated to support GINT_CALL()
* Replace rtc_start/stop_timer with rtc_periodic_enable/disable, which
  is less confusing because of ETMU being "RTC timers"
2021-04-27 14:29:38 +02:00
Lephe a086510885
display: add a maximum size parameter to dtext_opt()
This parameter controls the maximum number of glyphs to print.

For backwards compatibility, it is automatically inserted by a macro in
older calls with only 7 parameters.
2021-02-15 18:37:06 +01:00
Lephe d887423bbb
bopti: more performance improvement for SCSP cases
* Turn on GCC's -O3 for bopti files
* Remove the bopti_render_noclip() step
* Use rbox as early as possible to avoid moving memory around
* A lot of local grinding
2020-07-23 14:03:45 +02:00
Lephe 11dd04243f
bopti: performance improvements for SCSP cases
* Defined the single-column single-position (SCSP) situation where a
  single column of the input is blit on a single position of the VRAM.
  Provided optimized assembly and a specialized bopti_render_scsp()
  function.
* Improved the rendered by reducing the amount of computation and
  clarifying the semantics of the rbox.
* Separated rbox setup from clipping by making bopti_render_clip() a
  purely abstract superset of bopti_render_noclip().
2020-07-23 10:18:46 +02:00
Lephe 77de9e7796
move private headers to subfolders of src/
This keeps the include/ folder clean.
2020-07-13 17:47:21 +02:00
Lephe 0eb58c39a3
gray: add the DGRAY_PUSH_ON/OFF and DGRAY_POP feature
DGRAY_PUSH_ON/OFF will push the current gray engine state to a stack
before transitioning to on/off mode. DGRAY_POP will later recover the
saved state and transition back to it.
2020-07-13 17:14:58 +02:00
Lephe 94fb300e72
gray: finalize the gray engine API
* Define dgray() to replace gray_start() and gray_stop()
* Introduce a mechanism to override the d*() functions rather than using
  another set of functions, namely g*(). Gray rendering should now be
  done with d*() (a compatibility macro for g*() is available until v2.1).
* Gray engine now reserves TMU0 at the start of the add-in to prevent
  surprises if timers are exhausted, so it nevers fails to start
* Replace other gray engine functions with dgray_*()
* More general rendering functions (in render/) to lessen the burden of
  porting them to the gray engine. As a consequence, dtext_opt(),
  dprint_opt() and drect_border() are now available in the gray engine,
  which was an omission from 230b796.
* Allow C_NONE in more functions, mainly on fx-CG 50
* Remove the now-unused dupdate_noint()
2020-07-13 13:49:07 +02:00
Lephe 411bbb9568
gray: use 923, 1742 as the default gray settings
Found by Kbd2.
2020-07-10 17:30:00 +02:00
Lephe 2751dcf045
remove the .gint.data section
Since both platforms now have their VBR and gint-specific data loaded
along the add-in's data, the .gint.data section is entirely unused.

The .gint.bss section is still used for uninitialized objects (it has
different semantics than .bss which is initially cleared) and the
.gint.data.sh3 and .gint.bss.sh3 sections that are dropped on the
SH4-only fx-CG 50 are also still used.
2020-07-10 16:36:05 +02:00
Lephe dc83d5ee1f
timer: final iteration on the API
This commit minimally changes the signature of timer_setup() to greatly
simplify timer management, allowing to user to let the library choose
available timers dynamically depending on the settings.
2020-06-20 22:45:46 +02:00
Lephe 4a0fc65c34
gray: add decent defaults for older fx9860g-like models
Gray quality is better on the Graph 35+E II, it still flickers a lot on
other models (as I remembered). There might be better settings out there
but I'm not sure we can reach the quality of the current Graph 35+E II
defaults. The Graph 75+E with which I tested might also be different
from other T6K11 such as the smaller Graph 35+E.
2020-06-20 19:16:42 +02:00
Lephe caa4f675c9
bopti: deprecate image_t, renamed to bopti_image_t 2020-06-01 12:11:59 +02:00
Lephe 9eb723ee53
render: remove the GINT_NEED_VRAM macro
This macro used to protect the declaration of the [vram] variable of
gint. This variable was short to keep drawing functions short but could
clutter the namespace.

That being said, it's even better to just [#define vram gint_vram] if
you need. This change renames the variable to [gint_vram], exposes it
whenever <gint/display.h> is included, and removes the GINT_NEED_VRAM
macro altogether.
2019-10-27 08:14:42 +01:00
Lephe ef0e5e32f8
render: add one-parameter dvline() and dhline()
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().
2019-09-07 11:26:11 +02:00
lephe 62ae7e19d4 gray: considerably improve gray visuals 2019-07-29 12:17:25 -04:00
lephe 1cf5bf514a bopti: add gray support for all four profiles
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.
2019-07-27 19:51:53 -04:00
lephe 144ff90e37 gray: add gpixel() and gline()
Optimized cases for gline() rely on grect() instead of reimplementing
the mechanics of the fully-optimized drawing to save some space.
2019-07-27 19:48:36 -04:00
lephe ae4f7af172 gray: add engine, basic drawing and text
This revision includes the base gray engine with sensible starting
defaults, gclear() and grect(), as well as gtext().
2019-07-20 12:31:46 -04:00
lephe c50cbf6a9c Make room for an fx-cg50 compatible version. Enhanced build system. 2018-04-09 08:31:12 +02:00
lephe 79b78b5345 Hopefully the last adjustments before the first release. 2017-07-11 13:51:56 +02:00
lephe f6133c26fc Startup logs instead of diagnostics, created .gint_bss, updated demo. 2017-07-05 21:38:12 +02:00
lephe 5e66efc560 Interrupt controller module description (WIP), task switch and return to menu. 2017-07-01 16:07:14 +02:00
lephe 3214f6b797 Almost ended quality review, and fixed tales-related vram overflows. 2017-04-19 19:57:31 +02:00
lephe a6e312a39c Some quality review. Made keyboard time milliseconds. 2017-03-26 18:38:32 +02:00
lephe 31e2b453dd Redesigned timer module: got a possibly infinite amount of virtual timers. 2017-03-01 11:07:28 +01:00
lephe 7ab6170ca3 Key repeat events & Timer callbacks with arguments. Fixed sleep_us(). 2017-02-25 23:19:35 +01:00
lephe d852bc3310 Huh... debug app for crashes & whole new interrupt system. Minor edits. 2017-02-25 19:02:07 +01:00
lephe 2564096a13 Added natural delay/frequency settings for timers. 2016-12-22 19:47:05 +01:00
lephe d80de5683b Added clock frequency computations/measurements, and frequency-delay/timer expression. 2016-08-29 11:29:07 +02:00
lephe c63d7b812e Added bitmap part rendering and text colors, proper gray text. Enhanced demo app (wip). 2016-07-28 18:12:07 +02:00
lephe b2151886bc Added formatted printing for stdio: handles everything except doubles and %m. 2016-07-25 22:38:47 +02:00
lephe 34dd27d7a3 Major bopti update (one of the last, I hope). Added comparison with ML as fifth application (hidden). 2016-07-14 21:10:51 +02:00
lephe d122624c56 Re-structured files. Minor name changes. No code changed in this falsely huge commit. 2016-07-06 11:28:51 +02:00