Made this to test out my Mode 4 code:
Spent most of the time trying to optimise the random number generator. Quirk with mode 4 is that it has two pages that you are supposed to swap between for reading/writing pixel data, but what I did here was Direct Memory Access (DMA) copy the back buffer to the front buffer when in VBlank.
A normal CPU copy involves reading from memory to the CPU then writing from the CPU to memory (load/store) - with DMA you basically connect the memory directly so the data transfers without touching the CPU (well, not quite). The CPU is halted during the transfer, but it's really fast compared to even the fast CPU copy mode (which does load/store copy but locks the CPU to do it as fast as it can).
Spent most of the time trying to optimise the random number generator. Quirk with mode 4 is that it has two pages that you are supposed to swap between for reading/writing pixel data, but what I did here was Direct Memory Access (DMA) copy the back buffer to the front buffer when in VBlank.
A normal CPU copy involves reading from memory to the CPU then writing from the CPU to memory (load/store) - with DMA you basically connect the memory directly so the data transfers without touching the CPU (well, not quite). The CPU is halted during the transfer, but it's really fast compared to even the fast CPU copy mode (which does load/store copy but locks the CPU to do it as fast as it can).























