Merge branch 'master' (early part) into medusa

This commit is contained in:
Vicki Pfau 2019-06-28 17:21:39 -07:00
commit 7ef60af5fa
12 changed files with 5613 additions and 560 deletions

View File

@ -8,6 +8,7 @@ env:
- DOCKER_TAG=ubuntu:xenial - DOCKER_TAG=ubuntu:xenial
- DOCKER_TAG=ubuntu:bionic - DOCKER_TAG=ubuntu:bionic
- DOCKER_TAG=ubuntu:cosmic - DOCKER_TAG=ubuntu:cosmic
- DOCKER_TAG=ubuntu:disco
- DOCKER_TAG=3ds - DOCKER_TAG=3ds
- DOCKER_TAG=wii - DOCKER_TAG=wii
- DOCKER_TAG=vita - DOCKER_TAG=vita

View File

@ -46,6 +46,8 @@ Other fixes:
- Qt: Fix saved scale not getting set on resize (fixes mgba.io/i/1074) - Qt: Fix saved scale not getting set on resize (fixes mgba.io/i/1074)
- CMake: Fix .deb imagemagick dependencies - CMake: Fix .deb imagemagick dependencies
- Qt: Fix crash in sprite viewer magnification (fixes mgba.io/i/1362) - Qt: Fix crash in sprite viewer magnification (fixes mgba.io/i/1362)
- 3DS: Ensure core 2 can be used for threaded renderer (fixes mgba.io/i/1371)
- GB Core: Fix toggling WIN and OBJ being swapped
Misc: Misc:
- GBA Savedata: EEPROM performance fixes - GBA Savedata: EEPROM performance fixes
- GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash - GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash

View File

@ -202,8 +202,7 @@ list(APPEND UTIL_SRC ${CMAKE_CURRENT_BINARY_DIR}/version.c)
source_group("Generated sources" FILES ${CMAKE_CURRENT_BINARY_DIR}/version.c) source_group("Generated sources" FILES ${CMAKE_CURRENT_BINARY_DIR}/version.c)
# Advanced settings # Advanced settings
if(NOT DEFINED 3DS AND NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_COMPILER_VERSION VERSION_LESS "4.5")) if(NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_COMPILER_VERSION VERSION_LESS "4.5"))
# LTO appears to make 3DS binary slower
set(DEFAULT_LTO ON) set(DEFAULT_LTO ON)
else() else()
set(DEFAULT_LTO OFF) set(DEFAULT_LTO OFF)

View File

@ -95,6 +95,20 @@ union PSR {
#endif #endif
}; };
struct {
#if defined(__BIG_ENDIAN__)
uint8_t flags;
uint8_t status;
uint8_t extension;
uint8_t control;
#else
uint8_t control;
uint8_t extension;
uint8_t status;
uint8_t flags;
#endif
};
int32_t packed; int32_t packed;
}; };

View File

