Difference between revisions of "Nintendo 64 - Nintendo Switch Online"

From Nintendo Switch Brew
Jump to navigation Jump to search
Line 37: Line 37:
 
***** The .lua file is optional. Compared to [[Super_Mario_3D_All-Stars#SuperMario64|SM3DAS]], Mario64 here (regions E/P at least) no longer has a .lua file, and the only remaining patches in config are for "Idle" and "BreakLoop". There's also various config differences compared to SM3DAS.
 
***** The .lua file is optional. Compared to [[Super_Mario_3D_All-Stars#SuperMario64|SM3DAS]], Mario64 here (regions E/P at least) no longer has a .lua file, and the only remaining patches in config are for "Idle" and "BreakLoop". There's also various config differences compared to SM3DAS.
 
*** "{dirname}.png"
 
*** "{dirname}.png"
 +
 +
= libHovercraftJITPlugin =
 +
This section documents the [[JIT_services|JIT]] plugin.
 +
 +
This is an updated version of the plugin used by [[Super_Mario_3D_All-Stars|SM3DAS]]. Besides compiler-version differences / funcs being moved around, there were actual code changes.
 +
 +
The struct passed as the InBuffer to [[JIT_services#Control|Control]] is now 0xE00-bytes instead of 0xEB0-bytes. The internal workmem offsets / layout changed. Various funcs were updated etc.

Revision as of 15:31, 2 November 2021

This page documents the N64 application available via Nintendo Switch Online.

The internal name is "Hovercraft".

This uses an updated version of the N64 emulator used by SM3DAS. Like SM3DAS, Vulkan is used for rendering.

This saves various PlayReports. This also uses bcat.

NPDM

Same as SM3DAS Mario64 (besides programId etc), except the following services are additionally accessible: audout:u, bcat:u, bsd:u, bsdcfg, friend:u, nifm:u, nsd:u, sfdnsres, ssl. Flags is 0x27.

Details

Like SM3DAS, this uses JIT for running the emulated executable. The game archives also contains an AOT NRO. A NRO does get loaded, however it's not used other than that (no symbols from the NRO are resolved). Patches are applied at runtime with the config/lua files from the game archives.

A maximum of 0x1000-bytes are loaded from the launch-parameter, with buf[read_size]=0. Hence, this is a string. When available, this seems to be used to select which game to launch.

RomFs contains the following:

  • "/kc.dat", "/Pipeline.cache", "/shader_font_frag.spv", "/shader_p1_frag.spv", "/shader_p1_vert.spv", "/shader_p2_srgb_frag.spv", "/shader_vulkan_frag.spv", "/shader_vulkan_vert.spv".
  • "/.nrr/" contains:
    • "l-classics-app.nrr"
    • "libHovercraftJITPlugin.nrr"
    • And NRRs for each game's AOT NRO.
  • "/bootapp/" contains "init.json", "resources.json", and "resources/" which contains:
    • Various UI/graphics data is stored here under various sub-dirs. This also includes "scripts/", which contains Lua scripts in bytecode form.
      • One of these scripts at "/scripts/constants_nuse.lua" in the raw data, contains among various other data: "FirstDeliveryDate" "2019-09-01".
  • "/nro/" contains "libHovercraftJITPlugin.nro", the NRO for the JitPlugin.
  • "/sysdata/shaders/mesh.spirv", "/sysdata/shaders/sprite.spirv"
  • "/titles/" contains the data for the emulated games:
    • "lclassics.titlesdb"
    • There's a sub-dir for each game containing:
      • "{dirname}-details.png"
      • "{dirname}.bnz": ROM-image compressed directly with zlib.
      • "{dirname}.dtz": cpio archive compressed directly with zlib, containing the following (these are under "metapack_temp\"):
        • The data here has mostly the same structure/format as SM3DAS rom/{subdir}, without the unused NRR. Filenames have the same "{fileid}_{TitleCode}.ext" format. When any texture data is present, it's included directly in this directory.
          • The .meta no longer contains "DataSection", which in SM3DAS specified what files to load from here.
          • The .lua file is optional. Compared to SM3DAS, Mario64 here (regions E/P at least) no longer has a .lua file, and the only remaining patches in config are for "Idle" and "BreakLoop". There's also various config differences compared to SM3DAS.
      • "{dirname}.png"

libHovercraftJITPlugin

This section documents the JIT plugin.

This is an updated version of the plugin used by SM3DAS. Besides compiler-version differences / funcs being moved around, there were actual code changes.

The struct passed as the InBuffer to Control is now 0xE00-bytes instead of 0xEB0-bytes. The internal workmem offsets / layout changed. Various funcs were updated etc.