3#pragma argument_flag_ones 210, 230, 247, 255, 277, 308, 310, 484, 485, 486
4#pragma argument_flag_ones 494, 496, 499, 501, 545, 548, 552, 553, 557, 560
5#pragma argument_flag_ones 583, 594, 602, 609, 610, 611, 614, 615, 616, 655
6#pragma argument_flag_ones 665, 671, 672, 673, 679, 689, 695, 696, 697, 703
7#pragma argument_flag_ones 713, 719, 720, 721, 736, 751, 757, 758, 764, 772
8#pragma argument_flag_ones 825, 1002
10#pragma argument_flag 0
11#pragma argument_flag_ones 190, 210, 227, 235, 257, 288, 290, 295, 403, 428
12#pragma argument_flag_ones 430, 464, 465, 466, 474, 476, 479, 481, 525, 528
13#pragma argument_flag_ones 532, 533, 537, 540, 563, 574, 582, 589, 590, 591
14#pragma argument_flag_ones 594, 595, 596, 635, 645, 651, 652, 653, 659, 669
15#pragma argument_flag_ones 675, 676, 677, 683, 693, 699, 700, 701, 716, 731
16#pragma argument_flag_ones 737, 738, 744, 752, 805, 982
30#include "dataalloc.hpp"
33#include "framevu1.hpp"
35#include "mainselect.hpp"
40#include "renderinfo.hpp"
43#include "title/op_a.hpp"
44#include "title/opening.hpp"
45#include "title/script.hpp"
69 CRect(T new_x, T new_y, T new_width, T new_height) {
75} __attribute__((aligned(16)));
96 CMap() { Initialize(); }
118 void DrawFire(
int unknown0,
int unknown1,
CCamera *camera,
float *eye,
float scale,
int unknown2,
float unknown3);
133 void Initialize(
CEffect *table,
int max);
136 void Step(
int unknown0);
218void wait_now_loading_vsync();
220void MoveImageTest(
sceVif1Packet *packet,
int sbp,
int sbw,
int spsm,
const CRect<int> &rect,
int dbp,
int dbw,
int dpsm,
int dsax,
int dsay,
int dir);
222void DepthOfField(
float *dist,
int level,
int alpha,
int blur);
224static void LoadTexture();
225static void LoadData();
226static void SetDanceMotion();
227static void InitDancerPos();
228static void DrawCloud();
229static void SmokeProcess();
230static void MoveDancers();
231static void ReaderShadow();
232static void DancerShadow();
233static void ShogunShadow();
234static void ShisaiShadow();
235static void DrawShadow(
float x,
float y,
float z);
236static void setTexScroll();
237static void setCloudTexScroll();
239void FaceChange(
int actor_no);
240void LoadCharaData(
int buffer_no,
int actor_no);
241void LoadMotionData();
309sceVu0FVECTOR OP_FirePosition[96];
310float OP_FireScale[96];
318static sceVu0FVECTOR DancerPos[35];
319static sceVu0FVECTOR DancerRot[35];
323static float DancerAmb;
326static float DanceWait;
333void OpA_InitProcess() {
336 OP_GroundMap.Initialize();
337 OP_BuildingMap.Initialize();
338 OPAnalyz(
"opdat/opinfo.cfg");
341 LoadFile(
"opdat/dungeon/dungeon.pak", read_buffer, 0);
342 wait_now_loading_vsync();
347 CSnd.
SetVol(MIDI_PORT_SE_TITLE, 256);
348 CSnd.
SetVol(MIDI_PORT_SE_DEFAULT, 256);
349 CSnd.
SetVol(MIDI_PORT_UNK_D, 256);
350 CSnd.
SetVol(MIDI_PORT_SE_SPECIAL, 256);
351 CSnd.
SE_Play(MIDI_PORT_SE_TITLE, 16, 20, 0, 0);
352 wait_now_loading_vsync();
354 LoadFile(
"opdat/chara/01p19a1b.chr", (
void *) ((
char *) read_buffer + 0x10C900), 0);
355 LoadFile(
"opdat/chara/01p17a1b.chr", (
void *) read_buffer, 0);
373static void LoadTexture() {
375 {
"#blender#640#" HALF_BUFFER_HEIGHT_STR
"#4", 0, 0},
376 {
"#fontbase#512#256#1", 26, 0},
377 {
"#fukidashibase#640#" HALF_BUFFER_HEIGHT_STR
"#4", 26, 0},
378 {
"#frame_image#640#" HALF_BUFFER_HEIGHT_STR
"#4", 22, 0},
409 TexManager.Initialize(16352);
410 LoadFile(
"opdat/dungeon/dungeon.pim", (
void *) read_buffer, 0);
412 texture_list[4].name = (
char *) GetPackFile(read_buffer,
"gaiji.img", 0);
413 texture_list[5].name = (
char *) GetPackFile(read_buffer,
"fuki256.img", 0);
414 texture_list[6].name = (
char *) GetPackFile(read_buffer,
"syst04.img", 0);
415 texture_list[7].name = (
char *) GetPackFile(read_buffer,
"c07a01.img", 0);
416 texture_list[8].name = (
char *) GetPackFile(read_buffer,
"c07a01an.img", 0);
417 texture_list[9].name = (
char *) GetPackFile(read_buffer,
"p17a01.img", 0);
418 texture_list[10].name = (
char *) GetPackFile(read_buffer,
"c08a01.img", 0);
419 texture_list[11].name = (
char *) GetPackFile(read_buffer,
"c09a01.img", 0);
420 texture_list[12].name = (
char *) GetPackFile(read_buffer,
"c09a01an.img", 0);
421 texture_list[13].name = (
char *) GetPackFile(read_buffer,
"c11a01.img", 0);
422 texture_list[14].name = (
char *) GetPackFile(read_buffer,
"c11a01an.img", 0);
423 texture_list[15].name = (
char *) GetPackFile(read_buffer,
"p19a01.img", 0);
424 texture_list[16].name = (
char *) GetPackFile(read_buffer,
"p19a01an.img", 0);
425 texture_list[17].name = (
char *) GetPackFile(read_buffer,
"ex.img", 0);
426 texture_list[18].name = (
char *) GetPackFile(read_buffer,
"cloud.img", 0);
427 texture_list[19].name = (
char *) GetPackFile(read_buffer,
"cloudan.img", 0);
428 texture_list[20].name = (
char *) GetPackFile(read_buffer,
"cloud2.img", 0);
429 texture_list[21].name = (
char *) GetPackFile(read_buffer,
"i01t01.img", 0);
430 texture_list[22].name = (
char *) GetPackFile(read_buffer,
"i01t02.img", 0);
431 texture_list[23].name = (
char *) GetPackFile(read_buffer,
"e01s01.img", 0);
432 texture_list[24].name = (
char *) GetPackFile(read_buffer,
"fire.img", 0);
433 texture_list[25].name = (
char *) GetPackFile(read_buffer,
"pause.img", 0);
436 switch (LanguageCode) {
438 texture_list[26].name = (
char *) GetPackFile(read_buffer,
"pause_e.img", 0);
440 case LANG_ENGLISH_US:
441 texture_list[26].name = (
char *) GetPackFile(read_buffer,
"pause_e.img", 0);
443 case LANG_ENGLISH_UK:
444 texture_list[26].name = (
char *) GetPackFile(read_buffer,
"pause_e.img", 0);
447 texture_list[26].name = (
char *) GetPackFile(read_buffer,
"pause_f.img", 0);
450 texture_list[26].name = (
char *) GetPackFile(read_buffer,
"pause_g.img", 0);
453 texture_list[26].name = (
char *) GetPackFile(read_buffer,
"pause_i.img", 0);
456 texture_list[26].name = (
char *) GetPackFile(read_buffer,
"pause_s.img", 0);
460 texture_list[27].name = (
char *) GetPackFile(read_buffer,
"ashikage.img", 0);
462 texture_list[26].name = (
char *) GetPackFile(read_buffer,
"pause_e.img", 0);
463 texture_list[27].name = (
char *) GetPackFile(read_buffer,
"start2.img", 0);
464 texture_list[28].name = (
char *) GetPackFile(read_buffer,
"ashikage.img", 0);
467 TexManager.LoadTextureBlock(-1, texture_list);
489static void LoadData() {
490 char *config_names[4] = {
"01c07a.cfg",
"01c08a.cfg",
"01c11a.cfg",
"01c09a.cfg"};
492 for (
int i = 0; i < 4; i++) {
493 Chara__3[i].
LoadPackData(read_buffer, config_names[i], CharaDataBuffer__2, 0);
498 Chara__3[i].
frame->SetAttr(attr, 1, 4);
507 wait_now_loading_vsync();
510 Chara__3[6].
frame = LoadMDSFile(GetPackFile(read_buffer,
"01p19a.mds", 0), &CharaDataBuffer__2[4], 6, 0, 0);
515 Chara__3[6].
frame->SetAttr(noroi_attr, 1, 4);
517 wait_now_loading_vsync();
520 Chara__3[7].
frame = LoadMDSFile(GetPackFile(read_buffer,
"01p17a.mds", 0), &CharaDataBuffer__2[4], 6, 0, 0);
525 Chara__3[7].
frame->SetAttr(dancer_attr, 1, 4);
527 float scale[4] = {4.5f, 1.0f, 4.5f, 0.0f};
529 Chara__3[7].
frame->SearchFrame(
"body")->ScaleBoundBox(scale);
533 wait_now_loading_vsync();
535 Cloud.
frame = LoadMDSFile(GetPackFile(read_buffer,
"01cloud.mds", 0), 2, 0);
538 EffectTable = (
CEffect *) MapDataBuffer.Alloc(12800);
539 Smoke.Initialize(EffectTable, 50);
542 Shadow = LoadMDSFile(GetPackFile(read_buffer,
"ashikage.mds", 0), 2, 0);
554static void SetDanceMotion() {
555 LoadFile(
"opdat/chara/01p19a1a.chr", (
void *) read_buffer, 0);
556 Chara__3[6].
LoadPackData(read_buffer,
"01p19a1a.cfg", &CharaDataBuffer__2[4], &CharaDataBuffer__2[6], 0);
564 LoadFile(
"opdat/chara/01p17a1a.chr", (
void *) read_buffer, 0);
565 Chara__3[7].
LoadPackData(read_buffer,
"01p17a1a.cfg", &CharaDataBuffer__2[4], &CharaDataBuffer__2[6], 0);
583static void InitDancerPos() {
584 float layout[35][4] = {
585 {3.0f, 0.0f, 27.0f, 0.0f},
586 {0.0f, 0.0f, 27.0f, 0.0f},
587 {-3.0f, 0.0f, 27.0f, 0.0f},
588 {1.5f, 0.0f, 29.0f, 0.0f},
589 {-1.5f, 0.0f, 29.0f, 0.0f},
590 {4.5f, 0.0f, 29.0f, 0.0f},
591 {-4.5f, 0.0f, 29.0f, 0.0f},
592 {3.0f, 0.0f, 31.0f, 0.0f},
593 {0.0f, 0.0f, 31.0f, 0.0f},
594 {-3.0f, 0.0f, 31.0f, 0.0f},
595 {1.5f, 0.0f, 33.0f, 0.0f},
596 {-1.5f, 0.0f, 33.0f, 0.0f},
597 {4.5f, 0.0f, 33.0f, 0.0f},
598 {-4.5f, 0.0f, 33.0f, 0.0f},
599 {3.0f, 0.0f, 35.0f, 0.0f},
600 {0.0f, 0.0f, 35.0f, 0.0f},
601 {-3.0f, 0.0f, 35.0f, 0.0f},
602 {1.5f, 0.0f, 37.0f, 0.0f},
603 {-1.5f, 0.0f, 37.0f, 0.0f},
604 {4.5f, 0.0f, 37.0f, 0.0f},
605 {-4.5f, 0.0f, 37.0f, 0.0f},
606 {3.0f, 0.0f, 39.0f, 0.0f},
607 {0.0f, 0.0f, 39.0f, 0.0f},
608 {-3.0f, 0.0f, 39.0f, 0.0f},
609 {1.5f, 0.0f, 41.0f, 0.0f},
610 {-1.5f, 0.0f, 41.0f, 0.0f},
611 {4.5f, 0.0f, 41.0f, 0.0f},
612 {-4.5f, 0.0f, 41.0f, 0.0f},
613 {3.0f, 0.0f, 43.0f, 0.0f},
614 {0.0f, 0.0f, 43.0f, 0.0f},
615 {-3.0f, 0.0f, 43.0f, 0.0f},
616 {1.5f, 0.0f, 45.0f, 0.0f},
617 {-1.5f, 0.0f, 45.0f, 0.0f},
618 {4.5f, 0.0f, 45.0f, 0.0f},
619 {-4.5f, 0.0f, 45.0f, 0.0f}
622 for (
int i = 0; i < 35; i++) {
623 DancerPos[i][0] = 10.0f * layout[i][0];
624 DancerPos[i][1] = 10.0f * layout[i][1];
625 DancerPos[i][2] = 10.0f + 10.0f * layout[i][2];
626 DancerRot[i][0] = 0.0f;
627 DancerRot[i][1] = PI_D;
632 DancerRot[i][0] = 0.0f;
644void OpA_DrawProcess() {
645 static sceVu0FVECTOR ambient = {0.0f, 0.0f, 0.0f, 0.0f};
647 sceVu0FVECTOR saved_ambient;
649 TexManager.ReloadTexture(Vif1Packet, 10);
651 TexManager.ReloadTexture(Vif1Packet, 11);
659 OP_BuildingMap.Draw();
665 MGGetAmbient(saved_ambient);
668 if (ambient[3] < 128.0f) {
675 MGSetAmbient(ambient);
676 OP_BuildingMap.Draw();
677 MGSetAmbient(saved_ambient);
680 for (
int i = 0; i < 6; i++) {
681 if (i != 1 && CScript__2.
obj[i].
disp) {
682 TexManager.ReloadTexture(Vif1Packet, CharaTex__2[i]);
702 TexManager.ReloadTexture(Vif1Packet, CharaTex__2[1]);
708 static float col = 0.0f;
709 static float am = 0.0f;
713 static sceVu0FMATRIX lcolor;
715 for (
int i = 0; i < 3; i++) {
716 if (lightcolor[i][0] > col) {
720 if (lightcolor[i][1] > col) {
724 if (lightcolor[i][2] > col) {
737 MGSetPLight(light, lcolor);
739 sceVu0FVECTOR lead_ambient = {22.0f, 22.0f, 12.0f, 0.0f};
741 lead_ambient[3] = am;
747 MGSetAmbient(lead_ambient);
757 MGSetAmbient(ambientlight);
758 MGSetPLight(light, lightcolor);
760 sceVu0FVECTOR crowd_ambient;
762 sceVu0CopyVector(crowd_ambient, ambientlight);
765 if (Cam__2[SceneNp__2].motion_type.state.time > 249.0f) {
768 if (DancerAmb < 0.0f) {
772 crowd_ambient[3] = DancerAmb;
778 if (CScript__2.
obj[6].
disp && !Pause) {
780 if (DanceWait < 2.0f || DanceWait > 490.0f) {
782 if (DanceWait < 2.0f || DanceWait > 480.0f) {
795 if (DanceWait > 10000) {
801 TexManager.ReloadTexture(Vif1Packet, CharaTex__2[6]);
803 MGSetAmbient(crowd_ambient);
809 TexManager.ReloadTexture(Vif1Packet, 6);
810 Chara__3[7].
SetPosition(DancerPos[0][0], DancerPos[0][1], DancerPos[0][2]);
811 Chara__3[7].
SetRotation(DancerRot[0][0], DancerRot[0][1], DancerRot[0][2]);
812 MGSetAmbient(crowd_ambient);
851 for (
int i = 1; i < crowd_count; i++) {
854 frame->SetPosition(DancerPos[i][0], DancerPos[i][1], DancerPos[i][2]);
855 frame->SetRotation(DancerRot[i][0], DancerRot[i][1], DancerRot[i][2]);
856 MGSetAmbient(crowd_ambient);
862 MGSetAmbient(ambientlight);
866 TexManager.ReloadTexture(GetVif1Packet(), 0);
867 OP_CharaFrame__2 = Cam__2[SceneNp__2].
frame;
868 sceVu0CopyVector(eye, OP_CharaFrame__2->
position);
876 for (
int i = 0; i < OP_FireList; i++) {
877 float z = OP_FirePosition[i][2];
878 float y = OP_FirePosition[i][1];
879 float x = OP_FirePosition[i][0];
881 CFire.
pos[0] = 10.0f * x;
882 CFire.
pos[1] = 10.0f * y;
883 CFire.
pos[2] = 10.0f * z;
885 CFire.DrawFire(1, 1, &OP_MainCamera, eye, OP_FireScale[i], 15, 15.0f);
890 static float cnt = 1024.0f;
893 if (CScript__2.
sprite == 1) {
894 TexManager.ReloadTexture(Vif1Packet, 7);
896 int alpha = (int) (128.0f - cnt / 4.0f);
902 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"ex", -1),
CRect<int>((
int) (272.0f - cnt / 2.0f), (
int) (10.0f - cnt / 2.0f), (
int) (128.0f + cnt), (
int) (128.0f + cnt)),
CRect<int>(0, 0, 128, 128), (u_char) alpha);
922 TexManager.ReloadTexture(Vif1Packet, 22);
934 float dof[] = {50.0f};
936 DepthOfField(dof, 1, 56, 0);
939 float dof[2] = {200.0f, 400.0f};
942 float draw_phase0 = 0.0f, draw_phase1 = 0.0f, draw_phase2 = 0.0f, draw_phase3 = 0.0f, draw_phase4 = 0.0f, draw_phase5 = 0.0f, draw_phase6 = 0.0f, draw_phase7 = 0.0f;
943 DepthOfField(dof, 2, 40, 0);
958static void DrawCloud() {
959 static sceVu0FVECTOR ambient = {0.0f, 0.0f, 0.0f, 0.0f};
960 static float sc = 0.0f;
962 if (CScript__2.
sprite == 2) {
966 if (CloudFlag == 1) {
967 TexManager.ReloadTexture(Vif1Packet, 8);
973 Cloud.
frame->SetScale(sc, sc, sc);
983 sceVu0FVECTOR saved_ambient;
985 MGGetAmbient(saved_ambient);
986 MGSetAmbient(ambient);
989 MGSetAmbient(saved_ambient);
996 if (ambient[3] < 80.0f) {
1016static void SmokeProcess() {
1030 sceVu0FVECTOR chimney_position = {0.0f, 80.0f, 22.0f, 1.0f};
1031 sceVu0FVECTOR alternate_position = {-30.0f, 100.0f, 30.0f, 1.0f};
1034 sceVu0CopyVector(param.
position, chimney_position);
1036 sceVu0CopyVector(param.
position, alternate_position);
1045 param.
velocity_y = 1.5f + 0.2f * (float) rand() / 2147483648.0f;
1049 param.
texture = TexManager.GetTexture(
"cloud2", -1);
1054 Smoke.EnterEffect(¶m);
1061 sceVu0FVECTOR second_position = {0.0f, 50.0f, -17.0f, 1.0f};
1063 sceVu0CopyVector(param.
position, second_position);
1064 Smoke.EnterEffect(¶m);
1068 float motion_phase0 = 0.0f, motion_phase1 = 0.0f, motion_phase2 = 0.0f, motion_phase3 = 0.0f, motion_phase4 = 0.0f, motion_phase5 = 0.0f, motion_phase6 = 0.0f, motion_phase7 = 0.0f, motion_phase8 = 0.0f, motion_phase9 = 0.0f, motion_phase10 = 0.0f;
1077void OpA_MotionProcess() {
1082 MGSetRenderInfo(mgRenderInfo.
scale[0], 10.0f, 0xffff);
1086 MGSetRenderInfo(mgRenderInfo.
scale[0], (
float) ((1 << 3) + 2), (0x10000 - 1));
1091 MGSetRenderInfo(mgRenderInfo.
scale[0], 16.0f, 0xffff);
1098 MGSetRenderInfo(mgRenderInfo.
scale[0], 18.0f, 0xffff);
1102 MGSetRenderInfo(mgRenderInfo.
scale[0], 6.0f, 0xffff);
1121 if (Cam__2[SceneNp__2].motion_type.state.time < 56.0f) {
1128 if (CloudFlag == 1) {
1137 sceVu0FVECTOR reference;
1139 OP_MainCamera.
GetRef(reference);
1140 reference[0] += (float) (rand() % d) / 10.0f;
1141 reference[1] += (float) (rand() % d) / 10.0f;
1142 reference[2] += (float) (rand() % d) / 10.0f;
1143 OP_MainCamera.
SetRef(reference);
1146 for (
int i = 0; i < OP_AnimeSeqRot; i++) {
1147 ObjAnimePlay(&OP_AnimeSeq[i]);
1150 for (
int i = 0; i < 6; i++) {
1153 if (Chara__3[i].motion_type.state.time > (
float) (Chara__3[i].motion_type.motion_info[CScript__2.
obj[i].
motion].end - 1)) {
1161 if (CScript__2.
obj[i].
step == 1.0f) {
1162 if (CScript__2.
obj[i].
motion != Chara__3[i].motion_no) {
1184 char *frame_names[23] = {
"c07a",
"c08a",
"c11a",
"c09a",
"c08a",
"c08c",
"p19a",
"p17a", 0, 0, 0, 0,
1185 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
1186 sceVu0FMATRIX matrix;
1188 for (
int i = 0; i < 8; i++) {
1190 CFrame *frame = Cam__2[SceneNp__2].
frame->SearchFrame(frame_names[i]);
1193 frame->GetLWMatrix(matrix);
1196 Chara__3[i].
SetRotation(0.0f, (
float) (atan2f(matrix[2][0], matrix[2][2]) + PI_D), 0.0f);
1197 }
else if (i == 5) {
1198 float tilt = atan2f(-matrix[2][1], matrix[2][2]);
1204 if (tilt < -3.14f) {
1208 Chara__3[i].
SetRotation(tilt, atan2f(matrix[2][0], matrix[2][2]), 0.0f);
1210 Chara__3[i].
SetRotation(0.0f, atan2f(matrix[2][0], matrix[2][2]), 0.0f);
1216 if (Chara__3[i].motion_type.state.time > 345 && Chara__3[i].motion_type.state.time < 350.0f) {
1218 }
else if (Chara__3[i].motion_type.state.time >= 350.0f) {
1226 float x = matrix[3][0];
1227 float y = matrix[3][1] - f;
1228 float z = matrix[3][2];
1232 float x = matrix[3][0];
1233 float y = matrix[3][1];
1234 float z = matrix[3][2];
1246 for (
int i = 0; i < 23; i++) {
1247 if (CScript__2.
obj[i].
load != -1) {
1248 LoadCharaData(CScript__2.
obj[i].
load, i);
1262static void MoveDancers() {
1263 char *frame_names[35] = {
"p17a1",
"p17a2",
"p17a3",
"p17a4",
"p17a5",
"p17a6",
"p17a7",
"p17a8",
1264 "p17a9",
"p17a10",
"p17a11",
"p17a12",
"p17a13",
"p17a14",
"p17a15",
1265 "p17a16",
"p17a17",
"p17a18",
"p17a19",
"p17a20",
"p17a21",
"p17a22",
1266 "p17a23",
"p17a24",
"p17a25",
"p17a26",
"p17a27",
"p17a28",
"p17a29",
1267 "p17a30",
"p17a31",
"p17a32",
"p17a33",
"p17a34",
"p17a35"};
1268 sceVu0FMATRIX matrix;
1271 for (
int i = 0; i < 35; i++) {
1272 CFrame *frame = Cam__2[SceneNp__2].
frame->SearchFrame(frame_names[i]);
1275 frame->GetLWMatrix(matrix);
1276 DancerPos[i][0] = matrix[3][0];
1277 DancerPos[i][1] = matrix[3][1];
1278 DancerPos[i][2] = matrix[3][2];
1279 DancerRot[i][0] = 0.0f;
1280 DancerRot[i][1] = (float) (atan2f(matrix[2][0], matrix[2][2]) + PI_D);
1281 DancerRot[i][2] = 0.0f;
1296static void ReaderShadow() {
1297 sceVu0FMATRIX matrix;
1299 TexManager.ReloadTexture(Vif1Packet, 6);
1301 CFrame *frame = Chara__3[6].
frame->SearchFrame(
"eff20");
1304 frame->GetLWMatrix(matrix);
1305 DrawShadow(matrix[3][0], matrix[3][1], matrix[3][2]);
1308 frame = Chara__3[6].
frame->SearchFrame(
"eff14");
1311 frame->GetLWMatrix(matrix);
1312 DrawShadow(matrix[3][0], matrix[3][1], matrix[3][2]);
1324static void DancerShadow() {
1325 sceVu0FMATRIX matrix;
1335 Chara__3[7].
frame->SearchFrame(
"r_foot")->GetLWMatrix(matrix);
1336 x_address = &matrix[3][0];
1338 y_address = &matrix[3][1];
1340 z_address = &matrix[3][2];
1342 DrawShadow(x, y, z);
1343 Chara__3[7].
frame->SearchFrame(
"l_foot")->GetLWMatrix(matrix);
1347 DrawShadow(x, y, z);
1358static void ShogunShadow() {
1359 sceVu0FMATRIX matrix;
1368 TexManager.ReloadTexture(Vif1Packet, 6);
1369 Chara__3[3].
frame->SearchFrame(
"eff66")->GetLWMatrix(matrix);
1370 x_address = &matrix[3][0];
1372 y_address = &matrix[3][1];
1374 z_address = &matrix[3][2];
1376 DrawShadow(x, y, z);
1377 Chara__3[3].
frame->SearchFrame(
"eff62")->GetLWMatrix(matrix);
1381 DrawShadow(x, y, z);
1392static void ShisaiShadow() {
1393 sceVu0FMATRIX matrix;
1402 TexManager.ReloadTexture(Vif1Packet, 6);
1403 Chara__3[2].
frame->SearchFrame(
"eff93")->GetLWMatrix(matrix);
1404 x_address = &matrix[3][0];
1406 y_address = &matrix[3][1];
1408 z_address = &matrix[3][2];
1410 DrawShadow(x, y, z);
1411 Chara__3[2].
frame->SearchFrame(
"eff99")->GetLWMatrix(matrix);
1415 DrawShadow(x, y, z);
1428static void DrawShadow(
float x,
float y,
float z) {
1429 sceVu0FVECTOR ambient = {0.0f, 0.0f, 0.0f, 64.0f};
1431 ambient[3] -= 10.0f * y;
1433 if (ambient[3] > 0.0f) {
1434 if (ambient[3] > DancerAmb) {
1435 ambient[3] = DancerAmb;
1438 MGSetAmbient(ambient);
1440 float heading = atan2f(x, z);
1442 Shadow->SetPosition(x, 0.05f, z);
1443 Shadow->SetRotation(89.0f * PI_D / 180.0f, heading, 0.0f);
1445 MGSetAmbient(ambientlight);
1454void OpA_SoundProcess() {
1456 typedef float SoundSetup0, SoundSetup1, SoundSetup2, SoundSetup3, SoundSetup4, SoundSetup5, SoundSetup6, SoundSetup7, SoundSetup8, SoundSetup9, SoundSetup10, SoundSetup11, SoundSetup12, SoundSetup13, SoundSetup14;
1459 if (DanceWait > 5.0f) {
1469 sceVu0FVECTOR camera_position;
1470 sceVu0FVECTOR shogun_position;
1472 sceVu0CopyVector(shogun_position, Chara__3[3].pos);
1473 OP_MainCamera.
GetPos(camera_position);
1476 int motion_frame = (int) Chara__3[3].motion_type.state.time;
1477 static int wait = 0;
1480 if (motion_frame > 38 && motion_frame < 40) {
1481 OpPlayVolPanSE(shogun_position, 100.0f, 500.0f, MIDI_PORT_SE_DEFAULT, 21, 28);
1483 }
else if (motion_frame > 48 && motion_frame < 50) {
1484 OpPlayVolPanSE(shogun_position, 100.0f, 500.0f, MIDI_PORT_SE_DEFAULT, 21, 29);
1493 int motion_frame = (int) Chara__3[3].motion_type.state.time;
1494 static int wait = 0;
1497 if (motion_frame > 98 && motion_frame < 100) {
1498 OpPlayVolPanSE(shogun_position, 100.0f, 500.0f, MIDI_PORT_SE_DEFAULT, 21, 28);
1500 }
else if (motion_frame > 108 && motion_frame < 110) {
1501 OpPlayVolPanSE(shogun_position, 100.0f, 500.0f, MIDI_PORT_SE_DEFAULT, 21, 29);
1510 int motion_frame = (int) Chara__3[3].motion_type.state.time;
1511 static int wait = 0;
1514 if (motion_frame > 228 && motion_frame < 230) {
1515 OpPlayVolPanSE(shogun_position, 100.0f, 500.0f, MIDI_PORT_SE_DEFAULT, 21, 28);
1517 }
else if (motion_frame > 238 && motion_frame < 240) {
1518 OpPlayVolPanSE(shogun_position, 100.0f, 500.0f, MIDI_PORT_SE_DEFAULT, 21, 29);
1527 int motion_frame = (int) Chara__3[2].motion_type.state.time;
1528 static int wait = 0;
1531 if (motion_frame > 295 && motion_frame < 297) {
1532 OpPlayVolPanSE(shogun_position, 100.0f, 500.0f, MIDI_PORT_SE_DEFAULT, 21, 28);
1534 }
else if (motion_frame > 298 && motion_frame < 300) {
1535 OpPlayVolPanSE(shogun_position, 100.0f, 500.0f, MIDI_PORT_SE_DEFAULT, 21, 29);
1537 }
else if (motion_frame > 301 && motion_frame < 303) {
1538 OpPlayVolPanSE(shogun_position, 100.0f, 500.0f, MIDI_PORT_SE_DEFAULT, 21, 28);
1546 sceVu0FVECTOR fountain = {0.0f, 0.0f, 0.0f, 0.0f};
1548 OpSetVolPanSE(fountain, 200.0f, 500.0f, 15, 16, 20);
1550 static int seflg = 0;
1551 static int secnt = 0;
1552 static float vol = 128.0f;
1554 if (CloudFlag == 1) {
1556 OpPlayVolSE(MIDI_PORT_SE_TITLE, 16, 28, 0.8f);
1559 sceVu0FVECTOR wind = {0.0f, 50.0f, 0.0f, 0.0f};
1561 OpSetVolPanSE(wind, 100.0f, 400.0f, 15, 16, 28);
1573 if (CScript__2.
camera_start == 44 && Cam__2[SceneNp__2].motion_type.state.time > 252.0) {
1575 if (CScript__2.
camera_start == 44 && Cam__2[SceneNp__2].motion_type.state.time > 249.0) {
1578 while (ReadBGSync())
1581 LoadFileBG(
"opdat/dungeon/o1bbgm.snd", (u_long128 *) read_buffer, 0);
1594 CSnd.
Stop(MIDI_PORT_BGM);
1619static void setTexScroll() {
1620 static int setTexScrollCnt = 0;
1621 static float setTexScrollCntf = 0.0f;
1623 sceGifTag giftag = {0, 1, 0, 0, 0, 0, 1, SCE_GIF_PACKED_AD};
1631 sceVif1PkCnt(Vif1Packet, 0);
1632 sceVif1PkOpenDirectCode(Vif1Packet, 0);
1633 sceVif1PkOpenGifTag(Vif1Packet, *(u_long128 *) &giftag);
1634 sceVif1PkAddGsAD(Vif1Packet, SCE_GS_TEXFLUSH, 0);
1635 sceVif1PkCloseGifTag(Vif1Packet);
1636 sceVif1PkCloseDirectCode(Vif1Packet);
1637 sceVif1PkTerminate(Vif1Packet);
1639 if (setTexScrollCntf <= 0.0f) {
1640 setTexScrollCntf = 126.0f;
1642 setTexScrollCntf -= 0.5f;
1645 setTexScrollCnt = (int) setTexScrollCntf;
1647 plate = TexManager.GetTexture(
"i01t06", -1);
1648 strip = TexManager.GetTexture(
"i01t06a", -1);
1650 if (plate == 0 || strip == 0) {
1654 dbp = plate->
tex0 & 0x3fff;
1655 sbp = strip->
tex0 & 0x3fff;
1656 dbw = (plate->
tex0 >> 14) & 0x3f;
1657 sbw = (strip->
tex0 >> 14) & 0x3f;
1659 if (setTexScrollCnt != 128) {
1660 MoveImageTest(Vif1Packet, sbp, sbw, 0,
CRect<int>(0, setTexScrollCnt, 128, 128 - setTexScrollCnt), dbp, dbw, 0, 0, 0, 0);
1663 if (setTexScrollCnt != 0) {
1664 MoveImageTest(Vif1Packet, sbp, sbw, 0,
CRect<int>(0, 0, 128, setTexScrollCnt), dbp, dbw, 0, 0, 128 - setTexScrollCnt, 0);
1676static void setCloudTexScroll() {
1677 static int setTexScrollCnt = 0;
1678 static float setTexScrollCntf = 0.0f;
1680 sceGifTag giftag = {0, 1, 0, 0, 0, 0, 1, SCE_GIF_PACKED_AD};
1688 sceVif1PkCnt(Vif1Packet, 0);
1689 sceVif1PkOpenDirectCode(Vif1Packet, 0);
1690 sceVif1PkOpenGifTag(Vif1Packet, *(u_long128 *) &giftag);
1691 sceVif1PkAddGsAD(Vif1Packet, SCE_GS_TEXFLUSH, 0);
1692 sceVif1PkCloseGifTag(Vif1Packet);
1693 sceVif1PkCloseDirectCode(Vif1Packet);
1694 sceVif1PkTerminate(Vif1Packet);
1696 if (setTexScrollCntf <= 0.0f) {
1697 setTexScrollCntf = 126.0f;
1699 setTexScrollCntf -= 0.5f;
1702 setTexScrollCnt = (int) setTexScrollCntf;
1704 plate = TexManager.GetTexture(
"cloud", -1);
1705 strip = TexManager.GetTexture(
"cloudan", -1);
1707 if (plate == 0 || strip == 0) {
1711 dbp = plate->
tex0 & 0x3fff;
1712 sbp = strip->
tex0 & 0x3fff;
1713 dbw = (plate->
tex0 >> 14) & 0x3f;
1714 sbw = (strip->
tex0 >> 14) & 0x3f;
1716 if (setTexScrollCnt != 128) {
1717 MoveImageTest(Vif1Packet, sbp, sbw, 0,
CRect<int>(0, setTexScrollCnt, 128, 128 - setTexScrollCnt), dbp, dbw, 0, 0, 0, 0);
1720 if (setTexScrollCnt != 0) {
1721 MoveImageTest(Vif1Packet, sbp, sbw, 0,
CRect<int>(0, 0, 128, setTexScrollCnt), dbp, dbw, 0, 0, 128 - setTexScrollCnt, 0);
void SetRef(CFrame *parent, float x, float y, float z)
virtual void LoadPackData(unsigned int *pack, char *name, CDataAlloc2< 1 > *model_alloc, CDataAlloc2< 1 > *texture_alloc)
tagMOTION_TYPE motion_type
virtual void SetRotation(float x, float y, float z)
virtual void Initialize()
virtual void SetPosition(float x, float y, float z)
float position_oscillation_rate_x
int position_oscillation_flags
float position_oscillation_x
CategoryAttr category[16]
void SE_Play(int port, int bank, int program, int pan, int velocity, int volume, int voice)
int LoadSoundFileFromPack(char *name, unsigned int *pack)
void SetVol(int port, int volume)
void SetReverb(int core, int mode, int depth)
sceVu0FVECTOR start_value
MOTION_INFO * motion_info