Re: [hatari-users] Minor Problems with Falcon Emulation (joypad issue) |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-users Archives
]
Hi,
On lauantai 09 elokuu 2014, Eero Tamminen wrote:
> On lauantai 09 elokuu 2014, Thomas Huth wrote:
> > schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:
> > > I don't know how they're supposed to work, but code for
> > > PAD A in Hatari looks buggy[1]. Does the attached patch fix
> > > your problem?
> >
> > That code looks really wrong, I think your patch is right, Eero.
> > It should be ok to commit it.
>
> Commited. Any comments on the Joy_StePadMulti_ReadWord() code,
> do you know how it should work and does it look correct?
>
> (masks used for nData between joy A & B look suspicious.)
I mean, stuff like this:
--------------------------------------
Uint8 nData = 0xff;
....
nData &= 0xf0;
....
nData |= ~<value> & 0x0f;
....
nData &= 0x0f; <==
....
nData |= ~<value> & 0x0f; <==
....
IoMem_WriteWord(0xff9202, (nData << 8) | 0x0ff);
--------------------------------------
At least I would use Uint16 for "<< 8".
And:
-----------------
else if (!(nSteJoySelect & 0x2))
{
nData |= ~(Joy_GetFireButtons(JOYID_STEPADA) >> 13) & 0x0f;
-----------------
-> This will have effect only with buttons 14 - 17...
- Eero