mirror of https://github.com/mgba-emu/mgba.git
Merge branch 'master' (early part) into medusa
This commit is contained in:
commit
1a0e44c014
2
CHANGES
2
CHANGES
|
@ -71,6 +71,8 @@ Bugfixes:
|
||||||
- GB Timer: Minor accuracy improvements
|
- GB Timer: Minor accuracy improvements
|
||||||
- GB Audio: Clock frame events on DIV
|
- GB Audio: Clock frame events on DIV
|
||||||
- GBA: Fix SharkPort saves for EEPROM games
|
- GBA: Fix SharkPort saves for EEPROM games
|
||||||
|
- Qt: Fix opening in fullscreen (fixes mgba.io/i/993)
|
||||||
|
- Python: Fix package directory
|
||||||
Misc:
|
Misc:
|
||||||
- GBA Timer: Use global cycles for timers
|
- GBA Timer: Use global cycles for timers
|
||||||
- GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)
|
- GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)
|
||||||
|
|
|
@ -322,13 +322,20 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Generic")
|
||||||
check_function_exists(uselocale HAVE_USELOCALE)
|
check_function_exists(uselocale HAVE_USELOCALE)
|
||||||
check_function_exists(setlocale HAVE_SETLOCALE)
|
check_function_exists(setlocale HAVE_SETLOCALE)
|
||||||
else()
|
else()
|
||||||
if(DEFINED 3DS)
|
if(DEFINED 3DS OR DEFINED WII)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS -Wl,--require-defined,snprintf_l)
|
||||||
check_function_exists(snprintf_l HAVE_SNPRINTF_L)
|
check_function_exists(snprintf_l HAVE_SNPRINTF_L)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS -Wl,--require-defined,strtof_l)
|
||||||
check_function_exists(strtof_l HAVE_STRTOF_L)
|
check_function_exists(strtof_l HAVE_STRTOF_L)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS -Wl,--require-defined,newlocale)
|
||||||
check_function_exists(newlocale HAVE_NEWLOCALE)
|
check_function_exists(newlocale HAVE_NEWLOCALE)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS -Wl,--require-defined,freelocale)
|
||||||
check_function_exists(freelocale HAVE_FREELOCALE)
|
check_function_exists(freelocale HAVE_FREELOCALE)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS -Wl,--require-defined,uselocale)
|
||||||
check_function_exists(uselocale HAVE_USELOCALE)
|
check_function_exists(uselocale HAVE_USELOCALE)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS -Wl,--require-defined,setlocale)
|
||||||
check_function_exists(setlocale HAVE_SETLOCALE)
|
check_function_exists(setlocale HAVE_SETLOCALE)
|
||||||
|
unset(CMAKE_REQUIRED_FLAGS)
|
||||||
endif()
|
endif()
|
||||||
if(NOT DEFINED 3DS AND NOT DEFINED PSP2 AND NOT DEFINED WII)
|
if(NOT DEFINED 3DS AND NOT DEFINED PSP2 AND NOT DEFINED WII)
|
||||||
set(DISABLE_DEPS ON CACHE BOOL "This platform cannot build with dependencies" FORCE)
|
set(DISABLE_DEPS ON CACHE BOOL "This platform cannot build with dependencies" FORCE)
|
||||||
|
@ -355,7 +362,7 @@ if(HAVE_LOCALTIME_R)
|
||||||
list(APPEND FUNCTION_DEFINES HAVE_LOCALTIME_R)
|
list(APPEND FUNCTION_DEFINES HAVE_LOCALTIME_R)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(HAVE_NEWLOCALE AND HAVE_FREELOCALE AND HAVE_USELOCALE OR APPLE OR DEFINED 3DS)
|
if(HAVE_NEWLOCALE AND HAVE_FREELOCALE AND HAVE_USELOCALE OR APPLE)
|
||||||
list(APPEND FUNCTION_DEFINES HAVE_LOCALE)
|
list(APPEND FUNCTION_DEFINES HAVE_LOCALE)
|
||||||
if (HAVE_STRTOF_L)
|
if (HAVE_STRTOF_L)
|
||||||
list(APPEND FUNCTION_DEFINES HAVE_STRTOF_L)
|
list(APPEND FUNCTION_DEFINES HAVE_STRTOF_L)
|
||||||
|
@ -379,6 +386,7 @@ endif()
|
||||||
|
|
||||||
# Feature dependencies
|
# Feature dependencies
|
||||||
set(FEATURE_DEFINES)
|
set(FEATURE_DEFINES)
|
||||||
|
set(FEATURE_FLAGS)
|
||||||
set(FEATURES)
|
set(FEATURES)
|
||||||
set(ENABLES)
|
set(ENABLES)
|
||||||
if(CMAKE_SYSTEM_NAME MATCHES .*BSD)
|
if(CMAKE_SYSTEM_NAME MATCHES .*BSD)
|
||||||
|
@ -517,6 +525,7 @@ if(USE_MAGICK)
|
||||||
set(MAGICKWAND_DEB_VERSION "-6.q16-2")
|
set(MAGICKWAND_DEB_VERSION "-6.q16-2")
|
||||||
endif()
|
endif()
|
||||||
list(APPEND FEATURE_DEFINES MAGICKWAND_VERSION_MAJOR=${MAGICKWAND_VERSION_MAJOR})
|
list(APPEND FEATURE_DEFINES MAGICKWAND_VERSION_MAJOR=${MAGICKWAND_VERSION_MAJOR})
|
||||||
|
list(APPEND FEATURE_FLAGS ${MAGICKWAND_CFLAGS_OTHER})
|
||||||
|
|
||||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libmagickwand${MAGICKWAND_DEB_VERSION}")
|
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libmagickwand${MAGICKWAND_DEB_VERSION}")
|
||||||
endif()
|
endif()
|
||||||
|
@ -807,7 +816,7 @@ if(NOT SKIP_LIBRARY)
|
||||||
add_library(${BINARY_NAME} SHARED ${SRC} ${VFS_SRC})
|
add_library(${BINARY_NAME} SHARED ${SRC} ${VFS_SRC})
|
||||||
if(BUILD_STATIC)
|
if(BUILD_STATIC)
|
||||||
add_library(${BINARY_NAME}-static STATIC ${SRC})
|
add_library(${BINARY_NAME}-static STATIC ${SRC})
|
||||||
set_target_properties(${BINARY_NAME}-static PROPERTIES COMPILE_DEFINITIONS "${OS_DEFINES};${FEATURE_DEFINES};${FUNCTION_DEFINES}")
|
set_target_properties(${BINARY_NAME}-static PROPERTIES COMPILE_DEFINITIONS "${OS_DEFINES};${FEATURE_DEFINES};${FUNCTION_DEFINES}" COMPILE_OPTIONS "${FEATURE_FLAGS}")
|
||||||
install(TARGETS ${BINARY_NAME}-static DESTINATION ${LIBDIR} COMPONENT lib${BINARY_NAME})
|
install(TARGETS ${BINARY_NAME}-static DESTINATION ${LIBDIR} COMPONENT lib${BINARY_NAME})
|
||||||
add_dependencies(${BINARY_NAME}-static version-info)
|
add_dependencies(${BINARY_NAME}-static version-info)
|
||||||
endif()
|
endif()
|
||||||
|
@ -816,7 +825,7 @@ if(NOT SKIP_LIBRARY)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_dependencies(${BINARY_NAME} version-info)
|
add_dependencies(${BINARY_NAME} version-info)
|
||||||
set_target_properties(${BINARY_NAME} PROPERTIES VERSION ${LIB_VERSION_STRING} SOVERSION ${LIB_VERSION_ABI} COMPILE_DEFINITIONS "${OS_DEFINES};${FEATURE_DEFINES};${FUNCTION_DEFINES}")
|
set_target_properties(${BINARY_NAME} PROPERTIES VERSION ${LIB_VERSION_STRING} SOVERSION ${LIB_VERSION_ABI} COMPILE_DEFINITIONS "${OS_DEFINES};${FEATURE_DEFINES};${FUNCTION_DEFINES}" COMPILE_OPTIONS "${FEATURE_FLAGS}")
|
||||||
|
|
||||||
target_link_libraries(${BINARY_NAME} ${DEBUGGER_LIB} ${DEPENDENCY_LIB} ${OS_LIB})
|
target_link_libraries(${BINARY_NAME} ${DEBUGGER_LIB} ${DEPENDENCY_LIB} ${OS_LIB})
|
||||||
install(TARGETS ${BINARY_NAME} LIBRARY DESTINATION ${LIBDIR} COMPONENT lib${BINARY_NAME} NAMELINK_SKIP ARCHIVE DESTINATION ${LIBDIR} RUNTIME DESTINATION ${LIBDIR} COMPONENT lib${BINARY_NAME})
|
install(TARGETS ${BINARY_NAME} LIBRARY DESTINATION ${LIBDIR} COMPONENT lib${BINARY_NAME} NAMELINK_SKIP ARCHIVE DESTINATION ${LIBDIR} RUNTIME DESTINATION ${LIBDIR} COMPONENT lib${BINARY_NAME})
|
||||||
|
|
|
@ -124,7 +124,7 @@ Note that you should not do a `make install` on macOS, as it will not work prope
|
||||||
|
|
||||||
#### Windows developer building
|
#### Windows developer building
|
||||||
|
|
||||||
To build on Windows for development, using MSYS2 is recommended. Follow the installation steps found on their [website](https://msys2.github.io). Make sure you're running the 32-bit version ("MSYS2 MinGW 32-bit") (or the 64-bit version "MSYS2 MinGW 64-bit" if you want to build for x86_64) and run this additional command (including the braces) to install the needed dependencies (please note that this involves downloading over 500MiB of packages, so it will take a long time):
|
To build on Windows for development, using MSYS2 is recommended. Follow the installation steps found on their [website](https://msys2.github.io). Make sure you're running the 32-bit version ("MSYS2 MinGW 32-bit") (or the 64-bit version "MSYS2 MinGW 64-bit" if you want to build for x86_64) and run this additional command (including the braces) to install the needed dependencies (please note that this involves downloading over 1100MiB of packages, so it will take a long time):
|
||||||
|
|
||||||
For x86 (32 bit) builds:
|
For x86 (32 bit) builds:
|
||||||
|
|
||||||
|
@ -221,7 +221,7 @@ Missing features on DS are
|
||||||
Copyright
|
Copyright
|
||||||
---------
|
---------
|
||||||
|
|
||||||
medusa is Copyright © 2013 – 2017 Jeffrey Pfau. It is distributed under the [Mozilla Public License version 2.0](https://www.mozilla.org/MPL/2.0/). A copy of the license is available in the distributed LICENSE file.
|
medusa is Copyright © 2013 – 2019 Jeffrey Pfau. It is distributed under the [Mozilla Public License version 2.0](https://www.mozilla.org/MPL/2.0/). A copy of the license is available in the distributed LICENSE file.
|
||||||
|
|
||||||
medusa contains the following third-party libraries:
|
medusa contains the following third-party libraries:
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@ Bitte beachte, dass Du unter macOS nicht 'make install' verwenden solltest, da d
|
||||||
|
|
||||||
### Für Entwickler: Kompilieren unter Windows
|
### Für Entwickler: Kompilieren unter Windows
|
||||||
|
|
||||||
Um mGBA auf Windows zu kompilieren, wird MSYS2 empfohlen. Befolge die Installationsschritte auf der [MSYS2-Website](https://msys2.github.io). Stelle sicher, dass Du die 32-Bit-Version ("MSYS2 MinGW 32-bit") (oder die 64-Bit-Version "MSYS2 MinGW 64-bit", wenn Du mGBA für x86_64 kompilieren willst) verwendest und führe folgendes Kommando (einschließlich der Klammern) aus, um alle benötigten Abhängigkeiten zu installieren. Bitte beachte, dass dafür über 500MiB an Paketen heruntergeladen werden, was eine Weile dauern kann):
|
Um mGBA auf Windows zu kompilieren, wird MSYS2 empfohlen. Befolge die Installationsschritte auf der [MSYS2-Website](https://msys2.github.io). Stelle sicher, dass Du die 32-Bit-Version ("MSYS2 MinGW 32-bit") (oder die 64-Bit-Version "MSYS2 MinGW 64-bit", wenn Du mGBA für x86_64 kompilieren willst) verwendest und führe folgendes Kommando (einschließlich der Klammern) aus, um alle benötigten Abhängigkeiten zu installieren. Bitte beachte, dass dafür über 1100MiB an Paketen heruntergeladen werden, was eine Weile dauern kann:
|
||||||
|
|
||||||
Für x86 (32 Bit):
|
Für x86 (32 Bit):
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ Fußnoten
|
||||||
Copyright
|
Copyright
|
||||||
---------
|
---------
|
||||||
|
|
||||||
Copyright für mGBA © 2013 – 2017 Jeffrey Pfau. mGBA wird unter der [Mozilla Public License version 2.0](https://www.mozilla.org/MPL/2.0/) veröffentlicht. Eine Kopie der Lizenz ist in der mitgelieferten Datei LICENSE verfügbar.
|
Copyright für mGBA © 2013 – 2018 Jeffrey Pfau. mGBA wird unter der [Mozilla Public License version 2.0](https://www.mozilla.org/MPL/2.0/) veröffentlicht. Eine Kopie der Lizenz ist in der mitgelieferten Datei LICENSE verfügbar.
|
||||||
|
|
||||||
mGBA beinhaltet die folgenden Bibliotheken von Drittanbietern:
|
mGBA beinhaltet die folgenden Bibliotheken von Drittanbietern:
|
||||||
|
|
||||||
|
|
|
@ -93,6 +93,7 @@ void GBACheatSetGameSharkVersion(struct GBACheatSet* cheats, enum GBACheatGameSh
|
||||||
bool GBACheatAddGameSharkRaw(struct GBACheatSet* cheats, uint32_t op1, uint32_t op2) {
|
bool GBACheatAddGameSharkRaw(struct GBACheatSet* cheats, uint32_t op1, uint32_t op2) {
|
||||||
enum GBAGameSharkType type = op1 >> 28;
|
enum GBAGameSharkType type = op1 >> 28;
|
||||||
struct mCheat* cheat = 0;
|
struct mCheat* cheat = 0;
|
||||||
|
int romPatch = 0;
|
||||||
|
|
||||||
if (cheats->incompleteCheat != COMPLETE) {
|
if (cheats->incompleteCheat != COMPLETE) {
|
||||||
struct mCheat* incompleteCheat = mCheatListGetPointer(&cheats->d.list, cheats->incompleteCheat);
|
struct mCheat* incompleteCheat = mCheatListGetPointer(&cheats->d.list, cheats->incompleteCheat);
|
||||||
|
@ -148,10 +149,16 @@ bool GBACheatAddGameSharkRaw(struct GBACheatSet* cheats, uint32_t op1, uint32_t
|
||||||
cheats->incompleteCheat = mCheatListIndex(&cheats->d.list, cheat);
|
cheats->incompleteCheat = mCheatListIndex(&cheats->d.list, cheat);
|
||||||
break;
|
break;
|
||||||
case GSA_PATCH:
|
case GSA_PATCH:
|
||||||
cheats->romPatches[0].address = BASE_CART0 | ((op1 & 0xFFFFFF) << 1);
|
while (cheats->romPatches[romPatch].exists) {
|
||||||
cheats->romPatches[0].newValue = op2;
|
++romPatch;
|
||||||
cheats->romPatches[0].applied = false;
|
if (romPatch >= MAX_ROM_PATCHES) {
|
||||||
cheats->romPatches[0].exists = true;
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cheats->romPatches[romPatch].address = BASE_CART0 | ((op1 & 0xFFFFFF) << 1);
|
||||||
|
cheats->romPatches[romPatch].newValue = op2;
|
||||||
|
cheats->romPatches[romPatch].applied = false;
|
||||||
|
cheats->romPatches[romPatch].exists = true;
|
||||||
return true;
|
return true;
|
||||||
case GSA_BUTTON:
|
case GSA_BUTTON:
|
||||||
switch (op1 & 0x00F00000) {
|
switch (op1 & 0x00F00000) {
|
||||||
|
|
|
@ -22,7 +22,7 @@ setup(name="${BINARY_NAME}",
|
||||||
url="http://github.com/mgba-emu/mgba/",
|
url="http://github.com/mgba-emu/mgba/",
|
||||||
packages=["mgba"],
|
packages=["mgba"],
|
||||||
package_dir={
|
package_dir={
|
||||||
"mgba": "${CMAKE_CURRENT_SOURCE_DIR}"
|
"mgba": "${CMAKE_CURRENT_SOURCE_DIR}/mgba"
|
||||||
},
|
},
|
||||||
setup_requires=['cffi>=1.6', 'pytest-runner'],
|
setup_requires=['cffi>=1.6', 'pytest-runner'],
|
||||||
install_requires=['cffi>=1.6', 'cached-property'],
|
install_requires=['cffi>=1.6', 'cached-property'],
|
||||||
|
|
|
@ -83,8 +83,8 @@
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>© 2013 – 2017 Jeffrey Pfau, licensed under the Mozilla Public License, version 2.0
|
<string>© 2013 – 2019 Jeffrey Pfau, licensed under the Mozilla Public License, version 2.0
|
||||||
Game Boy and Game Boy Advance are registered trademarks of Nintendo Co., Ltd.</string>
|
Game Boy Advance is a registered trademark of Nintendo Co., Ltd.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignCenter</set>
|
<set>Qt::AlignCenter</set>
|
||||||
|
|
|
@ -217,9 +217,6 @@ if(WIN32)
|
||||||
configure_file(${CMAKE_SOURCE_DIR}/res/win.rc.in ${CMAKE_BINARY_DIR}/res/${BINARY_NAME}.rc)
|
configure_file(${CMAKE_SOURCE_DIR}/res/win.rc.in ${CMAKE_BINARY_DIR}/res/${BINARY_NAME}.rc)
|
||||||
list(APPEND RESOURCES ${CMAKE_BINARY_DIR}/res/${BINARY_NAME}.rc)
|
list(APPEND RESOURCES ${CMAKE_BINARY_DIR}/res/${BINARY_NAME}.rc)
|
||||||
set_source_files_properties(${CMAKE_BINARY_DIR}/res/${BINARY_NAME}.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_SOURCE_DIR}/res/${BINARY_NAME}.ico)
|
set_source_files_properties(${CMAKE_BINARY_DIR}/res/${BINARY_NAME}.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_SOURCE_DIR}/res/${BINARY_NAME}.ico)
|
||||||
if(QT_STATIC)
|
|
||||||
list(APPEND QT_LIBRARIES qwindows Qt5PlatformSupport imm32)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
if(NOT DEFINED DATADIR)
|
if(NOT DEFINED DATADIR)
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
|
@ -276,6 +273,10 @@ list(APPEND QT_LIBRARIES Qt5::Widgets)
|
||||||
if(BUILD_GL OR BUILD_GLES2)
|
if(BUILD_GL OR BUILD_GLES2)
|
||||||
list(APPEND QT_LIBRARIES Qt5::OpenGL ${OPENGL_LIBRARY} ${OPENGLES2_LIBRARY})
|
list(APPEND QT_LIBRARIES Qt5::OpenGL ${OPENGL_LIBRARY} ${OPENGLES2_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
if(WIN32 AND QT_STATIC)
|
||||||
|
list(APPEND QT_LIBRARIES qwindows dwmapi imm32 uxtheme Qt5EventDispatcherSupport Qt5FontDatabaseSupport Qt5ThemeSupport)
|
||||||
|
set_target_properties(Qt5::Core PROPERTIES INTERFACE_LINK_LIBRARIES "qtpcre2;version;ws2_32")
|
||||||
|
endif()
|
||||||
target_link_libraries(${BINARY_NAME}-qt ${PLATFORM_LIBRARY} ${BINARY_NAME} ${QT_LIBRARIES})
|
target_link_libraries(${BINARY_NAME}-qt ${PLATFORM_LIBRARY} ${BINARY_NAME} ${QT_LIBRARIES})
|
||||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}" PARENT_SCOPE)
|
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}" PARENT_SCOPE)
|
||||||
|
|
||||||
|
|
|
@ -216,7 +216,9 @@ void Window::resizeFrame(const QSize& size) {
|
||||||
m_screenWidget->setSizeHint(newSize);
|
m_screenWidget->setSizeHint(newSize);
|
||||||
newSize -= m_screenWidget->size();
|
newSize -= m_screenWidget->size();
|
||||||
newSize += this->size();
|
newSize += this->size();
|
||||||
resize(newSize);
|
if (!isFullScreen()) {
|
||||||
|
resize(newSize);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::setConfig(ConfigController* config) {
|
void Window::setConfig(ConfigController* config) {
|
||||||
|
|
|
@ -40,10 +40,10 @@
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../AboutScreen.ui" line="86"/>
|
<location filename="../AboutScreen.ui" line="86"/>
|
||||||
<source>© 2013 – 2017 Jeffrey Pfau, licensed under the Mozilla Public License, version 2.0
|
<source>© 2013 – 2019 Jeffrey Pfau, licensed under the Mozilla Public License, version 2.0
|
||||||
Game Boy and Game Boy Advance are registered trademarks of Nintendo Co., Ltd.</source>
|
Game Boy Advance is a registered trademark of Nintendo Co., Ltd.</source>
|
||||||
<translation>© 2013 – 2017 Jeffrey Pfau, lizenziert unter der Mozilla Public License, Version 2.0
|
<translation>© 2013 – 2019 Jeffrey Pfau, lizenziert unter der Mozilla Public License, Version 2.0
|
||||||
Game Boy und Game Boy Advance sind eingetragene Warenzeichen von Nintendo Co., Ltd.</translation>
|
Game Boy Advance ist ein eingetragenes Warenzeichen von Nintendo Co., Ltd.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../AboutScreen.ui" line="155"/>
|
<location filename="../AboutScreen.ui" line="155"/>
|
||||||
|
|
|
@ -30,9 +30,9 @@
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../AboutScreen.ui" line="86"/>
|
<location filename="../AboutScreen.ui" line="86"/>
|
||||||
<source>© 2013 – 2017 Jeffrey Pfau, licensed under the Mozilla Public License, version 2.0
|
<source>© 2013 – 2018 Jeffrey Pfau, licensed under the Mozilla Public License, version 2.0
|
||||||
Game Boy Advance is a registered trademark of Nintendo Co., Ltd.</source>
|
Game Boy Advance is a registered trademark of Nintendo Co., Ltd.</source>
|
||||||
<translation>© 2013 – 2017 Jeffrey Pfau, licenciado bajo la Mozilla Public License, versión 2.0
|
<translation>© 2013 – 2018 Jeffrey Pfau, licenciado bajo la Mozilla Public License, versión 2.0
|
||||||
Game Boy Advance es una marca registrada de Nintendo Co., Ltd.</translation>
|
Game Boy Advance es una marca registrada de Nintendo Co., Ltd.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
|
|
|
@ -7,6 +7,13 @@
|
||||||
|
|
||||||
#include <mgba/core/version.h>
|
#include <mgba/core/version.h>
|
||||||
|
|
||||||
|
void mSDLGLDoViewport(int w, int h, struct VideoBackend* v) {
|
||||||
|
v->resized(v, w, h);
|
||||||
|
v->clear(v);
|
||||||
|
v->swap(v);
|
||||||
|
v->clear(v);
|
||||||
|
}
|
||||||
|
|
||||||
void mSDLGLCommonSwap(struct VideoBackend* context) {
|
void mSDLGLCommonSwap(struct VideoBackend* context) {
|
||||||
struct mSDLRenderer* renderer = (struct mSDLRenderer*) context->user;
|
struct mSDLRenderer* renderer = (struct mSDLRenderer*) context->user;
|
||||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||||
|
|
|
@ -12,6 +12,7 @@ CXX_GUARD_START
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
|
void mSDLGLDoViewport(int w, int h, struct VideoBackend* v);
|
||||||
void mSDLGLCommonSwap(struct VideoBackend* context);
|
void mSDLGLCommonSwap(struct VideoBackend* context);
|
||||||
void mSDLGLCommonInit(struct mSDLRenderer* renderer);
|
void mSDLGLCommonInit(struct mSDLRenderer* renderer);
|
||||||
|
|
||||||
|
|
|
@ -13,13 +13,6 @@
|
||||||
|
|
||||||
#include "platform/opengl/gl.h"
|
#include "platform/opengl/gl.h"
|
||||||
|
|
||||||
static void _doViewport(int w, int h, struct VideoBackend* v) {
|
|
||||||
v->resized(v, w, h);
|
|
||||||
v->clear(v);
|
|
||||||
v->swap(v);
|
|
||||||
v->clear(v);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool mSDLGLInit(struct mSDLRenderer* renderer);
|
static bool mSDLGLInit(struct mSDLRenderer* renderer);
|
||||||
static void mSDLGLRunloop(struct mSDLRenderer* renderer, void* user);
|
static void mSDLGLRunloop(struct mSDLRenderer* renderer, void* user);
|
||||||
static void mSDLGLDeinit(struct mSDLRenderer* renderer);
|
static void mSDLGLDeinit(struct mSDLRenderer* renderer);
|
||||||
|
@ -47,7 +40,7 @@ bool mSDLGLInit(struct mSDLRenderer* renderer) {
|
||||||
renderer->gl.d.init(&renderer->gl.d, 0);
|
renderer->gl.d.init(&renderer->gl.d, 0);
|
||||||
renderer->gl.d.setDimensions(&renderer->gl.d, renderer->width, renderer->height);
|
renderer->gl.d.setDimensions(&renderer->gl.d, renderer->width, renderer->height);
|
||||||
|
|
||||||
_doViewport(renderer->viewportWidth, renderer->viewportHeight, &renderer->gl.d);
|
mSDLGLDoViewport(renderer->viewportWidth, renderer->viewportHeight, &renderer->gl.d);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +56,7 @@ void mSDLGLRunloop(struct mSDLRenderer* renderer, void* user) {
|
||||||
// Event handling can change the size of the screen
|
// Event handling can change the size of the screen
|
||||||
if (renderer->player.windowUpdated) {
|
if (renderer->player.windowUpdated) {
|
||||||
SDL_GetWindowSize(renderer->window, &renderer->viewportWidth, &renderer->viewportHeight);
|
SDL_GetWindowSize(renderer->window, &renderer->viewportWidth, &renderer->viewportHeight);
|
||||||
_doViewport(renderer->viewportWidth, renderer->viewportHeight, v);
|
mSDLGLDoViewport(renderer->viewportWidth, renderer->viewportHeight, v);
|
||||||
renderer->player.windowUpdated = 0;
|
renderer->player.windowUpdated = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -115,6 +115,8 @@ bool mSDLGLES2Init(struct mSDLRenderer* renderer) {
|
||||||
renderer->gl2.d.swap = mSDLGLCommonSwap;
|
renderer->gl2.d.swap = mSDLGLCommonSwap;
|
||||||
renderer->gl2.d.init(&renderer->gl2.d, 0);
|
renderer->gl2.d.init(&renderer->gl2.d, 0);
|
||||||
renderer->gl2.d.setDimensions(&renderer->gl2.d, renderer->width, renderer->height);
|
renderer->gl2.d.setDimensions(&renderer->gl2.d, renderer->width, renderer->height);
|
||||||
|
|
||||||
|
mSDLGLDoViewport(renderer->viewportWidth, renderer->viewportHeight, &renderer->gl2.d);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,6 +128,14 @@ void mSDLGLES2Runloop(struct mSDLRenderer* renderer, void* user) {
|
||||||
while (mCoreThreadIsActive(context)) {
|
while (mCoreThreadIsActive(context)) {
|
||||||
while (SDL_PollEvent(&event)) {
|
while (SDL_PollEvent(&event)) {
|
||||||
mSDLHandleEvent(context, &renderer->player, &event);
|
mSDLHandleEvent(context, &renderer->player, &event);
|
||||||
|
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||||
|
// Event handling can change the size of the screen
|
||||||
|
if (renderer->player.windowUpdated) {
|
||||||
|
SDL_GetWindowSize(renderer->window, &renderer->viewportWidth, &renderer->viewportHeight);
|
||||||
|
mSDLGLDoViewport(renderer->viewportWidth, renderer->viewportHeight, v);
|
||||||
|
renderer->player.windowUpdated = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mCoreSyncWaitFrameStart(&context->impl->sync)) {
|
if (mCoreSyncWaitFrameStart(&context->impl->sync)) {
|
||||||
|
|
|
@ -61,6 +61,7 @@ struct VFileZip {
|
||||||
struct VFile d;
|
struct VFile d;
|
||||||
unzFile z;
|
unzFile z;
|
||||||
void* buffer;
|
void* buffer;
|
||||||
|
size_t bufferSize;
|
||||||
size_t fileSize;
|
size_t fileSize;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -451,7 +452,9 @@ static enum VFSType _vdezType(struct VDirEntry* vde) {
|
||||||
bool _vfzClose(struct VFile* vf) {
|
bool _vfzClose(struct VFile* vf) {
|
||||||
struct VFileZip* vfz = (struct VFileZip*) vf;
|
struct VFileZip* vfz = (struct VFileZip*) vf;
|
||||||
unzCloseCurrentFile(vfz->z);
|
unzCloseCurrentFile(vfz->z);
|
||||||
free(vfz->buffer);
|
if (vfz->buffer) {
|
||||||
|
mappedMemoryFree(vfz->buffer, vfz->bufferSize);
|
||||||
|
}
|
||||||
free(vfz);
|
free(vfz);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -536,6 +539,8 @@ void* _vfzMap(struct VFile* vf, size_t size, int flags) {
|
||||||
unzOpenCurrentFile(vfz->z);
|
unzOpenCurrentFile(vfz->z);
|
||||||
vf->seek(vf, pos, SEEK_SET);
|
vf->seek(vf, pos, SEEK_SET);
|
||||||
|
|
||||||
|
vfz->bufferSize = size;
|
||||||
|
|
||||||
return vfz->buffer;
|
return vfz->buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -619,6 +624,7 @@ struct VFile* _vdzOpenFile(struct VDir* vd, const char* path, int mode) {
|
||||||
struct VFileZip* vfz = malloc(sizeof(struct VFileZip));
|
struct VFileZip* vfz = malloc(sizeof(struct VFileZip));
|
||||||
vfz->z = vdz->z;
|
vfz->z = vdz->z;
|
||||||
vfz->buffer = 0;
|
vfz->buffer = 0;
|
||||||
|
vfz->bufferSize = 0;
|
||||||
vfz->fileSize = info.uncompressed_size;
|
vfz->fileSize = info.uncompressed_size;
|
||||||
|
|
||||||
vfz->d.close = _vfzClose;
|
vfz->d.close = _vfzClose;
|
||||||
|
|
Loading…
Reference in New Issue