Giter VIP home page Giter VIP logo

playdate-reverse-engineering's Introduction

Unofficial Playdate reverse-engineering notes/tools - covers file formats, server API and USB serial commands

⚠️ This documentation is unofficial and is not affiliated with Panic. All of the content herein was gleaned from reverse-engineering Playdate tools and game files, and as such there may be mistakes or missing information.

Documentation

  • File Formats
    • Playdate game formats
    • Other formats
      • .fnt - Font source file
      • .strings - Strings source file (TODO)
  • Server
  • Misc
    • USB - USB serial interface
    • Streaming - Video/audio streaming protocol (via USB serial), used by Playdate Mirror

Tools

  • pdz.py - Unpacks all files from a .pdz file container
  • pdex2elf.py - Converts a pdex.bin to an ELF file that can be analysed in a decompilation tool such as Ghidra
  • usbeval.py - Uses the Playdate's USB eval command to evaluate a Lua script over USB. Has access to the Lua runtime of the currently loaded game, except for system apps.

Related Projects and Resources

  • pd-usb - JavaScript library for interacting with the Playdate's serial API from a WebUSB-compatible web browser.
  • unluac - Fork of the unluac Lua decompiler, modified to support Playdate-flavoured Lua.
  • lua54 - Fork of Lua that aims to match the custom tweaks that Panic added for Playdate-flavoured Lua.

Special Thanks


2022-2023 James Daniel

Playdate is © Panic Inc. - this project isn't affiliated with or endorsed by them in any way.

playdate-reverse-engineering's People

Contributors

alandesmet avatar ericlewis avatar jaames avatar notpeter avatar scratchminer avatar zhuowei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

playdate-reverse-engineering's Issues

pdz.py doesn't work on the main.pdz from settings

i tried using pdz.py on the main.pdz file found in settings, but i got this error.

Traceback (most recent call last):
File "C:\Users\user\Documents\reverse-playdate\pdz.py", line 114, in
pdz.save_entries(argv[2])
File "C:\Users\user\Documents\reverse-playdate\pdz.py", line 101, in save_entries
self.save_entry_data(name, outdir)
File "C:\Users\user\Documents\reverse-playdate\pdz.py", line 92, in save_entry_data
data = self.get_entry_data(name)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\Documents\reverse-playdate\pdz.py", line 86, in get_entry_data
return decompress(entry['data'])
^^^^^^^^^^^^^^^^^^^^^^^^^
zlib.error: Error -3 while decompressing data: incorrect header check

i did get this file from simulator and not real hardware, so that might be it.

API pagination?

The catalog API returns a consistent 50 results, so I suspect there must be a way to go to the next page of results. I tried a couple likely options with no luck. If you have any clues in that direction, I'd appreciate it.

Tools: Scripts for other formats

I am planning on adding more scripts for working with the various formats you can find in a Playdate game:

  • pdv converter - convert gif sequences to and from the pdv video format
  • pdi/pdt converter - convert images to and from the pdi/pdt image format
  • pda converter - convert audio to and from the pda format
  • pdz packing support - add the ability to repack files into a pdz to pdz.py

If anyone would like to help so this gets done faster, that would be appreciated!

Any tools to decompile .luac files?

Thanks for this list of tools!

Would you be able to recommend tools that work on macos and allow decompiling / disassembling of .luac files?

Thanks!

Unlock code mem address

The address for the serial unlock code seems to have changed, (const char*)0x1FF0F040 now throws an error.

If anyone could help me find the unlock code I'd be forever grateful, I really need full serial access for a hardware project I'm half way through.

PDX for dumping system lock key?

Hello, I was wondering if someone has made a tool that dumps the lock key as seen at the bottom of this page, I am not very familiar with C so any help would be appreciated!

Document non-obvious clip/no-alpha interaction

Having spent too long debugging this, I think the pdi/pdt documentation should add some notes on interpreting the cell header. Here's my immediate thoughts (feel free to use them if you think they're useful):

When compiling images, the Playdate software tries to eliminate borders that are entirely transparent. How many rows or columns were removed are the clip values. If the clipped image has no remaining transparent pixels, no alpha channel will be written at all.

As a result, an image with transparent pixels may not have an alpha channel. The pixels for which there is data are opaque. When the clipped borders are re-added, they are always transparent.

Help about an eventual API recreation

I want to recreate the playdate server API, but here's a thing; I don't have any /games/purchased/ or /games/system/ or /games/user/ API dump which isn't empty (just [])

If you can, can you provide a schema of the response given from /games/purchased/ or /games/system/ or /games/user/?

Investigate PFT font format

I haven't had a chance to properly look at this yet. It seems to be pretty similar to the imagetable format, but it wasn't obvious how each glyph is stored.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.