Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kwsch committed Apr 30, 2021
0 parents commit d94cb20
Show file tree
Hide file tree
Showing 36 changed files with 2,171 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
251 changes: 251 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
#################
## Eclipse
#################

*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath


#################
## Visual Studio
#################

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates
*.vs

# Build results

[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.Publish.xml
*.pubxml

# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
packages/

# Windows Azure Build Output
csx
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
App_Data/*.mdf
App_Data/*.ldf


#############
## Qt Creator
#############

*.save
*.autosave

#############
## GNU Emacs
#############

\#*
.\#*
*.elc


#############
## Windows detritus
#############

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/


#############
## OS X
#############

.DS_Store


#############
## C#
#############

*.resources
pingme.txt


#############
## Python
#############

*.py[co]

# Packages
*.egg
*.egg-info
dist/
build/
eggs/
parts/
var/
sdist/
develop-eggs/
.installed.cfg

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox

# Translations
*.mo

# Mr Developer
.mr.developer.cfg

#################
## MonoDevelop
#################

*.userprefs
15 changes: 15 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ISC License

Copyright (c) 2021, SciresM, Kaphotics

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
13 changes: 13 additions & 0 deletions NewSnap.App/NewSnap.App.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>9</LangVersion>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\NewSnap.Lib\NewSnap.Lib.csproj" />
</ItemGroup>

</Project>
89 changes: 89 additions & 0 deletions NewSnap.App/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
using System;
using System.IO;
using NewSnap.Lib;

namespace NewSnap.App
{
internal static class Program
{
private static void Main(string[] args)
{
if (args.Length is not (2 or 3))
{
PrintUsage();
return;
}

try
{
Dump(args);
}
#pragma warning disable CA1031 // Do not catch general exception types
catch (Exception ex)
#pragma warning restore CA1031 // Do not catch general exception types
{
Console.WriteLine(ex);
}
}

private static void Dump(string[] args)
{
var mode = args[0];
var path = args[1];
switch (mode)
{
case "-sav" when !File.Exists(path):
Console.WriteLine("Input ROM directory not found.");
return;

case "-sav":
{
var dest = args.Length == 3 ? args[2] : path;
SaveDumper.ExtractEntries(path, dest);
break;
}

case "-drp" when Directory.Exists(path):
{
var dest = args.Length == 3 ? args[2] : path;
DumpUtil.DumpAllDrp(path, dest);
break;
}

case "-drp" when !File.Exists(path):
Console.WriteLine("Input drp file not found.");
return;

case "-drp":
{
var dest = args.Length == 3 ? args[2] : Path.GetFullPath(path);
DumpUtil.DumpToPath(path, dest);
break;
}

default:
PrintUsage();
return;
}

Console.WriteLine("Done!");
}

private static void PrintUsage()
{
Console.WriteLine(@$"{nameof(NewSnap)} Command Line
==============================
See below for command line parameters.
An optional destination path will resolve to the source file/folder's current folder if not provided.
==============================
-sav [folder] [destFolder(Optional)]
-drp [drpFile] [destFolder(Optional)]
-drp [drpFolder] [destFolder(Optional)]
==============================
Hint: [x] are string paths.
");
}
}
}
Loading

0 comments on commit d94cb20

Please sign in to comment.