Improving LinkCable's API to mimic LinkUniversal and better support mid-frame reads

This commit is contained in:
Rodrigo Alfonso
2023-11-15 01:20:18 -03:00
parent fe572b0f74
commit e12ffdd5fa
11 changed files with 104 additions and 109 deletions

View File

@@ -38,7 +38,10 @@ int main() {
data[i] = 0;
while (true) {
// (4) Send/read messages
// (4) Sync
linkCable->sync();
// (5) Send/read messages
u16 keys = ~REG_KEYS & KEY_ANY;
linkCable->send(keys + 1); // (avoid using 0)
@@ -63,9 +66,6 @@ int main() {
output += std::string("Waiting...");
}
// (5) Mark the current state copy (front buffer) as consumed
linkCable->consume();
VBlankIntrWait();
log(output);
}