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