Les membres ayant 30 points peuvent parler sur les canaux annonces, projets et hs du chat.
La shoutbox n'est pas chargée par défaut pour des raisons de performances. Cliquez pour charger.

Forum Casio - Projets de programmation


Index du Forum » Projets de programmation » gint : un noyau pour développer des add-ins
Lephenixnoir En ligne Administrateur Points: 24145 Défis: 170 Message

gint : un noyau pour développer des add-ins

Posté le 20/02/2015 17:30

Ce topic fait partie de la série de topics du fxSDK.

En plus des options de programmation intégrée comme le Basic Casio ou Python, la plupart des calculatrices Casio supportent des add-ins, des programmes natifs très polyvalents avec d'excellentes performances. Les add-ins sont généralement programmés en C/C++ avec l'aide d'un ensemble d'outils appelé SDK.

Plusieurs SDK ont été utilisés par la communauté avec le temps. D'abord le fx-9860G SDK de Casio avec fxlib pour Graph monochromes (plus maintenu depuis longtemps). Puis le PrizmSDK avec libfxcg pour Prizm et Graph 90+E (encore un peu actif sur Cemetech). Et plus récemment celui que je maintiens, le fxSDK, dont gint est le composant principal.

gint est un unikernel, ce qui veut dire qu'il embarque essentiellement un OS indépendant dans les add-ins au lieu d'utiliser les fonctions de l'OS de Casio. Ça lui permet beaucoup de finesse sur le contrôle du matériel, notamment la mémoire, le clavier, l'écran et les horloges ; mais aussi de meilleures performances sur le dessin, les drivers et la gestion des interruptions, plus des choses entièrement nouvelles comme le moteur de gris sur Graph monochromes.

Les sources de gint sont sur la forge de Planète Casio : dépôt Gitea Lephenixnoir/gint

Aperçu des fonctionnalités

