3#pragma argument_flag_ones 14, 16, 20, 22, 31, 33, 45, 47, 129
6#pragma argument_flag_ones 14, 16, 20, 22, 31, 33, 45, 47, 109, 418
7#pragma argument_flag_ones 430, 452, 453, 463, 464, 474, 475, 485, 486, 533
8#pragma argument_flag_ones 534, 537, 547, 548, 551, 561, 562, 565, 585, 586
9#pragma argument_flag_ones 589, 599, 600, 603, 615, 616, 619, 629, 630, 633
10#pragma argument_flag_ones 643, 644, 647, 657, 658, 661, 671, 672, 675, 685
11#pragma argument_flag_ones 686, 689, 699, 700, 703, 713, 714, 717, 727, 728
12#pragma argument_flag_ones 731, 744, 745, 748, 762, 768, 775
31#include "dataalloc.hpp"
34#include "framevu1.hpp"
41#include "title/cursol.hpp"
42#include "title/logo.hpp"
43#include "title/scfader.hpp"
44#include "title/sprite.hpp"
59 CRect(T left, T top, T width, T height) {
86void InitOpeningBook(u_long128 *pack,
int *param);
88void OpeningBookDraw();
90#include "editloop.hpp"
91#include "gamemode.hpp"
94#include "menu_save.hpp"
98#include "title/dispfade.hpp"
99#include "title/op_a.hpp"
100#include "title/op_b.hpp"
101#include "title/op_c.hpp"
102#include "title/rushmovi.hpp"
103#include "title/script.hpp"
104#include "title/title.hpp"
108#include "mainselect.hpp"
125 void SetVertex(
float *corner0,
float *corner1,
float *corner2,
float *corner3);
126 void SetSize(
int row_count,
int column_count,
CDataAlloc2<1> *arena);
127 void SetParam(
float speed,
float damping_rate,
float scale,
float shift);
128 void SetColor(u_char red, u_char green, u_char blue, u_char alpha);
129 void Shake(
int x,
int y,
float height_change);
141 virtual void FrameObjectOnOff(
char *name,
int on);
164 void DrawShadow(
int fast);
175 void Set(
float *origin);
197 void SetPosition(
float x,
float y,
float z) {
204 void DrawFire(
int unused0,
int unused1,
CCamera *camera,
float *eye,
float scale,
int layers,
float camera_offset);
219void InitializeDataBuffer();
223void TiPlayVolSE(
int group,
int no,
int voice,
float volume);
242void TitleInit(
int mode) {
244 float scale = 750.0f;
245 float far_z = 65535.0f;
247 InitializeDataBuffer();
248 SetDataBuffer(&VisualData, 200000);
249 SetDataBuffer(&MotionData, 500000);
250 SetDataBuffer(&TextureData, 300000);
251 SetPacketReadBuffer(40000, 300000);
253 MGSetRenderInfo(scale, 4.0f, far_z);
254 Camera.
SetRef(0, 0.0f, 0.0f, 0.0f);
259 Camera.
SetPos(0, zero, zero, zero);
264 MGSetBGColor(0.0f, 0.0f, 0.0f, 128.0f);
269 {
"#frame_image_mes#640#448#4", 26, 0},
271 {
"#fukidashibase#640#" HALF_BUFFER_HEIGHT_STR
"#4", 26, 0},
272 {
"#fontbase#512#256#1", 26, 0},
273 {
"meswin/gaiji.img", 26, 0},
274 {
"meswin/fuki256.img", 26, 0},
275 {
"meswin/syst04.img", 26, 0},
279 TexManager.Initialize(16352);
280 TexManager.LoadTextureBlock(-1, tex, read_buffer);
281 LoadFileMenuData(
"stayframe.img", (u_int *) read_buffer);
282 TexManager.EnterFixTextureZ((u_char *) read_buffer);
285 switch (LanguageCode) {
287 LoadFile(
"titledat/title.pak", (
void *) read_buffer, 0);
289 case LANG_ENGLISH_US:
290 LoadFile(
"titledat/title.pak", (
void *) read_buffer, 0);
292 case LANG_ENGLISH_UK:
293 LoadFile(
"titledat/title_eu.pak", (
void *) read_buffer, 0);
296 LoadFile(
"titledat/title_f.pak", (
void *) read_buffer, 0);
299 LoadFile(
"titledat/title_g.pak", (
void *) read_buffer, 0);
302 LoadFile(
"titledat/title_i.pak", (
void *) read_buffer, 0);
305 LoadFile(
"titledat/title_s.pak", (
void *) read_buffer, 0);
309 LoadFile(
"titledat/title.pak", (
void *) read_buffer, 0);
314 {(
char *)
"#frame_image#640#" HALF_BUFFER_HEIGHT_STR
"#4", 0, 0},
315 {(
char *)
"#frame_image#640#" HALF_BUFFER_HEIGHT_STR
"#4", 1, 0},
327 tex2[2].
name = (
char *) GetPackFile(read_buffer,
"bg.img", 0);
328 tex2[3].
name = (
char *) GetPackFile(read_buffer,
"title.img", 0);
329 tex2[4].
name = (
char *) GetPackFile(read_buffer,
"main.img", 0);
330 tex2[5].
name = (
char *) GetPackFile(read_buffer,
"pat01.img", 0);
331 tex2[6].
name = (
char *) GetPackFile(read_buffer,
"pat02.img", 0);
332 tex2[7].
name = (
char *) GetPackFile(read_buffer,
"start.img", 0);
333 tex2[8].
name = (
char *) GetPackFile(read_buffer,
"start3.img", 0);
334 tex2[9].
name = (
char *) GetPackFile(read_buffer,
"icon01.img", 0);
337 {(
char *)
"#frame_image#640#224#4", 0, 0},
338 {(
char *)
"#frame_image#640#224#4", 1, 0},
339 {(
char *)
"#frame_image#640#224#4", 2, 0},
340 {(
char *)
"#frame_image#640#224#4", 3, 0},
353 tex2[4].
name = (
char *) GetPackFile(read_buffer,
"bg.img", 0);
354 tex2[5].
name = (
char *) GetPackFile(read_buffer,
"title.img", 0);
355 tex2[6].
name = (
char *) GetPackFile(read_buffer,
"main.img", 0);
356 tex2[7].
name = (
char *) GetPackFile(read_buffer,
"pat01.img", 0);
357 tex2[8].
name = (
char *) GetPackFile(read_buffer,
"pat02.img", 0);
358 tex2[9].
name = (
char *) GetPackFile(read_buffer,
"start.img", 0);
359 tex2[10].
name = (
char *) GetPackFile(read_buffer,
"start3.img", 0);
360 tex2[11].
name = (
char *) GetPackFile(read_buffer,
"icon01.img", 0);
361 tex2[12].
name = (
char *) GetPackFile(read_buffer,
"trial.img", 0);
363 TexManager.LoadTextureBlock(-1, tex2);
367 ObjectFrame3 = LoadMDSFile(GetPackFile(read_buffer,
"sky.mds", 0), 2, 0);
371 ObjectFrame3->SetPosition(pos);
373 Cloud__2.
LoadPackData(read_buffer,
"cloud.cfg", &MotionData, 0);
382 Logo.
LoadPackData(read_buffer,
"logo.cfg", &MotionData, 0);
391 "logo_p1.cfg",
"logo_p2.cfg",
"logo_p3.cfg",
"logo_p4.cfg",
"logo_p5.cfg",
392 "logo_p6.cfg",
"logo_p7.cfg",
"logo_p8.cfg",
"logo_p9.cfg"};
394 for (i = 0; i < 9; i++) {
395 Spark[i].
LoadPackData(read_buffer, name[i], &MotionData, 0);
408 CSnd.
SetVol(MIDI_PORT_SE_TITLE, 256);
409 CSnd.
SetVol(MIDI_PORT_SE_DEFAULT, 256);
410 CSnd.
SetVol(MIDI_PORT_UNK_D, 256);
411 CSnd.
SetVol(MIDI_PORT_SE_SPECIAL, 256);
412 CSnd.
SQ_Play(MIDI_PORT_AMBIENT, 0);
414 Fade1 = Fade2 = Fade3 = Fade4 = Wait = 0;
431 for (i = 0; i < 10; i++) {
442 sceVu0FMATRIX matrix;
445 sceVif1PkCall(Vif1Packet, (u_long128 *) Vu_prog0f, 0);
449 MGSetViewMatrix(matrix, pos);
453 case TITLE_STEP_FADE_IN:
458 if (GamePad.
Down(PAD_START) && EffCnt > 16) {
469 case TITLE_STEP_RETURN_FADE_IN:
476 case TITLE_STEP_WAIT:
483 if (GamePad.
Down(PAD_START)) {
489 case TITLE_STEP_LOGO:
491 TiPlayVolSE(MIDI_PORT_SE_DEFAULT, 38, 21, 1.0f);
496 if (GamePad.
Down(PAD_START)) {
504 for (i = 0; i < 9; i++) {
514 Fade2 = (Fade2 + 2) & 0x7f;
517 if (keywait >= 500) {
525 if (Fade1 > 127 && GamePad.
Down(PAD_START)) {
526 TiPlayVolSE(MIDI_PORT_UNK_D, 122, 25, 1.0f);
543 case TITLE_STEP_MENU:
547 if (GamePad.
Down(PAD_UP)) {
550 TiPlayVolSE(MIDI_PORT_UNK_D, 122, 24, 1.0f);
553 if (GamePad.
Down(PAD_DOWN)) {
556 TiPlayVolSE(MIDI_PORT_UNK_D, 122, 24, 1.0f);
569 case TITLE_MENU_NEW_GAME:
572 case TITLE_MENU_NEW_GAME:
577 case TITLE_MENU_LOAD:
580 case TITLE_MENU_LOAD:
585 case TITLE_MENU_OPTION:
588 case TITLE_MENU_OPTION:
594 if (GamePad.
Down(PAD_START) || GamePad.
Down(PAD_CROSS)) {
595 TiPlayVolSE(MIDI_PORT_SE_DEFAULT, 38, 20, 1.0f);
600 if (GamePad.
Down(PAD_CIRCLE)) {
601 Fade1 = Fade2 = Fade3 = Fade4 = 0;
619 case TITLE_STEP_MENU_BLINK:
630 case TITLE_STEP_MENU_FADE_OUT:
635 case TITLE_MENU_NEW_GAME:
638 case TITLE_MENU_LOAD:
641 case TITLE_MENU_OPTION:
649 case TITLE_STEP_ATTRACT_FADE_OUT:
652 CSnd.
Stop(MIDI_PORT_BGM);
659 case TITLE_STEP_OPENING_BOOK_INIT:
661 CSnd.
Stop(MIDI_PORT_BGM);
664 CSnd.
SetVol(MIDI_PORT_SE_TITLE, 256);
665 CSnd.
SetVol(MIDI_PORT_SE_DEFAULT, 256);
666 CSnd.
SetVol(MIDI_PORT_UNK_D, 256);
667 CSnd.
SetVol(MIDI_PORT_SE_SPECIAL, 256);
668 CSnd.
SQ_Play(MIDI_PORT_BGM, 0);
669 TiPlayVolSE(MIDI_PORT_SE_TITLE, 16, 24, 0.5f);
671 int book[2] = {2, 60};
673 InitOpeningBook((u_long128 *) read_buffer, book);
678 case TITLE_STEP_OPENING_BOOK:
679 if (OpeningBookKey()) {
685 case TITLE_STEP_SAVE_INIT:
686 InitMenuSave(SAVE_MENU_MODE_LOAD, 2, 0);
690 case TITLE_STEP_SAVE:
691 switch (MenuSaveKey()) {
692 case MENU_SAVE_RUNNING:
695 case MENU_SAVE_LOADED:
699 MapJump(*(s32 *) ((
char *) SaveData + 0x1C8), -1);
702 case MENU_SAVE_CLOSED:
711 case TITLE_STEP_OPTION_INIT:
712 InitMenuOption(OPTION_OPEN_TITLE, 2, 0);
716 case TITLE_STEP_OPTION:
719 if (MenuOptionKey()) {
727 case TITLE_STEP_EXIT:
729 CSnd.
Stop(MIDI_PORT_BGM);
741#define MENU_Y(y) ((y) + (SCREEN_HEIGHT - 448) / 2)
744 sceVu0FVECTOR light0 = {2.4578f, 9.9294f, -2.8074f, 0.0f};
745 sceVu0FVECTOR light1 = {4.6086f, -10.4028f, -0.8286f, 0.0f};
746 sceVu0FVECTOR light2 = {0.0f, 0.0f, -10.0f, 0.0f};
748 sceVu0FMATRIX color = {
749 {191.0f, 105.0f, 76.0f, 128.0f},
750 {63.0f, 51.0f, 127.0f, 128.0f},
751 {40.0f, 30.0f, 30.0f, 128.0f},
752 {0.0f, 0.0f, 0.0f, 0.0f }
754 sceVu0FVECTOR light0b = {0.0f, 6.0f, -8.0f, 0.0f};
755 sceVu0FVECTOR light1b = {0.0f, 0.0f, 0.0f, 0.0f};
756 sceVu0FVECTOR light2b = {0.0f, 0.0f, 0.0f, 0.0f};
757 sceVu0FMATRIX lightb;
758 sceVu0FMATRIX colorb = {
759 {128.0f, 128.0f, 112.0f, 128.0f},
760 {0.0f, 0.0f, 0.0f, 0.0f },
761 {0.0f, 0.0f, 0.0f, 0.0f },
762 {0.0f, 0.0f, 0.0f, 0.0f }
764 sceVu0FVECTOR ambient = {0.0f, 0.0f, 0.0f, 100.0f};
768 ambient[3] = (float) CFade.
Get(128);
773 MGSetAmbient(ambient);
775 sceVu0Normalize(light0, light0);
776 sceVu0Normalize(light1, light1);
777 sceVu0Normalize(light2, light2);
778 sceVu0NormalLightMatrix(light, light0, light1, light2);
779 MGSetPLight(light, color);
782 static float rot[4] = {0.0f, 0.0f, 0.0f, 0.0f};
784 TexManager.ReloadTexture(GetVif1Packet(), 0);
787 if (rot[1] > 3.14f) {
791 ObjectFrame3->SetRotation(rot[0], rot[1], rot[2]);
792 MGDraw(ObjectFrame3);
796 TexManager.ReloadTexture(GetVif1Packet(), 1);
799 ambient[3] = (float) CFade.
Get(100);
804 MGSetAmbient(ambient);
808 if (
CProcess.
no != TITLE_STEP_FADE_IN || CFade.
Get(128) >= 4) {
817 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"frame_image", -1),
CRect<int>(0, 0, 640, 85),
CRect<int>(1, 0, 639, 45), 112);
819 for (i = 1; i < 4; i++) {
820 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"frame_image", -1),
CRect<int>(0, i * 84 + 1, 640, 84),
CRect<int>(1, i * 42, 639, 45), 114);
823 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"frame_image", -1),
CRect<int>(0, 336, 640, 105),
CRect<int>(1, 167, 639, 57), 114);
825 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"frame_image", -1),
CRect<int>(0, 441, 640, 39),
CRect<int>(1, 220, 639, 19), 114);
827 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"frame_image", -1),
CRect<int>(0, 440, 640, 8),
CRect<int>(1, 220, 639, 3), 114);
837 MGGetFBuffTex(&tex0);
838 image = *(
sceGsTex0 *) &TexManager.GetTexture(
"frame_image", -1)->
tex0;
840 MGStretchMoveImage(&tex0,
CRect<int>(0, 0, 10240, SCREEN_HALF_HEIGHT * 16), &image,
CRect<int>(0, 0, 10240, SCREEN_HALF_HEIGHT * 16));
845 case TITLE_STEP_LOGO:
846 case TITLE_STEP_RETURN_FADE_IN:
847 case TITLE_STEP_MENU:
848 case TITLE_STEP_MENU_BLINK:
849 case TITLE_STEP_MENU_FADE_OUT:
850 case TITLE_STEP_ATTRACT_FADE_OUT:
851 sceVu0Normalize(light0b, light0b);
852 sceVu0Normalize(light1b, light1b);
853 sceVu0Normalize(light2b, light2b);
854 sceVu0NormalLightMatrix(lightb, light0b, light1b, light2b);
855 MGSetPLight(lightb, colorb);
859 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"main", -1),
CRect<int>(0, 62, 288, 170),
CRect<int>(0, 0, 288, 170), (u_char) CFade.
Get(Fade4));
860 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"main", -1),
CRect<int>(288, 112, 72, 190),
CRect<int>(288, 50, 72, 190), (u_char) CFade.
Get(Fade4));
861 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"main", -1),
CRect<int>(360, 142, 412, 160),
CRect<int>(360, 80, 412, 160), (u_char) CFade.
Get(Fade4));
863 ambient[3] = (float) CFade.
Get(128);
864 MGSetAmbient(ambient);
866 if (CFade.
Get(128) == 128) {
870 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"start", -1),
CRect<int>(64, MENU_Y(362), 512, 64),
CRect<int>(0, 64, 512, 64), (u_char) CFade.
Get(Fade1));
873 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"start", -1),
CRect<int>(64, MENU_Y(296), 512, 64),
CRect<int>(0, 0, 512, 64), (u_char) CFade.
Get(Fade2));
878 if (brinkcnt % 3 == 0) {
888 case TITLE_MENU_NEW_GAME:
889 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"start3", -1),
CRect<int>(193, MENU_Y(280), 256, 32),
CRect<int>(0, 0, 256, 32), (u_char) CFade.
Get(br));
890 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"start3", -1),
CRect<int>(193, MENU_Y(312), 256, 32),
CRect<int>(0, 32, 256, 32), (u_char) CFade.
Get(32));
891 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"start3", -1),
CRect<int>(193, MENU_Y(344), 256, 32),
CRect<int>(0, 64, 256, 32), (u_char) CFade.
Get(32));
894 case TITLE_MENU_LOAD:
895 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"start3", -1),
CRect<int>(193, MENU_Y(280), 256, 32),
CRect<int>(0, 0, 256, 32), (u_char) CFade.
Get(32));
896 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"start3", -1),
CRect<int>(193, MENU_Y(312), 256, 32),
CRect<int>(0, 32, 256, 32), (u_char) CFade.
Get(br));
897 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"start3", -1),
CRect<int>(193, MENU_Y(344), 256, 32),
CRect<int>(0, 64, 256, 32), (u_char) CFade.
Get(32));
900 case TITLE_MENU_OPTION:
901 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"start3", -1),
CRect<int>(193, MENU_Y(280), 256, 32),
CRect<int>(0, 0, 256, 32), (u_char) CFade.
Get(32));
902 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"start3", -1),
CRect<int>(193, MENU_Y(312), 256, 32),
CRect<int>(0, 32, 256, 32), (u_char) CFade.
Get(32));
903 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"start3", -1),
CRect<int>(193, MENU_Y(344), 256, 32),
CRect<int>(0, 64, 256, 32), (u_char) CFade.
Get(br));
907 if (
CProcess.
no != TITLE_STEP_ATTRACT_FADE_OUT) {
911 RECT rect = {0, 0, 32, 32};
913 DrawObjectVibe(225,
CCursol.
GetPos(), TexManager.GetTexture(
"icon01", -1), rect, 128, CFade.
Get(128));
920 case TITLE_STEP_OPENING_BOOK:
921 TexManager.ReloadTexture(GetVif1Packet(), 2);
925 case TITLE_STEP_SAVE:
926 TexManager.ReloadTexture(GetVif1Packet(), 2);
930 case TITLE_STEP_OPTION:
931 TexManager.ReloadTexture(GetVif1Packet(), 2);
939 MGGetFBuffBackTex(&backtex);
943 texture.
tex0 = *(u_long *) &backtex;
944 set2DSprite(Vif1Packet, &texture,
CRect<int>(0, 0, 640, 448),
CRect<int>(0, 0, 640, 224), 128, 128, 128, 35);
void SetHeight(float height)
void SetFollow(float x, float y, float z)
void SetDistance(float distance)
virtual void Step(int steps)
void SetAngle(float angle)
void GetCameraMatrix(float(*matrix)[4])
void SetRef(CFrame *parent, float x, float y, float z)
void SetPos(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 SetPosition(float x, float y, float z)
void Set(float new_target_y)
void MenuModeOn(int threshold)
void SetAutoRepeat(int mask, int initial_delay, int repeat_delay)
void Sparkdraw(float time)
void Set(float *position)
int LoadSoundFileFromPack(char *name, unsigned int *pack)
void SetVol(int port, int volume)
void SQ_Play(int port, int seq_no)
void SetReverb(int core, int mode, int depth)