git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit dd435ae5f011e09941bbd9e99eec5f1ca80108fa
parent 53dd19ec352e0ddc6b0ee377c7018e93afb85e06
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Sun, 24 Jul 2022 17:41:34 +0300

Fixed potential race condition in the Cocoa memory viewer

Diffstat:
MCocoa/GBMemoryByteArray.m25+++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/Cocoa/GBMemoryByteArray.m b/Cocoa/GBMemoryByteArray.m @@ -34,17 +34,18 @@ - (void)copyBytes:(unsigned char *)dst range:(HFRange)range { - __block uint16_t addr = (uint16_t) range.location; - __block unsigned long long length = range.length; - if (_mode == GBMemoryEntireSpace) { - while (length) { - *(dst++) = [_document readMemory:addr++]; - length--; + [_document performAtomicBlock:^{ + uint8_t *_dst = dst; + uint16_t addr = (uint16_t) range.location; + unsigned long long length = range.length; + if (_mode == GBMemoryEntireSpace) { + while (length) { + *(_dst++) = [_document readMemory:addr++]; + length--; + } } - } - else { - [_document performAtomicBlock:^{ - unsigned char *_dst = dst; + else { + uint8_t *_dst = dst; uint16_t bank_backup = 0; GB_gameboy_t *gb = _document.gameboy; switch (_mode) { @@ -94,8 +95,8 @@ default: assert(false); } - }]; - } + } + }]; } - (NSArray *)byteSlices

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.