1 /*---------------------------------------------------------------------------*
2 Project: TwlSDK - OS
3 File: os_attentionLimitedChina.c
4
5 Copyright 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-06-04#$
14 $Rev: 10698 $
15 $Author: okubata_ryoma $
16 *---------------------------------------------------------------------------*/
17
18 #include <os_attention.h>
19 #include <nitro/os/common/interrupt.h>
20
21 #ifdef SDK_TWLLTD
22
23
24 /*---------------------------------------------------------------------------*
25 * Function Declarations
26 *---------------------------------------------------------------------------*/
27 static u8* OSi_LoadImageChina(IMAGE_OBJ_INDEX index, u32 *p_size);
28 extern void OSi_WaitVBlank(void);
29 extern void OSi_VBlankIntr(void);
30 extern void OSi_PrepareAttention(void);
31 extern void OSi_ShowAttention(void);
32
33
34
35 /*---------------------------------------------------------------------------*
36 Name: OSi_LoadImage
37
38 Description: Loads an image file (provisional). NOTE: This function actually just returns a pointer.
39
40 Arguments: index: Index to the file to load
41 p_size: Pointer to u32 that stores the file size
42 If not needed, specify NULL, and it will be ignored.
43
44 Returns: Returns the starting address of the image data.
45 *---------------------------------------------------------------------------*/
OSi_LoadImageChina(IMAGE_OBJ_INDEX index,u32 * p_size)46 static u8 *OSi_LoadImageChina(IMAGE_OBJ_INDEX index, u32 *p_size)
47 {
48 extern u8 _binary_attention_limited_china_01nbfc_bin[];
49 extern u8 _binary_attention_limited_china_01nbfc_bin_end[];
50 extern u8 _binary_attention_limited_china_01nbfs_bin[];
51 extern u8 _binary_attention_limited_china_01nbfs_bin_end[];
52 extern u8 _binary_attention_limited_china_02nbfc_bin[];
53 extern u8 _binary_attention_limited_china_02nbfc_bin_end[];
54 extern u8 _binary_attention_limited_china_02nbfs_bin[];
55 extern u8 _binary_attention_limited_china_02nbfs_bin_end[];
56 extern u8 _binary_attention_limited_nbfp_bin[];
57 extern u8 _binary_attention_limited_nbfp_bin_end[];
58
59 static u8 *ptr_table[IMAGE_OBJ_NUM] =
60 {
61 _binary_attention_limited_china_01nbfc_bin,
62 _binary_attention_limited_china_01nbfs_bin,
63 _binary_attention_limited_china_02nbfc_bin,
64 _binary_attention_limited_china_02nbfs_bin,
65 _binary_attention_limited_nbfp_bin
66 };
67
68 static u8 *ptr_end_table[IMAGE_OBJ_NUM] =
69 {
70 _binary_attention_limited_china_01nbfc_bin_end,
71 _binary_attention_limited_china_01nbfs_bin_end,
72 _binary_attention_limited_china_02nbfc_bin_end,
73 _binary_attention_limited_china_02nbfs_bin_end,
74 _binary_attention_limited_nbfp_bin_end
75 };
76
77 if(p_size)
78 {
79 *p_size = (u32)(ptr_end_table[index] - ptr_table[index]);
80 }
81
82 return (u8 *)ptr_table[index];
83 }
84
85 /*---------------------------------------------------------------------------*
86 Name: OS_ShowAttentionOfLimitedRomChina
87
88 Description: Displays notice for running in limited mode on NITRO for China.
89
90 Arguments: None.
91
92 Returns: None.
93 *---------------------------------------------------------------------------*/
OS_ShowAttentionOfLimitedRomChina(void)94 SDK_WEAK_SYMBOL void OS_ShowAttentionOfLimitedRomChina(void)
95 {
96 /* Preparation */
97 OSi_PrepareAttention();
98
99 /* Load image data */
100 {
101 u32 plt_size;
102 void const *data_plt = OSi_LoadImageChina(IMAGE_OBJ_PAL, &plt_size);
103 void const *data_01_chr = OSi_LoadImageChina(IMAGE_OBJ_01_CHR, NULL);
104 void const *data_01_scr = OSi_LoadImageChina(IMAGE_OBJ_01_SCR, NULL);
105 void const *data_02_chr = OSi_LoadImageChina(IMAGE_OBJ_02_CHR, NULL);
106 void const *data_02_scr = OSi_LoadImageChina(IMAGE_OBJ_02_SCR, NULL);
107
108 /* Load data for the upper screen into VRAM-A */
109 MI_UncompressLZ16(data_01_chr, (u32 *)HW_BG_VRAM);
110 MI_UncompressLZ16(data_01_scr, (u32 *)(HW_BG_VRAM + 0xf000));
111
112 /* Load data for the lower screen into VRAM-C */
113 MI_UncompressLZ16(data_02_chr, (u32 *)HW_DB_BG_VRAM);
114 MI_UncompressLZ16(data_02_scr, (u32 *)(HW_DB_BG_VRAM + 0xf000));
115
116 /* Load palette data into standard palette ROM */
117 SVC_CpuCopyFast(data_plt, (u32 *)(HW_BG_PLTT), plt_size);
118 SVC_CpuCopyFast(data_plt, (u32 *)(HW_DB_BG_PLTT), plt_size);
119 }
120
121 /* Display (Note: This will loop) */
122 OSi_ShowAttention();
123 }
124
125
126 #endif // #ifdef SDK_TWLLTD
127 /*---------------------------------------------------------------------------*
128 End of file
129 *---------------------------------------------------------------------------*/
130