[pckernel] use pc-get-resolution to fetch initial fullscreen resolution (#3307)

This is the more correct way of doing what that code is trying to do.
Fixes #3296

Also fixed some type inconsistencies with related code, probably wasn't
causing issues though.

May also fix the "black screen on startup" issues people keep having,
but that would simply be a nice bonus and isn't the aim of this PR.
This commit is contained in:
ManDude
2024-01-15 18:53:49 +00:00
committed by GitHub
parent 619f39d3b7
commit 46db6a36da
6 changed files with 35 additions and 22 deletions
+6 -6
View File
@@ -512,13 +512,13 @@ void pc_get_active_display_size(u32 w_ptr, u32 h_ptr) {
return;
}
if (w_ptr) {
auto w_out = Ptr<u32>(w_ptr).c();
auto w_out = Ptr<s64>(w_ptr).c();
if (w_out) {
*w_out = Display::GetMainDisplay()->get_display_manager()->get_screen_width();
}
}
if (h_ptr) {
auto h_out = Ptr<u32>(h_ptr).c();
auto h_out = Ptr<s64>(h_ptr).c();
if (h_out) {
*h_out = Display::GetMainDisplay()->get_display_manager()->get_screen_height();
}
@@ -537,13 +537,13 @@ void pc_get_window_size(u32 w_ptr, u32 h_ptr) {
return;
}
if (w_ptr) {
auto w = Ptr<u32>(w_ptr).c();
auto w = Ptr<s64>(w_ptr).c();
if (w) {
*w = Display::GetMainDisplay()->get_display_manager()->get_window_width();
}
}
if (h_ptr) {
auto h = Ptr<u32>(h_ptr).c();
auto h = Ptr<s64>(h_ptr).c();
if (h) {
*h = Display::GetMainDisplay()->get_display_manager()->get_window_height();
}
@@ -590,11 +590,11 @@ s64 pc_get_num_resolutions() {
void pc_get_resolution(u32 id, u32 w_ptr, u32 h_ptr) {
if (Display::GetMainDisplay()) {
auto res = Display::GetMainDisplay()->get_display_manager()->get_resolution(id);
auto w = Ptr<u32>(w_ptr).c();
auto w = Ptr<s64>(w_ptr).c();
if (w) {
*w = res.width;
}
auto h = Ptr<u32>(h_ptr).c();
auto h = Ptr<s64>(h_ptr).c();
if (h) {
*h = res.height;
}