Alternative library and kernel for add-in development on fx-9860G and fx-CG50 under Linux.
Go to file
Lephe 815d479ab7
cmake: install FindGint.cmake (previously in the fxSDK)
2021-01-27 08:57:23 +01:00
cmake cmake: install FindGint.cmake (previously in the fxSDK) 2021-01-27 08:57:23 +01:00
include/gint cmake: restore options USER_VRAM and STATIC_GRAY 2021-01-25 19:06:42 +01:00
src cmake: restore options USER_VRAM and STATIC_GRAY 2021-01-25 19:06:42 +01:00
.gitignore add GiteaPC support 2021-01-16 18:29:32 +01:00
CMakeLists.txt cmake: install FindGint.cmake (previously in the fxSDK) 2021-01-27 08:57:23 +01:00
README.md update README 2021-01-25 21:52:42 +01:00
TODO switch build system to CMake 2021-01-25 15:31:20 +01:00
fx9860g.ld kernel: dynamic loading of GMAPPED functions to user RAM 2020-09-17 14:48:54 +02:00
fxcg50.ld kernel: dynamic loading of GMAPPED functions to user RAM 2020-09-17 14:48:54 +02:00
giteapc.make switch build system to CMake 2021-01-25 15:31:20 +01:00

README.md

gint project

gint (pronounce “guin”) is an add-in unikernel for CASIO calculators of the fx-9860G II and fx-CG 50 families. It provides a mostly free-standing runtime and is used to develop add-ins under Linux, along with specialized GCC toolchains and the fxSDK.

When running in an add-in, gint takes control of the calculator's hardware from the operating system, and manages it with its own drivers. It exposes a new, richer API that takes advantage of the full capabilities of the machine.

This is free software: you may use it for any purpose, share it, modify it, and share your changes. Credit is not required, but please let me know!

gint also includes third-party code that is distributed under its own license. Currently, this only includes:

Programming interface

Because of its free-standing design, gint's API provides direct and efficient access to low-level MPU features, which includes:

  • Multi-key management with event systems suitable for games
  • Hardware timers with sub-millisecond and sub-microsecond resolution
  • Fast screen drivers with DMAC on fx-CG 50
  • Efficient and user-extendable interrupt management
  • Safe access to on-chip and DSP memory areas
  • Hardware-driven memory primitives (DMA, DSP)

The library also offers powerful higher-level features:

  • An enhanced version of the system's GetKey() and GetKeyWait()
  • A gray engine that works by rapidly swapping monochrome images on fx-9860G II
  • Blazingly fast rendering functions (image rendering is 10 times faster tha MonochromeLib)
  • Integrated font management

A couple of libraries extend these features, including:

Basic use with GiteaPC and the fxSDK

gint can be installed automatically with GiteaPC.

% giteapc install Lephenixnoir/gint

Normally you don't use it directly, instead the fxSDK provides project templates that are set up to use gint. Please see the fxSDK README file for details.

Building and installing manually

You will need a couple of tools:

  • A suitable GCC toolchain in the PATH. You can absolutely not build gint with your system compiler!
    • The tutorial on Planète Casio builds an sh-elf that works everywhere
    • For fx-9860G II, sh3eb-elf is strongly advised
    • For fx-CG 50, sh4eb-elf (with -m4-nofpu) is slightly better but sh3eb-elf is completely fine
  • The fxSDK installed and available in the PATH.

fx-CG 50 developers probably want a g3a wrapper as well; the reference implementation is Tari's mkg3a. This is needed at the very last compilation step to create the g3a file. On Arch Linux, you can use the AUR/mkg3a package maintained directly by Tari.

gint is built with CMake; the fxSDK provides CMake modules to target the calculator, as well as a couple of utilities. gint is always installed in the compiler's install path (as given by sh-elf-gcc --print-search-dirs) which is detected automatically, so normally you don't need to set the install prefix.

Building for fx-9860G II

fxsdk build-fx will invoke CMake and make. If you have specific configuration options, run once with -c to configure.

% fxsdk build-fx -c <OPTIONS...>

Run without -c to build. This configures automatically.

% fxsdk build-fx

The available options are:

  • -DGINT_STATIC_GRAY=1: Put the gray engine's VRAMs in static RAM instead of using malloc()

Building for fx-CG 50

Same as fx-9860G II, except the command is fxsdk build-cg instead of fxsdk build-fx.

The available options are:

  • -DGINT_USER_VRAM=1: Store all VRAMs in the user stack (takes up 350k/512k)

Linking with gint manually

Projects created with the fxSDK link with gint out-of-the-box. If you're not using the fxSDK, you will need to:

  • Build with -ffreestanding -fstrict-volatile-bitfields;
  • Link with -T fx9860g.ld and -lgint-fx on fx-9860G;
  • Link with -T fxcg50.ld and -lgint-cg on fx-CG 50.

If you don't have a standard library such as Memallox's port of newlib, you also need -nostdlib. I typically use -m3 -mb or -m4-nofpu -mb to specify the platform, but that may not even be necessary.