static void gfx_ctx_ps3_get_video_output_size(void *data, unsigned *width, unsigned *height) { global_t *global = global_get_ptr(); if (!global) return; gfx_ctx_ps3_get_resolution(global->console.screen.resolutions.current.id, width, height); if (*width == 720 && *height == 576) { if (global->console.screen.pal_enable) global->console.screen.pal60_enable = true; } else { global->console.screen.pal_enable = false; global->console.screen.pal60_enable = false; } }
static void *gfx_ctx_ps3_init(void *video_driver) { #ifdef HAVE_PSGL PSGLdeviceParameters params; PSGLinitOptions options; #endif global_t *global = global_get_ptr(); gfx_ctx_ps3_data_t *ps3 = (gfx_ctx_ps3_data_t*) calloc(1, sizeof(gfx_ctx_ps3_data_t)); (void)video_driver; (void)global; if (!ps3) return NULL; #if defined(HAVE_PSGL) options.enable = PSGL_INIT_MAX_SPUS | PSGL_INIT_INITIALIZE_SPUS; options.maxSPUs = 1; options.initializeSPUs = GL_FALSE; /* Initialize 6 SPUs but reserve 1 SPU as a raw SPU for PSGL. */ sys_spu_initialize(6, 1); psglInit(&options); params.enable = PSGL_DEVICE_PARAMETERS_COLOR_FORMAT | PSGL_DEVICE_PARAMETERS_DEPTH_FORMAT | PSGL_DEVICE_PARAMETERS_MULTISAMPLING_MODE; params.colorFormat = GL_ARGB_SCE; params.depthFormat = GL_NONE; params.multisamplingMode = GL_MULTISAMPLING_NONE_SCE; if (global->console.screen.resolutions.current.id) { params.enable |= PSGL_DEVICE_PARAMETERS_WIDTH_HEIGHT; gfx_ctx_ps3_get_resolution( global->console.screen.resolutions.current.id, ¶ms.width, ¶ms.height); global->console.screen.pal_enable = false; if (params.width == 720 && params.height == 576) { RARCH_LOG("[PSGL Context]: 720x576 resolution detected, setting MODE_VIDEO_PAL_ENABLE.\n"); global->console.screen.pal_enable = true; } } if (global->console.screen.pal60_enable) { RARCH_LOG("[PSGL Context]: Setting temporal PAL60 mode.\n"); params.enable |= PSGL_DEVICE_PARAMETERS_RESC_PAL_TEMPORAL_MODE; params.enable |= PSGL_DEVICE_PARAMETERS_RESC_RATIO_MODE; params.rescPalTemporalMode = RESC_PAL_TEMPORAL_MODE_60_INTERPOLATE; params.rescRatioMode = RESC_RATIO_MODE_FULLSCREEN; } ps3->gl_device = psglCreateDeviceExtended(¶ms); ps3->gl_context = psglCreateContext(); psglMakeCurrent(ps3->gl_context, ps3->gl_device); psglResetCurrentContext(); #endif global->console.screen.pal_enable = cellVideoOutGetResolutionAvailability( CELL_VIDEO_OUT_PRIMARY, CELL_VIDEO_OUT_RESOLUTION_576, CELL_VIDEO_OUT_ASPECT_AUTO, 0); gfx_ctx_ps3_get_available_resolutions(); return ps3; }