dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Re: Question on Config block/user_settings

Re: Question on Config block/user_settings

From: Björn Stenberg <>
Date: Fri, 25 Apr 2003 09:33:41 +0200

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;

Received on 2003-04-25

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy