1 /*---------------------------------------------------------------------------*
2 Project: Dolphin DVD fatal error demo
3 File: dvdfatal.c
4
5 Copyright 2002 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 $Log: dvdfatal.c,v $
14 Revision 1.2 02/20/2006 04:13:09 mitu
15 changed include path from dolphin/ to revolution/.
16
17 Revision 1.1 2006/01/17 02:43:50 hiratsu
18 Initial check in.
19
20
21 1 8/20/02 21:52 Shiki
22 Initial check-in.
23
24 $NoKeywords: $
25 *---------------------------------------------------------------------------*/
26
27 #include <revolution.h>
28
29 // The name of the file we are going to read.
30 const char* Filename = "texts/test1.txt";
31
main(void)32 void main(void)
33 {
34 DVDFileInfo fileInfo;
35 u32 fileSize;
36
37 VIInit();
38 DVDInit();
39
40 OSReport("Activate the disc fatal error to see the default disc fatal screen.\n");
41
42 DVDSetAutoFatalMessaging(TRUE);
43
44 for (;;)
45 {
46 // We MUST open the file before accessing the file
47 if (FALSE == DVDOpen(Filename, &fileInfo))
48 {
49 OSHalt("Cannot open file");
50 }
51
52 // Get the size of the file
53 fileSize = DVDGetLength(&fileInfo);
54
55 // read the entire file here
56 if (0 > DVDRead(&fileInfo, OSGetArenaLo(), (s32)OSRoundUp32B(fileSize), 0))
57 {
58 OSHalt("Error occurred when reading file");
59 }
60
61 // Close the file
62 DVDClose(&fileInfo);
63
64 VIWaitForRetrace();
65 }
66 // NOT REACHED HERE
67 }
68