Skip to content

i8080 Space Invaders Emulator in C

Notifications You must be signed in to change notification settings

tommojphillips/Space-Invaders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intel 8080 Space Invaders Emulator

An Emulator for The Original 1978 Space Invaders Arcade Machine. Written in C using SDL2 for renderering and imgui for a GUI. The emulator is capable of runnning a few different arcade machines: Space Invaders, Lunar Rescue, Balloon Bomber, Space Invaders pt2, Space Laser and Space Chaser

Space Invaders - invaders.zip Lunar Rescue - lrescue.zip Balloon Bomber - ballbomb.zip
invaders_470_540 lrescue_470_540 ballbomb_470_540
Space Invaders Pt2 - invadpt2.zip Space Laser - spclaser.zip Space Chaser - schaser.zip
invaderspt2_470_540 space_laser_470_540 schaser_470_540

Input

Both player 1 and player 2 controls are mapped to the same keys.

Key Desc
1 Player one start
2 Player two start
Space Fire
Left Arrow Left
Right Arrow Right
3 / C Insert Coin
Esc Toggle Main Menu
F11 Full Screen
P Pause/Unpause
I Spawn Space Ship
U Kill Space Ship
F5 Save Machine State
F9 Load Machine State

A Windows binary is available for download on the releases page. See: Releases


How to use

This project uses the same names for the roms as the MAME project. Roms are loaded from a directory named after their MAME name. eg.

 Space-Invaders.exe

 invaders\
         | - invaders.e
         | - invaders.f
         | - invaders.g
         | - invaders.h

 lrescue\
         | - lrescue.1
         | - lrescue.2
         | - lrescue.3
         | - lrescue.4
         | - lrescue.5
         | - lrescue.6

Changing ROMSETS:

1.) Open the menu using Esc

2.) Select the drop down menu and choose a romset.

Screenshot 2025-02-05 205313


Building

The project is built in Visual Studio 2022

Dependencies


  1. Clone the repo
git clone https://github.com/tommojphillips/Space-Invaders.git
  1. CD to lib/ dir
cd Space-Invaders/lib
  1. Clone imgui into lib/ dir
git clone --depth 1 --branch v1.91.6 https://github.com/ocornut/imgui.git
  1. Clone imgui-club into lib/ dir
git clone https://github.com/ocornut/imgui_club.git
  1. Download SDL2 VC package SDL2-devel-X.X.X-VC.zip (direct download link)

    • Extract and copy the include and lib folders into Space-Invaders/lib/SDL2 you will have to create the SDL2 directory
  2. Open vc\Space-Invaders.sln in visual studio and build and run

The project directory structure should look like this:

Space-Invaders\
      | -- lib\
      |        | -- i8080\
      |        |          | -- i8080.h
      |        |          | -- i8080.c
      |        |          | -- i8080_mnem.h
      |        |          | -- i8080_mnem.c
      |        |
      |        | -- imgui\
      |        |          | -- backends\
      |        |
      |        | -- imgui-club\
      |        |          | -- imgui_memory_editor\
      |        |
      |        | -- SDL2\
      |                  | -- include\
      |                  | -- lib\        
      | -- src\
      |
      | -- vc\
      |       | -- Space-Invaders.sln
      |       | -- Space-Invaders.vcxproj