Simulator: Extend “Send Bitmap” to send screenshot to device

The Send Bitmap function in the simulator is very convenient for quickly testing what something looks like on the real device display. Even more convenient would be if there was a variant of it that would send a screenshot of the simulator to the device with one click, without having to save it as a file first. If that functionality already exists, I haven’t found it yet (Simulator 1.13.2 on macOS).

Or, even better, a way to continuously stream the simulator screen to the device display, kind of the opposite of what the Mirror application does.

2 Likes

Hey @CWalther , not sure if you're still interested in a solution, but I built exactly the tool you were describing: Playdate AntiMirror continuously streams any content from your desktop to your Playdate in real-time via USB. Fun twist: I was able to implement it as web app!

Very cool, thanks!

It seems a bit fiddly to use with the Simulator though, for two reasons:

  • It’s hard to get a pixel-perfect view of the simulator screen. I haven’t managed yet (with Chromium on macOS) when running the simulator at 1× display scale. When I capture a single window, I haven’t figured out yet what units W and H are. It seems to be neither framebuffer pixels (800×480) nor logical pixels (400×240), but something in between. Maybe Chromium applies some scaling before the data reaches your code. When I capture the whole screen, the dimensions seem to be alright when I choose 400×240, but still some pixels get the wrong color when using “Threshold”, with black areas bleeding into where white should be. I wonder if there is any undue interpolation going on. The only way that works is using “2x Display” in the Simulator, capturing the whole screen, and setting W = 800, H = 480.
  • The web app needs to be connected while the Simulator is not running yet, otherwise the Simulator occupies the serial port.

Thank you for the feedback!

I am not sure there’s much I can do about the order at which the browser and simulator have to access the USB device. But I have ideas how to make this more accessible via in-app documentation.

As far as the “bleeding” is concerned, I suspect that this is a result of macOS “retina displays”. It occurs to me that I only ever used the screen capture on my external screens with 1:1 pixel ratio. I might be able to reproduce it myself, but if you can: I’d greatly appreciate a screenshot of your simulator window to test against, @CWalther