### Standard I/O Setup and Management Source: https://pcsx-redux.github.io/nugget/dc/d74/fileio_8h_source.html Functions for setting up, installing, and reopening standard input/output streams. ```c void setupFileIO(int installTTY); ``` ```c void installStdIo(int installTTY); ``` ```c void reopenStdio(); ``` -------------------------------- ### Install Standard I/O Source: https://pcsx-redux.github.io/nugget/d9/df6/stdio_8c.html Installs the standard I/O system. Use this function to set up TTY if needed. ```c void installStdIo (int installTTY) ``` -------------------------------- ### Install Kernel Handlers Source: https://pcsx-redux.github.io/nugget/dc/dea/handlers_8c.html Initializes and installs the necessary handlers for the operating system kernel. ```c void installKernelHandlers () ``` -------------------------------- ### Variable Initialization Examples Source: https://pcsx-redux.github.io/nugget/d4/d36/cester-cop0_8c.html Examples of variable initializations, including register assignments and null assignments. ```c s_oldIMASK = IMASK ``` ```c s_oldDPCR = DPCR ``` ```c s_oldDICR = DICR ``` ```c IMASK = 0 ``` ```c IREG = 0 ``` ```c DPCR = 0 ``` ```c uint32_t dicr = DICR ``` ```c DICR = dicr ``` ```c s_got40 = 0 ``` ```c s_got80 = 0 ``` ```c s_cause = 0 ``` ```c s_epc = 0 ``` ```c s_from = 0 ``` ```c s_resume = NULL ``` ```c s_regs = NULL ``` ```c s_customhandler = NULL ``` -------------------------------- ### Install Kernel Handlers Source: https://pcsx-redux.github.io/nugget/d9/d96/openbios_2kernel_2handlers_8h_source.html Installs the necessary handlers for the kernel. This function should be called during system initialization. ```c void installKernelHandlers() ``` -------------------------------- ### Install Handler Function Source: https://pcsx-redux.github.io/nugget/d1/d5b/structHandler.html Installs a handler for a specific address. This is an inline function. ```cpp template | void Handler< addr >::install | ( | | ) | ---|---|---|---|--- inline ``` -------------------------------- ### Start Shell Function Source: https://pcsx-redux.github.io/nugget/d6/d4f/shell_8c.html Initializes and starts the shell interface. It takes a single uint32_t argument, which is typically used for configuration or initial parameters. ```c int startShell (uint32_t arg) ``` -------------------------------- ### Install Exception Handler Source: https://pcsx-redux.github.io/nugget/d2/d6e/syscalls_8h_source.html Installs a handler for system exceptions. This is crucial for robust error handling. ```c static __attribute__((always_inline)) void syscall_installExceptionHandler() { register int n asm("t1") = 0x07; __asm__ volatile("" : "=r"(n) : "r"(n)); ((void (*)())0xc0)(); } ``` -------------------------------- ### Start Pad Syscall Source: https://pcsx-redux.github.io/nugget/d2/d6e/syscalls_8h_source.html Starts the input pad system. Sets register t1 to 0x13 and calls the syscall handler at 0xb0. ```c static __attribute__((always_inline)) void syscall_startPad() { register int n asm("t1") = 0x13; __asm__ volatile("" : "=r"(n) : "r"(n)); ((void (*)())0xb0)(); } ``` -------------------------------- ### Install TTY Console Driver Source: https://pcsx-redux.github.io/nugget/db/d39/md_openbios_2README.html Use `INSTALL_TTY_CONSOLE=true` to install a DTL-H2000 host console driver instead of the default 'dummy' TTY driver. ```makefile INSTALL_TTY_CONSOLE=true ``` -------------------------------- ### Install GCC for Arch Derivatives Source: https://pcsx-redux.github.io/nugget/d3/d4b/md_psyqo_2GETTING__STARTED.html Installs the MIPS toolchain for Arch Linux using an AUR helper. This includes binutils and gcc. ```bash trizen -S cross-mipsel-linux-gnu-binutils cross-mipsel-linux-gnu-gcc ``` -------------------------------- ### Device Information Source: https://pcsx-redux.github.io/nugget/dc/d74/fileio_8h_source.html Function to print a list of all installed devices. ```c void printInstalledDevices(); ``` -------------------------------- ### Exception Handler Installation/Uninstallation Source: https://pcsx-redux.github.io/nugget/d4/d36/cester-cop0_8c.html Prototypes for functions that install and uninstall exception handlers. ```c void installExceptionHandlers(uint32_t(*handler)(uint32_t *regs, uint32_t from)); ``` ```c void uninstallExceptionHandlers(); ``` -------------------------------- ### ArchiveManager Get Index Entry Sector Start Source: https://pcsx-redux.github.io/nugget/db/d86/archive-manager_8hh_source.html Calculates and returns the starting LBA (Logical Block Address) for a given IndexEntry within the archive. ```cpp uint32_t getIndexEntrySectorStart(const IndexEntry *entry) const ``` -------------------------------- ### setup.c Function Documentation Source: https://pcsx-redux.github.io/nugget/d2/d2e/setup_8c.html Documentation for functions within setup.c, including dependency graph and function signatures. ```APIDOC ## setup.c Function Documentation ### Include Dependency Graph Include dependency graph for setup.c: ## Functions --- int | __attribute__ ((section(".ramtext"))) ### Function Documentation ## ◆ __attribute__() int __attribute__ | ( | (section(".ramtext")) | | ) | --- | Parameter | Type | Description | |---|---|---| | section(".ramtext") | int | Specifies the section for the function. | ``` -------------------------------- ### Get Index Entry Sector Start Source: https://pcsx-redux.github.io/nugget/db/d86/archive-manager_8hh_source.html Calculates the starting sector LBA for a given index entry by combining the archive's base LBA with the entry's offset. ```cpp uint32_t getIndexEntrySectorStart(const IndexEntry *entry) const { return m_archiveDirentry.LBA + entry->getSectorOffset(); } ``` -------------------------------- ### Setup File I/O Source: https://pcsx-redux.github.io/nugget/d2/d6e/syscalls_8h_source.html Initializes or configures file input/output operations, potentially including TTY support. ```c static __attribute__((always_inline)) void syscall_setupFileIO(int installTTY) { register int n asm("t1") = 0x12; __asm__ volatile("" : "=r"(n) : "r"(n)); ((void (*)(int))0xc0)(installTTY); } ``` -------------------------------- ### Get Heap Start Pointer Source: https://pcsx-redux.github.io/nugget/d6/daf/psyqo_2alloc_8h_source.html psyqo_heap_start returns a pointer to the beginning of the heap memory region. ```c void *psyqo_heap_start(); ``` -------------------------------- ### startShell Function Source: https://pcsx-redux.github.io/nugget/df/d03/shell_8h_source.html This function is responsible for starting the shell with a given argument. ```APIDOC ## startShell ### Description Starts the shell with a specified argument. ### Method N/A (This appears to be a function declaration, not an API endpoint) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```c startShell(0x1000); ``` ### Response #### Success Response (200) N/A (Function return type is int, but specific success response details are not provided) #### Response Example ``` // Return value indicates success or failure, specific codes not detailed. ``` ``` -------------------------------- ### Standard I/O Redirection Source: https://pcsx-redux.github.io/nugget/dc/d74/fileio_8h.html Functions for installing, setting up, and reopening standard input/output streams. ```APIDOC ## POST /installStdIo ### Description Installs standard input/output streams, optionally to a TTY. ### Method POST ### Endpoint /installStdIo ### Parameters #### Request Body - **installTTY** (int) - Required - A flag indicating whether to install to a TTY (non-zero) or not (zero). ### Response #### Success Response (200) - **result** (void) - This function does not return a value. #### Response Example ```json { "status": "success" } ``` ``` ```APIDOC ## POST /reopenStdio ### Description Reopens standard input/output streams. ### Method POST ### Endpoint /reopenStdio ### Parameters #### Request Body None ### Response #### Success Response (200) - **result** (void) - This function does not return a value. #### Response Example ```json { "status": "success" } ``` ``` ```APIDOC ## POST /setupFileIO ### Description Sets up file input/output, optionally installing to a TTY. ### Method POST ### Endpoint /setupFileIO ### Parameters #### Request Body - **installTTY** (int) - Required - A flag indicating whether to install to a TTY (non-zero) or not (zero). ### Response #### Success Response (200) - **result** (void) - This function does not return a value. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Nugget - Namespace Member Details Source: https://pcsx-redux.github.io/nugget/namespacemembers_t.html Details on retrieving specific namespace members, with examples for members starting with 't'. ```APIDOC ## Nugget Namespace Member Details ### Description Retrieves detailed information about namespace members. ### Method GET ### Endpoint /nugget/namespaces/{namespace}/members/{member_initial} ### Example (Members starting with 't') - takeOverKernel() : psyqo::Kernel - Tex16Bits : psyqo::Prim::TPageAttr - Tex4Bits : psyqo::Prim::TPageAttr - Tex8Bits : psyqo::Prim::TPageAttr - tgtVal() : Mips::Encoder - toUnderlying() : psyqo - Transparency : psyqo::Prim - TV : psyqo::GTE::Kernels ``` -------------------------------- ### Function Documentation Source: https://pcsx-redux.github.io/nugget/d0/d0d/cxxglue_8c.html Documentation for the __preinit_array_start, cxxmain, and main functions. ```APIDOC ## Function Documentation ### ◆ __attribute__() ```c extern __attribute__((weak)) ``` **Description:** This indicates that the symbol `__preinit_array_start` is weak, meaning it can be overridden by a non-weak symbol definition. It's often used for global constructors or initialization routines. ### ◆ cxxmain() ```c void cxxmain(int _argc_, char **_argv_) ``` **Description:** Initializes C++ runtime and calls the main function. It takes the argument count and argument vector as input. ### ◆ main() ```c int main(int _argc_, char **_argv_) ``` **Description:** The entry point of the program. It receives the argument count and argument vector. ``` -------------------------------- ### Create a Lua VM Instance Source: https://pcsx-redux.github.io/nugget/d5/d92/md_psyqo-lua_2README.html Instantiate the psyqo::Lua class to create a Lua virtual machine in your application. ```cpp psyqo::Lua L; ``` -------------------------------- ### Get Index Entry Sector Start Source: https://pcsx-redux.github.io/nugget/d1/d51/classpsyqo_1_1paths_1_1ArchiveManager.html Returns the Logical Block Address (LBA) of the first sector where the specified file is located within the archive. ```cpp uint32_t | getIndexEntrySectorStart (const IndexEntry *entry) const ``` -------------------------------- ### Install MIPS Toolchain on Windows Source: https://pcsx-redux.github.io/nugget/d3/d4b/md_psyqo_2GETTING__STARTED.html Run this PowerShell command to install the MIPS toolchain on Windows. A reboot may be required after installation. ```powershell powershell -c "& { iwr -UseBasicParsing https://raw.githubusercontent.com/grumpycoders/pcsx-redux/main/mips.ps1 | iex }" ``` ```bash mips install 14.2.0 ``` -------------------------------- ### BoardInit Function Source: https://pcsx-redux.github.io/nugget/dc/d99/tests_2uC-sdk-glue_2BoardInit_8c.html Performs the main initialization of the board. No parameters are required. ```c void BoardInit () ``` -------------------------------- ### BSS Start Address Source: https://pcsx-redux.github.io/nugget/dc/dea/handlers_8c.html Symbol indicating the start address of the BSS (Block Started by Symbol) segment, which contains uninitialized data. ```c uint32_t __bss_start ``` -------------------------------- ### BoardEarlyInit Function Source: https://pcsx-redux.github.io/nugget/dc/d99/tests_2uC-sdk-glue_2BoardInit_8c.html Initializes the board early in the boot process. No parameters are required. ```c void BoardEarlyInit () ``` -------------------------------- ### Install MIPS Toolchain on macOS Source: https://pcsx-redux.github.io/nugget/d3/d4b/md_psyqo_2GETTING__STARTED.html Installs the MIPS toolchain on macOS using Homebrew. This involves installing custom tap and then the binutils and gcc. ```bash brew install nikitabobko/tap/brew-install-path ``` ```bash brew install-path ./tools/macos-mips/mipsel-none-elf-binutils.rb ``` ```bash brew install-path ./tools/macos-mips/mipsel-none-elf-gcc.rb ``` -------------------------------- ### Function Documentation for main() Source: https://pcsx-redux.github.io/nugget/d0/d0d/cxxglue_8c.html Detailed documentation for the 'main' function, including its parameters. ```c int main | ( | int | _argc_ , | | char ** | _argv_ | ) | | ``` -------------------------------- ### Install and Uninstall Exception Handlers Source: https://pcsx-redux.github.io/nugget/d4/d36/cester-cop0_8c_source.html Installs a custom exception handler and flushes the cache. Ensures critical sections are managed correctly before and after handler installation. ```c void installExceptionHandlers(uint32_t (*handler)(uint32_t * regs, uint32_t from)); void uninstallExceptionHandlers(); ... s_interruptsWereEnabled = enterCriticalSection(); installExceptionHandlers(handler); syscall_flushCache(); ... uninstallExceptionHandlers(); syscall_flushCache(); if (s_interruptsWereEnabled) leaveCriticalSection(); ``` -------------------------------- ### Create Project Folder and Initialize Git Source: https://pcsx-redux.github.io/nugget/d3/d4b/md_psyqo_2GETTING__STARTED.html Commands to create a new project directory and initialize a Git repository. This is the first step in setting up a new project using the nugget repository. ```bash mkdir hello cd hello ``` ```bash git init ``` -------------------------------- ### Prepare Application Source: https://pcsx-redux.github.io/nugget/dc/d84/kernel_8hh_source.html Prepares the application instance. This is likely part of the application initialization sequence. ```cpp void prepare(Application&); ``` -------------------------------- ### Start Card Function Source: https://pcsx-redux.github.io/nugget/d6/da0/sio0_2card_8h_source.html Starts the card functionality. This function is declared in the header file. ```c int startCard(); ``` -------------------------------- ### Example: Loading a MOD File Source: https://pcsx-redux.github.io/nugget/d7/d96/modplayer_8h_source.html This pseudo-code demonstrates a valid way to load a MOD file, including error handling and memory relocation. ```c bool load_mod_file(File mod_file) { void * buffer = malloc(file_size(mod_file)); readfile(mod_file, buffer); uint32_t size = MOD_Load(buffer); if (size == 0) { free(buffer); return false; } MOD_Relocate(buffer); void * newbuffer = realloc(buffer, size); if (newbuffer != buffer) { free(newbuffer); return false; } return true; } ``` -------------------------------- ### GPU Initialization and Configuration Source: https://pcsx-redux.github.io/nugget/d4/dda/gpu_8hh_source.html Methods for initializing the GPU and setting up its configuration, including resolution, video mode, and color depth. ```APIDOC ## GPU Initialization and Configuration ### Description Initializes the GPU with the specified configuration and sets up display parameters. ### Method `void initialize(const Configuration &config)` ### Parameters #### Request Body - **config** (Configuration) - Required - The configuration object for the GPU. - **resolution** (Resolution) - Required - The display resolution. - **videoMode** (VideoMode) - Required - The video mode (e.g., NTSC, PAL). - **colorMode** (ColorMode) - Required - The color depth. - **interlace** (Interlace) - Required - Interlacing mode. - **miscSetting** (MiscSetting) - Required - Miscellaneous settings like VRAM clearing. ### Request Example ```json { "resolution": "W320", "videoMode": "NTSC", "colorMode": "C15BITS", "interlace": "PROGRESSIVE", "miscSetting": "CLEAR_VRAM" } ``` ### Response No specific response body for initialization, success is indicated by the absence of errors. ``` -------------------------------- ### Start Shell Function Declaration Source: https://pcsx-redux.github.io/nugget/df/d03/shell_8h_source.html This is the function declaration for starting the shell. It takes a uint32_t argument. ```c #include int startShell(uint32_t arg); ``` -------------------------------- ### SimplePad Initialization Source: https://pcsx-redux.github.io/nugget/d4/dc6/classpsyqo_1_1SimplePad.html Initializes the pads by calling the BIOS' interface. This method should be called from the `start` method of the root `Scene` object, not the `prepare` method of the `Application` class. Ensure correct ordering with BIOS memory card functions. ```APIDOC ## initialize() ### Description Initializes the pads by calling the BIOS' interface. ### Method void ### Endpoint N/A (Class method) ### Parameters None ### Request Example N/A ### Response None ``` -------------------------------- ### initialize (async with LBA and callback) Source: https://pcsx-redux.github.io/nugget/d1/d51/classpsyqo_1_1paths_1_1ArchiveManager.html Asynchronously initializes the archive manager with an LBA, a CDRom device, and a callback function. The callback is invoked upon completion. ```APIDOC ## POST /archive/initialize/async_lba_callback ### Description Asynchronously initializes the archive manager with an LBA, a CDRom device, and a callback. ### Method POST ### Endpoint `/archive/initialize/async_lba_callback` ### Parameters #### Request Body - **LBA** (uint32_t) - Required - The Logical Block Address of the archive. - **device** (CDRom) - Required - The CDRom device object. - **callback** (function) - Required - A callback function to be executed after initialization. ### Response #### Success Response (200) - **void** - The function returns void, and the callback is invoked. #### Response Example ```json { "status": "initializing", "callback_invoked": true } ``` ``` -------------------------------- ### Data Start Address Source: https://pcsx-redux.github.io/nugget/dc/dea/handlers_8c.html Symbol indicating the start address of the initialized data segment in memory. ```c uint32_t __data_start ``` -------------------------------- ### initialize (async with LBA) Source: https://pcsx-redux.github.io/nugget/d1/d51/classpsyqo_1_1paths_1_1ArchiveManager.html Asynchronously initializes the archive manager with an LBA and a CDRom device. This overload bypasses ISO9660 filesystem parsing. ```APIDOC ## POST /archive/initialize/async_lba ### Description Asynchronously initializes the archive manager with an LBA and a CDRom device. ### Method POST ### Endpoint `/archive/initialize/async_lba` ### Parameters #### Request Body - **LBA** (uint32_t) - Required - The Logical Block Address of the archive. - **device** (CDRom) - Required - The CDRom device object. ### Response #### Success Response (200) - **InitAwaiter** - An awaiter object for the initialization process. #### Response Example ```json { "status": "initializing" } ``` ``` -------------------------------- ### CPU Test Environment Setup (Before Each Test) Source: https://pcsx-redux.github.io/nugget/d4/d36/cester-cop0_8c_source.html Initializes the test environment before each CPU test by saving and clearing relevant registers and DMA control structures. ```c s_oldIMASK = IMASK; s_oldDPCR = DPCR; s_oldDICR = DICR; IMASK = 0; IREG = 0; for (unsigned i = 0; i < 7; i++) { DMA_CTRL[i].CHCR = 0; DMA_CTRL[i].BCR = 0; DMA_CTRL[i].MADR = 0; } DPCR = 0; uint32_t dicr = DICR; DICR = dicr; DICR = 0; s_got40 = 0; s_got80 = 0; s_cause = 0; s_epc = 0; s_from = 0; s_resume = NULL; s_regs = NULL; s_customhandler = NULL; ``` -------------------------------- ### Install Crash Handler Source: https://pcsx-redux.github.io/nugget/dc/d84/kernel_8hh_source.html Installs the custom crash handler for the system. This should be called early in the application lifecycle. ```cpp void installCrashHandler(); ``` -------------------------------- ### Main Function Definition Source: https://pcsx-redux.github.io/nugget/d3/d5e/tests_2gpu_2gpu_8c.html Defines the main entry point of the program. This function initializes the system and starts the emulation process. ```c int main ( void ) ``` -------------------------------- ### ROM Data Start Address Source: https://pcsx-redux.github.io/nugget/dc/dea/handlers_8c.html Symbol indicating the start address of the initialized data segment in ROM. ```c uint32_t __rom_data_start ``` -------------------------------- ### Function Documentation for cxxmain() Source: https://pcsx-redux.github.io/nugget/d0/d0d/cxxglue_8c.html Detailed documentation for the 'cxxmain' function, including its parameters. ```c void cxxmain | ( | int | _argc_ , | | char ** | _argv_ | ) | | ``` -------------------------------- ### Install Exception Handlers Function Source: https://pcsx-redux.github.io/nugget/d4/d36/cester-cop0_8c_source.html Prototype for the function that installs exception handlers. It takes a function pointer as an argument. ```cpp void installExceptionHandlers(uint32_t(*handler)(uint32_t *regs, uint32_t from)) ``` -------------------------------- ### Install GCC for Debian Derivatives Source: https://pcsx-redux.github.io/nugget/d3/d4b/md_psyqo_2GETTING__STARTED.html Installs the necessary make and g++ compiler for MIPS development on Debian-based systems. ```bash sudo apt-get install -y make g++-mipsel-linux-gnu ``` -------------------------------- ### BoardLateInit Function Source: https://pcsx-redux.github.io/nugget/dc/d99/tests_2uC-sdk-glue_2BoardInit_8c.html Performs late-stage initialization of the board after other components are ready. No parameters are required. ```c void BoardLateInit () ``` -------------------------------- ### Initialize GPU Source: https://pcsx-redux.github.io/nugget/d4/dda/gpu_8hh_source.html Initializes the GPU with the specified configuration. The Configuration struct must be defined elsewhere. ```cpp void initialize(const Configuration &config); ``` -------------------------------- ### Functions starting with 'a' Source: https://pcsx-redux.github.io/nugget/functions_func.html This section lists functions that start with the letter 'a', along with their respective class or namespace and template parameters. ```APIDOC ## Functions starting with 'a' ### access() - **Signature**: `psyqo::Hardware::BasicAccess< offset, BaseAddress, T >`, `psyqo::Hardware::CDRom::Access< Reg, m >`, `psyqo::Hardware::Register< offset, T, writeQueue, Access >` ### accessPtr() - **Signature**: `psyqo::Hardware::BasicAccess< offset, BaseAddress, T >` ### Action() - **Signature**: `psyqo::CDRomDevice::Action< S >` ### allocate() - **Signature**: `psyqo::BumpAllocator< N, safety >`, `psyqo::PsyqoAllocator` ### allocateFragment() - **Signature**: `psyqo::BumpAllocator< N, safety >` ### argCheck() - **Signature**: `psyqo::Lua` ### argError() - **Signature**: `psyqo::Lua` ### armPeriodicTimer() - **Signature**: `psyqo::GPU` ### armTimer() - **Signature**: `psyqo::GPU` ### await_ready() - **Signature**: `psyqo::CDRomDevice::GetPlaybackLocationAwaiter`, `psyqo::CDRomDevice::GetTOCSizeAwaiter`, `psyqo::CDRomDevice::MuteAwaiter`, `psyqo::CDRomDevice::ReadTOCAwaiter`, `psyqo::CDRomDevice::ResetAwaiter`, `psyqo::CDRomDevice::UnmuteAwaiter`, `psyqo::Coroutine< T >::Awaiter`, `psyqo::Coroutine< T >::ChainAwaiter`, `psyqo::ISO9660Parser::GetDirentryAwaiter`, `psyqo::ISO9660Parser::InitializeAwaiter` ### await_resume() - **Signature**: `psyqo::CDRomDevice::GetPlaybackLocationAwaiter`, `psyqo::CDRomDevice::GetTOCSizeAwaiter`, `psyqo::CDRomDevice::MuteAwaiter`, `psyqo::CDRomDevice::ReadTOCAwaiter`, `psyqo::CDRomDevice::ResetAwaiter`, `psyqo::CDRomDevice::UnmuteAwaiter`, `psyqo::Coroutine< T >::Awaiter`, `psyqo::Coroutine< T >::ChainAwaiter`, `psyqo::ISO9660Parser::GetDirentryAwaiter`, `psyqo::ISO9660Parser::InitializeAwaiter` ### await_suspend() - **Signature**: `psyqo::CDRomDevice::GetPlaybackLocationAwaiter`, `psyqo::CDRomDevice::GetTOCSizeAwaiter`, `psyqo::CDRomDevice::MuteAwaiter`, `psyqo::CDRomDevice::ReadTOCAwaiter`, `psyqo::CDRomDevice::ResetAwaiter`, `psyqo::CDRomDevice::UnmuteAwaiter`, `psyqo::Coroutine< T >::Awaiter`, `psyqo::Coroutine< T >::ChainAwaiter`, `psyqo::ISO9660Parser::GetDirentryAwaiter`, `psyqo::ISO9660Parser::InitializeAwaiter` ### awaiter() - **Signature**: `psyqo::Coroutine< T >` ### Awaiter() - **Signature**: `psyqo::Coroutine< T >::Awaiter` ``` -------------------------------- ### initialize (async with filename and callback) Source: https://pcsx-redux.github.io/nugget/d1/d51/classpsyqo_1_1paths_1_1ArchiveManager.html Asynchronously initializes the archive manager with a filename, an ISO9660Parser, and a callback function. The callback is invoked upon completion of the initialization. ```APIDOC ## POST /archive/initialize/async_filename_callback ### Description Asynchronously initializes the archive manager with a filename, an ISO9660Parser, and a callback. ### Method POST ### Endpoint `/archive/initialize/async_filename_callback` ### Parameters #### Request Body - **archiveName** (string) - Required - The name of the archive file. - **parser** (ISO9660Parser) - Required - The ISO9660Parser object. - **callback** (function) - Required - A callback function to be executed after initialization. ### Response #### Success Response (200) - **void** - The function returns void, and the callback is invoked. #### Response Example ```json { "status": "initializing", "callback_invoked": true } ``` ``` -------------------------------- ### Generate Drawing Area Start Command Source: https://pcsx-redux.github.io/nugget/d2/d4b/common_2hardware_2gpu_8h_source.html Generates the command word to define the starting point of the drawing area. ```c static inline uint32_t generateDrawingAreaStart(int16_t x, int16_t y) { return 0xe3000000 | x | y << 10; } ``` -------------------------------- ### Get Parity Source: https://pcsx-redux.github.io/nugget/d4/dda/gpu_8hh_source.html Gets the index of the current display buffer, often referred to as parity in interlaced display modes. ```cpp unsigned getParity() const; ``` -------------------------------- ### Include Headers for hello.cpp Source: https://pcsx-redux.github.io/nugget/d9/d29/hello_8cpp.html Includes necessary headers for the hello.cpp file, covering string manipulation, syscalls, Lua integration, and Psyqo application/graphics components. ```cpp #include "EASTL/string.h" #include "common/syscalls/syscalls.h" #include "psyqo-lua/lua.hh" #include "psyqo/application.hh" #include "psyqo/font.hh" #include "psyqo/gpu.hh" #include "psyqo/scene.hh" ``` -------------------------------- ### DEFAULT_TTY_INSTALL Macro Definition Source: https://pcsx-redux.github.io/nugget/dc/d03/tty_8c.html Defines the default value for installing TTY. This macro is used to set the initial state of TTY installation. ```c #define DEFAULT_TTY_INSTALL 0 ``` -------------------------------- ### initialize (async with filename) Source: https://pcsx-redux.github.io/nugget/d1/d51/classpsyqo_1_1paths_1_1ArchiveManager.html Asynchronously initializes the archive manager with a filename and an ISO9660Parser. The system finds the archive in the ISO9660 filesystem. ```APIDOC ## POST /archive/initialize/async_filename ### Description Asynchronously initializes the archive manager with a filename and an ISO9660Parser. ### Method POST ### Endpoint `/archive/initialize/async_filename` ### Parameters #### Request Body - **archiveName** (string) - Required - The name of the archive file. - **parser** (ISO9660Parser) - Required - The ISO9660Parser object. ### Response #### Success Response (200) - **InitAwaiterWithFilename** - An awaiter object for the initialization process. #### Response Example ```json { "status": "initializing" } ``` ``` -------------------------------- ### Hello Class API Documentation Source: https://pcsx-redux.github.io/nugget/d2/d5a/classHello.html Detailed API documentation for the 'Hello' class, including its constructor, destructor, and member functions. ```APIDOC ## Class Hello ### Description This class is a simple example class with a constructor, destructor, and a print method. ### Public Member Functions - **Hello** () - **~Hello** () - **print** () ### Constructor & Destructor Documentation #### ◆ Hello() ``` Hello::Hello () ``` * **Description**: Default constructor for the Hello class. * **inline**: true #### ◆ ~Hello() ``` virtual Hello::~Hello ()=default ``` * **Description**: Virtual destructor for the Hello class. * **virtual**: true * **default**: true ### Member Function Documentation #### ◆ print() ``` void Hello::print () ``` * **Description**: Prints a message or performs an action. * **Return Type**: void ### Source File * cxxhello/main.cpp ``` -------------------------------- ### Functions starting with 'g' Source: https://pcsx-redux.github.io/nugget/functions_g.html This section lists functions that start with the letter 'g', along with their respective return types and the classes they belong to. ```APIDOC ## Functions starting with 'g' ### Description This section lists functions that start with the letter 'g', along with their respective return types and the classes they belong to. ### Functions - **g** : Color, psyqo::Color - **gc()** : psyqo::Lua - **get()** : psyqo::Vector< N, precisionBits, T >, Utilities::BitField< T > - **getabsolute()** : psyqo::Lua - **getActualFragmentSize()** : psyqo::Fragments::FixedFragment< Prim, N >, psyqo::Fragments::FixedFragmentWithPrologue< P, Prim, N >, psyqo::Fragments::SimpleFragment< Prim > - **getAdc()** : psyqo::AdvancedPad - **getBranchAddress()** : Mips::Decoder::Instruction - **getCDRom()** : psyqo::ISO9660Parser - **getClear()** : psyqo::GPU - **getColor()** : psyqo::Prim::Quad, psyqo::Prim::TexturedQuad, psyqo::Prim::TexturedTriangle, psyqo::Prim::Triangle - **getColorA()** : psyqo::Prim::GouraudQuad, psyqo::Prim::GouraudTexturedQuad, psyqo::Prim::GouraudTexturedTriangle, psyqo::Prim::GouraudTriangle - **getColorB()** : psyqo::Prim::GouraudQuad, psyqo::Prim::GouraudTexturedQuad, psyqo::Prim::GouraudTexturedTriangle, psyqo::Prim::GouraudTriangle - **getColorC()** : psyqo::Prim::GouraudQuad, psyqo::Prim::GouraudTexturedQuad, psyqo::Prim::GouraudTexturedTriangle, psyqo::Prim::GouraudTriangle - **getColorD()** : psyqo::Prim::GouraudQuad, psyqo::Prim::GouraudTexturedQuad - **getColorMode()** : psyqo::PrimPieces::TPageAttr - **getCompressedSize()** : psyqo::paths::ArchiveManager::IndexEntry - **getCompressionMethod()** : psyqo::paths::ArchiveManager::IndexEntry - **getCurrentScene()** : psyqo::Application - **getDecompSize()** : psyqo::paths::ArchiveManager::IndexEntry - **getDirentry()** : psyqo::ISO9660Parser - **GetDirentryAwaiter()** : psyqo::ISO9660Parser::GetDirentryAwaiter - **getField()** : psyqo::Lua - **getFirstIndexEntry()** : psyqo::paths::ArchiveManager - **getFrameCount()** : psyqo::GPU - **getGlobal()** : psyqo::Lua - **getGlyphFragment()** : psyqo::FontBase - **getHalfword()** : psyqo::AdvancedPad - **getIndexCount()** : psyqo::paths::ArchiveManager - **getIndexEntry()** : psyqo::paths::ArchiveManager - **getIndexEntrySectorStart()** : psyqo::paths::ArchiveManager - **getInfo()** : psyqo::Lua - **getJumpAddress()** : Mips::Decoder::Instruction - **getJumpRegisterAddress()** : Mips::Decoder::Instruction - **getLoadAddress()** : Mips::Decoder::Instruction - **getLoadMask()** : Mips::Decoder::Instruction - **getLocal()** : psyqo::Lua - **getMetatable()** : psyqo::Lua - **getNextClear()** : psyqo::GPU - **getNextFreeChannel()** : psyqo::SPU - **getNextScissor()** : psyqo::GPU - **getPadding()** : psyqo::paths::ArchiveManager::IndexEntry - **getPadType()** : psyqo::AdvancedPad - **getPageLoc()** : psyqo::PrimPieces::TPageAttr - **getPageX()** : psyqo::PrimPieces::TPageAttr - **getPageY()** : psyqo::PrimPieces::TPageAttr - **getParity()** : psyqo::GPU - **getPlaybackLocation()** : psyqo::CDRomDevice - **GetPlaybackLocationAwaiter()** : psyqo::CDRomDevice::GetPlaybackLocationAwaiter - **getRefreshRate()** : psyqo::GPU - **getScissor()** : psyqo::GPU - **getSectorOffset()** : psyqo::paths::ArchiveManager::IndexEntry - **getSemiTrans()** : psyqo::PrimPieces::TPageAttr - **getStack()** : psyqo::Lua - **getState()** : psyqo::CDRomDevice::Action< S >, psyqo::Lua - **getStoreAddress()** : Mips::Decoder::Instruction - **getStoreMask()** : Mips::Decoder::Instruction - **getTable()** : psyqo::Lua - **getTOCSize()** : psyqo::CDRomDevice - **GetTOCSizeAwaiter()** : psyqo::CDRomDevice::GetTOCSizeAwaiter - **getTOCSizeBlocking()** : psyqo::CDRomDevice - **getTop()** : psyqo::Lua - **getValueToStore()** : Mips::Decoder::Instruction ### Related Classes - **GlyphsFragment** : psyqo::FontBase - **GouraudLine()** : psyqo::Prim::GouraudLine - **GouraudQuad()** : psyqo::Prim::GouraudQuad - **GouraudTexturedQuad()** : psyqo::Prim::GouraudTexturedQuad - **GouraudTexturedTriangle()** : psyqo::Prim::GouraudTexturedTriangle - **GouraudTriangle()** : psyqo::Prim::GouraudTriangle - **gp** : JmpBuf, Mips::GPRRegs, psxExeHeader, Registers - **GPR** : Registers - **gpu()** : psyqo::Application, psyqo::FontBase::XPrintfInfo - **GPU** : psyqo::GPU::Configuration, psyqo::OrderingTable< N, safety > - **gpu()** : psyqo::Scene ``` -------------------------------- ### C++ String View Starts With Check Source: https://pcsx-redux.github.io/nugget/d5/d77/strings-helpers_8hh_source.html Checks if a string view starts with a given prefix. Requires C++17 or later for string_view. ```cpp static inline bool startsWith(const eastl::string_view &s1, const eastl::string_view &s2) { return s1.rfind(s2, 0) == 0; } ``` -------------------------------- ### Build Options for PSYQo Library Source: https://pcsx-redux.github.io/nugget/d3/d4b/md_psyqo_2GETTING__STARTED.html Specifies different build configurations for the PSYQo library and your binary. Choose based on whether you prioritize speed, size, or debuggability. ```bash make BUILD=Release ``` ```bash make BUILD=Debug ``` ```bash make BUILD=SmallDebug ``` ```bash make BUILD=LTO ``` -------------------------------- ### Initialize Archive by LBA (Awaitable) Source: https://pcsx-redux.github.io/nugget/d1/d51/classpsyqo_1_1paths_1_1ArchiveManager.html Initializes the archive manager using an LBA and a CDRom device. This is an awaitable operation. ```cpp InitAwaiter | initialize (uint32_t LBA, CDRom &device) ``` -------------------------------- ### CDRomDevice - Get Playback Location Source: https://pcsx-redux.github.io/nugget/d1/de1/classpsyqo_1_1CDRomDevice.html Gets the current playback location of the CDDA audio. Supports asynchronous operations and coroutine wrappers. ```APIDOC ## GET /cdrom/playbackLocation ### Description Gets the playback location of the CDDA audio. Supports asynchronous operations and a coroutine-friendly API. ### Method GET ### Endpoint /cdrom/playbackLocation ### Parameters #### Query Parameters - **location** (PlaybackLocation*) - Optional. A pointer to store the playback location. ### Response #### Success Response (200) - **location** (PlaybackLocation) - The current playback location. ### Response Example ```json { "location": { "minutes": 1, "seconds": 30, "frames": 15 } } ``` ``` -------------------------------- ### Initialize GPU Source: https://pcsx-redux.github.io/nugget/d3/ddf/shell_2gpu_8c.html Initializes the GPU module. Use this function during system startup. Pass 1 for PAL systems, 0 otherwise. ```c void initGPU | ( | int | _isPAL_| ) | ``` -------------------------------- ### CDROM Initialization Source: https://pcsx-redux.github.io/nugget/d1/d99/shell_2cdrom_8h_source.html Initializes the CDROM subsystem. ```APIDOC ## void initCD() ### Description Initializes the CDROM subsystem. ### Method void ### Endpoint N/A (Function Call) ### Parameters None ### Request Example ```c initCD(); ``` ### Response None ``` -------------------------------- ### Initialize Archive with Filename Source: https://pcsx-redux.github.io/nugget/d1/d51/classpsyqo_1_1paths_1_1ArchiveManager.html Initializes the archive manager using a filename and an ISO9660Parser. This is an awaitable operation. ```cpp InitAwaiterWithFilename | initialize (eastl::string_view archiveName, ISO9660Parser &parser) ``` -------------------------------- ### POST /CDRomDevice/PlayCDDADisc Source: https://pcsx-redux.github.io/nugget/d1/de1/classpsyqo_1_1CDRomDevice.html Begins playing CDDA audio from a given starting point on the disc. The callback is invoked twice: once for successful start, and once for completion/pause. ```APIDOC ## POST /CDRomDevice/PlayCDDADisc ### Description Begins playing CDDA audio from a given starting point on the disc. ### Method POST ### Endpoint /CDRomDevice/PlayCDDADisc ### Parameters #### Query Parameters - **start** (MSF) - Required - The starting point for playback (Minutes:Seconds:Frames). - **callback** (function) - Required - The callback to call when playback starts or completes. ### Response #### Success Response (200) - **started** (bool) - True if playback started successfully, false otherwise. #### Response Example ```json { "started": true } ``` ``` -------------------------------- ### ISO9660Parser Constructor Source: https://pcsx-redux.github.io/nugget/d6/dd0/classpsyqo_1_1ISO9660Parser.html Initializes the ISO9660Parser with a CDRom device. ```APIDOC ## ISO9660Parser() ### Description The ISO9660Parser constructor. This constructor takes a CDRom device as a parameter. It will use that device to read the structure of the ISO9660 filesystem. ### Parameters - **cdrom** (CDRom *) - The CDRom device to use. ``` -------------------------------- ### gte_set_screen() Function Examples Source: https://pcsx-redux.github.io/nugget/d8/d15/gte-rtps_8c.html Configures the screen parameters for the GTE. The first example sets default values, while the second uses shifted values. ```c gte_set_screen(0, 0, 200) ``` ```c gte_set_screen(160 << 16, 120 << 16, 200) ``` -------------------------------- ### Build with Docker Source: https://pcsx-redux.github.io/nugget/db/d39/md_openbios_2README.html Use the `dockermake.sh` script as a replacement for `make` when building with Docker. This is the currently supported method for the project. ```bash dockermake.sh ``` -------------------------------- ### Initialize CD-ROM Device Source: https://pcsx-redux.github.io/nugget/db/d86/archive-manager_8hh_source.html Initializes the CD-ROM device and starts the initialization queue. Use this for direct initialization. ```cpp void initialize(uint32_t LBA, CDRom &device, eastl::function &&callback) { setupInitQueue(LBA, device, eastl::move(callback)); m_queue.run(); } ``` -------------------------------- ### Character I/O: Get, Put, Get String, Put String, Printf Source: https://pcsx-redux.github.io/nugget/dc/d74/fileio_8h_source.html Functions for character-by-character and string-based input/output, including formatted printing. ```c int psxgetc(int fd); ``` ```c void psxputc(int c, int fd); ``` ```c char * psxgets(char *storage); ``` ```c void psxputs(const char *str); ``` ```c int psxprintf(const char *msg, ...); ``` -------------------------------- ### Include GPU and Math Headers Source: https://pcsx-redux.github.io/nugget/d9/d4f/shell_2gpu_8h.html Includes necessary headers for GPU hardware access and shell math operations. Ensure these paths are correct in your build environment. ```c #include #include "common/hardware/gpu.h" #include "common/hardware/hwregs.h" #include "shell/math.h" ``` -------------------------------- ### Global TTY Variables Source: https://pcsx-redux.github.io/nugget/dd/d71/tty_8h_source.html Global variables controlling TTY (teletypewriter) installation. `g_cachedInstallTTY` and `g_installTTY` likely manage the state or configuration for TTY device installation. ```c extern int g_cachedInstallTTY; ``` ```c extern int g_installTTY; ``` -------------------------------- ### cop2_put Examples Source: https://pcsx-redux.github.io/nugget/d7/d2f/gte-lighting_8c.html Illustrates the use of cop2_put to load data into GTE registers. Examples cover various register addresses and data values, including bitwise operations. ```c cop2_put | ( | 0 | , | | 0x00000000 ``` ```c cop2_put | ( | 0 | , | | (0<< 16)| | _0x1000_ ``` ```c cop2_put | ( | 1 | , | | 0 ``` ```c cop2_put | ( | 1 | , | | 0x1000 ``` ```c cop2_put | ( | 10 | , | | 0x1000 ``` ```c cop2_put | ( | 11 | , | | 0x1000 ``` ```c cop2_put | ( | 2 | , | | 0x00000000 ``` ```c cop2_put | ( | 3 | , | | 0x0800 ``` ```c cop2_put | ( | 4 | , | | 0x00000000 ``` ```c cop2_put | ( | 5 | , | | 0x0400 ``` -------------------------------- ### Enable Display Source: https://pcsx-redux.github.io/nugget/d2/d4b/common_2hardware_2gpu_8h_source.html Sends the command to enable the display output. ```c static inline void enableDisplay() { sendGPUStatus(generateEnableDisplay()); } ``` -------------------------------- ### CDRomDevice - Prepare Source: https://pcsx-redux.github.io/nugget/d1/de1/classpsyqo_1_1CDRomDevice.html Prepares the CDRom subsystem for operation. ```APIDOC ## POST /cdrom/prepare ### Description Prepares the CDRom subsystem. ### Method POST ### Endpoint /cdrom/prepare ### Request Body None ### Response #### Success Response (200) - **status** (boolean) - Indicates if the preparation was successful. ### Response Example ```json { "status": true } ``` ``` -------------------------------- ### cop2_get Examples Source: https://pcsx-redux.github.io/nugget/d7/d2f/gte-lighting_8c.html Shows how to retrieve data from GTE registers using cop2_get. Examples include fetching RGB values (registers 20-22) and MAC components (registers 25-27). ```c cop2_get | ( | 20 | , | | rgb0 ``` ```c cop2_get | ( | 21 | , | | rgb1 ``` ```c cop2_get | ( | 22 | , | | rgb2 ``` ```c cop2_get | ( | 25 | , | | mac1 ``` ```c cop2_get | ( | 26 | , | | mac2 ``` ```c cop2_get | ( | 27 | , | | mac3 ``` -------------------------------- ### psyqo::Prim::GouraudLine Source: https://pcsx-redux.github.io/nugget/d1/dbe/lines_8hh_source.html Represents a Gouraud-shaded line primitive, allowing for different colors at its start and end points. Supports setting colors, opacity, and defining start and end points. ```APIDOC ## GouraudLine Primitive ### Description Represents a Gouraud-shaded line primitive, allowing for different colors at its start and end points. Supports setting colors, opacity, and defining start and end points. ### Structure ```cpp struct GouraudLine { GouraudLine(); GouraudLine(Color c); GouraudLine& setColorA(Color c); GouraudLine& setColorB(Color c); GouraudLine& setOpaque(); GouraudLine& setSemiTrans(); Vertex pointA; Color colorB; Vertex pointB; private: uint32_t command; }; ``` ### Methods - **GouraudLine()**: Default constructor. - **GouraudLine(Color c)**: Constructor that initializes the line with a given color for both endpoints. - **setColorA(Color c)**: Sets the color for the starting point (pointA). - **setColorB(Color c)**: Sets the color for the ending point (pointB). - **setOpaque()**: Sets the line to be opaque. - **setSemiTrans()**: Sets the line to be semi-transparent. ### Members - **pointA** (Vertex): The starting vertex of the line. - **colorB** (Color): The color of the ending point. - **pointB** (Vertex): The ending vertex of the line. - **command** (uint32_t): Internal command data for the line. ``` -------------------------------- ### ArchiveManager Initialization with LBA Source: https://pcsx-redux.github.io/nugget/db/d86/archive-manager_8hh_source.html Schedules the initialization of the archive manager using an LBA and a CDRom device. Returns a Task object. ```cpp psyqo::TaskQueue::Task scheduleInitialize(uint32_t LBA, CDRom &device) ```