diff --git a/bsnes/emulator/emulator.hpp b/bsnes/emulator/emulator.hpp index a6af8090..8f307e83 100644 --- a/bsnes/emulator/emulator.hpp +++ b/bsnes/emulator/emulator.hpp @@ -29,7 +29,7 @@ using namespace nall; namespace Emulator { static const string Name = "bsnes"; - static const string Version = "111.9"; + static const string Version = "111.10"; static const string Author = "byuu"; static const string License = "GPLv3"; static const string Website = "https://byuu.org"; diff --git a/bsnes/sfc/ppu-fast/background.cpp b/bsnes/sfc/ppu-fast/background.cpp index 547a503d..792e5be0 100644 --- a/bsnes/sfc/ppu-fast/background.cpp +++ b/bsnes/sfc/ppu-fast/background.cpp @@ -93,7 +93,7 @@ auto PPU::Line::renderBackground(PPU::IO::Background& self, uint8 source) -> voi tileNumber = (tileNumber & 0x03ff) + tiledataIndex & tileMask; uint16 address; - address = (tileNumber << colorShift) + (voffset & 7 ^ mirrorY); + address = (tileNumber << colorShift) + (voffset & 7 ^ mirrorY) & 0x7fff; uint64 data; data = (uint64)ppu.vram[address + 0] << 0; diff --git a/bsnes/sfc/system/serialization.cpp b/bsnes/sfc/system/serialization.cpp index 5900b273..75c0e5d9 100644 --- a/bsnes/sfc/system/serialization.cpp +++ b/bsnes/sfc/system/serialization.cpp @@ -1,10 +1,6 @@ auto System::serialize(bool synchronize) -> serializer { - //deterministic serialization (synchronize=false) is only possible with select libco methods. - if(co_method() != "x86" - && co_method() != "amd64" - && co_method() != "arm" - && co_method() != "aarch64" - ) synchronize = true; + //deterministic serialization (synchronize=false) is only possible with select libco methods + if(!co_serializable()) synchronize = true; if(!information.serializeSize[synchronize]) return {}; //should never occur if(synchronize) runToSave(); diff --git a/libco/aarch64.c b/libco/aarch64.c index 59162f20..b3ffcc49 100644 --- a/libco/aarch64.c +++ b/libco/aarch64.c @@ -59,10 +59,6 @@ static void co_init() { #endif } -const char* co_method() { - return "aarch64"; -} - cothread_t co_active() { if(!co_active_handle) co_active_handle = &co_active_buffer; return co_active_handle; @@ -102,6 +98,10 @@ void co_switch(cothread_t handle) { co_swap(co_active_handle = handle, co_previous_handle); } +int co_serializable() { + return 1; +} + #ifdef __cplusplus } #endif diff --git a/libco/amd64.c b/libco/amd64.c index e9aef889..e9424c0b 100755 --- a/libco/amd64.c +++ b/libco/amd64.c @@ -115,10 +115,6 @@ static void crash() { assert(0); /* called only if cothread_t entrypoint returns */ } -const char* co_method() { - return "amd64"; -} - cothread_t co_active() { if(!co_active_handle) co_active_handle = &co_active_buffer; return co_active_handle; @@ -158,6 +154,10 @@ void co_switch(cothread_t handle) { co_swap(co_active_handle = handle, co_previous_handle); } +int co_serializable() { + return 1; +} + #ifdef __cplusplus } #endif diff --git a/libco/arm.c b/libco/arm.c index 8d872bf5..95adf6b2 100644 --- a/libco/arm.c +++ b/libco/arm.c @@ -35,10 +35,6 @@ static void co_init() { #endif } -const char* co_method() { - return "arm"; -} - cothread_t co_active() { if(!co_active_handle) co_active_handle = &co_active_buffer; return co_active_handle; @@ -77,6 +73,10 @@ void co_switch(cothread_t handle) { co_swap(co_active_handle = handle, co_previous_handle); } +int co_serializable() { + return 1; +} + #ifdef __cplusplus } #endif diff --git a/libco/fiber.c b/libco/fiber.c index f508b0f8..dd539c37 100755 --- a/libco/fiber.c +++ b/libco/fiber.c @@ -16,10 +16,6 @@ static void __stdcall co_thunk(void* coentry) { ((void (*)(void))coentry)(); } -const char* co_method() { - return "fiber"; -} - cothread_t co_active() { if(!co_active_) { ConvertThreadToFiber(0); @@ -50,6 +46,10 @@ void co_switch(cothread_t cothread) { SwitchToFiber(cothread); } +int co_serializable() { + return 0; +} + #ifdef __cplusplus } #endif diff --git a/libco/libco.h b/libco/libco.h index 0b94c2e9..88d00a72 100755 --- a/libco/libco.h +++ b/libco/libco.h @@ -13,12 +13,12 @@ extern "C" { typedef void* cothread_t; -const char* co_method(); cothread_t co_active(); cothread_t co_derive(void*, unsigned int, void (*)(void)); cothread_t co_create(unsigned int, void (*)(void)); void co_delete(cothread_t); void co_switch(cothread_t); +int co_serializable(); #ifdef __cplusplus } diff --git a/libco/ppc.c b/libco/ppc.c index 314997c8..6b7f4acd 100755 --- a/libco/ppc.c +++ b/libco/ppc.c @@ -413,10 +413,6 @@ static void co_init_(void) { co_active_handle = co_create_(state_size, (uintptr_t)&co_switch); } -const char* co_method() { - return "ppc"; -} - cothread_t co_active() { if(!co_active_handle) co_init_(); @@ -429,3 +425,7 @@ void co_switch(cothread_t t) { CO_SWAP_ASM(t, old); } + +int co_serializable() { + return 0; +} diff --git a/libco/ppc64v2.c b/libco/ppc64v2.c index fac464a6..3c296959 100644 --- a/libco/ppc64v2.c +++ b/libco/ppc64v2.c @@ -221,10 +221,6 @@ __asm__( ".size swap_context, .-swap_context\n" ); -const char* co_method() { - return "ppc64v2"; -} - cothread_t co_active() { if(!co_active_handle) { co_active_handle = (struct ppc64_context*)malloc(MIN_STACK + sizeof(struct ppc64_context)); @@ -274,6 +270,10 @@ void co_switch(cothread_t to) { swap_context((struct ppc64_context*)to, from); } +int co_serializable() { + return 1; +} + #ifdef __cplusplus } #endif diff --git a/libco/sjlj.c b/libco/sjlj.c index b4faf17b..5af14729 100755 --- a/libco/sjlj.c +++ b/libco/sjlj.c @@ -33,10 +33,6 @@ static void springboard(int ignored) { } } -const char* co_method() { - return "sjlj"; -} - cothread_t co_active() { if(!co_running) co_running = &co_primary; return (cothread_t)co_running; @@ -140,6 +136,10 @@ void co_switch(cothread_t cothread) { } } +int co_serializable() { + return 0; +} + #ifdef __cplusplus } #endif diff --git a/libco/ucontext.c b/libco/ucontext.c index 49fa976c..5ff76af3 100755 --- a/libco/ucontext.c +++ b/libco/ucontext.c @@ -26,10 +26,6 @@ extern "C" { static thread_local ucontext_t co_primary; static thread_local ucontext_t* co_running = 0; -const char* co_module() { - return "ucontext"; -} - cothread_t co_active() { if(!co_running) co_running = &co_primary; return (cothread_t)co_running; @@ -81,6 +77,10 @@ void co_switch(cothread_t cothread) { swapcontext(old_thread, co_running); } +int co_serializable() { + return 0; +} + #ifdef __cplusplus } #endif diff --git a/libco/x86.c b/libco/x86.c index 8effa0d4..fa1c538f 100755 --- a/libco/x86.c +++ b/libco/x86.c @@ -69,10 +69,6 @@ static void crash() { assert(0); /* called only if cothread_t entrypoint returns */ } -const char* co_method() { - return "x86"; -} - cothread_t co_active() { if(!co_active_handle) co_active_handle = &co_active_buffer; return co_active_handle; @@ -112,6 +108,10 @@ void co_switch(cothread_t handle) { co_swap(co_active_handle = handle, co_previous_handle); } +int co_serializable() { + return 1; +} + #ifdef __cplusplus } #endif