{"id":15640173,"url":"https://github.com/flozz/gameboy-examples","last_synced_at":"2025-04-30T07:28:59.195Z","repository":{"id":66099039,"uuid":"151075237","full_name":"flozz/gameboy-examples","owner":"flozz","description":"Example programs that run on the Nintendo GameBoy","archived":false,"fork":false,"pushed_at":"2020-10-20T16:19:10.000Z","size":1066,"stargazers_count":93,"open_issues_count":0,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T14:02:42.530Z","etag":null,"topics":["gameboy","gbdev","gbdk"],"latest_commit_sha":null,"homepage":"https://blog.flozz.fr/2019/09/18/developpement-gameboy-1bis-re-hello-world/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flozz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"flozz","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://www.paypal.me/0xflozz"}},"created_at":"2018-10-01T11:06:42.000Z","updated_at":"2025-03-08T21:09:22.000Z","dependencies_parsed_at":"2023-03-07T11:01:12.045Z","dependency_job_id":null,"html_url":"https://github.com/flozz/gameboy-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flozz%2Fgameboy-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flozz%2Fgameboy-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flozz%2Fgameboy-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flozz%2Fgameboy-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flozz","download_url":"https://codeload.github.com/flozz/gameboy-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251660117,"owners_count":21623192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gameboy","gbdev","gbdk"],"created_at":"2024-10-03T11:31:53.652Z","updated_at":"2025-04-30T07:28:59.174Z","avatar_url":"https://github.com/flozz.png","language":"C","readme":"# GameBoy Examples\n\nThis repository contains example programs for the Nintendo GameBoy video game console. The examples are related to articles on my blog (in French).\n\n\n## Examples Index\n\n| Screenshot                                              | Name                                                       | Description                                                                  |\n|---------------------------------------------------------|------------------------------------------------------------|------------------------------------------------------------------------------|\n| ![](./01-hello-world/hello_screenshot.png)              | [01 - Hello World](./01-hello-world/)                      | Simple program that prints \"Hello World\" on the screen                       |\n| ![](./02-gamepad/gamepad_screenshot.gif)                | [02 - Gamepad](./02-gamepad/)                              | Simple program shows how to use gamepad in a GameBoy program                 |\n| ![](./03-tic-tac-toe/tictactoe_screenshot.gif)          | [03 - Tic Tac Toe](./03-tic-tac-toe/)                      | A complete example project to show how to make a simple game for the GameBoy |\n| ![](./04-graphics1/graphics1_screenshot.png)            | [04 - Graphics 1](./04-graphics1/)                         | Simple example to show how to draw tiles on the GameBoy                      |\n| ![](./05-graphics2/graphics2_screenshot.png)            | [05 - Graphics 2](./05-graphics2/)                         | Convert an image using img2gb and display it                                 |\n| ![](./06-graphics3-background/graphics3_screenshot.gif) | [06 - Graphics 3 - background](./06-graphics3-background/) | Background layer scrolling example                                           |\n| ![](./07-graphics4-sprites/graphics4_screenshot.gif)    | [07 - Graphics 4 - sprites](./07-graphics4-sprites/)       | A complete sprite example with an animated player                            |\n| ![](./08-graphics5-window/graphics5_screenshot.gif)     | [08 - Graphics 5 - window](./08-graphics5-window/)         | Window layer example                                                         |\n| ![](./09-graphics6-palette/graphics6_screenshot.gif)    | [09 - Graphics 6 - palettes](./09-graphics6-palette/)      | Playing with color palettes                                                  |\n| ![](./10-breakout/breakout_screenshot.gif)              | [10 - Breakout](./10-breakout/)                            | Simple breakout game                                                         |\n| ![](./11-custom-text/text_screenshot.png)               | [11 - Custom Text](./11-custom-text/)                      | Handle and display text                                                      |\n\n\n## Compiling Examples\n\n### Linux\n\nFirst you need to install some dependencies: SDCC (with its libraries), GNU Make, git. This can be installed with the following command on Debian / Ubuntu:\n\n    sudo apt install build-essential sdcc sdcc-libraries git\n\nThen clone this repository and get submodules:\n\n    git clone https://github.com/flozz/gameboy-examples.git\n    cd gameboy-examples\n    git submodule init\n    git submodule update\n\nThen you have to build the gbdk-n library (this needs to be done only once):\n\n    cd gbdk-n\n    make\n    cd ..\n\nFinally, you can build examples with the `make` command from the directory of the example. For example, if you want to build the \"Hello World\" example, you will have to run the following commands:\n\n    cd 01-hello-world/\n    make\n\nYou can now run the generated `.gb` file with your favorite emulator.\n\nIf you want to cleanup the folder from all generated files (`*.rel`, `*.lst`, `*.gb`,...), you can use the following command:\n\n    make clean\n\n\n### Windows\n\nTo build the examples on Windows, you first have to download and install [the latest SDCC version](http://sdcc.sourceforge.net/).\n\nThen clone this repository and get submodules:\n\n    git clone https://github.com/flozz/gameboy-examples.git\n    cd gameboy-examples\n    git submodule init\n    git submodule update\n\nThen you have to build the gbdk-n library (this needs to be done only once).\n\nIf you are using CMD.exe:\n\n    cd gbdk-n\n    make\n    cd ..\n\nIf you are using Git Bash:\n\n    cd gbdk-n\n    ./Make.bat\n    cd ..\n\nFinally go to an example folder:\n\n    cd 01-hello-world\n\nAnd build it using the `Make.bat` file.\n\nIf you are using CMD.exe:\n\n    make\n\nIf you are using Git Bash:\n\n    ./Make.bat\n\nYou can now run the generated `.gb` file with your favorite emulator.\n\nIf you want to cleanup the folder from all generated files (`*.rel`, `*.lst`, `*.gb`,...), you can use the following command:\n\nIf you are using CMD.exe:\n\n    make clean\n\nIf you are using Git Bash:\n\n    ./Make.bat clean\n\n\n## Building assets\n\nSome of the examples have assets (tilesets, tilemaps, sprites,...). If you changes the images, you will have to rebuild assets.\n\n### Linux\n\nYou will first need to [install img2gb][img2gb-install]. This can be done with the following command:\n\n    sudo pip install img2gb\n\nThen, just run the following command (from the example directory):\n\n    make assets\n\n### Windows\n\nYou first have to get the Windows version of img2gb :\n\n* [Download de latest img2gb binary for Windows][img2gb-win],\n* then rename it `img2gb.exe`,\n* and put it in the project folder (in the same folder than the `Make.bat` file).\n\nFinally, open a terminal in the project's folder and use the following command to rebuild the assets :\n\n    make assets\n\nThe previous command will work if you are using CMD.exe, but if you are using Git Bash, type this one instead :\n\n    ./Make.bat assets\n\n\n[img2gb-win]: https://github.com/flozz/img2gb/releases\n[img2gb-install]: https://flozz.github.io/img2gb/install.html\n\n\n## License\n\nThe examples in this repository are licensed under WTFPL unless otherwise stated:\n\n```\n        DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE\n                    Version 2, December 2004\n\n Copyright (C) 2004 Sam Hocevar \u003csam@hocevar.net\u003e\n\n Everyone is permitted to copy and distribute verbatim or modified\n copies of this license document, and changing it is allowed as long\n as the name is changed.\n\n            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. You just DO WHAT THE FUCK YOU WANT TO.\n```\n","funding_links":["https://github.com/sponsors/flozz","https://www.paypal.me/0xflozz"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflozz%2Fgameboy-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflozz%2Fgameboy-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflozz%2Fgameboy-examples/lists"}