@ -186,6 +186,7 @@ static inline void _immediate(struct ARMCore* cpu, uint32_t opcode) {
// Beware pre-processor antics // Beware pre-processor antics
ATTRIBUTE_NOINLINE static void _additionS(struct ARMCore* cpu, int32_t m, int32_t n, int32_t d) { ATTRIBUTE_NOINLINE static void _additionS(struct ARMCore* cpu, int32_t m, int32_t n, int32_t d) {
cpu->cpsr.flags = 0;
cpu->cpsr.n = ARM_SIGN(d); cpu->cpsr.n = ARM_SIGN(d);
cpu->cpsr.z = !d; cpu->cpsr.z = !d;
cpu->cpsr.c = ARM_CARRY_FROM(m, n, d); cpu->cpsr.c = ARM_CARRY_FROM(m, n, d);
@ -193,6 +194,7 @@ ATTRIBUTE_NOINLINE static void _additionS(struct ARMCore* cpu, int32_t m, int32_
} }
ATTRIBUTE_NOINLINE static void _subtractionS(struct ARMCore* cpu, int32_t m, int32_t n, int32_t d) { ATTRIBUTE_NOINLINE static void _subtractionS(struct ARMCore* cpu, int32_t m, int32_t n, int32_t d) {
cpu->cpsr.flags = 0;
cpu->cpsr.n = ARM_SIGN(d); cpu->cpsr.n = ARM_SIGN(d);
cpu->cpsr.z = !d; cpu->cpsr.z = !d;
cpu->cpsr.c = ARM_BORROW_FROM(m, n, d); cpu->cpsr.c = ARM_BORROW_FROM(m, n, d);

View File

@ -12,12 +12,14 @@
// Beware pre-processor insanity // Beware pre-processor insanity
#define THUMB_ADDITION_S(M, N, D) \ #define THUMB_ADDITION_S(M, N, D) \
cpu->cpsr.flags = 0; \
cpu->cpsr.n = ARM_SIGN(D); \ cpu->cpsr.n = ARM_SIGN(D); \
cpu->cpsr.z = !(D); \ cpu->cpsr.z = !(D); \
cpu->cpsr.c = ARM_CARRY_FROM(M, N, D); \ cpu->cpsr.c = ARM_CARRY_FROM(M, N, D); \
cpu->cpsr.v = ARM_V_ADDITION(M, N, D); cpu->cpsr.v = ARM_V_ADDITION(M, N, D);
#define THUMB_SUBTRACTION_S(M, N, D) \ #define THUMB_SUBTRACTION_S(M, N, D) \
cpu->cpsr.flags = 0; \
cpu->cpsr.n = ARM_SIGN(D); \ cpu->cpsr.n = ARM_SIGN(D); \
cpu->cpsr.z = !(D); \ cpu->cpsr.z = !(D); \
cpu->cpsr.c = ARM_BORROW_FROM(M, N, D); \ cpu->cpsr.c = ARM_BORROW_FROM(M, N, D); \

View File

@ -826,10 +826,10 @@ static void _GBCoreEnableVideoLayer(struct mCore* core, size_t id, bool enable)
gb->video.renderer->disableBG = !enable; gb->video.renderer->disableBG = !enable;
break; break;
case 1: case 1:
gb->video.renderer->disableOBJ = !enable; gb->video.renderer->disableWIN = !enable;
break; break;
case 2: case 2:
gb->video.renderer->disableWIN = !enable; gb->video.renderer->disableOBJ = !enable;
break; break;
default: default:
break; break;

View File

@ -104,6 +104,7 @@ static C3D_RenderTarget* upscaleBuffer;
static C3D_Tex upscaleBufferTex; static C3D_Tex upscaleBufferTex;
static aptHookCookie cookie; static aptHookCookie cookie;
static bool core2;
extern bool allocateRomBuffer(void); extern bool allocateRomBuffer(void);
@ -258,9 +259,7 @@ static void _resetCamera(struct m3DSImageSource* imageSource) {
} }
static void _setup(struct mGUIRunner* runner) { static void _setup(struct mGUIRunner* runner) {
bool n3ds = false; if (core2) {
APT_CheckNew3DS(&n3ds);
if (n3ds) {
mCoreConfigSetDefaultIntValue(&runner->config, "threadedVideo", 1); mCoreConfigSetDefaultIntValue(&runner->config, "threadedVideo", 1);
mCoreLoadForeignConfig(runner->core, &runner->config); mCoreLoadForeignConfig(runner->core, &runner->config);
} }
@ -752,6 +751,10 @@ static void _postAudioBuffer(struct mAVStream* stream, blip_t* left, blip_t* rig
} }
} }
THREAD_ENTRY _core2Test(void* context) {
UNUSED(context);
}
int main() { int main() {
rotation.d.sample = _sampleRotation; rotation.d.sample = _sampleRotation;
rotation.d.readTiltX = _readTiltX; rotation.d.readTiltX = _readTiltX;
@ -953,6 +956,12 @@ int main() {
APT_SetAppCpuTimeLimit(20); APT_SetAppCpuTimeLimit(20);
runner.autosave.thread = threadCreate(mGUIAutosaveThread, &runner.autosave, 0x4000, 0x1F, 1, true); runner.autosave.thread = threadCreate(mGUIAutosaveThread, &runner.autosave, 0x4000, 0x1F, 1, true);
Thread thread2;
if (ThreadCreate(&thread2, _core2Test, NULL) == 0) {
core2 = true;
ThreadJoin(thread2);
}
mGUIInit(&runner, "3ds"); mGUIInit(&runner, "3ds");
_map3DSKey(&runner.params.keyMap, KEY_X, GUI_INPUT_CANCEL); _map3DSKey(&runner.params.keyMap, KEY_X, GUI_INPUT_CANCEL);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,7 @@ adddep() {
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
DEB=$1 DEB=$1
dpkg-deb -R $DEB deb-temp dpkg-deb -R $DEB deb-temp
PKG=`head -n1 deb-temp/DEBIAN/control | cut -f2 -d ' '` PKG=`grep Package deb-temp/DEBIAN/control | cut -f2 -d ' '`
echo Found package $PKG echo Found package $PKG
case $PKG in case $PKG in
@ -30,9 +30,12 @@ while [ $# -gt 0 ]; do
PKG=$BINARY-qt PKG=$BINARY-qt
rmdep libav rmdep libav
rmdep libedit rmdep libedit
rmdep libelf
rmdep libpng rmdep libpng
rmdep libzip rmdep libzip
rmdep libmagickwand rmdep libmagickwand
rmdep libsqlite3
rmdep libswresample
rmdep libswscale rmdep libswscale
rmdep zlib rmdep zlib
adddep lib$BINARY adddep lib$BINARY
@ -41,10 +44,13 @@ while [ $# -gt 0 ]; do
PKG=$BINARY-sdl PKG=$BINARY-sdl
rmdep libav rmdep libav
rmdep libedit rmdep libedit
rmdep libelf
rmdep libpng rmdep libpng
rmdep qt rmdep qt
rmdep libzip rmdep libzip
rmdep libmagickwand rmdep libmagickwand
rmdep libsqlite3
rmdep libswresample
rmdep libswscale rmdep libswscale
rmdep zlib rmdep zlib
adddep lib$BINARY adddep lib$BINARY