VSRAM Fill Mode DMA

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Post Reply
BigEvilCorporation
Very interested
Posts: 209
Joined: Sat Sep 08, 2012 10:41 am
Contact:

VSRAM Fill Mode DMA

Post by BigEvilCorporation » Sun Jun 19, 2016 4:48 pm

Does the VDP implement Fill Mode DMA targetting VSRAM?

Regen implements it (I can write garbage bytes to it, and a DMA Fill clears it properly) but I believe this may be in error.

My game works on real hardware but every 50th boot or so the vertical scroll data is messed up. I ignored the bug and put it on the backlist until recently I tried the 'mega' emulator (https://github.com/SavourySnaX/mega) which errors if DMA Fill is used on VSRAM, and reminded me to chase this up. I work with the emulator's author and he can't remember.

Is it a real thing or not?
A blog of my Megadrive programming adventures: http://www.bigevilcorporation.co.uk

Sik
Very interested
Posts: 939
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: VSRAM Fill Mode DMA

Post by Sik » Sun Jun 19, 2016 8:21 pm

Huuuuuh honestly I never tested it (and I don't think it ever was), but if it does work, then I think it should be working on words, not bytes (this may mess up the parameters you're using).
Sik is pronounced as "seek", not as "sick".

Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Re: VSRAM Fill Mode DMA

Post by Nemesis » Wed Jun 22, 2016 12:47 am

Yes, you can do a DMA fill to VSRAM, but it doesn't behave the way you might expect. There's a lot of information in the following post, including enough info to understand how to reliably do a DMA fill operation to CRAM or VSRAM:
viewtopic.php?p=21016#p21016
If you need more info, trace back from here a few posts to follow the conversation. You'll see I posted my "VDP FIFO" test ROM in this thread, which contains working examples of DMA fill to VSRAM. You can also check the sourcecode of Exodus, which implements DMA fills based on all these findings, and passes the test cases in the VDP FIFO test ROM. Note that most emulators get areas of DMA behaviour like this wrong, which you can test by running that ROM and comparing with the results from Exodus or the real hardware.

BigEvilCorporation
Very interested
Posts: 209
Joined: Sat Sep 08, 2012 10:41 am
Contact:

Re: VSRAM Fill Mode DMA

Post by BigEvilCorporation » Wed Jun 22, 2016 8:31 pm

Excellent stuff, thank you! I'll follow that thread and see if there's a subtlety I'm missing that might make it mess up after a few resets. It *mostly* works - I can verify by making a deliberate mess of VSRAM and using DMA fill to clear it - so this is definitely something I need to implement in the Mega emulator.
A blog of my Megadrive programming adventures: http://www.bigevilcorporation.co.uk

Post Reply