- Joined: 23 Sep 2021
- Posts: 100
- Location: Poland
|
Writing to VDP and VRAM outside VBLANK
Posted: Wed Nov 03, 2021 9:32 pm
|
I am not sure about read / write VRAM or VDP registers beyond VBLANK interrupt. In Ni****do NES, writing/reading to PPU / VIDEO memory is possible only when screen rendering is turned off or during VBLANK irq.
How does it work with SMS - is it possible to operate on VDP / VRAM while the screen is on and/or out of VBLANK?
|
- Site Admin
- Joined: 19 Oct 1999
- Posts: 14745
- Location: London
|
Posted: Wed Nov 03, 2021 11:23 pm
|
Yes, you can access VRAM but it has to be at a slower rate. The VDP uses the majority of the access slots to the VRAM for drawing, allowing you to read or write every 28 Z80 cycles. Some systems can go a little faster but it's best not to rely on that.
|
- Joined: 23 Sep 2021
- Posts: 100
- Location: Poland
|
Posted: Thu Nov 04, 2021 9:00 am
|
Thanks. that's great.
It will not be complicated calculations of VRAM, rather, for example in the game some collectable item as background element and while collecting it there will be a small update nametable to make it disappear. And possibly changing the colors of the palette - I understand it can be done without problems in the cpu loop (forever loop)?
|
- Joined: 12 Apr 2005
- Posts: 391
- Location: London, United Kingdom
|
Posted: Thu Nov 04, 2021 4:51 pm
|
Writing to CRAM has the same timing requirements as writing to VRAM, however if you write to CRAM during the active display then the value you write will briefly appear on the screen as a single pixel glitch (so-called "CRAM dots") so updating the palette is best done off-screen.
|