Skip to content

Commit

Permalink
Add display mode: Bilinear Filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
ShutOstrich committed May 1, 2023
1 parent 5854125 commit ab3cc26
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Classes/PCSX2GameCore.mm
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@

static NSString * const OEPSCSX2InternalResolution = @"OEPSCSX2InternalResolution";
static NSString * const OEPSCSX2BlendingAccuracy = @"OEPSCSX2BlendingAccuracy";
static NSString * const OEPSCSX2BilinearFiltering = @"OEPSCSX2BilinearFiltering";

namespace GSDump
{
Expand Down Expand Up @@ -104,7 +105,9 @@ - (instancetype)init
_maxDiscs = 0;
_displayModes = [[NSMutableDictionary alloc] initWithDictionary:
@{OEPSCSX2InternalResolution: @1,
OEPSCSX2BlendingAccuracy: @1}];
OEPSCSX2BlendingAccuracy: @1,
OEPSCSX2BilinearFiltering: @1,
}];
screenRect = OEIntRectMake(0, 0, 640 * 4, 448 * 4);
}
return self;
Expand Down Expand Up @@ -522,6 +525,7 @@ - (void)setDisplayModeInfo:(NSDictionary<NSString *, id> *)displayModeInfo
} defaultValues[] = {
{ OEPSCSX2InternalResolution, [NSNumber class], @1 },
{ OEPSCSX2BlendingAccuracy, [NSNumber class], @1 },
{ OEPSCSX2BilinearFiltering, [NSNumber class], @1 },
};
/* validate the defaults to avoid crashes caused by users playing
* around where they shouldn't */
Expand Down Expand Up @@ -565,6 +569,10 @@ - (void)setDisplayModeInfo:(NSDictionary<NSString *, id> *)displayModeInfo
OptionWithValue(@"High", OEPSCSX2BlendingAccuracy, 3),
OptionWithValue(@"Full (Very Slow)", OEPSCSX2BlendingAccuracy, 4),
OptionWithValue(@"Ultra (Ultra Slow, or M1)", OEPSCSX2BlendingAccuracy, 5)]),
OEDisplayMode_Submenu(@"Bilinear Filtering",
@[OptionWithValue(@"None", OEPSCSX2BilinearFiltering, 0),
OptionWithValue(@"Smooth", OEPSCSX2BilinearFiltering, 1),
OptionWithValue(@"Sharp", OEPSCSX2BilinearFiltering, 2)]),
];

#undef OptionWithValue
Expand All @@ -586,6 +594,8 @@ - (void)changeDisplayWithMode:(NSString *)displayMode
VMManager::RequestDisplaySize([currentVal floatValue]);
} else if ([key isEqualToString:OEPSCSX2BlendingAccuracy]) {
s_base_settings_interface->SetIntValue("EmuCore/GS", "accurate_blending_unit", [currentVal intValue]);
} else if ([key isEqualToString:OEPSCSX2BilinearFiltering]) {
s_base_settings_interface->SetIntValue("EmuCore/GS", "linear_present_mode", [currentVal intValue]);
}

VMManager::ApplySettings();
Expand Down

0 comments on commit ab3cc26

Please sign in to comment.