Repository navigation
Interactions with Swiss
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.
| Device | Device path |
|---|---|
| SD Card - SD2SP2 | sd:/ |
| SD Card - Slot A | carda:/ |
| SD Card - Slot B | cardb:/ |
| 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:/ |
| 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
/appsscheme, and the directory contains adata.isofile,argv[0]will instead point to thedata.iso. - Alternatively, if the directory contains a
.isofile named the same as the executable,argv[0]will instead point to the.isofile. - 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:
- The root directory of the first device mounted successfully.
- The
PWDenvironment variable. - 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.
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 bySYS_GetLanguage(). -
OLDPWD
Previous working directory in Swiss. -
PWD
Current working directory in Swiss. Used as fallback whenargv[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 bySYS_Report(). -
USBGECKO_SAFE
Wait for USB Gecko setting from Swiss. Used internally bySYS_Report(). -
VIDEO_ASPECT_RATIO(not yet implemented)
Display aspect ratio, typically4:3or16:9.
Intended to be used byVIDEO_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 eitherTCP:aaa.bbb.ccc.dddfor TCP/IP, orUSBGECKOfor USB Gecko.
This can be used to call back to the PC host for additional services.
Swiss and libogc2 implement a subset of the globals defined by Nintendo. The following functions may be influenced by these:
AR_GetSizeCARD_FormatCARD_FormatAsyncDVD_GetCurrentDiskIDGX_InitPAD_ControlAllMotorsPAD_ControlMotorPAD_GetSpecPAD_InitPAD_RecalibrateSYS_GetArenaHiSYS_GetArenaLoSYS_GetBusFrequencySYS_GetConsoleTypeSYS_GetCoreFrequencySYS_GetFontEncodingSYS_GetPhysicalMemSizeSYS_GetSimulatedMemSizeSYS_GetSystemTimeSYS_InitSYS_ReportSYS_ReportvVIDEO_GetCurrentTvModeVIDEO_GetPreferredModeVIDEO_Initsbrk
Swiss synchronizes with or stores applicable settings in the battery-backed SRAM. The following functions read these directly or indirectly:
CARD_MountCARD_MountAsyncGX_InitSYS_GetBootModeSYS_GetCoreTemperatureSYS_GetCounterBiasSYS_GetDisplayOffsetHSYS_GetEuRGB60SYS_GetGBSModeSYS_GetLanguageSYS_GetProgressiveScanSYS_GetSoundModeSYS_GetTAUCalibrationSYS_GetVideoModeSYS_GetWirelessIDSYS_InitVIDEO_GetAdjustingValuesVIDEO_GetPreferredModeVIDEO_Initclock_gettimegettimegettimeofdaytime
| 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
|
libogc2 can pick up Swiss' reload stub. This is done automatically when calling exit or returning from main.