Emulator · github.com/stella-emu/stella
Stella
The reference 2600 emulator. Since version 7.0 it loads ELF games with a loader and a vcsLib of its own, both written in C++, which imitate what the cartridge firmware does.
Christian Speckner (DirtyHairy) and the Stella team
Complete 33With differences 4Empty 0Missing 14
Specifications
| Since | 7.0 (October 2024) |
|---|---|
| Source | src/emucore/elf/ (VcsLib.cxx, ElfEnvironment.cxx, CartELF.cxx) |
| Licence | GPL-2 |
| Debugging | The -elf.dump option shows how the ROM was linked |
Versions
2022202320242025202620277.0master
| Version | Date | Changes to vcsLib |
|---|---|---|
| 7.0 | 2024-10-05 | The first ELF loader (the “ELF mapper”, written for Mattress Monkeys). Nearly all of vcsLib has been there since August 2024, bus stuffing and bus snooping included. |
| master | 2025-11-07 | vcsWrite4 (PR #1104), and since 2026 save states keep the last byte read from the bus. Neither change is in a release yet. |
Errata
- vcsLdxForBusStuff2 and vcsLdyForBusStuff2 serve LDA (A9) instead of LDX (A2) and LDY (A0), and all three masks are 0 (VcsLib.cxx:163, 264, 268).
- vcsWrite3 always serves STA and writes the whole byte without simulating the fight over the bus, so a bus-stuffing kernel can look fine in Stella and wrong on a console.
- vcsPla4Ex, vcsPlp4Ex, vcsWaitForAddress and injectDmaData stop emulation with “unimplemented”.
- The DMA function is called injectDmaData, without the vcs prefix, and there’s no vcsSnoopRead.
- The transaction queue holds 10 entries. If the game gets further ahead than that, the ARM stalls until the 6507 catches up.
- If a symbol is missing the ROM doesn’t load (“symbol not found”).
On the differences page
- vcsJmpToRam3 on the Chameleon Cart expects the return one byte earlier: It expects the return at JMP + 3 ($1003 after vcsJmp3).
- Some implementations of vcsSta4 only use the low byte: 16 bits.
- vcsRead4 doesn’t take the same number of cycles everywhere: 4 cycles.
- You can’t test bus stuffing in Stella: Always STA, and the whole byte gets written.
- Functions with a different name, or that do nothing: injectDmaData. vcsWaitForAddress and the Ex functions stop emulation.
- Where the game code runs: No restrictions.
- The Chameleon Cart calls elf_main with the console already running: The 6507 is at $1000.
Compatibility by version
● complete ◐ works with differences ○ exists but does nothing – missing ? no data
| Function | 7.0 | master | Notes |
|---|---|---|---|
| Startup | |||
| elf_main | ● | ● | It only looks for elf_main. |
| Flow control | |||
| vcsJmp3 | ● | ● | |
| vcsNop2 | ● | ● | |
| vcsNop2n | ● | ● | It does nothing when count is 0. |
| vcsNop3 | – | – | |
| vcsSleep | ● | ● | |
| vcsJsr6 | ● | ● | |
| vcsTxs2 | ● | ● | |
| Loads and stores | |||
| vcsLda2 | ● | ● | |
| vcsLdx2 | ● | ● | |
| vcsLdy2 | ● | ● | |
| vcsSta3 | ● | ● | |
| vcsStx3 | ● | ● | |
| vcsSty3 | ● | ● | |
| vcsSax3 | ● | ● | |
| vcsSta4 | ● | ● | |
| vcsStx4 | ● | ● | |
| vcsSty4 | ● | ● | |
| vcsWrite5 | ● | ● | |
| vcsWrite6 | ● | ● | |
| Reads | |||
| vcsRead4 | ● | ● | |
| vcsRead6 | – | – | |
| Bus stuffing | |||
| vcsLdaForBusStuff2 | ◐ | ◐ | It loads #$00. |
| vcsLdxForBusStuff2 | ◐ | ◐ | It serves LDA (A9) instead of LDX, and loads #$00. |
| vcsLdyForBusStuff2 | ◐ | ◐ | It serves LDA (A9) instead of LDY, and loads #$00. |
| vcsWrite3 | ◐ | ◐ | It always serves STA and writes the whole byte, so the fight over the bus isn’t simulated. |
| vcsWrite4 | – | – | Only on the main branch since 7 November 2025, and not in any release yet. |
| Stack | |||
| vcsPha3 | ● | ● | It’s exported, even though the Chameleon header doesn’t declare it. |
| vcsPhp3 | ● | ● | |
| vcsPla4 | ● | ● | |
| vcsPlp4 | ● | ● | |
| vcsPla4Ex | – | – | It stops emulation with “unimplemented”. |
| vcsPlp4Ex | – | – | It stops emulation with “unimplemented”. |
| Overblank | |||
| vcsCopyOverblankToRiotRam | ● | ● | |
| vcsStartOverblank | ● | ● | |
| vcsEndOverblank | ● | ● | |
| 7800 bus | |||
| vcsJmpToRam3 | ● | ● | |
| vcsWaitForAddress | – | – | It stops emulation with “unimplemented”. |
| vcsSnoopRead | – | – | |
| vcsInjectDmaData | – | – | It’s called injectDmaData and it stops emulation. |
| Cartridge ROM | |||
| vcsPokeRomByte | – | – | |
| vcsSetNextAddress | – | – | |
| Saving | |||
| vcsInitNvStore | – | – | |
| vcsWriteNvChunk | – | – | |
| vcsProcessNvStoreEvents | – | – | |
| vcsIsNvBusy | – | – | |
| Utilities | |||
| randint | ● | ● | |
| ReverseByte | ● | ● | |
| ColorLookup | ● | ● | |
| memset | ● | ● | |
| memcpy | ● | ● | |