A fun little proof of concept for mGBA-http where it takes in your CPU usage as what button to press.
cpuplaysshort.mp4
Video is sped up.
Every second:
- The CPU usage is checked
- Some maths then the usage is mapped to a key
- The key is sent to mGBA-http and onwards to mGBA
- Have mGBA up and running
- Get and setup mGBA-http
- Get this project
- Run this project (either in Visual Studio/your IDE of choice, or with
dotnet run
)
- Uses the new
PeriodicTimer
object - The maths for the value to modulo is a mixture of both the whole and fraction because:
- If just the whole value is used, then there may not be enough variation in CPU usage to modulo for all the keys
- If it's just the fraction, the trailing zero is cut off, meaning we never get the A key
PerformanceCounter
is now a NuGet package
The following is a whole hour of "playing" and "progress":