mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-11 07:03:33 +02:00
Link backtrace.cpp on Android too for consistency. Use it in FLOG.
This commit is contained in:
@@ -10,6 +10,7 @@ LOCAL_SRC_FILES :=\
|
||||
android/native_audio.cpp \
|
||||
audio/wav_read.cpp \
|
||||
audio/mixer.cpp.arm \
|
||||
base/backtrace.cpp \
|
||||
base/buffer.cpp \
|
||||
base/display.cpp \
|
||||
base/timeutil.cpp \
|
||||
|
||||
+10
-3
@@ -400,6 +400,8 @@ int main(int argc, char *argv[]) {
|
||||
SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1);
|
||||
|
||||
int mode;
|
||||
float set_dpi = 1.0f;
|
||||
float set_scale = 1.0f;
|
||||
#ifdef USING_GLES2
|
||||
mode = SDL_SWSURFACE | SDL_FULLSCREEN;
|
||||
int set_xres = -1;
|
||||
@@ -409,7 +411,6 @@ int main(int argc, char *argv[]) {
|
||||
int set_xres = -1;
|
||||
int set_yres = -1;
|
||||
|
||||
float set_dpi = 1.0f;
|
||||
for (int i = 1; i < argc; i++) {
|
||||
if (!strcmp(argv[i],"--fullscreen"))
|
||||
mode |= SDL_FULLSCREEN;
|
||||
@@ -420,6 +421,8 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
if (set_dpi == -2)
|
||||
set_dpi = parseFloat(argv[i]);
|
||||
if (set_scale == -2)
|
||||
set_scale = parseFloat(argv[i]);
|
||||
|
||||
if (!strcmp(argv[i],"--xres"))
|
||||
set_xres = -2;
|
||||
@@ -427,6 +430,8 @@ int main(int argc, char *argv[]) {
|
||||
set_yres = -2;
|
||||
if (!strcmp(argv[i],"--dpi"))
|
||||
set_dpi = -2;
|
||||
if (!strcmp(argv[i],"--scale"))
|
||||
set_scale = -2;
|
||||
}
|
||||
#endif
|
||||
if (mode & SDL_FULLSCREEN) {
|
||||
@@ -438,13 +443,15 @@ int main(int argc, char *argv[]) {
|
||||
#endif
|
||||
} else {
|
||||
// set a sensible default resolution (2x)
|
||||
pixel_xres = 480 * 2;
|
||||
pixel_yres = 272 * 2;
|
||||
pixel_xres = 480 * 2 * set_scale;
|
||||
pixel_yres = 272 * 2 * set_scale;
|
||||
#ifdef PPSSPP
|
||||
g_Config.bFullScreen = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
set_dpi = 1.0f / set_dpi;
|
||||
|
||||
if (!landscape) {
|
||||
std::swap(pixel_xres, pixel_yres);
|
||||
}
|
||||
|
||||
+10
-3
@@ -1,8 +1,7 @@
|
||||
#include "base/backtrace.h"
|
||||
|
||||
#ifdef __linux__
|
||||
|
||||
// LINUX ONLY
|
||||
// The mac check doesn't seem to work right.
|
||||
#if (!defined(ANDROID) && defined(__linux__)) || (defined(__APPLE__) && (defined(_M_IX86) || defined(_M_X64)))
|
||||
|
||||
#include <execinfo.h>
|
||||
#include <unistd.h>
|
||||
@@ -14,4 +13,12 @@ void PrintBacktraceToStderr() {
|
||||
backtrace_symbols_fd(backtrace_buffer, num_addrs, STDERR_FILENO);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void PrintBacktraceToStderr() {
|
||||
fprintf(stderr, "No backtrace available to print on this platform\n");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "backtrace.h"
|
||||
|
||||
// Simple wrapper around Android's logging interface that also allows other
|
||||
// implementations, and also some misc utilities.
|
||||
|
||||
@@ -29,12 +31,14 @@ inline void Crash() { __asm { int 3 }; }
|
||||
|
||||
#if defined(ARM) || defined(MIPS)
|
||||
inline void Crash() {
|
||||
PrintBacktraceToStderr();
|
||||
char *p = (char *)1337;
|
||||
*p = 1;
|
||||
}
|
||||
#else
|
||||
// TODO: 64-bit version
|
||||
inline void Crash() {
|
||||
PrintBacktraceToStderr();
|
||||
asm("int $0x3");
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user