megadev dma step size
Posted: Mon Sep 21, 2026 1:05 pm
Yo all! Got the urge to do something for the mega cd so I cloned megadev and started hacking away.
But I've now run into a problem with the BIOS_DMA_XFER_WORD_RAM where I can't for the life of me work out why the step size (autoinc) won't work.
Is the BIOS_DMA_XFER_WORD_RAM setting the autoinc to always be 2?
Tried these in different combinations and what not as well before doing the actual dma:
I'm just trying to set the step size to 128.
Most likely doing something totally dumb, but please tell me what it is.
Edit:
This is the smallest test-app I could make. Built on the included new_project in megadev.
This does not step 4. It steps 2. And if a bios_vblank_wait_default() is added after the dma, the horizontal scroll value seems to have been modified. Doing all three ways of setting the autoinc register in this example.
Will post this as an issue at the megadev repo as well. Maybe it's not me after all.
But I've now run into a problem with the BIOS_DMA_XFER_WORD_RAM where I can't for the life of me work out why the step size (autoinc) won't work.
Is the BIOS_DMA_XFER_WORD_RAM setting the autoinc to always be 2?
Tried these in different combinations and what not as well before doing the actual dma:
Code: Select all
vdp_reg regs[] = {0x8F80, 0};
bios_load_vdp_regs(regs);
Code: Select all
bios_vdp_regs[15] = 0x8f80;
Code: Select all
vdp_ctrl = 0x8f80;
Most likely doing something totally dumb, but please tell me what it is.
Edit:
This is the smallest test-app I could make. Built on the included new_project in megadev.
This does not step 4. It steps 2. And if a bios_vblank_wait_default() is added after the dma, the horizontal scroll value seems to have been modified. Doing all three ways of setting the autoinc register in this example.
Will post this as an issue at the megadev repo as well. Maybe it's not me after all.
Code: Select all
#define vdp_ctrl16 (*(u16 volatile *) GFX_CTRL_PORT)
u16 tmp[20] = {33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52};
vdp_reg regs[] = {0x8f04, 0};
void main() {
vdp_ctrl16 = 0x8f04;
bios_vdp_regs[15] = 0x8f04;
bios_load_vdp_regs(regs);
bios_dma_xfer_word_ram(
to_vdp_addr(BIOS_VDP_DEFAULT_PLANEA + VDP_PLANE_POS(10, 0, Width64)),
tmp,
20);
while(1) {
}
}