> >I still don't understand the AND/OR values for reading joystick status
from
> >the Portar documentation ?!?!???!?!??? ? ?!?!?!? ?!??!?!?:
> >
> >This rotine will read joystick 1 or 2:
> >F3 di
> >3E 0F ld a,0fh Write this for Write this for
> >D3 A0 out (0a0h),a Joystick port 1: Joystick port 2:
> >DB A2 in a,(0a2h)
> >E6 DF / E6 AF and 11011111b; 0DFh and 10101111b; 0AFh
> >F6 4C / F6 03 or 01001100b; 04Ch or 00000011b; 003h
> >D3 A1 out (0a1h),a
> >3E 0E ld a,0eh
> >D3 A0 out (0a0h),a
> >DB A2 in a,(0a2h)
>
> I lost the reply someone (Laurens?) did to my message. It was stated the
> utility of AND/OR againt multiple BIT/SET instead of the actual meaning of
> the bit salad regarding joystick reading.
>
> I of course know the AND/OR vs BIT/SET! I was poking Z80 opcodes right in
> 1984 when the rest of the classroom was learning "present continuous"! 8:D
You seem normal once again!
> I wanted to know the reason of these values. According to the Portar doc
it
> should be enough to toggle the joystick select line. The lower bits seem
to
> be for touchpad handshaking and all 4 should be "1". The AND instruction
> also wipes another bit apart from joystick select.
>
> I've been using this routine blindly for some time and it works, but I'd
> like to know exactly the electrical reasons behind the process.
**sigh** okay I'll explain...
By the way, the AND and ORs you say belong to port 2 belong to port 1. You
accidentally (I hope?)swapped them.
Well, bit 6 is used as port select for register 14. (1=port 2, 0=port 1)
Bit 0, 1 and 4 correspond to pins 6, 7 and 8 of port 1
Bit 2, 3 and 5 correspond to pins 6, 7 and 8 of port 2
Well, here are the reasons why they are set: officially, the joystick only
works when pin 8 is 0. So the joystick-routines set the pin to 0. Further,
pins 6 and 7 only give input as long as the output is 1. So in order to read
pins 6 and 7 they first set them. Ofcourse this won't have to be done
everytime, but if they for example don't set bits 6 and 7 then if some nerdo
changes bits 6 and 7 into 0 the buttons can't be read anymore until the next
reset.
Well that's the reason.
By the way, the joystickroutines on the interrupt also (re)set those pins,
unfortunatly. And that is stupid because therefor JoyNet can't function with
the normal interrupt enabled.
~Grauw
--
>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<
email me: [EMAIL PROTECTED] or ICQ: 10196372
visit the Datax homepage at http://datax.cjb.net/
MSX fair Bussum / MSX Marathon homepage: http://msxfair.cjb.net/
>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<
****
MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)
****