Commit graph

74 commits

Author SHA1 Message Date
Lephe
416331d48b
kernel: replace CP400 file functions with Yatis', fixing unstability 2025-04-06 22:00:40 +02:00
Lephe
8e64a8a107
fs: fx-CP 400 fixes, still unreliable when writing as previously known 2025-04-06 15:54:44 +02:00
Lephe
4a5c0bbfec
gint: fix poweroff crash due to misaligned syscall table 2025-03-24 10:57:22 +01:00
Lephe
cf020c4bee
kernel: detect circuit10's emulator so it stays as CG50
Otherwise gint assumes Math+ by default.
2025-03-24 10:28:43 +01:00
Yann MAGNIN
3fefc3f716
touch: prepare touch-screen driver 2025-03-17 15:07:29 +01:00
Lephe
411b1a3d7d
kernel: get arenas from MPM load info 2025-02-24 19:41:49 +01:00
Lephe
ff17b8c22c
kernel: syscall support for Math+ OS v2.00 2025-02-03 23:52:48 +01:00
Lephe
232a4195d2
cpg: don't overclock beyond known limits on Math+ 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
Lephe
f953efdc82
kernel: partial support for Math+ OS 1.00 2025-02-03 23:52:47 +01:00
Lephe
1df334110e
kernel: allows syscalls to be called from fixed addresses 2025-02-03 23:52:44 +01:00
Yann MAGNIN
45139d13b5
kernel: simplify PIE support 2024-12-13 13:38:59 +01:00
Lephenixnoir
2ef2c7de27
kernel: fix 512-kB RAM check on mono being duped by cache
This was noticed by Sentaro21 and tested by CalcLoverHK on a Slim.
2024-10-19 09:44:38 +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
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
88eb5413a6
gint: remove the need to track filename offset in stage-2 load
By patching the ELF we insert the filename at a time where the file
format itself already tracks it (through the symbol .stage2_filename).
2024-06-05 10:49:13 +02:00
Lephe
da05e89b1c
gint: disable restart on fx-CP
There is no return-to-menu so enabling it would just loop.
2024-06-04 17:58:16 +02:00
Lephe
58eb5d92d7
gint: stage-2 loads for HH2 2024-06-04 11:28:23 +02:00
Lephe
1fc7290b09
gint: setup to prepare HH2 stage-2 loads 2024-06-02 22:01:29 +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
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
faead4bc1d
Merge remote-tracking branch 'redoste/gdb' into dev (#27) 2024-03-25 08:05:48 +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
5ff6a518f6
gint: memory micro-optimizations 2024-03-19 19:03:17 +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
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
redoste
6efcfa6018
ubc: panic when trying to break in code using register bank 1 2023-06-04 23:20:42 +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
Lephe
1a61e97ef0
mmu: provide read-only access to ITLB 2023-02-02 14:23:03 +01:00
Lephe
6f758cd36c
defs: allow NULL callbacks in gint_call() 2023-01-31 16:04:35 +01:00
Lephe
db50c9b192
kernel: more options in System ERROR screen
* Add options to RESET, go to menu, or abort()
* Define weak symbols for driver functions so that low-level debugging
  add-ins can be linked with minimal drivers (CPU/INTC/MMU)
2023-01-25 22:38:39 +01:00
mibi88
984f162cb2 Added gint_set_quit_handler() 2022-11-20 11:48:26 +01:00
mibi88
2fe67412cc Added SetQuitHandler. 2022-11-20 11:48:26 +01:00
calamari
a735e074d8 Clean up style mismatch 2022-09-25 11:23:07 -07:00
calamari
ddf340cccd Support gint_osmenu() on fx-9860G Slim 2022-09-25 10:37:41 -07:00
calamari
b23ed9629e Add HWCALC entry for fx-9860G Slim 2022-09-24 19:48:07 -07:00
Lephe
3e5c45c5ad
kernel: make gint_setrestart() reset everything 2022-09-02 22:29:19 +02:00
Lephe
9924dc4684
fs: add rename() function on fx-CG 2022-08-22 15:25:14 +02:00
Lephe
b942bc5d19
clock: add overclock support on fx-CG 10/20/50 2022-05-15 19:20:14 +01:00
Lephe
7a3604ccbb
render-cg: allocate VRAM in the heap; default to double buffering
* Create a heap arena over the OS stack, large enough to hold two VRAMs
  as was previously done, unless GINT_NO_OS_STACK is set at compile
  time. (This replaces GINT_USER_VRAM.)

* Allocate a single VRAM in the heap at startup.

* Use double buffering by default as triple buffering is almost entirely
  useless. dudpate() waits if both VRAMs are identical to prevent
  corruption, but this can be bypassed with R61524 functions as usual.
  This adds about 180 kB of heap data to any add-in using default
  settings.
2022-05-04 20:08:52 +01:00
Lephe
8210524152
ld: merge XRAM and YRAM into a single 16-kiB section 2022-05-04 19:08:54 +01:00
Lephe
d8b85a9fab
hardware: specify gint[HWRAM] = 8 MiB on the CG-50 2022-01-18 13:49:33 +01:00
Lephe
321d6937e0
kernel: tentative stack overflow panic, 14 kiB stack on G-III
I saw a crash with the 12 kB stack. Added an error message to diagnose
further similar issues, and bumbed the stack to 14 kB. That's a lot of
space just for BFile but stability is queen... :x
2021-12-11 16:38:31 +01:00
Lephe
71de4dcb95
bfile: clean up header, add BFile_Seek and BFile_GetPos 2021-12-10 07:24:12 +01:00
Lephe
2e5e56f82e
hardware: expose filesystem type in the hardware info
Filesystem type is detected with a trivial heuristic:
* fx-9860G: CASIOWIN, unless Fugue in the G-III series (OS >= 3.00)
* fx-CG 50: Always Fugue
2021-12-06 21:31:00 +01:00
Lephe
86fad757e1
kernel: increase stack size to 12 kB on SH4 fx-9860G
BFile calls on the G-III series can overflow an 8 kB stack, overriding
the VBR which is located just before (!).
2021-12-05 21:15:41 +01:00
Lephe
b7173a5109
kernel: fix incorrect interrupt save/restore for MAC on SH3 2021-11-25 14:02:04 +01:00