Les fonctionnalités phares de gint (avec le fxSDK) incluent :

  • Toutes vos images et polices converties automatiquement depuis le PNG, sans code à copier (via fxconv)
  • Un contrôle détaillé du clavier, avec un GetKey() personnalisable et un système d'événements à la SDL
  • Une bibliothèque standard C plus fournie que celle de Casio (voir fxlibc), et la majorité de la bibliothèque C++
  • Plein de raccourcis pratiques, comme pour afficher la valeur d'une variable : dprint(1,1,"x=%d",x)
  • Des fonctions de dessin, d'images et de texte optimisées à la main et super rapides, surtout sur Graph 90+E
  • Des timers très précis (60 ns / 30 µs selon les cas, au lieu des 25 ms de l'OS), indispensables pour les jeux
  • Captures d'écran et capture vidéo des add-ins par USB, en temps réel (via fxlink)

Avec quelques mentions spéciales sur les Graph monochromes :
Un moteur de gris pour faire des jeux en 4 couleurs !
La compatibilité SH3, SH4 et Graph 35+E II, avec un seul fichier g1a
Une API Unix/POSIX et standard C pour accéder au système de fichiers (Graph 35+E II seulement)

Et quelques mentions spéciales sur les Graph 90+E :
Une nouvelle police de texte, plus lisible et économe en espace
Le dessin en plein écran, sans les bordures blanches et la barre de statut !
Un driver écran capable de triple-buffering
Une API Unix/POSIX et standard C pour accéder au système de fichiers

Galerie d'add-ins et de photos

Voici quelques photos et add-ins réalisés avec gint au cours des années !



Arena (2016)Plague (2021)



Rogue Life (2021)



Momento (2021)



Communication avec le PC (cliquez pour agrandir)


Utiliser gint pour développer des add-ins

Les instructions pour installer et utiliser gint sont données dans les divers tutoriels recensés dans le topic du fxSDK. Il y a différentes méthodes de la plus automatique (GiteaPC) à la plus manuelle (compilation/installation de chaque dépôt). Le fxSDK est compatible avec Linux, Mac OS, et marche aussi sous Windows avec l'aide de WSL, donc normalement tout le monde est couvert

Notez en particulier qu'il y a des tutoriels de développement qui couvrent les bases ; tout le reste est expliqué dans les en-têtes (fichiers .h) de la bibliothèque que vous pouvez consulter en ligne, ou dans les ajouts aux changelogs ci-dessous.

Changelog et informations techniques

Pour tester les fonctionnalités et la compatibilité de gint, j'utilise un add-in de test appelé gintctl (dépôt Gitea Lephenixnoir/gintctl). Il contient aussi une poignée d'utilitaires d'ordre général.

Ci-dessous se trouve la liste des posts indiquant les nouvelles versions de gint, et des liens vers des instructions/tutoriels supplémentaires qui accompagnent ces versions.

VersionDateInfos supplémentaires
gint 2.10.02 Avril 2023
gint 2.9.021 Août 2022
gint 2.8.017 Mai 2022Effets dynamiques sur les imagesAPI de manipulations d'images
Overclock intégré
gint 2.7.119 Mars 2022Tutoriel capture des flux standards
gint 2.7.031 Décembre 2021
gint 2.6.029 Août 2021Tutoriel de capture vidéo par USB
gint 2.5.28 Juin 2021
gint 2.5.12 Juin 2021
gint 2.5.026 Mai 2021Intégration de fxlibc (dépôt) — Tutoriel de communication par USB
gint 2.4.027 Avril 2021Api GINT_CALL() pour les callbacks
gint 2.3.12 Février 2021
gint 2.3.029 Janvier 2021
gint 2.2.112 Janvier 2021
gint 2.2.011 Janvier 2021
gint 2.1.116 Septembre 2020
gint 2.1.021 Août 2020Polices UnicodeNouvelle API du moteur de gris
gint 2.0.3-beta10 Juillet 2020Modifications de l'API timer
gint 2.0.2-beta17 Juin 2020
gint 2.0.1-beta1er Juin 2020

Anecdotes et bugs pétés

Ô amateurs de bas niveau, j'espère que vous ne tomberez pas dans les mêmes pièges que moi.


TODO list pour les prochaines versions (2023-04-03)

gint 2.11
  1. Changements de contextes CPU. À reprendre du prototype de threading de Yatis pour permettre l'implémentation d'un véritable ordonnanceur. Demandé par si pour faire du threading Java.
  2. Applications USB. Ajouter le support de descripteurs de fichiers USB. Potentiellement pousser jusqu'à avoir GDB pour debugger.
  3. Support de scanf() dans la fxlibc. Codé par SlyVTT, plus qu'à nettoyer et fusionner.

Non classé

  • Regarder du côté serial (plus facile que l'USB) pour la communication inter-calculatrices (multijoueur) et ultimement l'audio (libsnd de TSWilliamson).
  • Un système pour recompiler des add-ins mono sur la Graph 90+E avec une adaptation automatique.
  • Support des fichiers en RAM pour pouvoir utiliser l'API haut-niveau sur tous les modèles et éviter la lenteur de BFile à l'écriture quand on a assez de RAM.



Précédente 1, 2, 3 ··· 10 ··· 20 ··· 30, 31, 32, 33, 34, 35, 36, 37 ··· 40 ··· 50 ··· 60 ··· 70, 71, 72, 73 Suivante
Lephenixnoir En ligne Administrateur Points: 24145 Défis: 170 Message

Citer : Posté le 14/01/2020 20:02 | #


Ce ne serait pas une erreur parce que l'adresse 0 est mappée en fait, ce qui est d'ailleurs pas pratique parce que les accès à NULL passent inaperçus...
Mon graphe (24 Mars): (gint#27 ; (Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; ...) || (shoutbox v5 ; v5)
Captainluigi Hors ligne Membre Points: 815 Défis: 1 Message

Citer : Posté le 14/01/2020 21:23 | #


Y a t'il un moyen de développer avec gint sur Windows ? ( je suis très intéressé )
Les bons artistes copient, les grands artistes volent. Picasso
Synthwave/Musique électro 80s sur ma chaine Youtube

Jouez à Mario sans arrêt sur votre Casio !
Cliquez pour découvrir
Cliquez pour recouvrir
Milang Hors ligne Membre Points: 488 Défis: 2 Message

Citer : Posté le 14/01/2020 21:36 | #


Avec une image docker c'est possible, mais pas encore nativement.
Lephenixnoir En ligne Administrateur Points: 24145 Défis: 170 Message

Citer : Posté le 14/01/2020 21:51 | #


Ça fait pas mal de fois qu'on me le demande donc je vais l'envisager sérieusement. Honnêtement ça m'aiderait si quelqu'un voulait bien aider pour le faire ; mais bon, on fera comme ça vient.
Mon graphe (24 Mars): (gint#27 ; (Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; ...) || (shoutbox v5 ; v5)
Captainluigi Hors ligne Membre Points: 815 Défis: 1 Message

Citer : Posté le 15/01/2020 09:20 | #


Lephenixnoir a écrit :
Ça fait pas mal de fois qu'on me le demande donc je vais l'envisager sérieusement. Honnêtement ça m'aiderait si quelqu'un voulait bien aider pour le faire ; mais bon, on fera comme ça vient.

Super !

Ajouté le 15/01/2020 à 09:21 :
Et du coup ça serait sous quelle forme sur Windows ?
( IDE ? )
Les bons artistes copient, les grands artistes volent. Picasso
Synthwave/Musique électro 80s sur ma chaine Youtube

Jouez à Mario sans arrêt sur votre Casio !
Cliquez pour découvrir
Cliquez pour recouvrir
Lephenixnoir En ligne Administrateur Points: 24145 Défis: 170 Message

Citer : Posté le 15/01/2020 09:24 | #


Sous Windows je donnerai les fichiers binaires de gint et vous les intégrez comme vous voulez à votre outil préféré.

Pour le fxSDK il y a d'autres ajustements à faire, mais chaque chose en son temps.

Ajouté le 15/01/2020 à 10:03 :
Enfin cela dit, vous pouvez déjà utiliser WSL... >_>
Mon graphe (24 Mars): (gint#27 ; (Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; ...) || (shoutbox v5 ; v5)
Dark storm Hors ligne Labélisateur Points: 11631 Défis: 176 Message

Citer : Posté le 15/01/2020 10:59 | #


Ou un Gnunux…

Blague à part, pour ce genre d'application la VM (VirtualBox ou Docker) ça marche très bien, ça vous initie aux systèmes Unix (spoiler, dans le monde du dev c'est juste indispensable), et ça ne vous prive pas de vos bsod favoris.

Un IDE c'est lourd, pas maintenable et n'a aucun intérêt (je trouve) dans le cas où tout se fait à coup d'éditeur de texte. Un IDE c'est bien quand tu fais du Grafcet ou du Scratch par exemple. Le reste c'est que de la poudre aux yeux.

Après ce qui peut être intéressant c'est une intégration à Atom par exemple. Genre des raccourcis clavier pour lancer le makefile. Mais ça demande moins de travail même si ça nécessite d'avoir tous les outils à dispo dans le PATH.
Finir est souvent bien plus difficile que commencer. — Jack Beauregard
Lephenixnoir En ligne Administrateur Points: 24145 Défis: 170 Message

Citer : Posté le 15/01/2020 11:30 | #


Après ce qui peut être intéressant c'est une intégration à Atom par exemple. Genre des raccourcis clavier pour lancer le makefile.

La magie c'est que comme tu le sais, le fxSDK utilise des outils standard comme Make, et donc il n'a pas d'interface spécifique avec Atom. Il suffit d'utiliser les bindings que Atom à déjà pour lancer les Makefile.
Mon graphe (24 Mars): (gint#27 ; (Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; ...) || (shoutbox v5 ; v5)
Redcmd Hors ligne Membre Points: 380 Défis: 7 Message

Citer : Posté le 26/01/2020 09:40 | #


I have encountered a strange bug with your GintDemo.G1A test download program
(fx-9750GII SH4 02.04.0201)
It seems that I have to press harder on the [REPLAY] keys for the program to detect it
I can feel the key touch the bottom of the circuit board and I have to push just a tiny bit harder for it to activate
Is this known?
Is it possible to add linear/soft touchable keys?
How is this even possible? it should only be an on/off switch
or maybe gint uses less battery and the keys need to be pushed harder for the contact pads to decrease the resistance enough to be detected
But it still happens when it's plugged into power or not

Other than that
The rest of Gint works really well
Especially the grayscale
Lephenixnoir En ligne Administrateur Points: 24145 Défis: 170 Message

Citer : Posté le 26/01/2020 10:23 | #


Keys are just on/off, there is no electronics involved there. So I don't think there is any way to change the touch of the keys.

This is the firs time I've ever heard of this bug. Are you sure it's not timing-related? Did you test that on the keyboard menu?

gintdemo.g1a is pretty old now, but the keyboard driver hasn't changed much so I guess this is still valid.

Other than that
The rest of Gint works really well
Especially the grayscale

Thank you sir
Mon graphe (24 Mars): (gint#27 ; (Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; ...) || (shoutbox v5 ; v5)
Redcmd Hors ligne Membre Points: 380 Défis: 7 Message

Citer : Posté le 26/01/2020 10:35 | #


I'm able to hold the keys down and nothing will happen (until I press a bit harder)
It affects the entire program, not just the keyboard section
In CASIO's main menu and in C.Basic it works like normal
It only affects the [REPLAY] keys, all other keys are fine
My [UP] key is more sensitive than the others, but I still need to push harder than normal

No way to get Gint working in the SDK?

The grayscales look very nice, there's even a stabilize button
Lephenixnoir En ligne Administrateur Points: 24145 Défis: 170 Message

Citer : Posté le 26/01/2020 11:03 | #


I'll have a look at this. Can you please just confirm the bug in gintctl (which is the current equivalent to gintdemo.g1a)?

No way to get Gint working in the SDK?

It technically works in the emulator, and also in the Graph 35+E II emulator.

But in the SDK itself with its compiler and libraries, it is plain impossible. There are multiple impossiblities: missing compiler capabilities including structure attributes and inline assembler, lack of external library support, lack of custom linking and linker scripts. And there are many annoyances: ANSI-only SDK, lack of ELF debugging information, lack of quick send-to-calculator function, rigid build process with a limited make, and many more.

Which isn't to say that the SDK is not worth developing with, but I personally can't bear with it anymore.
Mon graphe (24 Mars): (gint#27 ; (Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; ...) || (shoutbox v5 ; v5)
Redcmd Hors ligne Membre Points: 380 Défis: 7 Message

Citer : Posté le 26/01/2020 11:18 | #


Does gint work in windows? If not, may I have a link to a precompiled g1a file please? I haven’t set Linux back up again yet.
Not at my pc right now
Will do tomorrow morning
Lephenixnoir En ligne Administrateur Points: 24145 Défis: 170 Message

Citer : Posté le 26/01/2020 11:25 | # | Fichier joint


Oops sorry, I thought for a moment that the g1a file was available on the repository.

I'm attaching a fresh version from my own PC.

Also, gint and the fxSDK do not currently work on native Windows, but I'm considering options. Right now I wish to collect feedback on how it works on WSL to decide whether a full port is required or whether existing Windows support for Linux programs is sufficient for a comfortable experience.
Mon graphe (24 Mars): (gint#27 ; (Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; ...) || (shoutbox v5 ; v5)
Redcmd Hors ligne Membre Points: 380 Défis: 7 Message

Citer : Posté le 26/01/2020 19:52 | #


I liked the look and feel of the old GintDemo.G1A compared to the newer GintCLT.G1A
The keys work fine in the gintclt
Still need to press harder in gintdemo
I'm not able to access the Keyboard or Real-Time-Clock tests in gintclt
and I can't exit out of the Gray Engine test (have to press the restart button)
[MENU] doesn't work in gintclt (It worked perfectly in gintdemo)
Lephenixnoir En ligne Administrateur Points: 24145 Défis: 170 Message

Citer : Posté le 26/01/2020 21:14 | #


Alright, one step at a time.

I liked the look and feel of the old GintDemo.G1A compared to the newer GintCLT.G1A

The look and feel is basically the same, I did not change the fundamental way I design these menus. What do you miss?

The keys work fine in the gintclt
Still need to press harder in gintdemo

Good to know! So current versions of gint do not have the bug. That's one done

I'm not able to access the Keyboard or Real-Time-Clock tests in gintclt

Oh yeah, I might not have programmed these yet...

and I can't exit out of the Gray Engine test (have to press the restart button)

This is really not normal, please provide details if possible.

[MENU] doesn't work in gintclt (It worked perfectly in gintdemo)

Yes, this is normal, one of the last features still missing. Please bear with me, I think in the next month I might be able to come back seriously on this project and finish cleaning up the edges so this will come at that time.
Mon graphe (24 Mars): (gint#27 ; (Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; ...) || (shoutbox v5 ; v5)
Redcmd Hors ligne Membre Points: 380 Défis: 7 Message

Citer : Posté le 27/01/2020 02:43 | #


When entering the Gray Engine (Tuning) section in GintCLT
The Gray square to the right is flickering (quite badly, needs tuning)
It says Light and Dark in the centre, with the numbers to the side
F1 to F5 buttons are shown at the bottom of the screen
None of the buttons is working at all
I can't control anything
Just have to press restart on the back

How many buffers does the Gray engine use?
what order are they shown on screen and what are the base timings
Lephenixnoir En ligne Administrateur Points: 24145 Défis: 170 Message

Citer : Posté le 27/01/2020 08:08 | #


The Gray square to the right is flickering (quite badly, needs tuning)


The default settings of the gray engine in gintctl are currently values that work on the Graph 35+E II because that's what I've used when testing at the time. I am aware that the display of the Graph 35+E II requires different delays than the others, so this is no problem. I just need to also add delays for other models and everything will work fine.

So you can't go back to the menu with EXIT? Interesting. What model do you have? What hardware is detected in the hardware menu? I am interested in particular in:
MPU type (first line of MPU and CPU)
Amount of ROM and RAM
Clock Generator

Also, are you maybe overclocking your calculator?

How many buffers does the Gray engine use?
what order are they shown on screen and what are the base timings

You can find that in the source code if you want the ultimate details. Here it is.
• There are 4 buffers in total because of double buffering. At every time, there are two buffers being displayed on screen and two being drawn to. Because of the alternating images, the buffers being displayed must be left unchanged until the next frame is ready, thus the need for two full gray VRAMs.
• There is no specific order, the light-black buffer is shown with the short delay and the dark-black with the long delay, that's all.
• The base timings (on the Graph 35+E II) are 762 and 1311, the units are in Pϕ/4 (assuming non overclock), you can derive the delay in seconds frequency from this.

By the way, the name should by GintCTL (CTL stands for Control) instead of GintCLT.
Mon graphe (24 Mars): (gint#27 ; (Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; ...) || (shoutbox v5 ; v5)
Redcmd Hors ligne Membre Points: 380 Défis: 7 Message

Citer : Posté le 27/01/2020 08:40 | #


The default settings of the gray engine in gictclt are currently values that work on the Graph 35+E II...
The gray in GintDemo looks perfect and works 100% straight out the box
But in GintCLT the gray flickers a lot and is filled with vsync lines

So you can't go back to the menu with EXIT?
I've tried pushing every single key, but they all do nothing

What hardware is detected in the hardware menu?
MPU and CPU
SH-4A SHY305

Memory and MMU
-ROM:8M
-RAM:512k (32k user)
-TLB is unified

Clock Generator
-Input freq known
SH7724-style CPG

RTC
-not loaded

Keyboard
-Key scan interface
-Scans at 128Hz

It says backlight supported, but I don't have a backlight

Also, are you maybe overclocking your calculator?
I have never overclocked it
Lephenixnoir En ligne Administrateur Points: 24145 Défis: 170 Message

Citer : Posté le 27/01/2020 08:47 | #


The gray in GintDemo looks perfect and works 100% straight out the box

Yes because gintdemo is older than the Graph 35+E II so the values set in there were suitable for your calculator... don't worry about this...

Well, this is extremely suspicious. This will only get worse when I tell you that the current gray engine is 100% the same as in gintdemo (except for the interrupt handler backing it, but this one works fine). What model is this exactly?
Mon graphe (24 Mars): (gint#27 ; (Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; ...) || (shoutbox v5 ; v5)
Redcmd Hors ligne Membre Points: 380 Défis: 7 Message

Citer : Posté le 27/01/2020 08:54 | #


fx-9750GII
02.04.0201

Précédente 1, 2, 3 ··· 10 ··· 20 ··· 30, 31, 32, 33, 34, 35, 36, 37 ··· 40 ··· 50 ··· 60 ··· 70, 71, 72, 73 Suivante

LienAjouter une imageAjouter une vidéoAjouter un lien vers un profilAjouter du codeCiterAjouter un spoiler(texte affichable/masquable par un clic)Ajouter une barre de progressionItaliqueGrasSoulignéAfficher du texte barréCentréJustifiéPlus petitPlus grandPlus de smileys !
Cliquez pour épingler Cliquez pour détacher Cliquez pour fermer
Alignement de l'image: Redimensionnement de l'image (en pixel):
Afficher la liste des membres
:bow: :cool: :good: :love: ^^
:omg: :fusil: :aie: :argh: :mdr:
:boulet2: :thx: :champ: :whistle: :bounce:
valider
 :)  ;)  :D  :p
 :lol:  8)  :(  :@
 0_0  :oops:  :grr:  :E
 :O  :sry:  :mmm:  :waza:
 :'(  :here:  ^^  >:)

Σ π θ ± α β γ δ Δ σ λ
Veuillez donner la réponse en chiffre
Vous devez activer le Javascript dans votre navigateur pour pouvoir valider ce formulaire.

Si vous n'avez pas volontairement désactivé cette fonctionnalité de votre navigateur, il s'agit probablement d'un bug : contactez l'équipe de Planète Casio.

Planète Casio v4.3 © créé par Neuronix et Muelsaco 2004 - 2024 | Il y a 109 connectés | Nous contacter | Qui sommes-nous ? | Licences et remerciements

Planète Casio est un site communautaire non affilié à Casio. Toute reproduction de Planète Casio, même partielle, est interdite.
Les programmes et autres publications présentes sur Planète Casio restent la propriété de leurs auteurs et peuvent être soumis à des licences ou copyrights.
CASIO est une marque déposée par CASIO Computer Co., Ltd