Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

Commit

Permalink
Add WAD2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
dd86k committed Nov 14, 2018
1 parent ce009c5 commit 2ca7e5b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions src/ff.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ void scan(int *error) {
return;
}

char *r; // result pointer

switch (s) {
case 0x00000100: {
uint8_t b[12];
Expand Down Expand Up @@ -445,14 +447,17 @@ void scan(int *error) {
scan_rpm();
return;

case 0x44415749: case 0x44415750: { // "IWAD", "PWAD"
char *r;
case 0x44415749:
r = "IWAD";
goto WAD;
case 0x44415750:
r = "PWAD";
goto WAD;
case 0x32444157: {
r = "WAD2";
WAD:
int b[2]; // Reads as ints.
_ddread(&b, sizeof(b));
if (s == 0x44415750)
r = "PWAD";
else
r = "IWAD";
reportf("%s, %d entries at %Xh\n", r, b[0], b[1]);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void version() {
#endif
"\n"
"MIT License: Copyright (c) 2017-2018 dd86k\n"
"Project page: <https://github.com/dd86k/ff>"
"Project page: <https://git.dd86k.space.com/dd86k/ff>"
);
exit(0);
}
Expand Down

0 comments on commit 2ca7e5b

Please # to comment.