This is a slight bottleneck, as the emulator input plugin blocks while the TCP socket fetches the response, causing stuttering.
Instead of requesting 4 responses per image frame, instead request 1 response containing the entire memory buffer.
This will require a slight change in the JSON structure, such that:
{
"PLAYER_1_ANALOG": [0,0],
...
"PLAYER_4_A_BTN: 0
}
We can then parse this more easily, using only function calls on a string instead of blocking the input thread.
This is a slight bottleneck, as the emulator input plugin blocks while the TCP socket fetches the response, causing stuttering.
Instead of requesting 4 responses per image frame, instead request 1 response containing the entire memory buffer.
This will require a slight change in the JSON structure, such that:
{ "PLAYER_1_ANALOG": [0,0], ... "PLAYER_4_A_BTN: 0 }We can then parse this more easily, using only function calls on a string instead of blocking the input thread.