DMA code generating

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
DMA code generating
by on (#159550)
I've seen discussion about generating code to speed up vram writes on the NES and so I'll might as do the same with the SNES's DMA to cut down on the CPU overhead between DMA transfers.

I'm also planning on using tricks such placing the stack on the $43xx registers and pushing some "effective addresses" onto it. Somebody once mentioned that it's possible to have an extra DMA channel for vram addresses, and it looks like it will benefit here.

Here's how the generated code will look like:

Code:
//A=$4315, X=$02, Y=$03, D=$4300
tcs
pea bank&legnth
pea source
stx $05
sty $420b
jml end_dma_routine


If you find anything wrong with the code, please mention it.