Bha le voila mais il est pas encore finit
(pour l'instant il suffit d'appuyer sur alpha pour que la calcu s'éteigne)
;========================ALPHA MODE=============================
.NOLIST
#define equ .equ
#define EQU .equ
#define end .end
.LIST
.org 9327h
di ;disable interrupts (don't want an interrupt before we're ready)
ld hl,$9900 ;start of interrupt table
ld de,$9901 ;start of interrupt table +1
ld bc,256 ;257 - 1 bytes to copy
ld (hl),$9a ;load $9a into (hl)
ldir ;ld (hl) into (de), inc hl and de, ld (hl) into (de)...
;now you have a 257 byte table starting at $9900 filled with $9a
ld hl,interrupt_start ;\
ld de,$9a9a ; | copy interrupt routine to $9a9a
ld bc,interrupt_end-interrupt_start ; |
ldir ;/
ld a,$99
ld i,a ;load $99 into I
im 2 ;switch to mode 2
ei ;enable interrupts
interrupt_start:
exx ;swap registers...
ex af,af' ;swap registers...
ld a,$ff ;\
out (1),a ; |
ld a,$df ; |hopefully you understand direct input
out (1),a ; |
in a,(1) ;/
bit 7,a ;si le bit 7 est zero, ALPHA est pressé
jr nz,interrupt_done ;si ALPHA n'est pas pressé, on va à interrupt_done
;sinon, on éteint la ti
di ; disable interrupts
ld a,001h
out (003h),A ; turn off screen
ld A,000H
out (004H),A
ex af,af'
exx
ei ; enable interrupts
interrupt_done:
exx ;swap registers back
ex af,af' ;swap registers back
jp $0038 ;go to normal interrupt routine
interrupt_end:
.end
END
En vérité je sais pas si ca marche : la fonction pour éteindre la calcu ne marche pas sous vti (mais je pense que c'est uniquement du à l'émulateur, j'avais deja repéré ca avant).
Et puis il y a un truc qui me semble assez bizarre, ce sont les 2 lignes lorsqu'on rallume la calcu, pourquoi aurait on besoin de changer les registres ?? (t'as pas une idée) :
ex af,af'
exx