/[projet1]/public/oric/demos/SlideShowDemo/code/main.c
Defence Force logotype

Contents of /public/oric/demos/SlideShowDemo/code/main.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1045 - (show annotations)
Fri Dec 20 17:42:53 2013 UTC (5 years, 10 months ago) by dbug
File MIME type: text/plain
File size: 3428 byte(s)
Floppy Builder 0.11
- Added support for metadata that can be used later on by the programmer
Also modified Link65 to handle #include correctly in assembler source files
The SlideShow now correctly displays the name of the pictures and their authors from the exported metadata (Still need transitions)

1 //
2 // This program simply display a picture on the hires screen
3 //
4 #include <lib.h>
5
6 #include "floppy_description.h"
7
8 // irq.s
9 extern void System_InstallIRQ_SimpleVbl();
10 extern void VSync();
11 extern void Stop();
12
13 // player.s
14 extern unsigned char MusicLooped;
15 extern Mym_Initialize();
16 extern Mym_ReInitialize();
17
18 // transitions.s
19 extern unsigned char PictureLoadBuffer[];
20 extern void PictureTransitionFromTopAndBottom();
21 extern void PictureTransitionVenicianStore();
22 extern void PictureTransitionUnroll();
23
24 extern void PictureDoTransition();
25
26 extern void PrintDescription();
27
28
29 extern void InitTransitionData();
30
31 // scroller.s
32 extern unsigned char FontBuffer[];
33
34
35 // loader_api.s
36 extern unsigned char LoaderApiEntryIndex;
37 extern unsigned char LoaderApiAddressLow;
38 extern unsigned char LoaderApiAddressHigh;
39 extern void* LoaderApiAddress;
40
41 extern void SetLoadAddress();
42 extern void LoadFile();
43
44 void Pause()
45 {
46 int i;
47 for (i=0;i<50*5;i++)
48 {
49 VSync();
50 }
51 }
52
53 extern void Player_SetMusic_Birthday();
54
55 unsigned char CurrentMusic=LOADER_FIRST_MUSIC;
56
57 /*
58 void PrintDescription(const char* author,const char* name)
59 {
60 char* textLine;
61
62 textLine=(char*)0xbb80+40*25;
63 memset(textLine,32,40);
64
65 memcpy(textLine,author,strlen(author));
66 memcpy(textLine+20,name,strlen(name));
67 }
68 */
69
70 void main()
71 {
72 int y;
73 if (!is_overlay_enabled())
74 {
75 hires();
76 }
77 MusicLooped=1;
78
79 // Load the 6x8 font
80 LoaderApiEntryIndex=LOADER_FONT_6x8_ARTDECO;
81 LoadFile();
82
83 // Some basic inits
84 InitTransitionData();
85
86 System_InstallIRQ_SimpleVbl();
87
88 // Load and play the music
89 LoaderApiEntryIndex=LOADER_FIRST_MUSIC+2;
90 LoadFile();
91 Mym_ReInitialize();
92
93 // Load the font
94 LoaderApiEntryIndex=LOADER_FONT_24x20;
95 LoaderApiAddress=FontBuffer;
96 SetLoadAddress();
97 LoadFile();
98
99 /*
100 // Test load compressed file
101 LoaderApiEntryIndex=LOADER_COMPRESSED_TEST;
102 LoaderApiAddress=PictureLoadBuffer+8;
103 SetLoadAddress();
104 LoadFile();
105
106 PictureLoadBuffer[0]='L';
107 PictureLoadBuffer[1]='Z';
108 PictureLoadBuffer[2]='7';
109 PictureLoadBuffer[3]='7';
110 *((int*)(PictureLoadBuffer+4))=8000; // Src size
111 *((int*)(PictureLoadBuffer+6))=8000; // Dst size
112
113 Stop();
114 file_unpack((unsigned char*)0xa000,PictureLoadBuffer);
115 */
116
117
118 while (1)
119 {
120 /*
121 if (MusicLooped)
122 {
123 poke(0xbb80+40*25,16 | ((peek(0xbb80+40*25)+1)&7) );
124 //MusicPlaying=1;
125 if ( (CurrentMusic<LOADER_FIRST_MUSIC) || (CurrentMusic>=LOADER_LAST_MUSIC) )
126 {
127 CurrentMusic=LOADER_FIRST_MUSIC;
128 }
129 LoaderApiEntryIndex=CurrentMusic;
130 LoadFile();
131 Mym_ReInitialize();
132 ++CurrentMusic;
133 }
134 */
135
136 for (LoaderApiEntryIndex=LOADER_FIRST_PICTURE;LoaderApiEntryIndex<LOADER_LAST_PICTURE;LoaderApiEntryIndex++)
137 {
138 LoaderApiAddress=PictureLoadBuffer;
139 SetLoadAddress();
140 LoadFile();
141
142 //memcpy((unsigned char*)0xa000,PictureLoadBuffer,8000);
143 //PictureTransitionFromTopAndBottom();
144 //PictureTransitionVenicianStore();
145 //PictureTransitionUnroll();
146 //PrintDescription("Twilighte","Barbitoric");
147 PrintDescription();
148 PictureDoTransition();
149
150 Pause();
151 }
152
153 /*
154 for (LoaderApiEntryIndex=LOADER_FIRST_MUSIC;LoaderApiEntryIndex<LOADER_LAST_MUSIC;LoaderApiEntryIndex++)
155 {
156 LoadFile();
157 Mym_Initialize();
158 //Pause();
159 }
160 */
161 VSync();
162 }
163
164 //memset((unsigned char*)0xa000,0,8000);
165 }
166
167
168
169

  ViewVC Help
Powered by ViewVC 1.1.26