Commit graph

312 commits

Author SHA1 Message Date
Yann MAGNIN
0aca688343
Merge branch 'dev' of git.planet-casio.com:Lephenixnoir/gint into feat/touchscreen 2025-03-18 10:20:39 +01:00
Yann MAGNIN
3fefc3f716
touch: prepare touch-screen driver 2025-03-17 15:07:29 +01:00
Lephe
256487cc7e
r61523: add partial update function 2025-03-15 17:08:46 +01:00
Lephe
c2cc3e48f2
cpg: allow overclock settings to be made permanent 2025-02-20 19:16:33 +01:00
CalcLoverHK
cdcf880006 cpg: add superhyway clock frequency calculation 2025-02-16 17:04:27 +08:00
Lephe
e44e4fa14e
keysc: add MPU module description for KEYSC 2025-02-03 23:52:48 +01:00
Lephe
7a479e4f45
keydev: support for the Math+ layout and track row/col
key_event_t is now 8 bytes instead of 4, a change that was doomed to
happen anyway to deal with touch input (where it's not clear either
whether 8 bytes will be enough for double touch).
2025-02-03 23:52:48 +01:00
Lephe
a62ba8a026
kernel: further support for the Math+ in general
* Add a new HWCALC value HWCALC_FXCG100, detected based on being on an
  Area-3 RAM model and having OS version that's either less than 3 or
  3 and built after January 2025.
* Disable the _ostk heap arena, as the region might simply not exist,
  and improve the VRAM allocation code to account for this better than
  the hardcoded macro previously in place for the fx-CP 400.
* Disable gint_osmenu() which can't work with MPM right now.
* Add BFile_FindFirst() and GetVRAMAddress() syscalls.
2025-02-03 23:52:48 +01:00
Lephenixnoir
09ad6b0b31
minor: add missing include in defs/call.h 2024-12-16 13:15:37 +01:00
Lephe
47b86b83c8
gdb: add missing stdbool.h include in gdb.h
Fixes sh-elf-gdb#1
2024-10-06 08:51:22 +02:00
Lephe
ccdd4c227c
provide new line-distance property for built-in fonts 2024-09-15 18:44:44 +02:00
Lephe
aba6c280b6
hh2: provide metadata macros and a non-metadata marker by default
If none of the HH2_*() macros are used, the binary will show up as its
own filename instead of random garbage.

If HH2_NAME() is used the metadata will be read, and the binary format
requires that all fields by specified. Using only a subset of the macros
is invalid, but not reported.
2024-08-17 18:05:43 +02:00
Lephe
979873288a
defs: allow bool * pointer variants in GINT_CALL 2024-08-15 22:17:22 +02:00
Lephenixnoir
4173bf1f78
exch, inth: save more data in context structure, and simplify entries 2024-07-15 20:57:26 +02:00
Lephenixnoir
395250b5a9
exch: add trapa #31 handler 2024-07-13 10:11:26 +02:00
Lephe
f70f1d9ae3
keysc: make the fx-CP Clear key EXIT instead of AC/ON
It's much more useful for compatibility with keyboard apps
2024-06-04 17:57:38 +02:00
Lephe
84a4dd7ca9
gint: compressed VRAM save on fx-CP
This frees the OS' backup VRAM, which is a 337920-byte buffer sitting
at a fixed address, for loading code.
2024-06-01 14:41:09 +02:00
Lephe
335326692f
meta: add LTO support and enable it by default
* Set -flto
* Use gcc-ar to build the archive so the LTO plugin is loaded and LTO
  sections aren't stripped off the object files
