Add Nintendo Switch initial support

This commit is contained in:
Adrian Graber
2021-07-04 18:52:48 +02:00
parent f50026828a
commit 28f266302f
13 changed files with 273 additions and 12 deletions

View File

@ -11,6 +11,10 @@
#define __STDC_LIMIT_MACROS // so we get UINT32_MAX etc
#endif
#ifdef GTA_SWITCH
#include <switch.h>
#endif
#include <stdint.h>
#include <string.h>
#include <math.h>

View File

@ -319,7 +319,7 @@ enum Config {
#if !defined(RW_GL3) && defined(_WIN32)
#define XINPUT
#endif
#if defined XINPUT || (defined RW_GL3 && !defined LIBRW_SDL2 && !defined __SWITCH__)
#if defined XINPUT || (defined RW_GL3 && !defined LIBRW_SDL2 && !defined GTA_SWITCH)
#define DETECT_JOYSTICK_MENU // Then we'll expect user to enter Controller->Detect joysticks if his joystick isn't detected at the start.
#endif
#define DETECT_PAD_INPUT_SWITCH // Adds automatic switch of pad related stuff between controller and kb/m
@ -439,7 +439,7 @@ enum Config {
#endif
// Streaming
#if !defined(_WIN32) && !defined(__SWITCH__)
#if !defined(_WIN32) && !defined(GTA_SWITCH)
//#define ONE_THREAD_PER_CHANNEL // Don't use if you're not on SSD/Flash - also not utilized too much right now(see commented LoadAllRequestedModels in Streaming.cpp)
#define FLUSHABLE_STREAMING // Make it possible to interrupt reading when processing file isn't needed anymore.
#endif
@ -461,4 +461,9 @@ enum Config {
#undef PEDS_REPORT_CRIMES_ON_PHONE
#endif
#ifdef GTA_SWITCH
#define IGNORE_MOUSE_KEYBOARD // ignore mouse & keyboard input
#define USE_UNNAMED_SEM // named semaphores are unsupported on the switch
#endif
#endif // VANILLA_DEFINES

View File

@ -45,9 +45,7 @@
#include "Population.h"
#include "IniFile.h"
#ifdef DETECT_JOYSTICK_MENU
#include "crossplatform.h"
#endif
#ifndef _WIN32
#include "assert.h"