Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playdate support? #484

Open
jverkoey opened this issue Aug 7, 2022 · 10 comments
Open

Playdate support? #484

jverkoey opened this issue Aug 7, 2022 · 10 comments

Comments

@jverkoey
Copy link
Contributor

jverkoey commented Aug 7, 2022

There's a few Gameboy emulators for Playdate already. May be a fun challenge to get SameBoy working on the Playdate hardware given that the maximum frame rate is 50 fps. Some of the other specs:

  • 16 MB RAM32 KB L1 Cache
  • 4GB flash storage
  • A crank!
  • A/B buttons + d-pad
  • 1-bit monochrome display @ 400 x 240 pixel resolution — this will make dithering / scaling a bit tricky.
  • 168 MHz Cortex M7

https://sdk.play.date/1.12.2/Inside%20Playdate%20with%20C.html

I've got the Playdate SDK + simulator set up, so for funzies I'm going to take a stab at getting SameBoy compiling on top of their SDK :) Unfortunately I won't be getting any hardware until likely next year given the backlog, so assuming this is actually feasible we may need to find some folks with access to hardware to test performance characteristics.

@jverkoey
Copy link
Contributor Author

jverkoey commented Aug 7, 2022

Will use this post to catalog existing emulators:

  • Playboy, source, written in Rust. So far seems to have significant performance issues
  • Peanut-GB, source, written in C. Similarly has performance issues: "but most games still only run at 20-30 fps".
  • gamekid. Performance issues: "FPS is not yet where we want it to be but it'll get there in time"

@jverkoey
Copy link
Contributor Author

jverkoey commented Aug 7, 2022

And will use this post to collect performance-related threads and details:

@jverkoey
Copy link
Contributor Author

jverkoey commented Aug 7, 2022

@jverkoey
Copy link
Contributor Author

jverkoey commented Aug 8, 2022

Got SameBoy rendering on Playdate :D

pokemon-red.mov

No input or audio yet. Going to take a stab at audio first.

@jverkoey
Copy link
Contributor Author

jverkoey commented Aug 8, 2022

And now with audio!

Screen.Recording.2022-08-07.at.11.18.15.PM.mov

@jverkoey
Copy link
Contributor Author

jverkoey commented Aug 8, 2022

Note for anyone trying out the Playdate branch locally, here's the basic setup instructions.

First, get the Playdate SDK: https://play.date/dev/

and also the rgbds binaries: brew install rgbds

Once that's installed, you should be able to get the simulator build up-and-running like so:

git clone https://github.com/jverkoey/SameBoy.git
cd SameBoy
git checkout playdate
open Playdate/roms

You'll then need to add a ROM into that directory and name it test.gb; there's no loader implemented yet so it's all hard-coded.

open Playdate/Playdate.xcodeproj

Select the Playdate target.

Hit build. This should, in theory, succeed :)

Assuming it does, you'll need to update the hard-coded location of the Playdate emulator. Do this by:

  1. Cmd+Shift+, to open the scheme manager.
  2. Make sure that the Playdate scheme is selected.
  3. Click the Run configuration.
  4. Click the Info tab.
  5. Where it says Executable, select "Other..." and open the Playdate simulator application found within ~/Developer/PlaydateSDK/bin

You should now be able to run and debug from within the Playdate emulator :)

@jverkoey
Copy link
Contributor Author

jverkoey commented Aug 8, 2022

Input working :D

input.mov

@Smileyspencer
Copy link

@jverkoey the videos are not rendering properly for me, and I'm not able to try out your branch quite yet. Is the performance you're getting better than the existing emulators? I'd been thinking about running some kind of branch like this myself 😂

@jverkoey
Copy link
Contributor Author

jverkoey commented Aug 8, 2022

https://twitter.com/featherless/status/1556488811584143360?s=21&t=QZXQfJoU-Z8tZUJXLqa0dw might work better on Twitter?

Haven't tested performance of other emulators yet! No hardware yet unfortunately so any testing I can do is not super trustworthy :(

@Smileyspencer
Copy link

The performance looks quite a bit better at least from the video. I'll be interested to try this out. I do have hardware, but I'm largely unfamiliar with emulation so if I did take a stab at it I'm not sure it would've worked anyways 😄. If you need someone to test something on hardware I'd be happy to help, provided you're okay with some handholding.

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

No branches or pull requests

2 participants