CPU Loop VBLANK/Raster Timing Synchronization

Post programming questions related to the CPC Here!
Post Reply
Posts: 2
Joined: Wed Nov 03, 2021 9:15 pm

CPU Loop VBLANK/Raster Timing Synchronization

Post by siudym » Sat Jan 14, 2023 12:40 pm

What are good methods to synchronize cpu loop with vblank timing?
Any examples?

User avatar
Posts: 566
Joined: Mon Apr 22, 2019 3:19 am

Re: CPU Loop VBLANK/Raster Timing Synchronization

Post by akuyou » Sat Jan 14, 2023 1:10 pm

Interrupts occur on the Amstrad CPC 6 times per frame, so if you want to do a mode/color switch for part of the screen that's your best option.

If you want to do things with line level precision, then you need to calculate the time the beam is taking, I believe one 'NOP' takes the time of one Mode 1 8 pixel wide block...

Here's the tutorials I have on CPC interrupts and raster tricks:

Lesson M6 - Advanced Interrupt handler template
https://www.chibiakumas.com/z80/multipl ... p#LessonM6

Lesson P40 - Syncronized mode switches for 320x200 @ 16 color EGX graphics on the Amstrad CPC

Lesson P41 - CRTC Rupture for Interrupt based splitscreen on the CPC

Lesson P42 - Advanced CRTC Rupture
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter! // 「チビ悪魔」可笑しいゴシックSTG ! // Work in Progress: ChibiAliens

Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809

Post Reply

Return to “Amstrad CPC Assembly Programming”