Returning value from C function to Lua coroutine



The above phenomenon seems to be recurring.
Attached is a sample that can be compiled with the latest SDK.

Best regards. (5.1 KB)


I just updated my project from the prehistoric SDK 1.4.0 to 1.12.3.

Took me a few hours to figure out that everything's broken because all the playdate->lua->getArg*/pushObject functions don't work inside coroutines any more.

Going back to SDK 1.10.0 and the problem is still there so I guess this broke between 1.4.0 and 1.10.0. I didn't keep copies of and can't find any pre 1.10 SDKs to check those.

My entire project is structured around coroutines and C so hopefully there's a workaround or fix for this. In the meantime, I'm back on 1.4.0.

1 Like

Found & tried 1.9.0, same problem.

Found it. I broke the previous fix when I updated Lua to 5.4.3 in SDK 1.8, about a year ago. :frowning: I have our local changes to the Lua runtime flagged with comments in the source and merge them in by hand because I don't trust git to do it right. But now I don't trust myself either so I'll try git again next time.

MR is in for 1.13, lmk if you need a beta build before that's out.

Nice, thanks Dave! I'll be ok on 1.4.0 for now and will try the upgrade again when 1.13 is released.

1 Like

I'll verify this when 1.13 comes out.

1 Like

Confirmed it's fixed in SDK 1.13.0!

1 Like