# GB# > A statically compiled, hardware-aware C# development environment for the Game Boy and Game Boy Color. You write a constrained subset of C#; GB# analyses it with Roslyn, lowers it to its own IR, emits conservative C, and hands that to GBDK-2020/SDCC to produce a .gb or .gbc ROM. There is no CLR, no JIT, and no garbage collector on the target. Game code is written against the `GB` namespace (`using GB;` and `using static GB.Hardware;`). Everything is driven by the `gbsharp` CLI: new, build, run, profile, publish, clean, analyze, assets, doctor. Assets are PNGs bound with attributes like `[Asset]` and converted at build time. `static readonly` data goes to ROM; everything else is WRAM. `[Bank(n)]` places code and data in ROM banks. Diagnostics are stable `GBSxxxx` ids banded by category. ## Getting Started - [Installation](https://skytech6.github.io/GBSharp/md/getting-started/installation.md): GB# has one requirement you install yourself: the .NET 10 SDK. - [Your first game](https://skytech6.github.io/GBSharp/md/getting-started/first-game.md): This page goes from an empty directory to a ROM running in an emulator. - [Project layout](https://skytech6.github.io/GBSharp/md/getting-started/project-layout.md): A GB# project is a directory of C# files with an optional `gbsharp.json` beside them. ## Tutorials - [Move a sprite](https://skytech6.github.io/GBSharp/md/tutorials/move-a-sprite.md): You will build the smallest complete GB# program (display on, one hardware sprite, joypad input, a frame loop) by reading `Samples/MoveSprite` in the repo, which is the thesis MVP verbatim. - [Backgrounds and tilemaps](https://skytech6.github.io/GBSharp/md/tutorials/backgrounds-and-tilemaps.md): You will put artwork on the background layer three ways: a PNG on Game Boy Color, the same pipeline on an original Game Boy, and tile data written by hand, by reading `Samples/Background`, `Samples/BackgroundDmg` and `Samples/Tilemap` in the repo. - [Drawing text](https://skytech6.github.io/GBSharp/md/tutorials/drawing-text.md): You will draw a static label and a counter that ticks once a second, from one font sheet, by reading `Samples/Text` in the repo. - [Metasprites](https://skytech6.github.io/GBSharp/md/tutorials/metasprites.md): You will draw a character bigger than one hardware sprite and animate it, by reading `Samples/Metasprite` in the repo. - [Many objects](https://skytech6.github.io/GBSharp/md/tutorials/many-objects.md): You will run eight enemies from fixed storage with no allocation and no object graph, by reading `Samples/Enemies` in the repo, the sample that exercises the language core: structs, enums, fixed collections, arrays, `ref` parameters, `for`, `switch` and 8-bit arithmetic. - [Banking a big game](https://skytech6.github.io/GBSharp/md/tutorials/banking-a-big-game.md): You will build a cartridge larger than 32 KB and control where every piece of it goes, by reading `Samples/Banking` in the repo: a working 64 KB MBC5 cartridge using both `[Bank]` forms, explicit and automatic, plus banked assets. ## Guides - [The language subset](https://skytech6.github.io/GBSharp/md/guides/language-subset.md): GB# compiles a constrained subset of C#. - [Structs](https://skytech6.github.io/GBSharp/md/guides/structs.md): A struct is a layout, and its methods are functions that take a pointer to one. - [Assets](https://skytech6.github.io/GBSharp/md/guides/assets.md): Drop a PNG next to your code and name it: - [Data in ROM](https://skytech6.github.io/GBSharp/md/guides/rom-data.md): A Game Boy has two places to keep data: the cartridge, which is large and read-only, and 8 KB of work RAM, which is neither. - [Banking](https://skytech6.github.io/GBSharp/md/guides/banking.md): A Game Boy maps 16 KB of cartridge permanently and 16 KB at a time, so a game without banking stops at 32 KB. - [Memory and budgets](https://skytech6.github.io/GBSharp/md/guides/memory-and-budgets.md): A Game Boy has 8 KB of work RAM, and everything mutable shares it: your static fields, the call stack, the shadow OAM the sprite system copies from, and GBDK's own state. - [Drawing text](https://skytech6.github.io/GBSharp/md/guides/text.md): Text on a Game Boy is tiles. - [Audio](https://skytech6.github.io/GBSharp/md/guides/audio.md): The `Audio` class is the sound hardware at register level, and that is deliberate. - [Configuring diagnostics](https://skytech6.github.io/GBSharp/md/guides/diagnostics-configuration.md): GB# reports what your code costs at every build: WRAM, ROM, estimated cycles, bank switches. - [Profiling and the cost model](https://skytech6.github.io/GBSharp/md/guides/profiling-and-cost.md): A Game Boy gives you 70,224 cycles between frames, at 59.7 frames a second. - [Publishing a game](https://skytech6.github.io/GBSharp/md/guides/publishing.md): A ROM needs an emulator, and most people do not have one. - [GB# in the editor](https://skytech6.github.io/GBSharp/md/guides/ide-analyzers.md): GB# diagnostics live in the editor, before any build. - [Running your game](https://skytech6.github.io/GBSharp/md/guides/emulators.md): gbsharp run MyGame - [The native escape hatch](https://skytech6.github.io/GBSharp/md/guides/native-escape-hatch.md): Framework members are mapped to C symbols by attribute, and user code can use the same mechanism to reach anything GBDK exposes that the framework does not wrap: ## Reference - [CLI commands](https://skytech6.github.io/GBSharp/md/reference/cli.md): The `gbsharp` command line is how a GB# project is created, checked, built, run, measured and published. - [The project file (gbsharp.json)](https://skytech6.github.io/GBSharp/md/reference/gbsharp-json.md): A GB# project is described by a single `gbsharp.json` in the project root. - [Diagnostics reference](https://skytech6.github.io/GBSharp/md/reference/diagnostics/index.md): Every diagnostic GB# can report - all 88 of them, generated from the compiler's own descriptors in `GBSharp.Rules`, so this list cannot drift from what a build reports. - [Language subset diagnostics (GBS0001–GBS0099)](https://skytech6.github.io/GBSharp/md/reference/diagnostics/language.md): Constructs outside the GB# language subset. - [Performance diagnostics (GBS0100–GBS0199)](https://skytech6.github.io/GBSharp/md/reference/diagnostics/performance.md): Operations that are legal but expensive on the SM83. - [Memory diagnostics (GBS0200–GBS0299)](https://skytech6.github.io/GBSharp/md/reference/diagnostics/memory.md): WRAM, VRAM and ROM consumption - what your declarations reserve, and budgets that fail the build when exceeded. - [Banking diagnostics (GBS0300–GBS0399)](https://skytech6.github.io/GBSharp/md/reference/diagnostics/banking.md): ROM banking: placement, cross-bank access, trampoline costs, and bank overflow. - [Cycle cost diagnostics (GBS0400–GBS0499)](https://skytech6.github.io/GBSharp/md/reference/diagnostics/cycle-cost.md): Estimated cycle costs measured against the 70,224-cycle frame budget. - [Toolchain diagnostics (GBS0500–GBS0599)](https://skytech6.github.io/GBSharp/md/reference/diagnostics/toolchain.md): The toolchain and the build itself: missing tools, project file problems, and settings that were asked for but could not be honoured. - [Assets diagnostics (GBS0600–GBS0699)](https://skytech6.github.io/GBSharp/md/reference/diagnostics/assets.md): The asset pipeline. - [Internal diagnostics (GBS9000+)](https://skytech6.github.io/GBSharp/md/reference/diagnostics/internal.md): Bugs in GB# itself. ## Optional - [llms-full.txt](https://skytech6.github.io/GBSharp/llms-full.txt): the complete manual - every page above, the full diagnostics reference, and the framework API - in one file. - [Design thesis](https://github.com/SkyTech6/GBSharp/blob/main/GBSharp_Thesis_and_Architecture.md): why GB# is a compiled subset rather than a runtime, and the architecture behind it.