1 /*---------------------------------------------------------------------------*
2 Project: TwlSDK - nandApp - tips - banner - NTRBanner
3 File: main.c
4
5 Copyright 2007-2008 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-02-06#$
14 $Rev: 9986 $
15 $Author: yosizaki $
16 *---------------------------------------------------------------------------*/
17
18 #include <nitro.h>
19 #include <DEMO.h>
20
21 static void InitDEMOSystem();
22 static void InitInteruptSystem();
23
24 /*---------------------------------------------------------------------------*
25 Name: NitroMain
26
27 Description: Main function.
28
29 Arguments: None.
30
31 Returns: None.
32 *---------------------------------------------------------------------------*/
NitroMain(void)33 void NitroMain(void)
34 {
35 OS_Init();
36 InitInteruptSystem();
37 InitDEMOSystem();
38 OS_Printf("*** start NTRBanner demo\n");
39
40 for (;;)
41 {
42 DEMODrawText( 8, 0, "NTRBanner demo");
43 DEMO_DrawFlip();
44 OS_WaitVBlankIntr();
45 }
46 OS_Terminate();
47 }
48
49 /*---------------------------------------------------------------------------*
50 Name: InitDEMOSystem
51
52 Description: Configures display settings for console screen output.
53
54 Arguments: None.
55
56 Returns: None.
57 *---------------------------------------------------------------------------*/
InitDEMOSystem()58 static void InitDEMOSystem()
59 {
60 // Initialize screen display
61 DEMOInitCommon();
62 DEMOInitVRAM();
63 DEMOInitDisplayBitmap();
64 DEMOHookConsole();
65 DEMOSetBitmapTextColor(GX_RGBA(31, 31, 0, 1));
66 DEMOSetBitmapGroundColor(DEMO_RGB_CLEAR);
67 DEMOStartDisplay();
68 }
69
70 /*---------------------------------------------------------------------------*
71 Name: InitInteruptSystem
72
73 Description: Initializes interrupts.
74
75 Arguments: None.
76
77 Returns: None.
78 *---------------------------------------------------------------------------*/
InitInteruptSystem()79 static void InitInteruptSystem()
80 {
81 (void)OS_EnableIrq();
82 (void)OS_EnableInterrupts();
83 }
84