This repository has been archived by the owner on Oct 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
kizuato_jingle.c
192 lines (172 loc) · 4.33 KB
/
kizuato_jingle.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
185
186
187
188
189
190
191
/*
* LEAF Visual Novel System For X
* (c) Copyright 1999,2000 Go Watanabe mailto:[email protected]
* All rights reserverd.
*
* ORIGINAL LVNS (c) Copyright 1996-1999 LEAF/AQUAPLUS Inc.
*
* $Id: kizuato_jingle.c,v 1.29 2001/08/05 10:58:09 go Exp $
*
*/
/*
* Leaf 新ジングル (痕/ToHeart共通)
*/
#include <stdio.h>
#include "kizuato.h"
#ifndef USE_MGL
#define SLIDE_H 192
#else
#define SLIDE_H 96
#endif
static int
Slide(Lvns *lvns, LvnsScript *scr)
{
int i;
for (i=0;i<6;i++) {
int y = scr->state * 6 - i * 5;
if (y >= 0) {
lvnsimage_clear_area(lvns->vram, 0, y, WIDTH, 1);
lvnsimage_clear_area(lvns->vram, 0, HEIGHT-1-y, WIDTH, 1);
}
}
lvns->drawWindow(lvns);
lvns->flushWindow(lvns);
if (++scr->state == ((HEIGHT - SLIDE_H)/2/6 + 1)) {
return True; /* 処理終了 */
} else {
return False;
}
}
#undef SLIDE_H
/* ジングル用パレットデータ */
static u_char pal[][3] = {
{ 0xff, 0xff, 0xff },
{ 0xff, 0xff, 0xff },
{ 0xff, 0xff, 0xff },
{ 0xff, 0xff, 0xff },
{ 0xff, 0xff, 0xff },
{ 0xff, 0xff, 0xff },
{ 0xff, 0xff, 0xff },
{ 0xff, 0xff, 0xff },
{ 0xff, 0xff, 0xee },
{ 0xff, 0xff, 0xdd },
{ 0xff, 0xff, 0xcc },
{ 0xff, 0xff, 0xbb },
{ 0xff, 0xff, 0xaa },
{ 0xff, 0xff, 0x99 },
{ 0xee, 0xff, 0xaa },
{ 0xdd, 0xff, 0xbb },
{ 0xcc, 0xff, 0xcc },
{ 0xbb, 0xff, 0xdd },
{ 0xaa, 0xff, 0xee },
{ 0xbb, 0xee, 0xee },
{ 0xcc, 0xdd, 0xee },
{ 0xdd, 0xcc, 0xee },
{ 0xee, 0xbb, 0xee },
{ 0xff, 0xaa, 0xee },
{ 0xff, 0xaa, 0xdd },
{ 0xff, 0xaa, 0xcc },
{ 0xff, 0xaa, 0xbb },
{ 0xff, 0xaa, 0xaa },
{ 0xff, 0xaa, 0x99 },
{ 0xee, 0xaa, 0xaa },
{ 0xdd, 0xaa, 0xbb },
{ 0xcc, 0xaa, 0xcc },
{ 0xbb, 0xaa, 0xdd },
{ 0xaa, 0xaa, 0xee },
{ 0xaa, 0xaa, 0xee },
{ 0xaa, 0xaa, 0xee },
{ 0xaa, 0xaa, 0xee },
{ 0xaa, 0xaa, 0xee },
{ 0xaa, 0xaa, 0xee },
{ 0xaa, 0xaa, 0xee },
{ 0xaa, 0xaa, 0xee },
{ 0xaa, 0xaa, 0xee },
{ 0xaa, 0xaa, 0xee },
};
static int
ClearWhite(Lvns *lvns, LvnsScript *scr)
{
#ifndef USE_MGL
lvnsimage_clear_color(lvns->vram, 255, 255, 255);
#else
mglimage_clear_color(lvns->vram, COLOR_WHITE);
#endif
return True;
}
static int
LoadTitle(Lvns *lvns, LvnsScript *scr)
{
int i;
LvnsImage *image;
/* ロゴデータ準備 */
image = LvnsLoadImage(lvns, "LEAF.LFG", NULL);
/* 葉っぱ以外の部分を白に */
for (i=5; i<16; i++) {
image->palette[i][0] =
image->palette[i][1] =
image->palette[i][2] = 255;
}
/* 画像準備 */
#ifndef USE_MGL
image->yoffset += ((HEIGHT - 400) / 2);
image->height += ((HEIGHT - 400) / 2);
lvnsimage_copy2(image, lvns->vram, 15);
#else
image->yoffset += ((HEIGHT - 200) / 2);
image->height += ((HEIGHT - 200) / 2);
mglimage_add(image, lvns->vram, 0, 0);
#endif
lvnsimage_delete(image);
return True;
}
static int
Palette(Lvns *lvns, LvnsScript *scr)
{
/* パレット制御しながら葉っぱを表示 */
int i;
int cnt = scr->state;
for (i=0; i<9; i++) {
lvns->vram->palette[5+i][0] = pal[cnt+i][0];
lvns->vram->palette[5+i][1] = pal[cnt+i][1];
lvns->vram->palette[5+i][2] = pal[cnt+i][2];
}
if (cnt == 30) {
lvns->vram->palette[14][0] = 0xdd;
lvns->vram->palette[14][1] = 0xdd;
lvns->vram->palette[14][2] = 0xff;
}
lvns->setPalette(lvns);
lvns->drawWindow(lvns);
lvns->flushWindow(lvns);
scr->state++;
LvnsWait(lvns, 3);
if (scr->state > 34) {
scr->state = 0;
return True;
} else {
return False;
}
}
/* ジングルスクリプト */
static LvnsScriptData jingledata[] = {
{ LVNS_SCRIPT_FUNC, ClearWhite },
{ LVNS_SCRIPT_MUSIC, (void*)2 },
{ LVNS_SCRIPT_TIMER_INIT },
{ LVNS_SCRIPT_DISP_VRAM, (void*)LVNS_EFFECT_FADE_PALETTE },
{ LVNS_SCRIPT_FUNC, LoadTitle },
{ LVNS_SCRIPT_WHITEIN },
{ LVNS_SCRIPT_TIMER_WAIT, (void*)1000 },
{ LVNS_SCRIPT_LOOP_FUNC, Palette },
{ LVNS_SCRIPT_TIMER_WAIT, (void*)8000 },
{ LVNS_SCRIPT_LOOP_FUNC, Slide },
{ LVNS_SCRIPT_TIMER_WAIT, (void*)12000 },
{ LVNS_SCRIPT_CLICK_JUMP },
{ LVNS_SCRIPT_CLEAR, (void*)LVNS_EFFECT_FADE_PALETTE },
{ LVNS_SCRIPT_END }
};
void
KizuatoJingle(Lvns *lvns)
{
LvnsScriptRun(lvns, jingledata);
}