add yaze_emu target and YAZE_BUILD_EMU flag
This commit is contained in:
@@ -5,6 +5,7 @@ project(yaze VERSION 0.2.0)
|
|||||||
|
|
||||||
# Build Flags
|
# Build Flags
|
||||||
set(YAZE_BUILD_APP ON)
|
set(YAZE_BUILD_APP ON)
|
||||||
|
set(YAZE_BUILD_EMU ON)
|
||||||
set(YAZE_BUILD_Z3ED ON)
|
set(YAZE_BUILD_Z3ED ON)
|
||||||
set(YAZE_BUILD_PYTHON ON)
|
set(YAZE_BUILD_PYTHON ON)
|
||||||
set(YAZE_BUILD_CLIB ON)
|
set(YAZE_BUILD_CLIB ON)
|
||||||
|
|||||||
@@ -71,6 +71,10 @@ if (YAZE_BUILD_APP)
|
|||||||
include(app/app.cmake)
|
include(app/app.cmake)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (YAZE_BUILD_EMU)
|
||||||
|
include(app/emu/CMakeLists.txt)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (YAZE_BUILD_Z3ED)
|
if (YAZE_BUILD_Z3ED)
|
||||||
include(cli/z3ed.cmake)
|
include(cli/z3ed.cmake)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -20,4 +20,12 @@ target_include_directories(
|
|||||||
${SDL2_INCLUDE_DIR}
|
${SDL2_INCLUDE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(yaze_emu PUBLIC ${ABSL_TARGETS} ${SDL_TARGETS} ${PNG_LIBRARIES} ${CMAKE_DL_LIBS} ImGui)
|
target_link_libraries(
|
||||||
|
yaze_emu PUBLIC
|
||||||
|
${ABSL_TARGETS}
|
||||||
|
${SDL_TARGETS}
|
||||||
|
${PNG_LIBRARIES}
|
||||||
|
${CMAKE_DL_LIBS}
|
||||||
|
ImGui
|
||||||
|
ImGuiTestEngine
|
||||||
|
)
|
||||||
@@ -28,6 +28,7 @@
|
|||||||
#include "imgui_memory_editor.h"
|
#include "imgui_memory_editor.h"
|
||||||
|
|
||||||
using namespace yaze::app;
|
using namespace yaze::app;
|
||||||
|
using yaze::app::core::SDL_Deleter;
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
absl::InitializeSymbolizer(argv[0]);
|
absl::InitializeSymbolizer(argv[0]);
|
||||||
@@ -37,8 +38,8 @@ int main(int argc, char **argv) {
|
|||||||
options.alarm_on_failure_secs = true;
|
options.alarm_on_failure_secs = true;
|
||||||
absl::InstallFailureSignalHandler(options);
|
absl::InstallFailureSignalHandler(options);
|
||||||
|
|
||||||
std::unique_ptr<SDL_Window, sdl_deleter> window_;
|
std::unique_ptr<SDL_Window, SDL_Deleter> window_;
|
||||||
std::unique_ptr<SDL_Renderer, sdl_deleter> renderer_;
|
std::unique_ptr<SDL_Renderer, SDL_Deleter> renderer_;
|
||||||
if (SDL_Init(SDL_INIT_EVERYTHING) != 0) {
|
if (SDL_Init(SDL_INIT_EVERYTHING) != 0) {
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
} else {
|
} else {
|
||||||
@@ -47,23 +48,23 @@ int main(int argc, char **argv) {
|
|||||||
int screenWidth = displayMode.w * 0.8;
|
int screenWidth = displayMode.w * 0.8;
|
||||||
int screenHeight = displayMode.h * 0.8;
|
int screenHeight = displayMode.h * 0.8;
|
||||||
|
|
||||||
window_ = std::unique_ptr<SDL_Window, sdl_deleter>(
|
window_ = std::unique_ptr<SDL_Window, SDL_Deleter>(
|
||||||
SDL_CreateWindow("Yaze Emulator", // window title
|
SDL_CreateWindow("Yaze Emulator", // window title
|
||||||
SDL_WINDOWPOS_UNDEFINED, // initial x position
|
SDL_WINDOWPOS_UNDEFINED, // initial x position
|
||||||
SDL_WINDOWPOS_UNDEFINED, // initial y position
|
SDL_WINDOWPOS_UNDEFINED, // initial y position
|
||||||
512, // width, in pixels
|
512, // width, in pixels
|
||||||
480, // height, in pixels
|
480, // height, in pixels
|
||||||
SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI),
|
SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI),
|
||||||
sdl_deleter());
|
SDL_Deleter());
|
||||||
if (window_ == nullptr) {
|
if (window_ == nullptr) {
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
renderer_ = std::unique_ptr<SDL_Renderer, sdl_deleter>(
|
renderer_ = std::unique_ptr<SDL_Renderer, SDL_Deleter>(
|
||||||
SDL_CreateRenderer(window_.get(), -1,
|
SDL_CreateRenderer(window_.get(), -1,
|
||||||
SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC),
|
SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC),
|
||||||
sdl_deleter());
|
SDL_Deleter());
|
||||||
if (renderer_ == nullptr) {
|
if (renderer_ == nullptr) {
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user