Software and examples

Getting started

emuStudio does not distribute the copyrighted arcade ROMs. Supply legally obtained copies of the four binary images:

ROM file Load address Size
invaders.h 0000h (0) 2048 bytes
invaders.g 0800h (2048) 2048 bytes
invaders.f 1000h (4096) 2048 bytes
invaders.e 1800h (6144) 2048 bytes

Configure the ROMs

  1. Close the virtual computer before editing config/SpaceInvaders.toml.
  2. In [MEMORY.settings], use one 64 KiB bank with memorySize = 65536, banksCount = 1, and commonBoundary = 0. The game needs the full 8080 address space, including addresses beyond the framebuffer.
  3. Uncomment the imageName and imageAddress lines by removing their leading #. Set each imageName to the path of its ROM file. Absolute paths avoid dependence on the launch directory. Keep the addresses shown below and leave the four images assigned to bank 0.

The image settings belong inside the existing [MEMORY.settings] section; do not add a second section with that name:

imageName0 = "/path/to/roms/invaders.h"
imageAddress0 = 0
imageName1 = "/path/to/roms/invaders.g"
imageAddress1 = 2048
imageName2 = "/path/to/roms/invaders.f"
imageAddress2 = 4096
imageName3 = "/path/to/roms/invaders.e"
imageAddress3 = 6144

Replace /path/to/roms/ with your directory. On Windows, TOML literal strings such as imageName0 = 'C:\roms\invaders.h' can be used for paths containing backslashes. Keep the template’s ROMfrom and ROMto settings, which protect ROM from writes by the emulated CPU.

Start playing

  1. Launch emuStudio and choose Space Invaders in the computer chooser, or run ./emuStudio -cf config/SpaceInvaders.toml from the installation directory.
  2. Select the Emulator tab and double-click spaceinvaders-display in the device list to open the game window.
  3. Choose Reset, then Run in the execution toolbar. The ROMs are already loaded; no source compilation is needed to play.
  4. Focus the game window, press and release C to insert a coin, then press 1 to start a one-player game.
  5. Use the arrow keys to move and Space to fire. Use Pause and Run in the main window to pause and resume.

Troubleshooting

Symptom What to check
Space Invaders is missing from the chooser Check that the installation includes config/SpaceInvaders.toml and the display plugin.
Blank display or game does not start Check that all four ROM settings are uncommented, the paths exist, and the files have the sizes and addresses listed above. Reopen the computer, then Reset and Run.
Game stops during the attract screen Check that memorySize is 65536, rather than 16384.
Keys do nothing Focus the display window, check that the CPU is running, and insert a coin before starting.
Display settings have no effect Click Save in the display settings. If you edited the configuration file directly, close and reopen the computer.
Device initialization fails Keep the template’s connections to both CPU and memory. In a custom schema, CPU ports 1–5 must be free.

Example: draw and read Fire

This program clears the framebuffer, draws a vertical line at column 112, and lights the upper-left pixel while Space is held. It starts at 2000h, in writable RAM in the bundled configuration, and leaves interrupts disabled. It does not need the arcade ROMs.

  1. Stop the game and open a new source file in the editor. Paste the program below and compile it with as-8080.
  2. Click Reset, then use Jump to location to set the next instruction address to 0x2000.
  3. Open the display, click Run, then focus the display window and hold/release Space.
org 2000h

di
lxi sp,2400h        ; stack grows down into RAM below the framebuffer
lxi h,2400h
lxi b,1C00h        ; clear all 7168 framebuffer bytes
clear_screen:
mvi m,0
inx h
dcx b
mov a,b
ora c
jnz clear_screen

lxi h,3200h        ; start of column 112: 2400h + 112 * 32
mvi b,32
draw_column:
mvi m,0FFh
inx h
dcr b
jnz draw_column

poll_fire:
in 1
ani 10h
jz fire_released
mvi a,80h          ; bit 7 at 241Fh is the upper-left pixel
jmp write_pixel
fire_released:
xra a
write_pixel:
sta 241Fh
jmp poll_fire

The example writes the whole byte at 241Fh, clearing the other seven pixels in that byte. In a program that shares that byte with other graphics, use the read–modify–write operations instead.


This site uses Just the Docs, a documentation theme for Jekyll.