Mail Archives: djgpp/1998/02/26/18:27:36
Este es un mensaje multipartes en formato MIME.
--------------71F65E5D4D64
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I want this little code can help you. It's for Turbo C, but i suppose
it's easy to convert to Djgpp.
--------------71F65E5D4D64
Content-Type: text/plain; charset=us-ascii; name="Testjoy.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="Testjoy.c"
/**************************************************************/
/* TESTYOY Muestra en pantalla los valores X, Y del joy y el */
/* estado de los pulsadores */
/* Mariano Alvarez 1990 */
/**************************************************************/
#include <stdio.h>
#include <dos.h>
#include <conio.h>
main()
{
int x, y, boton1, boton2, botones, c;
while( ! kbhit() ){
_AH = 0x84;
_DX = 1;
geninterrupt( 0x15 );
x = _AX;
y = _BX;
_AH = 0x84;
_DX = 0;
geninterrupt( 0x15 );
botones = _AL;
boton1 = (botones & 16) ? 1 : 0;
boton2 = (botones & 32) ? 1 : 0;
printf( "%6i %6i %6i %6i\n",x,y,boton1,boton2 );
delay( 100 );
}
c = getch();
}
--------------71F65E5D4D64--
- Raw text -