143 int bg_color[4][4] = {
147 {0x80, 0x80, 0x80, 0},
149 float light_dir[3][4] = {
150 {0.5f, 0.5f, 0.5f, 0.0f},
151 {0.0f, -0.4f, -0.1f, 0.0f},
152 {-0.5f, -0.5f, 0.5f, 0.0f},
154 float light_color[3][4] = {
155 {0.48f, 0.48f, 0.03f, 0.0f},
156 {0.5f, 0.33f, 0.2f, 0.0f},
157 {0.14f, 0.14f, 0.38f, 0.0f},
159 float ambient[4] = {0.5f, 0.5f, 0.5f, 0.0f};
164 strcpy((
char *) this->
icon_sys.
title_name,
"\x82\x63\x82\x81\x82\x92\x82\x8B\x81\x40\x82\x62\x82\x8C\x82\x8F"
165 "\x82\x95\x82\x84\x81\x40\x82\x63\x82\x81\x82\x94\x82\x81");
369 switch (this->
step) {
374 InitSaveFileInfoTbl();
390 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
399 if (result == sceMcResNoEntry || result == sceMcResNoFormat) {
411 strcat(pattern,
"*");
413 if (sceMcGetDir(this->
port, 1, pattern, 0, 15, SaveFileInfo) == 0) {
421 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
425 if (cmd != 0xD || (cmd == 0xD && result < 0)) {
442 port_no = this->
port;
444 switch (this->
step) {
446 if (sceMcOpen(port_no, 1, this->
dir_name, 1) == 0) {
454 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
458 if (cmd != 2 || (cmd == 2 && result < 0)) {
465 sys_config.
values[17] = 1;
476 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
480 if (cmd != 5 || (cmd == 5 && result < 0)) {
490 if (sceMcClose(this->
fd) == 0) {
498 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
502 if (cmd != 3 || (cmd == 3 && result < 0)) {
507 for (i = 0; i < 12; i++) {
523 port_no = this->
port;
525 switch (this->
step) {
527 if (sceMcOpen(port_no, 1, this->
dir_name, 2) == 0) {
535 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
539 if (cmd != 2 || (cmd == 2 && result < 0)) {
548 for (i = 0; i < 18; i++) {
549 printf(
"config%d = %d\n", i, sys_config.
values[i]);
560 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
564 if (cmd != 6 || (cmd == 6 && result < 0)) {
574 if (sceMcFlush(this->
fd) == 0) {
582 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
586 if (cmd != 0xA || (cmd == 0xA && result < 0)) {
590 if (sceMcClose(this->
fd) == 0) {
598 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
602 if (cmd != 3 || (cmd == 3 && result < 0)) {
618 sceMcChdir(this->
port, 1,
"/", NULL);
619 sceMcSync(MC_WAIT, &cmd, &result);
620 sceMcOpen(this->
port, 1,
"test", 0x202);
621 sceMcSync(MC_WAIT, &cmd, &result);
623 sceMcWrite(this->
fd, buffer, 0x76F800);
624 sceMcSync(MC_WAIT, &cmd, &result);
625 sceMcFlush(this->
fd);
626 sceMcSync(MC_WAIT, &cmd, &result);
627 sceMcClose(this->
fd);
628 sceMcSync(MC_WAIT, &cmd, &result);
637 char buffer[0x19000];
641 sceMcChdir(this->
port, 1,
"/",
"");
642 sceMcSync(MC_WAIT, &cmd, &result);
643 printf(
"move to dir\n");
648 printf(
"create new dir\n");
650 for (i = 0; i < MC_SAVE_FILE_MAX; i++) {
651 strcpy(src_name,
"BASCUS-97112dkcloud/");
653 strcat(src_name,
"%d");
654 sprintf(src_name, src_name, i);
655 strcpy(dst_name,
"BASCUS-97111dkcloud/");
657 strcat(dst_name,
"%d");
658 sprintf(dst_name, dst_name, i);
660 if (sceMcOpen(this->
port, 1, src_name, 1) != 0) {
664 sceMcSync(MC_WAIT, &cmd, &result);
666 if (cmd != 2 || (cmd == 2 && result < 0)) {
671 printf(
"fname = %s\n", src_name);
674 sceMcSync(MC_WAIT, &cmd, &result);
676 sceMcSync(MC_WAIT, &cmd, &result);
678 if (sceMcOpen(this->
port, 1, dst_name, 0x202) != 0) {
682 sceMcSync(MC_WAIT, &cmd, &result);
684 if (cmd != 2 || (cmd == 2 && result < 0)) {
689 printf(
"fname = %s\n", dst_name);
690 memset(buffer, 0, 0x136E7);
692 sceMcSync(MC_WAIT, &cmd, &result);
694 sceMcSync(MC_WAIT, &cmd, &result);
695 printf(
"save %d\n", i);
697 sceMcSync(MC_WAIT, &cmd, &result);
705 static int iconNo = -1;
709 switch (this->
step) {
719 if (sceMcSync(MC_NOWAIT, &cmd, &status) == 0) {
727 if (cmd == 0xB && status < 0) {
742 if (sceMcSync(MC_NOWAIT, &cmd, &status) == 0) {
746 if (cmd != 0xC || (cmd == 0xC && status < 0)) {
760 if (sceMcSync(MC_NOWAIT, &cmd, &status) == 0) {
764 if (cmd != 2 || (cmd == 2 && status < 0)) {
771 memset(mcdmybuf, 0,
sizeof(mcdmybuf));
782 if (sceMcSync(MC_NOWAIT, &cmd, &status) == 0) {
786 if (cmd != 6 || (cmd == 6 && status < 0)) {
797 if (sceMcClose(this->
fd) == 0) {
805 if (sceMcSync(MC_NOWAIT, &cmd, &status) == 0) {
809 if (cmd != 3 || (cmd == 3 && status < 0)) {
813 if (sceMcOpen(this->
port, 1,
"icon.sys", 0x202) == 0) {
822 if (sceMcSync(MC_NOWAIT, &cmd, &status) == 0) {
826 if (cmd != 2 || (cmd == 2 && status < 0)) {
827 printf(
"open error = %d\n", status);
835 if (sceMcWrite(this->
fd, &this->
icon_sys, this->transfer_size) == 0) {
846 if (sceMcSync(MC_NOWAIT, &cmd, &status) == 0) {
850 if (cmd != 6 || (cmd == 6 && status < 0)) {
860 if (sceMcFlush(this->
fd) == 0) {
871 if (sceMcSync(MC_NOWAIT, &cmd, &status) == 0) {
875 if (cmd != 0xA || (cmd == 0xA && status < 0)) {
879 cmd = sceMcClose(this->
fd);
892 if (sceMcSync(MC_NOWAIT, &cmd, &status) == 0) {
896 if (cmd != 3 || (cmd == 3 && status < 0)) {
903 cmd = sceMcOpen(this->
port, 1, (&this->
icon.
view)[iconNo].name, 0x203);
918 if (sceMcSync(MC_NOWAIT, &cmd, &status) == 0) {
922 if (cmd != 2 || (cmd == 2 && status < 0)) {
928 this->transfer_size = (&this->
icon.
view)[iconNo].size;
929 cmd = sceMcWrite(this->
fd, (&this->
icon.
view)[iconNo].data, this->transfer_size);
955 switch ((this->
step - 1) % 4) {
961 if (sceMcOpen(this->
port, 1, name, 1) == 0) {
969 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
978 if (result == sceMcResNoEntry || result == sceMcResNoFormat) {
979 printf(
"not found\n");
994 if (sceMcRead(this->
fd, this->read_buffer, this->
transfer_size) == 0) {
1002 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
1006 if (cmd != 5 || (cmd == 5 && result < 0)) {
1014 printf(
"getinfo read error \n");
1016 if (sceMcClose(this->
fd) == 0) {
1032 if (sceMcClose(this->
fd) == 0) {
1040 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
1044 if (cmd != 3 || (cmd == 3 && result < 0)) {
1052 if (memcmp(data,
"darkcloud", 9) == 0) {
1063 if (*data ==
'd' && strcmp(this->
GetVersion(), data) != 0) {
1075 printf(
"not enough size\n");
1081 memcpy(info->
name, ((
CSaveData *) this->read_buffer)->GetCharaName(0),
sizeof(info->
name));
1087 for (dungeon = 0; dungeon < 6; dungeon++) {
1161 switch (this->
step) {
1166 cmd = sceMcOpen(this->
port, 1, name, GetOpenAttribute(name) ? 2 : 0x202);
1171 printf(
"cmd = %d\n", cmd);
1177 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
1182 printf(
"fd = %d\n", result);
1202 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
1206 if (cmd != 6 || (cmd == 6 && result < 0)) {
1216 if (sceMcFlush(this->
fd) == 0) {
1224 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
1228 if (cmd != 0xA || (cmd == 0xA && result < 0)) {
1232 if (sceMcClose(this->
fd) == 0) {
1240 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
1244 if (cmd != 3 || (cmd == 3 && result < 0)) {
1249 strcat(pattern,
"*");
1251 if (sceMcGetDir(this->
port, 1, pattern, 0, 15, SaveFileInfo) == 0) {
1259 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
1263 if (cmd != 0xD || (cmd == 0xD && result < 0)) {
1282 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
1296 this->transfer_size = 0x40;
1298 for (i = 0; i < 12; i++) {
1301 if (sceMcWrite(this->
fd, &sys_config, this->transfer_size) == 0) {
1309 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
1313 if (cmd != 6 || (cmd == 6 && result < 0)) {
1323 if (sceMcFlush(this->
fd) == 0) {
1331 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
1335 if (cmd != 0xA || (cmd == 0xA && result < 0)) {
1339 if (sceMcClose(this->
fd) == 0) {
1347 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
1351 if (cmd != 3 || (cmd == 3 && result < 0)) {
1364 char saved_version[0x20];
1373 switch (this->
step) {
1379 if (sceMcOpen(this->
port, 1, name, 1) == 0) {
1387 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
1391 if (cmd != 2 || (cmd == 2 && result < 0)) {
1408 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
1412 if (cmd != 5 || (cmd == 5 && result < 0)) {
1422 if (sceMcClose(this->
fd) == 0) {
1430 if (sceMcSync(MC_NOWAIT, &cmd, &result) == 0) {
1434 if (cmd != 3 || (cmd == 3 && result < 0)) {
1441 memcpy(saved_version, data,
sizeof(saved_version));
1443 if (saved_version[0] ==
version[0]) {
1444 if (strcmp(
version, saved_version) == 0) {
1449 for (i = 0; i <
sizeof(
CSaveData); i++) {
1453 if (total != *sum) {
1454 printf(
"save data break!!!\n");
1466 printf(
"not load\n");
1689 switch (this->
step) {
1691 result = sceMcUnformat(this->
port, 1);
1696 sceMcSync(MC_NOWAIT, &result, &status);
1697 printf(
"dmy sync\n");
1702 result = sceMcSync(MC_NOWAIT, &cmd, &status);
1712 if (cmd == 0x11 && status < 0) {