Add local emulators for v1/v2/v3 hardware#142
Open
sastraxi wants to merge 29 commits intoTreeFallSound:pistomp-v3from
Open
Add local emulators for v1/v2/v3 hardware#142sastraxi wants to merge 29 commits intoTreeFallSound:pistomp-v3from
sastraxi wants to merge 29 commits intoTreeFallSound:pistomp-v3from
Conversation
Account for blit elapsed time when computing SPI sleep deficit, and skip sleeps below macOS's ~1 ms timer granularity. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
# Conflicts: # pyproject.toml # uv.lock
# Conflicts: # uilib/lcd_ili9341.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pi-stomp Emulator
Run locally against a MOD Desktop instance.
Requires MOD Desktop running at
http://127.0.0.1:18181/.Hardware versions
emulator_v3EmulatorModhandler+EmulatorHardwareV3emulator_v2EmulatorModhandler+EmulatorHardwareV2emulator_v1EmulatorMod+EmulatorHardwareV1Key classes
EmulatorHardwareBaseemulator/hardware_base.pyEmulatorHardwareV1/V2/V3emulator/hardware_v*.pyEmulatorModhandleremulator/modhandler.pyModhandlersubclass — ownsVirtualAudiocard,StubWifiManager,StubRelay; drives render loopEmulatorModemulator/mod.pyModsubclassEmulatorWindowemulator/window.pyLcdPygameemulator/lcd_pygame.pyLcdBaseimplementation — receives PIL frames, blits to pygameSurfaceVirtualAudiocardemulator/stubs.pyStubWifiManageremulator/stubs.pyRender loop
poll_controlsruns every ~10 ms:EmulatorWindow.process_events()— drains pygame events, fires hardware callbackssuper().poll_controls()— polls encoders/footswitcheslcd.poll_updates()— flushes dirty PIL→pygame blitEmulatorWindow.render()— scales LCD surface and blits to screenNotes
pygame._freetypeC extension directly we can get around it*
lilvis installed outside the venv, so there's arun_emulator.shshim that uses pkg-config / Homebrew to find the prefix and exportsDYLD_LIBRARY_PATH/PYTHONPATHfor itemulator/__init__.pypatchesImageFont.truetypeto resolve bare names fromfonts/time.sleepbased on the number of pixels blittedImages