Skip to content

Instantly share code, notes, and snippets.

View jaames's full-sized avatar
🐳
~

James jaames

🐳
~
  • UK, '97
  • 20:01 (UTC +01:00)
View GitHub Profile
@jaames
jaames / PdvParser.ts
Last active July 6, 2022 20:33
Basic Playdate .PDV video format parser in Typescript (doesn't handle frame type 3 yet)
import { unzlibSync } from 'fflate';
function assert(condition: boolean, errMsg: string = 'Assert failed'): asserts condition {
if (!condition) {
console.trace(errMsg);
throw new Error(errMsg);
}
}
function readChars(data: DataView, ptr: number, size?: number) {
@jaames
jaames / colors-beta-guide.md
Last active May 25, 2022 22:58
Colors Live Windows beta guide

Troubleshooting

Missing MSVCP140.dll or VCRUNTIME140.dll errors

If you get a message warning you about missing DLLs MSVCP140.dll or VCRUNTIME140.dll when starting the app, you will need to install vc_redist.x64.exe from this page: https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

Missing dcomp.dll

This will show up if you try running Colors Live on an older version of Windows. Windows 10 is the only version currently supported, however support for older versions may be added eventually.

@jaames
jaames / playdate_season_1.md
Created May 23, 2022 18:11
Playdate Season 1 game bundle IDs. Enjoy :)
com.panic.b360
com.tpmcosoft.battleship
com.a-m.beats-bleeps-boogie
com.radstronomical.CasualBirder
com.uvula.crankin
com.crookedpark.demonquest85
com.samanthazero.echoicmemory
com.davemakes.execgolf
com.serenityforge.elevator
@jaames
jaames / baba-api.md
Last active May 22, 2022 10:20
Baba Is You level editor API details

API

The API base URL is https://8778eno8ha.execute-api.eu-central-1.amazonaws.com

GET /prod/list_levels2

Returns the asset URL, the number of total pages in this list, and a list of level details

URL params

@jaames
jaames / fancy-css-links.md
Last active April 13, 2022 09:20
Fancy CSS link underlines with inline SVGs (plus embedded animations!)
@jaames
jaames / playdate_adpcm.c
Last active April 2, 2022 23:07
Example for decoding and playing an ADPCM audio buffer on the Playdate in C, only supports mono IMA-ADPCM with no blocks!
// adpcm.h
#define CLAMP(n, l, h) \
if (n < l) n = l; \
if (n > h) n = h;
#define min(a,b) (((a) < (b)) ? (a) : (b))
static const int8_t indexTable[8] =
{ -1, -1, -1, -1, 2, 4, 6, 8 };

version: 0.10.2 md5: 2e80ff35027fc4a72e9dcd9e8b15a27b

version: 1.7.0 md5: 4156d02939ebfd3929b53dcc61d69cd1

version: 1.9.1-beta.1 md5: 2dbef3db9a98239079c47dd1a4dc8867

@jaames
jaames / playdate-disk.py
Last active March 2, 2022 10:32
Puts a USB-connected Playdate into disk mode - workaround for the Simulator not recognising that a Playdate is connected in macOS Monterey
# playdate-disk.py
# Puts a USB-connected Playdate into disk mode
# requires Python 3 and pyUSB (pip install pyusb)
# python3 playdate-disk.py
import usb.core
import usb.util
# Playdate USB vendor and product IDs
PLAYDATE_VID = 0x1331;
@jaames
jaames / client_ca.pem
Created August 26, 2021 19:59
Playdate's client_ca.pem from the ESP flash. Dumped by doing `esp AT+SYSFLASH=2,"client_ca",0,0x2000` over USB.
-----BEGIN CERTIFICATE-----
MIIGEzCCA/ugAwIBAgIQfVtRJrR2uhHbdBYLvFMNpzANBgkqhkiG9w0BAQwFADCB
iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl
cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV
BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTgx
MTAyMDAwMDAwWhcNMzAxMjMxMjM1OTU5WjCBjzELMAkGA1UEBhMCR0IxGzAZBgNV
BAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEYMBYGA1UE
ChMPU2VjdGlnbyBMaW1pdGVkMTcwNQYDVQQDEy5TZWN0aWdvIFJTQSBEb21haW4g
VmFsaWRhdGlvbiBTZWN1cmUgU2VydmVyIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC
AQ8AMIIBCgKCAQEA1nMz1tc8INAA0hdFuNY+B6I/x0HuMjDJsGz99J/LEpgPLT+N
@jaames
jaames / ppm.lua
Last active December 8, 2021 00:40
Flipnote PPM parser made in Lua, for the Playdate. It's horrendously slow, so maybe don't use this, it's only preserved lest future generations repeat the same mistakes
import 'CoreLibs/object'
import 'CoreLibs/graphics'
-- Flipnote Studio (DSiWare version) animation parser
-- Format reference:
-- https://github.com/Flipnote-Collective/flipnote-studio-docs/wiki/PPM-format
class("PpmParser").extends()
local gfx <const> = playdate.graphics