/
splash.c
184 lines (175 loc) · 4.16 KB
/
splash.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
//#include <memory.h>
#include "defines.h"
#include "gui2/gui2_draw.h"
#include "system/video.h"
int progress = 0;
static u8 *scr = 0;
//begin doing the splash screen
void splash_start(u8 *dest)
{
scr = dest;
progress = 0;
}
//end of splash screen, gui/emulator is showing
void splash_stop()
{
}
static u8 loading[16*8*12] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
};
static u8 zeldaobj[12][16*12] = {
{
0,0,0,0,0,1,0,0,0,0,0,0,
0,0,0,0,0,1,0,0,0,0,0,0,
0,0,0,0,1,1,1,0,0,0,0,0,
0,0,0,0,1,2,1,0,0,0,0,0,
0,0,0,0,0,2,0,0,0,0,0,0,
0,0,0,0,0,2,0,0,0,0,0,0,
0,0,0,0,0,2,0,0,0,0,0,0,
0,0,0,0,0,2,0,0,0,0,0,0,
0,0,0,0,0,2,0,0,0,0,0,0,
0,0,0,0,0,2,0,0,0,0,0,0,
0,0,0,0,3,2,3,0,0,0,0,0,
0,0,0,3,4,2,4,3,0,0,0,0,
0,0,0,0,3,2,3,0,0,0,0,0,
0,0,0,3,4,2,4,3,0,0,0,0,
0,0,0,0,3,2,3,0,0,0,0,0,
0,0,0,3,0,2,0,3,0,0,0,0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,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,7,8,6,0,0,0,0,
0,0,0,0,7,7,6,0,0,0,0,0,
0,0,0,8,7,6,0,0,0,0,0,0,
0,0,0,8,8,6,0,0,0,0,0,0,
0,0,0,8,8,6,0,0,0,0,0,0,
0,0,0,8,8,6,0,0,0,0,0,0,
0,0,0,0,8,8,6,0,0,0,0,0,
0,0,0,0,0,8,8,6,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0}
};
//draw/update splash screen
void splash_draw()
{
int i,j,k;
int offset = 264*32+16;
int frame;
memset(scr,0,(256+8)*240);
video_setpalentry(0xCC,0xFF,0xFF,0xFF);
video_setpalentry(0,0x00,0x00,0x00);
video_setpalentry(1,0xF0,0xA0,0x80);
video_setpalentry(2,0x20,0xD0,0x20);
video_setpalentry(3,0xC0,0x40,0x40);
video_setpalentry(4,0x00,0x00,0x00);
video_setpalentry(5,0x00,0x00,0xC0);
video_setpalentry(6,0x00,0x00,0xC0);
video_setpalentry(7,0xFF,0xFF,0xFF);
video_setpalentry(8,0x80,0x80,0xFF);
for(i=0;i<progress;i++) {
frame = i;
for(j=0;j<16;j++) {
for(k=0;k<12;k++) {
*(scr+offset+progress*14+j*264+k) = zeldaobj[frame % 7][k + j*12];
}
}
}
gui_draw_text(7 + 0x40,32,64,"nesemu v"VERSION);
gui_draw_text(7 + 0x40,32,74,"loading...");
video_update(scr,256+8);
}
//add one progress mark and update screen
void splash_adddot()
{
progress++;
splash_draw();
}