diff options
| -rw-r--r-- | src/core/hw/gpu.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp index 7471def57..2bc650002 100644 --- a/src/core/hw/gpu.cpp +++ b/src/core/hw/gpu.cpp | |||
| @@ -125,11 +125,11 @@ inline void Write(u32 addr, const T data) { | |||
| 125 | break; | 125 | break; |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | unsigned horizontal_scale = (config.scaling != config.NoScale) ? 2 : 1; | 128 | bool horizontal_scale = config.scaling != config.NoScale; |
| 129 | unsigned vertical_scale = (config.scaling == config.ScaleXY) ? 2 : 1; | 129 | bool vertical_scale = config.scaling == config.ScaleXY; |
| 130 | 130 | ||
| 131 | u32 output_width = config.output_width / horizontal_scale; | 131 | u32 output_width = config.output_width >> horizontal_scale; |
| 132 | u32 output_height = config.output_height / vertical_scale; | 132 | u32 output_height = config.output_height >> vertical_scale; |
| 133 | 133 | ||
| 134 | u32 input_size = config.input_width * config.input_height * GPU::Regs::BytesPerPixel(config.input_format); | 134 | u32 input_size = config.input_width * config.input_height * GPU::Regs::BytesPerPixel(config.input_format); |
| 135 | u32 output_size = output_width * output_height * GPU::Regs::BytesPerPixel(config.output_format); | 135 | u32 output_size = output_width * output_height * GPU::Regs::BytesPerPixel(config.output_format); |
| @@ -161,8 +161,8 @@ inline void Write(u32 addr, const T data) { | |||
| 161 | 161 | ||
| 162 | // Calculate the [x,y] position of the input image | 162 | // Calculate the [x,y] position of the input image |
| 163 | // based on the current output position and the scale | 163 | // based on the current output position and the scale |
| 164 | u32 input_x = x * horizontal_scale; | 164 | u32 input_x = x << horizontal_scale; |
| 165 | u32 input_y = y * vertical_scale; | 165 | u32 input_y = y << vertical_scale; |
| 166 | 166 | ||
| 167 | if (config.flip_vertically) { | 167 | if (config.flip_vertically) { |
| 168 | // Flip the y value of the output data, | 168 | // Flip the y value of the output data, |