Fixed a bug causing closed ROMs to run in background

This commit is contained in:
Lior Halphon
2025-10-03 22:19:59 +03:00
parent 939dd6ad5b
commit c3586ef7ca
+19 -1
View File
@@ -17,6 +17,24 @@
#import "GBHexStatusBarRepresenter.h"
#import "NSObject+DefaultsObserver.h"
void *AllocationAt(uintptr_t x)
{
size_t malloc_size(const void *ptr);
uintptr_t t = x & ~7;
for (unsigned i = 0; i < 128; i++) {
size_t size = malloc_size((void *)t);
if (!size) {
t -= 8;
continue;
}
if (x < t + size) {
return (void *)t;
}
return NULL;
}
return NULL;
}
#define likely(x) GB_likely(x)
#define unlikely(x) GB_unlikely(x)
@@ -348,7 +366,7 @@ static void debuggerReloadCallback(GB_gameboy_t *gb)
}];
[self observeStandardDefaultsKey:@"GBTurboCap" withBlock:^(NSNumber *value) {
if (!_master) {
if (!weakSelf->_master) {
GB_set_turbo_cap(gb, value.doubleValue);
}
}];