mirror of
https://github.com/gopher64/gopher64.git
synced 2026-07-11 01:25:20 +02:00
fix PAL aspect ratio (#241)
This commit is contained in:
@@ -245,8 +245,8 @@ void rdp_close()
|
||||
|
||||
static void calculate_viewport(float *x, float *y, float *width, float *height)
|
||||
{
|
||||
const int32_t display_width = 320;
|
||||
const int32_t display_height = 240;
|
||||
const int32_t display_width = gfx_info.PAL ? 360 : 320;
|
||||
const int32_t display_height = gfx_info.PAL ? 288 : 240;
|
||||
|
||||
int w, h;
|
||||
SDL_GetWindowSize(window, &w, &h);
|
||||
|
||||
@@ -16,6 +16,7 @@ extern "C"
|
||||
uint32_t *DPC_START_REG;
|
||||
uint32_t *DPC_END_REG;
|
||||
uint32_t *DPC_STATUS_REG;
|
||||
bool PAL;
|
||||
} GFX_INFO;
|
||||
|
||||
typedef struct
|
||||
|
||||
+11
-2
@@ -15,8 +15,15 @@ pub fn init(device: &mut device::Device) {
|
||||
flags |= sdl3_sys::video::SDL_WINDOW_RESIZABLE;
|
||||
}
|
||||
|
||||
device.ui.window =
|
||||
unsafe { sdl3_sys::video::SDL_CreateWindow(title.as_ptr(), 640, 480, flags) };
|
||||
let mut window_width = 640;
|
||||
let mut window_height = 480;
|
||||
if device.cart.pal {
|
||||
window_width = 720;
|
||||
window_height = 576;
|
||||
}
|
||||
device.ui.window = unsafe {
|
||||
sdl3_sys::video::SDL_CreateWindow(title.as_ptr(), window_width, window_height, flags)
|
||||
};
|
||||
if device.ui.window.is_null() {
|
||||
panic!("Could not create window");
|
||||
}
|
||||
@@ -32,6 +39,7 @@ pub fn init(device: &mut device::Device) {
|
||||
DPC_START_REG: &mut device.rdp.regs_dpc[device::rdp::DPC_START_REG as usize],
|
||||
DPC_END_REG: &mut device.rdp.regs_dpc[device::rdp::DPC_END_REG as usize],
|
||||
DPC_STATUS_REG: &mut device.rdp.regs_dpc[device::rdp::DPC_STATUS_REG as usize],
|
||||
PAL: device.cart.pal,
|
||||
};
|
||||
|
||||
unsafe {
|
||||
@@ -66,6 +74,7 @@ pub fn load_state(device: &mut device::Device) {
|
||||
DPC_START_REG: &mut device.rdp.regs_dpc[device::rdp::DPC_START_REG as usize],
|
||||
DPC_END_REG: &mut device.rdp.regs_dpc[device::rdp::DPC_END_REG as usize],
|
||||
DPC_STATUS_REG: &mut device.rdp.regs_dpc[device::rdp::DPC_STATUS_REG as usize],
|
||||
PAL: device.cart.pal,
|
||||
};
|
||||
unsafe {
|
||||
rdp_new_processor(gfx_info, device.ui.config.video.upscale);
|
||||
|
||||
Reference in New Issue
Block a user