J'ai corrigé la routine:
;detect the hardware version
;Thanks to Julien Muchembled for the C version listed in the TI-GCC FAQ.
;Converted to assembly by Kevin Kofler
GetHardModel:
move.l ($c8).w,d0
andi.l #$600000,d0 ;get the ROM base
movea.l d0,a0
moveq.l #1,d0
movea.l 260(a0),a1 ;get the pointer to the hardware parameter block
adda.l #$10000,a0
cmpa.l a0,a1 ;check if the hardware parameter block is near enough
bcc.s hw1 ;if it is too far, it is HW1
cmpi.w #22,(a1) ;check if the parameter block contains the hardware version
bls.s hw1 ;if it is too small, it is HW1
move.l 22(a1),d0 ;check the hardware version
hw1:
rts
;end of hardware version detection routine
pour qu'elle puisse retourner autre chose que 1 ou 2, en vue de
cela. (C'est aussi plus court. J'aurais dû mettre ça tout de suite.)
[edit]Edité par Kevin Kofler le 05-01-2002 à 22:13:23[/edit]