/[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 1070 - (hide annotations)
Fri Jan 3 10:47:33 2014 UTC (5 years, 11 months ago) by dbug
File MIME type: text/plain
File size: 3460 byte(s)
Updated the scroller code, still buggy and needing optimizations.
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 dbug 1050 extern void ScrollerInit();
34 dbug 1070 extern void TestScroller();
35 dbug 1024
36 dbug 1015 // loader_api.s
37     extern unsigned char LoaderApiEntryIndex;
38 dbug 1024 extern unsigned char LoaderApiAddressLow;
39     extern unsigned char LoaderApiAddressHigh;
40     extern void* LoaderApiAddress;
41    
42     extern void SetLoadAddress();
43 dbug 1015 extern void LoadFile();
44    
45     void Pause()
46     {
47     int i;
48     for (i=0;i<50*5;i++)
49     {
50     VSync();
51     }
52     }
53    
54     extern void Player_SetMusic_Birthday();
55    
56     unsigned char CurrentMusic=LOADER_FIRST_MUSIC;
57    
58 dbug 1045 /*
59     void PrintDescription(const char* author,const char* name)
60     {
61     char* textLine;
62    
63     textLine=(char*)0xbb80+40*25;
64     memset(textLine,32,40);
65    
66     memcpy(textLine,author,strlen(author));
67     memcpy(textLine+20,name,strlen(name));
68     }
69     */
70    
71 dbug 1015 void main()
72     {
73     int y;
74     if (!is_overlay_enabled())
75     {
76     hires();
77     }
78     MusicLooped=1;
79    
80 dbug 1045 // Load the 6x8 font
81     LoaderApiEntryIndex=LOADER_FONT_6x8_ARTDECO;
82     LoadFile();
83    
84 dbug 1070 // Load the 12x16 font
85     LoaderApiEntryIndex=LOADER_FONT_12x16_ARTDECO; // 3040 bytes
86     LoaderApiAddress=FontBuffer;
87     SetLoadAddress();
88     LoadFile();
89    
90     //while(1);
91    
92     memset((unsigned char*)0xa000,64+1+4+16,8000);
93    
94    
95 dbug 1045 // Some basic inits
96     InitTransitionData();
97    
98 dbug 1015 System_InstallIRQ_SimpleVbl();
99 dbug 1024
100 dbug 1070 //TestScroller();
101     //while (1)
102     {
103     }
104 dbug 1050
105 dbug 1024 // Load and play the music
106 dbug 1038 LoaderApiEntryIndex=LOADER_FIRST_MUSIC+2;
107 dbug 1019 LoadFile();
108     Mym_ReInitialize();
109 dbug 1015
110 dbug 1038 /*
111     // Test load compressed file
112     LoaderApiEntryIndex=LOADER_COMPRESSED_TEST;
113     LoaderApiAddress=PictureLoadBuffer+8;
114     SetLoadAddress();
115     LoadFile();
116    
117     PictureLoadBuffer[0]='L';
118     PictureLoadBuffer[1]='Z';
119     PictureLoadBuffer[2]='7';
120     PictureLoadBuffer[3]='7';
121     *((int*)(PictureLoadBuffer+4))=8000; // Src size
122     *((int*)(PictureLoadBuffer+6))=8000; // Dst size
123    
124     Stop();
125     file_unpack((unsigned char*)0xa000,PictureLoadBuffer);
126     */
127    
128    
129 dbug 1015 while (1)
130     {
131 dbug 1019 /*
132 dbug 1015 if (MusicLooped)
133     {
134     poke(0xbb80+40*25,16 | ((peek(0xbb80+40*25)+1)&7) );
135     //MusicPlaying=1;
136     if ( (CurrentMusic<LOADER_FIRST_MUSIC) || (CurrentMusic>=LOADER_LAST_MUSIC) )
137     {
138     CurrentMusic=LOADER_FIRST_MUSIC;
139     }
140     LoaderApiEntryIndex=CurrentMusic;
141     LoadFile();
142     Mym_ReInitialize();
143     ++CurrentMusic;
144     }
145 dbug 1019 */
146 dbug 1015
147     for (LoaderApiEntryIndex=LOADER_FIRST_PICTURE;LoaderApiEntryIndex<LOADER_LAST_PICTURE;LoaderApiEntryIndex++)
148     {
149 dbug 1024 LoaderApiAddress=PictureLoadBuffer;
150     SetLoadAddress();
151 dbug 1015 LoadFile();
152 dbug 1024
153     //memcpy((unsigned char*)0xa000,PictureLoadBuffer,8000);
154 dbug 1045 //PictureTransitionFromTopAndBottom();
155     //PictureTransitionVenicianStore();
156     //PictureTransitionUnroll();
157     //PrintDescription("Twilighte","Barbitoric");
158 dbug 1049 //PrintDescription();
159 dbug 1045 PictureDoTransition();
160 dbug 1024
161 dbug 1015 Pause();
162     }
163    
164     VSync();
165     }
166    
167 dbug 1024 //memset((unsigned char*)0xa000,0,8000);
168 dbug 1015 }
169    
170 dbug 1024
171    
172    

  ViewVC Help
Powered by ViewVC 1.1.26