1 /*---------------------------------------------------------------------------*
2   Project:  TwlSDK - nandApp - tips - banner - TWLBanner-anim1
3   File:     main.c
4 
5   Copyright 2007-2009 Nintendo. All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law. They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Date:: 2009-09-24#$
14   $Rev: 11063 $
15   $Author: okubata_ryoma $
16  *---------------------------------------------------------------------------*/
17 
18 #include <twl.h>
19 #include <DEMO.h>
20 
21 static void InitDEMOSystem();
22 static void InitInteruptSystem();
23 
24 /*---------------------------------------------------------------------------*
25   Name:         TwlMain
26 
27   Description:  Main function.
28 
29   Arguments:    None.
30 
31   Returns:      None.
32  *---------------------------------------------------------------------------*/
TwlMain(void)33 void TwlMain(void)
34 {
35     OS_Init();
36 
37     // When in NITRO mode, stopped by Panic
38     DEMOCheckRunOnTWL();
39 
40     InitInteruptSystem();
41     InitDEMOSystem();
42     OS_Printf("*** start TWLBanner-anim1 demo\n");
43 
44     for (;;)
45     {
46         DEMODrawText( 8, 0, "TWLBanner-anim1 demo");
47         DEMO_DrawFlip();
48         OS_WaitVBlankIntr();
49     }
50     OS_Terminate();
51 }
52 
53 /*---------------------------------------------------------------------------*
54   Name:         InitDEMOSystem
55 
56   Description:  Configures display settings for console screen output.
57 
58   Arguments:    None.
59 
60   Returns:      None.
61  *---------------------------------------------------------------------------*/
InitDEMOSystem()62 static void InitDEMOSystem()
63 {
64     // Initialize screen display
65     DEMOInitCommon();
66     DEMOInitVRAM();
67     DEMOInitDisplayBitmap();
68     DEMOHookConsole();
69     DEMOSetBitmapTextColor(GX_RGBA(31, 31, 0, 1));
70     DEMOSetBitmapGroundColor(DEMO_RGB_CLEAR);
71     DEMOStartDisplay();
72 }
73 
74 /*---------------------------------------------------------------------------*
75   Name:         InitInteruptSystem
76 
77   Description:  Initializes interrupts.
78 
79   Arguments:    None.
80 
81   Returns:      None.
82  *---------------------------------------------------------------------------*/
InitInteruptSystem()83 static void InitInteruptSystem()
84 {
85     (void)OS_EnableIrq();
86     (void)OS_EnableInterrupts();
87 }
88