git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlToolsRED@591 7061adef-622a-194b-ae81-725974e89856

This commit is contained in:
mizu 2013-02-25 00:53:49 +00:00
parent 3d7f3cfeab
commit c09eacf35a
4 changed files with 40 additions and 11 deletions

Binary file not shown.

Binary file not shown.

View File

@ -184,10 +184,10 @@ begin
s := 'game_code = ';
for i:=1 to 4 do s[12+i] := romh.game_code[i];
//ListBox_log.Items.Add(s); //game code
//ListBox_log.Items.Add('version = '+inttostr(romh.rom_version));
//ListBox_log.Items.Add('rom version = '+inttostr(romh.rom_version));
//ListBox_log.Items.Add(' ');
Writeln(flog,s);
Writeln(flog,'version = '+inttostr(romh.rom_version));
Writeln(flog,'rom_version = '+inttostr(romh.rom_version));
Writeln(flog);//改行
//オーバレイチェック

View File

@ -24,6 +24,7 @@ type
private
{ Private 宣言 }
function CheckSrlHeader:integer;
function fstring(s:string):string;
public
{ Public 宣言 }
end;
@ -99,11 +100,32 @@ var
implementation
function TForm1.fstring(s:string):string;
var
s1,s2,s3:string;
n,nn:integer;
begin
//'='まで切り出す
n := pos('=',s);
s1 := copy(s,0,n-1);
while length(s1) < 16 do s1 := s1+' ';
//';'まで切り出す
nn := pos(';',s);
s2 := copy(s,n,nn-n);
while length(s2) < 16 do s2 := s2+' ';
//残り
s3 := copy(s,nn,length(s));
Result := s1+s2+s3;
end;
function TForm1.CheckSrlHeader: integer;
var
Rec: TSearchRec;
sf,s,ss: String;
i,n,Count,err_files,ng_entry: integer;
i,j,n,Count,err_files,ng_entry: integer;
fsrl: file;
flog:TextFile;
romh: TRomh;
@ -162,10 +184,10 @@ begin
s := 'game_code = ';
for i:=1 to 4 do s[12+i] := romh.game_code[i];
//ListBox_log.Items.Add(s); //game code
//ListBox_log.Items.Add('version = '+inttostr(romh.rom_version));
//ListBox_log.Items.Add('rom version = '+inttostr(romh.rom_version));
//ListBox_log.Items.Add(' ');
Writeln(flog,s);
Writeln(flog,'version = '+inttostr(romh.rom_version));
Writeln(flog,'rom version = '+inttostr(romh.rom_version));
Writeln(flog);//改行
//オーバレイチェック
@ -177,6 +199,7 @@ begin
nums := romh.main_ovt_size div 32;//Ovl count
noc_size :=0;//範囲外トータルsize
noc_sectors := 0;// 同セクタ
j := 0;//通し番号
for i := 0 to nums-1 do begin
if CB_add_ovt.Checked then begin
//OVT
@ -199,10 +222,10 @@ begin
ss := '(A9 Overlay'+inttostr(i);
//max_sectors = (DHT_OVERLAY_MAX/512 - total_sectors) / (nums-i);
if (total_sectors < 1024)then max_sectors := (1024 - total_sectors) div (nums-i)
else max_sectors := 0;
else max_sectors := 0; //CARDブート時、マイナスはエラー(FAT Broken)になる
btm := fat.bottom and $fffffe00; //512単位
if (fat.bottom and $1ff)<>0 then inc(btm,512);//上方向に丸める
if max_sectors = 0 then begin//最大達したら丸ごと検証外
if max_sectors = 0 then begin//丸ごと検証外
top := fat.top;
sectors := (btm-top) shr 9;//div 512
if (top and $1ff)<>0 then inc(sectors);
@ -215,18 +238,21 @@ begin
if size<>0 then begin
inc(top,512);////上方向に丸める
//先頭の未検証部分 .. 不要?
s := 'offset'+inttostr(i)+' = 0x'+ inttohex(fat.top,8)
s := 'offset'+inttostr(j)+' = 0x'+ inttohex(fat.top,8)
+' ; 0x'+ inttohex(fat.top,8)
+'-0x' + inttohex(top-1,8)+ss;
//ListBox_log.Items.Add(s);
s := fstring(s);//整形
Writeln(flog,s);
s := 'length'+ inttostr(i) + ' = 0x' + inttohex(size,4)
s := 'length'+ inttostr(j) + ' = 0x' + inttohex(size,4)
+ ' ; '+ inttostr(size)+' bytes';
//ListBox_log.Items.Add(s);
s := fstring(s);//整形
Writeln(flog,s);
inc(noc_size,512);
inc(noc_sectors);
inc(all_sectors);
inc(j);
ng_flg:=true;
end;
size := btm - top;
@ -244,17 +270,20 @@ begin
end;
if sectors > 0 then begin//残りあり
size := sectors shl 9;
s := 'offset'+inttostr(i)+' = 0x'+ inttohex(top,8)
s := 'offset'+inttostr(j)+' = 0x'+ inttohex(top,8)
+' ; 0x'+ inttohex(top,8)
+'-0x' + inttohex(btm-1,8)+ss;
//ListBox_log.Items.Add(s);
s :=fstring(s);//整形
Writeln(flog,s);
s := 'length'+ inttostr(i) + ' = 0x' + inttohex(size,4)
s := 'length'+ inttostr(j) + ' = 0x' + inttohex(size,4)
+ ' ; '+ inttostr(size)+' bytes';
//ListBox_log.Items.Add(s);
s := fstring(s);//整形
Writeln(flog,s);
inc(noc_size,size);
inc(noc_sectors,sectors);
inc(j);
end;
if ng_flg then inc(ng_entry);
end;