1 /*---------------------------------------------------------------------------*
2 Project: TwlSDK - MB - demos - cloneboot
3 File: main.c
4
5 Copyright 2005-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-03-02#$
14 $Rev: 10122 $
15 $Author: kitase_hirotake $
16 *---------------------------------------------------------------------------*/
17
18 #ifdef SDK_TWL
19 #include <twl.h>
20 #else
21 #include <nitro.h>
22 #endif
23
24 #include "common.h"
25
26 /*
27 * Sample application that implements clone booting.
28 *
29 * Because the MB library samples use the multiboot functionality, multiple development units with the same communications environment (wired or wireless) are required.
30 *
31 * The mb_child_NITRO.srl and mb_child_TWL.srl programs in the directory $TwlSDK/bin/ARM9-TS/Rom/ are samples providing the same features as the multiboot child in the final commercial unit. Load these binaries into other development units using the same method as for sample programs, and execute them together.
32 *
33 *
34 *
35 *
36 *
37 */
38
39 /******************************************************************************/
40
41
42
43 //============================================================================
44 // Function Definitions
45 //============================================================================
46
47 /*---------------------------------------------------------------------------*
48 Name: NitroMain / TwlMain
49
50 Description: Main routine.
51
52 Arguments: None.
53
54 Returns: None.
55 *---------------------------------------------------------------------------*/
56 #ifdef SDK_TWL
TwlMain(void)57 void TwlMain(void)
58 #else
59 void NitroMain(void)
60 #endif
61 {
62 /*
63 * This sample uses the multiboot-Model sample demo unchanged and simply divides processing by determining whether this is a DS Download Play child program.
64 *
65 *
66 *
67 * The following are primary differences between the parent and child environments when clone booting.
68 * 1. A child does not have card access
69 * 2. You must include 8 KB or less of code specific to the parent
70 * 3. Parents and children use different wireless communications procedures
71 *
72 *
73 * If you heed these points and handle them with wrapper processes that match your application design, you can create an efficient program that keeps most content common between parents and children, supports both single-player and versus play, and conserves CARD-ROM memory usage.
74 * Conversely, if there are absolutely no commonalities between the parent and children in DS Download Play, it will probably not be possible to achieve the aforementioned benefits.
75 *
76 *
77 *
78 */
79 if (!MB_IsMultiBootChild())
80 {
81 ParentMain();
82 }
83 else
84 {
85 ChildMain();
86 }
87
88 /* Control should not arrive here */
89 }
90