{"id":16323664,"url":"https://github.com/im-rises/space_invaders_arcade_emulator","last_synced_at":"2025-10-25T20:31:20.948Z","repository":{"id":47354573,"uuid":"487126307","full_name":"Im-Rises/space_invaders_arcade_emulator","owner":"Im-Rises","description":"Space Invaders Arcade game emulator made in Rust 🦀","archived":false,"fork":false,"pushed_at":"2023-05-06T21:56:54.000Z","size":34423,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-31T10:23:18.728Z","etag":null,"topics":["arcade-game","emulator","game","rust","space-invaders","video-game"],"latest_commit_sha":null,"homepage":"https://im-rises.github.io/space-invaders-arcade-emulator-website/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Im-Rises.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-29T22:32:48.000Z","updated_at":"2023-05-10T17:15:28.000Z","dependencies_parsed_at":"2023-02-08T05:01:36.994Z","dependency_job_id":null,"html_url":"https://github.com/Im-Rises/space_invaders_arcade_emulator","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Im-Rises%2Fspace_invaders_arcade_emulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Im-Rises%2Fspace_invaders_arcade_emulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Im-Rises%2Fspace_invaders_arcade_emulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Im-Rises%2Fspace_invaders_arcade_emulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Im-Rises","download_url":"https://codeload.github.com/Im-Rises/space_invaders_arcade_emulator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238207641,"owners_count":19434095,"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":["arcade-game","emulator","game","rust","space-invaders","video-game"],"created_at":"2024-10-10T22:55:22.584Z","updated_at":"2025-10-25T20:31:12.548Z","avatar_url":"https://github.com/Im-Rises.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# space_invaders_arcade_emulator\n\n\u003cp align=\"center\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/Rust-000000?style=for-the-badge\u0026logo=rust\u0026logoColor=white\" alt=\"rustLogo\" style=\"height:60px;\"/\u003e\n      \u003cimg src=\"https://user-images.githubusercontent.com/59691442/181630275-92b292b4-854c-447c-8da9-f8281c1e89c4.png\" alt=\"sdl2Logo\" style=\"height:60px;\"/\u003e\n\u003c/p\u003e\n\n## Description\n\nSpace Invaders arcade game emulator made in Rust with SDL2 and SDL2_mixer.\n\nComplete Emulator of the Intel 8080, the app is implemented to run the Space Invaders Arcade game.\n\nEverything is working including the Space Invaders Easter Egg.\n\nYou can also play it in the browser, I ported the code to WebGL, you can find the\ncode  [here](https://github.com/Im-Rises/space-invaders-arcade-emulator-website).\n\n# 🚀🚀 Play in the browser [here](https://im-rises.github.io/space-invaders-arcade-emulator-website/). 🚀🚀\n\n## Features\n\n- Full emulation\n- Sound\n- Two-players mode\n- Window resizing without deformation\n\n## Images\n\n| Title screen                                                                                                           | Game screen                                                                                                            |\n|------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|\n| ![title_screen](https://user-images.githubusercontent.com/59691442/181736212-8d8cfa4e-4c85-48ce-92ac-1165dcb73891.png) | ![playing_demo](https://user-images.githubusercontent.com/59691442/181736224-da769503-2a2e-45d6-af2c-9204a96e78e1.png) |\n\n| Taito Cop Easter Egg                                                                                                           | Score advance table with Invaders                                                                                             |\n|--------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| ![taito_cop_easter_egg](https://user-images.githubusercontent.com/59691442/183047666-97f9711c-e2a4-4659-86df-410db5562450.png) | ![score_advance_table](https://user-images.githubusercontent.com/59691442/183058044-b5d532d6-bad2-4629-a55c-f669c82a5e29.png) |\n\n## Videos\n\nhttps://user-images.githubusercontent.com/59691442/183045566-0a3df947-06e7-4c46-9fc6-9d2b8f7d9a46.mp4\n\n## Quick start\n\nTo download the emulator, you can click one of the icons below depending on your operating system, or you can click the\nrelease section of the GitHub page.\n\nFor each version when you unzip the downloaded release, you will get the executable and two folder, one\nnamed `game_roms` where you must put the game's roms:\n\n- invaders.h\n- invaders.g\n- invaders.e\n- invaders.f\n\nDepending on you `operating system` you will need to install some libs, they are installed differently depending on your\nsystem, please follow one of the section below `Windows` or `Linux` or `MacOs`.\n\n### Windows\n\n\u003ca href=\"https://github.com/Im-Rises/space_invaders_arcade_emulator/releases/latest\"\u003e\u003cimg src=\"https://img.shields.io/badge/Windows-0078D6?style=for-the-badge\u0026logo=windows\u0026logoColor=white\" alt=\"cmakeLogo\" style=\"height:40px;\"/\u003e\u003c/a\u003e\n\nFor Windows users you don't need to install the libs, you just need to be carefully that you have the `SDL2.dll`\nand `SDL2_mixer.dll` next to the `space_invaders_arcade_emulator.exe` or the emulator won't start.\n\nOnce everything is set up by you can start the emulator by double-clicking the executable of typing the following\ncommand next to it:\n\n```bash\n.\\space_invaders_arcade_emulator.exe\n```\n\n### Linux\n\n\u003ca href=\"https://github.com/Im-Rises/space_invaders_arcade_emulator/releases/latest\"\u003e\u003cimg src=\"https://img.shields.io/badge/Linux-FCC624?style=for-the-badge\u0026logo=linux\u0026logoColor=black\" alt=\"cmakeLogo\" style=\"height:40px;\"/\u003e\u003c/a\u003e\n\nFor Linux users, you need to install the SDL2 lib, to do so type one of the following commands:\n\n```bash\nsudo apt-get install libsdl2-2.0-0 libsdl2-mixer-2.0-0\n```\n\nor if you're a developer and want to compile the Emulator, please install this version of SDL2:\n\n```bash\nsudo apt-get install libsdl2-dev libsdl2-mixer-dev\n```\n\nThen you can start by double-clicking the executable of typing the following command next to it:\n\n```bash\n./space_invaders_arcade_emulator\n```\n\n### MacOs\n\n\u003ca href=\"https://github.com/Im-Rises/space_invaders_arcade_emulator/releases/latest\"\u003e\u003cimg src=\"https://img.shields.io/badge/mac%20os-000000?style=for-the-badge\u0026logo=apple\u0026logoColor=white\" alt=\"cmakeLogo\" style=\"height:40px;\"/\u003e\u003c/a\u003e\n\nFor macOS users you will need to install Brew, please follow the instruction in the link below:  \n\u003chttps://brew.sh\u003e\n\nOnce it is installed, you can type the following command to install SDL2.\n\n```bash\nbrew install sdl2\nbrew install sdl2_mixer\n```\n\nYou also need to add `SDL2` to the paths by typing:\n\n```bash\nexport LIBRARY_PATH=\"$LIBRARY_PATH:$(brew --prefix)/lib\"\n```\n\nThen you can start by double-clicking the executable of typing the following command next to it:\n\n```bash\n./space_invaders_arcade_emulator\n```\n\n## Controls\n\nYou can use the keyboard to play the game.\n\n| Arcade buttons | Emulator/Keyboard |\n|----------------|-------------------|\n| Insert coin    | C                 |\n| Shoot          | ↑                 |\n| ←              | ←                 |\n| →              | →                 |\n| Start 1        | 1                 |\n| Start 2        | 2                 |\n\nThe original game is mapped with some inputs that allow the constructor to choose the difficulty. I Mapped those inputs\nto the keyboard. This allows you to increase the numer of lives and change the extra ship necessity points.\n\nBefore pressing start with player 1 or 2, you can choose the number of life you want to have for a game party.\n\n| Emulator/Keyboard | Emulator buttons                                 |\n|-------------------|--------------------------------------------------|\n| O                 | Show additional info in demo                     |\n| K                 | 1 more life                                      |\n| L                 | 2 more lives                                     |\n| M                 | extra ship at 1000 points instead of 1500 points |\n\n\u003e **Note**  \n\u003e If you don't keep pressed K or L before pressing start and starting a new game you will have 3 lives.  \n\u003e In the same way, you can enable the extra ship to came at 1000 points instead of 1500, but you just need to press\n\u003e the button one time (a confirmation will be displayed in the console).\n\n## Code architecture\n\nThe Emulator is divided into 4 parts:\n\n- main (starter)\n- si_arcade (console emulation)\n- my_sdl2 (video, audio and inputs si_arcade interpreter)\n- binary_lib (a set of binary functions to manipulate data)\n\nThe sound is implemented using `.wav` files, they are loaded in the `si_aracade` part of the program and totally\ninterpreted in the `my_sdl2` part.\n\n## Compilation\n\nFirst thing you need is to install cargo and rust. You can find them by following the instructions in the link below:  \n\u003chttps://www.rust-lang.org/tools/install\u003e\n\nYou also need to download the following audio files:\n\n- 0.wav\n- 1.wav\n- 2.wav\n- 3.wav\n- 4.wav\n- 5.wav\n- 6.wav\n- 7.wav\n- 8.wav\n\nThe `wav` files wan be downloaded in the links below:  \n\u003chttps://samples.mameworld.info\u003e  \n\u003chttps://www.classicgaming.cc/classics/space-invaders/sounds\u003e\n\nThey all must be put in the `game_audios` folder.\n\n\u003e **Warning**  \n\u003e Be carefully when downloading the .wav files, some files pay have the wrong name.\n\nDepending on your OS, you will need to follow specific steps to compile the app. Please refer to the sections\nbelow `Windows`, `Linux` and `macOs`.\n\n### Windows\n\n~~Windows users need to install SDL2 for your OS. The setup instruction can be followed in the link below:~~  \n\u003chttps://github.com/Rust-SDL2/rust-sdl2\u003e\n\nI set up a static SDL2 Linking so Windows user just need to download the project and everything will be set up for SDL2.\nI used the instructions in the link below to set up the dynamic linking:  \n\u003chttps://github.com/Rust-SDL2/rust-sdl2#user-content-windows-with-build-script\u003e\n\n### Linux\n\nLinux Users need to install the SDL2 libs (SDL2 and SDL2_mixer). To do so, type in your bash system the following\ncommands.\n\nIf you want to compile the program, install the developer version with the command below:\n\n```bash\nsudo apt-get install libsdl2-dev libsdl2-mixer-dev\n```\n\n### MacOs\n\nFor macOS users you will need to install Brew, please follow the instruction in the link below:  \n\u003chttps://brew.sh\u003e\n\nOnce it is installed, you can type the following command to install SDL2.\n\n```bash\nbrew install sdl2\nbrew install sdl2_mixer\n```\n\nYou also need to add `SDL2` to the paths by typing:\n\n```bash\nexport LIBRARY_PATH=\"$LIBRARY_PATH:$(brew --prefix)/lib\"\n```\n\n---\n\nWith Rust and SDL2 libs installed, you can now compile the project in two-way, debug or release. To compile go to the\nproject root folder and type one of the two following commands below (If you want to use the emulator please compile\nusing the second command).\n\n```bash\ncargo build\n```\n\nor\n\n```bash\ncargo build --release\n```\n\nThe compiled app will be in the folder `target/debug` or `target/release` depending on the compilation you did.\n\n## Rust tests\n\nYou can test the good behaviour of the project by typing the commands onf of the following command. It will start the\nunit test of the CPU.\n\nIt will start a test rom for the Intel 8080 CPU. You can find it in the link below:  \n\u003chttps://altairclone.com/downloads/cpu_tests/\u003e\n\n```bash\ncargo test\n```\n\nor\n\n```bash\ncargo test --release\n```\n\nCurrently, the CPU is passing the following tests:\n\n- [x] cpudiag.bin\n- [x] TST8080.COM\n- [x] 8080PRE.COM\n- [x] CPUTEST.COM\n- [x] 8080EXER.COM\n- [x] 8080EXM.COM\n\nThe tests are named:\n\n- cpu_test_rom_cpudiag\n- cpu_test_rom_tst8080\n- cpu_test_rom_8080pre\n- cpu_test_rom_cputest\n- cpu_test_rom_8080exer\n- cpu_test_rom_8080exm\n\nYou can start them individuality by typing:\n\n```bash\ncargo test \u003ctest_name\u003e\n```\n\nor\n\n```bash\ncargo test \u003ctest_name\u003e --release\n```\n\nExample: If you want to start the cpu_test_rom_tst8080 test.\n\n```bash\ncargo test cpu_test_rom_tst8080\n```\n\nor\n\n```bash\ncargo test cpu_test_rom_tst8080 --release\n```\n\nTo show the CPU test logs, you can use the `--show-output` flag.\n\n```bash\ncargo test --release -- --show-output\n```\n\nYou can also debug disassembly by uncommenting the two following lines in the `cpu.rs` file in the `test`\nmodule.\n\n~~~\n// let mut f = File::create(\"test_roms/my_output.log\").expect(\"Cannot create debug log file\");  \n~~~\n\n~~~\n// write_debug_to_file(\u0026mut cpu_debug, \u0026mut f, cycles_counter);\n~~~\n\nThis will output the complete disassembly of the CPU in the `test_roms/my_output.log` file.\n\n\u003e **Note**  \n\u003e Depending on the test the output is different. Refer to this project for more explanation about how they work.  \n\u003e https://github.com/superzazu/8080  \n\u003e http://www.emulator101.com/full-8080-emulation.html\n\u003e\n\u003e The last test (cpu_test_rom_8080exm) can take a lot of time in debug mode, you should test it in release mode, use the\n\u003e command below:\n\u003e ```bash\n\u003e cargo test cpu_test_rom_8080exm --release\n\u003e ```\n\n## GitHub Actions\n\n[![Rust](https://github.com/Im-Rises/space_invaders_arcade_emulator/actions/workflows/rust.yml/badge.svg?branch=main)](https://github.com/Im-Rises/space_invaders_arcade_emulator/actions/workflows/rust.yml)\n[![rust-clippy analyze](https://github.com/Im-Rises/space_invaders_arcade_emulator/actions/workflows/rust-clippy.yml/badge.svg?branch=main)](https://github.com/Im-Rises/space_invaders_arcade_emulator/actions/workflows/rust-clippy.yml)\n[![rustfmt check](https://github.com/Im-Rises/space_invaders_arcade_emulator/actions/workflows/rustfmt.yml/badge.svg?branch=main)](https://github.com/Im-Rises/space_invaders_arcade_emulator/actions/workflows/rustfmt.yml)\n[![rust-publish](https://github.com/Im-Rises/space_invaders_arcade_emulator/actions/workflows/rust-publish.yaml/badge.svg?branch=main)](https://github.com/Im-Rises/space_invaders_arcade_emulator/actions/workflows/rust-publish.yaml)\n\nThe project is set with a set of different scripts:\n\n- rust : Check the code compilation.\n- rust-clippy analyze : Evaluate the code quality (error, warnings, etc...).\n- rustfmt check :  Check the code good formatting\n- rust-publisher : Publish the app to releases when pushing to the main branch.\n\n## Documentation\n\nemulator101:  \n\u003chttp://www.emulator101.com\u003e\n\nComputer Archeology:  \n\u003chttps://www.computerarcheology.com/Arcade/SpaceInvaders/Hardware.html\u003e\n\nEmudev.de:  \n\u003chttps://emudev.de/q00-si/a-short-fun-project/\u003e\n\nRust:  \n\u003chttps://doc.rust-lang.org/book\u003e\n\nSDL2 Rust:  \n\u003chttps://github.com/Rust-SDL2/rust-sdl2\u003e\n\nSDL2 libs download:  \n\u003chttps://www.libsdl.org/download-2.0.php\u003e  \n\u003chttps://github.com/libsdl-org/SDL_mixer/releases\u003e\n\nrust-clippy:  \n\u003chttps://github.com/rust-lang/rust-clippy\u003e\n\nrustfmt:  \n\u003chttps://github.com/rust-lang/rustfmt\u003e\n\nIntel 8080 documentations:  \n\u003chttps://archive.org/details/8080Datasheet\u003e  \n\u003chttps://altairclone.com/downloads/manuals/8080%20Programmers%20Manual.pdf\u003e\n\u003chttp://bitsavers.org/components/intel/MCS80/9800301D_8080_8085_Assembly_Language_Programming_Manual_May81.pdf\u003e\n\nIntel 8080 opcodes table:  \n\u003chttps://www.pastraiser.com/cpu/i8080/i8080_opcodes.html\u003e\n\nWikipedia:  \n\u003chttps://en.wikipedia.org/wiki/Intel_8080\u003e\n\nTest Roms for the Intel 8080:  \n\u003chttps://github.com/superzazu/8080/\u003e  \n\u003chttps://altairclone.com/downloads/cpu_tests/\u003e  \n\u003chttp://www.emulator101.com/full-8080-emulation.html\u003e\n\nSpace Invaders Audio files:  \n\u003chttps://samples.mameworld.info\u003e  \n\u003chttps://www.classicgaming.cc/classics/space-invaders/sounds\u003e\n\n## Contributors\n\nQuentin MOREL :\n\n- @Im-Rises\n- \u003chttps://github.com/Im-Rises\u003e\n\n[![GitHub contributors](https://contrib.rocks/image?repo=Im-Rises/GameBoyEmulator)](https://github.com/Im-Rises/GameBoyEmulator/graphs/contributors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fim-rises%2Fspace_invaders_arcade_emulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fim-rises%2Fspace_invaders_arcade_emulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fim-rises%2Fspace_invaders_arcade_emulator/lists"}