rewrote peripheral interface to closely resemble SDL, analog still flaky