Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uakari.primate.wisc.edu!dali.cs.montana.edu!milton!hlab From: galt@hellgate.utah.edu (Greg Alt) Newsgroups: sci.virtual-worlds Subject: Re: Power Glove Message-ID: <1991May21.220510.22992@milton.u.washington.edu> Date: 21 May 91 04:00:30 GMT References: <1991May19.224708.19251@milton.u.washington.edu> Sender: hlab@milton.u.washington.edu (Human Int. Technology Lab) Organization: University of Utah, CS Dept., Salt Lake City Lines: 39 Approved: cyberoid@milton.u.washington.edu > [Moderator(Mark): I have requested the author's source code-- > I will post it as soon as I receive it.] ok, here it is: #include main() { int b,x; while(1) { outportb(0x378,1); outportb(0x378,3); outportb(0x378,1); for(b=x=0;x<8;x++) { b=b<<1; b+=(inportb(0x379)&16)>>4; outportb(0x378,0); outportb(0x378,1); } b^=255; gotoxy(1,1); printf("%d%d%d%d%d%d%d%d\n",(b&128)>>7,(b&64)>>6,(b&32)>>5, (b&16)>>4,(b&8)>>3,(b&4)>>2,(b&2)>>1,b&1); } } It's exactly the same as the assembly code shown in the BYTE article, but I figured it would be much simpler to do it in C. The final value from the glove is in b at the end of the loop. You can change this to a simple function like: char powerglove() { . [Moderator(Mark): Is this the end, or a mailer glitch?]