git.y1.nz

SameBoy

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

commit 739a9eb2bf9767562a19e9f993b9c4f02e939e8e
parent e6c4ceaf5aa5885a62a65095b963f44fc95c79c4
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Wed, 27 Oct 2021 01:43:36 +0300

Use a monospaced font in the palette viewer

Diffstat:
MCocoa/GBColorCell.m5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Cocoa/GBColorCell.m b/Cocoa/GBColorCell.m @@ -13,13 +13,13 @@ static inline double scale_channel(uint8_t x) - (void)setObjectValue:(id)objectValue { - _integerValue = [objectValue integerValue]; uint8_t r = _integerValue & 0x1F, g = (_integerValue >> 5) & 0x1F, b = (_integerValue >> 10) & 0x1F; super.objectValue = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"$%04x", (uint16_t)(_integerValue & 0x7FFF)] attributes:@{ - NSForegroundColorAttributeName: r * 3 + g * 4 + b * 2 > 120? [NSColor blackColor] : [NSColor whiteColor] + NSForegroundColorAttributeName: r * 3 + g * 4 + b * 2 > 120? [NSColor blackColor] : [NSColor whiteColor], + NSFontAttributeName: [NSFont userFixedPitchFontOfSize:12] }]; } @@ -36,6 +36,7 @@ static inline double scale_channel(uint8_t x) - (NSColor *) backgroundColor { + /* Todo: color correction */ uint16_t color = self.integerValue; return [NSColor colorWithRed:scale_channel(color) green:scale_channel(color >> 5) blue:scale_channel(color >> 10) alpha:1.0]; }

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