{"id":29615112,"url":"https://github.com/rtsuk/crankstart","last_synced_at":"2025-07-21T00:01:59.506Z","repository":{"id":39994117,"uuid":"273092647","full_name":"pd-rs/crankstart","owner":"pd-rs","description":"A barely functional, wildly incomplete and basically undocumented Rust crate whose aim is to let you write Games for the Playdate handheld gaming system in Rust.","archived":false,"fork":false,"pushed_at":"2025-04-05T15:41:45.000Z","size":330,"stargazers_count":247,"open_issues_count":16,"forks_count":25,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-07-14T02:45:44.142Z","etag":null,"topics":["game","panic","playdate","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pd-rs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-06-17T22:44:28.000Z","updated_at":"2025-07-09T18:08:15.000Z","dependencies_parsed_at":"2023-10-16T18:35:16.401Z","dependency_job_id":"641177bb-5753-44dc-a39d-2e2ddb3a98b1","html_url":"https://github.com/pd-rs/crankstart","commit_stats":{"total_commits":71,"total_committers":7,"mean_commits":"10.142857142857142","dds":"0.21126760563380287","last_synced_commit":"c5e8428bb7a962f7f31c282e5743e99d9328417e"},"previous_names":["rtsuk/crankstart"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pd-rs/crankstart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pd-rs%2Fcrankstart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pd-rs%2Fcrankstart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pd-rs%2Fcrankstart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pd-rs%2Fcrankstart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pd-rs","download_url":"https://codeload.github.com/pd-rs/crankstart/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pd-rs%2Fcrankstart/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266217170,"owners_count":23894242,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["game","panic","playdate","rust"],"created_at":"2025-07-21T00:01:32.822Z","updated_at":"2025-07-21T00:01:59.497Z","avatar_url":"https://github.com/pd-rs.png","language":"Rust","readme":"# Rust for Playdate\n\nYou've stumbled across a barely functional, wildly incomplete and basically undocumented Rust crate whose aim is to let you write games for the [Playdate handheld gaming system](https://play.date) in [Rust](https://www.rust-lang.org).\n\nThis software is not sponsored or supported by Panic.\n\n## Installation\n\nTo use this crate, you'll also need to install the [crank command line tool](https://github.com/rtsuk/crank).\n\nFrom the crankstart directory where you found this README,\n\n    crank run --release --example hello_world\n\nShould launch the simulator and load in the hello_world sample.\n\nIf you have a device attached to your desktop,\n\n    crank run --release --example hello_world --device\n\nShould launch the hello_world sample on the device.\n\nFor the sprite_game example one needs to copy the images folder from `\"PlaydateSDK/C_API/Examples/Sprite Game/Source/images\"` to `\"sprite_game_images\"`.\n\n## Your Own Project\n\nUsing this system for your own project requires some setup:\n\n1. Follow the setup for `crank` with Rust nightly's `no_std` support.\n2. Start a new rust library project with `cargo new --lib project_name`\n3. `git clone git@github.com:pd-rs/crankstart.git` at the same depth as your new project.\n4. Go into the new project, and add the following to your `Cargo.toml`:\n\n```toml\n[package.metadata.cargo-xbuild]\nmemcpy = false\nsysroot_path = \"target/sysroot\"\npanic_immediate_abort = false\n\n[profile.dev]\npanic = \"abort\"\nopt-level = 'z'\nlto = true\n\n[profile.release]\npanic = \"abort\"\nopt-level = 'z'\nlto = true\n\n[lib]\ncrate-type = [\"staticlib\", \"cdylib\"]\n\n[dependencies]\ncrankstart = { path = \"../crankstart\" }\ncrankstart-sys = { path = \"../crankstart/crankstart-sys\" }\nanyhow = { version = \"1.0.31\", default-features = false }\neuclid = { version = \"0.22.9\", default-features = false, features = [ \"libm\" ] }\nhashbrown = \"0.14.0\"\n\n[dependencies.cstr_core]\nversion = \"=0.1.2\"\ndefault-features = false\nfeatures = [ \"alloc\" ]\n```\n\n5. Add a `Crank.toml` at the same level as your `Cargo.toml`, with this minimum:\n\n```toml\n[[target]]\n    name = \"project_name\"\n    assets = [\n    ]\n```\n\n`assets` should be a list of paths to any/all assets you need copied into your project, such as sprites, music, etc.\n\n6. Inside your `lib.rs`, you only need to implement the `crankstart::Game` trait to your game's core state struct, then call `crankstart::crankstart_game!` on that struct. See the `examples` folder for examples.\n7. To run the project, from its root, you should now be able to `crank run` successfully!\n\nIf you want an example of an independent project following these conventions, go check out [Nine Lives](https://github.com/bravely/nine_lives).\n\n## Updating Bindings\n\nIf there's a newer [Playdate SDK](https://play.date/dev/) available that updates the C API, the crankstart bindings should be updated to match.\nHere's a guide.\n\n1. Install [the dependencies for bindgen](https://rust-lang.github.io/rust-bindgen/requirements.html).\n2. Install [bindgen-cli](https://rust-lang.github.io/rust-bindgen/command-line-usage.html).\n3. Install the gcc-arm-none-eabi toolchain, either [manually](https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain) or through a system package, which may also be named something like \"cross-arm-none-eabi-gcc\".\n4. On Linux, install the 32-bit glibc development package, which will be called something like `glibc-devel-32bit`.\n5. Install the new [Playdate SDK](https://play.date/dev/), and if it's not at the default MacOS path, set `PLAYDATE_SDK_PATH` to where you unzipped it.  (This should be the directory that contains `C_API`, `CoreLibs`, etc.)\n6. Run `./scripts/generate_bindings.sh`\n7. Inspect the changes to `crankstart-sys/src/bindings_*` - they should reflect the updates to the Playdate C API.  If nothing changed, double-check that the C API actually changed and not just the Lua API.\n8. Submit a PR with the changes :)\n","funding_links":[],"categories":["Game Development"],"sub_categories":["Programming Frameworks \u0026 Languages"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtsuk%2Fcrankstart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frtsuk%2Fcrankstart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtsuk%2Fcrankstart/lists"}