Merge pull request #499 from reicast/skmp/gdtool

skmp/gdtool
This commit is contained in:
Stefanos Kornilios Mitsis Poiitidis 2014-06-19 01:19:15 +03:00
commit 4c67940eb5
5 changed files with 37 additions and 18 deletions

View File

@ -207,7 +207,7 @@ size_t core_fseek(core_file* fc, size_t offs, size_t origin) {
die("Invalid code path"); die("Invalid code path");
if (f->f) if (f->f)
fseek((FILE*)f, f->seek_ptr, SEEK_SET); fseek(f->f, f->seek_ptr, SEEK_SET);
return 0; return 0;
} }

View File

@ -66,6 +66,7 @@
<ItemGroup> <ItemGroup>
<ClCompile Include="..\core\deps\chdpsr\cdipsr.cpp" /> <ClCompile Include="..\core\deps\chdpsr\cdipsr.cpp" />
<ClCompile Include="..\core\deps\chdr\chdr.cpp" /> <ClCompile Include="..\core\deps\chdr\chdr.cpp" />
<ClCompile Include="..\core\deps\coreio\coreio.cpp" />
<ClCompile Include="..\core\deps\crypto\md5.cpp" /> <ClCompile Include="..\core\deps\crypto\md5.cpp" />
<ClCompile Include="..\core\deps\crypto\sha1.cpp" /> <ClCompile Include="..\core\deps\crypto\sha1.cpp" />
<ClCompile Include="..\core\deps\libpng\png.c" /> <ClCompile Include="..\core\deps\libpng\png.c" />
@ -110,6 +111,7 @@
<ClInclude Include="..\core\deps\chdpsr\cdipsr.h" /> <ClInclude Include="..\core\deps\chdpsr\cdipsr.h" />
<ClInclude Include="..\core\deps\chdr\chd.h" /> <ClInclude Include="..\core\deps\chdr\chd.h" />
<ClInclude Include="..\core\deps\chdr\coretypes.h" /> <ClInclude Include="..\core\deps\chdr\coretypes.h" />
<ClInclude Include="..\core\deps\coreio\coreio.h" />
<ClInclude Include="..\core\deps\crypto\md5.h" /> <ClInclude Include="..\core\deps\crypto\md5.h" />
<ClInclude Include="..\core\deps\crypto\sha1.h" /> <ClInclude Include="..\core\deps\crypto\sha1.h" />
<ClInclude Include="..\core\deps\libpng\config.h" /> <ClInclude Include="..\core\deps\libpng\config.h" />

View File

@ -115,6 +115,9 @@
<ClCompile Include="src\cdromfs.cpp"> <ClCompile Include="src\cdromfs.cpp">
<Filter>src</Filter> <Filter>src</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\core\deps\coreio\coreio.cpp">
<Filter>deps\coreio</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\core\imgread\SCSIDEFS.H"> <ClInclude Include="..\core\imgread\SCSIDEFS.H">
@ -195,6 +198,9 @@
<ClInclude Include="src\cdromfs_imp.h"> <ClInclude Include="src\cdromfs_imp.h">
<Filter>src</Filter> <Filter>src</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\core\deps\coreio\coreio.h">
<Filter>deps\coreio</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Filter Include="imgread"> <Filter Include="imgread">
@ -221,5 +227,8 @@
<Filter Include="deps\crypto"> <Filter Include="deps\crypto">
<UniqueIdentifier>{a78ba9fb-70ba-4319-89e7-926abca0794c}</UniqueIdentifier> <UniqueIdentifier>{a78ba9fb-70ba-4319-89e7-926abca0794c}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="deps\coreio">
<UniqueIdentifier>{cac3d6da-3b7f-47ae-89be-59803c990f41}</UniqueIdentifier>
</Filter>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerCommandArguments>c:\ika.chd</LocalDebuggerCommandArguments> <LocalDebuggerCommandArguments>q:\ika.chd</LocalDebuggerCommandArguments>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor> <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@ -181,6 +181,10 @@ void extract_data(FILE* w, bool first, Disc* d, int start_fad, int size) {
} }
} }
void hash_track() {
}
bool jsarray; bool jsarray;
vector<string> cmds; vector<string> cmds;
vector<string> files; vector<string> files;
@ -201,9 +205,17 @@ void exec_cmd(FILE* w, bool first, Disc* d) {
} }
break; break;
case 'i': case 'i':
extract_info(w, first, d); extract_info(w, first, d);
break; break;
case 'h':
printf("hashes not supported yet");
break;
case 'f':
printf("fingerprint not supported yet");
break;
} }
} }
} }
@ -238,27 +250,23 @@ void parse_args(int argc, char** argv) {
if (p[0][0] == '-') if (p[0][0] == '-')
{ {
i++; auto cmd = string(p[0]);
switch(p[0][1]) { if (cmd == "-get") {
case 'G':
case 'g':
cmds.push_back("g"); cmds.push_back("g");
cmds.push_back(p[1]); cmds.push_back(p[1]);
cmds.push_back(p[2]); cmds.push_back(p[2]);
i+=2; i+=2;
break; break;
} else if (cmd == "-info") {
case 'I':
case 'i':
cmds.push_back("i"); cmds.push_back("i");
break; } else if (cmd == "-hash") {
cmds.push_back("h");
default: } else if (cmd == "-fingerprint") {
printf("Unknown option %c\n",*p[1]); cmds.push_back("f");
} else {
printf("Unknown option %s\n", cmd.c_str());
} }
} }
else else
files.push_back(p[0]); files.push_back(p[0]);