diff --git a/Makefile b/Makefile index 017e13b5..577946eb 100644 --- a/Makefile +++ b/Makefile @@ -103,7 +103,7 @@ include mk/external.mk # Non-trivial demonstration programs ifeq ("$(ENABLE_SDL)", "1") -demo: $(BIN) $(DOOM_DATA) +doom: $(BIN) $(DOOM_DATA) (cd $(OUT); ../$(BIN) doom.elf) ifeq ("$(ENABLE_RV32F)", "1") quake: $(BIN) $(QUAKE_DATA) diff --git a/README.md b/README.md index f0a9f00d..0652e8b1 100644 --- a/README.md +++ b/README.md @@ -22,11 +22,17 @@ make check Run [Doom](https://en.wikipedia.org/wiki/Doom_(1993_video_game)), the classical video game, via `rv32emu`: ```shell -make demo +make doom ``` -The build script will then download data file for Doom automatically. SDL2 based window -should appear when Doom is loaded and executed. +The build script will then download data file for Doom automatically. SDL2 based window should appear when Doom is loaded and executed. + +If RV32F support is enabled (turned on by default), [Quake](https://en.wikipedia.org/wiki/Quake_(series)) demo program can be launched via: +```shell +make quake +``` + +The usage and limitations of Doom and Quake demo are listed in [docs/demo.md](docs/demo.md). ## riscv-arch-test diff --git a/build/quake.elf b/build/quake.elf old mode 100644 new mode 100755 index e610d5d7..fa0cc132 Binary files a/build/quake.elf and b/build/quake.elf differ diff --git a/docs/demo.md b/docs/demo.md new file mode 100644 index 00000000..d3a089ae --- /dev/null +++ b/docs/demo.md @@ -0,0 +1,48 @@ +# Demos + +## Doom +**source**: [doom_riscv](https://github.com/smunaut/doom_riscv) + +**commmad**: `make doom` + +[Doom](https://en.wikipedia.org/wiki/Doom_(franchise)), a pioneering first-person shooter game developed by [id Software](https://en.wikipedia.org/wiki/Id_Software) in 1993, is known for its open-source code and vibrant community, it debuted innovations like genuine 3D graphics, networked multiplayer gameplay and the ability for players to create custom expansions. + +![Doom Gameplay](https://imgur.com/bLc5LG8.gif) + +### Limitations +* The input system is not supported yet + +## Quake +**source**: [quake-embedded](https://github.com/sysprog21/quake-embedded/) + +**command**: `make quake` + +[Quake](https://en.wikipedia.org/wiki/Quake_(series)) was created in 1996 as a successor of the highly succcessful first-person shooter game Doom, it is based on Doom's game engine and 3D graphics compability, and it enhanced the fast-paced gameplay and online multiplayer over the Internet. + +[quake-embedded](https://github.com/sysprog21/quake-embedded/) is an embedded RISC-V port of Quake based on [QuakEMBD](https://github.com/FantomJAC/quakembd). + +Build Instruction: +```shell +git clone https://github.com/sysprog21/quake-embedded.git && cd quake-embedded +mkdir build && cd build +cmake -DCMAKE_TOOLCHAIN_FILE=../port/boards/rv32emu/toolchain.cmake \ + -DCMAKE_BUILD_TYPE=RELEASE -DBOARD_NAME=rv32emu .. +make +``` + +![Quake Gameplay](https://imgur.com/gXKb7D0.gif) + +### Default Key Bindings +* Move Forward/Backward: Up Arrow Key/Down Arrow Key +* Move Left/Right: Comma(,) Key/Period(.) Key +* Turn Left/Right: Left Arrow Key/Right Arrow Key +* Swim Up/Down: D Key/C Key +* Shoot: Left Mouse Button or CTRL Key +* Switch Weapon: Slash(/) Key +* Sprint: Shift Key + +You may use the mouse to adjust the pitch and yaw angle + +### Limitations +* Mouse wheel input is not supported +* All sound functions are not implemented