diff --git a/.gitignore b/.gitignore index dc220e8..8d077ce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /target /.vscode -/Wrapper-Project/.pio -/Wrapper-Project/lib/*.a +arduboy-rust/Wrapper-Project/.pio +arduboy-rust/Wrapper-Project/lib/*.a +arduboy-rust/Wrapper-Project/build/*.hex diff --git a/Cargo.lock b/Cargo.lock index 2ff6046..0d8db40 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -45,14 +45,14 @@ dependencies = [ ] [[package]] -name = "eeprom-byte-demo" +name = "eeprom" version = "0.1.0" dependencies = [ "arduboy-rust", ] [[package]] -name = "eeprom-demo" +name = "eeprom-byte" version = "0.1.0" dependencies = [ "arduboy-rust", diff --git a/Examples/Arduboy-Tutorials/eeprom-byte/Cargo.toml b/Examples/Arduboy-Tutorials/eeprom-byte/Cargo.toml index 72b5f65..4ae8c5f 100644 --- a/Examples/Arduboy-Tutorials/eeprom-byte/Cargo.toml +++ b/Examples/Arduboy-Tutorials/eeprom-byte/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "eeprom-byte-demo" +name = "eeprom-byte" version = "0.1.0" authors = ["ZennDev "] license = "MIT OR Apache-2.0" diff --git a/Examples/Arduboy-Tutorials/eeprom/Cargo.toml b/Examples/Arduboy-Tutorials/eeprom/Cargo.toml index 72e75a3..89d2b0a 100644 --- a/Examples/Arduboy-Tutorials/eeprom/Cargo.toml +++ b/Examples/Arduboy-Tutorials/eeprom/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "eeprom-demo" +name = "eeprom" version = "0.1.0" authors = ["ZennDev "] license = "MIT OR Apache-2.0" diff --git a/README.md b/README.md index 9e55c51..3b93274 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ requirements: - The Arduboy must be plugged in - You are in the root directory of this project -All builded `.hex` files are saved inside of `Wrapper-Project/.pio/build/.hex` after you uploaded them to the Arduboy. +All builded `.hex` files are saved inside of `arduboy-rust/Wrapper-Project/build/.hex` after you uploaded them to the Arduboy. To upload your own game to the Arduboy use: @@ -158,6 +158,7 @@ Linux: ./run demo5 ./run demo6 ./run eeprom +./run eeprom-byte ./run progmem ./run tone ``` @@ -171,6 +172,7 @@ Windows: .\run.bat demo5 .\run.bat demo6 .\run.bat eeprom +.\run.bat eeprom-byte .\run.bat progmem .\run.bat tone ``` diff --git a/arduboy-rust/Wrapper-Project/build/.gitkeep b/arduboy-rust/Wrapper-Project/build/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Wrapper-Project/include/README b/arduboy-rust/Wrapper-Project/include/README similarity index 100% rename from Wrapper-Project/include/README rename to arduboy-rust/Wrapper-Project/include/README diff --git a/Wrapper-Project/lib/README b/arduboy-rust/Wrapper-Project/lib/README similarity index 100% rename from Wrapper-Project/lib/README rename to arduboy-rust/Wrapper-Project/lib/README diff --git a/Wrapper-Project/platformio.ini b/arduboy-rust/Wrapper-Project/platformio.ini similarity index 100% rename from Wrapper-Project/platformio.ini rename to arduboy-rust/Wrapper-Project/platformio.ini diff --git a/Wrapper-Project/src/library/arduboy/arduboy_export.h b/arduboy-rust/Wrapper-Project/src/library/arduboy/arduboy_export.h similarity index 100% rename from Wrapper-Project/src/library/arduboy/arduboy_export.h rename to arduboy-rust/Wrapper-Project/src/library/arduboy/arduboy_export.h diff --git a/Wrapper-Project/src/library/arduboy/arduboy_tones_export.h b/arduboy-rust/Wrapper-Project/src/library/arduboy/arduboy_tones_export.h similarity index 100% rename from Wrapper-Project/src/library/arduboy/arduboy_tones_export.h rename to arduboy-rust/Wrapper-Project/src/library/arduboy/arduboy_tones_export.h diff --git a/Wrapper-Project/src/library/arduboy/sprites_export.h b/arduboy-rust/Wrapper-Project/src/library/arduboy/sprites_export.h similarity index 100% rename from Wrapper-Project/src/library/arduboy/sprites_export.h rename to arduboy-rust/Wrapper-Project/src/library/arduboy/sprites_export.h diff --git a/Wrapper-Project/src/library/arduino/arduino_export.h b/arduboy-rust/Wrapper-Project/src/library/arduino/arduino_export.h similarity index 100% rename from Wrapper-Project/src/library/arduino/arduino_export.h rename to arduboy-rust/Wrapper-Project/src/library/arduino/arduino_export.h diff --git a/Wrapper-Project/src/library/arduino/eeprom_export.h b/arduboy-rust/Wrapper-Project/src/library/arduino/eeprom_export.h similarity index 100% rename from Wrapper-Project/src/library/arduino/eeprom_export.h rename to arduboy-rust/Wrapper-Project/src/library/arduino/eeprom_export.h diff --git a/Wrapper-Project/src/main.cpp b/arduboy-rust/Wrapper-Project/src/main.cpp similarity index 100% rename from Wrapper-Project/src/main.cpp rename to arduboy-rust/Wrapper-Project/src/main.cpp diff --git a/Wrapper-Project/src/main.h b/arduboy-rust/Wrapper-Project/src/main.h similarity index 92% rename from Wrapper-Project/src/main.h rename to arduboy-rust/Wrapper-Project/src/main.h index 617c358..5705b1e 100644 --- a/Wrapper-Project/src/main.h +++ b/arduboy-rust/Wrapper-Project/src/main.h @@ -1,6 +1,6 @@ #pragma once -#include "../../import_config.h" +#include "../../../import_config.h" #if defined(Arduboy2_Library) #include diff --git a/Wrapper-Project/test/README b/arduboy-rust/Wrapper-Project/test/README similarity index 100% rename from Wrapper-Project/test/README rename to arduboy-rust/Wrapper-Project/test/README diff --git a/run b/run index 5f26d90..0c90c6c 100755 --- a/run +++ b/run @@ -19,10 +19,10 @@ then cargo build -p tone --release && cp ./target/arduboy/release/libtone.a ./Wrapper-Project/lib/libgame.a && cd Wrapper-Project/ && pio run -v -t upload && cp ./.pio/build/arduboy/firmware.hex ./.pio/build/tone.hex && pio run -t clean && rm lib/libgame.a && cd .. elif [ "$option" = "eeprom" ] then - cargo build -p eeprom-demo --release && cp ./target/arduboy/release/libeeprom_demo.a ./Wrapper-Project/lib/libgame.a && cd Wrapper-Project/ && pio run -v -t upload && cp ./.pio/build/arduboy/firmware.hex ./.pio/build/eeprom.hex && pio run -t clean && rm lib/libgame.a && cd .. + cargo build -p eeprom --release && cp ./target/arduboy/release/libeeprom.a ./Wrapper-Project/lib/libgame.a && cd Wrapper-Project/ && pio run -v -t upload && cp ./.pio/build/arduboy/firmware.hex ./.pio/build/eeprom.hex && pio run -t clean && rm lib/libgame.a && cd .. elif [ "$option" = "eeprom-byte" ] then - cargo build -p eeprom-byte-demo --release && cp ./target/arduboy/release/libeeprom_byte_demo.a ./Wrapper-Project/lib/libgame.a && cd Wrapper-Project/ && pio run -v -t upload && cp ./.pio/build/arduboy/firmware.hex ./.pio/build/eeprom-byte.hex && pio run -t clean && rm lib/libgame.a && cd .. + cargo build -p eeprom-byte --release && cp ./target/arduboy/release/libeeprom_byte.a ./Wrapper-Project/lib/libgame.a && cd Wrapper-Project/ && pio run -v -t upload && cp ./.pio/build/arduboy/firmware.hex ./.pio/build/eeprom-byte.hex && pio run -t clean && rm lib/libgame.a && cd .. elif [ "$option" = "progmem" ] then cargo build -p progmem --release && cp ./target/arduboy/release/libprogmem.a ./Wrapper-Project/lib/libgame.a && cd Wrapper-Project/ && pio run -v -t upload && cp ./.pio/build/arduboy/firmware.hex ./.pio/build/progmem.hex && pio run -t clean && rm lib/libgame.a && cd .. diff --git a/run.bat b/run.bat index 894716e..a36797a 100644 --- a/run.bat +++ b/run.bat @@ -3,47 +3,43 @@ set option=%1 if [%option%]==[] ( - powershell -Command "cargo build -p game --release; cp ./target/arduboy/release/libgame.a ./Wrapper-Project/lib/libgame.a; cd Wrapper-Project/; pio run -v -t upload; cp ./.pio/build/arduboy/firmware.hex ./.pio/build/game.hex; pio run -t clean; rm lib/libgame.a; cd .." + powershell -Command "cargo build -p game --release; cp ./target/arduboy/release/libgame.a ./arduboy-rust/Wrapper-Project/lib/libgame.a; cd arduboy-rust/Wrapper-Project/; pio run -v -t upload; cp ./.pio/build/arduboy/firmware.hex ./build/game.hex; pio run -t clean; rm lib/libgame.a; cd ../../" goto :eof ) if %option%==snake ( - powershell -Command "cargo build -p snake --release; cp ./target/arduboy/release/libsnake.a ./Wrapper-Project/lib/libgame.a; cd Wrapper-Project/; pio run -v -t upload; cp ./.pio/build/arduboy/firmware.hex ./.pio/build/snake.hex; pio run -t clean; rm lib/libgame.a; cd .." - goto :eof + goto :run ) else if %option%==pong ( - powershell -Command "cargo build -p pong --release; cp ./target/arduboy/release/libpong.a ./Wrapper-Project/lib/libgame.a; cd Wrapper-Project/; pio run -v -t upload; cp ./.pio/build/arduboy/firmware.hex ./.pio/build/pong.hex; pio run -t clean; rm lib/libgame.a; cd .." - goto :eof + goto :run ) else if %option%==rustacean ( - powershell -Command "cargo build -p rustacean --release; cp ./target/arduboy/release/librustacean.a ./Wrapper-Project/lib/libgame.a; cd Wrapper-Project/; cp ./.pio/build/arduboy/firmware.hex ./.pio/build/rustacean.hex; pio run -v -t upload; pio run -t clean; rm lib/libgame.a; cd .." - goto :eof + goto :run ) else if %option%==tone ( - powershell -Command "cargo build -p tone --release; cp ./target/arduboy/release/libtone.a ./Wrapper-Project/lib/libgame.a; cd Wrapper-Project/; pio run -v -t upload; cp ./.pio/build/arduboy/firmware.hex ./.pio/build/tone.hex; pio run -t clean; rm lib/libgame.a; cd .." - goto :eof + goto :run ) else if %option%==eeprom ( - powershell -Command "cargo build -p eeprom-demo --release; cp ./target/arduboy/release/libeeprom_demo.a ./Wrapper-Project/lib/libgame.a; cd Wrapper-Project/; pio run -v -t upload; cp ./.pio/build/arduboy/firmware.hex ./.pio/build/eeprom.hex; pio run -t clean; rm lib/libgame.a; cd .." - goto :eof + goto :run ) else if %option%==eeprom-byte ( - powershell -Command "cargo build -p eeprom-byte-demo --release; cp ./target/arduboy/release/libeeprom_byte_demo.a ./Wrapper-Project/lib/libgame.a; cd Wrapper-Project/; pio run -v -t upload; cp ./.pio/build/arduboy/firmware.hex ./.pio/build/eeprom-byte.hex; pio run -t clean; rm lib/libgame.a; cd .." - goto :eof + powershell -Command "cargo build -p %option% --release; cp ./target/arduboy/release/libeeprom_byte.a ./arduboy-rust/Wrapper-Project/lib/libgame.a; cd arduboy-rust/Wrapper-Project/; pio run -v -t upload; cp ./.pio/build/arduboy/firmware.hex ./build/%option%.hex; pio run -t clean; rm lib/libgame.a; cd ../../" +goto :eof ) else if %option%==progmem ( - powershell -Command "cargo build -p progmem --release; cp ./target/arduboy/release/libprogmem.a ./Wrapper-Project/lib/libgame.a; cd Wrapper-Project/; pio run -v -t upload; cp ./.pio/build/arduboy/firmware.hex ./.pio/build/progmem.hex; pio run -t clean; rm lib/libgame.a; cd .." - goto :eof + goto :run ) else if %option%==demo2 ( - powershell -Command "cargo build -p demo2 --release; cp ./target/arduboy/release/libdemo2.a ./Wrapper-Project/lib/libgame.a; cd Wrapper-Project/; pio run -v -t upload; cp ./.pio/build/arduboy/firmware.hex ./.pio/build/demo2.hex; pio run -t clean; rm lib/libgame.a; cd .." - goto :eof + goto :run ) else if %option%==demo3 ( - powershell -Command "cargo build -p demo3 --release; cp ./target/arduboy/release/libdemo3.a ./Wrapper-Project/lib/libgame.a; cd Wrapper-Project/; pio run -v -t upload; cp ./.pio/build/arduboy/firmware.hex ./.pio/build/demo3.hex; pio run -t clean; rm lib/libgame.a; cd .." - goto :eof + goto :run ) else if %option%==demo4 ( - powershell -Command "cargo build -p demo4 --release; cp ./target/arduboy/release/libdemo4.a ./Wrapper-Project/lib/libgame.a; cd Wrapper-Project/; pio run -v -t upload; cp ./.pio/build/arduboy/firmware.hex ./.pio/build/demo4.hex; pio run -t clean; rm lib/libgame.a; cd .." - goto :eof + goto :run ) else if %option%==demo5 ( - powershell -Command "cargo build -p demo5 --release; cp ./target/arduboy/release/libdemo5.a ./Wrapper-Project/lib/libgame.a; cd Wrapper-Project/; pio run -v -t upload; cp ./.pio/build/arduboy/firmware.hex ./.pio/build/demo5.hex; pio run -t clean; rm lib/libgame.a; cd .." - goto :eof + goto :run ) else if %option%==demo6 ( - powershell -Command "cargo build -p demo6 --release; cp ./target/arduboy/release/libdemo6.a ./Wrapper-Project/lib/libgame.a; cd Wrapper-Project/; pio run -v -t upload; cp ./.pio/build/arduboy/firmware.hex ./.pio/build/demo6.hex; pio run -t clean; rm lib/libgame.a; cd .." - goto :eof + goto :run +) else ( + goto :help ) +:run +powershell -Command "cargo build -p %option% --release; cp ./target/arduboy/release/lib%option%.a ./arduboy-rust/Wrapper-Project/lib/libgame.a; cd arduboy-rust/Wrapper-Project/; pio run -v -t upload; cp ./.pio/build/arduboy/firmware.hex ./build/%option%.hex; pio run -t clean; rm lib/libgame.a; cd ../../" +goto :eof + +:help @echo Usage: .\run.bat // for uploading your game @echo Usage: .\run.bat ^ // for uploading an example game \ No newline at end of file