Skip to content

Commit

Permalink
Updated all libretro based color profiles.
Browse files Browse the repository at this point in the history
Added GB micro, GBA SP (AGS-101), DS lite and VBA/No$GBA profiles.
  • Loading branch information
profi200 committed Dec 3, 2024
1 parent dd90d49 commit 4e4c2aa
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 35 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,17 @@ Video-related settings.

`string colorProfile` - Color correction profile.
* Default: `none`
* Options: `none`, `gba`, `nds`, `nds_white`, `nso`, `identity`
* If you just want less saturated colors or change other basic settings like contrast or brightness then set this to `identity`.
* Options:
* `none` Disable all color correction options.
* `gba` Game Boy Advance.
* `gb_micro` Game Boy micro.
* `gba_sp101` Game Boy Advance SP (AGS-101).
* `nds` Nintendo DS (DS phat).
* `ds_lite` Nintendo DS lite.
* `nso` Nintendo Switch Online.
* `vba` Visual Boy Advance/No$GBA full.
* `identity` No color space conversion.
* If you just want less saturated colors or to change other basic settings like contrast or brightness then set this to `identity`.
* Due to most 2/3DS LCDs not being calibrated correctly from factory the look may not match exactly what you see on real hardware.
* Due to a lot of extra RAM access and extra CPU processing per frame, battery runtime is affected with color profiles other than `none`.

Expand Down Expand Up @@ -156,7 +165,7 @@ Game-specific settings. Only intended to be used in the per-game settings (romNa

`string saveType` - Override to use a specific save type.
* Default: `auto`
* Options starting with `rom_256m` are intended for 32 MiB games. Options ending with `rtc` enable the hardware real-time clock. Options:
* Options starting with `rom_256m` are intended for 32 MiB games. Options ending with `rtc` enable the hardware real-time clock:
* `eeprom_8k`
* `rom_256m_eeprom_8k`
* `eeprom_64k`
Expand Down
2 changes: 1 addition & 1 deletion include/arm11/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ typedef struct

// [video]
u8 scaler; // 0 = 1:1/none, 1 = bilinear (GPU) x1.5, 2 = matrix (hardware) x1.5.
u8 colorProfile; // 0 = none, 1 = GBA, 2 = DS phat, 3 = DS phat white, 4 = Nintendo Switch Online, 5 = identity.
u8 colorProfile; // 0 = none, 1 = GBA, 2 = GB micro, 3 = GBA SP (AGS-101), 4 = DS phat, 5 = DS lite, 6 = Nintendo Switch Online, 7 = Visual Boy Advance/No$GBA, 8 = identity.
float contrast; // Range 0.0-1.0.
float brightness; // Range 0.0-1.0.
float saturation; // Range 0.0-1.0.
Expand Down
16 changes: 11 additions & 5 deletions source/arm11/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,22 @@ static int cfgIniCallback(void *user, const char *section, const char *name, con
config->colorProfile = 0;
else if(strcmp(value, "gba") == 0)
config->colorProfile = 1;
else if(strcmp(value, "nds") == 0)
else if(strcmp(value, "gb_micro") == 0)
config->colorProfile = 2;
else if(strcmp(value, "nds_white") == 0)
else if(strcmp(value, "gba_sp101") == 0)
config->colorProfile = 3;
else if(strcmp(value, "nso") == 0)
else if(strcmp(value, "nds") == 0)
config->colorProfile = 4;
else if(strcmp(value, "identity") == 0)
else if(strcmp(value, "ds_lite") == 0)
config->colorProfile = 5;
else if(strcmp(value, "nso") == 0)
config->colorProfile = 6;
else if(strcmp(value, "vba") == 0)
config->colorProfile = 7;
else if(strcmp(value, "identity") == 0)
config->colorProfile = 8;
//else if(strcmp(value, "custom") == 0) // TODO: Implement user provided profile.
// config->colorProfile = 6;
// config->colorProfile = 9;
}
else if(strcmp(name, "contrast") == 0)
config->contrast = str2float(value);
Expand Down
78 changes: 52 additions & 26 deletions source/arm11/oaf_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,40 +126,66 @@ typedef struct
float displayGamma;
} ColorProfile;

static const ColorProfile g_colorProfiles[5] =
// libretro shader values. Credits: hunterk and Pokefan531.
// Last updated 2014-12-03.
static const ColorProfile g_colorProfiles[8] =
{
{ // libretro GBA color (sRGB). Credits: hunterk and Pokefan531.
2.f + 0.5f,
0.93f,
0.8f, 0.275f, -0.075f,
0.135f, 0.64f, 0.225f,
0.195f, 0.155f, 0.65f,
1.f / 2.f
{ // libretro GBA color (sRGB).
2.2f + (0.3f * 1.6f), // Darken screen. Default 0. Modified to 0.3.
0.91f,
0.905f, 0.195f, -0.1f,
0.1f, 0.65f, 0.25f,
0.1575f, 0.1425f, 0.7f,
1.f / 2.2f
},
{ // libretro DS phat (sRGB). Credits: hunterk and Pokefan531.
2.f,
1.f,
0.705f, 0.235f, -0.075f,
0.09f, 0.585f, 0.24f,
0.1075f, 0.1725f, 0.72f,
1.f / 2.f
{ // libretro GB micro color (sRGB).
2.2f,
0.9f,
0.8025f, 0.31f, -0.1125f,
0.1f, 0.6875f, 0.2125f,
0.1225f, 0.1125f, 0.765f,
1.f / 2.2f
},
{ // libretro GBA SP (AGS-101) color (sRGB).
2.2f,
0.935f,
0.96f, 0.11f, -0.07f,
0.0325f, 0.89f, 0.0775f,
0.001f, -0.03f, 1.029f,
1.f / 2.2f
},
{ // libretro DS phat white (sRGB). Credits: hunterk and Pokefan531.
2.f,
0.915f,
0.815f, 0.275f, -0.09f,
0.1f, 0.64f, 0.26f,
0.1075f, 0.1725f, 0.72f,
1.f / 2.f
{ // libretro NDS color (sRGB).
2.2f,
0.905f,
0.835f, 0.27f, -0.105f,
0.1f, 0.6375f, 0.2625f,
0.105f, 0.175f, 0.72f,
1.f / 2.2f
},
{ // libretro NDS lite color (sRGB).
2.2f,
0.935f,
0.93f, 0.14f, -0.07f,
0.025f, 0.9f, 0.075f,
0.008f, -0.03f, 1.022f,
1.f / 2.2f
},
{ // libretro Nintendo Switch Online (sRGB). Credits: hunterk and Pokefan531.
2.2f + 0.8f,
{ // libretro Nintendo Switch Online color (sRGB).
2.2f + 0.8f, // Darken screen. Default 0.8.
1.f,
0.865f, 0.1225f, 0.0125f,
0.0575f, 0.925f, 0.0125f,
0.0575f, 0.1225f, 0.82f,
0.0575f, 0.925f, 0.0125f,
0.0575f, 0.1225f, 0.82f,
1.f / 2.2f
},
{ // libretro Visual Boy Advance/No$GBA full color.
1.45f + 1.f, // Darken screen. Default 1.
1.f,
0.73f, 0.27f, 0.f,
0.0825f, 0.6775f, 0.24f,
0.0825f, 0.24f, 0.6775f,
1.f / 1.45f
},
{ // Identity.
1.f,
1.f,
Expand Down

0 comments on commit 4e4c2aa

Please sign in to comment.