EN
vcsRead4(3V)vcsLib manualvcsRead4(3V)
Name

vcsRead4

Serves LDA abs. The 6507 does the read and the ARM keeps the byte that went across the bus.

Synopsis
#include "vcsLib.h"

uint8_t vcsRead4(uint16_t address);
Description

The cartridge listens to the data bus during the read cycle and returns that byte from the function. That’s how you read the joysticks (SWCHA, INPT4), the console switches (SWCHB), the collision registers or the timer.

Right after the read the cartridge has to serve the next instruction. Slower cartridges can’t keep up, which is why the PlusCart replaced it with vcsRead6, which adds a NOP.

On the bus

It serves AD lo hi and takes 4 cycles of the 6507. This is how it looks on the bus right after a vcsJmp3:

φ2A12–A0D7–D0R/W$1000AD$100180$100202$02807F
1 lda abs2 low byte3 SWCHA4 the RIOT answers and the ARM keeps a copy

served by the cartridgeanswered by RAM, the TIA or the RIOT

Example
uint8_t joy = vcsRead4(SWCHA);
if (!(joy & 0x80)) x++;    /* right */
Compatibility

● complete ◐ works with differences ○ exists but does nothing – missing ? no data

ImplementationBy versionNotes
Stella● 7.0● master
Gopher2600● 2022-2023● 2025-04● v0.51.0● v0.53.0● master
Test7800● 2025● v0.8.0 – v0.9.0
PlusCart and UnoCart● 2.3.15 – 2.3.28◐ git 2025-11◐ 2.3.32It’s still in the firmware so that older ELF files keep working, but it was taken out of the header in November 2025.
Chameleon Cart◐ 2025-10-23It also serves a NOP afterwards, so it takes 6 cycles, like vcsRead6.
Chameleon Cart, alternative firmware◐ 2026-11-28It’s the template’s version, NOP included.
Newbroo Wild Cart and Decker? 2026
VCSIDE ACE adapter◐ 2026-117 cycles (8 above $FF).
Known issues
See also

vcsRead6(3V)

vcsLib · December 2026ReadsvcsRead4(3V)