How klorfmorf/goemon64recomp works
Main Components
• Game Engine & Rendering: At the core, the project leverages RT64 for advanced rendering. This is a central component that handles graphics, shaders, and high-framerate support.
• Static Recompilation & Game Patches: The static recompilation process takes original N64 elements and converts them. The “patches” directory (with files such as patches/main.c and several headers in patches/) indicates extensive modifications to the game logic and memory layout. This module is responsible for bridging original game code to natively running code.
• Game Logic & Core Modules: Inside the “src” directory, the “game” subfolder contains components for game configuration, controls, debugging, quicksaving, and other gameplay elements. The “src/main” folder handles the application’s initialization, registration of patches/overlays, and integration with the engine.
• UI & Launcher: The UI components (located in “src/ui” and under the “assets” folder, which also includes menu and font assets) are built with RmlUi. This includes the in-game configuration menus and the launcher interface that provides an accessible user front-end.
• External Libraries & Dependencies: The project depends on several external libraries such as:
• RT64 for rendering
• RmlUi (and related packages such as lunasvg and FreeType) for UI rendering
• Gamepad Motion Helpers and moodycamel::ConcurrentQueue for input processing and concurrency
• Additional support from libraries included in the “lib” directory for specific functionalities (e.g., a reference to Ares emulator’s RSP implementation for vector instruction support)
• Build & Configuration: Tools such as CMake (with files like CMakeLists.txt, CMakeSettings.json), GitHub workflows, and scripts (build_debug.bat, etc.) represent the build system and continuous integration components.
Representing Relationships & Interactions
• The Launcher (src/main) initializes and configures the system, then calls into the Game Engine.
• The Game Engine (RT64) processes rendering and acts on input from the UI.
• The Static Recompilation/Patches layer acts as an intermediary to adapt the original game logic into a form suitable for modern hardware.
• The UI layer, built with RmlUi, communicates with both the engine and game logic modules for settings and user interactions.
• External libraries and tools (listed in the “lib” folder) interact with various modules (e.g., input handling, concurrency, or shader management).
Architectural Patterns and Design Principles
• Modular Separation: The separation into directories like “src/game”, “src/main”, “src/ui”, and “assets” clearly separates game logic, initialization, and the user interface. This separation supports maintainability and clarity.
• Integration of External Libraries: Emphasize dependency injection and integration points for libraries like RT64 and RmlUi.
Detailed Elements
• Clear, descriptive labels for each element.
• The launcher initializing RT64 and registering patches.
• The UI feeding configuration changes back into the game logic.
• Assets being loaded at startup to supply themes and fonts.