Skip to content

Conversation

@fuglaro
Copy link
Contributor

@fuglaro fuglaro commented Jan 10, 2023

The stand-alone emulator previously used the same menu.py file that runs on the device, but manipulated the python code with some hot patches to be able to dynamically load all the games from the Arcade.

This change avoids this hot patching by making some minimal fallback behaviour in menu.py:

  • If there is an error listing the contents of /Games/, menu.py will load the list of games from a `/Games' file, which is provided by the standalone emulator.
  • If running stat on the game file errors, assume we are running in emulatton mode and ignore it.
  • When a game is launched, print to terminal a line like HEYTHUMBY!LOAD:TinyBlocks

There is also a related change in play.js that cleans up better when games end and it goes back to the menu. Previously, lots of hidden Editor widgets would be left open.

There should be no other behavioural changes with this update expect code that is less brittle to future changes.

Tests on the the following looked good to me:

  • standalone emulator via menu
  • standalone emulator via direct link
  • code editor emulator
  • fast execute
  • thumby device

@ghost
Copy link

ghost commented Mar 1, 2023

Seems reasonable. My only issue is that regular hardware users will see that message HEYTHUMBY!LOAD:TinyBlocks printed. Would be nice if it only occurred in the emulator. Would it be possible to only print that if running in the emulator? Like when the emulator module exists?

@fuglaro
Copy link
Contributor Author

fuglaro commented Mar 1, 2023

Good point and that sounds great! I'll take a look at that soon. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant