Skip to content

Commit

Permalink
v0.2
Browse files Browse the repository at this point in the history
Updated reamde and help, made pattern direction lowercase
  • Loading branch information
GeekJoystick committed Jan 28, 2024
1 parent 33162e1 commit b65c0f7
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 28 deletions.
34 changes: 21 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ Pre-built binaries can be downloaded from the [GitHub Releases section](https://
```
nesrip.exe file [arguments]
Arguments:
-S {start address} {end address} Directly rip graphics from specified memory in ROM.
-o {filename} Output filename (without file extension) when using -S.
-d {filename} Graphics database filename.
-c {compression type, raw} Graphics decompression algorithm.
-p {pattern size, 1/2/4/8} Set or override tile block size.
-i {4 letter combination of b/o/t/w} Set or override palette order for rendering.
-S {start address} {end address} Directly rip graphics from specified memory in ROM.
-o {filename} Output filename (without file extension) when using -S.
-d {filename} Graphics database filename.
-c {compression type, raw} Graphics decompression algorithm.
-p {pattern size, 1/2/4/8/16} {direction, h/v} Set or override tile block size and direction.
-i {4 letter combination of b/o/t/w} Set or override palette order for rendering.
```

### Graphics database file
Expand All @@ -54,7 +54,7 @@ The file contains a number of **description blocks**, each of them containing a
Hash {ROM SHA-256 hash}
EndHash
Section {Start address} {End address}
Pattern {Pattern size, 1/2/4/8}
Pattern {Pattern size, 1/2/4/8/16} {Direction, h/v}
Palette {4 letter combination of b/o/t/w}
Compression {compression type, raw}
```
Expand All @@ -72,17 +72,17 @@ Compression {compression type, raw}
```
//Spacegulls
Hash B69BD1809E26400336AF288BC04403C00D77030B931BC31875594C9A0AE92F67
Pattern 1
Pattern 1 h
Palette botw
Section bg 00010 1000F
Section bg 00000 FFFFF
EndHash
//Micro Mages
Hash A4B5B736A84B260314C18783381FE2DCA7B803F7C29E78FB403A0F9087A7E570
Pattern 1
Pattern 1 v
Palette btow
Section spr 8010 900F
Section bg 9010 A00F
Section spr 8000 8FFF
Section bg 9000 9FFF
EndHash
...
Expand All @@ -94,8 +94,16 @@ EndHash
## Version History

* 0.2
* Made ROM headers be ignored from any operation.
* Hashes are now case insensitive.
* Made output files go into a folder named after the input ROM.
* Added batch files for processing multiple ROMs.
* Added pattern directionnality.
* Sheets will now extend vertically instead of splitting in multiple sheets.
* Added a pattern size of 16 to allow for fully vertical 128x128 sections.
* 0.1
* Initial Release
* Initial Release.

## License

Expand Down
11 changes: 6 additions & 5 deletions src/args.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,19 @@ int handleOutputArg(int pass, int* argc, char*** argv) {
return 0;
}

int handlePatternSizeArg(int pass, int* argc, char*** argv) {
CHECK_ARGC("-p", 2);
int handlePatternArg(int pass, int* argc, char*** argv) {
CHECK_ARGC("-p", 3);

if (pass != 0) {
INC(2);
INC(3);
return 0;
}

patternSize = (*argv)[1];
patternDirection = (*argv)[2];
patternOverride = true;

INC(2);
INC(3);
return 0;
}

Expand Down Expand Up @@ -154,7 +155,7 @@ int handleAdditionnalArgs(int pass, int argc, char** argv) {

CHECK_ARG("-S", handleDirectSectionRipArg);
CHECK_ARG("-o", handleOutputArg);
CHECK_ARG("-p", handlePatternSizeArg);
CHECK_ARG("-p", handlePatternArg);
CHECK_ARG("-c", handleCompressionArg);
CHECK_ARG("-i", handlePaletteDescriptionArg);
CHECK_ARG("-d", handleDescriptorFilenameArg);
Expand Down
12 changes: 6 additions & 6 deletions src/logger.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ void printHelp() {
printProgamName();
printf(" file [arguments]\n");
printf("Arguments:\n");
printf(" -S {start address} {end address} Directly rip graphics from specified memory in ROM.\n");
printf(" -o {filename} Output filename (without file extension) when using -S.\n");
printf(" -d {filename} Graphics database filename.\n");
printf(" -c {compression type, raw} Graphics decompression algorithm.\n");
printf(" -p {pattern size, 1/2/4/8} Set or override tile block size.\n");
printf(" -i {4 letter combination of b/o/t/w} Set or override palette order for rendering.\n");
printf(" -S {start address} {end address} Directly rip graphics from specified memory in ROM.\n");
printf(" -o {filename} Output filename (without file extension) when using -S.\n");
printf(" -d {filename} Graphics database filename.\n");
printf(" -c {compression type, raw} Graphics decompression algorithm.\n");
printf(" -p {pattern size, 1/2/4/8/16} {direction, h/v} Set or override tile block size and direction.\n");
printf(" -i {4 letter combination of b/o/t/w} Set or override palette order for rendering.\n");
}

void printNoInput() {
Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ char* outputFolder;
char* outputFilename = NULL;
char* compressionType = "raw";
char* patternSize = "1";
char* patternDirection = "H";
char* patternDirection = "h";
char* paletteDescription = "bwot";
char* descriptorFilename = "nes_gfxdb.txt";
int patternOverride = false;
Expand Down
6 changes: 3 additions & 3 deletions src/ripper.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,14 @@ int getSectionDetails(Rom* rom, ExtractionContext* context) {
return 0;
}

if (strcmp(args->patternDirectionString, "H") == 0) {
if (strcmp(args->patternDirectionString, "h") == 0) {
context->patternDirection = false;
}
else if (strcmp(args->patternDirectionString, "V") == 0) {
else if (strcmp(args->patternDirectionString, "v") == 0) {
context->patternDirection = true;
}
else {
printf("Error: Invalid pattern direction. Use \"H\" or \"V\".\n");
printf("Error: Invalid pattern direction. Use \"h\" or \"v\".\n");
}

return 1;
Expand Down

0 comments on commit b65c0f7

Please sign in to comment.