attempting to link asar
This commit is contained in:
@@ -31,6 +31,5 @@ find_package(GLEW REQUIRED)
|
||||
# Project Files
|
||||
add_subdirectory(src/lib/abseil-cpp)
|
||||
add_subdirectory(src/lib/SDL)
|
||||
add_subdirectory(src/lib/asar/src)
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(test)
|
||||
@@ -37,10 +37,13 @@ set(
|
||||
# Asar Assembly ---------------------------------------------------------------
|
||||
add_subdirectory(lib/asar/src)
|
||||
get_target_property(ASAR_INCLUDE_DIR asar-static INCLUDE_DIRECTORIES)
|
||||
include_directories(${ASAR_INCLUDE_DIR})
|
||||
set(ASAR_GEN_EXE_TEST OFF)
|
||||
set(ASAR_GEN_DLL_TEST OFF)
|
||||
set(ASAR_GEN_EXE OFF)
|
||||
add_definitions(-Dstricmp=strcasecmp)
|
||||
|
||||
# executable linkage ----------------------------------------------------------
|
||||
|
||||
# yaze source files -----------------------------------------------------------
|
||||
set(
|
||||
YAZE_APP_CORE_SRC
|
||||
app/core/common.cc
|
||||
@@ -96,6 +99,7 @@ add_executable(
|
||||
${YAZE_APP_ZELDA3_SRC}
|
||||
${YAZE_GUI_SRC}
|
||||
${IMGUI_SRC}
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
yaze PUBLIC
|
||||
@@ -132,7 +136,7 @@ if(WIN32 OR MINGW)
|
||||
endif()
|
||||
|
||||
target_link_libraries(
|
||||
yaze
|
||||
yaze PUBLIC
|
||||
${ABSL_TARGETS}
|
||||
${SDL_TARGETS}
|
||||
${PNG_LIBRARIES}
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
#include <interface-lib.h>
|
||||
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "absl/status/statusor.h"
|
||||
@@ -17,7 +19,9 @@ namespace app {
|
||||
namespace snes_asm {
|
||||
|
||||
absl::Status Script::ApplyPatchToROM(ROM& rom) {
|
||||
if (!asar_patch(patch_filename_, rom_.data(), patch_size_, rom_.size())) {
|
||||
char* data = (char*) rom.data();
|
||||
int size = 0;
|
||||
if (!asar_patch(patch_filename_.c_str(), data, patch_size_, &size)) {
|
||||
return absl::InternalError("Unable to apply patch");
|
||||
}
|
||||
return absl::OkStatus();
|
||||
|
||||
@@ -4,8 +4,10 @@
|
||||
#include <interface-lib.h>
|
||||
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "absl/status/statusor.h"
|
||||
|
||||
@@ -92,6 +92,7 @@ class ROM {
|
||||
auto isLoaded() const { return is_loaded_; }
|
||||
auto begin() { return rom_data_.begin(); }
|
||||
auto end() { return rom_data_.end(); }
|
||||
auto data() { return rom_data_.data(); }
|
||||
|
||||
uchar& operator[](int i) {
|
||||
if (i > size_) {
|
||||
|
||||
Reference in New Issue
Block a user