Commit Graph

129 Commits

Author SHA1 Message Date
Luke Street 2f53b21740 Stop trying to make <ranges> happen, it's not going to happen 2021-10-25 22:34:12 -04:00
Luke Street 45f56d21f1 DirectoryEnumerator: Only include <ranges> on Windows 2021-10-25 19:34:50 -04:00
Phillip Stephens 2288e71605
Fix OSUTF8to32 2021-07-10 19:40:39 -07:00
Luke Street 0985c63958 Fix compile errors/typos; update logvisor 2021-06-30 16:22:50 -04:00
Luke Street c1635245b8 Use UTF-8 exclusively internally; replace iconv with OSUTF
Filenames are now unconditionally encoded/decoded as
Shift-JIS, which provides a reasonable fallback to
7-bit ASCII.
2021-06-30 13:47:10 -04:00
Minty-Meeo 3c25647b6e The Encoding Update
While Nintendo's own documents claim GameCube and Wii disc file symbol tables only support 7-bit ASCII, this is far from the truth.  Indeed, even some first-party Nintendo games shipped with Shift-JIS encoded file symbol tables.  My guess?  The locale of whatever Windows machine mastered a GameCube or Wii disc influenced how wide character strings (UCS-2) were converted to narrow character strings.  To account for all possibilites, this update adds extensible multi-byte character set options to NOD-Tool.

A rundown of notable changes:
 - "-c XXXXX" option added to set the encoding of the GameCube / Wii ISO(s) being processed.
 - "SystemStringConv" renamed to "DiscLocToSystemConv"
 - "SystemUTF8Conv" renamed to "SystemToDiscLocConv"
 - Help message updated with new info.
 - Bugfix: AddBuildName had a logic error wherein the length of the SystemString was being used instead of length of the disc locale string.  This would corrupt the File Symbol Table if the disc locale string's length was greater than the SystemString's length.
 - Bugfix: recursiveMergeFST was not keeping track of parent indexes at all, meaning nested folders and their contents would be corrupted.  I simply copied the way recursiveBuildFST did things to fix this.
 - Bugfix (Windows): On Windows, for some reason, Sstat was a typedef for _stat (32-bit) instead of _stat64 (64-bit).  This is confounding, because untrimmed Wii ISOs will always be larger than the unsigned 32-bit integer limit (4,699,979,776 bytes vs 4,294,967,295 bytes), meaning the MergeWii errand has never worked for untrimmed ISOs on Windows.  Was this never tested??
 - Bugfix (Windows): Did you know Windows Command Prompt fully supports Unicode?  Stdio streams are now in _O_U16TEXT mode for Windows only.  Previously, attempting to print any character that could not be narrowed to your locale's encoding would either silently fail (std functions), or throw an exception (fmt functions).  As a minor drawback, narrow character print functions can no longer be used when stdio is in _O_U16TEXT mode, necessitating my PR for Logvisor here: (AxioDL/logvisor#7)
 - ExtractionContext::progressCB now uses SystemStringView because widechar printing works correctly on Windows now.
 - progFunc lambda no longer throws exceptions when printing unicode because widechar printing works correctly on Windows now.
 - Top-level constructors and functions with a Codepage_t parameter have also signatures that default to the US-ASCII codepage.
    - DiscGCN constructor
    - DiscBuilderGCN constructor
    - DiscBuilderGCN::CalculateTotalSizeRequired
    - DiscMergerGCN constructor
    - DiscMergerGCN::CalculateTotalSizeRequired
    - DiscWii constructor
    - DiscBuilderWii constructor
    - DiscBuilderWii::CalculateTotalSizeRequired
    - DiscMergerWii constructor
    - DiscMergerWii::CalculateTotalSizeRequired
    - OpenDiscFromImage
 - Conversion between system encoding and disc locale encoding has checks in place to warn the user if string conversion goes awry.
