Fermer2
ContraLe 05/03/2011 à 22:28
Bonjour,

Je n'arrive pas à scanner 2 groupes de touches différents avec direct input...

Dans un premier fichier je scanne les flèches :
[code]
ld a,$FF ; Before any action, reset the keyport
out (1),a ; ...by sending to the port 1 the value 255 (FF
ld a,$FE ; select the keyboard group to scan (here the arrow keys)
out (1),a ; ...by sending to the keyboard port (1) the value FE.
in a,(1) ; Get the port value, which says wich keys was pressed
cp 254 ;\
jp z,bot ;|
cp 253 ;| Look for the key which was pressed and jump to the correct label.
jp z,left ;|
cp 251 ;|
jp z,right ;|
cp 247 ;|
jp z,top ;/
[/code]

Jusque là tout marche bien ...

Et dans ma seconde macro, lorsque je fais :
ld a,$FF
out (1),a
ld a,$FD ; ici je n'arrive pas a scanner un autre keyport
out (1),a
in a,(1)
bit 0,a
;cp 254
jp z, drop_bomb
[/code]

Ca ne scanne pas le bouton enter...

Par contre si je mets le meme groupe $FE au lieu de $FD, bah ça marche...
Je ne comprends vraiment pas ce qui empêche de faire marcher ce direct input sachant que a est mis à FF avant et le port est bien reset également... ?!

Quelqu'un a une idée?

Merci d'avance.

Thibault