thejpster / monotron

A simple 8-bit home computer style application for the TI Tiva-C Launchpad
Apache License 2.0
191 stars 9 forks source link

Improve video CPU usage #42

Open thejpster opened 5 years ago

thejpster commented 5 years ago

Here's an idea to reduce the busy-waits during video rendering.

Break the frame into 5 points, A through E.

At A: spi_off(); audio_play(); spi_prefill(); audio_generate(); At B: sync pulse on (will occur during A interrupt) At C: sync pulse off At D: execute nops (low priority) At E: spi_on(); spi_int(on);

Spi_int(): pull bytes from FB and load SPI until SPI full. When eol found, disable interrupt. Spi_prefill(): call spi_int()

thejpster commented 5 years ago

https://photos.app.goo.gl/PMAcuFd5dn9UoL7e8

thejpster commented 5 years ago

This would speed up #33 too.