add 3D voxels game
[microwatt.git] / rust_voxels_game / README.md
1 # 3D Voxels Game
2
3 # Tools you'll need:
4
5 Install Rust using [`rustup`](https://rustup.rs/).
6
7 Then run:
8 ```bash
9 rustup default nightly
10 rustup target add powerpc64le-unknown-linux-gnu
11 rustup component add rust-src
12 cargo install xargo
13 ```
14
15 # Run without FPGA/hardware-simulation
16
17 Resize your terminal to be at least 100x76.
18
19 Building:
20 ```bash
21 cd rust_voxels_game
22 cargo build
23 ```
24
25 Running:
26 ```bash
27 cd rust_voxels_game
28 cargo run
29 ```
30
31 # Run on OrangeCrab v0.2.1
32
33 Set the OrangeCrab into firmware upload mode by plugging it in to USB while the button is pressed, then run the following commands:
34
35 Building/Flashing:
36 ```bash
37 make -C rust_voxels_game
38 sudo make FPGA_TARGET=ORANGE-CRAB-0.21 dfuprog DOCKER=1 LITEDRAM_GHDL_ARG=-gUSE_LITEDRAM=false RAM_INIT_FILE=rust_voxels_game/rust_voxels_game.hex MEMORY_SIZE=$((3<<16))
39 ```
40
41 Connect a 3.3v USB serial adaptor to the OrangeCrab's TX/RX pins:
42
43 pins going from the corner closest to the button:
44
45 | Silkscreen Label | Purpose | Connect to on serial adaptor |
46 |------------------|---------|------------------------------|
47 | GND | Ground | Ground |
48 | 1 | UART RX | TX |
49 | 2 | UART TX | RX |
50
51 Then, in a separate terminal that you've resized to be at least 100x76, run
52 (replacing ttyUSB0 with whatever serial device the OrangeCrab is connected to):
53 ```bash
54 sudo tio --baudrate=1000000 /dev/ttyUSB0
55 ```