Commit Graph

38 Commits

Author SHA1 Message Date
Lephe 4485e7f865
core, tmu: add gint_switch(), return to menu, and improve timer code
* Add the gint_switch() function which executes user-provided code from
  the system (CASIOWIN) context.
* Added interrupt masks to the core context (should have been there long
  ago).
* Added the gint_osmenu() function that switches out of gint to invoke
  GetKeyWait() and inject KEY_CTRL_MENU to trigger the main menu. This
  uses many CASIOWIN syscalls, but we don't care because gint is unloaded.
  Trickery is used to catch the key following the return in the add-in
  and/or display a new application frame before GetKeyWait() even finishes
  after coming back. This is only available on fx9860g for now.
* Removed any public syscall definition to clear up interfaces.
* Patched the DMA interruption problem in a weird way on fxcg50, a
  driver function will be used to do that properly eventually.
* Changed the driver model to save driver contexts in preallocated
  spaces instead of on the stack for overall less risk.
* Enabled return-to-menu with the MENU key on fx9860g in getkey().
* Changed the keyboard driver to emit releases before presses, as a
  return-to-menu acts as a press+release of different keys in a single
  driver frame, which confuses getkey().
* Fixed a really stupid bug in memcpy() that made the function really
  not work.

Improvements in the timer driver:

* Expose ETMU modules as SH7705_TMU and SH7305_TMU in <gint/mpu/tmu.h>.
* Remove the timer_t structures, using SH*_ETMU and SH*_TMU instead.
  Only interrupt gate entries are left hardcoded.
* Discovered that not only every write to the TCNT or TCR of an ETMU
  takes about 1/32k of a second (hinting at registers being powered by
  the same clock as the timer), but every write occuring while a previous
  write is pending is *lost*. This led to terrible bugs when switching
  ETMU contexts too fast in gint_switch().
* Removed an internal timer_address() function.
* Overall simplified the handling of timers and the initialization step.
2020-05-10 14:03:41 +02:00
lephe f33cb3cf80 core: better bootlog API and implementation
* Now uses topti instead of fxlib for text (including MMU failure)
* Fit .pretext into 4k for everything before MMU succeeds
* A short version of sprintf() for dynamic messages
* Support a driver function, status(), to allow early driver debug
* Expose more useful platform information in <gint/mpu.h>
* Expose the first of a few CASIOWIN syscalls
2019-03-06 14:32:51 +01:00
lephe 3f7c0a04ad way too much, including bopti/topti, timers, and more. 2019-02-21 21:00:26 +01:00
lephe 2f0e049c33 More interrupt system, exceptions, timers. 2018-08-01 20:41:36 +02:00
lephe 3b90b40dd7 Hybrid build system and runtime (no interrupts). t6k11 driver. Basic r61524 driver. 2018-04-19 13:24:26 +02:00
lephe c50cbf6a9c Make room for an fx-cg50 compatible version. Enhanced build system. 2018-04-09 08:31:12 +02:00
lephe 131b432cc9 Define GINT_VERSION at library link time instead of add-in link time. 2017-07-13 21:39:51 +02:00
lephe 0f4b589240 Not enough, apparently. 2017-07-11 14:02:50 +02:00
lephe 34e42a03a6 Small Makefile adjustments, preparing fusion with fxSDK 2017-07-08 17:22:42 +02:00
lephe f6133c26fc Startup logs instead of diagnostics, created .gint_bss, updated demo. 2017-07-05 21:38:12 +02:00
lephe 3214f6b797 Almost ended quality review, and fixed tales-related vram overflows. 2017-04-19 19:57:31 +02:00
lephe b15d543e8d Just a hotfix for dimage()... fxSDK's a bit late... 2017-04-17 12:56:27 +02:00
lephe 57a7e1c2d4 More quality review, more registers saved at startup. 2017-04-13 21:59:13 +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 0ef89df6e7 Erf. Large commits always fail. 2017-02-25 20:10:48 +01:00
lephe d852bc3310 Huh... debug app for crashes & whole new interrupt system. Minor edits. 2017-02-25 19:02:07 +01:00
lephe 49df2a5fb4 Added a --extended-libc option and some headers to allow porting external programs. 2017-01-22 18:35:02 +01:00
lephe 4fceab4533 Updated README and TODO files 2016-12-25 11:45:05 +01:00
lephe 9a3433c52a Fixed left-side vram overflow with text, made install automatically along fxSDK. 2016-12-22 23:08:44 +01:00
lephe e6e0989436 Solved backlight issues and added backlight control to the API. 2016-12-22 18:36:39 +01:00
lephe 28748a820c Fixed some Makefile dependencies. 2016-11-11 10:43:13 +01:00
lephe eedec2b124 Added a configure script with some options, made Makefile output pretty. Set up an event system (used by keyboard). 2016-11-05 22:00:23 +01:00
lephe d80de5683b Added clock frequency computations/measurements, and frequency-delay/timer expression. 2016-08-29 11:29:07 +02:00
lephe 0205c39f21 Fixed area functions (rectangles completely outside the screen). 2016-08-14 19:57:58 +02:00
lephe 58db663ae6 Some time manipulation. Added the targets to the .gitignore file. 2016-08-08 15:01:33 +02:00
lephe 1f223f807f Added an RTC test (clock), image part drawing and a few standard functions (stdlib, time). 2016-08-02 07:51:44 +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 7f174043a5 Reported TLB issues. Moved internal headers files, added rtc module and alloca. 2016-07-25 09:04:22 +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
lephe ab17532f67 Major update for bopti (gray, light still not tested). Reworked out gray engine. 2016-07-04 18:30:25 +02:00
lephe aa0f4b7285 First gray tests. Added text module, 'tales'. 2016-05-20 22:04:15 +02:00
lephe f27ba1129a Finished rewriting bopti, except for Checker. Removed .gitlab-ci.yml because of non-successful runner tests. 2016-05-07 12:10:47 +02:00
lephe 13aad50ab7 Began to re-write bopti. Bitmap tests changed. Added a continuous integration file. 2016-05-06 20:47:15 +02:00
lephe f2fb010128 Changed test application name to 'ginttest'. Added build instructions to README. 2016-05-05 13:30:49 +02:00
lephe 0a7f22d4c1 Initial commit. Includes interrupt handler, drivers for keyboard and screen, and parts of the drawing library. 2016-05-05 11:49:05 +02:00