Skip to content

Commit

Permalink
adapt frontend util and build system changes
Browse files Browse the repository at this point in the history
  • Loading branch information
RSDuck committed Jan 26, 2021
1 parent d4b7e5c commit caf4ce1
Show file tree
Hide file tree
Showing 6 changed files with 206 additions and 179 deletions.
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ if (ENABLE_OGLRENDERER)
else()
if (WIN32)
target_link_libraries(core ole32 comctl32 ws2_32)
elseif (SWITCH)
target_link_libraries(core)
else()
target_link_libraries(core rt)
endif()
Expand Down
6 changes: 5 additions & 1 deletion src/frontend/switch/Platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,14 @@ void ThreadEntry(void* param)

#define STACK_SIZE (1024 * 1024 * 4)

int nextCore = 0;

Thread* Thread_Create(void (*func)())
{
::Thread* thread = new ::Thread();
threadCreate(thread, ThreadEntry, (void*)func, NULL, STACK_SIZE, 0x1F, 2);
threadCreate(thread, ThreadEntry, (void*)func, NULL, STACK_SIZE, 0x1F, nextCore);
// this relies on the order of thread creation, very bad
nextCore = 2;
threadStart(thread);
return (Thread*)thread;
}
Expand Down
16 changes: 10 additions & 6 deletions src/frontend/switch/PlatformConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ int ScreenSwap;
int ScreenSizing;
int Filtering;
int IntegerScaling;
int ScreenAspectTop;
int ScreenAspectBot;

int SavestateRelocSRAM;

Expand Down Expand Up @@ -49,12 +51,14 @@ ConfigEntry PlatformConfigFile[] =
{"ScreenSizing", 0, &ScreenSizing, 0, NULL, 0},
{"Filtering", 0, &Filtering, 1, NULL, 0},
{"IntegerScaling", 0, &IntegerScaling, 0, NULL, 0},

{"LastROMPath0", 1, LastROMPath[0], 0, "", 511},
{"LastROMPath1", 1, LastROMPath[1], 0, "", 511},
{"LastROMPath2", 1, LastROMPath[2], 0, "", 511},
{"LastROMPath3", 1, LastROMPath[3], 0, "", 511},
{"LastROMPath4", 1, LastROMPath[4], 0, "", 511},
{"ScreenAspectTop", 0, &ScreenAspectTop, 0, NULL, 0},
{"ScreenAspectBot", 0, &ScreenAspectBot, 0, NULL, 0},

{"LastROMPath0", 1, LastROMPath[0], 0, "", 511},
{"LastROMPath1", 1, LastROMPath[1], 0, "", 511},
{"LastROMPath2", 1, LastROMPath[2], 0, "", 511},
{"LastROMPath3", 1, LastROMPath[3], 0, "", 511},
{"LastROMPath4", 1, LastROMPath[4], 0, "", 511},

{"LastROMFolder", 1, LastROMFolder, 0, "/", 511},

Expand Down
2 changes: 2 additions & 0 deletions src/frontend/switch/PlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ extern int ScreenSwap;
extern int ScreenSizing;
extern int Filtering;
extern int IntegerScaling;
extern int ScreenAspectTop;
extern int ScreenAspectBot;

extern char LastROMPath[5][512];

Expand Down
6 changes: 4 additions & 2 deletions src/frontend/switch/SettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,11 @@ void DoGui(BoxGui::Frame& parent)
SectionHeader(settingsFrame, settingsSkewer, "Screens");

DoCombobox(settingsFrame, settingsSkewer, "Rotation", "\090°\000180°\000270°\0", Config::ScreenRotation, true);
DoCombobox(settingsFrame, settingsSkewer, "Sizing", "Even\0Emphasise top\0Emphasise bottom\0Auto\0", Config::ScreenSizing);
DoCombobox(settingsFrame, settingsSkewer, "Sizing", "Even\0Emphasise top\0Emphasise bottom\0Auto\0Top only\0Bottom only\0", Config::ScreenSizing);
DoCombobox(settingsFrame, settingsSkewer, "Gap", "0px\0001px\08px\00064px\090px\000128px\0", Config::ScreenGap);
DoCombobox(settingsFrame, settingsSkewer, "Layout", "Natural\0Vertical\0Horizontal\0", Config::ScreenLayout);
DoCombobox(settingsFrame, settingsSkewer, "Layout", "Natural\0Vertical\0Horizontal\0Hybrid\0", Config::ScreenLayout);
DoCombobox(settingsFrame, settingsSkewer, "Aspect ratio top", "4:3 (native)\00016:9\0", Config::ScreenAspectTop);
DoCombobox(settingsFrame, settingsSkewer, "Aspect ratio bottom", "4:3 (native)\00016:9\0", Config::ScreenAspectBot);
bool screenSwap = Config::ScreenSwap;
DoCheckbox(settingsFrame, settingsSkewer, "Swap screens", screenSwap);
Config::ScreenSwap = screenSwap;
Expand Down
Loading

0 comments on commit caf4ce1

Please sign in to comment.