Problème connu, ça fait longtemps qu'on a corrigé ça dans
TIGCC. Voilà le code utilisé dans
tipatch.lib pour la détection de modèle:
| Get the address of the jump table (needed a few times).
| Note that calling a function will destroy %a0; be sure to check whether
| this is still valid for screen-saving support whenever you make a change in
| between.
move.l 0xC8,%a0
/* Calculator Detection */
| At first, assume TI-92 Plus.
| It takes less space to write the values into %d0 first and then check whether they are correct.
moveq #1,%d0
| Move the address of the jump table to %d1.
move.l %a0,%d1
and.l #0x400000,%d1
| Now %d1 is 0 on a TI-89 or V200, or 0x400000 on a TI-92+.
jbne __calc_in_d0__
| Otherwise, assume TI-89.
clr.w %d0
| Get the address of the ScrRect variable into a1.
move.l (%a0,0x2F*4),%a1 /* ScrRect */
| If ScrRect+2 (x2) is less than 200, it is a TI-89.
cmp.b #200,2(%a1)
jbcs __calc_in_d0__
| Otherwise, it is a V200.
moveq #3,%d0
__calc_in_d0__:
Ce code met les valeurs suivantes dans
d0:
valeur | calculatrice détectée
-------+----------------------
0 | TI-89
1 | TI-92+
3 | Voyage 200
(La valeur 2 est réservée pour les TI-92 simples au cas où des versions futures de
TIGCC et/ou
PreOs - les codes de modèle sont mis en commun pour les 2 projets - les supportent.)