TwlIPL/build/systemMenu_tools/SystemUpdaterRegionSelect/ARM9.TWL/src/fade.c
kamikawa cd59bcdbfb SystemUpdaterRegionSelectの追加
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2562 b08762b0-b915-fc4b-9d8c-17b2551a87ff
2008-10-01 05:03:34 +00:00

78 lines
2.0 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*---------------------------------------------------------------------------*
Project: TwlSDK - NandInitializer
File: fade.c
Copyright 2008 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
Company Ltd., and are protected by Federal copyright law. They may
not be disclosed to third parties or copied or duplicated in any form,
in whole or in part, without the prior written consent of Nintendo.
$Date:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#include <twl.h>
#include "kami_global.h"
/*---------------------------------------------------------------------------*
è<E28099>è`
*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*
“à•”•Ï<E280A2>è`
*---------------------------------------------------------------------------*/
static int brightness = 0;
static int master_brightness = -16;
static int counter;
/*---------------------------------------------------------------------------*
“à•”ŠÖ<C5A0>è`
*---------------------------------------------------------------------------*/
BOOL FadeOutTick(void)
{
if ( brightness < 16)
{
// if (++counter == 2)
// {
counter = 0;
G2_SetBlendBrightness( GX_BLEND_PLANEMASK_BG0 | GX_BLEND_PLANEMASK_BG1, ++brightness );
// }
return FALSE;
}
return TRUE;
}
BOOL FadeInTick(void)
{
if ( brightness > 0)
{
// if (++counter == 2)
// {
counter = 0;
G2_SetBlendBrightness( GX_BLEND_PLANEMASK_BG0 | GX_BLEND_PLANEMASK_BG1, --brightness );
// }
return FALSE;
}
return TRUE;
}
BOOL FadeInMaster(void)
{
if ( master_brightness < 0)
{
if (++counter == 2)
{
counter = 0;
GX_SetMasterBrightness( ++master_brightness );
}
return FALSE;
}
return TRUE;
}