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 hiand takes 4 cycles of the 6507. This is how it looks on the bus right after a vcsJmp3:1 lda abs2 low byte3 SWCHA4 the RIOT answers and the ARM keeps a copyserved 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
Implementation By version Notes 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.32 It’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-23 It also serves a NOP afterwards, so it takes 6 cycles, like vcsRead6. Chameleon Cart, alternative firmware ◐ 2026-11-28 It’s the template’s version, NOP included. Newbroo Wild Cart and Decker ? 2026 VCSIDE ACE adapter ◐ 2026-11 7 cycles (8 above $FF). - Known issues
- PlusCart and UnoCart: It’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: It also serves a NOP afterwards, so it takes 6 cycles, like vcsRead6.
- Chameleon Cart, alternative firmware: It’s the template’s version, NOP included.
- VCSIDE ACE adapter: 7 cycles (8 above $FF).
- See also vcsRead4 doesn’t take the same number of cycles everywhere.
- See also
vcsRead6(3V)
vcsLib · December 2026ReadsvcsRead4(3V)