Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Writing to VDP and VRAM outside VBLANK

Reply to topic
Author Message
  • Joined: 23 Sep 2021
  • Posts: 96
  • Location: Poland
Reply with quote
Writing to VDP and VRAM outside VBLANK
Post 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?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14682
  • Location: London
Reply with quote
Post 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.
  View user's profile Send private message Visit poster's website
  • Joined: 23 Sep 2021
  • Posts: 96
  • Location: Poland
Reply with quote
Post 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)?
  View user's profile Send private message Visit poster's website
  • Joined: 12 Apr 2005
  • Posts: 391
  • Location: London, United Kingdom
Reply with quote
Post 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.
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!