Close

Buffer switching with VBlank synchronization

A project log for Spartan-6 FPGA Retro System

A complete retro computer system on a single Spartan-6 FPGA. Integrates VGA (640x480), text & sprite engines, PS/2, UART, SD Card, and a cus

rick1961plrick1961pl • 5 hours ago•0 Comments

Version 1.1 added graphics buffer switching (CMD_SET_BUF_LB / CMD_SET_BUF_UB). The switching is synchronized with VBlank to avoid tearing — the buffer swap happens only during the vertical blanking interval (v_cnt >= 480).

Implementation:
- Added vblank output to vga_timing.v
- Added ST_WAIT_VBLANK state to cpu_ram.v
- Buffer swap is triggered by rising edge of vblank

This ensures the VGA display never shows a partially-drawn frame.

Discussions