mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Buildfixes
This commit is contained in:
1 parent
cb18929f3a
commit
00a566514e
4 files changed
+58
-68
No files matched your search
+33
-56
@@ -1326,14 +1326,12 @@ void retro_get_system_av_info(struct retro_system_av_info *info)
|
||||
|
||||
unsigned retro_api_version(void) { return RETRO_API_VERSION; }
|
||||
|
||||
namespace Libretro
|
||||
{
|
||||
namespace Libretro {
|
||||
bool useEmuThread = false;
|
||||
std::atomic<EmuThreadState> emuThreadState(EmuThreadState::DISABLED);
|
||||
|
||||
static std::thread emuThread;
|
||||
static void EmuFrame()
|
||||
{
|
||||
static void EmuFrame() {
|
||||
ctx->SetRenderTarget();
|
||||
Draw::DrawContext *draw = ctx->GetDrawContext();
|
||||
if (draw) {
|
||||
@@ -1380,12 +1378,10 @@ namespace Libretro
|
||||
}
|
||||
}
|
||||
|
||||
static void EmuThreadFunc()
|
||||
{
|
||||
static void EmuThreadFunc() {
|
||||
SetCurrentThreadName("EmuThread");
|
||||
|
||||
for (;;)
|
||||
{
|
||||
for (;;) {
|
||||
switch ((EmuThreadState)emuThreadState)
|
||||
{
|
||||
case EmuThreadState::START_REQUESTED:
|
||||
@@ -1408,8 +1404,7 @@ namespace Libretro
|
||||
}
|
||||
}
|
||||
|
||||
void EmuThreadStart()
|
||||
{
|
||||
void EmuThreadStart() {
|
||||
EmuThreadState state = emuThreadState;
|
||||
bool wasPaused = state == EmuThreadState::PAUSED;
|
||||
|
||||
@@ -1425,8 +1420,7 @@ namespace Libretro
|
||||
}
|
||||
}
|
||||
|
||||
void EmuThreadStop()
|
||||
{
|
||||
void EmuThreadStop() {
|
||||
if (emuThreadState != EmuThreadState::RUNNING)
|
||||
return;
|
||||
|
||||
@@ -1442,8 +1436,7 @@ namespace Libretro
|
||||
ctx->ThreadEnd();
|
||||
}
|
||||
|
||||
void EmuThreadPause()
|
||||
{
|
||||
void EmuThreadPause() {
|
||||
if (emuThreadState != EmuThreadState::RUNNING)
|
||||
return;
|
||||
|
||||
@@ -1458,13 +1451,11 @@ namespace Libretro
|
||||
|
||||
} // namespace Libretro
|
||||
|
||||
static void retro_check_backend(void)
|
||||
{
|
||||
static void retro_check_backend(void) {
|
||||
struct retro_variable var = {0};
|
||||
|
||||
var.key = "ppsspp_backend";
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
||||
{
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
|
||||
if (!strcmp(var.value, "auto"))
|
||||
backend = RETRO_HW_CONTEXT_DUMMY;
|
||||
else if (!strcmp(var.value, "opengl"))
|
||||
@@ -1478,11 +1469,9 @@ static void retro_check_backend(void)
|
||||
}
|
||||
}
|
||||
|
||||
bool retro_load_game(const struct retro_game_info *game)
|
||||
{
|
||||
bool retro_load_game(const struct retro_game_info *game) {
|
||||
retro_pixel_format fmt = retro_pixel_format::RETRO_PIXEL_FORMAT_XRGB8888;
|
||||
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
|
||||
{
|
||||
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt)) {
|
||||
ERROR_LOG(Log::System, "XRGB8888 is not supported.\n");
|
||||
return false;
|
||||
}
|
||||
@@ -1554,10 +1543,10 @@ bool retro_load_game(const struct retro_game_info *game)
|
||||
return true;
|
||||
}
|
||||
|
||||
void retro_unload_game(void)
|
||||
{
|
||||
if (Libretro::useEmuThread)
|
||||
Libretro::EmuThreadStop();
|
||||
void retro_unload_game(void) {
|
||||
if (Libretro::useEmuThread) {
|
||||
Libretro::EmuThreadStop();
|
||||
}
|
||||
|
||||
PSP_Shutdown(true);
|
||||
g_VFS.Clear();
|
||||
@@ -1567,19 +1556,16 @@ void retro_unload_game(void)
|
||||
PSP_CoreParameter().graphicsContext = nullptr;
|
||||
}
|
||||
|
||||
void retro_reset(void)
|
||||
{
|
||||
void retro_reset(void) {
|
||||
PSP_Shutdown(true);
|
||||
|
||||
if (BootState::Complete != PSP_Init(PSP_CoreParameter(), &g_bootErrorString))
|
||||
{
|
||||
if (BootState::Complete != PSP_Init(PSP_CoreParameter(), &g_bootErrorString)) {
|
||||
ERROR_LOG(Log::Boot, "%s", g_bootErrorString.c_str());
|
||||
environ_cb(RETRO_ENVIRONMENT_SHUTDOWN, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
static void retro_input(void)
|
||||
{
|
||||
static void retro_input(void) {
|
||||
unsigned i;
|
||||
int16_t ret = 0;
|
||||
// clang-format off
|
||||
@@ -1605,26 +1591,20 @@ static void retro_input(void)
|
||||
|
||||
input_poll_cb();
|
||||
|
||||
if (libretro_supports_bitmasks)
|
||||
if (libretro_supports_bitmasks) {
|
||||
ret = input_state_cb(0, RETRO_DEVICE_JOYPAD,
|
||||
0, RETRO_DEVICE_ID_JOYPAD_MASK);
|
||||
else
|
||||
{
|
||||
0, RETRO_DEVICE_ID_JOYPAD_MASK);
|
||||
} else {
|
||||
for (i = RETRO_DEVICE_ID_JOYPAD_B; i <= RETRO_DEVICE_ID_JOYPAD_R; i++)
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, i))
|
||||
ret |= (1 << i);
|
||||
}
|
||||
|
||||
for (i = 0; i < sizeof(map) / sizeof(*map); i++)
|
||||
{
|
||||
for (i = 0; i < sizeof(map) / sizeof(*map); i++) {
|
||||
bool pressed = ret & (1 << map[i].retro);
|
||||
|
||||
if (pressed)
|
||||
{
|
||||
if (pressed) {
|
||||
__CtrlUpdateButtons(map[i].sceCtrl, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
__CtrlUpdateButtons(0, map[i].sceCtrl);
|
||||
}
|
||||
}
|
||||
@@ -1676,8 +1656,7 @@ static void retro_input(void)
|
||||
__CtrlSetAnalogXY(CTRL_STICK_RIGHT, x_right, y_right);
|
||||
}
|
||||
|
||||
void retro_run(void)
|
||||
{
|
||||
void retro_run(void) {
|
||||
if (g_pendingBoot) {
|
||||
BootState state = PSP_InitUpdate(&g_bootErrorString);
|
||||
switch (state) {
|
||||
@@ -1715,8 +1694,7 @@ void retro_run(void)
|
||||
}
|
||||
|
||||
// TODO: This seems dubious.
|
||||
if (softwareRenderInitHack)
|
||||
{
|
||||
if (softwareRenderInitHack) {
|
||||
log_cb(RETRO_LOG_DEBUG, "Software rendering init hack for opengl triggered.\n");
|
||||
softwareRenderInitHack = false;
|
||||
g_Config.bSoftwareRendering = true;
|
||||
@@ -1963,10 +1941,11 @@ int64_t System_GetPropertyInt(SystemProperty prop) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
float System_GetPropertyFloat(SystemProperty prop)
|
||||
{
|
||||
switch (prop)
|
||||
{
|
||||
bool System_SendDebugOutput(std::string_view data) { return false; }
|
||||
void System_SendDebugScreenshot(const uint8_t *data, int width, int height) {}
|
||||
|
||||
float System_GetPropertyFloat(SystemProperty prop) {
|
||||
switch (prop) {
|
||||
case SYSPROP_DISPLAY_REFRESH_RATE:
|
||||
return 60.0f / 1.001f;
|
||||
case SYSPROP_DISPLAY_SAFE_INSET_LEFT:
|
||||
@@ -1981,10 +1960,8 @@ float System_GetPropertyFloat(SystemProperty prop)
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool System_GetPropertyBool(SystemProperty prop)
|
||||
{
|
||||
switch (prop)
|
||||
{
|
||||
bool System_GetPropertyBool(SystemProperty prop) {
|
||||
switch (prop) {
|
||||
case SYSPROP_CAN_JIT:
|
||||
#if PPSSPP_PLATFORM(IOS)
|
||||
bool can_jit;
|
||||
|
||||
Reference in new issue
Block a user