[hatari-devel] Falcon emu and STE compatibility (D-Bug games)
Eero Tamminen
oak at helsinkinet.fi
Sun Feb 20 23:18:25 CET 2011
Hi,
On sunnuntai 20 helmikuu 2011, Laurent Sallafranque wrote:
> > Pretty much well done now ... it's just a little bit confusing that
> > the
>
> STE mode is activated when "isFalconInSteMode" is false... when I read
> the code I would rather expect isFalconInSteMode == true would mean
> that the STE mode is activated...
>
>
> Yes, I thought about it. As the Ste compatibility mode is activated when
> the bit = 0, I've kept the same behaviour for the variable. But like
> you, I think it can be confusing.
> If you ask for, I change it.
-------
static Uint8 falconBusMode; /* Falcon bus mode
(0=STe compatible bus; 1= Falcon bus) */
...
if (falconBusMode == 0) {
--------
No magic variables, please. If it's bool, use true & false and variable
name where it's clear what true means, with non-bools like above, please use
enums for the names of the possible states.
For example:
---------
static enum {
FALCON_BUS_STE,
FALCON_BUS_16MHZ
} falconBusMode;
----------
(C++ and maybe GCC too check that one doesn't try to put wrong values to
enums.)
- Eero
More information about the hatari-devel
mailing list