• R/O
  • SSH
  • HTTPS

gpsp-kai: コミット


コミットメタ情報

リビジョン585 (tree)
日時2010-04-16 09:21:05
作者takka

ログメッセージ

(メッセージはありません)

変更サマリ

差分

--- trunk/iso_tool/screen.c (revision 584)
+++ trunk/iso_tool/screen.c (revision 585)
@@ -109,6 +109,11 @@
109109 #define ZBUF_SIZE (BUF_WIDTH SCR_HEIGHT * 2)
110110
111111 /*---------------------------------------------------------------------------
112+ タイトル表示
113+---------------------------------------------------------------------------*/
114+static void print_title();
115+
116+/*---------------------------------------------------------------------------
112117 枠を描画
113118 ---------------------------------------------------------------------------*/
114119 static void write_window(int x1, int y1, int x2, int y2, int window_only);
@@ -350,12 +355,16 @@
350355 setupGu();
351356 sceGuSwapBuffers();
352357 fnt_load_mem(shnm16, &font);
358+ print_title();
359+}
360+
361+/*---------------------------------------------------------------------------
362+ タイトル表示
363+---------------------------------------------------------------------------*/
364+void print_title()
365+{
353366 print_xy_mid(15, 0, (void*)global_title, 1, 1, 0);
354-// char *text[15];
355-// text[0] = "開発中のbeta版なので注意してください";
356-// text[1] = "◎を押してください";
357-// text[2] = "\0";
358-// dialog(text);
367+ print_xy(23, 0, "kako / takka", 1, 1, 0);
359368 }
360369
361370 /*---------------------------------------------------------------------------
@@ -443,7 +452,7 @@
443452
444453 if(redrow_flag == YES)
445454 {
446- print_xy_mid(15, 0, (void*)global_title, 1, 1, 0);
455+ print_title();
447456 print_xy(DIR_MENU_X1 + 1, DIR_MENU_Y1 + 1 + sel_num, RIGHT_TRIANGLE, 1, 1 ,0);
448457 return DONE;
449458 }
@@ -562,7 +571,7 @@
562571
563572 if(redrow == YES)
564573 {
565- print_xy_mid(15, 0, (void*)global_title, 1, 1, 0);
574+ print_title();
566575 sjis_to_utf8(utf8, path);
567576 make_window(utf8, DIR_MENU_X1, DIR_MENU_Y1, DIR_MENU_X2, DIR_MENU_Y2, 1);
568577 make_stat_win();
--- trunk/iso_tool/Makefile (revision 584)
+++ trunk/iso_tool/Makefile (revision 585)
@@ -18,7 +18,7 @@
1818 LIBDIR = ./
1919 LDFLAGS =
2020 LIBS = -lpspsystemctrl_user -lpspsystemctrl_kernel -lpsppower -lpspkubridge -lz -lpspumd -lpspgu -lpsputility -lpsprtc -lpspaudiolib -lpspaudio -lpspnet -lpsphttp
21-LIBS += -lcurl -lpspgum -lm
21+LIBS += -lcurl -lpspgum -lm
2222
2323
2424 OBJS = main.o \
--- trunk/iso_tool/menu.c (revision 584)
+++ trunk/iso_tool/menu.c (revision 585)
@@ -81,7 +81,7 @@
8181 { MENU_COMMAND, "EBOOTリカバリ", (eboot_recovery), NULL, 0, 0 },
8282 { MENU_COMMAND, "リネーム", (rename_file), NULL, 0, 0 },
8383 { MENU_COMMAND, "CSO変換", (iso2cso), NULL, 2048, 0 },
84- { MENU_COMMAND, "起動", (boot_iso), NULL, 2048, 0 },
84+// { MENU_COMMAND, "起動", (boot_iso), NULL, 2048, 0 },
8585 { MENU_NOP, "--------------", (NULL), NULL, 0, 0 },
8686 { MENU_COMMAND, "削除", (remove_file), NULL, 0, 0 },
8787 { MENU_NOP, "\0", (NULL), NULL, 0, 0 }
@@ -93,7 +93,7 @@
9393 { MENU_COMMAND, "リネーム", (rename_file), NULL, 0, 0 },
9494 { MENU_COMMAND, "ISO変換", (cso2iso), NULL, 0, 0 },
9595 { MENU_NOP, "--------------", (NULL), NULL, 0, 0 },
96- { MENU_COMMAND, "ヘッダー調整", (fix_header), NULL, 0, 0 }, // TODO
96+// { MENU_COMMAND, "ヘッダー調整", (fix_header), NULL, 0, 0 }, // TODO
9797 { MENU_COMMAND, "削除", (remove_file), NULL, 0, 0 },
9898 { MENU_NOP, "\0" , (NULL), NULL, 0, 0 }
9999 };
@@ -542,7 +542,8 @@
542542 strcat(out_path, global.umd_id);
543543 strcat(out_path, ".ISO");
544544
545- strcpy(ren_path, "../out.tmp");
545+ strcpy(ren_path, dir);
546+ strcat(ren_path, "01234565789012345678901234567890123456789012345678901234567890123456789");
546547
547548 msg_win("", 0, MSG_CLEAR, 0);
548549 sjis_to_utf8(work, strrchr(out_path, '/') + 1);
@@ -577,8 +578,7 @@
577578
578579 // msg
579580 msg_win("", 0, MSG_CLEAR, 0);
580- msg_win("UMD -> ISO 変換", 1, MSG_WAIT, 0);
581-// msg_win("", 0, MSG_WAIT, 0);
581+ msg_win("UMD -> ISO 変換", 0, MSG_WAIT, 0);
582582 sprintf(msg, "%d / %d セクタ完了", write_sector, in_sec_num);
583583 msg_win(msg, 0, MSG_LINE, 1);
584584
@@ -612,6 +612,7 @@
612612 }
613613 first_wait = 1;
614614 }
615+
615616 write_sector += read_size[num];
616617
617618 // 遅延書込み開始
@@ -626,7 +627,6 @@
626627 msg_win("Wait READ", 0, MSG_LINE, 4);
627628 ret = sceIoWaitAsync(fp_in, &res);
628629 ERR_RET_2(res, ERR_READ);
629- msg_win("READ", 0, MSG_LINE, 4);
630630 read_size[(num + 1) % 3] = res;
631631 read_sector += res;
632632 }
@@ -646,7 +646,7 @@
646646 msg_win(msg, 0, MSG_LINE, 1);
647647 sceRtcGetCurrentTick(&now_tick);
648648 now_tick -= start_tick;
649- ret = (MAX_READ_SIZE << 11) / 1024 /* * 1000 */ /((now_tick - old_tick)/* / 1000*/);
649+ ret = (MAX_READ_SIZE << 11) / 1024 * 1000 /((now_tick - old_tick) / 1000);
650650 old_tick = now_tick;
651651 sceRtcSetTick(&date1, &now_tick);
652652 now_tick = now_tick * in_sec_num / write_sector;
@@ -698,6 +698,7 @@
698698 msg_win("", 0, MSG_LINE, 3);
699699 msg_win("", 0, MSG_LINE, 4);
700700 msg_win("", 0, MSG_LINE, 5);
701+ ret = 0;
701702
702703 LABEL_ERR:
703704 // close
@@ -708,6 +709,7 @@
708709
709710 if(ret != -1)
710711 {
712+ sceIoRemove(out_path);
711713 sceIoRename(ren_path, out_path);
712714
713715 text[0] = "変換完了";
@@ -724,20 +726,73 @@
724726
725727 int umd2cso(char *dir, char *file, file_type type, int opt_1, int opt_2)
726728 {
727- char umd_path[MAX_PATH];
728- char cso_path[MAX_PATH];
729+ char in_path[MAX_PATH];
730+ char out_path[MAX_PATH];
731+ char ren_path[MAX_PATH];
729732 char work[MAX_PATH];
730733 char work2[MAX_PATH];
734+ char *read_buf[3]; // 読込バッファ ポインタ
735+ char *write_buf[3]; // 書込バッファ ポインタ
736+
737+ SceUID fp_in = 0; // 読込ファイル ポインタ
738+ SceUID fp_out = 0; // 書込ファイル ポインタ
739+ SceInt64 res = -1; // 非同期ファイルIO用
740+
741+ const int MAX_READ_SIZE = 512; // 一回の読込サイズ
742+
743+ int in_sec_num = 0; // 総セクタ数
744+ int read_size[3]; // 読込んだサイズ
745+ int write_size = 0; // 一回の書込サイズ
746+ int write_sector = 0; // 処理したセクタ数
747+ int read_sector = 0; // 処理したセクタ数
748+ int cso_sector = 0; // 処理したセクタ数
749+
750+ int num; // 汎用
731751 int ret;
752+ int loop;
732753
754+ char *text[15]; // テキスト表示用
755+ char msg[256]; // テキスト表示用
756+
757+ SceCtrlData data;
758+ u64 start_tick;
759+ u64 now_tick;
760+ u64 old_tick = 0;
761+ pspTime date1;
762+ pspTime date2;
763+ pspTime date3;
764+ int first_wait = 0;
765+
766+ CISO_H header; // CSOヘッダ
767+ int *tag = NULL; // CSOセクタタグ ポインタ
768+ int tag_size = 0; // CSOセクタタグ サイズ
769+ char cso_buf[0x1000]; // CSO変換バッファ
770+ int write_ptr = 0; // 書込バッファへの転送位置
771+ int cso_sec_ptr = 0; // CSOセクタ位置
772+ int cso_sec_size; // 圧縮後のセクタサイズ
773+
774+ // buff 設定
775+ read_buf[0] = &WORK[O_BUFFER][0];
776+ read_buf[1] = &WORK[O_BUFFER + MAX_READ_SIZE][0];
777+ read_buf[2] = &WORK[O_BUFFER + MAX_READ_SIZE * 2][0];
778+ write_buf[0] = &WORK[O_BUFFER + MAX_READ_SIZE * 3][0];
779+ write_buf[1] = &WORK[O_BUFFER + MAX_READ_SIZE * 4][0];
780+ write_buf[2] = &WORK[O_BUFFER + MAX_READ_SIZE * 5][0];
781+
782+ // tag設定
783+ tag = (int *)&WORK[O_BUFFER + MAX_READ_SIZE * 6][0];
784+
785+ // MSチェック
733786 ret = check_ms();
734787 if(ret < 0)
735788 return CANCEL;
736789
790+ // UMDチェック
737791 ret = check_umd();
738792 if(ret < 0)
739793 return CANCEL;
740794
795+ // 空き容量チェック
741796 if((global.umd_size / 1024) > global.ms_free_size)
742797 {
743798 msg_win("空き容量がUMDサイズ以下です", 0, MSG_WAIT, 0);
@@ -747,15 +802,17 @@
747802 return CANCEL;
748803 }
749804
805+ // パラメータ設定
750806 msg_win("", 0, MSG_CLEAR, 0);
751807 ret = select_menu_list(cso_trans_menu);
752808 if(ret == CANCEL )
753809 return CANCEL;
754810
755- strcpy(umd_path, dir);
756- strcat(umd_path, file);
811+ // ファイル名設定
812+ strcpy(in_path, dir);
813+ strcat(in_path, file);
757814
758- strcpy(cso_path, dir);
815+ strcpy(out_path, dir);
759816 strcpy(work2, global.umd_id);
760817 sprintf(work, "_%d_%03d", global.cso_level, global.cso_threshold);
761818 strcat(work2, work);
@@ -762,14 +819,259 @@
762819
763820 ret = osk(work, work2, "ファイル名指定", 0);
764821 if(ret == PSP_UTILITY_OSK_RESULT_CHANGED)
765- strcat(cso_path, work);
822+ strcat(out_path, work);
766823 else
767- strcat(cso_path, work2);
824+ strcat(out_path, work2);
768825
769- strcat(cso_path, ".CSO");
826+ strcat(out_path, ".CSO");
770827
828+ strcpy(ren_path, dir);
829+ strcat(ren_path, "01234565789012345678901234567890123456789012345678901234567890123456789");
830+
831+ msg_win("", 0, MSG_CLEAR, 0);
832+ sjis_to_utf8(work, strrchr(out_path, '/') + 1);
833+ sprintf(msg, "出力名:%s", work);
834+ msg_win(msg, 0, MSG_WAIT, 0);
835+
836+ if(check_file(out_path) < 0)
837+ {
838+ msg_win("開始しますか?", 0, MSG_WAIT, 0);
839+ ret = select_menu("開始", select_yes_no, 0, 28, 10);
840+ }
841+ else
842+ {
843+ msg_win("同名のファイルがあります", 0, MSG_WAIT, 0);
844+ msg_win("上書きしますか?", 0, MSG_WAIT, 0);
845+ ret = select_menu("上書き", select_no_yes, 0, 28, 10);
846+ }
847+
848+ if(ret != YES)
849+ return CANCEL;
850+
851+ in_sec_num = get_umd_sector("umd:", TYPE_UMD);
852+ tag_size = in_sec_num + 1;
853+
854+ // open設定
855+ fp_in = sceIoOpen("umd:", PSP_O_RDONLY, 0777);
856+ ERR_RET_2(fp_in, ERR_OPEN);
857+ sceIoLseek32(fp_in, 0, SEEK_SET);
858+
859+ fp_out = sceIoOpen(ren_path, PSP_O_WRONLY | PSP_O_CREAT | PSP_O_TRUNC, 0777);
860+ ERR_RET_2(fp_out, ERR_OPEN);
861+ sceIoLseek32(fp_out, 0, SEEK_SET);
862+
863+ // msg
864+ msg_win("", 0, MSG_CLEAR, 0);
865+ sprintf(msg, "UMD -> CSO 変換 (圧縮レベル:%d/閾値%3d%%)", global.cso_level, global.cso_threshold);
866+ msg_win(msg, 0, MSG_WAIT, 0);
867+ sprintf(msg, "%d / %d セクタ完了", write_sector, in_sec_num);
868+ msg_win(msg, 0, MSG_LINE, 1);
869+
870+ sceRtcGetCurrentTick(&start_tick);
871+
771872 set_clock(333, 166);
772- file_trans(cso_path, umd_path, TRANS_UMD_CSO, 0, 0, opt_1, opt_2);
873+
874+ // 2ブロック分先行読込
875+ read_size[0] = sceIoRead(fp_in, read_buf[0], MAX_READ_SIZE);
876+ ERR_RET_2(read_size[0], ERR_READ);
877+ read_sector += read_size[0];
878+ read_size[1] = sceIoReadAsync(fp_in, read_buf[1], MAX_READ_SIZE);
879+ ERR_RET_2(read_size[1], ERR_READ);
880+
881+ // header
882+ header.magic[0] = 'C';
883+ header.magic[1] = 'I';
884+ header.magic[2] = 'S';
885+ header.magic[3] = 'O';
886+ header.header_size = 0x00; /* 本来 0x18 であるが、PSP Filer 6.6で読み込めなくなるので一時的に修正*/
887+ header.total_bytes = in_sec_num * SECTOR_SIZE;
888+ header.block_size = SECTOR_SIZE;
889+ header.ver = 0x01;
890+ header.align = 0x00;
891+ header.rsv_06[0] = 0x00;
892+ header.rsv_06[1] = 0x00;
893+
894+ // ヘッダ書込み
895+ ret = sceIoWrite(fp_out, &header, CISO_HEADER_SIZE);
896+ ERR_RET_2(ret, ERR_WRITE);
897+ cso_sec_ptr = CISO_HEADER_SIZE + (tag_size * 4);
898+ tag[0] = cso_sec_ptr;
899+ ret = sceIoLseek32(fp_out, cso_sec_ptr, PSP_SEEK_SET);
900+ ERR_RET_2(ret, ERR_SEEK);
901+
902+ // loop前
903+ cso_sector = 0;
904+ write_sector = 0;
905+ num = 0;
906+
907+ // loop
908+ while(in_sec_num > write_sector)
909+ {
910+ write_sector += read_size[num];
911+
912+ // CSO変換
913+ msg_win("DEFLATE", 0, MSG_LINE, 4);
914+ loop = 0;
915+ write_size = 0;
916+ write_ptr = 0;
917+ while(read_size[num] > 0)
918+ {
919+ cso_sec_size = deflate_cso(cso_buf, sizeof(cso_buf), (read_buf[num] + (loop * SECTOR_SIZE)), SECTOR_SIZE, global.cso_level);
920+ if(cso_sec_size < 0)
921+ {
922+ text[0] = "CSO変換エラー";
923+ text[1] = "◎を押してください";
924+ text[2] = "\0";
925+ dialog(text);
926+ ret = -1;
927+ goto LABEL_ERR;
928+ }
929+ if(cso_sec_size < (SECTOR_SIZE * global.cso_threshold / 100))
930+ {
931+ write_size += cso_sec_size;
932+ cso_sec_ptr += cso_sec_size;
933+ tag[cso_sector + 1] = cso_sec_ptr;
934+ memcpy(write_buf[num] + write_ptr, cso_buf, cso_sec_size);
935+ }
936+ else
937+ {
938+ cso_sec_size = SECTOR_SIZE;
939+ write_size += SECTOR_SIZE;
940+ cso_sec_ptr += SECTOR_SIZE;
941+ tag[cso_sector] |= 0x80000000;
942+ tag[cso_sector + 1] = cso_sec_ptr;
943+ memcpy(write_buf[num] + write_ptr, read_buf[num] + loop * SECTOR_SIZE, SECTOR_SIZE);
944+ }
945+ write_ptr += cso_sec_size;
946+ read_size[num]--;
947+ loop++;
948+ cso_sector++;
949+ }
950+
951+ // 遅延書込み終了
952+ msg_win("Wait WRITE", 0, MSG_LINE, 4);
953+ ret = sceIoWaitAsync(fp_out, &res);
954+ if(res < 0)
955+ {
956+ if(first_wait == 1)
957+ {
958+ err_msg(ERR_WRITE);
959+ return CANCEL;
960+ }
961+ first_wait = 1;
962+ }
963+
964+ // 遅延書込み開始
965+ msg_win("WRITE", 0, MSG_LINE, 4);
966+ ret = sceIoWriteAsync(fp_out, write_buf[num], write_size);
967+ ERR_RET_2(ret, ERR_WRITE);
968+
969+ // 遅延読込み終了
970+ if(read_sector < in_sec_num)
971+ {
972+ msg_win("Wait READ", 0, MSG_LINE, 4);
973+ ret = sceIoWaitAsync(fp_in, &res);
974+ ERR_RET_2(res, ERR_READ);
975+ read_size[(num + 1) % 3] = res;
976+ read_sector += res;
977+ }
978+ // 遅延読込み開始
979+ if(read_sector < in_sec_num)
980+ {
981+ msg_win("READ", 0, MSG_LINE, 4);
982+ ret = sceIoReadAsync(fp_in, read_buf[(num + 2) % 3], MAX_READ_SIZE);
983+ if(ret < 0)
984+ {
985+ err_msg(ERR_READ);
986+ return CANCEL;
987+ }
988+ }
989+
990+ sprintf(msg, "%d / %d セクタ完了", write_sector, in_sec_num);
991+ msg_win(msg, 0, MSG_LINE, 1);
992+ sceRtcGetCurrentTick(&now_tick);
993+ now_tick -= start_tick;
994+ ret = (MAX_READ_SIZE << 11) / 1024 * 1000 /((now_tick - old_tick) / 1000);
995+ old_tick = now_tick;
996+ sceRtcSetTick(&date1, &now_tick);
997+ now_tick = now_tick * in_sec_num / write_sector;
998+ sceRtcSetTick(&date2, &now_tick);
999+ now_tick -= old_tick;
1000+ sceRtcSetTick(&date3, &now_tick);
1001+ sprintf(msg, "経過 %02d:%02d:%02d / 予想 %02d:%02d:%02d / 残 %02d:%02d:%02d",
1002+ date1.hour, date1.minutes, date1.seconds,
1003+ date2.hour, date2.minutes, date2.seconds,
1004+ date3.hour, date3.minutes, date3.seconds);
1005+ msg_win(msg, 0, MSG_LINE, 2);
1006+ sprintf(msg, "速度 %4dKB/s", ret);
1007+ msg_win(msg, 0, MSG_LINE, 3);
1008+
1009+ get_button(&data);
1010+ if((data.Buttons) == PSP_CTRL_CROSS)
1011+ {
1012+ msg_win("STOP !!", 0, MSG_LINE, 2);
1013+ ret = select_menu("中止しますか?", select_no_yes, 0, 28, 10);
1014+ if(ret == 1)
1015+ {
1016+ text[0] = "変換中止";
1017+ text[1] = "◎を押してください";
1018+ text[2] = "\0";
1019+ dialog(text);
1020+ ret = -1;
1021+ goto LABEL_ERR;
1022+ }
1023+ dir_menu(NULL, YES);
1024+ msg_win("", 0, MSG_REDROW, 0);
1025+ }
1026+ num = (num + 1) % 3;
1027+ }
1028+
1029+ // msg
1030+ sprintf(msg, "%d / %d セクタ完了", in_sec_num, in_sec_num);
1031+ msg_win(msg, 0, MSG_LINE, 1);
1032+
1033+ sceRtcGetCurrentTick(&now_tick);
1034+ now_tick -= start_tick;
1035+ sceRtcSetTick(&date3, &now_tick);
1036+ ret = (in_sec_num * SECTOR_SIZE) / 1024 * 1000 / (now_tick / 1000);
1037+ sprintf(msg, "変換時間 %02d:%02d:%02d / 平均速度 %04dKB/s", date3.hour, date3.minutes, date3.seconds, ret);
1038+ msg_win(msg, 0, MSG_LINE, 0);
1039+ sprintf(msg, "経過 %02d:%02d:%02d / 予想 %02d:%02d:%02d / 残 00:00:00",
1040+ date1.hour, date1.minutes, date1.seconds,
1041+ date2.hour, date2.minutes, date2.seconds);
1042+ msg_win(msg, 0, MSG_LINE, 2);
1043+ msg_win("", 0, MSG_LINE, 3);
1044+ msg_win("", 0, MSG_LINE, 4);
1045+ msg_win("", 0, MSG_LINE, 5);
1046+ ret = 0;
1047+
1048+LABEL_ERR:
1049+ // close
1050+ sceIoWaitAsync(fp_in, &res);
1051+ sceIoWaitAsync(fp_out, &res);
1052+
1053+ // header
1054+ ret = sceIoLseek32(fp_out, CISO_HEADER_SIZE, PSP_SEEK_SET);
1055+ ERR_RET_2(ret, ERR_SEEK);
1056+ ret = sceIoWrite(fp_out, tag, tag_size * sizeof(unsigned int));
1057+ ERR_RET_2(ret, ERR_WRITE);
1058+
1059+ sceIoClose(fp_in);
1060+ sceIoClose(fp_out);
1061+
1062+ if(ret != -1)
1063+ {
1064+ sceIoRemove(out_path);
1065+ sceIoRename(ren_path, out_path);
1066+
1067+ text[0] = "変換完了";
1068+ text[1] = "◎を押してください";
1069+ text[2] = "\0";
1070+ dialog(text);
1071+ }
1072+ else
1073+ sceIoRemove(ren_path);
1074+
7731075 set_clock(222, 111);
7741076 return DONE;
7751077 }
@@ -892,7 +1194,7 @@
8921194 int in_sec_num = 0; // 読込セクタ数
8931195
8941196 int max_read_size = 0; // 一回の読込サイズ
895- int read_size[2]; // 読込んだサイズ
1197+ int read_size = 0; // 読込んだサイズ
8961198 int write_size = 0; // 一回の書込サイズ
8971199 int now_sector = 0; // 処理したセクタ数
8981200 int write_block_shift = 0; // 処理単位(シフト数)
@@ -1110,26 +1412,23 @@
11101412 msg_win(msg, 0, MSG_LINE, 1);
11111413
11121414 if(type == TRANS_CSO_ISO)
1113- read_size[0] = cso_read_fp(read_buf[0], fp_in, now_sector << read_block_shift, max_read_size);
1415+ read_size = cso_read_fp(read_buf[0], fp_in, now_sector << read_block_shift, max_read_size);
11141416 else
11151417 {
1116- read_size[0] = sceIoRead(fp_in, read_buf[0], max_read_size);
1117- ERR_RET_2(read_size[0], ERR_READ);
1118- read_size[1] = sceIoRead(fp_in, read_buf[1], max_read_size);
1119- ERR_RET_2(read_size[1], ERR_READ);
1418+ read_size = sceIoRead(fp_in, read_buf[0], max_read_size);
1419+ ERR_RET_2(read_size, ERR_READ);
11201420 }
11211421
11221422 // loop
1123- while(read_size[num] > 0)
1423+ while(read_size > 0)
11241424 {
11251425 if(out_cso_flag == 1)
11261426 {
1127- // BUF_0 圧縮処理
11281427 msg_win("DEFLATE", 0, MSG_LINE, 4);
11291428 loop = 0;
11301429 write_size = 0;
11311430 write_ptr = 0;
1132- while(read_size[num] > 0)
1431+ while(read_size > 0)
11331432 {
11341433 cso_sec_size = deflate_cso(cso_buf, sizeof(cso_buf), (read_buf[num] + (loop * SECTOR_SIZE)), SECTOR_SIZE, global.cso_level);
11351434 if(cso_sec_size < 0)
@@ -1158,7 +1457,7 @@
11581457 memcpy(write_buf[num] + write_ptr, read_buf[num] + loop * SECTOR_SIZE, SECTOR_SIZE);
11591458 }
11601459 write_ptr += cso_sec_size;
1161- read_size[num] -= SECTOR_SIZE >> write_block_shift;
1460+ read_size -= SECTOR_SIZE >> write_block_shift;
11621461 loop++;
11631462 now_sector++;
11641463 }
@@ -1166,10 +1465,9 @@
11661465 else
11671466 {
11681467 now_sector += max_read_size >> read_block_shift;
1169- write_size = read_size[num] << write_block_shift;
1468+ write_size = read_size << write_block_shift;
11701469 }
11711470
1172- // BUF_1 遅延書込み終了
11731471 msg_win("Wait WRITE", 0, MSG_LINE, 4);
11741472 ret = sceIoWaitAsync(fp_out, &res);
11751473 if(ret < 0)
@@ -1182,11 +1480,10 @@
11821480 first_wait = 1;
11831481 }
11841482
1185- // BUF_1 遅延読込み開始
11861483 if(type != TRANS_CSO_ISO)
11871484 {
11881485 msg_win("READ", 0, MSG_LINE, 4);
1189- ret = sceIoReadAsync(fp_in, read_buf[num], max_read_size);
1486+ ret = sceIoReadAsync(fp_in, read_buf[(num + 1) % 2], max_read_size);
11901487 if(ret < 0)
11911488 {
11921489 err_msg(ERR_READ);
@@ -1194,11 +1491,11 @@
11941491 }
11951492 }
11961493
1197- // BUF_0 遅延書込み開始
11981494 msg_win("WRITE", 0, MSG_LINE, 4);
11991495 ret = sceIoWriteAsync(fp_out, write_buf[num], write_size);
12001496 ERR_RET_2(ret, ERR_WRITE);
12011497
1498+ num = (num + 1) % 2;
12021499 sprintf(msg, "%d / %d セクタ完了", now_sector, in_sec_num);
12031500 msg_win(msg, 0, MSG_LINE, 1);
12041501 sceRtcGetCurrentTick(&now_tick);
@@ -1236,7 +1533,6 @@
12361533 msg_win("", 0, MSG_REDROW, 0);
12371534 }
12381535
1239- // BUF_1 遅延読込み終了
12401536 msg_win("Wait READ", 0, MSG_LINE, 4);
12411537 if(type == TRANS_CSO_ISO)
12421538 res = cso_read_fp(read_buf[num], fp_in, now_sector << read_block_shift, max_read_size);
@@ -1246,8 +1542,7 @@
12461542 ERR_RET_2(ret, ERR_READ);
12471543 msg_win("READ", 0, MSG_LINE, 4);
12481544 }
1249- read_size[num] = res;
1250- num = (num + 1) % 2;
1545+ read_size = res;
12511546 }
12521547
12531548 // msg
@@ -1510,14 +1805,17 @@
15101805 break;
15111806 }
15121807
1513- sctrlSESetUmdFile(path);
1808+// sctrlSESetUmdFile(path);
15141809
1515- sceKernelDelayThread(5000000);
1516- sceUmdActivate(1, "disc0:");
1517- sceKernelDelayThread(5000000);
1518- sceUmdWaitDriveStat(PSP_UMD_READY);
1519-// ModuleMgrForKernel_1B91F6EC("disc0:/PSP_GAME/SYSDIR/EBOOT.BIN", 0, &option);
1520- sctrlKernelLoadExecVSHDisc("disc0:/PSP_GAME/SYSDIR/EBOOT.BIN", NULL);
1810+// sceKernelDelayThread(5000000);
1811+// sceUmdActivate(1, "disc0:");
1812+// sceKernelDelayThread(5000000);
1813+// sceUmdWaitDriveStat(PSP_UMD_READY);
1814+// ModuleMgrForKernel_1B91F6EC("disc0:/PSP_GAME/SYSDIR/EBOOT.BIN", 0, NULL);
1815+// sctrlKernelLoadExecVSHDisc("disc0:/PSP_GAME/SYSDIR/EBOOT.BIN", NULL);
1816+// sctrlKernelLoadExecVSHDisc("disc0:/PSP_GAME/SYSDIR/EBOOT.BIN", NULL);
15211817 // sctrlKernelLoadExecVSHWithApitype();
1818+ ret = sceKernelLoadModule("loadprx.prx", 0, NULL);
1819+ ret = sceKernelStartModule(ret, strlen(path)+1, path, NULL, NULL);
15221820 return DONE;
15231821 }
--- trunk/iso_tool/update.txt (revision 584)
+++ trunk/iso_tool/update.txt (revision 585)
@@ -1,5 +1,8 @@
11 *1.13
2+[UPDATE] 変換処理を書き直し
23 [UPDATE] 処理できる最大EBOOT.BINサイズを20MBに変更
4+[BUG] 破損ファイルによりXMBからメモステが開けないのを回避
5+[BUG] 別の場所にISOファイルが出来てしまうのを修正
36
47 *1.12
58 [UPDATE] リネーム時に先頭に「.」がある場合、「 」(空白)を先頭に追加する
旧リポジトリブラウザで表示