Commit Graph

247 Commits

Author SHA1 Message Date
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
Phillip Stephens 3eccde013d
Update logvisor 2021-06-19 14:44:24 -07:00
Henrique Gemignani Passos Lima ab8f4c3990 Update logvisor 2021-06-19 13:53:45 +03:00
Phillip Stephens 6a231004b1
Update logvisor 2021-05-07 23:21:10 -07:00
Luke Street d14b798b5f Don't install within add_subdirectory; update logvisor 2021-04-13 10:34:57 -04:00
Luke Street 1f110f3549 Update logvisor 2021-04-12 15:54:07 -04:00
Luke Street 311d20532e Update logvisor 2021-04-06 17:57:07 -04:00
Luke Street 8fdc893c86 Update logvisor; set submodule tracking branch 2021-04-06 12:48:38 -04:00
Luke Street fdc8be487d Update logvisor 2021-04-05 16:31:21 -04:00
Luke Street 3a21961a4e Update logvisor 2021-04-05 13:26:39 -04:00
Luke Street da399b5b67 Update logvisor 2021-04-05 12:06:30 -04:00
Luke Street 11c734be47 Update logvisor 2021-04-04 18:23:33 -04:00
Phillip Stephens 364787604d Update logivisor 2021-04-03 10:28:23 -07: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
Phillip Stephens d53d677038 Merge commit '5b1b6f6' 2020-12-31 13:59:27 -08:00
Phillip Stephens 5b1b6f6f80 Update logvisor 2020-12-31 13:58:57 -08:00
Luke Street 393a11ffb5 Update CMakeLists for individual build 2020-05-31 17:23:01 -04:00
Jack Andersen 2783337c36 Update fmtlib 2020-04-11 12:45:06 -10:00
Jack Andersen dffcac50c5 Exclude CMake CXX standard from MSVC 2020-04-10 19:00:19 -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
Jack Andersen 11a0351d1c Merge branch 'master' of ssh://git.axiodl.com:6431/AxioDL/nod 2019-09-30 21:30:57 -10:00
Jack Andersen 4ec6c6697b Update logvisor 2019-09-30 21:30:42 -10:00
Phillip Stephens ba0c2b7843
Merge pull request #14 from lioncash/athena
General: Be explicit about athena's SeekOrigin type
2019-09-08 17:51:25 -07:00
Lioncash 221bc7c7f2 General: Be explicit about athena's SeekOrigin type
Allows this code to function if the enum is turned into an enum class.
2019-09-08 17:29:38 -04:00
Phillip Stephens acdadaf963
Merge pull request #5 from henriquegemignani/optional
Use std::optional for CalculateTotalSizeBuild
2019-09-07 01:18:43 -07:00
Phillip Stephens d658909948
Update athena 2019-09-06 23:31:44 -07:00
Henrique Gemignani Passos Lima 091262ace1 Use std::optional for CalculateTotalSizeBuild 2019-09-06 22:17:06 +02:00
Phillip Stephens 97cfcea14e
Merge pull request #13 from lioncash/overrun
DiscBase: Prevent potential off-by-one case within getPartitonNodeCount()
2019-09-05 19:35:01 -07:00
Lioncash f5c3cbdcd7 DiscBase: Amend typo within getPartitonNodeCount() name
Adds an extra 'i' to correct a typo.
2019-09-05 21:57:44 -04:00
Lioncash 7ddff919c1 DiscBase: Prevent potential off-by-one case within getPartitonNodeCount()
We should be comparing with >= instead of >.
2019-09-05 21:56:49 -04:00
Lioncash 4bba7af2c2 DiscBase: std::move std::function instance
std::function isn't a trivial type (it's allowed to heap allocate to
store any necessary captures), so we can move it in the constructor to
avoid any unnecessary allocations
2019-09-05 21:52:43 -04:00
Lioncash f443b60bde DiscBase: Mark member functions as const where applicable
These don't modify instance state, so they can be marked as const.
2019-09-05 21:51:20 -04:00
Lioncash 998d6a77c3 General: Remove redundant inline keyword
Functions defined within the class declaration are already inline by
default, so we don't need to specify the keyword here.
2019-09-05 21:48:07 -04: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
Phillip Stephens 793413540d
Merge pull request #12 from lioncash/fmt
FileIOWin32: Amend fmt format strings
2019-08-30 16:28:45 -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
Phillip Stephens edc31b2107
Merge pull request #10 from lioncash/cmake
CMakeLists: Minor cleanup
2019-08-30 02:13:13 -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
Phillip Stephens df1e450728
Update logvisor 2019-08-26 15:56:48 -07:00
Phillip Stephens c9bf821285 Update logvisor 2019-08-17 23:00:24 -07: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