mirror of
https://github.com/LIJI32/SameBoy.git
synced 2026-10-12 02:06:38 +00:00
Fixed a bug causing closed ROMs to run in background
This commit is contained in:
+19
-1
@@ -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);
|
||||
}
|
||||
}];
|
||||
|
||||
Reference in New Issue
Block a user