Skip to content

Interactions with Swiss

Extrems edited this page Oct 1, 2026 · 13 revisions

Command-line arguments

As of Swiss v0.6r1420, Swiss will pass command-line arguments onto libogc2 applications unconditionally. argv[0] points to either the executable name, or a disc image.

Swiss converts its internal device names to standardized device names understood by libdvm and libfat.

Supported devices by libogc

Device Device path
SD Card - SD2SP2 sd:/
SD Card - Slot A carda:/
SD Card - Slot B cardb:/

Supported devices by libogc2

Device Device path
GC Loader dvd:/
MMCE - Serial Port 2 sd:/
MMCE - Slot A carda:/
MMCE - Slot B cardb:/
RAM Disk ram:/
SD Card - SD2SP2 sd:/
SD Card - Slot A / SD2SP1 carda:/
SD Card - Slot B cardb:/

Unsupported devices (informational)

Device Device path
DVD * dvd:/
File Service Protocol fsp:/
File Transfer Protocol ftp:/
FlippyDrive * dvd:/
FlippyDrive Flash flash:/
IDE-EXI - Slot A * carda:/
IDE-EXI - Slot B * cardb:/
KunaiGC * flash:/
M.2 Loader * ata:/
Memory Card - Slot A carda:/
Memory Card - Slot B cardb:/
Qoob Pro qoob:/
SMB 1.0/CIFS smb:/
USB Gecko - Slot B ./
Wiikey / Wasp Fusion dvd:/
WODE Jukebox wode:/

* Support for this device is planned.


  • If the executable resides within the standard /apps scheme, and the directory contains a data.iso file, argv[0] will instead point to the data.iso.
  • Alternatively, if the directory contains a .iso file named the same as the executable, argv[0] will instead point to the .iso file.
  • If the executable resides within a disc image, argv[0] will point to the disc image.

When calling fatInitDefault(), libdvm and libfat will change the current working directory to one of the following:

  1. The root directory of the first device mounted successfully.
  2. The PWD environment variable.
  3. The directory containing argv[0].

In the future, fatInitDefault() will also automatically loop mount the disc image given by argv[0].

Additional command-line arguments can be given by using wiiload, or .cli and .dcp files named the same as the executable.

Environment variables

As of Swiss v0.6r1867, Swiss can pass environment variables onto libogc2 applications. The following may appear:

  • AVE
    Audio/video encoder setting from Swiss.

  • CUBEBOOT
    Indicates if loaded by cubeboot or cubiboot.

  • FLIPPYDRIVE
    Indicates presence of FlippyDrive.

  • LANG
    Extended system languages that cannot be represented by SYS_GetLanguage().

  • OLDPWD
    Previous working directory in Swiss.

  • PWD
    Current working directory in Swiss. Used as fallback when argv[0] is invalid, as is typically the case when using wiiload.

  • TZ (not yet implemented)
    Time zone as defined by the POSIX standard. Used internally by the libc.

  • USBGECKO_CHANNEL
    Enable USB Gecko setting from Swiss. Used internally by SYS_Report().

  • USBGECKO_SAFE
    Wait for USB Gecko setting from Swiss. Used internally by SYS_Report().

  • VIDEO_ASPECT_RATIO (not yet implemented)
    Display aspect ratio, typically 4:3 or 16:9.
    Intended to be used by VIDEO_GetAspectRatio().

  • VIDEO_PIXEL_PERFECT
    Set when optimizing for the RetroTINK-4K's HDMI input.
    Intended to turn off horizontal and vertical scaling.

  • WIILOAD
    Address of the wiiload client. Can be either TCP:aaa.bbb.ccc.ddd for TCP/IP, or USBGECKO for USB Gecko.
    This can be used to call back to the PC host for additional services.

Dolphin OS globals

Swiss and libogc2 implement a subset of the globals defined by Nintendo. The following functions may be influenced by these:

  • AR_GetSize
  • CARD_Format
  • CARD_FormatAsync
  • DVD_GetCurrentDiskID
  • GX_Init
  • PAD_ControlAllMotors
  • PAD_ControlMotor
  • PAD_GetSpec
  • PAD_Init
  • PAD_Recalibrate
  • SYS_GetArenaHi
  • SYS_GetArenaLo
  • SYS_GetBusFrequency
  • SYS_GetConsoleType
  • SYS_GetCoreFrequency
  • SYS_GetFontEncoding
  • SYS_GetPhysicalMemSize
  • SYS_GetSimulatedMemSize
  • SYS_GetSystemTime
  • SYS_Init
  • SYS_Report
  • SYS_Reportv
  • VIDEO_GetCurrentTvMode
  • VIDEO_GetPreferredMode
  • VIDEO_Init
  • sbrk

Non-volatile memory

Swiss synchronizes with or stores applicable settings in the battery-backed SRAM. The following functions read these directly or indirectly:

  • CARD_Mount
  • CARD_MountAsync
  • GX_Init
  • SYS_GetBootMode
  • SYS_GetCoreTemperature
  • SYS_GetCounterBias
  • SYS_GetDisplayOffsetH
  • SYS_GetEuRGB60
  • SYS_GetGBSMode
  • SYS_GetLanguage
  • SYS_GetProgressiveScan
  • SYS_GetSoundMode
  • SYS_GetTAUCalibration
  • SYS_GetVideoMode
  • SYS_GetWirelessID
  • SYS_Init
  • VIDEO_GetAdjustingValues
  • VIDEO_GetPreferredMode
  • VIDEO_Init
  • clock_gettime
  • gettime
  • gettimeofday
  • time

Preferred render modes

Swiss video mode libogc2 render mode libogc render mode
NTSC 480i TVNtsc480IntDf TVNtsc480IntDf or TVNtsc480Prog
NTSC 480sf TVNtsc480IntDf TVNtsc480IntDf or TVNtsc480Prog
NTSC 240p TVNtsc240DsVf TVNtsc480IntDf or TVNtsc480Prog
NTSC 480p TVNtsc480Prog TVNtsc480IntDf or TVNtsc480Prog
PAL 576i TVPal576IntDfScale TVPal576IntDfScale or TVPal576ProgScale
PAL 576sf TVPal576IntDfScale TVPal576IntDfScale or TVPal576ProgScale
PAL 288p TVPal288DsVfScale TVPal576IntDfScale or TVPal576ProgScale
PAL 576p TVPal576ProgScale TVPal576IntDfScale or TVPal576ProgScale
PAL-M 480i TVMpal480IntDf TVMpal480IntDf or TVMpal480Prog
PAL-M 480sf TVMpal480IntDf TVMpal480IntDf or TVMpal480Prog
PAL-M 240p TVMpal240DsVf TVMpal480IntDf or TVMpal480Prog
NTSC-N 576i TVPal576IntDfScale TVNtsc480IntDf or TVNtsc480Prog
NTSC-N 576sf TVPal576IntDfScale TVNtsc480IntDf or TVNtsc480Prog
NTSC-N 288p TVPal288DsVfScale TVNtsc480IntDf or TVNtsc480Prog
PAL 480i TVEurgb60Hz480IntDf TVNtsc480IntDf or TVNtsc480Prog
PAL 480sf TVEurgb60Hz480IntDf TVNtsc480IntDf or TVNtsc480Prog
PAL 240p TVEurgb60Hz240DsVf TVNtsc480IntDf or TVNtsc480Prog
PAL 480p TVEurgb60Hz480Prog TVNtsc480IntDf or TVNtsc480Prog

Return to loader

libogc2 can pick up Swiss' reload stub. This is done automatically when calling exit or returning from main.