Merge commit '88617af4098b1fe159bbc085b1a1927d45af3c22'
This commit is contained in:
commit
d2e579b613
2
deps/nostalgia/CMakeLists.txt
vendored
2
deps/nostalgia/CMakeLists.txt
vendored
@ -23,6 +23,8 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(CMAKE_MACOSX_RPATH OFF)
|
set(CMAKE_MACOSX_RPATH OFF)
|
||||||
else()
|
else()
|
||||||
|
3
deps/nostalgia/README.md
vendored
3
deps/nostalgia/README.md
vendored
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
* Install GCC, Clang, or Visual Studio with C++20 support
|
* Install GCC, Clang, or Visual Studio with C++20 support
|
||||||
* Install [devkitPro](https://devkitpro.org/wiki/Getting_Started) to build for GBA
|
* Install [devkitPro](https://devkitpro.org/wiki/Getting_Started) to build for GBA
|
||||||
|
* Install the gba-dev package
|
||||||
* Install Python 3
|
* Install Python 3
|
||||||
* Install Ninja, Make, and CMake
|
* Install Ninja, Make, and CMake
|
||||||
* Consider also installing ccache for faster subsequent build times
|
* Consider also installing ccache for faster subsequent build times
|
||||||
@ -21,7 +22,7 @@ probably differ), install the following additional packages:
|
|||||||
|
|
||||||
Build options: release, debug, asan, gba, gba-debug
|
Build options: release, debug, asan, gba, gba-debug
|
||||||
|
|
||||||
make purge configure-{gba,release,debug} install
|
make purge configure-{gba,release,debug} build
|
||||||
|
|
||||||
## Run
|
## Run
|
||||||
|
|
||||||
|
5
deps/nostalgia/deps/buildcore/base.mk
vendored
5
deps/nostalgia/deps/buildcore/base.mk
vendored
@ -10,10 +10,9 @@ ifeq (${OS},Windows_NT)
|
|||||||
SHELL := powershell.exe
|
SHELL := powershell.exe
|
||||||
.SHELLFLAGS := -NoProfile -Command
|
.SHELLFLAGS := -NoProfile -Command
|
||||||
BC_VAR_OS=windows
|
BC_VAR_OS=windows
|
||||||
|
BC_CMD_HOST_PY3=python
|
||||||
else
|
else
|
||||||
BC_VAR_OS=$(shell uname | tr [:upper:] [:lower:])
|
BC_VAR_OS=$(shell uname | tr [:upper:] [:lower:])
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(shell which python3 2> /dev/null),)
|
ifneq ($(shell which python3 2> /dev/null),)
|
||||||
BC_CMD_HOST_PY3=python3
|
BC_CMD_HOST_PY3=python3
|
||||||
else
|
else
|
||||||
@ -24,6 +23,8 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
ifdef BC_VAR_USE_DOCKER_DEVENV
|
ifdef BC_VAR_USE_DOCKER_DEVENV
|
||||||
ifneq ($(shell which docker 2> /dev/null),)
|
ifneq ($(shell which docker 2> /dev/null),)
|
||||||
|
@ -96,7 +96,7 @@ def main() -> int:
|
|||||||
cmake_cmd.append(build_tool)
|
cmake_cmd.append(build_tool)
|
||||||
if qt_path != '':
|
if qt_path != '':
|
||||||
cmake_cmd.append(qt_path)
|
cmake_cmd.append(qt_path)
|
||||||
if platform.system() == 'Windows':
|
if platform.system() == 'Windows' and platform.system() == 'AMD64':
|
||||||
cmake_cmd.append('-A x64')
|
cmake_cmd.append('-A x64')
|
||||||
|
|
||||||
cmake_err = subprocess.run(cmake_cmd).returncode
|
cmake_err = subprocess.run(cmake_cmd).returncode
|
||||||
|
@ -32,7 +32,7 @@ def get_os() -> str:
|
|||||||
|
|
||||||
|
|
||||||
def get_arch() -> str:
|
def get_arch() -> str:
|
||||||
arch = platform.machine()
|
arch = platform.machine().lower()
|
||||||
if arch.lower() == 'amd64':
|
if arch == 'amd64':
|
||||||
arch = 'x86_64'
|
arch = 'x86_64'
|
||||||
return arch
|
return arch
|
||||||
|
@ -83,10 +83,10 @@ class Signal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cleanup(Signal *signal) noexcept final {
|
void cleanup(Signal *signal) noexcept final {
|
||||||
auto err = m_receiver->destruction.disconnectSignal(signal);
|
std::ignore = m_receiver->destruction.disconnectSignal(signal);
|
||||||
if (err) {
|
//if (err) {
|
||||||
oxErrorf("Signal could not notify receiver that it is being destroyed. Destruction of receiver will cause use-after-free. ({})", toStr(err));
|
// oxErrorf("Signal could not notify receiver that it is being destroyed. Destruction of receiver will cause use-after-free. ({})", toStr(err));
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
#define OX_ARCH_x86_64
|
#define OX_ARCH_x86_64
|
||||||
#elif defined(__i386__) || defined(_M_IX86)
|
#elif defined(__i386__) || defined(_M_IX86)
|
||||||
#define OX_ARCH_x86_32
|
#define OX_ARCH_x86_32
|
||||||
#elif defined(__arm64__) || defined(__aarch64__)
|
#elif defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64)
|
||||||
#define OX_ARCH_ARM64
|
#define OX_ARCH_ARM64
|
||||||
#elif defined(__arm__)
|
#elif defined(__arm__) || defined(_M_ARM)
|
||||||
#define OX_ARCH_ARM
|
#define OX_ARCH_ARM
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -84,21 +84,23 @@ static ox::Error loadTileSheetSet(
|
|||||||
uint16_t *tileMapTargetMem,
|
uint16_t *tileMapTargetMem,
|
||||||
TileSheetSet const&set) noexcept {
|
TileSheetSet const&set) noexcept {
|
||||||
size_t tileWriteIdx = 0;
|
size_t tileWriteIdx = 0;
|
||||||
|
size_t const bppMod = set.bpp == 4;
|
||||||
for (auto const&entry : set.entries) {
|
for (auto const&entry : set.entries) {
|
||||||
oxRequire(ts, keel::readObj<CompactTileSheet>(keelCtx(ctx), entry.tilesheet));
|
oxRequire(ts, keel::readObj<CompactTileSheet>(keelCtx(ctx), entry.tilesheet));
|
||||||
if (set.bpp != ts->bpp && ts->bpp == 8) {
|
if (set.bpp != ts->bpp && ts->bpp == 8) {
|
||||||
return OxError(1, "cannot load an 8 BPP tilesheet into a 4 BPP CBB");
|
return OxError(1, "cannot load an 8 BPP tilesheet into a 4 BPP CBB");
|
||||||
}
|
}
|
||||||
for (auto const&s : entry.sections) {
|
for (auto const&s : entry.sections) {
|
||||||
auto const cnt = (static_cast<size_t>(s.tiles) * PixelsPerTile) / (1 + (set.bpp == 4));
|
auto const cnt = (static_cast<size_t>(s.tiles) * PixelsPerTile) >> bppMod;
|
||||||
for (size_t i = 0; i < cnt; ++i) {
|
for (size_t i = 0; i < cnt; ++i) {
|
||||||
auto const srcIdx = static_cast<size_t>(s.begin) + i * 2;
|
auto const begin = static_cast<size_t>(s.begin) * (PixelsPerTile >> bppMod);
|
||||||
|
auto const srcIdx = begin + i * 2;
|
||||||
auto const v = static_cast<uint16_t>(
|
auto const v = static_cast<uint16_t>(
|
||||||
static_cast<uint16_t>(ts->pixels[srcIdx]) |
|
static_cast<uint16_t>(ts->pixels[srcIdx]) |
|
||||||
(static_cast<uint16_t>(ts->pixels[srcIdx + 1]) << 8));
|
(static_cast<uint16_t>(ts->pixels[srcIdx + 1]) << 8));
|
||||||
tileMapTargetMem[tileWriteIdx + i] = v;
|
tileMapTargetMem[tileWriteIdx + i] = v;
|
||||||
}
|
}
|
||||||
tileWriteIdx += cnt;
|
tileWriteIdx += cnt >> bppMod;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user