diff --git a/README.md b/README.md index a3b3f99..4a14f19 100644 --- a/README.md +++ b/README.md @@ -86,10 +86,11 @@ the ANGLE dylib files into the `build` dir, so it can load them. Remember to run If there are any issues, feel free to open an issue & PR request. **Requirements:** +- Git (https://git-scm.com/) - MinGW-w64 (https://www.mingw-w64.org/) - CMake (https://cmake.org/download/) -Follow these steps to install MinGW-w64 for Windows: https://code.visualstudio.com/docs/cpp/config-mingw#_installing-the-mingww64-toolchain +**Follow these steps to install MinGW-w64 for Windows:** https://code.visualstudio.com/docs/cpp/config-mingw#_installing-the-mingww64-toolchain Change the default compiler to use in CMakeList.txt to the following: ```cmake @@ -101,7 +102,8 @@ Once complete, continue in Powershell: git clone https://github.com/npxtune/chisel8.git cd chisel8 git submodule update --init --recursive # To fetch raylib & raygui -mkdir build && cd ./build +mkdir build +cd build cmake -DCMAKE_BUILD_TYPE=Release .. make -j 6 # '6' -> How many cores you want to use ``` diff --git a/src/core/emu_core.c b/src/core/emu_core.c index 2b11b3c..a5fdfe4 100644 --- a/src/core/emu_core.c +++ b/src/core/emu_core.c @@ -259,9 +259,8 @@ int32_t decode_exec(emu *chip8, options_config *config) { case (0x33): N1 = chip8->reg[X]; chip8->ram[(chip8->I) % RAM_SIZE] = N1 / 100; - chip8->ram[(chip8->I + 1) % RAM_SIZE] = N1 % (((chip8->ram[(chip8->I) % RAM_SIZE]) * 100)) / 10; - chip8->ram[(chip8->I + 2) % RAM_SIZE] = N1 % (((chip8->ram[(chip8->I) % RAM_SIZE]) * 100 + - (chip8->ram[(chip8->I + 1) % RAM_SIZE]) * 10)); + chip8->ram[(chip8->I + 1) % RAM_SIZE] = (N1 % 100) / 10; + chip8->ram[(chip8->I + 2) % RAM_SIZE] = N1 % 10; break; case (0x55): diff --git a/src/gui/options_window.c b/src/gui/options_window.c index 7860689..a7e3755 100644 --- a/src/gui/options_window.c +++ b/src/gui/options_window.c @@ -179,11 +179,25 @@ int32_t options_window(options_config *config, ui_scale *scale) { GuiColorPicker((Rectangle) {600, 175, 200, 200}, "TEXT", &config->pixel_color); + GuiCheckBox((Rectangle) {scale->button_x, GetScreenHeight() - (GetScreenHeight() / 3), + scale->button_width/8, scale->button_width/8}, "Show Debug info", &config->show_debug); + + GuiCheckBox((Rectangle) {scale->button_x, GetScreenHeight() - (GetScreenHeight() / 2), + scale->button_width/8, scale->button_width/8}, "Show FPS", &config->show_fps); + + if (GuiButton((Rectangle) {scale->button_x, GetScreenHeight() - (GetScreenHeight() / 6), scale->button_width, scale->button_height}, GuiIconText(ICON_REREDO_FILL, "Return")) || IsKeyPressed(KEY_ESCAPE)) { SetExitKey(KEY_ESCAPE); return 0; } + + if (config->show_debug == true) { + SetTraceLogLevel(LOG_INFO); + } else { + SetTraceLogLevel(LOG_ERROR); + } + return 1; } \ No newline at end of file