Giter VIP home page Giter VIP logo

trowel's Introduction

Trowel

This is a sister project to the spade Sprig engine. It is a Sprig firmware implementation in rust.

Install rust

Follow these instructions to install rust on your computer.

Setup rust for cross platform development

$ rustup target add thumbv6m-none-eabi
$ cargo install cargo-binutils
$ rustup component add llvm-tools-preview
$ cargo install elf2uf2-rs
$ cargo install probe-run
$ cargo install flip-link

Ancillary Dependencies

For the most part cargo will handle all the dependencies. However, the rust sdl2 crate does require SDL2 to be installed for the PC simulator. Follow these instructions for your operating system to install SDL2.

Simulate on your PC

maze on the pc simulator

cargo run --example maze

Run on your sprig

maze on the sprig

cargo run --example maze --target thumbv6m-none-eabi

Examples

  • hello_world
  • maze
  • draw_ferris
cargo run --example $example

Runty8 Examples

Runty8 is a pico-8 clone in rust. Trowel has an adapter so any runty8 games can run on the Sprig.

  • bresenham
  • moving-box
  • celeste (!!!)
cargo run --example $example --features runty8 

Celeste on the pc simulator

Notes

See the .cargo/config.toml for various build and run settings. You can generate uf2 files, write directly to the sprig if it's in BOOTSEL mode, or you can use a debug probe.

TODOs

"The framerate is not great on this. But it's the tip of the iceberg. There's a ton that can be done to improve it. The screen is the big bottleneck, we can get maybe 10 or 20 fps redrawing the whole thing. But the screen also remembers everything, so if you don't draw to a part of it, you don't need to update it. So if we buffered the output with two framebuffers, we can check them for differences. Pretend we had only a 1-bit display, then we could XOR our buffers, that'd give us a table of all the pixels that would need to change. One could also double the framerate by interlacing, update odd and even rows or columns every other frame. So some neat opportunities there to make it more performant."

Runty8 TODOs

  • Add a runty8 adapter
  • Make examples run: bresenham, moving-box.
  • Make celeste run (!!!).
  • Add binary serialization support.
  • Don't make copies upon binary deserialization. (Memory is precious here.)
  • Add a mouse simulator mode.
  • Make carts load-able.

Advanced: Setup probe

If you have an extra pico, you can set one up as a debug probe. It is super useful. You can run your code through the debugger. You'll get stacktraces and panic messages when your code fails.

Requirements

  • sprig
  • extra pico
  • breadboard
  • wires

Load probe firmware

The probe needs to have this uf2 installed.

Wire the probe to the target sprig

See this page and the Getting Started Guide for more information.

Change to use probe-run

Once you have that setup, you can change your runner in the .cargo/config.toml file.

runner = "probe-run --chip RP2040"

Troubleshooting debug probe

Once your debug probe has been flashed and it's plugged in, see if probe-run can find it.

$ probe-run --list-probes
the following probes were found:
[0]: Picoprobe CMSIS-DAP (VID: 2e8a, PID: 000c, Serial: E66164084367642A, CmsisDap)

Acknowledgments

trowel's People

Contributors

shanecelis avatar

Stargazers

 avatar  avatar

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.