/[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 1024 - (show annotations)
Sun Dec 15 09:42:42 2013 UTC (5 years, 11 months ago) by dbug
File MIME type: text/plain
File size: 2207 byte(s)
Generic clean-up of the loader code, moved the vectors at the end of the file so they get auto-magically setup when the loader is installed in memory.
Fixed a bug in the bootsector which did not actually know the actual length of the loader.
First transition effect (simple top/bottom copy), makes the whole thing feel smoother.
New LoaderAPI command: _SetLoadAddress, can be used to override the location of where files get loaded.
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
12 // player.s
13 extern unsigned char MusicLooped;
14 extern Mym_Initialize();
15 extern Mym_ReInitialize();
16
17 // transitions.s
18 extern unsigned char PictureLoadBuffer[];
19 extern void PictureTransitionFromTopAndBottom();
20
21 // scroller.s
22 extern unsigned char FontBuffer[];
23
24
25 // loader_api.s
26 extern unsigned char LoaderApiEntryIndex;
27 extern unsigned char LoaderApiAddressLow;
28 extern unsigned char LoaderApiAddressHigh;
29 extern void* LoaderApiAddress;
30
31 extern void SetLoadAddress();
32 extern void LoadFile();
33
34 void Pause()
35 {
36 int i;
37 for (i=0;i<50*5;i++)
38 {
39 VSync();
40 }
41 }
42
43 extern void Player_SetMusic_Birthday();
44
45 unsigned char CurrentMusic=LOADER_FIRST_MUSIC;
46
47 void main()
48 {
49 int y;
50 if (!is_overlay_enabled())
51 {
52 hires();
53 }
54 MusicLooped=1;
55
56 System_InstallIRQ_SimpleVbl();
57
58 // Load and play the music
59 LoaderApiEntryIndex=LOADER_FIRST_MUSIC+3;
60 LoadFile();
61 Mym_ReInitialize();
62
63 // Load the font
64 LoaderApiEntryIndex=LOADER_FONT_24x20;
65 LoaderApiAddress=FontBuffer;
66 SetLoadAddress();
67 LoadFile();
68
69 while (1)
70 {
71 /*
72 if (MusicLooped)
73 {
74 poke(0xbb80+40*25,16 | ((peek(0xbb80+40*25)+1)&7) );
75 //MusicPlaying=1;
76 if ( (CurrentMusic<LOADER_FIRST_MUSIC) || (CurrentMusic>=LOADER_LAST_MUSIC) )
77 {
78 CurrentMusic=LOADER_FIRST_MUSIC;
79 }
80 LoaderApiEntryIndex=CurrentMusic;
81 LoadFile();
82 Mym_ReInitialize();
83 ++CurrentMusic;
84 }
85 */
86
87 for (LoaderApiEntryIndex=LOADER_FIRST_PICTURE;LoaderApiEntryIndex<LOADER_LAST_PICTURE;LoaderApiEntryIndex++)
88 {
89 LoaderApiAddress=PictureLoadBuffer;
90 SetLoadAddress();
91 LoadFile();
92
93 //memcpy((unsigned char*)0xa000,PictureLoadBuffer,8000);
94 PictureTransitionFromTopAndBottom();
95
96 Pause();
97 }
98
99 /*
100 for (LoaderApiEntryIndex=LOADER_FIRST_MUSIC;LoaderApiEntryIndex<LOADER_LAST_MUSIC;LoaderApiEntryIndex++)
101 {
102 LoadFile();
103 Mym_Initialize();
104 //Pause();
105 }
106 */
107 VSync();
108 }
109
110 //memset((unsigned char*)0xa000,0,8000);
111 }
112
113
114
115

  ViewVC Help
Powered by ViewVC 1.1.26