mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
platform, fix vertical scaling, aspect ratio handling (gp2x, psp)
This commit is contained in:
parent
ace184013b
commit
495fe1fdad
2 changed files with 17 additions and 2 deletions
|
@ -256,8 +256,11 @@ static int ld_left, ld_lines; // numbers in Q1 format
|
||||||
|
|
||||||
static int EmuScanBegin16_ld(unsigned int num)
|
static int EmuScanBegin16_ld(unsigned int num)
|
||||||
{
|
{
|
||||||
if ((signed int)(ld_counter - num) > 100)
|
if ((signed int)(ld_counter - num) > 100) {
|
||||||
ld_counter = 0;
|
// vsync, offset so that the upscaled image is centered
|
||||||
|
ld_counter = 120 - (120-num) * (ld_lines+2)/ld_lines;
|
||||||
|
ld_left = ld_lines;
|
||||||
|
}
|
||||||
|
|
||||||
if (emu_scan_begin)
|
if (emu_scan_begin)
|
||||||
return emu_scan_begin(ld_counter);
|
return emu_scan_begin(ld_counter);
|
||||||
|
@ -586,6 +589,12 @@ void emu_video_mode_change(int start_line, int line_count, int start_col, int co
|
||||||
int scalex = 320, scaley = 240;
|
int scalex = 320, scaley = 240;
|
||||||
int ln_offs = 0;
|
int ln_offs = 0;
|
||||||
|
|
||||||
|
/* NTSC always has 224 visible lines, anything smaller has bars */
|
||||||
|
if (line_count < 224 && line_count > 144) {
|
||||||
|
start_line -= (224-line_count) /2;
|
||||||
|
line_count = 224;
|
||||||
|
}
|
||||||
|
|
||||||
/* line doubling for swscaling, also needed for bg frames */
|
/* line doubling for swscaling, also needed for bg frames */
|
||||||
if (currentConfig.vscaling == EOPT_SCALE_SW && line_count < 240) {
|
if (currentConfig.vscaling == EOPT_SCALE_SW && line_count < 240) {
|
||||||
ld_lines = ld_left = 2*line_count / (240 - line_count);
|
ld_lines = ld_left = 2*line_count / (240 - line_count);
|
||||||
|
|
|
@ -679,6 +679,12 @@ void plat_update_volume(int has_changed, int is_up)
|
||||||
/* prepare for MD screen mode change */
|
/* prepare for MD screen mode change */
|
||||||
void emu_video_mode_change(int start_line, int line_count, int start_col, int col_count)
|
void emu_video_mode_change(int start_line, int line_count, int start_col, int col_count)
|
||||||
{
|
{
|
||||||
|
/* NTSC always has 224 visible lines, anything smaller has bars */
|
||||||
|
if (line_count < 224 && line_count > 144) {
|
||||||
|
start_line -= (224-line_count) /2;
|
||||||
|
line_count = 224;
|
||||||
|
}
|
||||||
|
|
||||||
out_y = start_line; out_x = start_col;
|
out_y = start_line; out_x = start_col;
|
||||||
out_h = line_count; out_w = col_count;
|
out_h = line_count; out_w = col_count;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue