SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit e7cce8fdde6405c55e883c600e3a9df63a967261 parent defd8d4f6978d5627fa869625a8b69f3ca0d21f7 Author: Lior Halphon <LIJI32@gmail.com> Date: Tue, 24 Jan 2023 22:56:37 +0200 Fix the theme resetting to Twilight Diffstat:
| M | iOS/GBViewController.m | 11 | +++++------ |
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/iOS/GBViewController.m b/iOS/GBViewController.m @@ -31,6 +31,7 @@ size_t _audioBufferNeeded; GBAudioClient *_audioClient; NSMutableSet *_defaultsObservers; + GB_palette_t _palette; } static void loadBootROM(GB_gameboy_t *gb, GB_boot_rom_t type) @@ -553,14 +554,12 @@ static void rumbleCallback(GB_gameboy_t *gb, double amp) [[GBHapticManager sharedManager] setRumbleStrength:amp]; } -- (const GB_palette_t *)userPalette -{ - return [GBSettingsViewController paletteForTheme:[[NSUserDefaults standardUserDefaults] stringForKey:@"GBCurrentTheme"]]; -} - - (void)updatePalette { - GB_set_palette(&_gb, [self userPalette]); + memcpy(&_palette, + [GBSettingsViewController paletteForTheme:[[NSUserDefaults standardUserDefaults] stringForKey:@"GBCurrentTheme"]], + sizeof(_palette)); + GB_set_palette(&_gb, &_palette); } - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.