/* * 格闘老人 ビデオクリップ * * 製作開始日時 : 1997年9月30日 * 完了日時 : 10日 9日 * * 製作 : 格闘老人ビデオクリップ製作委員会 */ #include #include "pad.h" #include #include "public.h" #include "sprite.c" #include "timset.c" #define OBJECT 34 volatile unsigned char *bb0, *bb1; GsF_LIGHT pslt[3]; static GsSPRITE spr; static GsSPRITE sprt; short vab1; int i,j,k,b,r; int move_count; int time; int p_count; int keyflg; int move_wide; static char n[] = { 1,2,3,4,5,6,7, 8,9,10,11,12,13,14, 1,2,3,4,5,6,7,15, 16,17,18,19,20,21,22,23,24,25,26,25,24,23,22,21, 20,19,18,17,16,15,14,13,12,11,10, 31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,1,1,1, 1,1,1,2,2,2, 15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33, 3,2,1,1,1,1,1}; int d_count; int p_dance; int dance_type; int camera_type; static unsigned short dance[] = { 183,3,2 ,198,3,2, 131,1,0, 23,2,0, 136,1,0, 25,2,0, 140,1,0, 25,2,0, 134,1,0, 29,2,0, 118,4,1, 7,3,14,7,3,13,7,3,12,7,3,11,7,3,10,7,3,9,7,3,8, 104,4,1, 7,3,14,6,3,13,6,3,12,6,3,11,6,3,10,6,3,9,6,3,8, 113,1,1, 8,3,14,7,3,13,7,3,12,7,3,11,7,3,10,8,3,9,8,3,8, 106,4,1, 7,3,14,7,3,13,7,3,12,8,3,11,8,3,10,8,3,9,8,3,8, 133,1,5, 26,2,0, 139,1,5, 25,2,0, 134,1,5,28,2,0 , 320,3,6, 180,3,1 ,100,3,3,323,5,5, 12800,5,7}; static char move_min[] = { 1 , 23 ,1 ,50, 67 ,1 ,76, 96, 23,24,25,26,27,28,29}; static char move_max[] = { 37 , 49 ,49,69, 69 ,21, 94,100,25,26,27,28,29,30,31}; int t_count; int color; /* ================ メイン ================ */ int main(void) { RECT rc; GsCOORDINATE2 box_coord[OBJECT]; GsRVIEW2 pv ; GsOT wot[2]; GsOT_TAG zsorttable[2][1 << OT_LENGTH]; PACKET user_packet[2][0x10000]; GsDOBJ2 object[OBJECT]; unsigned long *dop; static unsigned long padd; static unsigned long opadd; static short se_voice[6]; unsigned char *buf; SVECTOR rot_vector[OBJECT]; static unsigned short int get_pad(void); int active_buf; /* テクスチャーをフレームバッファに転送*/ tim_set(WAVE01_AD); MakeSpData(TITLE_AD,&spr); setRGB(&spr,0,0,0); setXY(&spr,0,160) ; setROTATE(&spr, 0 ); MakeSpData(KAKLIV_AD,&sprt); setRGB(&sprt,0,0,0); setXY(&sprt,0,0); setROTATE(&sprt, 0 ); /* リバーブ の設定 */ SsUtSetReverbType( SS_REV_TYPE_STUDIO_C ); SsUtReverbOn(); /* VAB データのオープン,転送 */ buf = (unsigned char*)VH1_ADDR; vab1 = SsVabTransfer( VH1_ADDR, VB1_ADDR, -1, 1); SsSetMVol (127, 127); SsUtSetReverbDepth( 40, 40 ); /* 表示モードなどなど初期化。320×240, ノンインタレースモード */ GsInitGraph(320, 240, GsNONINTER | GsOFSGPU, 0, 0); GsDefDispBuff(0, 0, 0, 240); GsInit3D(); /* 視点の設定。 */ pv.vpx = 0; pv.vpy = 0; pv.vpz = 3000; pv.vrx = 0; pv.vry = 0; pv.vrz = 0; pv.rz = 0 * ONE; pv.super = WORLD; wot[0].length = OT_LENGTH; wot[0].org = zsorttable[0]; wot[1].length = OT_LENGTH; wot[1].org = zsorttable[1]; /* オブジェクトの初期化。 */ dop = (unsigned long *)OBJECT_ADDR; dop++; GsMapModelingData(dop); dop += 2; for ( i=1 ; imove_wide){ if (move_count < move_max[dance_type]) { move_count++; time=0; } else move_count=move_min[dance_type]; } object[0].tmd = object[n[move_count]].tmd; object[0].attribute = 0; /* パラメータの変更を有効にするため、データを送る */ (void)RotMatrix(&rot_vector[0], &(box_coord[0].coord)); box_coord[0].flg = 0; /* △ボタンを押したら 演奏開始、データ初期化 */ if( (padd & PADRup) && !(opadd & PADRup) ) { se_voice[0] = SsUtKeyOn( vab1, 0, 0, 48, 0, 127, 127 ); } if( !(padd & PADRup) && (opadd & PADRup) ) { SsUtKeyOff( se_voice[0], vab1, 0, 0, 48 ); p_count=0; d_count=0; p_dance=0; t_count=0; time=10; } /* ダンス制御(カメラ位置、動きの速さ)*/ d_count--; if (d_count == 9999) d_count=10000; if (d_count <= 0) { d_count=dance[p_dance++]; time=10; camera_type=dance[p_dance++]; dance_type=dance[p_dance++]; move_count=move_min[dance_type]; t_count=0; if (camera_type == 1){ rot_vector[0].vx = -517; rot_vector[0].vy = 2321; box_coord[0].coord.t[2]=1480; move_wide=2; } if (camera_type == 2){ rot_vector[0].vx = -550; rot_vector[0].vy = 2112; box_coord[0].coord.t[2] = -1380; move_wide = 6; } if (camera_type == 3){ rot_vector[0].vx = -671; rot_vector[0].vy = -1914; box_coord[0].coord.t[2] = -8840; move_wide = 6; } if (camera_type == 4){ rot_vector[0].vx = -297; rot_vector[0].vy = 2508; box_coord[0].coord.t[2] = -1840; move_wide = 7; } if (camera_type == 5){ rot_vector[0].vx = -671; rot_vector[0].vy = -1914; box_coord[0].coord.t[2] = -8840; move_wide = 8; } } /* 格闘老人 タイトル浮出(カラー調整) */ if (( d_count == 321 )&&(t_count == 0)) { setXY(&spr,40,20); t_count=1; color=0; } if (t_count > 0 ){ if (t_count ==1){ color+=3; if (color>100) t_count=2; } if ((t_count >1)&&(t_count <120))t_count++; if (t_count == 120 ){ color-=3; if (color<0){ color=0; t_count=-1; setXY(&spr,0,160); } } setRGB(&spr,color,color,color); } active_buf = GsGetActiveBuff(); GsSetWorkBase(user_packet[active_buf]); GsClearOt(0, 0, &wot[active_buf]); for (i=0 ; i<1 ; i++){ GsGetLs(object[0].coord2, &local_matrix); GsSetLightMatrix(&local_matrix); GsSetLsMatrix(&local_matrix); GsSortObject4(&object[0], &wot[active_buf], 14 - OT_LENGTH, getScratchAddr(0)); } GsSortSprite(&spr,&wot[active_buf],0); opadd = padd ; padd = get_pad(); (void)VSync(0); (void)ResetGraph(1); GsSwapDispBuff(); GsSortClear(0, 0, 0, &wot[active_buf]); GsDrawOt(&wot[active_buf]); } (void)VSync(0); (void)ResetGraph(1); return(0); } get_pad(void) { unsigned short rval; rval = (unsigned short int)(*(bb0 + 3)) | (unsigned short int)(*(bb0 + 2)) << 8; return(rval); }