* Slightly conservative KEEP()s in the linker script (not required but
  I'm paranoid)
* Make the drivers __attribute__((externall_visible)) so they are
  generated by the link-time back-end and not left in the archive
* Remove the unused isappli/optnum parameters of main, which have been
  unused for years, are irrelevant on fx-CG and lead to a link-time
  warning with LTO. I'll add APIs to access them later.
2024-05-26 18:16:31 +02:00
Lephe
4a2b60b785
keysc: add support for the CP-400 key layout 2024-05-25 18:01:15 +02:00
Lephe
e3105701d9
cpu: also save rN_bank registers at startup/exit
These are at least used on the CP to hold OS-related interrupt handler
pointers (to handling routines).
2024-05-25 17:59:10 +02:00
Lephe
5b16888d9d
gint: provide short type definitions (i8, u8, etc.) 2024-05-25 17:56:28 +02:00
Lephe
789ba7caa5
gint: basic support for fx-CP 400 programs with HollyHock 2 loading
Features will come in slowly while I restructure for gint 3. With this
third big target for gint, the legacy aspects of gint 2's structure and
API are getting felt, so a major revision will be in order.

See the TODO file at this commit for info on what works and not.
2024-04-16 15:53:10 +02:00
Lephe
5c3dc3220a
intc: add definition for SCIF interrupt 2024-04-14 18:21:14 +02:00
Lephe
7ac2ae25f2
gdb: stdout/err redirect + support swbreak + optional bridge logs 2024-04-13 09:20:01 +02:00
Lephe
0afd05848a
gdb, video, r61524: gdb visual feedback + start video intf on CG
- Define a draft of the video interface
- Implement that dragt for CG for a single mode
  * Includes stub of brightness setting from disassembling 3.60
- Use the video interface to show visual feedback on GDB on CG

Using the video interface avoids directly linking into a driver, which
will serve modularity in gint 3.
2024-04-09 08:57:46 +02:00
Lephe
d9414bb6f2
gdb: allow gdb stub to automatically start when a crash occurs
The user can still gdb_start() + gdb_main(NULL) manually, which allows
e.g. early setup of breakpoints. The start_on_except mechanism is the
lazier method where we just run the add-in normally and start fxsdk gdb
on the PC *after* a crash occurs.
2024-03-30 21:41:35 +01:00
Lephe
4623d790cc
ubc: slight cleanup
It is guaranteed by the driver model that drivers are powered on when
gint is active. Sharing the driver isn't too useful because we can't
remote debug in the OS world anyway, there's no USB driver there.
2024-03-30 21:41:08 +01:00
Lephe
faead4bc1d
Merge remote-tracking branch 'redoste/gdb' into dev (#27) 2024-03-25 08:05:48 +01:00
Lephe
946d4d9a6f
gray, r61524: gray engine for r61524
gray/engine.c looks terrible by now and it will have to be cleaned up in
the future, with the whole video modes abstraction.
2024-03-24 08:53:12 +01:00
Lephe
3a42b5d386
gint: switch away from FX9860G/FXCG50 macros
Not changing much for now, just distilling them into hardware/OS/render
macros. Later on the rendering stuff will become more dynamic and down
the line I want to unify the APIs more.
2024-03-24 08:28:22 +01:00
Lephe
5548bf68ab
render: add R61524 backend to render-fx for build-fxg3a target 2024-03-23 12:09:53 +01:00
Lephe
28bea2e1ce
gint: switch from file filters to config macros + basic fxg3a target
Nothing interesting in this commit, just moving files around, making
sure every target compiles every file, and controlling with macros
instead.

Basic support for fxg3a target in CMakeLists.txt, cmake/FindGint.cmake,
giteapc.make and include/gint/config.h.in. The rest is forgettable.
2024-03-23 10:02:51 +01:00
Lephe
b2b1f00d04
fs: take const descriptor in open_generic() 2024-03-19 19:03:33 +01:00
Lephe
5ff6a518f6
gint: memory micro-optimizations 2024-03-19 19:03:17 +01:00
Lephe
bc74586a2c
render: parametrize existence of dmode in config.h
This is the first of many steps designed to reduce gint's reliance on
the FX9860G and FXCG50 macros by describing the compile target more
symbolically. The goal is to allow both for g3a compilation of fx-API
code and for a potential CP port.
2024-03-19 18:37:13 +01:00
Lephenixnoir
e0ac25fbb0
render: improve implementation of dpoly()
* Honor dwindow settings immediately (avoids useless dline() calls)
* Bound to ymin/ymax instead of doing many useless cut computations
* Remove the need for floating-point operations and division
2024-03-02 23:16:22 +00:00
Lephe
e50769c824
kmalloc: add kmalloc_remove_arena() function 2024-02-04 22:10:01 +01:00
Lephe
caa68b08bf
render-fx: add image formats in public API 2024-01-31 15:51:39 +01:00
Lephe
833025f5dd
render-fx: turn bopti_image_t's data array into a pointer
It used to be a flexible array member because in the old days fxconv
could only output a fixed set of bytes, so any referencing was out the
question. Nowadays fxconv can output pretty much anything. Separating
the data pointer will be useful for PythonExtra to expose it as a Python
bytes() or bytearray() object while using the gint API.
2024-01-29 09:49:34 +01:00
Lephe
fd5a70e21b
gint: add power-off feature and shortcut in getkey() 2024-01-16 11:42:49 +01:00
Lephe
5655699cd8
gint: reload on-chip sections after world, with option to backup (#26)
Solves the power off crash, at least for programs that don't store
long-term data in on-chip memory.
2024-01-16 11:07:41 +01:00
Lephe
18a7b9ae5b
display: add dcircle() and dellipse() rendering functions
For PythonExtra#2.
2024-01-04 12:00:58 +01:00
Lephe
2bb5294578
gint: avoid annoying banner on return from menu on fx-CG
Instead of using GetKeyWait(), we directly call into an internal OS
function, which avoids the need to press a key before we can redraw over
the OS banner and VRAM when coming back. The disassembly to locate the
function was developed by Dr-Carlos.

We still have to redraw when coming back; getkey() will do it by
dupdate() by default, and it that's not a possibility for the
application an option to receive a special event and handle it manually
is provided.
2023-08-19 22:52:53 +02:00
Lephe
6d86c54507
keyboard: add keypressed() and keyreleased() functions 2023-07-24 14:08:23 +02:00
Lephe
16259deb20
render: expose some internal text rendering utilities 2023-06-04 23:24:34 +02:00
redoste
0b7d8d6800
ubc: ignore breaks when no debug handler is set 2023-06-04 23:20:42 +02:00
redoste
33dae5d218
ubc: add a global lock to inform if a UBC break is being handled 2023-05-27 18:59:24 +02:00
redoste
21ff5c1d53
usb: expose the context of the interrupted function on USB interrupt 2023-05-27 18:52:05 +02:00
redoste
76c82beec6
intc: allow user-space handlers to access the interrupted context
This workaround using a gint_call_t with an odd address is not realy the
cleanest idea but it helps keep the existing intc_generic_handler in
the 32 bytes size limit of the VBR space.
2023-05-27 18:36:15 +02:00
redoste
238bccddbe
gdb: add hw-breakpoint and single step support using the UBC 2023-05-24 22:21:01 +02:00