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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1049 - (hide annotations)
Sun Dec 22 13:42:11 2013 UTC (5 years, 11 months ago) by dbug
File MIME type: text/plain
File size: 3432 byte(s)
Added an asynchronous picture description, looks much more dynamic now.
1 dbug 1015 //
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 dbug 1038 extern void Stop();
12 dbug 1015
13     // player.s
14     extern unsigned char MusicLooped;
15     extern Mym_Initialize();
16     extern Mym_ReInitialize();
17    
18 dbug 1024 // transitions.s
19     extern unsigned char PictureLoadBuffer[];
20     extern void PictureTransitionFromTopAndBottom();
21 dbug 1045 extern void PictureTransitionVenicianStore();
22     extern void PictureTransitionUnroll();
23 dbug 1024
24 dbug 1045 extern void PictureDoTransition();
25    
26 dbug 1049 //extern void PrintDescription();
27 dbug 1045
28    
29     extern void InitTransitionData();
30    
31 dbug 1024 // scroller.s
32     extern unsigned char FontBuffer[];
33    
34    
35 dbug 1015 // loader_api.s
36     extern unsigned char LoaderApiEntryIndex;
37 dbug 1024 extern unsigned char LoaderApiAddressLow;
38     extern unsigned char LoaderApiAddressHigh;
39     extern void* LoaderApiAddress;
40    
41     extern void SetLoadAddress();
42 dbug 1015 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 dbug 1045 /*
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 dbug 1015 void main()
71     {
72     int y;
73     if (!is_overlay_enabled())
74     {
75     hires();
76     }
77     MusicLooped=1;
78    
79 dbug 1045 // Load the 6x8 font
80     LoaderApiEntryIndex=LOADER_FONT_6x8_ARTDECO;
81     LoadFile();
82    
83     // Some basic inits
84     InitTransitionData();
85    
86 dbug 1015 System_InstallIRQ_SimpleVbl();
87 dbug 1024
88     // Load and play the music
89 dbug 1038 LoaderApiEntryIndex=LOADER_FIRST_MUSIC+2;
90 dbug 1019 LoadFile();
91     Mym_ReInitialize();
92 dbug 1015
93 dbug 1024 // Load the font
94     LoaderApiEntryIndex=LOADER_FONT_24x20;
95     LoaderApiAddress=FontBuffer;
96     SetLoadAddress();
97     LoadFile();
98    
99 dbug 1038 /*
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 dbug 1015 while (1)
119     {
120 dbug 1019 /*
121 dbug 1015 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 dbug 1019 */
135 dbug 1015
136     for (LoaderApiEntryIndex=LOADER_FIRST_PICTURE;LoaderApiEntryIndex<LOADER_LAST_PICTURE;LoaderApiEntryIndex++)
137     {
138 dbug 1024 LoaderApiAddress=PictureLoadBuffer;
139     SetLoadAddress();
140 dbug 1015 LoadFile();
141 dbug 1024
142     //memcpy((unsigned char*)0xa000,PictureLoadBuffer,8000);
143 dbug 1045 //PictureTransitionFromTopAndBottom();
144     //PictureTransitionVenicianStore();
145     //PictureTransitionUnroll();
146     //PrintDescription("Twilighte","Barbitoric");
147 dbug 1049 //PrintDescription();
148 dbug 1045 PictureDoTransition();
149 dbug 1024
150 dbug 1015 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 dbug 1024 //memset((unsigned char*)0xa000,0,8000);
165 dbug 1015 }
166    
167 dbug 1024
168    
169    

  ViewVC Help
Powered by ViewVC 1.1.26