Skip to content

How to run emulator mode

Aleksei Dynda edited this page Aug 28, 2019 · 1 revision

HOW to run emulator mode

The library supports OLED/LCD emulation mode, so you can check your code prior to running it on real hardware. At present only Linux OS and MinGW32 are supported, but you're welcome to add true Windows OS support. Please remember: since emulation runs on HOST OS, the code will be compiled with host gcc/g++ compiler.

Arkanoid

Emulator core

There is a library located at lcdgfx/tools/sdl_core, which implements OLED display emulation. The library code is easy, and you can add support you need directly to this library.

Preparing environment for Linux

Emulator needs SDL2 library installed:

sudo apt-get install libsdl2-dev

Compiling example and running emulation in Linux

There is helper script in lcdgfx/tools directory: ./build_and_run.sh The following command will run example:

cd lcdgfx/tools
./build_and_run.sh -p linux -e -f demos/ssd1306_demo
./build_and_run.sh -p linux -e -f games/arkanoid

If you use old shell, then the script may not work correctly (due to the issue with parsing arguments), then you can compile and run using make command options:

cd lcdgfx/examples
make -f Makefile.linux SDL_EMULATION=y PROJECT=ssd1306_demo flash

flash target for Linux platform makes system to run compiled binary.

Preparing environment for Windows

Currently only MINGW32 is supported.

Compiling example and running emulation in Windows

For MinGW32 use the script below:

cd lcdgfx\tools
build_and_run.bat "demos/ssd1306_demo"
build_and_run.bat "games/arkanoid"

How to run lode runner demo on PC

Linux:

cd lcdgfx\tools
./build_and_run.sh -p linux -e -f games/lode_runner

Windows:

cd lcdgfx\tools
build_and_run.bat "games/lode_runner"