diff options
author | 浅倉麗子 | 2020-06-12 21:36:28 -0400 |
---|---|---|
committer | 浅倉麗子 | 2020-06-12 21:36:28 -0400 |
commit | a35a31ab95c16a1f87668d7a81d1230725142eca (patch) | |
tree | 7df099314603fdd0a9b4a94a8e6a8e417a3b7193 | |
parent | Add compile flags and warnings (diff) | |
download | sharpscale-a35a31ab95c16a1f87668d7a81d1230725142eca.tar.gz |
Terminology changes
full hd -> unlock framebuffer size
bilinear filter option -> scaling algorithm
psone mode -> psone ar
-rw-r--r-- | CHANGELOG.md | 4 | ||||
-rw-r--r-- | README.md | 16 | ||||
-rw-r--r-- | config-app/CMakeLists.txt | 2 | ||||
-rw-r--r-- | config-app/main.c | 26 | ||||
-rw-r--r-- | config.c | 10 | ||||
-rw-r--r-- | main.c | 10 | ||||
-rw-r--r-- | sharpscale.h | 16 | ||||
-rw-r--r-- | sharpscale_internal.h | 2 |
8 files changed, 45 insertions, 41 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a27e75..b0bbf57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ### Changelog +#### v1.5.0 + +- Name changes to configuration options + #### v1.4.0 - Allow enable HD framebuffer sizes on the Vita @@ -17,9 +17,9 @@ Sharpscale can be configured to different scaling methods. In integer and real modes, a few lines may be cropped from the top and bottom to preserve aspect ratio of the framebuffer. -#### PS1 aspect ratio modes +#### PS1 aspect ratio -PS1 aspect ratio modes only take effect in integer, real, and fitted scaling modes and is applied before scaling. +PS1 aspect ratio can be forced in integer, real, and fitted scaling modes and is applied before scaling. - Pixel: aspect ratio of the framebuffer - 4∶3: aspect ratio is forced to 4∶3 @@ -29,16 +29,16 @@ Scaling and PS1 aspect ratio will not apply when - in integer and real modes, if the framebuffer is already larger than the display - in fitted mode, if the framebuffer is too big to be scaled -- in 4∶3 and 16∶9 modes, aspect ratio is too different to be forced +- aspect ratio is too different to be forced to 4∶3 or 16∶9 -#### Bilinear filtering +#### Scaling algorithm -- On: system default -- Off: nearest neighbour +- Point: nearest neighbour +- Bilinear: bilinear interpolation (system default) -Whenever scaling mode is original, or otherwise not applied, system default bilinear filtering is applied. +Whenever scaling mode is original, or otherwise not applied, bilinear interpolation is used. -#### Enable Full HD +#### Unlock framebuffer size - On: allow framebuffers of sizes 1280x720, 1440x1080, and 1920x1080 to be submitted to the kernel - Off: system default diff --git a/config-app/CMakeLists.txt b/config-app/CMakeLists.txt index 0f8d62d..cdce48f 100644 --- a/config-app/CMakeLists.txt +++ b/config-app/CMakeLists.txt @@ -25,7 +25,7 @@ set(VPK "${PROJECT_NAME}.vpk") set(TITLE_NAME "Sharpscale Config Menu") set(TITLE_ID "AKRK00005") -set(TITLE_VER "01.04") +set(TITLE_VER "01.05") add_executable("${ELF}" main.c diff --git a/config-app/main.c b/config-app/main.c index f8bf745..6f7998b 100644 --- a/config-app/main.c +++ b/config-app/main.c @@ -107,13 +107,13 @@ int main(int argc, char **argv) { (void)argc; (void)argv; int inc = (btns & SCE_CTRL_LEFT) ? -1 : 1; if (ui_row == 0) { - config.mode = (config.mode + inc + 4) % 4; + config.mode = (config.mode + inc + SHARPSCALE_MODE_INVALID) % SHARPSCALE_MODE_INVALID; } else if (ui_row == 1) { - config.psone_mode = (config.psone_mode + inc + 3) % 3; + config.psone_ar = (config.psone_ar + inc + SHARPSCALE_PSONE_AR_INVALID) % SHARPSCALE_PSONE_AR_INVALID; } else if (ui_row == 2) { config.bilinear = !config.bilinear; } else if (ui_row == 3) { - config.full_hd = !config.full_hd; + config.unlock_fb_size = !config.unlock_fb_size; } SharpscaleSetConfig(&config); @@ -144,22 +144,22 @@ int main(int argc, char **argv) { (void)argc; (void)argv; x_pos = 50; y_pos = line_height * 5; - draw_text(x_pos, y_pos, text_yellow(ui_row == 1), "PS1 aspect ratio mode"); - draw_text(x_pos += 300, y_pos, text_blue(config.psone_mode == SHARPSCALE_PSONE_MODE_PIXEL), "Pixel"); - draw_text(x_pos += 100, y_pos, text_blue(config.psone_mode == SHARPSCALE_PSONE_MODE_4_3), "4:3"); - draw_text(x_pos += 100, y_pos, text_blue(config.psone_mode == SHARPSCALE_PSONE_MODE_16_9), "16:9"); + draw_text(x_pos, y_pos, text_yellow(ui_row == 1), "PS1 aspect ratio"); + draw_text(x_pos += 300, y_pos, text_blue(config.psone_ar == SHARPSCALE_PSONE_AR_PIXEL), "Pixel"); + draw_text(x_pos += 100, y_pos, text_blue(config.psone_ar == SHARPSCALE_PSONE_AR_4_3), "4:3"); + draw_text(x_pos += 100, y_pos, text_blue(config.psone_ar == SHARPSCALE_PSONE_AR_16_9), "16:9"); x_pos = 50; y_pos = line_height * 6; - draw_text(x_pos, y_pos, text_yellow(ui_row == 2), "Bilinear filtering"); - draw_text(x_pos += 300, y_pos, text_blue(config.bilinear), "On"); - draw_text(x_pos += 100, y_pos, text_blue(!config.bilinear), "Off"); + draw_text(x_pos, y_pos, text_yellow(ui_row == 2), "Scaling algorithm"); + draw_text(x_pos += 300, y_pos, text_blue(!config.bilinear), "Point"); + draw_text(x_pos += 100, y_pos, text_blue(config.bilinear), "Bilinear"); x_pos = 50; y_pos = line_height * 7; - draw_text(x_pos, y_pos, text_yellow(ui_row == 3), "Enable Full HD"); - draw_text(x_pos += 300, y_pos, text_blue(config.full_hd), "On"); - draw_text(x_pos += 100, y_pos, text_blue(!config.full_hd), "Off"); + draw_text(x_pos, y_pos, text_yellow(ui_row == 3), "Unlock framebuffer size"); + draw_text(x_pos += 300, y_pos, text_blue(config.unlock_fb_size), "On"); + draw_text(x_pos += 100, y_pos, text_blue(!config.unlock_fb_size), "Off"); } else { y_pos = line_height * 4; @@ -30,16 +30,16 @@ SharpscaleConfig ss_config; static bool is_config_valid(SharpscaleConfig *config) { return config->mode < SHARPSCALE_MODE_INVALID - && config->psone_mode < SHARPSCALE_PSONE_MODE_INVALID + && config->psone_ar < SHARPSCALE_PSONE_AR_INVALID && (config->bilinear == true || config->bilinear == false) - && (config->full_hd == true || config->full_hd == false); + && (config->unlock_fb_size == true || config->unlock_fb_size == false); } int reset_config(SharpscaleConfig *config) { config->mode = SHARPSCALE_MODE_INTEGER; - config->psone_mode = SHARPSCALE_PSONE_MODE_4_3; + config->psone_ar = SHARPSCALE_PSONE_AR_4_3; config->bilinear = false; - config->full_hd = false; + config->unlock_fb_size = false; return 0; } @@ -90,7 +90,7 @@ int SharpscaleSetConfig(SharpscaleConfig *config) { int ret = ksceKernelMemcpyUserToKernel(&kconfig, (uintptr_t)config, sizeof(kconfig)); if (ret < 0) { goto fail; } if (!is_config_valid(&kconfig)) { goto fail; } - if (set_full_hd(kconfig.full_hd) < 0) { goto fail; } + if (set_unlock_fb_size(kconfig.unlock_fb_size) < 0) { goto fail; } memcpy(&ss_config, &kconfig, sizeof(ss_config)); return write_config(&ss_config); @@ -171,15 +171,15 @@ static int sceIftuSetInputFrameBuffer_hook(int plane, SceIftuPlaneState *state, float ar_scale = 1.0; - if (ss_config.psone_mode != SHARPSCALE_PSONE_MODE_PIXEL + if (ss_config.psone_ar != SHARPSCALE_PSONE_AR_PIXEL && (fb_w < 960 && fb_h < 544) && !(fb_w == 480 && fb_h == 272) && ksceSblACMgrIsPspEmu(SCE_KERNEL_PROCESS_ID_SELF)) { - if (ss_config.psone_mode == SHARPSCALE_PSONE_MODE_4_3) { + if (ss_config.psone_ar == SHARPSCALE_PSONE_AR_4_3) { ar_scale = (float)(4 * fb_h) / (float)(3 * fb_w); fb_w = lroundf((float)(4 * fb_h) / 3.0); - } else if (ss_config.psone_mode == SHARPSCALE_PSONE_MODE_16_9) { + } else if (ss_config.psone_ar == SHARPSCALE_PSONE_AR_16_9) { ar_scale = (float)(16 * fb_h) / (float)(9 * fb_w); fb_w = lroundf((float)(16 * fb_h) / 9.0); } @@ -227,7 +227,7 @@ done: return TAI_NEXT(sceIftuSetInputFrameBuffer_hook, hook_ref[2], plane, state, bilinear, sync_mode); } -int set_full_hd(bool enable) { +int set_unlock_fb_size(bool enable) { static int enabled = 0; int ret = 0; @@ -296,7 +296,7 @@ int module_start(SceSize argc, const void *argv) { (void)argc; (void)argv; GLZ(HOOK_OFFSET(1, scedisplay_uid, 0x004, prepare_fb_compat)); GLZ(HOOK_IMPORT(2, "SceDisplay", 0xCAFCFE50, 0x7CE0C4DA, sceIftuSetInputFrameBuffer)); - GLZ(set_full_hd(ss_config.full_hd)); + GLZ(set_unlock_fb_size(ss_config.unlock_fb_size)); return SCE_KERNEL_START_SUCCESS; diff --git a/sharpscale.h b/sharpscale.h index 966ebfc..bc3a122 100644 --- a/sharpscale.h +++ b/sharpscale.h @@ -28,18 +28,18 @@ typedef enum SharpscaleMode { SHARPSCALE_MODE_INVALID, } SharpscaleMode; -typedef enum SharpscalePSOneMode { - SHARPSCALE_PSONE_MODE_PIXEL, - SHARPSCALE_PSONE_MODE_4_3, - SHARPSCALE_PSONE_MODE_16_9, - SHARPSCALE_PSONE_MODE_INVALID, -} SharpscalePSOneMode; +typedef enum SharpscalePSOneAR { + SHARPSCALE_PSONE_AR_PIXEL, + SHARPSCALE_PSONE_AR_4_3, + SHARPSCALE_PSONE_AR_16_9, + SHARPSCALE_PSONE_AR_INVALID, +} SharpscalePSOneAR; typedef struct SharpscaleConfig { SharpscaleMode mode; - SharpscalePSOneMode psone_mode; + SharpscalePSOneAR psone_ar; bool bilinear; - bool full_hd; + bool unlock_fb_size; } SharpscaleConfig; int SharpscaleGetConfig(SharpscaleConfig *config); diff --git a/sharpscale_internal.h b/sharpscale_internal.h index 6f9ca84..374c9e1 100644 --- a/sharpscale_internal.h +++ b/sharpscale_internal.h @@ -20,6 +20,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. #include <stdbool.h> -int set_full_hd(bool enable); +int set_unlock_fb_size(bool enable); #endif |