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 |
|
22 |
// scroller.s |
23 |
extern unsigned char FontBuffer[]; |
24 |
|
25 |
|
26 |
// loader_api.s |
27 |
extern unsigned char LoaderApiEntryIndex; |
28 |
extern unsigned char LoaderApiAddressLow; |
29 |
extern unsigned char LoaderApiAddressHigh; |
30 |
extern void* LoaderApiAddress; |
31 |
|
32 |
extern void SetLoadAddress(); |
33 |
extern void LoadFile(); |
34 |
|
35 |
void Pause() |
36 |
{ |
37 |
int i; |
38 |
for (i=0;i<50*5;i++) |
39 |
{ |
40 |
VSync(); |
41 |
} |
42 |
} |
43 |
|
44 |
extern void Player_SetMusic_Birthday(); |
45 |
|
46 |
unsigned char CurrentMusic=LOADER_FIRST_MUSIC; |
47 |
|
48 |
void main() |
49 |
{ |
50 |
int y; |
51 |
if (!is_overlay_enabled()) |
52 |
{ |
53 |
hires(); |
54 |
} |
55 |
MusicLooped=1; |
56 |
|
57 |
System_InstallIRQ_SimpleVbl(); |
58 |
|
59 |
// Load and play the music |
60 |
LoaderApiEntryIndex=LOADER_FIRST_MUSIC+2; |
61 |
LoadFile(); |
62 |
Mym_ReInitialize(); |
63 |
|
64 |
// Load the font |
65 |
LoaderApiEntryIndex=LOADER_FONT_24x20; |
66 |
LoaderApiAddress=FontBuffer; |
67 |
SetLoadAddress(); |
68 |
LoadFile(); |
69 |
|
70 |
/* |
71 |
// Test load compressed file |
72 |
LoaderApiEntryIndex=LOADER_COMPRESSED_TEST; |
73 |
LoaderApiAddress=PictureLoadBuffer+8; |
74 |
SetLoadAddress(); |
75 |
LoadFile(); |
76 |
|
77 |
PictureLoadBuffer[0]='L'; |
78 |
PictureLoadBuffer[1]='Z'; |
79 |
PictureLoadBuffer[2]='7'; |
80 |
PictureLoadBuffer[3]='7'; |
81 |
*((int*)(PictureLoadBuffer+4))=8000; // Src size |
82 |
*((int*)(PictureLoadBuffer+6))=8000; // Dst size |
83 |
|
84 |
Stop(); |
85 |
file_unpack((unsigned char*)0xa000,PictureLoadBuffer); |
86 |
*/ |
87 |
|
88 |
|
89 |
while (1) |
90 |
{ |
91 |
/* |
92 |
if (MusicLooped) |
93 |
{ |
94 |
poke(0xbb80+40*25,16 | ((peek(0xbb80+40*25)+1)&7) ); |
95 |
//MusicPlaying=1; |
96 |
if ( (CurrentMusic<LOADER_FIRST_MUSIC) || (CurrentMusic>=LOADER_LAST_MUSIC) ) |
97 |
{ |
98 |
CurrentMusic=LOADER_FIRST_MUSIC; |
99 |
} |
100 |
LoaderApiEntryIndex=CurrentMusic; |
101 |
LoadFile(); |
102 |
Mym_ReInitialize(); |
103 |
++CurrentMusic; |
104 |
} |
105 |
*/ |
106 |
|
107 |
for (LoaderApiEntryIndex=LOADER_FIRST_PICTURE;LoaderApiEntryIndex<LOADER_LAST_PICTURE;LoaderApiEntryIndex++) |
108 |
{ |
109 |
LoaderApiAddress=PictureLoadBuffer; |
110 |
SetLoadAddress(); |
111 |
LoadFile(); |
112 |
|
113 |
//memcpy((unsigned char*)0xa000,PictureLoadBuffer,8000); |
114 |
PictureTransitionFromTopAndBottom(); |
115 |
|
116 |
Pause(); |
117 |
} |
118 |
|
119 |
/* |
120 |
for (LoaderApiEntryIndex=LOADER_FIRST_MUSIC;LoaderApiEntryIndex<LOADER_LAST_MUSIC;LoaderApiEntryIndex++) |
121 |
{ |
122 |
LoadFile(); |
123 |
Mym_Initialize(); |
124 |
//Pause(); |
125 |
} |
126 |
*/ |
127 |
VSync(); |
128 |
} |
129 |
|
130 |
//memset((unsigned char*)0xa000,0,8000); |
131 |
} |
132 |
|
133 |
|
134 |
|
135 |
|