Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
beetle-psx-libretro
Commits
b91e37eb
Commit
b91e37eb
authored
Oct 03, 2021
by
ds22x
Browse files
Fix some issues with the dynamic overscan cropping
parent
76ba0512
Changes
3
Show whitespace changes
Inline
Side-by-side
mednafen/psx/gpu.cpp
View file @
b91e37eb
...
...
@@ -1676,7 +1676,12 @@ int32_t GPU_Update(const int32_t sys_timestamp)
&&
GPU
.
scanline
<
(
FirstVisibleLine
+
VisibleLineCount
))
{
int32
fb_x
=
GPU
.
DisplayFB_XStart
*
2
;
int32
dx_start
=
(
crop_overscan
?
608
:
GPU
.
HorizStart
),
dx_end
=
GPU
.
HorizEnd
;
// Restore old center behaviour if GPU.HorizStart is intentionally very high.
// 938 fixes Gunbird (1008) and Mobile Light Force (EU release of Gunbird),
// but this value should be lowered in the future if necessary.
// Additionally cut off everything after GPU.HorizEnd that shouldn't be
// in the viewport (the hardware renderers already takes care of this).
int32
dx_start
=
(
crop_overscan
&&
GPU
.
HorizStart
<
938
?
608
:
GPU
.
HorizStart
),
dx_end
=
(
crop_overscan
&&
GPU
.
HorizStart
<
938
?
GPU
.
HorizEnd
-
GPU
.
HorizStart
+
608
:
GPU
.
HorizEnd
-
(
GPU
.
HorizStart
<
938
?
0
:
1
));
int32
dest_line
=
((
GPU
.
scanline
-
FirstVisibleLine
)
<<
GPU
.
espec
->
InterlaceOn
)
+
GPU
.
espec
->
InterlaceField
;
...
...
parallel-psx/renderer/renderer.cpp
View file @
b91e37eb
...
...
@@ -794,8 +794,14 @@ Renderer::DisplayRect Renderer::compute_display_rect()
if
(
render_state
.
crop_overscan
)
{
// Horizontal crop amount is currently hardcoded. Future improvement could allow adjusting this.
// Restore old center behaviour is render_state.horiz_start is intentionally very high.
// 938 fixes Gunbird (1008) and Mobile Light Force (EU release of Gunbird),
// but this value should be lowerer in the future if necessary.
display_width
=
(
2560
/
clock_div
)
-
render_state
.
image_crop
;
if
(
render_state
.
horiz_start
<
938
)
left_offset
=
floor
((
render_state
.
offset_cycles
/
(
double
)
clock_div
)
-
(
render_state
.
image_crop
/
2
));
else
left_offset
=
floor
(((
render_state
.
horiz_start
+
render_state
.
offset_cycles
-
608
)
/
(
double
)
clock_div
)
-
(
render_state
.
image_crop
/
2
));
}
else
{
...
...
rsx/rsx_lib_gl.cpp
View file @
b91e37eb
...
...
@@ -1586,7 +1586,14 @@ static GlDisplayRect compute_gl_display_rect(GlRenderer *renderer)
{
width
=
(
uint32_t
)
((
2560
/
clock_div
)
-
renderer
->
image_crop
);
int32_t
offset_cycles
=
renderer
->
image_offset_cycles
;
int32_t
h_start
=
(
int32_t
)
renderer
->
config
.
display_area_hrange
[
0
];
/* Restore old center behaviour is render_state.horiz_start is intentionally very high.
* 938 fixes Gunbird (1008) and Mobile Light Force (EU release of Gunbird),
* but this value should be lowerer in the future if necessary. */
if
(
renderer
->
config
.
display_area_hrange
[
0
]
<
938
)
x
=
floor
((
offset_cycles
/
(
double
)
clock_div
)
-
(
renderer
->
image_crop
/
2
));
else
x
=
floor
(((
h_start
-
608
+
offset_cycles
)
/
(
double
)
clock_div
)
-
(
renderer
->
image_crop
/
2
));
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment