Skip to content

Commit

Permalink
Merge pull request #629 from wheremyfoodat/more-dsp
Browse files Browse the repository at this point in the history
Remember window positions in SDL & turn on AAC decoder by default
  • Loading branch information
wheremyfoodat authored Nov 2, 2024
2 parents 760c67c + 1287ec7 commit 4b0591c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/core/audio/hle_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,8 @@ namespace Audio {
response.command = request.command;
response.mode = request.mode;

// TODO: Make this a toggle in config.toml. Currently we have it off by default until we finish the DSP mixer.
constexpr bool enableAAC = false;
// TODO: Make this a toggle in config.toml. Currently we have it on by default.
constexpr bool enableAAC = true;
if (enableAAC) {
aacDecoder->decode(response, request, [this](u32 paddr) { return getPointerPhys<u8>(paddr); });
}
Expand Down
15 changes: 9 additions & 6 deletions src/panda_sdl/frontend_sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,18 @@ FrontendSDL::FrontendSDL() : keyboardMappings(InputMappings::defaultKeyboardMapp
printf("Welcome to Panda3DS v%s!\n", PANDA3DS_VERSION);
}

// Positions of the window
int windowX, windowY;

// Apply window size settings if the appropriate option is enabled
if (config.windowSettings.rememberPosition) {
windowX = config.windowSettings.x;
windowY = config.windowSettings.y;
windowWidth = config.windowSettings.width;
windowHeight = config.windowSettings.height;
} else {
windowX = SDL_WINDOWPOS_CENTERED;
windowY = SDL_WINDOWPOS_CENTERED;
windowWidth = 400;
windowHeight = 480;
}
Expand All @@ -56,7 +63,7 @@ FrontendSDL::FrontendSDL() : keyboardMappings(InputMappings::defaultKeyboardMapp
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, config.rendererType == RendererType::Software ? 3 : 4);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, config.rendererType == RendererType::Software ? 3 : 1);
window = SDL_CreateWindow(windowTitle, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, windowWidth, windowHeight, SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE);
window = SDL_CreateWindow(windowTitle, windowX, windowY, windowWidth, windowHeight, SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE);

if (window == nullptr) {
Helpers::panic("Window creation failed: %s", SDL_GetError());
Expand All @@ -76,9 +83,7 @@ FrontendSDL::FrontendSDL() : keyboardMappings(InputMappings::defaultKeyboardMapp

#ifdef PANDA3DS_ENABLE_VULKAN
if (config.rendererType == RendererType::Vulkan) {
window = SDL_CreateWindow(
windowTitle, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, windowWidth, windowHeight, SDL_WINDOW_VULKAN | SDL_WINDOW_RESIZABLE
);
window = SDL_CreateWindow(windowTitle, windowX, windowY, windowWidth, windowHeight, SDL_WINDOW_VULKAN | SDL_WINDOW_RESIZABLE);

if (window == nullptr) {
Helpers::warn("Window creation failed: %s", SDL_GetError());
Expand Down Expand Up @@ -116,8 +121,6 @@ void FrontendSDL::run() {

// Remember window position & size for future runs
auto& windowSettings = emu.getConfig().windowSettings;
// Note: For the time being we currently don't actually apply the x/y positions to the window, and center it instead
// This is subject to change in the future, so let's save the x/y positions to the config file anyways
SDL_GetWindowPosition(window, &windowSettings.x, &windowSettings.y);
SDL_GetWindowSize(window, &windowSettings.width, &windowSettings.height);
return;
Expand Down

0 comments on commit 4b0591c

Please sign in to comment.