Skip to content

Commit

Permalink
Stella color space in progess fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph Mattello <[email protected]>
  • Loading branch information
JoeMatt committed May 10, 2024
1 parent 31cb179 commit 41c4cf4
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions Cores/Stella/PVStellaGameCore/PVStellaGameCore.mm
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
typedef uint32_t stellabuffer_t;
#define STELLA_PITCH_SHIFT 2
#define STELLA_PIXEL_TYPE GL_UNSIGNED_BYTE
#define STELLA_PIXEL_FORMAT GL_BGRA
#define STELLA_INTERNAL_FORMAT GL_RGBA
#define STELLA_PIXEL_FORMAT GL_RGB565
#define STELLA_INTERNAL_FORMAT GL_RGB565

#define STELLA_WIDTH 160
#define STELLA_HEIGHT 256
Expand Down Expand Up @@ -169,13 +169,32 @@ static bool environment_callback(unsigned cmd, void *data) {
return true;
}
case RETRO_ENVIRONMENT_SET_PIXEL_FORMAT: {
// *(retro_pixel_format *)data = RETRO_PIXEL_FORMAT_0RGB1555;
return false;
enum retro_pixel_format pix_fmt = *(const enum retro_pixel_format*)data;
switch (pix_fmt)
{
case RETRO_PIXEL_FORMAT_0RGB1555:
NSLog(@"Environ SET_PIXEL_FORMAT: 0RGB1555");
break;

case RETRO_PIXEL_FORMAT_RGB565:
NSLog(@"Environ SET_PIXEL_FORMAT: RGB565");
break;

case RETRO_PIXEL_FORMAT_XRGB8888:
NSLog(@"Environ SET_PIXEL_FORMAT: XRGB8888");
break;

default:
return false;
}
//currentPixFmt = pix_fmt;
break;
}
case RETRO_ENVIRONMENT_GET_VARIABLE: {
struct retro_variable *var = (struct retro_variable*)data;
NSString *varS = [NSString stringWithUTF8String:var->key];
id _Nullable oValue = [strongCurrent getVariable:varS];

NSString *value = [oValue string];
if(oValue && value && value.length) {
var->value = value.cString;
Expand Down

0 comments on commit 41c4cf4

Please sign in to comment.