2021-06-27 03:26:20 -05:00
Luke Street 02c188497a Fixes for Apple Silicon
- Only include cpuid.h for x86
- Only set -maes flag for x86
2021-01-06 20:32:21 -05:00
Jack Andersen 2783337c36 Update fmtlib 2020-04-11 12:45:06 -10:00
Jack Andersen f147e12356 Windows build fixes 2019-11-24 15:17:57 -10:00
Jack Andersen 48a2981a93 Shared NFS data class not necessary 2019-11-24 13:47:48 -10:00
Jack Andersen 19604b2a3b Use correct slash finding function 2019-11-23 20:25:29 -10:00
Jack Andersen c1a1d1abc8 Use logical block for iv 2019-11-23 20:00:48 -10:00
Jack Andersen 6bf4f07129 Consistent variable names for blocks 2019-11-23 17:29:57 -10:00
Jack Andersen 75fc574f81 Support for Wii U VC NFS images 2019-11-23 17:24:33 -10:00
Henrique Gemignani Passos Lima 091262ace1 Use std::optional for CalculateTotalSizeBuild 2019-09-06 22:17:06 +02:00
Phillip Stephens 55301dd505
Merge pull request #11 from lioncash/make
General: Use std::make_unique where applicable
2019-08-30 16:28:53 -07:00
Lioncash f11eb728bf FileIOWin32: Amend fmt format strings
Amends a few stragglers from the transition to fmtlib.
2019-08-30 05:40:00 -04:00
Lioncash a8753e273f General: Use std::make_unique where applicable
Makes for a little less reading in certain cases.
2019-08-30 05:35:12 -04:00
Phillip Stephens 63264695b0
Merge pull request #9 from lioncash/include
General: Include headers directly where necessary
2019-08-30 02:13:24 -07:00
Lioncash 1b3bb7815d CMakeLists: Move lib-specific CMake commands into the lib folder
Keeps a clear division between the lib and the driver CMake code.
2019-08-30 04:53:05 -04:00
Lioncash 89df98ee96 CMakeLists: Eliminate glob statement
Avoids a top-level variable from being defined and adds the source files
explicitly to the target like our other targets.
2019-08-30 04:43:56 -04:00
Lioncash 5935e84dab General: Include headers directly where necessary
Ensures includes are explicitly included where necessary to avoid
indirect inclusions.
2019-08-30 04:34:49 -04:00
Jack Andersen 18b297e312
Merge pull request #8 from lioncash/cmake
CMakeLists: Migrate off directly modifying CMAKE_CXX_FLAGS
2019-08-10 09:30:26 -07:00
Lioncash 876a2ccf81 CMakeLists: Migrate off directly modifying CMAKE_CXX_FLAGS
We can simply apply the compilation options directly to the target. We
can perform equivalent behavior for conditionally adding sources to the
target instead of assigning to a variable as well.
2019-08-10 01:52:27 -04:00
Lioncash 2171388b9d General: Make use of override where applicable
Makes it explicit where functions are being overridden in derived
classes/structs.
2019-08-10 01:41:44 -04:00
Jack Andersen 37792ba116 Massive libfmt refactor 2019-07-19 18:21:57 -10:00
Phillip Stephens d9b6be8446 Compile fixes 2019-06-20 15:45:35 -07:00
Jack Andersen 47322b9496 Refactor of CMake for cleaner dependency handling 2019-06-11 15:54:20 -10:00
Jack Andersen 77013bbd9f Merge branch 'master' of https://github.com/AxioDL/nod 2019-06-09 16:51:00 -10:00
Jack Andersen 34b943c40f Solve various signing warnings reported by GCC 2019-06-09 16:49:17 -10:00
Jack Andersen 4dd0375cae Adjusted install commands for better CMake compatibility 2019-05-23 14:17:45 -10:00
Jack Andersen 95ed2ae7dc Implicit switch fallthrough refactor 2019-02-17 19:46:42 -10:00
Jack Andersen be8409681f New code style refactor 2018-12-07 19:21:47 -10:00
Jack Andersen f87b286ff3 Windows build fixes 2018-10-14 10:11:28 -10:00
Jack Andersen eb6aa30563 NX build fixes 2018-10-06 16:56:47 -10:00
Aruki 6f777ebb48 Fixes for a couple warnings/errors whene compiling on windows 2018-07-06 01:02:23 -06:00
Jack Andersen d5f5db440c Windows build fixes and warning avoidance 2018-05-24 20:38:06 -10:00
Jack Andersen a557f86974 Huge compile performance refactor 2017-12-28 21:57:54 -10:00
Jack Andersen 3d70a568dc UWP support 2017-12-05 17:23:58 -10:00
Jack Andersen 58ceb47b25 Windows fixes 2017-11-13 17:35:34 -10:00
Jack Andersen 27a2cb5998 string_view refactor 2017-11-12 20:18:53 -10:00
Jack Andersen c374038103 Minor indent fix 2017-10-30 17:51:49 -10:00
Jack Andersen db1a6f13a2 Fix missing variable initialization 2017-07-30 17:43:51 -10:00
Jack Andersen fb2a5c91d2 Explicitly zero-initialize new image files 2017-07-30 16:03:20 -10:00
Phillip Stephens 42ef3a7958 Fix return type derp 2017-07-25 05:06:35 -07:00
Jack Andersen d597400f4a Fix FST parent directory index 2017-07-11 19:13:44 -10:00
Phillip Stephens e99290e3c3 Remove unreferenced local 2017-07-09 02:11:19 -07:00
Phillip Stephens 72169e8e77 Added `writeSysFiles` for convience of integration 2017-07-09 01:25:43 -07:00
Jack Andersen 8bdbcf0c90 Fixes to work with directory-blob dolphin branch 2017-07-01 21:16:09 -10:00
Jack Andersen 6454d68abc Windows Fixes 2017-07-01 20:08:26 -10:00