/[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 1050 - (show annotations)
Sun Dec 22 17:05:37 2013 UTC (5 years, 11 months ago) by dbug
File MIME type: text/plain
File size: 3479 byte(s)
Adding a scroller, currently in the screen area but needs to move to the text zone
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 extern void ScrollerInit();
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 ScrollerInit();
89
90 // Load and play the music
91 LoaderApiEntryIndex=LOADER_FIRST_MUSIC+2;
92 LoadFile();
93 Mym_ReInitialize();
94
95 // Load the font
96 LoaderApiEntryIndex=LOADER_FONT_16x16;
97 LoaderApiAddress=FontBuffer;
98 SetLoadAddress();
99 LoadFile();
100
101 /*
102 // Test load compressed file
103 LoaderApiEntryIndex=LOADER_COMPRESSED_TEST;
104 LoaderApiAddress=PictureLoadBuffer+8;
105 SetLoadAddress();
106 LoadFile();
107
108 PictureLoadBuffer[0]='L';
109 PictureLoadBuffer[1]='Z';
110 PictureLoadBuffer[2]='7';
111 PictureLoadBuffer[3]='7';
112 *((int*)(PictureLoadBuffer+4))=8000; // Src size
113 *((int*)(PictureLoadBuffer+6))=8000; // Dst size
114
115 Stop();
116 file_unpack((unsigned char*)0xa000,PictureLoadBuffer);
117 */
118
119
120 while (1)
121 {
122 /*
123 if (MusicLooped)
124 {
125 poke(0xbb80+40*25,16 | ((peek(0xbb80+40*25)+1)&7) );
126 //MusicPlaying=1;
127 if ( (CurrentMusic<LOADER_FIRST_MUSIC) || (CurrentMusic>=LOADER_LAST_MUSIC) )
128 {
129 CurrentMusic=LOADER_FIRST_MUSIC;
130 }
131 LoaderApiEntryIndex=CurrentMusic;
132 LoadFile();
133 Mym_ReInitialize();
134 ++CurrentMusic;
135 }
136 */
137
138 for (LoaderApiEntryIndex=LOADER_FIRST_PICTURE;LoaderApiEntryIndex<LOADER_LAST_PICTURE;LoaderApiEntryIndex++)
139 {
140 LoaderApiAddress=PictureLoadBuffer;
141 SetLoadAddress();
142 LoadFile();
143
144 //memcpy((unsigned char*)0xa000,PictureLoadBuffer,8000);
145 //PictureTransitionFromTopAndBottom();
146 //PictureTransitionVenicianStore();
147 //PictureTransitionUnroll();
148 //PrintDescription("Twilighte","Barbitoric");
149 //PrintDescription();
150 PictureDoTransition();
151
152 Pause();
153 }
154
155 /*
156 for (LoaderApiEntryIndex=LOADER_FIRST_MUSIC;LoaderApiEntryIndex<LOADER_LAST_MUSIC;LoaderApiEntryIndex++)
157 {
158 LoadFile();
159 Mym_Initialize();
160 //Pause();
161 }
162 */
163 VSync();
164 }
165
166 //memset((unsigned char*)0xa000,0,8000);
167 }
168
169
170
171

  ViewVC Help
Powered by ViewVC 1.1.26