What are good methods to synchronize cpu loop with vblank timing?
Any examples?
CPU Loop VBLANK/Raster Timing Synchronization
Re: CPU Loop VBLANK/Raster Timing Synchronization
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
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
Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809