home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FreeWare Collection 2
/
FreeSoftwareCollection2pd199x-jp.img
/
demo
/
end.c
< prev
next >
Wrap
Text File
|
1990-06-14
|
7KB
|
271 lines
#include "demo.h"
#define END_CNT 6
#define ENDMES 8
typedef struct {
int x1;
int y1;
int x2;
int y2;
int dx1;
int dy1;
int dx2;
int dy2;
} ENDINFO;
/*59,56 155,104*/
ENDINFO EndInfo[END_CNT] = {
-97,56,215,56,1,0,-1,0,
-97,212,215,-100,1,-1,-1,1,
-97,-100,215,212,1,1,-1,-1,
-97,212,215,-100,1,-1,-1,1,
-97,56,215,56,1,0,-1,0,
59,-49,59,161,0,1,0,-1,
};
void
EndMessage()
{
STRING str;
PALETTE pal;
int cnt,cnt1,cnt2;
struct {
int mesno;
char *mes[10];
} endmes[9];
endmes[0].mesno = 3;
endmes[0].mes[0] = "少年は";
endmes[0].mes[1] = "しだいに意識が";
endmes[0].mes[2] = "戻りつつありました";
endmes[1].mesno = 3;
endmes[1].mes[0] = "目の前にはTOWNSのディスプレイ";
endmes[1].mes[1] = "そしてここはいつもの";
endmes[1].mes[2] = "見慣れた自分の部屋です";
endmes[2].mesno = 4;
endmes[2].mes[0] = "まだ完全には戻っていない";
endmes[2].mes[1] = "かすかな意識の中で";
endmes[2].mes[2] = "少年は数分前までの出来事を";
endmes[2].mes[3] = "思い返そうとしていました";
endmes[3].mesno = 2;
endmes[3].mes[0] = "しかし";
endmes[3].mes[1] = "少年は思い出す事が出来ませんでした";
endmes[4].mesno = 4;
endmes[4].mes[0] = "たった一つの言葉を除いて";
endmes[4].mes[1] = "・";
endmes[4].mes[2] = "・";
endmes[4].mes[3] = "・";
endmes[5].mesno = 4;
endmes[5].mes[0] = "伝説の道具を";
endmes[5].mes[1] = "数多く残してくれた";
endmes[5].mes[2] = "勇者がいることだけは";
endmes[5].mes[3] = "忘れないでほしい";
endmes[6].mesno = 3;
endmes[6].mes[0] = "その伝説は";
endmes[6].mes[1] = "今もなお";
endmes[6].mes[2] = "受け継がれています";
endmes[7].mesno = 3;
endmes[7].mes[0] = "その伝説の一部が";
endmes[7].mes[1] = "今";
endmes[7].mes[2] = "あなたの目の前にあるのです";
SPR_display(2,SpriteCnt);
for (cnt=0;cnt<=SpriteCnt;cnt++) {
SPR_setAttribute(1024-cnt,1,1,128,256 | 0x8000 | 0x2000);
}
SPR_display(1,SpriteCnt);
EGB_color(GWork,1,15);
EGB_clearScreen(GWork);
EGB_textZoom(GWork,1,32,32);
for (cnt=0;cnt<ENDMES;cnt++) {
for (cnt1=0;cnt1<endmes[cnt].mesno;cnt1++) {
EGB_color(GWork,0,cnt1);
str.len = strlen(endmes[cnt].mes[cnt1]);
str.x = 320-str.len*8;
str.y = 240-(endmes[cnt].mesno/2-cnt1)*35;
strcpy(str.str,endmes[cnt].mes[cnt1]);
EGB_sjisString(GWork,(char *)&str);
}
pal.no = endmes[cnt].mesno;
for(cnt1=0;cnt1<endmes[cnt].mesno*8+8;cnt1++) {
for (cnt2=0;cnt2<endmes[cnt].mesno;cnt2++) {
if ((cnt1 >= cnt2*8) && (cnt1 < cnt2*8+16)) {
pal.color[cnt2].seqno = cnt2;
pal.color[cnt2].blue = (15-(cnt1-cnt2*8)) << 4;
pal.color[cnt2].red = (15-(cnt1-cnt2*8)) << 4;
pal.color[cnt2].green = (15-(cnt1-cnt2*8)) << 4;
pal.color[cnt2].dummy = 0;
}
}
EGB_palette(GWork,1,(char *)&pal);
}
for(cnt1=0;cnt1<3000000;cnt1++);
for(cnt1=0;cnt1<endmes[cnt].mesno*8+8;cnt1++) {
for (cnt2=0;cnt2<endmes[cnt].mesno;cnt2++) {
if ((cnt1 >= cnt2*8) && (cnt1 < cnt2*8+16)) {
pal.color[cnt2].seqno = cnt2;
pal.color[cnt2].blue = (cnt1-cnt2*8) << 4;
pal.color[cnt2].red = (cnt1-cnt2*8) << 4;
pal.color[cnt2].green = (cnt1-cnt2*8) << 4;
pal.color[cnt2].dummy = 0;
}
}
EGB_palette(GWork,1,(char *)&pal);
}
EGB_color(GWork,1,15);
EGB_clearScreen(GWork);
}
}
void
FlashScreen()
{
PALETTE pal;
short int orgpal[16][3];
int cnt,cnt1,joy;
for (cnt=0;cnt<16;cnt++) {
orgpal[cnt][0] = (PalBuf[16][cnt] & 0xf00) >> 8;
orgpal[cnt][1] = (PalBuf[16][cnt] & 0x0f0) >> 4;
orgpal[cnt][2] = (PalBuf[16][cnt] & 0x00f);
}
pal.no = 16;
for (cnt=0;cnt<16;cnt++) {
for (cnt1=0;cnt1<16;cnt1++) {
orgpal[cnt1][0]++;
orgpal[cnt1][1]++;
orgpal[cnt1][2]++;
if (orgpal[cnt1][0] > 0xf) {
orgpal[cnt1][0] = 0xf;
}
if (orgpal[cnt1][1] > 0xf) {
orgpal[cnt1][1] = 0xf;
}
if (orgpal[cnt1][2] > 0xf) {
orgpal[cnt1][2] = 0xf;
}
pal.color[cnt1].seqno = cnt1;
pal.color[cnt1].blue = orgpal[cnt1][0] << 4;
pal.color[cnt1].red = orgpal[cnt1][1] << 4;
pal.color[cnt1].green = orgpal[cnt1][2] << 4;
pal.color[cnt1].dummy = 0;
}
EGB_palette(GWork,1,(char *)&pal);
}
EndMessage();
pal.no = 16;
for (cnt=15;cnt>=0;cnt--) {
for (cnt1=0;cnt1<16;cnt1++) {
orgpal[cnt1][0]--;
orgpal[cnt1][1]--;
orgpal[cnt1][2]--;
if (orgpal[cnt1][0] < 0) {
orgpal[cnt1][0] = 0;
}
if (orgpal[cnt1][1] < 0) {
orgpal[cnt1][1] = 0;
}
if (orgpal[cnt1][2] < 0) {
orgpal[cnt1][2] = 0;
}
pal.color[cnt1].seqno = cnt1;
pal.color[cnt1].blue = orgpal[cnt1][0] << 4;
pal.color[cnt1].red = orgpal[cnt1][1] << 4;
pal.color[cnt1].green = orgpal[cnt1][2] << 4;
pal.color[cnt1].dummy = 0;
}
EGB_palette(GWork,1,(char *)&pal);
}
}
void
Ending()
{
int cnt,cnt1,x1,x2,y1,y2;
FlashScreen();
EGB_writePage(GWork,0);
EGB_clearScreen(GWork);
SPR_display(2,SpriteCnt);
for (cnt=0;cnt<=SpriteCnt;cnt++) {
SPR_setAttribute(1024-cnt,1,1,128,256 | 0x8000 | 0x2000);
}
SPR_display(1,SpriteCnt);
EGB_writePage(GWork,1);
EGB_displayStart(GWork,0,0,0);
EGB_displayStart(GWork,1,0,0);
EGB_displayStart(GWork,2,3,3);
EGB_displayStart(GWork,3,256,256);
for (cnt1=0;cnt1<END_CNT;cnt1++) {
for (cnt=0;cnt<500000;cnt++);
SPR_display(2,36);
SPR_setPosition(0,1024-18,6,3,-96,-48);
SPR_setPosition(0,1024-36,6,3,214,160);
SPR_setAttribute(1024-18,6,3,PtnInfo[cnt1*2+18].ptn_no,0x8000 | PtnInfo[cnt1*2+18].pal);
SPR_setAttribute(1024-36,6,3,PtnInfo[cnt1*2+19].ptn_no,0x8000 | PtnInfo[cnt1*2+19].pal);
SPR_display(1,36);
x1 = EndInfo[cnt1].x1;
x2 = EndInfo[cnt1].x2;
y1 = EndInfo[cnt1].y1;
y2 = EndInfo[cnt1].y2;
while ((x1 != x2) || (y1 != y2)) {
x1 += EndInfo[cnt1].dx1;
x2 += EndInfo[cnt1].dx2;
y1 += EndInfo[cnt1].dy1;
y2 += EndInfo[cnt1].dy2;
SPR_display(2,36);
SPR_setPosition(0,1024-18,6,3,x1,y1);
SPR_setPosition(0,1024-36,6,3,x2,y2);
SPR_display(1,36);
}
for (cnt=0;cnt<2000000;cnt++);
while (((x1 < 214) || (x2 > -80)) && ((y2 > -48) || (y1 < 160))) {
x1 += EndInfo[cnt1].dx1;
x2 += EndInfo[cnt1].dx2;
y1 += EndInfo[cnt1].dy1;
y2 += EndInfo[cnt1].dy2;
SPR_display(2,36);
SPR_setPosition(0,1024-18,6,3,x1,y1);
SPR_setPosition(0,1024-36,6,3,x2,y2);
SPR_display(1,36);
}
}
}