Commit Graph

118 Commits

Author SHA1 Message Date
lephe 705854da39 getkey: exclude other keys during a repetition
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.
2019-07-18 15:20:34 -04:00
lephe 1697998a9c tmu: improve code style and clear masks
Apparently there are some situations where the interrupt masks for
TMU0 are set in the system. They should obviously be cleared.
2019-07-18 15:19:29 -04:00
lephe c80debacd7 keyboard stdio: some fixes 2019-07-17 19:29:12 -04:00
lephe 1685813078 libc: fix a pointer overflow in kprint
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()...
2019-07-16 19:13:26 -04:00
lephe ff2db385a8 TODO update and miscellaneous style 2019-07-16 18:34:10 -04:00
lephe 8dbdd32adb keyboard: finalize getkey() 2019-07-16 18:23:21 -04:00
lephe 2d7a6f154e libc: implement a compliant formatted printer
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)
2019-07-16 16:14:13 -04:00
lephe 31ade70c42 tmu: export definitions, clean stop, expose address
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.
2019-07-16 15:39:38 -04:00
lephe 7e09e37938 libc: implement malloc() etc. through syscalls
Currently only used by libprof itself.
2019-07-16 15:39:33 -04:00
lephe 24fbeab55b core: provide MPU type on unknown platforms
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.
2019-07-16 15:39:33 -04:00
lephe d9c32b2b05 libc: split standard headers properly
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.
2019-07-16 15:38:18 -04:00
lephe bbe51f9a34 r61524: stay compatible with sh3eb-elf 2019-07-13 11:45:21 -04:00
lephe be415fb4b3 rename 'clock' module 'cpg' and move sleep_us() to tmu 2019-07-06 16:51:31 -04:00
lephe 3c7a8891d0 render: rename dimage_opt() into dsubimage() 2019-07-06 16:49:59 -04:00
lephe eece35566e core: add BFile syscalls 2019-07-04 12:15:13 -04:00
lephe 3d362bb0bf defs: remove useless definitions 2019-07-04 12:15:00 -04:00
lephe 5a575a278f render: use shorter color names 2019-07-04 12:14:31 -04:00
lephe bfbbc440fd bootlog: fill with spaces, not NULs 2019-07-04 12:13:31 -04:00
lephe 3324d58afa core: add a hardware detection interface 2019-07-04 12:11:43 -04:00
lephe 7798f276ae render-cg: make the 8x9 font the default 2019-07-04 11:49:15 -04:00
lephe f8d69dd56a display: add a dupdate_noint() for exceptions handlers 2019-07-04 11:46:26 -04:00
lephe b0ede1d15d configure: fix integer regex and exit logic 2019-07-04 11:39:10 -04:00
lephe defb5ba779 README: use relative URLs to link to other projects 2019-07-04 11:38:39 -04:00
lephe 3afa0af3c6 make: do not assume install -m on Mac OS 2019-07-01 11:22:12 -04:00
lephe 11b40b445c render-cg: 8x9 font and proportional font rendering 2019-06-23 17:27:44 -04:00
lephe 0055199359 render: refactor to share functions, and basic text on fxcg50 2019-06-15 01:05:31 -04:00
lephe 81baa4c26a bopti: expose bopti functions and implement dimage() and dimage_opt() 2019-05-04 21:00:40 +02:00
lephe 9b24267488 topic: return to the 5x7 font as default
The 5x6 font is less readable than I hoped, so too bad.
2019-05-04 19:27:52 +02:00
lephe 19cdae4953 core: expose the syscall header
Will be used in time for BFile.
2019-05-04 14:59:13 +02:00
lephe 05f2e01b50 bootlog: make a copy for use in gintctl 2019-05-04 12:07:14 +02:00
lephe e48386d2a4 fix: remove the Gitlab continuous integration file 2019-05-03 17:23:19 +02:00
lephe 37e07dabcc t6k11: quick-and-dirty support for Graph 35+E II 2019-05-03 17:12:41 +02:00
lephe 8e0d2eb783 fix: various omissions 2019-05-03 17:12:22 +02:00
lephe f3c8964b84 render-cg: decently implement basic functions 2019-05-03 17:11:43 +02:00
lephe 04231ea5d6 dma: add a new driver to support r61524
Also add a power interface (without driving code) and switch toolchain
because the previous sh4eb-nofpu-elf toolchain was not completely
FPU-free.
2019-03-10 15:45:34 +01: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 417340ce91 topti: implement background color and text size
Also transition the bootlog from fxlib to topti.
2019-02-22 15:08:51 +01:00
lephe 3f7c0a04ad way too much, including bopti/topti, timers, and more. 2019-02-21 21:00:26 +01:00
lephe ae4e5d83b2 Merge branch 'compat' of http://git.planet-casio.com/lephe/gint into compat 2018-08-24 08:38:30 +02:00
lephe 298338f633 More timers, RTC, basic overclock-resistant keyboard, CPG, PFC, driver levels. 2018-08-19 17:11:37 +02:00
lephe b20fcc4c7c More timers, RTC, basic overclock-resistant keyboard, CPG, PFC, driver levels. 2018-08-19 17:11:37 +02:00
lephe 2f0e049c33 More interrupt system, exceptions, timers. 2018-08-01 20:41:36 +02:00
lephe 48b552b295 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 5c20997c9a 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 1d107a1d64 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 5b54cef75a 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