CPU Loop VBLANK/Raster Timing Synchronization

Post programming questions related to the CPC Here!
Post Reply
siudym
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
akuyou
Posts: 545
Joined: Mon Apr 22, 2019 3:19 am
Contact:

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
https://www.chibiakumas.com/z80/platform4.php#LessonP40

Lesson P41 - CRTC Rupture for Interrupt based splitscreen on the CPC
https://www.chibiakumas.com/z80/platform5.php#LessonP41

Lesson P42 - Advanced CRTC Rupture
https://www.chibiakumas.com/z80/platform5.php#LessonP42
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”