Re: Tectoy's weird VDP behavior
Posted: Tue Feb 20, 2018 3:45 pm
That'd explain why Miniplanets crashes at random at least... (it probably breaks NBA Jam too then? or was that just controller access without halting the Z80?)
Sega Megadrive/Genesis development
https://gendev.spritesmind.net/forum/
The hardware bug that causes shortened cycles if certain circumstances occur when accessing IO without stopping the Z80 doesn't matter if the rom is fast enough. That's why virtually no games beyond the first year bother stopping the Z80 to read the controller. I'm unaware of a flash cart that is slow enough to show this bug. It's possible that an emulation trying to be completely anal about timing without giving you an option of faster rom access might show this bug.Sik wrote: Tue Feb 20, 2018 3:45 pm That'd explain why Miniplanets crashes at random at least... (it probably breaks NBA Jam too then? or was that just controller access without halting the Z80?)
I did:How about sending a DMA request... After the manual writes?
...
- DMA write one tile
- DMA write a few tiles
- DMA queue one tile
...
That is most likely the case, the clone is probably using a much larger FIFO (or a VRAM cache).cero wrote: Tue Oct 03, 2017 5:31 pm The new tilemap data snaps in entirely during one frame, as if the fifo was massive, but I can't think of any reason for the delay.
Oh, just thought you done these before the manual write instead of after, just like in first post...cero wrote: Wed Mar 07, 2018 10:29 amI did:How about sending a DMA request... After the manual writes?...
- DMA write one tile
- DMA write a few tiles
- DMA queue one tile
...
Code: Select all
#include <genesis.h>
#include "files.h"
#include "../coords.h"
static u16 tmppal[64];
void rendering(const u8 enable);
static const u16 flower1pal[16] = {
RGB24_TO_VDPCOLOR(0x334225),
RGB24_TO_VDPCOLOR(0x3e4e2f),
RGB24_TO_VDPCOLOR(0x4f6132),
RGB24_TO_VDPCOLOR(0x4a533c),
RGB24_TO_VDPCOLOR(0x595b53),
RGB24_TO_VDPCOLOR(0x666565),
RGB24_TO_VDPCOLOR(0x68704d),
RGB24_TO_VDPCOLOR(0x737474),
RGB24_TO_VDPCOLOR(0x8f6a84),
RGB24_TO_VDPCOLOR(0xab6b9e),
RGB24_TO_VDPCOLOR(0xc468b8),
RGB24_TO_VDPCOLOR(0xce91d8),
RGB24_TO_VDPCOLOR(0xda6acd),
RGB24_TO_VDPCOLOR(0xe89d7f),
RGB24_TO_VDPCOLOR(0xecb216),
RGB24_TO_VDPCOLOR(0xed80e6),
};
static const u16 flower2pal[16] = {
RGB24_TO_VDPCOLOR(0x124108),
RGB24_TO_VDPCOLOR(0x22690f),
RGB24_TO_VDPCOLOR(0x3a7b25),
RGB24_TO_VDPCOLOR(0x49a10d),
RGB24_TO_VDPCOLOR(0x5a893c),
RGB24_TO_VDPCOLOR(0x73a766),
RGB24_TO_VDPCOLOR(0xc77005),
RGB24_TO_VDPCOLOR(0xaba67b),
RGB24_TO_VDPCOLOR(0xb49c47),
RGB24_TO_VDPCOLOR(0xa7b097),
RGB24_TO_VDPCOLOR(0xc5caaf),
RGB24_TO_VDPCOLOR(0xe7a107),
RGB24_TO_VDPCOLOR(0xe1e3c8),
RGB24_TO_VDPCOLOR(0xebd264),
RGB24_TO_VDPCOLOR(0xfde709),
RGB24_TO_VDPCOLOR(0xf5f8e9),
};
static void fadeout() {
VDP_fadeOut(0, 63, 30, 0);
}
static void fadein() {
VDP_fadeIn(0, 63, tmppal, 30, 0);
}
static void fillbg(const u16 * const buf) {
u16 x, i = 0;
u8 y;
for (y = 0; y < 28; y++) {
for (x = 0; x < 40; x++, i++) {
VDP_setTileMapXY(PLAN_B,
TILE_ATTR_FULL(0, 0, 0, 0, TILE_USERINDEX + buf[i]),
x, y);
}
}
}
int main() {
u8 i;
rendering(0);
VDP_loadTileSet(&flower1, TILE_USERINDEX, 1);
VDP_waitDMACompletion();
memcpy(tmppal, flower1pal, 16 * 2);
fillbg(flower1coords);
VDP_setPaletteColors(0, palette_black, 64);
rendering(1);
fadein();
for (i = 0; i < 60; i++)
VDP_waitVSync();
fadeout();
rendering(0);
VDP_loadTileSet(&flower2, TILE_USERINDEX, 1);
VDP_waitDMACompletion();
memcpy(tmppal, flower2pal, 16 * 2);
fillbg(flower2coords);
VDP_setPaletteColors(0, palette_black, 64);
rendering(1);
fadein();
while (1)
VDP_waitVSync();
return 0;
}