Module:AocUtils and Nxargs: Difference between pages

From ZeldaMods (Breath of the Wild)
(Difference between pages)
Jump to navigation Jump to search
imported>Leoetlino
No edit summary
 
imported>Leoetlino
No edit summary
 
Line 1: Line 1:
local pack = {}
{{Subsystem infobox|name=nxargs|is_name_official=1|description=[Switch] Holds launch parameters (retrieved with nn::oe::TryPopLaunchParameter)|init_addr_switch150=0000007100901BA4}}


aoc_resource_prefixes = {
Collects launch parameters (retrieved with nn::oe::TryPopLaunchParameter which is called each time with a 0x1000 byte buffer) and processes them as soon as the game has finished loading and if the current map isn't TitleMenu and isn't STAGESELECT, and if there is no active event.
  "^Terrain/A/AocField",
  "^UI/StaffRollDLC/",
  "^Map/MainField/",
  "^Map/MainFieldDungeon/",
  "^Map/AocField/",
  "^Physics/StaticCompound/AocField/",
  "^Physics/StaticCompound/MainFieldDungeon/",
  "^Movie/Demo6",
  "^Game/AocField/",
  "^NavMesh/AocField/",
  "^NavMesh/MainFieldDungeon/",
  "^Physics/TeraMeshRigidBody/AocField/",
  "^Voice/.*/Stream_Demo6.*/.*\.bfstm$",
  "^System/AocVersion\.txt$",
  "^Pack/RemainsWind.pack$",
  "^Pack/RemainsElectric.pack$",
  "^Pack/RemainsWater.pack$",
  "^Pack/RemainsFire.pack$",
  "^Pack/FinalTrial.pack$",
}


function has_aoc_dungeon_num(s)
A [https://gist.github.com/leoetlino/da5eeea19ad628642240bf8d2701dc51 010 template for the launch parameter data format is available here].
  local dungeon_num_str = string.match(s, "Dungeon(%d%d%d)")
  if dungeon_num_str == nil then
  return false
  end
  local dungeon_num = tonumber(dungeon_num_str)
  return dungeon_num > 119
end


function should_use_aoc_file_device(path)
[[Category: Internals]]
  for i, p in ipairs(aoc_resource_prefixes) do
[[Category: Subsystems (BotW)]]
    if string.find(path, p) then
      return true
    end
  end
  if string.find(path, "^Pack/") and string.find(path, "\.pack$") and has_aoc_dungeon_num(path) then
return true
  end
  if string.find(path, "^Map/CDungeon/") and has_aoc_dungeon_num(path) then
return true
  end
  if string.find(path, "^Physics/StaticCompound/") and has_aoc_dungeon_num(path) then
return true
  end
  if string.find(path, "^NavMesh/CDungeon/") and has_aoc_dungeon_num(path) then
return true
  end
  return false
end
 
function pack.get_aoc_canonical_path(frame)
  local path = frame.args.path
  local aoc_only = not not frame.args.aoc_only
  if not path then
  return "(unknown)"
  end
  if aoc_only or should_use_aoc_file_device(path) then
  return "Aoc/0010/" .. path
  end
  return path
end
 
return pack

Revision as of 19:50, 30 April 2019

nxargs
Subsystem
Official name Yes
Description [Switch] Holds launch parameters (retrieved with nn::oe::TryPopLaunchParameter)
Init function Switch 1.5.0: 0000007100901BA4
Wii U 1.5.0: ???
Debug only No

Collects launch parameters (retrieved with nn::oe::TryPopLaunchParameter which is called each time with a 0x1000 byte buffer) and processes them as soon as the game has finished loading and if the current map isn't TitleMenu and isn't STAGESELECT, and if there is no active event.

A 010 template for the launch parameter data format is available here.