### Install GB Studio from Source Source: https://github.com/chrismaltby/gb-studio/blob/develop/README.md Steps to clone the repository, install dependencies, and start the GB Studio application. ```bash cd gb-studio corepack enable yarn npm run fetch-deps npm start ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/chrismaltby/gb-studio/blob/develop/CONTRIBUTING.md Install the necessary project dependencies using Yarn. This command should be run after cloning the repository. ```bash yarn ``` -------------------------------- ### Get GB Studio CLI Version Source: https://github.com/chrismaltby/gb-studio/blob/develop/README.md Check the installed version of the GB Studio CLI. ```bash $(yarn bin gb-studio-cli) -V ``` -------------------------------- ### Run BGB Emulator with Watch Flag Source: https://github.com/chrismaltby/gb-studio/blob/develop/DEVELOPERS.md Start the BGB emulator from the command line with the -watch flag to automatically reload your game on each successful build. This is useful for rapid iteration during development. ```bash ./bgb -watch -rom game.gb ``` -------------------------------- ### BGB Profiling Output Example Source: https://github.com/chrismaltby/gb-studio/blob/develop/DEVELOPERS.md Example of profiling data generated by BGB when profiling is enabled in GB Studio. This data can be processed by tools like `bgb_profiling_toolkit` or custom scripts. ```text _UIOnInteract:_PopBank:_StackPop MIN: 34 AVG: 34.00 95P: 34 MAX: 34 TOTAL: 0x0000000000000044 NCALLS: 2 _ActorRunCollisionScripts:_PushBank:_StackPush MIN: 26 AVG: 26.00 95P: 26 MAX: 26 TOTAL: 0x0000000000000034 NCALLS: 2 _UIUpdate:_UIUpdate_b:_UIDrawTextBuffer MIN: 290 AVG: 354.00 95P: 290 MAX: 419 TOTAL: 0x00000000000002c5 NCALLS: 2 _UpdateCamera:_PushBank:_StackPush:_MusicUpdate MIN: 84 AVG: 84.00 95P: 84 MAX: 84 TOTAL: 0x0000000000000054 NCALLS: 1 _FadeUpdate:_PushBank MIN: 82 AVG: 82.00 95P: 82 MAX: 82 TOTAL: 0x00000000000000a4 NCALLS: 2 ``` -------------------------------- ### Manage Project Plugins Source: https://context7.com/chrismaltby/gb-studio/llms.txt Handles adding and removing plugins from a project, supporting both project-scoped and global installations. It also allows adding custom plugin repositories and listing available plugins. ```typescript import { addPluginToProject, removePluginFromProject, getGlobalPluginsList, addUserRepo, } from "lib/pluginManager/repo"; // Add a custom plugin repository await addUserRepo("https://example.com/my-gbs-plugins/plugins.json"); // List all available plugins across all registered repos const repos = await getGlobalPluginsList(); for (const repo of repos) { console.log(`[${repo.name}]`); repo.plugins.forEach((p) => console.log(` ${p.id} - ${p.name}`)); } // Install a specific plugin into the current project const installedPath = await addPluginToProject( "/path/to/MyGame.gbsproj", "some-plugin-id", // plugin id from the repository manifest "core", // repo id: "core" = official GB Studio repo ); console.log("Plugin installed at:", installedPath); // => /path/to/MyGame/plugins/some-plugin-id/ // Remove a plugin from the project await removePluginFromProject("/path/to/MyGame.gbsproj", "some-plugin-id"); ``` -------------------------------- ### addPluginToProject / removePluginFromProject Source: https://context7.com/chrismaltby/gb-studio/llms.txt Downloads and installs a plugin from a repository into the current project's `plugins/` folder or the global plugins directory. Plugins can contribute new script events, engine C files, scene types, and assets. It also supports removing installed plugins. ```APIDOC ## `addPluginToProject / removePluginFromProject` — Plugin Management Downloads and installs a plugin from a repository into either the current project's `plugins/` folder (project-scoped) or the global plugins directory (engine/global plugins). Plugins can contribute new script events, engine C files, scene types, and assets. ```typescript import { addPluginToProject, removePluginFromProject, getGlobalPluginsList, addUserRepo, } from "lib/pluginManager/repo"; // Add a custom plugin repository await addUserRepo("https://example.com/my-gbs-plugins/plugins.json"); // List all available plugins across all registered repos const repos = await getGlobalPluginsList(); for (const repo of repos) { console.log(`[${repo.name}]`); repo.plugins.forEach((p) => console.log(` ${p.id} - ${p.name}`)); } // Install a specific plugin into the current project const installedPath = await addPluginToProject( "/path/to/MyGame.gbsproj", "some-plugin-id", // plugin id from the repository manifest "core", // repo id: "core" = official GB Studio repo ); console.log("Plugin installed at:", installedPath); // => /path/to/MyGame/plugins/some-plugin-id/ // Remove a plugin from the project await removePluginFromProject("/path/to/MyGame.gbsproj", "some-plugin-id"); ``` ``` -------------------------------- ### CLI: Make Web Build Source: https://github.com/chrismaltby/gb-studio/blob/develop/README.md Generate a web-playable build from a GB Studio project. ```bash $(yarn bin gb-studio-cli) make:web path/to/project.gbsproj out/ ``` -------------------------------- ### CLI: Make Pocket Build Source: https://github.com/chrismaltby/gb-studio/blob/develop/README.md Create a build for the Analogue Pocket from a GB Studio project. ```bash $(yarn bin gb-studio-cli) make:pocket path/to/project.gbsproj out/game.pocket ``` -------------------------------- ### Wrapper Component Example Source: https://github.com/chrismaltby/gb-studio/blob/develop/src/stories/Index.mdx Example of a wrapper component that converts a transient prop for styled-components. This prevents exposing transient props directly in the wrapper. ```typescript // e.g. wrapper