VDP_loadTileData CPU vs DMA differences?
Posted: Sat Dec 22, 2018 7:51 am
So I'm back on my experimenting with MD homebrew bullshit 
Trying to write some custom graphics handling routines to handle custom data blobs. Was having issues getting tilesets loaded in. This particular tileset has 293 unique tiles in it.
What I have is a pointer to the raw data as a u32*, the tile index in VRAM to store it at, and the number of tiles to store.
When I try and use the CPU mode of VDP_loadTileData, it only loads *some* tiles. It appears to just give up partway through.
Here's what I get:

There's supposed to be way more tiles here, but it looks like it just gave up...?
BUT, if all I do is switch this over to DMA...
It works. The missing tiles are all here now.

What gives? I mean I guess I can just use DMA but this seems kinda broken and I want to make sure there's no underlying issue I've caused that's going to bite me in the ass on hardware later (something that just switching to DMA is *hiding* rather than actually fixing)
I get the exact same results on every emulator I've tried this on (Gens KMod, Fusion, Regen, and Exodus). I also know for a fact that dataPtr is aligned on a 4 byte boundary for whatever that's worth.

Trying to write some custom graphics handling routines to handle custom data blobs. Was having issues getting tilesets loaded in. This particular tileset has 293 unique tiles in it.
What I have is a pointer to the raw data as a u32*, the tile index in VRAM to store it at, and the number of tiles to store.
When I try and use the CPU mode of VDP_loadTileData, it only loads *some* tiles. It appears to just give up partway through.
Code: Select all
VDP_loadTileData( dataPtr, destVRAMIndex, numTiles, CPU );

There's supposed to be way more tiles here, but it looks like it just gave up...?
BUT, if all I do is switch this over to DMA...
Code: Select all
VDP_loadTileData( dataPtr, destVRAMIndex, numTiles, DMA );

What gives? I mean I guess I can just use DMA but this seems kinda broken and I want to make sure there's no underlying issue I've caused that's going to bite me in the ass on hardware later (something that just switching to DMA is *hiding* rather than actually fixing)
I get the exact same results on every emulator I've tried this on (Gens KMod, Fusion, Regen, and Exodus). I also know for a fact that dataPtr is aligned on a 4 byte boundary for whatever that's worth.