From 01e121b6e8b8082f21407b849968af8396692a63 Mon Sep 17 00:00:00 2001 From: toast2903 <22451773+lat9nq@users.noreply.github.com> Date: Wed, 31 May 2023 02:06:01 -0400 Subject: [PATCH 1/2] Create README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..7c1b8a4 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# tzdb_to_nx + +This is a CMake/C++ project to convert RFC 8536 time zone data to the Nintendo Switch's format. +This makes use a lot of Unix system calls as well as a bash script to convert the data, so it likely requires a bit of work to port to a non-POSIX platform, such as Windows. + +Intended for use with the [yuzu Emulator](https://yuzu-emu.org/) project, but the project in the future likely won't ship synthesized Switch archives. +That leaves this project in a place where it is not likely to be used, but will remain here as a reference. From badfaddec261d4ee8ff6e3a4d7888f5d51d80572 Mon Sep 17 00:00:00 2001 From: toast2903 <22451773+lat9nq@users.noreply.github.com> Date: Wed, 31 May 2023 02:14:31 -0400 Subject: [PATCH 2/2] Update README.md --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 7c1b8a4..cdaf6f1 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,14 @@ This makes use a lot of Unix system calls as well as a bash script to convert th Intended for use with the [yuzu Emulator](https://yuzu-emu.org/) project, but the project in the future likely won't ship synthesized Switch archives. That leaves this project in a place where it is not likely to be used, but will remain here as a reference. + +- tzdb: CMake and bash script to build and convert time zone data from https://www.iana.org/time-zones into the Nintendo Switch's format. +- tzdb2nx: C++ program that converts a single tzif file to the Nintendo's format. + +The fine folks over at [SwitchBrew](https://switchbrew.org/wiki/PSC_services#ITimeZoneService) have left very helpful information on reading the data. +Nintendo's file is simply the TZif version 2 data, with standard_indicators and ut_indicators data stripped out (and the necessary modifications needed in the header to make the data valid). +This means the TZif 1 data is not present, so essentially we are left with the second half of each file. + +Nintendo also does not seem to run the `zic` program on their output when they build the time zone data. +I have left the relevant build command for that in src/tzdb/CMakeLists.txt commented out, but it isn't used here. +This lets the project produce data identical to Nintendo's firmware for time zones, however this code does not produce the time zone data on US/Pacific-New or America/East-Saskatchewan (I may have bunged up the actual paths for these as this is 3 day old memory).