Merge pull request 'Update ARM GNU toolchain to version 12.3-rel1' (#64) from taylorthemushroom/minecraft-pi-reborn:master into master

Reviewed-on: minecraft-pi-reborn/minecraft-pi-reborn#64
This commit is contained in:
TheBrokenRail 2023-10-19 21:13:00 -04:00
commit fab66319ea
2 changed files with 11 additions and 10 deletions

View File

@ -1,11 +1,11 @@
# Pick URL
execute_process(COMMAND uname -m OUTPUT_VARIABLE arch OUTPUT_STRIP_TRAILING_WHITESPACE)
if(arch STREQUAL "x86_64")
set(toolchain_url "https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf.tar.xz")
set(toolchain_sha256 "aa074fa8371a4f73fecbd16bd62c8b1945f23289e26414794f130d6ccdf8e39c")
set(toolchain_url "https://developer.arm.com/-/media/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz")
set(toolchain_sha256 "f5f3c1cfcb429833d363e8fec31bb1282974b119ca8169d6277ce8a549e26d54")
elseif(arch STREQUAL "aarch64" OR arch STREQUAL "armv8b" OR arch STREQUAL "armv8l")
set(toolchain_url "https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-aarch64-arm-none-linux-gnueabihf.tar.xz")
set(toolchain_sha256 "fccd7af76988da2b077f939eb2a78baa9935810918d2bf3f837bc74f52efa825")
set(toolchain_url "https://developer.arm.com/-/media/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-aarch64-arm-none-linux-gnueabihf.tar.xz")
set(toolchain_sha256 "ac2806f4c1ba772817aded18a5b730b5004592b1f1224d8296de69942e3704bd")
else()
message(FATAL_ERROR "Unable To Download Prebuilt ARMHF Toolchain")
endif()

View File

@ -14,14 +14,15 @@
// Read Asset File
static AppPlatform_readAssetFile_return_value AppPlatform_readAssetFile_injection(__attribute__((unused)) unsigned char *app_platform, std::string const& path) {
// Read File
std::string full_path("data/");
full_path.append(path);
std::ifstream stream(full_path);
std::string str((std::istreambuf_iterator<char>(stream)), std::istreambuf_iterator<char>());
std::ifstream stream("data/" + path, std::ios_base::binary | std::ios_base::ate);
long len = stream.tellg();
char *buf = new char[len];
stream.seekg(0, stream.beg);
stream.read(buf, len);
// Return String
AppPlatform_readAssetFile_return_value ret;
ret.length = str.length();
ret.data = strdup(str.c_str());
ret.length = len;
ret.data = strdup(buf);
return ret;
}