Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Question on Config block/user_settings
From: Björn Stenberg (bjorn_at_haxx.se)
Date: 2003-04-25


c s wrote:
> is the only requirement that
> the value of a bool variable be zero OR non-zero (as
> opposed to zero OR one).

Yes. True and false is defined as !0 and 0. This is valid for all C code, not just boolean variables.

> Is there an error
> in the settings code or am I missing something?

Looks good to me:

Save - The caption boolean is converted to bit 1 of byte 0xAE:

    config_block[0xae] = (unsigned char)
        ((global_settings.fade_on_stop & 1) |
         ((global_settings.caption_backlight & 1) << 1));

Load - Bit 1 of byte 0xAE is converted to the caption boolean:

        global_settings.caption_backlight = config_block[0xae] & 2;

-- 
Björn



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa