> 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)

Well, I'll explain. If you want to set-reset certain bits then you can use
the SET and RES-instructions.
But if you want to (re)set multiple bits, then those are very slow. In that
case it's easier to use AND and OR.

AND %11011111 resets bit 5
OR %01001100 sets bits 6, 2 and 3

AND %10101111 resets bit 6 and 4
OR %00000011 sets bits 0 and 1.

If you check out some joystickport-docs (about PSG-registers 14-15) then you
will find that these indeed are the correct values which have to be written.

Didn't you know 'bout this use of OR and AND yet???


~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/)
****

Reply via email to