Changes

no edit summary
Line 4: Line 4:     
The launcher launches each game by using [[Applet_Manager_services#ExecuteProgram|ExecuteProgram]] with ProgramIndex={above values}, with 0x10-byte [[Applet_Manager_services#UnpopToUserChannel|parameter-data]]: {+0x0 = [[Settings_services#LanguageCode|LanguageCode]] selected in the launcher for this game, +0x8/+0xC = floats loaded from a fixed-data array specific for each game, which games can use with [[Audio_services#SetAudioDeviceOutputVolumeAuto|SetAudioDeviceOutputVolume]]}. Each game returns to the launcher by using [[Applet_Manager_services#ExecuteProgram|ExecuteProgram]] with ProgramIndex=0, no [[Applet_Manager_services#UnpopToUserChannel|parameter-data]] is passed to the launcher.
 
The launcher launches each game by using [[Applet_Manager_services#ExecuteProgram|ExecuteProgram]] with ProgramIndex={above values}, with 0x10-byte [[Applet_Manager_services#UnpopToUserChannel|parameter-data]]: {+0x0 = [[Settings_services#LanguageCode|LanguageCode]] selected in the launcher for this game, +0x8/+0xC = floats loaded from a fixed-data array specific for each game, which games can use with [[Audio_services#SetAudioDeviceOutputVolumeAuto|SetAudioDeviceOutputVolume]]}. Each game returns to the launcher by using [[Applet_Manager_services#ExecuteProgram|ExecuteProgram]] with ProgramIndex=0, no [[Applet_Manager_services#UnpopToUserChannel|parameter-data]] is passed to the launcher.
 +
 +
Each game uses different methods of emulation.
    
= SuperMario64 =
 
= SuperMario64 =
 +
This is a Nintendo 64 emulator. This uses [[JIT_services|JIT]] for running the emulated executable. RomFs also contains an AOT [[NRO]], but it's unused.
 +
 +
The ROMIMAGE .bin in RomFs is identical to the [https://tcrf.net/Super_Mario_64_(Nintendo_64)/Regional_and_Version_Differences#Shindou_Pak_Taiou_Version Shindou] region N64 ROM. Patches are applied at runtime with the config/lua files.
 +
 +
The LanguageCode is loaded from the launch-parameter passed by the launcher, if not available it will fallback to the output from [[Applet_Manager_services#GetDesiredLanguage|GetDesiredLanguage]]. This is used to select the <language> to load from RomFs "/Message/", the data from there is then used for patching the ROM. Note that the .lua file runs <code>n64InitMessageData();</code> from the GameBegin() function.
 +
 +
RomFs contains the following:
 +
* "/Pipeline.cache", "/shader_p1_frag.spv", "/shader_p1_vert.spv", "/shader_vulkan_frag.spv", "/shader_vulkan_vert.spv"
 +
* "/Message/<language>/" contains:
 +
** "Messages.bin", "UI_Font8.bin", "UI_Font16.bin", "UI_Font16_code2.bin", "UI_FontS88.bin".
 +
* "/.nrr/" contains:
 +
** "EmuAppNX64.nrr": The [[NRR]] for the [[JIT_services|JitPlugin]].
 +
** "04_UNSMJ3.002.nrr": Unused [[NRR]] for the AOT [[NRO]].
 +
* "/nro/" contains:
 +
** "EmuSystemJITPlugin.nro": The [[NRO]] for the [[JIT_services|JitPlugin]].
 +
** "NROBuilder.nro": Unused AOT [[NRO]].
 +
** "05_UNSMJ3.002.nro": Same as "NROBuilder.nro".
 +
** "/rom/": This contains the ROM sub-directory, in this case that dir-name is "Stardust_JP" which contains the following:
 +
*** "Textures/texture_pack.cpio": Standard (?) .cpio archive containing textures.
 +
*** "00_UNSMJ3.002.meta": Contains json metadata for the other files in this directory, etc.
 +
*** "01_UNSMJ3.002.bin": This is the ROMIMAGE.
 +
*** "02_UNSMJ3.002.cfg": Configuration json file, ROMCONFIG.
 +
*** "03_UNSMJ3.002.pcb": This is the "PRECMP" file referenced by the .meta.
 +
*** "04_UNSMJ3.002.nrr": Unused [[NRR]] which is the same as "/.nrr/04_UNSMJ3.002.nrr", except the [[NRR#Certification|Certification]] and ApplicationId are all-zero.
 +
*** "05_UNSMJ3.002.nro": Unused, identical to "/nro/05_UNSMJ3.002.nro".
 +
*** "06_UNSMJ3.002.lua": This is the "ROMPATCH" Lua file referenced by the .meta.
 +
*** "07_UNSMJ3.002.ppl": This is the "PIPELINE" file referenced by the .meta.
    
= SuperMarioSunshine =
 
= SuperMarioSunshine =
 +
This is a Nintendo Gamecube emulator. This uses an AOT [[NRO]] for running the emulated executable.
    
= SuperMarioGalaxy =
 
= SuperMarioGalaxy =