From 35906b51fd30b829fe3d53a31b0b488e7b570773 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 26 Jun 2017 11:08:27 -0700 Subject: [PATCH 01/41] Qt: Add memory search type info --- src/platform/qt/MemorySearch.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/platform/qt/MemorySearch.cpp b/src/platform/qt/MemorySearch.cpp index 0f7df5ece..60d4b095b 100644 --- a/src/platform/qt/MemorySearch.cpp +++ b/src/platform/qt/MemorySearch.cpp @@ -151,6 +151,7 @@ void MemorySearch::refresh() { mCoreMemorySearchResult* result = mCoreMemorySearchResultsGetPointer(&m_results, i); QTableWidgetItem* item = new QTableWidgetItem(QString("%1").arg(result->address, 8, 16, QChar('0'))); m_ui.results->setItem(i, 0, item); + QTableWidgetItem* type; if (m_ui.numHex->isChecked()) { switch (result->type) { case mCORE_MEMORY_SEARCH_8: @@ -182,9 +183,30 @@ void MemorySearch::refresh() { item = new QTableWidgetItem("?"); // TODO } } + QString divisor; + if (result->guessDivisor > 1) { + divisor = tr(" (⅟%0×)").arg(result->guessDivisor); + } + switch (result->type) { + case mCORE_MEMORY_SEARCH_8: + type = new QTableWidgetItem(tr("1 byte%0").arg(divisor)); + break; + case mCORE_MEMORY_SEARCH_16: + type = new QTableWidgetItem(tr("2 bytes%0").arg(divisor)); + break; + case mCORE_MEMORY_SEARCH_GUESS: + case mCORE_MEMORY_SEARCH_32: + type = new QTableWidgetItem(tr("4 bytes%0").arg(divisor)); + break; + case mCORE_MEMORY_SEARCH_STRING: + item = new QTableWidgetItem("?"); // TODO + } m_ui.results->setItem(i, 1, item); + m_ui.results->setItem(i, 2, type); } m_ui.results->sortItems(0); + m_ui.results->resizeColumnsToContents(); + m_ui.results->resizeRowsToContents(); } void MemorySearch::openMemory() { From cebc3f1cc460482b101d944eb7951d4ad3032751 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Wed, 28 Jun 2017 01:06:15 -0700 Subject: [PATCH 02/41] Core: Fix some minor warnings, fix channel labels --- src/core/core.c | 2 +- src/feature/video-logger.c | 2 +- src/gb/core.c | 20 ++++++++++---------- src/gba/core.c | 22 +++++++++++----------- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/core/core.c b/src/core/core.c index b82bab950..d42ce15ce 100644 --- a/src/core/core.c +++ b/src/core/core.c @@ -22,7 +22,7 @@ #include #endif -const static struct mCoreFilter { +static const struct mCoreFilter { bool (*filter)(struct VFile*); struct mCore* (*open)(void); enum mPlatform platform; diff --git a/src/feature/video-logger.c b/src/feature/video-logger.c index 865bd24ea..ab071512d 100644 --- a/src/feature/video-logger.c +++ b/src/feature/video-logger.c @@ -26,7 +26,7 @@ const char mVL_MAGIC[] = "mVL\0"; -const static struct mVLDescriptor { +static const struct mVLDescriptor { enum mPlatform platform; struct mCore* (*open)(void); } _descriptors[] = { diff --git a/src/gb/core.c b/src/gb/core.c index 03b88d62e..1b60361ee 100644 --- a/src/gb/core.c +++ b/src/gb/core.c @@ -24,26 +24,26 @@ #include #include -const static struct mCoreChannelInfo _GBVideoLayers[] = { +static const struct mCoreChannelInfo _GBVideoLayers[] = { { 0, "bg", "Background", NULL }, { 1, "obj", "Objects", NULL }, { 2, "win", "Window", NULL }, }; -const static struct mCoreChannelInfo _GBAudioChannels[] = { - { 0, "ch0", "Channel 0", "Square/Sweep" }, - { 1, "ch1", "Channel 1", "Square" }, - { 2, "ch2", "Channel 2", "PCM" }, - { 3, "ch3", "Channel 3", "Noise" }, +static const struct mCoreChannelInfo _GBAudioChannels[] = { + { 0, "ch1", "Channel 1", "Square/Sweep" }, + { 1, "ch2", "Channel 2", "Square" }, + { 2, "ch3", "Channel 3", "PCM" }, + { 3, "ch4", "Channel 4", "Noise" }, }; -const static struct LR35902Segment _GBSegments[] = { +static const struct LR35902Segment _GBSegments[] = { { .name = "ROM", .start = GB_BASE_CART_BANK1, .end = GB_BASE_VRAM }, { .name = "RAM", .start = GB_BASE_EXTERNAL_RAM, .end = GB_BASE_WORKING_RAM_BANK0 }, { 0 } }; -const static struct LR35902Segment _GBCSegments[] = { +static const struct LR35902Segment _GBCSegments[] = { { .name = "ROM", .start = GB_BASE_CART_BANK1, .end = GB_BASE_VRAM }, { .name = "RAM", .start = GB_BASE_EXTERNAL_RAM, .end = GB_BASE_WORKING_RAM_BANK0 }, { .name = "WRAM", .start = GB_BASE_WORKING_RAM_BANK1, .end = 0xE000 }, @@ -51,7 +51,7 @@ const static struct LR35902Segment _GBCSegments[] = { { 0 } }; -const static struct mCoreMemoryBlock _GBMemoryBlocks[] = { +static const struct mCoreMemoryBlock _GBMemoryBlocks[] = { { -1, "mem", "All", "All", 0, 0x10000, 0x10000, mCORE_MEMORY_VIRTUAL }, { GB_REGION_CART_BANK0, "cart0", "ROM Bank", "Game Pak (32kiB)", GB_BASE_CART_BANK0, GB_SIZE_CART_BANK0 * 2, 0x800000, mCORE_MEMORY_READ | mCORE_MEMORY_MAPPED, 511 }, { GB_REGION_VRAM, "vram", "VRAM", "Video RAM (8kiB)", GB_BASE_VRAM, GB_BASE_VRAM + GB_SIZE_VRAM, GB_SIZE_VRAM, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED }, @@ -62,7 +62,7 @@ const static struct mCoreMemoryBlock _GBMemoryBlocks[] = { { GB_BASE_HRAM, "hram", "HRAM", "High RAM", GB_BASE_HRAM, GB_BASE_HRAM + GB_SIZE_HRAM, GB_SIZE_HRAM, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED }, }; -const static struct mCoreMemoryBlock _GBCMemoryBlocks[] = { +static const struct mCoreMemoryBlock _GBCMemoryBlocks[] = { { -1, "mem", "All", "All", 0, 0x10000, 0x10000, mCORE_MEMORY_VIRTUAL }, { GB_REGION_CART_BANK0, "cart0", "ROM Bank", "Game Pak (32kiB)", GB_BASE_CART_BANK0, GB_SIZE_CART_BANK0 * 2, 0x800000, mCORE_MEMORY_READ | mCORE_MEMORY_MAPPED, 511 }, { GB_REGION_VRAM, "vram", "VRAM", "Video RAM (8kiB)", GB_BASE_VRAM, GB_BASE_VRAM + GB_SIZE_VRAM, GB_SIZE_VRAM * 2, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED, 1 }, diff --git a/src/gba/core.c b/src/gba/core.c index 53b3375e5..10425e645 100644 --- a/src/gba/core.c +++ b/src/gba/core.c @@ -24,7 +24,7 @@ #include #include -const static struct mCoreChannelInfo _GBAVideoLayers[] = { +static const struct mCoreChannelInfo _GBAVideoLayers[] = { { 0, "bg0", "Background 0", NULL }, { 1, "bg1", "Background 1", NULL }, { 2, "bg2", "Background 2", NULL }, @@ -32,16 +32,16 @@ const static struct mCoreChannelInfo _GBAVideoLayers[] = { { 4, "obj", "Objects", NULL }, }; -const static struct mCoreChannelInfo _GBAAudioChannels[] = { - { 0, "ch0", "PSG Channel 0", "Square/Sweep" }, - { 1, "ch1", "PSG Channel 1", "Square" }, - { 2, "ch2", "PSG Channel 2", "PCM" }, - { 3, "ch3", "PSG Channel 3", "Noise" }, +static const struct mCoreChannelInfo _GBAAudioChannels[] = { + { 0, "ch1", "PSG Channel 1", "Square/Sweep" }, + { 1, "ch2", "PSG Channel 2", "Square" }, + { 2, "ch3", "PSG Channel 3", "PCM" }, + { 3, "ch4", "PSG Channel 4", "Noise" }, { 4, "chA", "FIFO Channel A", NULL }, { 5, "chB", "FIFO Channel B", NULL }, }; -const static struct mCoreMemoryBlock _GBAMemoryBlocks[] = { +static const struct mCoreMemoryBlock _GBAMemoryBlocks[] = { { -1, "mem", "All", "All", 0, 0x10000000, 0x10000000, mCORE_MEMORY_VIRTUAL }, { REGION_BIOS, "bios", "BIOS", "BIOS (16kiB)", BASE_BIOS, SIZE_BIOS, SIZE_BIOS, mCORE_MEMORY_READ | mCORE_MEMORY_MAPPED }, { REGION_WORKING_RAM, "wram", "EWRAM", "Working RAM (256kiB)", BASE_WORKING_RAM, BASE_WORKING_RAM + SIZE_WORKING_RAM, SIZE_WORKING_RAM, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED }, @@ -55,7 +55,7 @@ const static struct mCoreMemoryBlock _GBAMemoryBlocks[] = { { REGION_CART2, "cart2", "ROM WS2", "Game Pak (Waitstate 2)", BASE_CART2, BASE_CART2 + SIZE_CART2, SIZE_CART2, mCORE_MEMORY_READ | mCORE_MEMORY_MAPPED }, }; -const static struct mCoreMemoryBlock _GBAMemoryBlocksSRAM[] = { +static const struct mCoreMemoryBlock _GBAMemoryBlocksSRAM[] = { { -1, "mem", "All", "All", 0, 0x10000000, 0x10000000, mCORE_MEMORY_VIRTUAL }, { REGION_BIOS, "bios", "BIOS", "BIOS (16kiB)", BASE_BIOS, SIZE_BIOS, SIZE_BIOS, mCORE_MEMORY_READ | mCORE_MEMORY_MAPPED }, { REGION_WORKING_RAM, "wram", "EWRAM", "Working RAM (256kiB)", BASE_WORKING_RAM, BASE_WORKING_RAM + SIZE_WORKING_RAM, SIZE_WORKING_RAM, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED }, @@ -70,7 +70,7 @@ const static struct mCoreMemoryBlock _GBAMemoryBlocksSRAM[] = { { REGION_CART_SRAM, "sram", "SRAM", "Static RAM (64kiB)", BASE_CART_SRAM, BASE_CART_SRAM + SIZE_CART_SRAM, SIZE_CART_SRAM, true }, }; -const static struct mCoreMemoryBlock _GBAMemoryBlocksFlash512[] = { +static const struct mCoreMemoryBlock _GBAMemoryBlocksFlash512[] = { { -1, "mem", "All", "All", 0, 0x10000000, 0x10000000, mCORE_MEMORY_VIRTUAL }, { REGION_BIOS, "bios", "BIOS", "BIOS (16kiB)", BASE_BIOS, SIZE_BIOS, SIZE_BIOS, mCORE_MEMORY_READ | mCORE_MEMORY_MAPPED }, { REGION_WORKING_RAM, "wram", "EWRAM", "Working RAM (256kiB)", BASE_WORKING_RAM, BASE_WORKING_RAM + SIZE_WORKING_RAM, SIZE_WORKING_RAM, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED }, @@ -85,7 +85,7 @@ const static struct mCoreMemoryBlock _GBAMemoryBlocksFlash512[] = { { REGION_CART_SRAM, "sram", "Flash", "Flash Memory (64kiB)", BASE_CART_SRAM, BASE_CART_SRAM + SIZE_CART_FLASH512, SIZE_CART_FLASH512, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED }, }; -const static struct mCoreMemoryBlock _GBAMemoryBlocksFlash1M[] = { +static const struct mCoreMemoryBlock _GBAMemoryBlocksFlash1M[] = { { -1, "mem", "All", "All", 0, 0x10000000, 0x10000000, mCORE_MEMORY_VIRTUAL }, { REGION_BIOS, "bios", "BIOS", "BIOS (16kiB)", BASE_BIOS, SIZE_BIOS, SIZE_BIOS, mCORE_MEMORY_READ | mCORE_MEMORY_MAPPED }, { REGION_WORKING_RAM, "wram", "EWRAM", "Working RAM (256kiB)", BASE_WORKING_RAM, BASE_WORKING_RAM + SIZE_WORKING_RAM, SIZE_WORKING_RAM, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED }, @@ -100,7 +100,7 @@ const static struct mCoreMemoryBlock _GBAMemoryBlocksFlash1M[] = { { REGION_CART_SRAM, "sram", "Flash", "Flash Memory (64kiB)", BASE_CART_SRAM, BASE_CART_SRAM + SIZE_CART_FLASH512, SIZE_CART_FLASH1M, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED, 1 }, }; -const static struct mCoreMemoryBlock _GBAMemoryBlocksEEPROM[] = { +static const struct mCoreMemoryBlock _GBAMemoryBlocksEEPROM[] = { { -1, "mem", "All", "All", 0, 0x10000000, 0x10000000, mCORE_MEMORY_VIRTUAL }, { REGION_BIOS, "bios", "BIOS", "BIOS (16kiB)", BASE_BIOS, SIZE_BIOS, SIZE_BIOS, mCORE_MEMORY_READ | mCORE_MEMORY_MAPPED }, { REGION_WORKING_RAM, "wram", "EWRAM", "Working RAM (256kiB)", BASE_WORKING_RAM, BASE_WORKING_RAM + SIZE_WORKING_RAM, SIZE_WORKING_RAM, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED }, From bea917f868c52be398e312ae8b13638b5910553a Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Wed, 28 Jun 2017 11:33:26 -0700 Subject: [PATCH 03/41] Res: Update patrons for June --- res/patrons.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/res/patrons.txt b/res/patrons.txt index 0cf2e6e28..3ec04c2b9 100644 --- a/res/patrons.txt +++ b/res/patrons.txt @@ -3,6 +3,7 @@ Fog Reilly Grant Philip Horton Jordan Jorgensen +mars Rohit Nirmal Rhys Powell rootfather From 88983da5c4b8e979bab1820f0663abbd763611da Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Wed, 28 Jun 2017 12:02:09 -0700 Subject: [PATCH 04/41] Qt: Fix library crash when another instance is open...again --- src/platform/qt/library/LibraryController.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platform/qt/library/LibraryController.cpp b/src/platform/qt/library/LibraryController.cpp index bb7acac36..8614f4c9e 100644 --- a/src/platform/qt/library/LibraryController.cpp +++ b/src/platform/qt/library/LibraryController.cpp @@ -45,8 +45,10 @@ LibraryController::LibraryController(QWidget* parent, const QString& path, Confi mLibraryListingInit(&m_listing, 0); if (!path.isNull()) { + // This can return NULL if the library is already open m_library = mLibraryLoad(path.toUtf8().constData()); - } else { + } + if (!m_library) { m_library = mLibraryCreateEmpty(); } From 23a346e8ce24b26b1a5bd980a744bf87f56b99a4 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Wed, 28 Jun 2017 12:51:33 -0700 Subject: [PATCH 05/41] All: Minor CMake touchups --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7504ae4da..afd389629 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -215,7 +215,7 @@ endif() if(APPLE) add_definitions(-D_DARWIN_C_SOURCE) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.6") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.5") endif() if(NOT HAIKU AND NOT MSVC AND NOT PSP2) @@ -843,7 +843,6 @@ if(BUILD_EXAMPLE) endif() endif() -message(STATUS ${USE_PTHREADS}) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/core/flags.h.in ${CMAKE_CURRENT_BINARY_DIR}/flags.h) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/flags.h DESTINATION include/mgba COMPONENT lib${BINARY_NAME}) @@ -897,6 +896,7 @@ else() endif() if(NOT QUIET) + message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") message(STATUS "Platforms:") message(STATUS " Game Boy Advance: ${M_CORE_GBA}") message(STATUS " Game Boy: ${M_CORE_GB}") From dc5c59d4dbe157bb1c6fe1e00c0893815723a16b Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Wed, 28 Jun 2017 13:07:39 -0700 Subject: [PATCH 06/41] Core: Fix interrupting a thread while on the thread (fixes #692) --- CHANGES | 1 + src/core/thread.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 55ce1fd69..0890adf9d 100644 --- a/CHANGES +++ b/CHANGES @@ -73,6 +73,7 @@ Bugfixes: - OpenGL: Fix some shaders causing offset graphics - Qt: Fix game unpausing after frame advancing and refocusing - GB Timer: Fix sub-M-cycle DIV reset timing and edge triggering + - Core: Fix interrupting a thread while on the thread (fixes mgba.io/i/692) Misc: - SDL: Remove scancode key input - GBA Video: Clean up unused timers diff --git a/src/core/thread.c b/src/core/thread.c index 424260b7e..ed979d77a 100644 --- a/src/core/thread.c +++ b/src/core/thread.c @@ -401,11 +401,14 @@ void mCoreThreadInterruptFromThread(struct mCoreThread* threadContext) { MutexLock(&threadContext->stateMutex); ++threadContext->interruptDepth; if (threadContext->interruptDepth > 1 || !mCoreThreadIsActive(threadContext)) { + if (threadContext->state == THREAD_INTERRUPTING) { + threadContext->state = THREAD_INTERRUPTED; + } MutexUnlock(&threadContext->stateMutex); return; } threadContext->savedState = threadContext->state; - threadContext->state = THREAD_INTERRUPTING; + threadContext->state = THREAD_INTERRUPTED; ConditionWake(&threadContext->stateCond); MutexUnlock(&threadContext->stateMutex); } From 6c6d09ee7c7c916c4f448dc7ece4fccd7a25e9af Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Wed, 28 Jun 2017 14:10:31 -0700 Subject: [PATCH 07/41] Core: Improved threading interrupted detection --- CHANGES | 1 + src/core/thread.c | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 0890adf9d..b3a545b85 100644 --- a/CHANGES +++ b/CHANGES @@ -143,6 +143,7 @@ Misc: - GB: Reset with initial state of DIV register - GB MBC: New MBC7 implementation - Qt: Better highlight active key in control binding + - Core: Improved threading interrupted detection 0.5.2: (2016-12-31) Bugfixes: diff --git a/src/core/thread.c b/src/core/thread.c index ed979d77a..5ed87e9ca 100644 --- a/src/core/thread.c +++ b/src/core/thread.c @@ -468,7 +468,7 @@ void mCoreThreadUnpause(struct mCoreThread* threadContext) { bool mCoreThreadIsPaused(struct mCoreThread* threadContext) { bool isPaused; MutexLock(&threadContext->stateMutex); - if (threadContext->state == THREAD_INTERRUPTED || threadContext->state == THREAD_INTERRUPTING) { + if (threadContext->interruptDepth) { isPaused = threadContext->savedState == THREAD_PAUSED; } else { isPaused = threadContext->state == THREAD_PAUSED; @@ -498,7 +498,7 @@ void mCoreThreadTogglePause(struct mCoreThread* threadContext) { void mCoreThreadPauseFromThread(struct mCoreThread* threadContext) { bool frameOn = true; MutexLock(&threadContext->stateMutex); - if (threadContext->state == THREAD_RUNNING || (threadContext->state == THREAD_INTERRUPTING && threadContext->savedState == THREAD_RUNNING)) { + if (threadContext->state == THREAD_RUNNING || (threadContext->interruptDepth && threadContext->savedState == THREAD_RUNNING)) { threadContext->state = THREAD_PAUSING; frameOn = false; } @@ -509,11 +509,11 @@ void mCoreThreadPauseFromThread(struct mCoreThread* threadContext) { void mCoreThreadSetRewinding(struct mCoreThread* threadContext, bool rewinding) { MutexLock(&threadContext->stateMutex); - if (rewinding && (threadContext->state == THREAD_REWINDING || (threadContext->state == THREAD_INTERRUPTING && threadContext->savedState == THREAD_REWINDING))) { + if (rewinding && (threadContext->state == THREAD_REWINDING || (threadContext->interruptDepth && threadContext->savedState == THREAD_REWINDING))) { MutexUnlock(&threadContext->stateMutex); return; } - if (!rewinding && (threadContext->state == THREAD_RUNNING || (threadContext->state == THREAD_INTERRUPTING && threadContext->savedState == THREAD_RUNNING))) { + if (!rewinding && ((!threadContext->interruptDepth && threadContext->state != THREAD_REWINDING) || (threadContext->interruptDepth && threadContext->savedState != THREAD_REWINDING))) { MutexUnlock(&threadContext->stateMutex); return; } @@ -529,7 +529,7 @@ void mCoreThreadSetRewinding(struct mCoreThread* threadContext, bool rewinding) void mCoreThreadWaitFromThread(struct mCoreThread* threadContext) { MutexLock(&threadContext->stateMutex); - if ((threadContext->state == THREAD_INTERRUPTED || threadContext->state == THREAD_INTERRUPTING) && threadContext->savedState == THREAD_RUNNING) { + if (threadContext->interruptDepth && threadContext->savedState == THREAD_RUNNING) { threadContext->savedState = THREAD_WAITING; } else if (threadContext->state == THREAD_RUNNING) { threadContext->state = THREAD_WAITING; @@ -539,7 +539,7 @@ void mCoreThreadWaitFromThread(struct mCoreThread* threadContext) { void mCoreThreadStopWaiting(struct mCoreThread* threadContext) { MutexLock(&threadContext->stateMutex); - if ((threadContext->state == THREAD_INTERRUPTED || threadContext->state == THREAD_INTERRUPTING) && threadContext->savedState == THREAD_WAITING) { + if (threadContext->interruptDepth && threadContext->savedState == THREAD_WAITING) { threadContext->savedState = THREAD_RUNNING; } else if (threadContext->state == THREAD_WAITING) { threadContext->state = THREAD_RUNNING; From fc64924cf566ea5ab9fb618c5224cc293792e11a Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Wed, 28 Jun 2017 14:26:03 -0700 Subject: [PATCH 08/41] GB MBC: Fix MBC7 sampling --- src/gb/mbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gb/mbc.c b/src/gb/mbc.c index 87fae1510..4c8bee9a8 100644 --- a/src/gb/mbc.c +++ b/src/gb/mbc.c @@ -558,7 +558,7 @@ void GBMBC7Write(struct GBMemory* memory, uint16_t address, uint8_t value) { return; case 0x10: mbc7->latch |= (value & 0xAA); - if (mbc7->latch == 0xFF && memory->rotation && memory->rotation->sample) { + if (mbc7->latch == 0xAB && memory->rotation && memory->rotation->sample) { memory->rotation->sample(memory->rotation); } mbc7->latch = 0; From 7752bfe0db245eacf7b612b85f2e92fa19274539 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 29 Jun 2017 02:45:50 -0700 Subject: [PATCH 09/41] Python: GB core should expose memory --- src/platform/python/mgba/gb.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/platform/python/mgba/gb.py b/src/platform/python/mgba/gb.py index 2b490e008..051c25d95 100644 --- a/src/platform/python/mgba/gb.py +++ b/src/platform/python/mgba/gb.py @@ -35,6 +35,10 @@ class GB(Core): self._native.video.renderer.cache = ffi.NULL lib.mTileCacheDeinit(cache) + def reset(self): + super(GB, self).reset() + self.memory = GBMemory(self._core) + def attachSIO(self, link): lib.GBSIOSetDriver(ffi.addressof(self._native.sio), link._native) From 6b26384c12683841b4435127832cfd2148286a9b Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 29 Jun 2017 17:49:43 -0700 Subject: [PATCH 10/41] Python: Improve GB SIO bindings --- src/platform/python/mgba/gb.py | 43 +++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/src/platform/python/mgba/gb.py b/src/platform/python/mgba/gb.py index 051c25d95..fdf7f78bd 100644 --- a/src/platform/python/mgba/gb.py +++ b/src/platform/python/mgba/gb.py @@ -65,21 +65,46 @@ class GBSIODriver(object): return value class GBSIOSimpleDriver(GBSIODriver): - def __init__(self): + def __init__(self, period=0x100): super(GBSIOSimpleDriver, self).__init__() - self.tx = 0xFF - self.rx = 0xFF + self.rx = 0x00 + self._period = period + + def init(self): + self._native.p.period = self._period + return True def writeSB(self, value): self.rx = value - def schedule(self, period=0x100, when=0): + def writeSC(self, value): + self._native.p.period = self._period + if value & 0x80: + lib.mTimingDeschedule(ffi.addressof(self._native.p.p.timing), ffi.addressof(self._native.p.event)) + lib.mTimingSchedule(ffi.addressof(self._native.p.p.timing), ffi.addressof(self._native.p.event), self._native.p.period) + return value + + def isReady(self): + return not self._native.p.remainingBits + + @property + def tx(self): + self._native.p.pendingSB + + @property + def period(self): + return self._native.p.period + + @tx.setter + def tx(self, newTx): + self._native.p.pendingSB = newTx self._native.p.remainingBits = 8 - self._native.p.period = period - self._native.p.pendingSB = self.tx - self.tx = 0xFF - lib.mTimingDeschedule(ffi.addressof(self._native.p.p.timing), ffi.addressof(self._native.p.event)) - lib.mTimingSchedule(ffi.addressof(self._native.p.p.timing), ffi.addressof(self._native.p.event), when) + + @period.setter + def period(self, newPeriod): + self._period = newPeriod + if self._native.p: + self._native.p.period = newPeriod class GBMemory(Memory): def __init__(self, core): From 0e3abccca29a69bc71ae053fc6740389151d8996 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 29 Jun 2017 18:08:25 -0700 Subject: [PATCH 11/41] LR35902: Fix decoding CB commands --- src/lr35902/decoder.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/lr35902/decoder.c b/src/lr35902/decoder.c index 796a50b17..c4214768a 100644 --- a/src/lr35902/decoder.c +++ b/src/lr35902/decoder.c @@ -315,24 +315,24 @@ DEFINE_POPPUSH_DECODER_LR35902(HL); DEFINE_POPPUSH_DECODER_LR35902(AF); #define DEFINE_CB_2_DECODER_LR35902(NAME, BODY) \ - DEFINE_DECODER_LR35902(NAME ## B, info->op1.reg = LR35902_REG_B; BODY) \ - DEFINE_DECODER_LR35902(NAME ## C, info->op1.reg = LR35902_REG_C; BODY) \ - DEFINE_DECODER_LR35902(NAME ## D, info->op1.reg = LR35902_REG_D; BODY) \ - DEFINE_DECODER_LR35902(NAME ## E, info->op1.reg = LR35902_REG_E; BODY) \ - DEFINE_DECODER_LR35902(NAME ## H, info->op1.reg = LR35902_REG_H; BODY) \ - DEFINE_DECODER_LR35902(NAME ## L, info->op1.reg = LR35902_REG_L; BODY) \ - DEFINE_DECODER_LR35902(NAME ## HL, info->op1.reg = LR35902_REG_HL; BODY) \ - DEFINE_DECODER_LR35902(NAME ## A, info->op1.reg = LR35902_REG_A; BODY) + DEFINE_DECODER_LR35902(NAME ## B, info->op2.reg = LR35902_REG_B; BODY) \ + DEFINE_DECODER_LR35902(NAME ## C, info->op2.reg = LR35902_REG_C; BODY) \ + DEFINE_DECODER_LR35902(NAME ## D, info->op2.reg = LR35902_REG_D; BODY) \ + DEFINE_DECODER_LR35902(NAME ## E, info->op2.reg = LR35902_REG_E; BODY) \ + DEFINE_DECODER_LR35902(NAME ## H, info->op2.reg = LR35902_REG_H; BODY) \ + DEFINE_DECODER_LR35902(NAME ## L, info->op2.reg = LR35902_REG_L; BODY) \ + DEFINE_DECODER_LR35902(NAME ## HL, info->op2.reg = LR35902_REG_HL; info->op2.flags = LR35902_OP_FLAG_MEMORY; BODY) \ + DEFINE_DECODER_LR35902(NAME ## A, info->op2.reg = LR35902_REG_A; BODY) #define DEFINE_CB_DECODER_LR35902(NAME, BODY) \ - DEFINE_CB_2_DECODER_LR35902(NAME ## 0, info->op2.immediate = 1; BODY) \ - DEFINE_CB_2_DECODER_LR35902(NAME ## 1, info->op2.immediate = 2; BODY) \ - DEFINE_CB_2_DECODER_LR35902(NAME ## 2, info->op2.immediate = 4; BODY) \ - DEFINE_CB_2_DECODER_LR35902(NAME ## 3, info->op2.immediate = 8; BODY) \ - DEFINE_CB_2_DECODER_LR35902(NAME ## 4, info->op2.immediate = 16; BODY) \ - DEFINE_CB_2_DECODER_LR35902(NAME ## 5, info->op2.immediate = 32; BODY) \ - DEFINE_CB_2_DECODER_LR35902(NAME ## 6, info->op2.immediate = 64; BODY) \ - DEFINE_CB_2_DECODER_LR35902(NAME ## 7, info->op2.immediate = 128; BODY) + DEFINE_CB_2_DECODER_LR35902(NAME ## 0, info->op1.immediate = 0; BODY) \ + DEFINE_CB_2_DECODER_LR35902(NAME ## 1, info->op1.immediate = 1; BODY) \ + DEFINE_CB_2_DECODER_LR35902(NAME ## 2, info->op1.immediate = 2; BODY) \ + DEFINE_CB_2_DECODER_LR35902(NAME ## 3, info->op1.immediate = 3; BODY) \ + DEFINE_CB_2_DECODER_LR35902(NAME ## 4, info->op1.immediate = 4; BODY) \ + DEFINE_CB_2_DECODER_LR35902(NAME ## 5, info->op1.immediate = 5; BODY) \ + DEFINE_CB_2_DECODER_LR35902(NAME ## 6, info->op1.immediate = 6; BODY) \ + DEFINE_CB_2_DECODER_LR35902(NAME ## 7, info->op1.immediate = 7; BODY) DEFINE_CB_DECODER_LR35902(BIT, info->mnemonic = LR35902_MN_BIT) DEFINE_CB_DECODER_LR35902(RES, info->mnemonic = LR35902_MN_RES) @@ -544,7 +544,7 @@ int LR35902Disassemble(struct LR35902InstructionInfo* info, char* buffer, int bl } } - if (info->op1.reg || info->op1.immediate) { + if (info->op1.reg || info->op1.immediate || info->op2.reg || info->op2.immediate) { written = _decodeOperand(info->op1, buffer, blen); ADVANCE(written); } From 54548cbc5133bb22e01b06491b4e7cd1bb29a9a3 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 29 Jun 2017 18:10:15 -0700 Subject: [PATCH 12/41] LR35902: Switch memory disassembly syntax to rgbds-style --- src/lr35902/decoder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lr35902/decoder.c b/src/lr35902/decoder.c index c4214768a..61832acf1 100644 --- a/src/lr35902/decoder.c +++ b/src/lr35902/decoder.c @@ -496,7 +496,7 @@ static int _decodeOperand(struct LR35902Operand op, char* buffer, int blen) { } if (op.flags & LR35902_OP_FLAG_MEMORY) { - strncpy(buffer, "(", blen - 1); + strncpy(buffer, "[", blen - 1); ADVANCE(1); } if (op.reg) { @@ -519,7 +519,7 @@ static int _decodeOperand(struct LR35902Operand op, char* buffer, int blen) { ADVANCE(1); } if (op.flags & LR35902_OP_FLAG_MEMORY) { - strncpy(buffer, ")", blen - 1); + strncpy(buffer, "]", blen - 1); ADVANCE(1); } return total; From 66e9b921a9264ee8186bb7dd1df022a5077a6ab1 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 29 Jun 2017 18:17:21 -0700 Subject: [PATCH 13/41] Core: Fix directory sets crashing on close if base isn't properly detached --- CHANGES | 1 + src/core/directories.c | 50 +++++++++++++++++++++++++++++++++--------- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index b3a545b85..473805f24 100644 --- a/CHANGES +++ b/CHANGES @@ -74,6 +74,7 @@ Bugfixes: - Qt: Fix game unpausing after frame advancing and refocusing - GB Timer: Fix sub-M-cycle DIV reset timing and edge triggering - Core: Fix interrupting a thread while on the thread (fixes mgba.io/i/692) + - Core: Fix directory sets crashing on close if base isn't properly detached Misc: - SDL: Remove scancode key input - GBA Video: Clean up unused timers diff --git a/src/core/directories.c b/src/core/directories.c index ca261dbd9..4d52bec43 100644 --- a/src/core/directories.c +++ b/src/core/directories.c @@ -22,28 +22,58 @@ void mDirectorySetDeinit(struct mDirectorySet* dirs) { mDirectorySetDetachBase(dirs); if (dirs->archive) { + if (dirs->archive == dirs->save) { + dirs->save = NULL; + } + if (dirs->archive == dirs->patch) { + dirs->patch = NULL; + } + if (dirs->archive == dirs->state) { + dirs->state = NULL; + } + if (dirs->archive == dirs->screenshot) { + dirs->screenshot = NULL; + } dirs->archive->close(dirs->archive); - dirs->archive = 0; + dirs->archive = NULL; } if (dirs->save) { + if (dirs->save == dirs->patch) { + dirs->patch = NULL; + } + if (dirs->save == dirs->state) { + dirs->state = NULL; + } + if (dirs->save == dirs->screenshot) { + dirs->screenshot = NULL; + } dirs->save->close(dirs->save); - dirs->save = 0; + dirs->save = NULL; } if (dirs->patch) { + if (dirs->patch == dirs->state) { + dirs->state = NULL; + } + if (dirs->patch == dirs->screenshot) { + dirs->screenshot = NULL; + } dirs->patch->close(dirs->patch); - dirs->patch = 0; + dirs->patch = NULL; } if (dirs->state) { + if (dirs->state == dirs->screenshot) { + dirs->state = NULL; + } dirs->state->close(dirs->state); - dirs->state = 0; + dirs->state = NULL; } if (dirs->screenshot) { dirs->screenshot->close(dirs->screenshot); - dirs->screenshot = 0; + dirs->screenshot = NULL; } } @@ -65,21 +95,21 @@ void mDirectorySetAttachBase(struct mDirectorySet* dirs, struct VDir* base) { void mDirectorySetDetachBase(struct mDirectorySet* dirs) { if (dirs->save == dirs->base) { - dirs->save = 0; + dirs->save = NULL; } if (dirs->patch == dirs->base) { - dirs->patch = 0; + dirs->patch = NULL; } if (dirs->state == dirs->base) { - dirs->state = 0; + dirs->state = NULL; } if (dirs->screenshot == dirs->base) { - dirs->screenshot = 0; + dirs->screenshot = NULL; } if (dirs->base) { dirs->base->close(dirs->base); - dirs->base = 0; + dirs->base = NULL; } } From 15243a6ae9e4e2b4d4ff68245ae3c1fc823c745a Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 29 Jun 2017 18:54:09 -0700 Subject: [PATCH 14/41] All: Revert setting minimum macOS version to 10.5 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index afd389629..a87678e0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -215,7 +215,7 @@ endif() if(APPLE) add_definitions(-D_DARWIN_C_SOURCE) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.5") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.6") endif() if(NOT HAIKU AND NOT MSVC AND NOT PSP2) From 32618a5b1d7fd6fcf010ffe81085b5caebe26caa Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 29 Jun 2017 19:00:10 -0700 Subject: [PATCH 15/41] GB Timer: Fix order-of-operations between & and + --- src/gb/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gb/timer.c b/src/gb/timer.c index 3729e313f..ad9e6c788 100644 --- a/src/gb/timer.c +++ b/src/gb/timer.c @@ -74,7 +74,7 @@ void GBTimerDivReset(struct GBTimer* timer) { if (timer->internalDiv & (timer->timaPeriod >> 1)) { ++timer->p->memory.io[REG_TIMA]; if (!timer->p->memory.io[REG_TIMA]) { - mTimingSchedule(&timer->p->timing, &timer->irq, 4 - (timer->p->cpu->executionState + 1) & 3); + mTimingSchedule(&timer->p->timing, &timer->irq, 4 - ((timer->p->cpu->executionState + 1) & 3)); } } timer->p->memory.io[REG_DIV] = 0; From bc3411762dde5bb5190b713113e0e8ff52c07212 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 29 Jun 2017 19:16:15 -0700 Subject: [PATCH 16/41] All: Update changes for 0.6 beta 1 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 473805f24..710f4ff20 100644 --- a/CHANGES +++ b/CHANGES @@ -146,6 +146,9 @@ Misc: - Qt: Better highlight active key in control binding - Core: Improved threading interrupted detection +0.6 beta 1: (2017-06-29) +- Initial beta for 0.6 + 0.5.2: (2016-12-31) Bugfixes: - All: Fix fullscreen config option being ignored From a265d5ac6138aa08903f337c009144ec594dcc6b Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 30 Jun 2017 00:09:07 -0700 Subject: [PATCH 17/41] Qt: Fix memory search close button (fixes #769) --- CHANGES | 6 +++++- src/platform/qt/MemorySearch.ui | 22 +++++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 710f4ff20..c163180bf 100644 --- a/CHANGES +++ b/CHANGES @@ -146,8 +146,12 @@ Misc: - Qt: Better highlight active key in control binding - Core: Improved threading interrupted detection +0.6 beta 2: (Future) +Bugfixes: + - Qt: Fix memory search close button (fixes mgba.io/i/769) + 0.6 beta 1: (2017-06-29) -- Initial beta for 0.6 + - Initial beta for 0.6 0.5.2: (2016-12-31) Bugfixes: diff --git a/src/platform/qt/MemorySearch.ui b/src/platform/qt/MemorySearch.ui index ccd7a05e9..2aa19e7a7 100644 --- a/src/platform/qt/MemorySearch.ui +++ b/src/platform/qt/MemorySearch.ui @@ -214,10 +214,26 @@ - + + + buttonBox + rejected() + MemorySearch + close() + + + 315 + 357 + + + 315 + 188 + + + + - - + From f91a4195b60fdd7943ace1444031ea7043fc172d Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 30 Jun 2017 10:02:24 -0700 Subject: [PATCH 18/41] Qt: Fix window icon being stretched --- CHANGES | 1 + src/platform/qt/GBAApp.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index c163180bf..7e9161f5d 100644 --- a/CHANGES +++ b/CHANGES @@ -149,6 +149,7 @@ Misc: 0.6 beta 2: (Future) Bugfixes: - Qt: Fix memory search close button (fixes mgba.io/i/769) + - Qt: Fix window icon being stretched 0.6 beta 1: (2017-06-29) - Initial beta for 0.6 diff --git a/src/platform/qt/GBAApp.cpp b/src/platform/qt/GBAApp.cpp index 8abb6a21b..5f430aaec 100644 --- a/src/platform/qt/GBAApp.cpp +++ b/src/platform/qt/GBAApp.cpp @@ -41,7 +41,7 @@ GBAApp::GBAApp(int& argc, char* argv[]) #endif #ifndef Q_OS_MAC - setWindowIcon(QIcon(":/res/mgba-1024.png")); + setWindowIcon(QIcon(":/res/mgba-512.png")); #endif QTranslator* translator = new QTranslator(this); From 4d3d579cae5c96bfc2e70c62b0266c2ad16fff08 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 30 Jun 2017 11:00:58 -0700 Subject: [PATCH 19/41] Qt: Add language selector --- CHANGES | 2 ++ src/platform/qt/GBAApp.cpp | 15 ++++++++-- src/platform/qt/SettingsView.cpp | 20 +++++++++++++ src/platform/qt/SettingsView.h | 1 + src/platform/qt/SettingsView.ui | 51 +++++++++++++++++++++++--------- src/platform/qt/Window.cpp | 1 + src/platform/qt/main.cpp | 13 -------- 7 files changed, 73 insertions(+), 30 deletions(-) diff --git a/CHANGES b/CHANGES index 7e9161f5d..079c31785 100644 --- a/CHANGES +++ b/CHANGES @@ -150,6 +150,8 @@ Misc: Bugfixes: - Qt: Fix memory search close button (fixes mgba.io/i/769) - Qt: Fix window icon being stretched +Misc: + - Qt: Add language selector 0.6 beta 1: (2017-06-29) - Initial beta for 0.6 diff --git a/src/platform/qt/GBAApp.cpp b/src/platform/qt/GBAApp.cpp index 5f430aaec..5c8e46bbf 100644 --- a/src/platform/qt/GBAApp.cpp +++ b/src/platform/qt/GBAApp.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -44,11 +45,19 @@ GBAApp::GBAApp(int& argc, char* argv[]) setWindowIcon(QIcon(":/res/mgba-512.png")); #endif - QTranslator* translator = new QTranslator(this); - if (translator->load(QLocale(), QLatin1String(binaryName), QLatin1String("-"), QLatin1String(":/translations"))) { - installTranslator(translator); + QLocale locale; + + if (!m_configController.getQtOption("language").isNull()) { + locale = QLocale(m_configController.getQtOption("language").toString()); } + QTranslator qtTranslator; + qtTranslator.load(locale, "qt", "_", QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + installTranslator(&qtTranslator); + + QTranslator langTranslator; + langTranslator.load(locale, binaryName, "-", ":/translations/"); + installTranslator(&langTranslator); SocketSubsystemInit(); qRegisterMetaType("const uint32_t*"); diff --git a/src/platform/qt/SettingsView.cpp b/src/platform/qt/SettingsView.cpp index bd7fd2cf4..0afb035b2 100644 --- a/src/platform/qt/SettingsView.cpp +++ b/src/platform/qt/SettingsView.cpp @@ -14,6 +14,7 @@ #include "ShortcutView.h" #include +#include #include using namespace QGBA; @@ -164,6 +165,19 @@ SettingsView::SettingsView(ConfigController* controller, InputController* inputC } }); + m_ui.languages->setItemData(0, QLocale("en")); + QDir ts(":/translations/"); + for (auto name : ts.entryList()) { + if (!name.endsWith(".qm")) { + continue; + } + QLocale locale(name.remove(QString("%0-").arg(binaryName)).remove(".qm")); + m_ui.languages->addItem(locale.nativeLanguageName(), locale); + if (locale == QLocale()) { + m_ui.languages->setCurrentIndex(m_ui.languages->count() - 1); + } + } + ShortcutView* shortcutView = new ShortcutView(); shortcutView->setController(shortcutController); shortcutView->setInputController(inputController); @@ -253,6 +267,12 @@ void SettingsView::updateConfig() { emit displayDriverChanged(); } + QLocale language = m_ui.languages->itemData(m_ui.languages->currentIndex()).toLocale(); + if (language != m_controller->getQtOption("language").toLocale() && !(language.bcp47Name() == QLocale::system().bcp47Name() && m_controller->getQtOption("language").isNull())) { + m_controller->setQtOption("language", language.bcp47Name()); + emit languageChanged(); + } + m_controller->write(); emit pathsChanged(); diff --git a/src/platform/qt/SettingsView.h b/src/platform/qt/SettingsView.h index d5cbe323d..3e85fe8bd 100644 --- a/src/platform/qt/SettingsView.h +++ b/src/platform/qt/SettingsView.h @@ -29,6 +29,7 @@ signals: void audioDriverChanged(); void displayDriverChanged(); void pathsChanged(); + void languageChanged(); void libraryCleared(); private slots: diff --git a/src/platform/qt/SettingsView.ui b/src/platform/qt/SettingsView.ui index 6f27a1fd5..2c98c5c03 100644 --- a/src/platform/qt/SettingsView.ui +++ b/src/platform/qt/SettingsView.ui @@ -398,17 +398,30 @@ - - + + - Show when no game open - - - true + Language + + + + English + + + + + + + + Library: + + + + @@ -422,35 +435,38 @@ - - + + - Library: + Show when no game open + + + true - + Clear cache - + Qt::Horizontal - + Allow opposing input directions - + Suspend screensaver @@ -460,13 +476,20 @@ - + Pause when inactive + + + + Qt::Horizontal + + + diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index 1f3555999..75725e6e3 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -459,6 +459,7 @@ void Window::openSettingsWindow() { connect(settingsWindow, &SettingsView::biosLoaded, m_controller, &GameController::loadBIOS); connect(settingsWindow, &SettingsView::audioDriverChanged, m_controller, &GameController::reloadAudioDriver); connect(settingsWindow, &SettingsView::displayDriverChanged, this, &Window::mustRestart); + connect(settingsWindow, &SettingsView::languageChanged, this, &Window::mustRestart); connect(settingsWindow, &SettingsView::pathsChanged, this, &Window::reloadConfig); connect(settingsWindow, &SettingsView::libraryCleared, m_libraryView, &LibraryController::clear); openView(settingsWindow); diff --git a/src/platform/qt/main.cpp b/src/platform/qt/main.cpp index 631040d82..c58ce7837 100644 --- a/src/platform/qt/main.cpp +++ b/src/platform/qt/main.cpp @@ -10,9 +10,6 @@ #include "GBAApp.h" #include "Window.h" -#include -#include - #include #ifdef QT_STATIC @@ -31,15 +28,5 @@ int main(int argc, char* argv[]) { #endif QGBA::GBAApp application(argc, argv); - QLocale locale = QLocale::system(); - - QTranslator qtTranslator; - qtTranslator.load(locale, "qt", "_", QLibraryInfo::location(QLibraryInfo::TranslationsPath)); - application.installTranslator(&qtTranslator); - - QTranslator langTranslator; - langTranslator.load(locale, binaryName, "-", ":/translations/"); - application.installTranslator(&langTranslator); - return application.exec(); } From b909575a6cb2aa669e4086c2d4e21bcc635e85b5 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 30 Jun 2017 11:24:50 -0700 Subject: [PATCH 20/41] Qt: Fix initial window size (fixes #766) --- CHANGES | 1 + src/platform/qt/Window.cpp | 16 ++++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 079c31785..d3571ff58 100644 --- a/CHANGES +++ b/CHANGES @@ -150,6 +150,7 @@ Misc: Bugfixes: - Qt: Fix memory search close button (fixes mgba.io/i/769) - Qt: Fix window icon being stretched + - Qt: Fix initial window size (fixes mgba.io/i/766) Misc: - Qt: Add language selector diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index 75725e6e3..6caed26dc 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -85,7 +85,11 @@ Window::Window(ConfigController* config, int playerId, QWidget* parent) m_screenWidget->setMinimumSize(m_display->minimumSize()); m_screenWidget->setSizePolicy(m_display->sizePolicy()); - int i = 2; +#if defined(M_CORE_GBA) + float i = 2; +#elif defined(M_CORE_GB) + float i = 3; +#endif QVariant multiplier = m_config->getOption("scaleMultiplier"); if (!multiplier.isNull()) { m_savedScale = multiplier.toInt(); @@ -119,8 +123,11 @@ Window::Window(ConfigController* config, int playerId, QWidget* parent) m_controller->loadGame(output, path.second, path.first); } }); -#elif defined(M_CORE_GBA) - m_screenWidget->setSizeHint(QSize(VIDEO_HORIZONTAL_PIXELS * i, VIDEO_VERTICAL_PIXELS * i)); +#endif +#if defined(M_CORE_GBA) + resizeFrame(QSize(VIDEO_HORIZONTAL_PIXELS * i, VIDEO_VERTICAL_PIXELS * i)); +#elif defined(M_CORE_GB) + resizeFrame(QSize(GB_VIDEO_HORIZONTAL_PIXELS * i, GB_VIDEO_VERTICAL_PIXELS * i)); #endif m_screenWidget->setPixmap(m_logo); m_screenWidget->setLockAspectRatio(m_logo.width(), m_logo.height()); @@ -233,9 +240,6 @@ void Window::argumentsPassed(mArguments* args) { void Window::resizeFrame(const QSize& size) { QSize newSize(size); -#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) - newSize /= m_screenWidget->devicePixelRatioF(); -#endif m_screenWidget->setSizeHint(newSize); newSize -= m_screenWidget->size(); newSize += this->size(); From faae0db84c159f9eb7f3d7f081165329bc4a7fb1 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 1 Jul 2017 00:28:42 -0700 Subject: [PATCH 21/41] Qt: Fix data directory path --- CHANGES | 1 + src/platform/qt/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index d3571ff58..fd8b8a8dd 100644 --- a/CHANGES +++ b/CHANGES @@ -151,6 +151,7 @@ Bugfixes: - Qt: Fix memory search close button (fixes mgba.io/i/769) - Qt: Fix window icon being stretched - Qt: Fix initial window size (fixes mgba.io/i/766) + - Qt: Fix data directory path Misc: - Qt: Add language selector diff --git a/src/platform/qt/CMakeLists.txt b/src/platform/qt/CMakeLists.txt index 088e26d23..a41e422cc 100644 --- a/src/platform/qt/CMakeLists.txt +++ b/src/platform/qt/CMakeLists.txt @@ -209,7 +209,7 @@ if(NOT DEFINED DATADIR) if(APPLE) set(DATADIR Applications/${PROJECT_NAME}.app/Contents/Resources) else() - set(DATADIR ${CMAKE_INSTALL_DATADIR}/${BINARY_NAME}) + set(DATADIR ${CMAKE_INSTALL_FULL_DATADIR}/${BINARY_NAME}) endif() endif() install(DIRECTORY ${CMAKE_SOURCE_DIR}/res/shaders DESTINATION ${DATADIR} COMPONENT ${BINARY_NAME}-qt) @@ -253,7 +253,7 @@ install(TARGETS ${BINARY_NAME}-qt if(UNIX AND NOT APPLE) find_program(DESKTOP_FILE_INSTALL desktop-file-install) if(DESKTOP_FILE_INSTALL) - install(CODE "execute_process(COMMAND ${DESKTOP_FILE_INSTALL} \"${CMAKE_SOURCE_DIR}/res/mgba-qt.desktop\" --dir \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/applications/\")") + install(CODE "execute_process(COMMAND ${DESKTOP_FILE_INSTALL} \"${CMAKE_SOURCE_DIR}/res/mgba-qt.desktop\" --dir \"\$ENV{DESTDIR}\${CMAKE_INSTALL_FULL_DATADIR}/applications/\")") endif() endif() if(UNIX) From 11354ac23ea6cbc41df04f2132e3b44d38c1494a Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 2 Jul 2017 10:06:59 -0700 Subject: [PATCH 22/41] All: Partially revert datadir change --- src/platform/qt/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/qt/CMakeLists.txt b/src/platform/qt/CMakeLists.txt index a41e422cc..f33c292ee 100644 --- a/src/platform/qt/CMakeLists.txt +++ b/src/platform/qt/CMakeLists.txt @@ -253,7 +253,7 @@ install(TARGETS ${BINARY_NAME}-qt if(UNIX AND NOT APPLE) find_program(DESKTOP_FILE_INSTALL desktop-file-install) if(DESKTOP_FILE_INSTALL) - install(CODE "execute_process(COMMAND ${DESKTOP_FILE_INSTALL} \"${CMAKE_SOURCE_DIR}/res/mgba-qt.desktop\" --dir \"\$ENV{DESTDIR}\${CMAKE_INSTALL_FULL_DATADIR}/applications/\")") + install(CODE "execute_process(COMMAND ${DESKTOP_FILE_INSTALL} \"${CMAKE_SOURCE_DIR}/res/mgba-qt.desktop\" --dir \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/applications/\")") endif() endif() if(UNIX) From da50382cd42765d48451fdf1f2fa608d87813626 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 2 Jul 2017 10:06:05 -0700 Subject: [PATCH 23/41] GBA Timer: Improve accuracy of timers --- CHANGES | 4 ++++ src/gba/timer.c | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index fd8b8a8dd..0f0327f68 100644 --- a/CHANGES +++ b/CHANGES @@ -75,6 +75,8 @@ Bugfixes: - GB Timer: Fix sub-M-cycle DIV reset timing and edge triggering - Core: Fix interrupting a thread while on the thread (fixes mgba.io/i/692) - Core: Fix directory sets crashing on close if base isn't properly detached + - Qt: Fix window icon being stretched + - Qt: Fix data directory path Misc: - SDL: Remove scancode key input - GBA Video: Clean up unused timers @@ -145,6 +147,7 @@ Misc: - GB MBC: New MBC7 implementation - Qt: Better highlight active key in control binding - Core: Improved threading interrupted detection + - GBA Timer: Improve accuracy of timers 0.6 beta 2: (Future) Bugfixes: @@ -154,6 +157,7 @@ Bugfixes: - Qt: Fix data directory path Misc: - Qt: Add language selector + - GBA Timer: Improve accuracy of timers 0.6 beta 1: (2017-06-29) - Initial beta for 0.6 diff --git a/src/gba/timer.c b/src/gba/timer.c index 03af4fe34..7bdd362df 100644 --- a/src/gba/timer.c +++ b/src/gba/timer.c @@ -103,20 +103,22 @@ void GBATimerWriteTMCNT_HI(struct GBA* gba, int timer, uint16_t control) { GBATimerUpdateRegister(gba, timer); unsigned oldPrescale = GBATimerFlagsGetPrescaleBits(currentTimer->flags); + unsigned prescaleBits; switch (control & 0x0003) { case 0x0000: - currentTimer->flags = GBATimerFlagsSetPrescaleBits(currentTimer->flags, 0); + prescaleBits = 0; break; case 0x0001: - currentTimer->flags = GBATimerFlagsSetPrescaleBits(currentTimer->flags, 6); + prescaleBits = 6; break; case 0x0002: - currentTimer->flags = GBATimerFlagsSetPrescaleBits(currentTimer->flags, 8); + prescaleBits = 8; break; case 0x0003: - currentTimer->flags = GBATimerFlagsSetPrescaleBits(currentTimer->flags, 10); + prescaleBits = 10; break; } + currentTimer->flags = GBATimerFlagsSetPrescaleBits(currentTimer->flags, prescaleBits); currentTimer->flags = GBATimerFlagsTestFillCountUp(currentTimer->flags, timer > 0 && (control & 0x0004)); currentTimer->flags = GBATimerFlagsTestFillDoIrq(currentTimer->flags, control & 0x0040); currentTimer->overflowInterval = (0x10000 - currentTimer->reload) << GBATimerFlagsGetPrescaleBits(currentTimer->flags); @@ -125,7 +127,7 @@ void GBATimerWriteTMCNT_HI(struct GBA* gba, int timer, uint16_t control) { if (!wasEnabled && GBATimerFlagsIsEnable(currentTimer->flags)) { mTimingDeschedule(&gba->timing, ¤tTimer->event); if (!GBATimerFlagsIsCountUp(currentTimer->flags)) { - mTimingSchedule(&gba->timing, ¤tTimer->event, currentTimer->overflowInterval); + mTimingSchedule(&gba->timing, ¤tTimer->event, currentTimer->overflowInterval + 7 - 6 * prescaleBits); } gba->memory.io[(REG_TM0CNT_LO + (timer << 2)) >> 1] = currentTimer->reload; currentTimer->oldReload = currentTimer->reload; From 4cd249e632f7337adf061e3e1a25442506938a84 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 2 Jul 2017 17:00:44 -0700 Subject: [PATCH 24/41] Qt: Fix controls not saving on non-SDL builds --- CHANGES | 1 + src/platform/qt/InputController.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 0f0327f68..d15921656 100644 --- a/CHANGES +++ b/CHANGES @@ -155,6 +155,7 @@ Bugfixes: - Qt: Fix window icon being stretched - Qt: Fix initial window size (fixes mgba.io/i/766) - Qt: Fix data directory path + - Qt: Fix controls not saving on non-SDL builds Misc: - Qt: Add language selector - GBA Timer: Improve accuracy of timers diff --git a/src/platform/qt/InputController.cpp b/src/platform/qt/InputController.cpp index 8a643854f..4731d81eb 100644 --- a/src/platform/qt/InputController.cpp +++ b/src/platform/qt/InputController.cpp @@ -123,8 +123,8 @@ void InputController::saveConfiguration() { if (m_playerAttached) { mSDLPlayerSaveConfig(&m_sdlPlayer, m_config->input()); } - m_config->write(); #endif + m_config->write(); } void InputController::saveConfiguration(uint32_t type) { From ab9b398317aef256f2aa2f0a2da524149c1a1c76 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 3 Jul 2017 23:53:01 -0700 Subject: [PATCH 25/41] GBA Timer: Use global cycles for timers --- CHANGES | 4 ++ include/mgba/internal/gba/gba.h | 1 + include/mgba/internal/gba/timer.h | 5 +- src/gba/io.c | 15 +++-- src/gba/timer.c | 98 ++++++++++++++++++++----------- 5 files changed, 81 insertions(+), 42 deletions(-) diff --git a/CHANGES b/CHANGES index d15921656..79b56b392 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +0.7.0: (Future) +Misc: + - GBA Timer: Use global cycles for timers + 0.6.0: (Future) Features: - GBA: Support printing debug strings from inside a game diff --git a/include/mgba/internal/gba/gba.h b/include/mgba/internal/gba/gba.h index 5710864e0..5440e3f12 100644 --- a/include/mgba/internal/gba/gba.h +++ b/include/mgba/internal/gba/gba.h @@ -79,6 +79,7 @@ struct GBA { uint32_t bus; int performingDMA; + struct mTimingEvent timerMaster; struct GBATimer timers[4]; int springIRQ; diff --git a/include/mgba/internal/gba/timer.h b/include/mgba/internal/gba/timer.h index d031f3d4f..5cb23605b 100644 --- a/include/mgba/internal/gba/timer.h +++ b/include/mgba/internal/gba/timer.h @@ -21,15 +21,14 @@ DECL_BIT(GBATimerFlags, Enable, 6); struct GBA; struct GBATimer { uint16_t reload; - uint16_t oldReload; - uint32_t lastEvent; + int32_t lastEvent; struct mTimingEvent event; int32_t overflowInterval; GBATimerFlags flags; }; void GBATimerInit(struct GBA* gba); -void GBATimerUpdateRegister(struct GBA* gba, int timer); +void GBATimerUpdateRegister(struct GBA* gba, int timer, int32_t cyclesLate); void GBATimerWriteTMCNT_LO(struct GBA* gba, int timer, uint16_t value); void GBATimerWriteTMCNT_HI(struct GBA* gba, int timer, uint16_t value); diff --git a/src/gba/io.c b/src/gba/io.c index 4d36f2800..ebcb30d95 100644 --- a/src/gba/io.c +++ b/src/gba/io.c @@ -707,17 +707,18 @@ uint16_t GBAIORead(struct GBA* gba, uint32_t address) { } switch (address) { + // Reading this takes two cycles (1N+1I), so let's remove them preemptively case REG_TM0CNT_LO: - GBATimerUpdateRegister(gba, 0); + GBATimerUpdateRegister(gba, 0, 2); break; case REG_TM1CNT_LO: - GBATimerUpdateRegister(gba, 1); + GBATimerUpdateRegister(gba, 1, 2); break; case REG_TM2CNT_LO: - GBATimerUpdateRegister(gba, 2); + GBATimerUpdateRegister(gba, 2, 2); break; case REG_TM3CNT_LO: - GBATimerUpdateRegister(gba, 3); + GBATimerUpdateRegister(gba, 3, 2); break; case REG_KEYINPUT: @@ -925,7 +926,6 @@ void GBAIOSerialize(struct GBA* gba, struct GBASerializedState* state) { for (i = 0; i < 4; ++i) { STORE_16(gba->memory.io[(REG_DMA0CNT_LO + i * 12) >> 1], (REG_DMA0CNT_LO + i * 12), state->io); STORE_16(gba->timers[i].reload, 0, &state->timers[i].reload); - STORE_16(gba->timers[i].oldReload, 0, &state->timers[i].oldReload); STORE_32(gba->timers[i].lastEvent - mTimingCurrentTime(&gba->timing), 0, &state->timers[i].lastEvent); STORE_32(gba->timers[i].event.when - mTimingCurrentTime(&gba->timing), 0, &state->timers[i].nextEvent); STORE_32(gba->timers[i].overflowInterval, 0, &state->timers[i].overflowInterval); @@ -952,9 +952,12 @@ void GBAIODeserialize(struct GBA* gba, const struct GBASerializedState* state) { } uint32_t when; + LOAD_32(when, 0, &state->masterCycles); + when += state->cpu.cycles; + when = 0x400 - (when & 0x3FF); + mTimingSchedule(&gba->timing, &gba->timerMaster, when); for (i = 0; i < 4; ++i) { LOAD_16(gba->timers[i].reload, 0, &state->timers[i].reload); - LOAD_16(gba->timers[i].oldReload, 0, &state->timers[i].oldReload); LOAD_32(gba->timers[i].overflowInterval, 0, &state->timers[i].overflowInterval); LOAD_32(gba->timers[i].flags, 0, &state->timers[i].flags); if (i > 0 && GBATimerFlagsIsCountUp(gba->timers[i].flags)) { diff --git a/src/gba/timer.c b/src/gba/timer.c index 7bdd362df..ee965aa78 100644 --- a/src/gba/timer.c +++ b/src/gba/timer.c @@ -8,11 +8,12 @@ #include #include -static void GBATimerUpdate(struct mTiming* timing, struct GBA* gba, int timerId, uint32_t cyclesLate) { +#define TIMER_MASTER 1024 + +static void GBATimerUpdate(struct GBA* gba, int timerId, uint32_t cyclesLate) { struct GBATimer* timer = &gba->timers[timerId]; gba->memory.io[(REG_TM0CNT_LO >> 1) + (timerId << 1)] = timer->reload; - timer->oldReload = timer->reload; - timer->lastEvent = timing->masterCycles - cyclesLate; + GBATimerUpdateRegister(gba, timerId, cyclesLate); if (GBATimerFlagsIsDoIrq(timer->flags)) { GBARaiseIRQ(gba, IRQ_TIMER0 + timerId); @@ -33,74 +34,106 @@ static void GBATimerUpdate(struct mTiming* timing, struct GBA* gba, int timerId, if (GBATimerFlagsIsCountUp(nextTimer->flags)) { // TODO: Does this increment while disabled? ++gba->memory.io[(REG_TM1CNT_LO >> 1) + (timerId << 1)]; if (!gba->memory.io[(REG_TM1CNT_LO >> 1) + (timerId << 1)] && GBATimerFlagsIsEnable(nextTimer->flags)) { - mTimingSchedule(timing, &nextTimer->event, -cyclesLate); + GBATimerUpdate(gba, timerId + 1, cyclesLate); } } } +} - if (!GBATimerFlagsIsCountUp(timer->flags)) { - uint32_t nextEvent = timer->overflowInterval - cyclesLate; - mTimingSchedule(timing, &timer->event, nextEvent); - } +static void GBATimerMasterUpdate(struct mTiming* timing, void* context, uint32_t cyclesLate) { + struct GBA* gba = context; + mTimingSchedule(timing, &gba->timerMaster, TIMER_MASTER - cyclesLate); + GBATimerUpdateRegister(gba, 0, cyclesLate); + GBATimerUpdateRegister(gba, 1, cyclesLate); + GBATimerUpdateRegister(gba, 2, cyclesLate); + GBATimerUpdateRegister(gba, 3, cyclesLate); } static void GBATimerUpdate0(struct mTiming* timing, void* context, uint32_t cyclesLate) { - GBATimerUpdate(timing, context, 0, cyclesLate); + UNUSED(timing); + GBATimerUpdate(context, 0, cyclesLate); } static void GBATimerUpdate1(struct mTiming* timing, void* context, uint32_t cyclesLate) { - GBATimerUpdate(timing, context, 1, cyclesLate); + UNUSED(timing); + GBATimerUpdate(context, 1, cyclesLate); } static void GBATimerUpdate2(struct mTiming* timing, void* context, uint32_t cyclesLate) { - GBATimerUpdate(timing, context, 2, cyclesLate); + UNUSED(timing); + GBATimerUpdate(context, 2, cyclesLate); } static void GBATimerUpdate3(struct mTiming* timing, void* context, uint32_t cyclesLate) { - GBATimerUpdate(timing, context, 3, cyclesLate); + UNUSED(timing); + GBATimerUpdate(context, 3, cyclesLate); } void GBATimerInit(struct GBA* gba) { + gba->timerMaster.name = "GBA Timer Master"; + gba->timerMaster.callback = GBATimerMasterUpdate; + gba->timerMaster.context = gba; + gba->timerMaster.priority = 0x20; + mTimingSchedule(&gba->timing, &gba->timerMaster, TIMER_MASTER); memset(gba->timers, 0, sizeof(gba->timers)); gba->timers[0].event.name = "GBA Timer 0"; gba->timers[0].event.callback = GBATimerUpdate0; gba->timers[0].event.context = gba; - gba->timers[0].event.priority = 0x20; + gba->timers[0].event.priority = 0x21; gba->timers[1].event.name = "GBA Timer 1"; gba->timers[1].event.callback = GBATimerUpdate1; gba->timers[1].event.context = gba; - gba->timers[1].event.priority = 0x21; + gba->timers[1].event.priority = 0x22; gba->timers[2].event.name = "GBA Timer 2"; gba->timers[2].event.callback = GBATimerUpdate2; gba->timers[2].event.context = gba; - gba->timers[2].event.priority = 0x22; + gba->timers[2].event.priority = 0x23; gba->timers[3].event.name = "GBA Timer 3"; gba->timers[3].event.callback = GBATimerUpdate3; gba->timers[3].event.context = gba; - gba->timers[3].event.priority = 0x23; + gba->timers[3].event.priority = 0x24; } -void GBATimerUpdateRegister(struct GBA* gba, int timer) { +void GBATimerUpdateRegister(struct GBA* gba, int timer, int32_t cyclesLate) { struct GBATimer* currentTimer = &gba->timers[timer]; - if (GBATimerFlagsIsEnable(currentTimer->flags) && !GBATimerFlagsIsCountUp(currentTimer->flags)) { - int32_t prefetchSkew = -2; - if (gba->memory.lastPrefetchedPc > (uint32_t) gba->cpu->gprs[ARM_PC]) { - prefetchSkew += ((gba->memory.lastPrefetchedPc - gba->cpu->gprs[ARM_PC]) * gba->cpu->memory.activeSeqCycles16) / WORD_SIZE_THUMB; + if (!GBATimerFlagsIsEnable(currentTimer->flags) || GBATimerFlagsIsCountUp(currentTimer->flags)) { + return; + } + + if (gba->memory.lastPrefetchedPc > (uint32_t) gba->cpu->gprs[ARM_PC]) { + cyclesLate -= ((gba->memory.lastPrefetchedPc - gba->cpu->gprs[ARM_PC]) * gba->cpu->memory.activeSeqCycles16) / WORD_SIZE_THUMB; + } + + int prescaleBits = GBATimerFlagsGetPrescaleBits(currentTimer->flags); + int32_t currentTime = mTimingCurrentTime(&gba->timing) - cyclesLate; + int32_t tickMask = (1 << prescaleBits) - 1; + currentTime &= ~tickMask; + int32_t tickIncrement = currentTime - currentTimer->lastEvent; + currentTimer->lastEvent = currentTime; + tickIncrement >>= prescaleBits; + tickIncrement += gba->memory.io[(REG_TM0CNT_LO + (timer << 2)) >> 1]; + gba->memory.io[(REG_TM0CNT_LO + (timer << 2)) >> 1] = tickIncrement; + tickIncrement -= 0x10000; + mTimingDeschedule(&gba->timing, ¤tTimer->event); + if (tickIncrement >= 0) { + mTimingSchedule(&gba->timing, ¤tTimer->event, 7 - (tickIncrement << prescaleBits)); + } else { + int32_t nextIncrement = mTimingUntil(&gba->timing, &gba->timerMaster); + tickIncrement = -tickIncrement; + tickIncrement <<= prescaleBits; + if (nextIncrement - tickIncrement > 0) { + mTimingSchedule(&gba->timing, ¤tTimer->event, 7 + tickIncrement); } - // Reading this takes two cycles (1N+1I), so let's remove them preemptively - int32_t diff = gba->cpu->cycles - (currentTimer->lastEvent - gba->timing.masterCycles); - gba->memory.io[(REG_TM0CNT_LO + (timer << 2)) >> 1] = currentTimer->oldReload + ((diff + prefetchSkew) >> GBATimerFlagsGetPrescaleBits(currentTimer->flags)); } } void GBATimerWriteTMCNT_LO(struct GBA* gba, int timer, uint16_t reload) { gba->timers[timer].reload = reload; - gba->timers[timer].overflowInterval = (0x10000 - gba->timers[timer].reload) << GBATimerFlagsGetPrescaleBits(gba->timers[timer].flags); } void GBATimerWriteTMCNT_HI(struct GBA* gba, int timer, uint16_t control) { struct GBATimer* currentTimer = &gba->timers[timer]; - GBATimerUpdateRegister(gba, timer); + GBATimerUpdateRegister(gba, timer, 0); unsigned oldPrescale = GBATimerFlagsGetPrescaleBits(currentTimer->flags); unsigned prescaleBits; @@ -121,21 +154,20 @@ void GBATimerWriteTMCNT_HI(struct GBA* gba, int timer, uint16_t control) { currentTimer->flags = GBATimerFlagsSetPrescaleBits(currentTimer->flags, prescaleBits); currentTimer->flags = GBATimerFlagsTestFillCountUp(currentTimer->flags, timer > 0 && (control & 0x0004)); currentTimer->flags = GBATimerFlagsTestFillDoIrq(currentTimer->flags, control & 0x0040); - currentTimer->overflowInterval = (0x10000 - currentTimer->reload) << GBATimerFlagsGetPrescaleBits(currentTimer->flags); bool wasEnabled = GBATimerFlagsIsEnable(currentTimer->flags); currentTimer->flags = GBATimerFlagsTestFillEnable(currentTimer->flags, control & 0x0080); if (!wasEnabled && GBATimerFlagsIsEnable(currentTimer->flags)) { mTimingDeschedule(&gba->timing, ¤tTimer->event); - if (!GBATimerFlagsIsCountUp(currentTimer->flags)) { - mTimingSchedule(&gba->timing, ¤tTimer->event, currentTimer->overflowInterval + 7 - 6 * prescaleBits); - } gba->memory.io[(REG_TM0CNT_LO + (timer << 2)) >> 1] = currentTimer->reload; - currentTimer->oldReload = currentTimer->reload; - currentTimer->lastEvent = gba->timing.masterCycles + gba->cpu->cycles; + int32_t tickMask = (1 << prescaleBits) - 1; + currentTimer->lastEvent = (mTimingCurrentTime(&gba->timing)) & ~tickMask; + GBATimerUpdateRegister(gba, timer, 0); } else if (wasEnabled && !GBATimerFlagsIsEnable(currentTimer->flags)) { mTimingDeschedule(&gba->timing, ¤tTimer->event); } else if (GBATimerFlagsIsEnable(currentTimer->flags) && GBATimerFlagsGetPrescaleBits(currentTimer->flags) != oldPrescale && !GBATimerFlagsIsCountUp(currentTimer->flags)) { mTimingDeschedule(&gba->timing, ¤tTimer->event); - mTimingSchedule(&gba->timing, ¤tTimer->event, currentTimer->overflowInterval - currentTimer->lastEvent); + int32_t tickMask = (1 << prescaleBits) - 1; + currentTimer->lastEvent = (mTimingCurrentTime(&gba->timing)) & ~tickMask; + GBATimerUpdateRegister(gba, timer, 0); } } From ccd9a1b54b7ca6114ca94325c8d38845d6749a90 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 4 Jul 2017 00:05:19 -0700 Subject: [PATCH 26/41] Qt: Hopefully fix datadir this time --- src/platform/qt/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platform/qt/CMakeLists.txt b/src/platform/qt/CMakeLists.txt index f33c292ee..800883ed0 100644 --- a/src/platform/qt/CMakeLists.txt +++ b/src/platform/qt/CMakeLists.txt @@ -209,13 +209,13 @@ if(NOT DEFINED DATADIR) if(APPLE) set(DATADIR Applications/${PROJECT_NAME}.app/Contents/Resources) else() - set(DATADIR ${CMAKE_INSTALL_FULL_DATADIR}/${BINARY_NAME}) + set(DATADIR ${CMAKE_INSTALL_DATADIR}/${BINARY_NAME}) endif() endif() install(DIRECTORY ${CMAKE_SOURCE_DIR}/res/shaders DESTINATION ${DATADIR} COMPONENT ${BINARY_NAME}-qt) install(FILES ${CMAKE_SOURCE_DIR}/res/nointro.dat DESTINATION ${DATADIR} COMPONENT ${BINARY_NAME}-qt) if(NOT WIN32 AND NOT APPLE) - list(APPEND QT_DEFINES DATADIR="${DATADIR}") + list(APPEND QT_DEFINES DATADIR="${CMAKE_INSTALL_PREFIX}/${DATADIR}") endif() find_package(Qt5LinguistTools) @@ -253,7 +253,7 @@ install(TARGETS ${BINARY_NAME}-qt if(UNIX AND NOT APPLE) find_program(DESKTOP_FILE_INSTALL desktop-file-install) if(DESKTOP_FILE_INSTALL) - install(CODE "execute_process(COMMAND ${DESKTOP_FILE_INSTALL} \"${CMAKE_SOURCE_DIR}/res/mgba-qt.desktop\" --dir \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/applications/\")") + install(CODE "execute_process(COMMAND ${DESKTOP_FILE_INSTALL} \"${CMAKE_SOURCE_DIR}/res/mgba-qt.desktop\" --dir \"\$ENV{DESTDIR}\${CMAKE_INSTALL_FULL_DATADIR}/applications/\")") endif() endif() if(UNIX) From 7a5190e95e517f8b1030340e72ae0288bb601f29 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 4 Jul 2017 02:17:56 -0700 Subject: [PATCH 27/41] GB Video: Fix LYC regression --- CHANGES | 1 + src/gb/video.c | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index 79b56b392..937f994e6 100644 --- a/CHANGES +++ b/CHANGES @@ -160,6 +160,7 @@ Bugfixes: - Qt: Fix initial window size (fixes mgba.io/i/766) - Qt: Fix data directory path - Qt: Fix controls not saving on non-SDL builds + - GB Video: Fix LYC regression Misc: - Qt: Add language selector - GBA Timer: Improve accuracy of timers diff --git a/src/gb/video.c b/src/gb/video.c index b495a96b1..605fcdd7f 100644 --- a/src/gb/video.c +++ b/src/gb/video.c @@ -386,6 +386,7 @@ void GBVideoWriteLYC(struct GBVideo* video, uint8_t value) { video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT); GBUpdateIRQs(video->p); } + video->p->memory.io[REG_STAT] = video->stat; } void GBVideoWritePalette(struct GBVideo* video, uint16_t address, uint8_t value) { From 0786d7fe3b6c78f46236cbb8fe2b91793d5304be Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 4 Jul 2017 09:59:26 -0700 Subject: [PATCH 28/41] GBA Timer: Fix reload timing regression --- include/mgba/internal/gba/timer.h | 1 - src/gba/io.c | 2 -- src/gba/timer.c | 6 +++++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/mgba/internal/gba/timer.h b/include/mgba/internal/gba/timer.h index 5cb23605b..664842e6b 100644 --- a/include/mgba/internal/gba/timer.h +++ b/include/mgba/internal/gba/timer.h @@ -23,7 +23,6 @@ struct GBATimer { uint16_t reload; int32_t lastEvent; struct mTimingEvent event; - int32_t overflowInterval; GBATimerFlags flags; }; diff --git a/src/gba/io.c b/src/gba/io.c index ebcb30d95..bae8236f3 100644 --- a/src/gba/io.c +++ b/src/gba/io.c @@ -928,7 +928,6 @@ void GBAIOSerialize(struct GBA* gba, struct GBASerializedState* state) { STORE_16(gba->timers[i].reload, 0, &state->timers[i].reload); STORE_32(gba->timers[i].lastEvent - mTimingCurrentTime(&gba->timing), 0, &state->timers[i].lastEvent); STORE_32(gba->timers[i].event.when - mTimingCurrentTime(&gba->timing), 0, &state->timers[i].nextEvent); - STORE_32(gba->timers[i].overflowInterval, 0, &state->timers[i].overflowInterval); STORE_32(gba->timers[i].flags, 0, &state->timers[i].flags); STORE_32(gba->memory.dma[i].nextSource, 0, &state->dma[i].nextSource); STORE_32(gba->memory.dma[i].nextDest, 0, &state->dma[i].nextDest); @@ -958,7 +957,6 @@ void GBAIODeserialize(struct GBA* gba, const struct GBASerializedState* state) { mTimingSchedule(&gba->timing, &gba->timerMaster, when); for (i = 0; i < 4; ++i) { LOAD_16(gba->timers[i].reload, 0, &state->timers[i].reload); - LOAD_32(gba->timers[i].overflowInterval, 0, &state->timers[i].overflowInterval); LOAD_32(gba->timers[i].flags, 0, &state->timers[i].flags); if (i > 0 && GBATimerFlagsIsCountUp(gba->timers[i].flags)) { // Overwrite invalid values in savestate diff --git a/src/gba/timer.c b/src/gba/timer.c index ee965aa78..d68fcbef4 100644 --- a/src/gba/timer.c +++ b/src/gba/timer.c @@ -13,7 +13,11 @@ static void GBATimerUpdate(struct GBA* gba, int timerId, uint32_t cyclesLate) { struct GBATimer* timer = &gba->timers[timerId]; gba->memory.io[(REG_TM0CNT_LO >> 1) + (timerId << 1)] = timer->reload; - GBATimerUpdateRegister(gba, timerId, cyclesLate); + int32_t currentTime = mTimingCurrentTime(&gba->timing) - cyclesLate; + int32_t tickMask = (1 << GBATimerFlagsGetPrescaleBits(timer->flags)) - 1; + currentTime &= ~tickMask; + timer->lastEvent = currentTime; + GBATimerUpdateRegister(gba, timerId, 0); if (GBATimerFlagsIsDoIrq(timer->flags)) { GBARaiseIRQ(gba, IRQ_TIMER0 + timerId); From 055302ef6fccdc622684f137ff238ef301b3dedb Mon Sep 17 00:00:00 2001 From: theheroGAC Date: Fri, 30 Jun 2017 18:26:36 +0200 Subject: [PATCH 29/41] Create mgba-it.ts Italian translation rev.1 --- src/platform/qt/ts/mgba-it.ts | 4305 +++++++++++++++++++++++++++++++++ 1 file changed, 4305 insertions(+) create mode 100644 src/platform/qt/ts/mgba-it.ts diff --git a/src/platform/qt/ts/mgba-it.ts b/src/platform/qt/ts/mgba-it.ts new file mode 100644 index 000000000..39abe32f3 --- /dev/null +++ b/src/platform/qt/ts/mgba-it.ts @@ -0,0 +1,4305 @@ + + + + + AboutScreen + + + About + About + + + + <a href="http://mgba.io/">Website</a> • <a href="https://forums.mgba.io/">Forums / Support</a> • <a href="https://patreon.com/mgba">Donate</a> • <a href="https://github.com/mgba-emu/mgba/tree/{gitBranch}">Source</a> + <a href="http://mgba.io/">Sitio web</a> • <a href="https://forums.mgba.io/">Foros / Supporto</a> • <a href="https://patreon.com/mgba">Donar</a> • <a href="https://github.com/mgba-emu/mgba/tree/{gitBranch}">Codice sorgente</a> + + + + {projectName} + {projectName} + + + + {projectName} would like to thank the following patrons from Patreon: + {projectName} desidera ringraziare i seguenti sponsor di Patreon: + + + + © 2013 – 2016 Jeffrey Pfau, licensed under the Mozilla Public License, version 2.0 +Game Boy Advance is a registered trademark of Nintendo Co., Ltd. + © 2013 - 2016 Jeffrey Pfau, sotto licenza Mozilla Public License, versione 2.0 +Game Boy Advance è un marchio registrato di Nintendo Co., Ltd. + + + + {patrons} + {patrons} + + + + {projectVersion} + {projectVersion} + + + + {logo} + {logo} + + + + {projectName} is an open-source Game Boy Advance emulator + {projectName} è un emulatore open-source del Game Boy Advance + + + + Branch: <tt>{gitBranch}</tt><br/>Revision: <tt>{gitCommit}</tt> + Ramo Git: <tt>{gitBranch}</tt><br/>Revisione: <tt>{gitCommit}</tt> + + + + ArchiveInspector + + + Open in archive... + Apri il file in ... + + + + Loading... + Caricamento... + + + + AssetTile + + + AssetTile + AssetTile + + + + Tile # + Tile Nº + + + + 0 + 0 + + + + Address + Indirizzo + + + + 0x06000000 + 0x06000000 + + + + Red + Rosso + + + + Green + Verde + + + + Blue + Blue + + + + + + 0x00 (00) + 0x00 (00) + + + + CheatsView + + + Cheats + Trucchi + + + + Remove + Rimuovere + + + + Save + Salva + + + + Load + Carica + + + + Add New Set + Aggiungere Nuovo Set + + + + Add + Aggiungi + + + + DebuggerConsole + + + Debugger + Debugger + + + + Enter command (try `help` for more info) + Inserire un comando (premere `help` per maggiori informazioni) + + + + Break + Pausa + + + + GIFView + + + Record GIF + Registra GIF + + + + Start + Avvia + + + + Stop + Stop + + + + Select File + Seleziona File + + + + Frameskip + Salta Frame + + + + Frame delay (ms) + Ritardo Frame (ms) + + + + Automatic + Automatico + + + + IOViewer + + + I/O Viewer + Visualizzatore I/O + + + + 0x0000 + 0x0000 + + + + 2 + 2 + + + + 5 + 5 + + + + 4 + 4 + + + + 7 + 7 + + + + 0 + 0 + + + + 9 + 9 + + + + 1 + 1 + + + + 3 + 3 + + + + 8 + 8 + + + + C + C + + + + E + E + + + + 6 + 6 + + + + D + D + + + + F + F + + + + A + A + + + + B + B + + + + LibraryView + + + Library + Biblioteca + + + + LoadSaveState + + + + %1 State + %1 cattura stato + + + + + + + + + + + + No Save + Senza Salvare + + + + 1 + 1 + + + + 2 + 2 + + + + 3 + 3 + + + + 4 + 4 + + + + 5 + 5 + + + + 6 + 6 + + + + 7 + 7 + + + + 8 + 8 + + + + 9 + 9 + + + + LogView + + + Logs + Logs + + + + Enabled Levels + Abilita Livelli + + + + Debug + Debug + + + + Stub + Stub + + + + Info + Informazioni + + + + Warning + Avvertenze + + + + Error + Errore + + + + Fatal + Fatale + + + + Game Error + Errore del gioco + + + + Clear + Pulisci + + + + Max Lines + Linee di massima + + + + MemoryView + + + Memory + Memoria + + + + Inspect Address: + Ispezionare indirizzo: + + + + 0x + 0x + + + + Set Alignment: + Set di allignamento: + + + + 1 Byte + 1 byte + + + + 2 Bytes + 2 bytes + + + + 4 Bytes + 4 bytes + + + + Signed Integer: + Integer Signato: + + + + String: + Stringa: + + + + Load TBL + Carica TBL + + + + Copy Selection + Copia la selezione + + + + Paste + Incolla + + + + Save Selection + Salva Selezione + + + + Load + Carica + + + + Unsigned Integer: + Integer non signato: + + + + ObjView + + + Sprites + Sprites + + + + + × + × + + + + Magnification + Magnification + + + + Attributes + Attributi + + + + Transform + Transformazione + + + + Off + No + + + + Palette + Palette + + + + + + + 0 + 0 + + + + Double Size + Doppia Dimensione + + + + + + + Return, Ctrl+R + Return, Ctrl+R + + + + Flipped + Flippato + + + + H + H + + + + V + V + + + + Mode + Modalità + + + + Normal + Normale + + + + Mosaic + Mosaico + + + + Enabled + Abilitato + + + + Priority + Priorità + + + + Tile + Tile + + + + Geometry + Geometria + + + + Position + Posizione + + + + , + , + + + + Dimensions + Dimensione + + + + + 8 + 8 + + + + Address + Indirizzo + + + + 0x07000000 + 0x07000000 + + + + OverrideView + + + Game Overrides + Valori specifici per gioco + + + + Game Boy Advance + Game Boy Advance + + + + + + + Autodetect + Rilevamento automatico + + + + Realtime clock + RealTime clock + + + + Gyroscope + Giroscopio + + + + Tilt + Inclinazione + + + + Light sensor + Sensore di luce + + + + Rumble + Vibrazione + + + + Save type + Tipo di salvataggio + + + + + None + Nessuno + + + + SRAM + SRAM + + + + Flash 512kb + Flash 512kb + + + + Flash 1Mb + Flash 1Mb + + + + EEPROM + EEPROM + + + + Idle loop + Idle loop + + + + Game Boy Player features + Caratteristiche Game Boy Player + + + + Game Boy + Game Boy + + + + Game Boy model + Modello del Game Boy + + + + Game Boy (DMG) + Game Boy (DMG) + + + + Game Boy Color (CGB) + Game Boy Color (CGB) + + + + Game Boy Advance (AGB) + Game Boy Advance (AGB) + + + + Memory bank controller + Controller del banco di memoria + + + + MBC1 + MBC1 + + + + MBC2 + MBC2 + + + + MBC3 + MBC3 + + + + MBC3 + RTC + MBC3 + Reloj + + + + MBC5 + MBC5 + + + + MBC5 + Rumble + MBC5 + Vibrazione + + + + MBC7 + MBC7 + + + + HuC-3 + HuC-3 + + + + PaletteView + + + Palette + Palette + + + + Background + SFondo (BG) + + + + Objects + Oggetti (OBJ) + + + + Selection + Selezione + + + + Red + Rosso + + + + Green + Verde + + + + Blue + Blue + + + + + + 0x00 (00) + 0x00 (00) + + + + 16-bit value + Valore in 16 bits + + + + Hex code + Codice esadecimale + + + + Palette index + Indice palette + + + + 0x0000 + 0x0000 + + + + #000000 + #000000 + + + + 000 + 000 + + + + Export BG + Esporta BG + + + + Export OBJ + Esporta OBJ + + + + QGBA::AssetTile + + + %0%1%2 + %0%1%2 + + + + + + 0x%0 (%1) + 0x%0 (%1) + + + + QGBA::CheatsModel + + + (untitled) + (senza titolo) + + + + Failed to open cheats file: %1 + Impossibile aprire il file cheats: %1 + + + + QGBA::CheatsView + + + + Add GameShark + Aggiungi GameShark + + + + Add Pro Action Replay + Aggiungi Pro Action Replay + + + + Add CodeBreaker + Aggiungi CodeBreaker + + + + Add GameGenie + Aggiungi GameGenie + + + + + Select cheats file + Seleziona il file cheats + + + + QGBA::GBAKeyEditor + + + Clear Button + Pulisci bottoni + + + + Clear Analog + Pulisci analogici + + + + Refresh + Aggiornare + + + + Set all + Impostare tutti + + + + QGBA::GDBWindow + + + Server settings + Impostazioni Server + + + + Local port + Porta locale + + + + Bind address + Indirizzo Bind + + + + Break + Break + + + + Stop + Stop + + + + Start + Avvia + + + + Crash + Errore + + + + Could not start GDB server + Impossibile avviare il server GDB + + + + QGBA::GIFView + + + Failed to open output GIF file: %1 + Impossibile aprire il file GIF di output: %1 + + + + Select output file + Seleziona file di output + + + + Graphics Interchange Format (*.gif) + Formato di interconnessione grafica (*.gif) + + + + QGBA::GameController + + + + Failed to open game file: %1 + Impossibile aprire il file di gioco: %1 + + + + Failed to open save file: %1 + Impossibile aprire il file di salvataggio: %1 + + + + Failed to open snapshot file for reading: %1 + Impossibile aprire il file snapshot per la lettura: %1 + + + + Failed to open snapshot file for writing: %1 + Impossibile aprire il file snapshot per la scrittura: %1 + + + + Failed to start audio processor + Impossibile avviare il processore audio + + + + QGBA::IOViewer + + + Background mode + Modalità Background (BG) + + + + Mode 0: 4 tile layers + Modalità 0: 4 tiles layers + + + + Mode 1: 2 tile layers + 1 rotated/scaled tile layer + Modalità 1: 2 tile layers + 1 ruotato/scalato tile layer + + + + Mode 2: 2 rotated/scaled tile layers + Modalità 2: 2 ruotato/scalato tile layers + + + + Mode 3: Full 15-bit bitmap + Modalità 3: completo 15 bitmap + + + + Mode 4: Full 8-bit bitmap + Modalità 4: completo 8 bits + + + + Mode 5: Small 15-bit bitmap + Modalità 5: basso 15-bit bitmap + + + + CGB Mode + Modalità CGB + + + + Frame select + Seleziona Frame + + + + Unlocked HBlank + HBlank sbloccato + + + + Linear OBJ tile mapping + Mappatura lineare tile OBJ + + + + Force blank screen + Forza schermo bianco + + + + Enable background 0 + Abilitare sfondo 0 + + + + Enable background 1 + Abilitare sfondo 1 + + + + Enable background 2 + Abilitare sfondo 2 + + + + Enable background 3 + Abilitare sfondo 3 + + + + Enable OBJ + Abilitare OBJ + + + + Enable Window 0 + Abilitare Window 0 + + + + Enable Window 1 + Abilitare Window 1 + + + + Enable OBJ Window + Abilitare Window OBJ + + + + Currently in VBlank + Attualmente in VBlank + + + + Currently in HBlank + Attualmente in HBlank + + + + Currently in VCounter + Attualmente in VCounter + + + + Enable VBlank IRQ generation + Abilita VBlank + + + + Enable HBlank IRQ generation + Abilita HBlank generazione IRQ + + + + Enable VCounter IRQ generation + Abilita generazione IRQ VCounter + + + + VCounter scanline + VCounter scanline + + + + Current scanline + Scanline corrente + + + + + + + Priority + Priorità + + + + + + + Tile data base (* 16kB) + Tile data base (* 16kB) + + + + + + + Enable mosaic + Abilita Mosaico + + + + + + + Enable 256-color + Abilita 256 colori + + + + + + + Tile map base (* 2kB) + Tile map base (* 2kB) + + + + + + + Background dimensions + Dimensioni dello sfondo + + + + + Overflow wraps + Overflow wraps + + + + + + + Horizontal offset + Compensazione orizzontale + + + + + + + Vertical offset + Compensazione verticale + + + + + + + + + + + + + + + Fractional part + Parte frazionale + + + + + + + + + + + Integer part + Parte Integer + + + + + + + Integer part (bottom) + Parte Integer (inferiore) + + + + + + + Integer part (top) + Parte Integer (superiore) + + + + + End x + Fine x + + + + + Start x + Inizio x + + + + + End y + Fine y + + + + + Start y + Inizio y + + + + Window 0 enable BG 0 + Window 0 BG 0 + + + + Window 0 enable BG 1 + Window 0 BG 1 + + + + Window 0 enable BG 2 + Window 0 BG 2 + + + + Window 0 enable BG 3 + Window 0 BG 3 + + + + Window 0 enable OBJ + Window 0 OBJ + + + + Window 0 enable blend + Abilita Window 0 miscelato + + + + Window 1 enable BG 0 + Abilita Window 1 BG 0 + + + + Window 1 enable BG 1 + Abilita Window 1 BG 1 + + + + Window 1 enable BG 2 + Abilita Window 1 BG 2 + + + + Window 1 enable BG 3 + AbilitaWindow 1 BG 3 + + + + Window 1 enable OBJ + Abilita Window 1 OBJ + + + + Window 1 enable blend + Abilita Window 1 miscelato + + + + Outside window enable BG 0 + Abilita Outside window BG 0 + + + + Outside window enable BG 1 + Abilita Outside window BG 1 + + + + Outside window enable BG 2 + Abilita Outside window BG 2 + + + + Outside window enable BG 3 + Abilita Outside window BG 3 + + + + Outside window enable OBJ + Abilita Outside window OBJ + + + + Outside window enable blend + Outside window mezcla + + + + OBJ window enable BG 0 + Abilita OBJ window BG 0 + + + + OBJ window enable BG 1 + Abilita OBJ window BG 1 + + + + OBJ window enable BG 2 + Abilita OBJ window BG 2 + + + + OBJ window enable BG 3 + Abilita OBJ window BG 3 + + + + OBJ window enable OBJ + Abilita OBJ window OBJ + + + + OBJ window enable blend + Abilita OBJ window mezcla + + + + Background mosaic size vertical + Sfondo mosaico verticale + + + + Background mosaic size horizontal + Sfondo mosaico orizzontale + + + + Object mosaic size vertical + Sfondo mosaico oggetto verticale + + + + Object mosaic size horizontal + Sfondo mosaico oggetto orizzontale + + + + BG 0 target 1 + BG 0 target 1 + + + + BG 1 target 1 + BG 1 target 1 + + + + BG 2 target 1 + BG 2 target 1 + + + + BG 3 target 1 + BG 3 target 1 + + + + OBJ target 1 + OBJ target 1 + + + + Backdrop target 1 + Backdrop target 1 + + + + Blend mode + Modalità miscelato + + + + Disabled + Disabilitato + + + + Additive blending + Miscelazione dell'additivo + + + + Brighten + Schiarire + + + + Darken + Oscurire + + + + BG 0 target 2 + BG 0 target 2 + + + + BG 1 target 2 + BG 1 target 2 + + + + BG 2 target 2 + BG 2 target 2 + + + + BG 3 target 2 + BG 3 target 2 + + + + OBJ target 2 + OBJ target 2 + + + + Backdrop target 2 + Backdrop target 2 + + + + Blend A (target 1) + Miscelato A (target 1) + + + + Blend B (target 2) + Miscelato B (target 2) + + + + Blend Y + Miscelato Y + + + + Sweep shifts + Sweep shifts + + + + Sweep subtract + Sposta subastratto + + + + Sweep time (in 1/128s) + Tempo di sweep (in 1/128seg) + + + + + + + Sound length + Lunghezza del suono + + + + + Duty cycle + Ciclo di lavoro + + + + + + Envelope step time + Envelope step time + + + + + + Envelope increase + Aumento envelope + + + + + + Initial volume + Volume iniziale + + + + + + Sound frequency + Frequenza del suono + + + + + + + Timed + Temporizzato + + + + + + + Reset + Reset + + + + Double-size wave table + Tavola delle onde a doppia dimensione + + + + Active wave table + Tavola delle onde attive + + + + Enable channel 3 + Canale 3 attivo + + + + Volume + Volume + + + + 0% + 0% + + + + + 100% + 100% + + + + + 50% + 50% + + + + + 25% + 25% + + + + + + + 75% + 75% + + + + Clock divider + Divisore dell'orologio + + + + Register stages + Stadi di registrazione + + + + 15 + 15 + + + + 7 + 7 + + + + Shifter frequency + Frecuencia de cambio + + + + PSG volume right + Volumen pulso derecha + + + + PSG volume left + Volumen pulso sinistro + + + + Enable channel 1 right + Abilita Canale 1 destro + + + + Enable channel 2 right + Abilita Canale 2 destro + + + + Enable channel 3 right + Abilita Canale 3 destro + + + + Enable channel 4 right + Abilita Canale 4 destro + + + + Enable channel 1 left + Abilita Canale 1 sinistro + + + + Enable channel 2 left + Abilita Canale 2 sinistro + + + + Enable channel 3 left + Abilita Canale 3 sinistro + + + + Enable channel 4 left + Abilita Canale 4 sinistro + + + + PSG master volume + PSG volume master + + + + Loud channel A + Canale A forte + + + + Loud channel B + Canale B forte + + + + Enable channel A right + Abilita Canale A destro + + + + Enable channel A left + Abilta Canale A sinistro + + + + Channel A timer + Canale A temporizzato + + + + + 0 + 0 + + + + + + + + + + + + 1 + 1 + + + + Channel A reset + Resetta canale A + + + + Enable channel B right + Abilita Canale B destro + + + + Enable channel B left + Abilita Canale B sinistro + + + + Channel B timer + Canale B temporizzato + + + + Channel B reset + Resetta canale B + + + + Active channel 1 + Canale 1 attivo + + + + Active channel 2 + Canale 2 attivo + + + + Active channel 3 + Canale 3 attivo + + + + Active channel 4 + Canale 4 attivo + + + + Enable audio + Abilitare audio + + + + Bias + Polarizzazione + + + + Resolution + Risoluzione + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sample + Mostra + + + + + + + + + + + Address (bottom) + Indirizzo (inferiore) + + + + + + + + + + + Address (top) + Indirizzo (superiore) + + + + + + + Word count + Contatore di parole + + + + + + + Destination offset + Compensazione offset + + + + + + + + + + + Increment + Incremento + + + + + + + + + + + Decrement + Decremento + + + + + + + + + + + Fixed + Fissato + + + + + + + Increment and reload + Incremento e ricarica + + + + + + + Source offset + Compensazione di origine + + + + + + + Repeat + Ripeti + + + + + + + 32-bit + 32 bit + + + + + + + Start timing + Avvia temporizzatore + + + + + + + Immediate + Immediato + + + + + + + + + VBlank + VBlank + + + + + + + + + HBlank + HBlank + + + + + + + + + + + + IRQ + IRQ + + + + + + + + + + + Enable + Abilitare + + + + + + Audio FIFO + Audio FIFO + + + + Video Capture + Cattura video + + + + DRQ + DRQ + + + + + + + Value + Valore + + + + + + + Scale + Scala + + + + + + + 1/64 + 1/64 + + + + + + + 1/256 + 1/256 + + + + + + + 1/1024 + 1/1024 + + + + + + Cascade + Cascata + + + + + A + A + + + + + B + B + + + + + Select + Seleziona + + + + + Start + Avvia + + + + + Right + Destro + + + + + Left + Sinistro + + + + + Up + + + + + + Down + Giù + + + + + R + R + + + + + L + L + + + + Condition + Condizione + + + + SC + SC + + + + SD + SD + + + + SI + SI + + + + SO + SO + + + + + VCounter + VCounter + + + + + Timer 0 + Timer 0 + + + + + Timer 1 + Timer 1 + + + + + Timer 2 + Timer 2 + + + + + Timer 3 + Timer 3 + + + + + SIO + SIO + + + + + DMA 0 + DMA 0 + + + + + DMA 1 + DMA 1 + + + + + DMA 2 + DMA 2 + + + + + DMA 3 + DMA 3 + + + + + Keypad + Tastiera + + + + + Gamepak + Gamepak + + + + SRAM wait + Attesa SRAM + + + + + + + + 4 + 4 + + + + + + + 3 + 3 + + + + + + + + 2 + 2 + + + + + + + + 8 + 8 + + + + Cart 0 non-sequential + Cart 0 non sequenziale + + + + Cart 0 sequential + Cart 0 sequenziale + + + + Cart 1 non-sequential + Cart 1 non sequenziale + + + + Cart 1 sequential + Cart 1 sequenziale + + + + Cart 2 non-sequential + Cart 2 non sequenziale + + + + Cart 2 sequential + Cart 2 sequenziale + + + + PHI terminal + Terminale PHI + + + + Disable + Disabilita + + + + 4.19MHz + 4.19MHz + + + + 8.38MHz + 8.38MHz + + + + 16.78MHz + 16.78MHz + + + + Gamepak prefetch + Gamepak prefetch + + + + Enable IRQs + Abilitare IRQs + + + + QGBA::KeyEditor + + + + --- + --- + + + + QGBA::LibraryModel + + + Name + Nome + + + + Filename + Nome del file + + + + Size + Dimensione + + + + Platform + Piattaforma + + + + GBA + GBA + + + + GB + GB + + + + ? + ? + + + + Location + Posizione + + + + CRC32 + CRC32 + + + + QGBA::LoadSaveState + + + Load State + Carica stato + + + + Save State + Salva stato + + + + Empty + Vuoto + + + + Corrupted + Corrotto + + + + Slot %1 + Slot %1 + + + + QGBA::LogController + + + DEBUG + DEBUG + + + + STUB + STUB + + + + INFO + INFORMAZIONI + + + + WARN + AVVERTENZA + + + + ERROR + ERRORE + + + + FATAL + FATALE + + + + GAME ERROR + ERRORE NEL GIOCO + + + + QGBA::MemoryModel + + + Copy selection + Copia selezionato + + + + Save selection + Salva selezionato + + + + Paste + Incolla + + + + Load + Carica + + + + + All + Tutto + + + + Load TBL + Carica TBL + + + + Save selected memory + Salva la memoria selezionate + + + + Failed to open output file: %1 + Impossibile aprire il file di output: %1 + + + + Load memory + Carica memoria + + + + Failed to open input file: %1 + Impossibile aprire il file di input: %1 + + + + TBL + TBL + + + + ISO-8859-1 + ISO-8859-1 + + + + QGBA::ObjView + + + + 0x%0 + 0x%0 + + + + Off + No + + + + Normal + Normale + + + + Trans + Trans + + + + OBJWIN + OBJWIN + + + + Invalid + Invalido + + + + + N/A + n/d + + + + QGBA::PaletteView + + + #%0 + #%0 + + + + 0x%0 + 0x%0 + + + + %0 + %0 + + + + + + 0x%0 (%1) + 0x%0 (%1) + + + + Export palette + Esporta palette + + + + Windows PAL (*.pal);;Adobe Color Table (*.act) + WIndows PAL (*.pal);;Tabella dei colori Adobe (*.act) + + + + Failed to open output palette file: %1 + Errore nell'aprire il file palette di output : %1 + + + + QGBA::ROMInfo + + + + + + + (unknown) + (sconosciuto) + + + + + bytes + bytes + + + + (no database present) + (nessun database presente) + + + + QGBA::SettingsView + + + Qt Multimedia + Qt Multimedia + + + + SDL + SDL + + + + Software (Qt) + Software (Qt) + + + + OpenGL + OpenGL + + + + OpenGL (force version 1.x) + OpenGL (forza la versione 1.x) + + + + Keyboard + Tastiera + + + + Controllers + Controllers + + + + Shortcuts + Tasti di scelta rapida + + + + Select BIOS + Seleziona BIOS + + + + QGBA::ShaderSelector + + + No shader active + Nessun shader attivo + + + + Load shader + Carica shader + + + + %1 Shader (%.shader) + %1 Shader (%.shader) + + + + No shader loaded + Nessun shader caricato + + + + by %1 + por %1 + + + + Preprocessing + Preprocesso + + + + Pass %1 + Pass %1 + + + + QGBA::ShortcutController + + + Action + Azione + + + + Keyboard + Tastiera + + + + Gamepad + Gamepad + + + + QGBA::VideoView + + + Failed to open output video file: %1 + Errore durante l'archiviazione del video: %1 + + + + Native (%0x%1) + Nativo (%0x%1) + + + + Select output file + Seleziona file di output + + + + QGBA::Window + + + Game Boy Advance ROMs (%1) + ROM di Game Boy Advance (%1) + + + + Game Boy ROMs (%1) + ROMs del Game Boy (%1) + + + + All ROMs (%1) + Tutte le ROM (%1) + + + + Archives (%1) + Archivio (%1) + + + + + + Select ROM + Seleziona ROM + + + + Game Boy Advance save files (%1) + Game Boy Advance file di salvataggio (%1) + + + + + + Select save + Seleziona salvataggio + + + + Select patch + Seleziona patch + + + + Patches (*.ips *.ups *.bps) + Patches (*.ips *.ups *.bps) + + + + + GameShark saves (*.sps *.xps) + Salvataggi GameShark (*.sps *.xps) + + + + Crash + Errore fatale + + + + The game has crashed with the following error: + +%1 + Il gioco è andato in crash con il seguente errore:: + +%1 + + + + Couldn't Load + Non è possibile caricare + + + + Could not load game. Are you sure it's in the correct format? + Impossibile caricare il gioco. Sei sicuro che sia nel formato corretto? + + + + Unimplemented BIOS call + BIOS non implementato + + + + This game uses a BIOS call that is not implemented. Please use the official BIOS for best experience. + Questo gioco utilizza una chiamata BIOS non implementata. Utilizza il BIOS ufficiale per una migliore esperienza + + + + Really make portable? + Davvero rendere portatile? + + + + This will make the emulator load its configuration from the same directory as the executable. Do you want to continue? + In questo modo l'emulatore carica la propria configurazione dalla stessa directory dell'eseguibile. Vuoi continuare? + + + + Restart needed + È necessario riavviare + + + + Some changes will not take effect until the emulator is restarted. + Alcune modifiche non avranno effetto finché l'emulatore non viene riavviato. + + + + - Player %1 of %2 + - Giocatore %1 di %2 + + + + %1 - %2 + %1 - %2 + + + + %1 - %2 - %3 + %1 - %2 - %3 + + + + %1 - %2 (%3 fps) - %4 + %1 - %2 (%3 fps) - %4 + + + + &File + &File + + + + Load &ROM... + Carica &ROM... + + + + Load ROM in archive... + Carica la ROM in archivio... + + + + Load temporary save... + Carica il salvataggio temporaneo.. + + + + Load &patch... + Carica &patch... + + + + Boot BIOS + Boot BIOS + + + + Replace ROM... + Sostituire la ROM... + + + + ROM &info... + ROM &info... + + + + Recent + Recente + + + + Make portable + Rendi portatile + + + + &Load state + &Carica stato + + + + F10 + F10 + + + + &Save state + &Salva stato + + + + Shift+F10 + DO NOT TRANSLATE + Shift+F10 + + + + Quick load + Caricamento rapido + + + + Quick save + Salvataggio rapido + + + + Load recent + Carica recente + + + + Save recent + Salva recente + + + + Undo load state + Annulla il caricamento dello stato + + + + F11 + DO NOT TRANSLATE + F11 + + + + Undo save state + Annulla salva stato + + + + Shift+F11 + DO NOT TRANSLATE + Shift+F11 + + + + + State &%1 + Stato &%1 + + + + F%1 + F%1 + + + + Shift+F%1 + DO NOT TRANSLATE + Shift+F%1 + + + + Import GameShark Save + Importa salvataggio GameShark + + + + Export GameShark Save + Esporta salvataggio GameShark + + + + New multiplayer window + Nuova finestra multigiocatore + + + + About + About + + + + E&xit + Uscire (&X) + + + + &Emulation + &Emulazione + + + + &Reset + &Reset + + + + Ctrl+R + Ctrl+R + + + + Sh&utdown + Spegni (&U) + + + + Yank game pak + Yank game pak + + + + &Pause + &Pausa + + + + Ctrl+P + Ctrl+P + + + + &Next frame + Salta il prossimo frame (&N) + + + + Ctrl+N + Ctrl+N + + + + Fast forward (held) + Avanzamento rapido (sostenuto) + + + + &Fast forward + Avanzamento rapido (&F) + + + + Shift+Tab + Shift+Tab + + + + Fast forward speed + Velocità di avanzamento rapido + + + + Unbounded + Illimitato + + + + %0x + %0x + + + + Rewind (held) + Riavvolgi (sostenuto) + + + + Re&wind + Riavvolgi (&W) + + + + ~ + ~ + + + + Step backwards + Torna indietro + + + + Ctrl+B + Ctrl+B + + + + Sync to &video + Sincronizzare su &video + + + + Sync to &audio + Sincronizzare su &audio + + + + Solar sensor + Sensore solare + + + + Increase solar level + Aumenta il livello solare + + + + Decrease solar level + Riduce il livello solare + + + + Brightest solar level + Livello solare brillante + + + + Darkest solar level + Livello solare più scuro + + + + Brightness %1 + Luminosità %1 + + + + Audio/&Video + Audio/&Video + + + + Frame size + Dimensione Frame + + + + %1x + %1x + + + + Toggle fullscreen + Abilita schermo intero + + + + Lock aspect ratio + Blocca aspect ratio + + + + Resample video + Rimostra video + + + + Frame&skip + Frame&skip + + + + Shader options... + Opzioni shader... + + + + Mute + Muto + + + + FPS target + FPS mirato + + + + 15 + 15 + + + + 30 + 30 + + + + 45 + 45 + + + + Native (59.7) + Nativo (59.7) + + + + 60 + 60 + + + + 90 + 90 + + + + 120 + 120 + + + + 240 + 240 + + + + Take &screenshot + Effettua &screenshot + + + + F12 + F12 + + + + Record output... + Registra salida... + + + + Record GIF... + Registra GIF... + + + + Video layers + Layers video + + + + Background %0 + Sfondo %0 + + + + OBJ (sprites) + OBJ (sprites) + + + + Audio channels + Canali audio + + + + Channel %0 + Canale %0 + + + + Channel A + Canale A + + + + Channel B + Canale B + + + + &Tools + &Strumenti + + + + View &logs... + Visualizza registri... (&L) + + + + Game &overrides... + Val&specifico per il gioco... + + + + Game &Pak sensors... + Sensori di gioco &Pak... + + + + &Cheats... + &Trucchi... + + + + Open debugger console... + Apri debugger console... + + + + Start &GDB server... + Avvia server &GDB... + + + + Settings... + Impostazioni... + + + + Select folder + Seleziona cartella + + + + Add folder to library... + Aggiungi cartella alla libreria... + + + + View &palette... + Ver &palette... + + + + View &sprites... + Ver &sprites... + + + + View &tiles... + Ver &tiles... + + + + View memory... + Ver memoria... + + + + View &I/O registers... + Ver reg&registri I/O... + + + + Exit fullscreen + Esci da schermo intero + + + + Autofire + Pulsanti Auto fuoco + + + + Autofire A + Auto fuoco A + + + + Autofire B + Auto fuoco B + + + + Autofire L + Auto fuoco L + + + + Autofire R + Auto fuoco R + + + + Autofire Start + Avvia Auto fuoco + + + + Autofire Select + Seleziona Auto fuoco + + + + Autofire Up + Auto fuoco sù + + + + Autofire Right + Auto fuoco destro + + + + Autofire Down + Auto fuoco giù + + + + Autofire Left + Auto fuoco sinistro + + + + ROMInfo + + + ROM Info + Informazioni della ROM + + + + Game name: + Nome del gioco: + + + + {NAME} + {NAME} + + + + Internal name: + Nome interno: + + + + {TITLE} + {TITLE} + + + + Game ID: + ID del gioco: + + + + {ID} + {ID} + + + + File size: + Dimensione del file: + + + + {SIZE} + {SIZE} + + + + CRC32: + CRC32: + + + + {CRC} + {CRC} + + + + SensorView + + + Sensors + Sensori + + + + Realtime clock + Realtime clock + + + + Fixed time + Ora fissa + + + + System time + Ora del sistema + + + + Start time at + Avvia tempo a + + + + Now + Adesso + + + + MM/dd/yy hh:mm:ss AP + dd/MM/yy HH:mm:ss + + + + Light sensor + Sensore di luce + + + + Brightness + Luminosità + + + + Tilt sensor + Sensore di inclinazione + + + + + Set Y + Config. Y + + + + + Set X + Config. X + + + + Gyroscope + Giroscopio + + + + Sensitivity + Sensibilità + + + + SettingsView + + + Settings + Impostazioni + + + + Audio/Video + Audio/Video + + + + Interface + Interfaccia + + + + Emulation + Emulazione + + + + Paths + Paths + + + + Audio driver: + Audio driver: + + + + Audio buffer: + Buffer audio: + + + + + 1536 + 1536 + + + + 512 + 512 + + + + 768 + 768 + + + + 1024 + 1024 + + + + 2048 + 2048 + + + + 3072 + 3072 + + + + 4096 + 4096 + + + + samples + samples + + + + Sample rate: + Sample rate: + + + + + 44100 + 44100 + + + + 22050 + 22050 + + + + 32000 + 32000 + + + + 48000 + 48000 + + + + Hz + Hz + + + + Volume: + Volume: + + + + Mute + Muto + + + + Display driver: + Visualizza driver: + + + + Frameskip: + Frameskip: + + + + Skip every + Salta ognuno + + + + + frames + frames + + + + FPS target: + FPS mirato: + + + + frames per second + frame per secondo + + + + Sync: + Sincronizzare: + + + + Video + Video + + + + Audio + Audio + + + + Lock aspect ratio + Blocca aspect ratio + + + + Resample video + Rimostrare video + + + + Library: + Biblioteca: + + + + Show when no game open + Mostra quando nessun gioco è aperto + + + + Clear cache + Cancella cache + + + + Fast forward speed: + Velocità di avanzamento rapido: + + + + + + + + + + Browse + Sfoglia + + + + Use BIOS file if found + Utilizzare il file del BIOS se è stato trovato + + + + Skip BIOS intro + Salta BIOS intro + + + + × + × + + + + Unbounded + Illimitato + + + + Suspend screensaver + Sospendi screensaver + + + + BIOS + BIOS + + + + Pause when inactive + Pausa se inattivo + + + + Run all + Avviare tutto + + + + Remove known + Rimuovi conosciuto + + + + Detect and remove + Rileva e rimuovi + + + + Allow opposing input directions + Consenti direzioni opposte + + + + + Screenshot + Screenshot + + + + + Save data + Salva dati + + + + + Cheat codes + Trucchi + + + + Enable rewind + Abilita riavvolgi + + + + Rewind history: + Riavvolgi storia: + + + + Idle loops: + Idle loops: + + + + Savestate extra data: + Salva dati extra: + + + + Load extra data: + Carica dati extra: + + + + GB BIOS file: + File GB BIOS: + + + + GBA BIOS file: + File GBA BIOS: + + + + GBC BIOS file: + File GBC BIOS: + + + + Save games + Salva il gioco + + + + + + + Same directory as the ROM + Stessa directory della ROM + + + + Save states + Salva Stato + + + + Screenshots + Screenshots + + + + Patches + Patches + + + + ShaderSelector + + + Shaders + Shaders + + + + Active Shader: + Attiva Shader: + + + + Name + Nome + + + + Author + Autore + + + + Description + Descrizione + + + + Unload Shader + Non caricare shader + + + + Load New Shader + Carica Nuovo shader + + + + ShortcutView + + + Edit Shortcuts + Edita Shortcuts + + + + Keyboard + Tastiera + + + + Gamepad + Gamepad + + + + Clear + Cancella + + + + TileView + + + Tiles + Tiles + + + + 256 colors + 256 colori + + + + × + × + + + + Magnification + Magnification + + + + VideoView + + + Record Video + Registra video + + + + Start + Avvia + + + + Stop + Stop + + + + Select File + Seleziona File + + + + Presets + Presets + + + + High Quality + Alta Qualità + + + + YouTube + YouTube + + + + + WebM + WebM + + + + Lossless + Senza perdite + + + + 1080p + 1080p + + + + 720p + 720p + + + + 480p + 480p + + + + Native + Nativo + + + + Format + Formato + + + + MKV + MKV + + + + AVI + AVI + + + + MP4 + MP4 + + + + PNG + PNG + + + + h.264 + h.264 + + + + VP8 + + + + + Xvid + Xvid + + + + FFV1 + FFV1 + + + + FLAC + FLAC + + + + Opus + Opus + + + + Vorbis + Vorbis + + + + MP3 + MP3 + + + + AAC + AAC + + + + Uncompressed + Senza compressione + + + + Bitrate (kbps) + Bitrate (kbps) + + + + VBR + VBR + + + + ABR + ABR + + + + Dimensions + Dimensioni + + + + : + : + + + + × + × + + + + Lock aspect ratio + Blocca aspect ratio + + + + Show advanced + Mostra avanzato + + + From 08b358bbaeef453ffc918f842179f9eb8c1d83a0 Mon Sep 17 00:00:00 2001 From: theheroGAC Date: Fri, 30 Jun 2017 19:16:02 +0200 Subject: [PATCH 30/41] Update mgba-it.ts --- src/platform/qt/ts/mgba-it.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platform/qt/ts/mgba-it.ts b/src/platform/qt/ts/mgba-it.ts index 39abe32f3..52734a864 100644 --- a/src/platform/qt/ts/mgba-it.ts +++ b/src/platform/qt/ts/mgba-it.ts @@ -1733,17 +1733,17 @@ Game Boy Advance è un marchio registrato di Nintendo Co., Ltd. Shifter frequency - Frecuencia de cambio + Cambio di frequenza PSG volume right - Volumen pulso derecha + PSG volume destro PSG volume left - Volumen pulso sinistro + PSG volume sinistro From a56e2ade64bf31fc9d1e038b31c749dde35db17e Mon Sep 17 00:00:00 2001 From: theheroGAC Date: Fri, 30 Jun 2017 23:06:46 +0200 Subject: [PATCH 31/41] Update mgba-it.ts Qt: Italian translation rev1 (by theheroGAC) --- src/platform/qt/ts/mgba-it.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/qt/ts/mgba-it.ts b/src/platform/qt/ts/mgba-it.ts index 52734a864..a7bb8a864 100644 --- a/src/platform/qt/ts/mgba-it.ts +++ b/src/platform/qt/ts/mgba-it.ts @@ -66,7 +66,7 @@ Game Boy Advance è un marchio registrato di Nintendo Co., Ltd. Loading... - Caricamento... + Caricamento in corso... @@ -1464,7 +1464,7 @@ Game Boy Advance è un marchio registrato di Nintendo Co., Ltd. OBJ window enable blend - Abilita OBJ window mezcla + Abilita OBJ window blend From b701cdea713ea9f9e9b9710328d94925928cd010 Mon Sep 17 00:00:00 2001 From: theheroGAC Date: Fri, 30 Jun 2017 23:10:38 +0200 Subject: [PATCH 32/41] Qt: Italian translation rev1.1 (by theheroGAC) Qt: Italian translation rev1.1 (by theheroGAC) --- src/platform/qt/ts/mgba-it.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/qt/ts/mgba-it.ts b/src/platform/qt/ts/mgba-it.ts index a7bb8a864..e66db7da8 100644 --- a/src/platform/qt/ts/mgba-it.ts +++ b/src/platform/qt/ts/mgba-it.ts @@ -3110,12 +3110,12 @@ Game Boy Advance è un marchio registrato di Nintendo Co., Ltd. Import GameShark Save - Importa salvataggio GameShark + Importa il salvataggio del GameShark Export GameShark Save - Esporta salvataggio GameShark + Esporta salvataggio dal GameShark From c8f07ebded0434a91fac18e03bc4703c2f0ce2ba Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 4 Jul 2017 10:04:09 -0700 Subject: [PATCH 33/41] All: Update CHANGES --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 937f994e6..86f68b89d 100644 --- a/CHANGES +++ b/CHANGES @@ -29,6 +29,7 @@ Features: - LR35902: Watchpoints - Memory search - Debugger: Execution tracing + - Qt: Italian translation (by theheroGAC) Bugfixes: - LR35902: Fix core never exiting with certain event patterns - GB Timer: Improve DIV reset behavior @@ -154,6 +155,8 @@ Misc: - GBA Timer: Improve accuracy of timers 0.6 beta 2: (Future) +Features: + - Qt: Italian translation (by theheroGAC) Bugfixes: - Qt: Fix memory search close button (fixes mgba.io/i/769) - Qt: Fix window icon being stretched From db08a75d9b031c3bfb6f510f6f52db6ace05c93e Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 4 Jul 2017 22:38:59 -0700 Subject: [PATCH 34/41] Qt: Fix initializing locale --- src/platform/qt/GBAApp.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platform/qt/GBAApp.cpp b/src/platform/qt/GBAApp.cpp index 5c8e46bbf..4af511208 100644 --- a/src/platform/qt/GBAApp.cpp +++ b/src/platform/qt/GBAApp.cpp @@ -49,6 +49,7 @@ GBAApp::GBAApp(int& argc, char* argv[]) if (!m_configController.getQtOption("language").isNull()) { locale = QLocale(m_configController.getQtOption("language").toString()); + QLocale::setDefault(locale); } QTranslator qtTranslator; From 7c59350e9dfa22901b5c3e8d8f789f46bd843727 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Wed, 5 Jul 2017 19:28:38 -0700 Subject: [PATCH 35/41] GBA Timer: More timer improvements --- include/mgba/internal/gba/gba.h | 1 - include/mgba/internal/gba/serialize.h | 4 +- include/mgba/internal/gba/timer.h | 2 + src/gba/io.c | 9 +-- src/gba/timer.c | 92 ++++++++++++++++++--------- 5 files changed, 70 insertions(+), 38 deletions(-) diff --git a/include/mgba/internal/gba/gba.h b/include/mgba/internal/gba/gba.h index 5440e3f12..5710864e0 100644 --- a/include/mgba/internal/gba/gba.h +++ b/include/mgba/internal/gba/gba.h @@ -79,7 +79,6 @@ struct GBA { uint32_t bus; int performingDMA; - struct mTimingEvent timerMaster; struct GBATimer timers[4]; int springIRQ; diff --git a/include/mgba/internal/gba/serialize.h b/include/mgba/internal/gba/serialize.h index 4f24198dd..8b4e4a84b 100644 --- a/include/mgba/internal/gba/serialize.h +++ b/include/mgba/internal/gba/serialize.h @@ -264,10 +264,10 @@ struct GBASerializedState { struct { uint16_t reload; - uint16_t oldReload; + uint16_t reserved; uint32_t lastEvent; uint32_t nextEvent; - int32_t overflowInterval; + uint32_t nextIrq; GBATimerFlags flags; } timers[4]; diff --git a/include/mgba/internal/gba/timer.h b/include/mgba/internal/gba/timer.h index 664842e6b..2a4234123 100644 --- a/include/mgba/internal/gba/timer.h +++ b/include/mgba/internal/gba/timer.h @@ -17,12 +17,14 @@ DECL_BITS(GBATimerFlags, PrescaleBits, 0, 4); DECL_BIT(GBATimerFlags, CountUp, 4); DECL_BIT(GBATimerFlags, DoIrq, 5); DECL_BIT(GBATimerFlags, Enable, 6); +DECL_BIT(GBATimerFlags, IrqPending, 7); struct GBA; struct GBATimer { uint16_t reload; int32_t lastEvent; struct mTimingEvent event; + struct mTimingEvent irq; GBATimerFlags flags; }; diff --git a/src/gba/io.c b/src/gba/io.c index bae8236f3..ae76e09e4 100644 --- a/src/gba/io.c +++ b/src/gba/io.c @@ -928,6 +928,7 @@ void GBAIOSerialize(struct GBA* gba, struct GBASerializedState* state) { STORE_16(gba->timers[i].reload, 0, &state->timers[i].reload); STORE_32(gba->timers[i].lastEvent - mTimingCurrentTime(&gba->timing), 0, &state->timers[i].lastEvent); STORE_32(gba->timers[i].event.when - mTimingCurrentTime(&gba->timing), 0, &state->timers[i].nextEvent); + STORE_32(gba->timers[i].irq.when - mTimingCurrentTime(&gba->timing), 0, &state->timers[i].nextIrq); STORE_32(gba->timers[i].flags, 0, &state->timers[i].flags); STORE_32(gba->memory.dma[i].nextSource, 0, &state->dma[i].nextSource); STORE_32(gba->memory.dma[i].nextDest, 0, &state->dma[i].nextDest); @@ -951,10 +952,6 @@ void GBAIODeserialize(struct GBA* gba, const struct GBASerializedState* state) { } uint32_t when; - LOAD_32(when, 0, &state->masterCycles); - when += state->cpu.cycles; - when = 0x400 - (when & 0x3FF); - mTimingSchedule(&gba->timing, &gba->timerMaster, when); for (i = 0; i < 4; ++i) { LOAD_16(gba->timers[i].reload, 0, &state->timers[i].reload); LOAD_32(gba->timers[i].flags, 0, &state->timers[i].flags); @@ -969,6 +966,10 @@ void GBAIODeserialize(struct GBA* gba, const struct GBASerializedState* state) { if (GBATimerFlagsIsEnable(gba->timers[i].flags)) { mTimingSchedule(&gba->timing, &gba->timers[i].event, when); } + LOAD_32(when, 0, &state->timers[i].nextIrq); + if (GBATimerFlagsIsIrqPending(gba->timers[i].flags)) { + mTimingSchedule(&gba->timing, &gba->timers[i].irq, when); + } LOAD_16(gba->memory.dma[i].reg, (REG_DMA0CNT_HI + i * 12), state->io); LOAD_32(gba->memory.dma[i].nextSource, 0, &state->dma[i].nextSource); diff --git a/src/gba/timer.c b/src/gba/timer.c index d68fcbef4..9920d2e93 100644 --- a/src/gba/timer.c +++ b/src/gba/timer.c @@ -8,7 +8,39 @@ #include #include -#define TIMER_MASTER 1024 +#define TIMER_IRQ_DELAY 7 + +static void GBATimerIrq(struct GBA* gba, int timerId) { + struct GBATimer* timer = &gba->timers[timerId]; + if (GBATimerFlagsIsIrqPending(timer->flags)) { + timer->flags = GBATimerFlagsClearIrqPending(timer->flags); + GBARaiseIRQ(gba, IRQ_TIMER0 + timerId); + } +} + +static void GBATimerIrq0(struct mTiming* timing, void* context, uint32_t cyclesLate) { + UNUSED(timing); + UNUSED(cyclesLate); + GBATimerIrq(context, 0); +} + +static void GBATimerIrq1(struct mTiming* timing, void* context, uint32_t cyclesLate) { + UNUSED(timing); + UNUSED(cyclesLate); + GBATimerIrq(context, 1); +} + +static void GBATimerIrq2(struct mTiming* timing, void* context, uint32_t cyclesLate) { + UNUSED(timing); + UNUSED(cyclesLate); + GBATimerIrq(context, 2); +} + +static void GBATimerIrq3(struct mTiming* timing, void* context, uint32_t cyclesLate) { + UNUSED(timing); + UNUSED(cyclesLate); + GBATimerIrq(context, 3); +} static void GBATimerUpdate(struct GBA* gba, int timerId, uint32_t cyclesLate) { struct GBATimer* timer = &gba->timers[timerId]; @@ -20,7 +52,10 @@ static void GBATimerUpdate(struct GBA* gba, int timerId, uint32_t cyclesLate) { GBATimerUpdateRegister(gba, timerId, 0); if (GBATimerFlagsIsDoIrq(timer->flags)) { - GBARaiseIRQ(gba, IRQ_TIMER0 + timerId); + timer->flags = GBATimerFlagsFillIrqPending(timer->flags); + if (!mTimingIsScheduled(&gba->timing, &timer->irq)) { + mTimingSchedule(&gba->timing, &timer->irq, TIMER_IRQ_DELAY - cyclesLate); + } } if (gba->audio.enable && timerId < 2) { @@ -44,15 +79,6 @@ static void GBATimerUpdate(struct GBA* gba, int timerId, uint32_t cyclesLate) { } } -static void GBATimerMasterUpdate(struct mTiming* timing, void* context, uint32_t cyclesLate) { - struct GBA* gba = context; - mTimingSchedule(timing, &gba->timerMaster, TIMER_MASTER - cyclesLate); - GBATimerUpdateRegister(gba, 0, cyclesLate); - GBATimerUpdateRegister(gba, 1, cyclesLate); - GBATimerUpdateRegister(gba, 2, cyclesLate); - GBATimerUpdateRegister(gba, 3, cyclesLate); -} - static void GBATimerUpdate0(struct mTiming* timing, void* context, uint32_t cyclesLate) { UNUSED(timing); GBATimerUpdate(context, 0, cyclesLate); @@ -74,28 +100,39 @@ static void GBATimerUpdate3(struct mTiming* timing, void* context, uint32_t cycl } void GBATimerInit(struct GBA* gba) { - gba->timerMaster.name = "GBA Timer Master"; - gba->timerMaster.callback = GBATimerMasterUpdate; - gba->timerMaster.context = gba; - gba->timerMaster.priority = 0x20; - mTimingSchedule(&gba->timing, &gba->timerMaster, TIMER_MASTER); memset(gba->timers, 0, sizeof(gba->timers)); gba->timers[0].event.name = "GBA Timer 0"; gba->timers[0].event.callback = GBATimerUpdate0; gba->timers[0].event.context = gba; - gba->timers[0].event.priority = 0x21; + gba->timers[0].event.priority = 0x20; gba->timers[1].event.name = "GBA Timer 1"; gba->timers[1].event.callback = GBATimerUpdate1; gba->timers[1].event.context = gba; - gba->timers[1].event.priority = 0x22; + gba->timers[1].event.priority = 0x21; gba->timers[2].event.name = "GBA Timer 2"; gba->timers[2].event.callback = GBATimerUpdate2; gba->timers[2].event.context = gba; - gba->timers[2].event.priority = 0x23; + gba->timers[2].event.priority = 0x22; gba->timers[3].event.name = "GBA Timer 3"; gba->timers[3].event.callback = GBATimerUpdate3; gba->timers[3].event.context = gba; - gba->timers[3].event.priority = 0x24; + gba->timers[3].event.priority = 0x23; + gba->timers[0].irq.name = "GBA Timer 0 IRQ"; + gba->timers[0].irq.callback = GBATimerIrq0; + gba->timers[0].irq.context = gba; + gba->timers[0].irq.priority = 0x28; + gba->timers[1].irq.name = "GBA Timer 1 IRQ"; + gba->timers[1].irq.callback = GBATimerIrq1; + gba->timers[1].irq.context = gba; + gba->timers[1].irq.priority = 0x29; + gba->timers[2].irq.name = "GBA Timer 2 IRQ"; + gba->timers[2].irq.callback = GBATimerIrq2; + gba->timers[2].irq.context = gba; + gba->timers[2].irq.priority = 0x2A; + gba->timers[3].irq.name = "GBA Timer 3 IRQ"; + gba->timers[3].irq.callback = GBATimerIrq3; + gba->timers[3].irq.context = gba; + gba->timers[3].irq.priority = 0x2B; } void GBATimerUpdateRegister(struct GBA* gba, int timer, int32_t cyclesLate) { @@ -117,17 +154,10 @@ void GBATimerUpdateRegister(struct GBA* gba, int timer, int32_t cyclesLate) { tickIncrement >>= prescaleBits; tickIncrement += gba->memory.io[(REG_TM0CNT_LO + (timer << 2)) >> 1]; gba->memory.io[(REG_TM0CNT_LO + (timer << 2)) >> 1] = tickIncrement; - tickIncrement -= 0x10000; - mTimingDeschedule(&gba->timing, ¤tTimer->event); - if (tickIncrement >= 0) { - mTimingSchedule(&gba->timing, ¤tTimer->event, 7 - (tickIncrement << prescaleBits)); - } else { - int32_t nextIncrement = mTimingUntil(&gba->timing, &gba->timerMaster); - tickIncrement = -tickIncrement; - tickIncrement <<= prescaleBits; - if (nextIncrement - tickIncrement > 0) { - mTimingSchedule(&gba->timing, ¤tTimer->event, 7 + tickIncrement); - } + if (!mTimingIsScheduled(&gba->timing, ¤tTimer->event)) { + tickIncrement = (0x10000 - tickIncrement) << prescaleBits; + currentTime -= mTimingCurrentTime(&gba->timing) - cyclesLate; + mTimingSchedule(&gba->timing, ¤tTimer->event, tickIncrement + currentTime); } } From c7630a13da378b112d60ddbb8ea75e24726aa9b2 Mon Sep 17 00:00:00 2001 From: rootfather Date: Wed, 5 Jul 2017 16:38:24 +0200 Subject: [PATCH 36/41] Qt: Update German GUI translation --- src/platform/qt/ts/mgba-de.ts | 592 +++++++++++++++++++++------------- 1 file changed, 367 insertions(+), 225 deletions(-) diff --git a/src/platform/qt/ts/mgba-de.ts b/src/platform/qt/ts/mgba-de.ts index e88df58d0..2fd4cd810 100644 --- a/src/platform/qt/ts/mgba-de.ts +++ b/src/platform/qt/ts/mgba-de.ts @@ -454,6 +454,105 @@ Game Boy Advance ist ein eingetragenes Warenzeichen von Nintendo Co., Ltd.Max. Zeilen + + MemorySearch + + + Form + Eingabemaske + + + + Address + Adresse + + + + Current Value + Aktueller Wert + + + + + Type + Typ + + + + Value + Wert + + + + Numeric + Numerisch + + + + Text + Text + + + + Width + Breite + + + + 1 Byte (8-bit) + 1 Byte (8-bit) + + + + 2 Bytes (16-bit) + 2 Bytes (16-bit) + + + + 4 Bytes (32-bit) + 4 Bytes (32-bit) + + + + Number type + Zahlensystem + + + + Hexadecimal + Hexadezimal + + + + Decimal + Dezimal + + + + Guess + automatisch + + + + Search + Suchen + + + + Search Within + Suchen innerhalb + + + + Open in Memory Viewer + Im Speicher-Monitor öffnen + + + + Refresh + Aktualisieren + + MemoryView @@ -834,6 +933,11 @@ Game Boy Advance ist ein eingetragenes Warenzeichen von Nintendo Co., Ltd.HuC-3 HuC-3 + + + Colors + Farben + PaletteView @@ -981,22 +1085,22 @@ Game Boy Advance ist ein eingetragenes Warenzeichen von Nintendo Co., Ltd. QGBA::GBAKeyEditor - + Clear Button Button löschen - + Clear Analog Analog löschen - + Refresh Aktualisieren - + Set all Alle belegen @@ -1065,28 +1169,28 @@ Game Boy Advance ist ein eingetragenes Warenzeichen von Nintendo Co., Ltd. QGBA::GameController - - + + Failed to open game file: %1 Fehler beim Öffnen der Spieldatei: %1 - + Failed to open save file: %1 Fehler beim Öffnen der Speicherdatei: %1 - + Failed to open snapshot file for reading: %1 Konnte Snapshot-Datei %1 nicht zum Lesen öffnen - + Failed to open snapshot file for writing: %1 Konnte Snapshot-Datei %1 nicht zum Schreiben öffnen - + Failed to start audio processor Fehler beim Starten des Audio-Prozessors @@ -2491,7 +2595,7 @@ Game Boy Advance ist ein eingetragenes Warenzeichen von Nintendo Co., Ltd.Defekt - + Slot %1 Speicherplatz %1 @@ -2598,57 +2702,80 @@ Game Boy Advance ist ein eingetragenes Warenzeichen von Nintendo Co., Ltd.ISO-8859-1 + + QGBA::MemorySearch + + + (⅟%0×) + (⅟%0×) + + + + 1 byte%0 + 1 Byte%0 + + + + 2 bytes%0 + 2 Bytes%0 + + + + 4 bytes%0 + 4 Bytes%0 + + QGBA::ObjView - - + + 0x%0 0x%0 - + Off Aus - + Normal Normal - + Trans Trans - + OBJWIN OBJWIN - + Invalid Ungültig - - + + N/A N/A - + Export sprite Sprite exportieren - + Portable Network Graphics (*.png) Portable Network Graphics (*.png) - + Failed to open output PNG file: %1 Fehler beim Öffnen der Ausgabe-PNG-Datei: %1 @@ -2708,7 +2835,7 @@ Game Boy Advance ist ein eingetragenes Warenzeichen von Nintendo Co., Ltd. bytes - Bytes + Bytes @@ -2719,47 +2846,47 @@ Game Boy Advance ist ein eingetragenes Warenzeichen von Nintendo Co., Ltd. QGBA::SettingsView - + Qt Multimedia Qt Multimedia - + SDL SDL - + Software (Qt) Software (Qt) - + OpenGL OpenGL - + OpenGL (force version 1.x) OpenGL (erzwinge Version 1.x) - + Keyboard Tastatur - + Controllers Gamepads - + Shortcuts Tastenkürzel - + Select BIOS BIOS auswählen @@ -2841,82 +2968,82 @@ Game Boy Advance ist ein eingetragenes Warenzeichen von Nintendo Co., Ltd. QGBA::Window - + Game Boy Advance ROMs (%1) Game Boy Advance-ROMs (%1) - + Game Boy ROMs (%1) Game Boy-ROMs (%1) - + All ROMs (%1) Alle ROMs (%1) - + %1 Video Logs (*.mvl) %1 Video-Logs (*.mvl) - + Archives (%1) Archive (%1) - - - + + + Select ROM ROM auswählen - + Game Boy Advance save files (%1) Game Boy Advance-Speicherdateien (%1) - - - + + + Select save Speicherdatei wählen - + Select patch Patch wählen - + Patches (*.ips *.ups *.bps) Patches (*.ips *.ups *.bps) - - + + GameShark saves (*.sps *.xps) GameShark-Speicherdaten (*.sps *.xps) - + Select video log Video-Log auswählen - + Video logs (*.mvl) Video-Logs (*.mvl) - + Crash Absturz - + The game has crashed with the following error: %1 @@ -2925,623 +3052,628 @@ Game Boy Advance ist ein eingetragenes Warenzeichen von Nintendo Co., Ltd. - + Couldn't Load Konnte nicht geladen werden - + Could not load game. Are you sure it's in the correct format? Konnte das Spiel nicht laden. Sind Sie sicher, dass es im korrekten Format vorliegt? - + Unimplemented BIOS call Nicht implementierter BIOS-Aufruf - + This game uses a BIOS call that is not implemented. Please use the official BIOS for best experience. Dieses Spiel verwendet einen BIOS-Aufruf, der nicht implementiert ist. Bitte verwenden Sie für die beste Spielerfahrung das offizielle BIOS. - + Really make portable? Portablen Modus wirklich aktivieren? - + This will make the emulator load its configuration from the same directory as the executable. Do you want to continue? Diese Einstellung wird den Emulator so konfigurieren, dass er seine Konfiguration aus dem gleichen Verzeichnis wie die Programmdatei lädt. Möchten Sie fortfahren? - + Restart needed Neustart benötigt - + Some changes will not take effect until the emulator is restarted. Einige Änderungen werden erst übernommen, wenn der Emulator neu gestartet wurde. - + - Player %1 of %2 - Spieler %1 von %2 - + %1 - %2 %1 - %2 - + %1 - %2 - %3 %1 - %2 - %3 - + %1 - %2 (%3 fps) - %4 %1 - %2 (%3 Bilder/Sekunde) - %4 - + &File &Datei - + Load &ROM... &ROM laden... - + Load ROM in archive... ROM aus Archiv laden... - + Load temporary save... Temporäre Speicherdatei laden... - + Load &patch... &Patch laden... - + Boot BIOS BIOS booten - + Replace ROM... ROM ersetzen... - + ROM &info... ROM-&Informationen... - + Recent Zuletzt verwendet - + Make portable Portablen Modus aktivieren - + &Load state Savestate &laden - + F10 F10 - + &Save state Savestate &speichern - + Shift+F10 Umschalt+F10 - + Quick load Schnell laden - + Quick save Schnell speichern - + Load recent Lade zuletzt gespeicherten Savestate - + Save recent Speichere aktuellen Stand - + Undo load state Laden des Savestate rückgängig machen - + F11 F11 - + Undo save state Speichern des Savestate rückgängig machen - + Shift+F11 Umschalt+F11 - + State &%1 Savestate &%1 - + F%1 F%1 - + Shift+F%1 Umschalt+F%1 - + Import GameShark Save Importiere GameShark-Speicherstand - + Export GameShark Save Exportiere GameShark-Speicherstand - + New multiplayer window Neues Multiplayer-Fenster - + About Über - + E&xit &Beenden - + &Emulation &Emulation - + &Reset Zu&rücksetzen - + Ctrl+R Strg+R - + Sh&utdown B&eenden - + Yank game pak Spielmodul herausziehen - + &Pause &Pause - + Ctrl+P Strg+P - + &Next frame &Nächstes Bild - + Ctrl+N Strg+N - + Fast forward (held) Schneller Vorlauf (gehalten) - + &Fast forward Schneller &Vorlauf - + Shift+Tab Umschalt+Tab - + Fast forward speed Vorlauf-Geschwindigkeit - + Unbounded Unbegrenzt - + %0x %0x - + Rewind (held) Zurückspulen (gehalten) - + Re&wind Zur&ückspulen - + ~ ~ - + Step backwards Schrittweiser Rücklauf - + Ctrl+B Strg+B - + Sync to &video Mit &Video synchronisieren - + Sync to &audio Mit &Audio synchronisieren - + Solar sensor Solar-Sensor - + Increase solar level Sonnen-Level erhöhen - + Decrease solar level Sonnen-Level verringern - + Brightest solar level Hellster Sonnen-Level - + Darkest solar level Dunkelster Sonnen-Level - + Brightness %1 Helligkeit %1 - + Audio/&Video Audio/&Video - + Frame size Bildgröße - + %1x %1x - + Toggle fullscreen Vollbildmodus umschalten - + Lock aspect ratio Seitenverhältnis korrigieren - + Force integer scaling Pixelgenaue Skalierung (Integer scaling) - + Frame&skip Frame&skip - + Shader options... Shader-Optionen... - + Mute Stummschalten - + FPS target Bildwiederholrate - + 15 15 - + 30 30 - + 45 45 - + Native (59.7) Nativ (59.7) - + 60 60 - + 90 90 - + 120 120 - + 240 240 - + Take &screenshot &Screenshot erstellen - + F12 F12 - + Record output... Ausgabe aufzeichen... - + Record GIF... GIF aufzeichen... - + Record video log... Video-Log aufzeichnen... - + Stop video log Video-Log beenden - + Video layers Video-Ebenen - + Audio channels Audio-Kanäle - + &Tools &Werkzeuge - + View &logs... &Logs ansehen... - + Game &overrides... Spiel-&Überschreibungen... - + Game &Pak sensors... Game &Pak-Sensoren... - + &Cheats... &Cheats... - + Open debugger console... Debugger-Konsole äffnen... - + Start &GDB server... &GDB-Server starten... - + Settings... Einstellungen... - + Select folder Ordner auswählen - + Add folder to library... Ordner zur Bibliothek hinzufügen... - + Bilinear filtering Bilineare Filterung - + View &palette... &Palette betrachten... - + View &sprites... &Sprites betrachten... - + View &tiles... &Tiles betrachten... - + View memory... Speicher betrachten... - + + Search memory... + Speicher durchsuchen... + + + View &I/O registers... &I/O-Register betrachten... - + Exit fullscreen Vollbildmodus beenden - + Autofire Autofeuer - + Autofire A Autofeuer A - + Autofire B Autofeuer B - + Autofire L Autofeuer L - + Autofire R Autofeuer R - + Autofire Start Autofeuer Start - + Autofire Select Autofeuer Select - + Autofire Up Autofeuer nach oben - + Autofire Right Autofeuer rechts - + Autofire Down Autofeuer nach unten - + Autofire Left Autofeuer links @@ -3833,7 +3965,7 @@ Game Boy Advance ist ein eingetragenes Warenzeichen von Nintendo Co., Ltd. - + frames Bilder @@ -3874,81 +4006,91 @@ Game Boy Advance ist ein eingetragenes Warenzeichen von Nintendo Co., Ltd. - + + Language + Sprache + + + + English + Englisch + + + List view Listenansicht - + Tree view Baumansicht - + Library: Bibliothek: - + Show when no game open Anzeigen, wenn kein Spiel geöffnet ist - + Clear cache Cache leeren - + Fast forward speed: Vorlauf-Geschwindigkeit: - + Rewind affects save data Rücklauf beeinflusst Speicherdaten - + Preload entire ROM into memory ROM-Datei vollständig in Arbeitsspeicher vorladen - - - - - - - + + + + + + + Browse Durchsuchen - + Use BIOS file if found BIOS-Datei verwenden, wenn vorhanden - + Skip BIOS intro BIOS-Intro überspringen - + × × - + Unbounded unbegrenzt - + Suspend screensaver Bildschirmschoner deaktivieren @@ -3958,50 +4100,50 @@ wenn vorhanden BIOS - + Pause when inactive Pause, wenn inaktiv - + Run all Alle ausführen - + Remove known Bekannte entfernen - + Detect and remove Erkennen und entfernen - + Allow opposing input directions Gegensätzliche Eingaberichtungen erlauben - - + + Screenshot Screenshot - - + + Save data Speicherdaten - - + + Cheat codes Cheat-Codes - + Enable rewind Rücklauf aktivieren @@ -4011,65 +4153,65 @@ wenn vorhanden Bilineare Filterung - + Rewind history: Rücklauf-Verlauf: - + Idle loops: Leerlaufprozesse: - + Savestate extra data: Zusätzliche Savestate-Daten: - + Load extra data: Lade zusätzliche Daten: - + GB BIOS file: Datei mit GB-BIOS: - + GBA BIOS file: Datei mit GBA-BIOS: - + GBC BIOS file: Datei mit GBC-BIOS: - + Save games Spielstände - - - - + + + + Same directory as the ROM Verzeichnis der ROM-Datei - + Save states Savestates - + Screenshots Screenshots - + Patches Patches From d3678471f681215765877d4d8be91ac4bbe768ff Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Wed, 5 Jul 2017 21:22:47 -0700 Subject: [PATCH 37/41] GBA Timer: More questionable tweaks --- src/gba/timer.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gba/timer.c b/src/gba/timer.c index 9920d2e93..d4ee0776a 100644 --- a/src/gba/timer.c +++ b/src/gba/timer.c @@ -9,6 +9,8 @@ #include #define TIMER_IRQ_DELAY 7 +#define TIMER_RELOAD_DELAY 0 +#define TIMER_STARTUP_DELAY 2 static void GBATimerIrq(struct GBA* gba, int timerId) { struct GBATimer* timer = &gba->timers[timerId]; @@ -157,7 +159,7 @@ void GBATimerUpdateRegister(struct GBA* gba, int timer, int32_t cyclesLate) { if (!mTimingIsScheduled(&gba->timing, ¤tTimer->event)) { tickIncrement = (0x10000 - tickIncrement) << prescaleBits; currentTime -= mTimingCurrentTime(&gba->timing) - cyclesLate; - mTimingSchedule(&gba->timing, ¤tTimer->event, tickIncrement + currentTime); + mTimingSchedule(&gba->timing, ¤tTimer->event, TIMER_RELOAD_DELAY + tickIncrement + currentTime); } } @@ -194,14 +196,14 @@ void GBATimerWriteTMCNT_HI(struct GBA* gba, int timer, uint16_t control) { mTimingDeschedule(&gba->timing, ¤tTimer->event); gba->memory.io[(REG_TM0CNT_LO + (timer << 2)) >> 1] = currentTimer->reload; int32_t tickMask = (1 << prescaleBits) - 1; - currentTimer->lastEvent = (mTimingCurrentTime(&gba->timing)) & ~tickMask; - GBATimerUpdateRegister(gba, timer, 0); + currentTimer->lastEvent = (mTimingCurrentTime(&gba->timing) - TIMER_STARTUP_DELAY) & ~tickMask; + GBATimerUpdateRegister(gba, timer, TIMER_STARTUP_DELAY); } else if (wasEnabled && !GBATimerFlagsIsEnable(currentTimer->flags)) { mTimingDeschedule(&gba->timing, ¤tTimer->event); } else if (GBATimerFlagsIsEnable(currentTimer->flags) && GBATimerFlagsGetPrescaleBits(currentTimer->flags) != oldPrescale && !GBATimerFlagsIsCountUp(currentTimer->flags)) { mTimingDeschedule(&gba->timing, ¤tTimer->event); int32_t tickMask = (1 << prescaleBits) - 1; - currentTimer->lastEvent = (mTimingCurrentTime(&gba->timing)) & ~tickMask; - GBATimerUpdateRegister(gba, timer, 0); + currentTimer->lastEvent = (mTimingCurrentTime(&gba->timing) - TIMER_STARTUP_DELAY) & ~tickMask; + GBATimerUpdateRegister(gba, timer, TIMER_STARTUP_DELAY); } } From 9b6fc4482555e1a9e06b088604ebaabbc8325e2b Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 6 Jul 2017 11:13:28 -0700 Subject: [PATCH 38/41] Qt: Fix translation initialization (fixes #776) --- CHANGES | 1 + src/platform/qt/GBAApp.cpp | 79 ++++--------------- src/platform/qt/GBAApp.h | 6 +- src/platform/qt/GameController.cpp | 1 + src/platform/qt/library/LibraryController.cpp | 3 +- src/platform/qt/main.cpp | 53 ++++++++++++- 6 files changed, 73 insertions(+), 70 deletions(-) diff --git a/CHANGES b/CHANGES index 86f68b89d..6f34af0b5 100644 --- a/CHANGES +++ b/CHANGES @@ -164,6 +164,7 @@ Bugfixes: - Qt: Fix data directory path - Qt: Fix controls not saving on non-SDL builds - GB Video: Fix LYC regression + - Qt: Fix translation initialization (fixes mgba.io/i/776) Misc: - Qt: Add language selector - GBA Timer: Improve accuracy of timers diff --git a/src/platform/qt/GBAApp.cpp b/src/platform/qt/GBAApp.cpp index 4af511208..c92cc402f 100644 --- a/src/platform/qt/GBAApp.cpp +++ b/src/platform/qt/GBAApp.cpp @@ -6,6 +6,7 @@ #include "GBAApp.h" #include "AudioProcessor.h" +#include "ConfigController.h" #include "Display.h" #include "GameController.h" #include "Window.h" @@ -14,11 +15,8 @@ #include #include #include -#include -#include #include -#include #include #include @@ -32,8 +30,9 @@ static GBAApp* g_app = nullptr; mLOG_DEFINE_CATEGORY(QT, "Qt", "platform.qt"); -GBAApp::GBAApp(int& argc, char* argv[]) +GBAApp::GBAApp(int& argc, char* argv[], ConfigController* config) : QApplication(argc, argv) + , m_configController(config) { g_app = this; @@ -45,21 +44,6 @@ GBAApp::GBAApp(int& argc, char* argv[]) setWindowIcon(QIcon(":/res/mgba-512.png")); #endif - QLocale locale; - - if (!m_configController.getQtOption("language").isNull()) { - locale = QLocale(m_configController.getQtOption("language").toString()); - QLocale::setDefault(locale); - } - - QTranslator qtTranslator; - qtTranslator.load(locale, "qt", "_", QLibraryInfo::location(QLibraryInfo::TranslationsPath)); - installTranslator(&qtTranslator); - - QTranslator langTranslator; - langTranslator.load(locale, binaryName, "-", ":/translations/"); - installTranslator(&langTranslator); - SocketSubsystemInit(); qRegisterMetaType("const uint32_t*"); qRegisterMetaType("mCoreThread*"); @@ -67,50 +51,15 @@ GBAApp::GBAApp(int& argc, char* argv[]) QApplication::setApplicationName(projectName); QApplication::setApplicationVersion(projectVersion); - if (!m_configController.getQtOption("displayDriver").isNull()) { - Display::setDriver(static_cast(m_configController.getQtOption("displayDriver").toInt())); - } - - mArguments args; - mGraphicsOpts graphicsOpts; - mSubParser subparser; - initParserForGraphics(&subparser, &graphicsOpts); - bool loaded = m_configController.parseArguments(&args, argc, argv, &subparser); - if (loaded && args.showHelp) { - usage(argv[0], subparser.usage); - ::exit(0); - return; + if (!m_configController->getQtOption("displayDriver").isNull()) { + Display::setDriver(static_cast(m_configController->getQtOption("displayDriver").toInt())); } reloadGameDB(); - if (!m_configController.getQtOption("audioDriver").isNull()) { - AudioProcessor::setDriver(static_cast(m_configController.getQtOption("audioDriver").toInt())); + if (!m_configController->getQtOption("audioDriver").isNull()) { + AudioProcessor::setDriver(static_cast(m_configController->getQtOption("audioDriver").toInt())); } - Window* w = new Window(&m_configController); - connect(w, &Window::destroyed, [this, w]() { - m_windows.removeAll(w); - }); - m_windows.append(w); - - if (loaded) { - w->argumentsPassed(&args); - } else { - w->loadConfig(); - } - freeArguments(&args); - - if (graphicsOpts.multiplier) { - w->resizeFrame(QSize(VIDEO_HORIZONTAL_PIXELS * graphicsOpts.multiplier, VIDEO_VERTICAL_PIXELS * graphicsOpts.multiplier)); - } - if (graphicsOpts.fullscreen) { - w->enterFullScreen(); - } - - w->show(); - - w->controller()->setMultiplayerController(&m_multiplayer); - w->multiplayerChanged(); } GBAApp::~GBAApp() { @@ -132,7 +81,7 @@ Window* GBAApp::newWindow() { if (m_windows.count() >= MAX_GBAS) { return nullptr; } - Window* w = new Window(&m_configController, m_multiplayer.attached()); + Window* w = new Window(m_configController, m_multiplayer.attached()); int windowId = m_multiplayer.attached(); connect(w, &Window::destroyed, [this, w]() { m_windows.removeAll(w); @@ -175,10 +124,10 @@ void GBAApp::continueAll(const QList& paused) { QString GBAApp::getOpenFileName(QWidget* owner, const QString& title, const QString& filter) { QList paused; pauseAll(&paused); - QString filename = QFileDialog::getOpenFileName(owner, title, m_configController.getOption("lastDirectory"), filter); + QString filename = QFileDialog::getOpenFileName(owner, title, m_configController->getOption("lastDirectory"), filter); continueAll(paused); if (!filename.isEmpty()) { - m_configController.setOption("lastDirectory", QFileInfo(filename).dir().canonicalPath()); + m_configController->setOption("lastDirectory", QFileInfo(filename).dir().canonicalPath()); } return filename; } @@ -186,10 +135,10 @@ QString GBAApp::getOpenFileName(QWidget* owner, const QString& title, const QStr QString GBAApp::getSaveFileName(QWidget* owner, const QString& title, const QString& filter) { QList paused; pauseAll(&paused); - QString filename = QFileDialog::getSaveFileName(owner, title, m_configController.getOption("lastDirectory"), filter); + QString filename = QFileDialog::getSaveFileName(owner, title, m_configController->getOption("lastDirectory"), filter); continueAll(paused); if (!filename.isEmpty()) { - m_configController.setOption("lastDirectory", QFileInfo(filename).dir().canonicalPath()); + m_configController->setOption("lastDirectory", QFileInfo(filename).dir().canonicalPath()); } return filename; } @@ -197,10 +146,10 @@ QString GBAApp::getSaveFileName(QWidget* owner, const QString& title, const QStr QString GBAApp::getOpenDirectoryName(QWidget* owner, const QString& title) { QList paused; pauseAll(&paused); - QString filename = QFileDialog::getExistingDirectory(owner, title, m_configController.getOption("lastDirectory")); + QString filename = QFileDialog::getExistingDirectory(owner, title, m_configController->getOption("lastDirectory")); continueAll(paused); if (!filename.isEmpty()) { - m_configController.setOption("lastDirectory", QFileInfo(filename).dir().canonicalPath()); + m_configController->setOption("lastDirectory", QFileInfo(filename).dir().canonicalPath()); } return filename; } diff --git a/src/platform/qt/GBAApp.h b/src/platform/qt/GBAApp.h index fec6056f3..2b7c2e5cc 100644 --- a/src/platform/qt/GBAApp.h +++ b/src/platform/qt/GBAApp.h @@ -10,7 +10,6 @@ #include #include -#include "ConfigController.h" #include "MultiplayerController.h" struct NoIntroDB; @@ -21,6 +20,7 @@ mLOG_DECLARE_CATEGORY(QT); namespace QGBA { +class ConfigController; class GameController; class Window; @@ -43,7 +43,7 @@ class GBAApp : public QApplication { Q_OBJECT public: - GBAApp(int& argc, char* argv[]); + GBAApp(int& argc, char* argv[], ConfigController*); ~GBAApp(); static GBAApp* app(); @@ -67,7 +67,7 @@ private: void pauseAll(QList* paused); void continueAll(const QList& paused); - ConfigController m_configController; + ConfigController* m_configController; QList m_windows; MultiplayerController m_multiplayer; diff --git a/src/platform/qt/GameController.cpp b/src/platform/qt/GameController.cpp index ef1b3dddb..8a6f63c87 100644 --- a/src/platform/qt/GameController.cpp +++ b/src/platform/qt/GameController.cpp @@ -9,6 +9,7 @@ #include "InputController.h" #include "LogController.h" #include "MultiplayerController.h" +#include "Override.h" #include "VFileDevice.h" #include diff --git a/src/platform/qt/library/LibraryController.cpp b/src/platform/qt/library/LibraryController.cpp index 8614f4c9e..fc558f226 100644 --- a/src/platform/qt/library/LibraryController.cpp +++ b/src/platform/qt/library/LibraryController.cpp @@ -5,7 +5,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "LibraryController.h" -#include "../GBAApp.h" +#include "ConfigController.h" +#include "GBAApp.h" #include "LibraryGrid.h" #include "LibraryTree.h" diff --git a/src/platform/qt/main.cpp b/src/platform/qt/main.cpp index c58ce7837..8b6de713d 100644 --- a/src/platform/qt/main.cpp +++ b/src/platform/qt/main.cpp @@ -7,10 +7,15 @@ // This must be defined before anything else is included. #define SDL_MAIN_HANDLED +#include "ConfigController.h" #include "GBAApp.h" #include "Window.h" #include +#include + +#include +#include #ifdef QT_STATIC #include @@ -22,11 +27,57 @@ Q_IMPORT_PLUGIN(QWindowsAudioPlugin); #endif #endif +using namespace QGBA; + int main(int argc, char* argv[]) { #ifdef BUILD_SDL SDL_SetMainReady(); #endif - QGBA::GBAApp application(argc, argv); + + ConfigController configController; + + QLocale locale; + if (!configController.getQtOption("language").isNull()) { + locale = QLocale(configController.getQtOption("language").toString()); + QLocale::setDefault(locale); + } + + mArguments args; + mGraphicsOpts graphicsOpts; + mSubParser subparser; + initParserForGraphics(&subparser, &graphicsOpts); + bool loaded = configController.parseArguments(&args, argc, argv, &subparser); + if (loaded && args.showHelp) { + usage(argv[0], subparser.usage); + return 0; + } + + GBAApp application(argc, argv, &configController); + + QTranslator qtTranslator; + qtTranslator.load(locale, "qt", "_", QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + application.installTranslator(&qtTranslator); + + QTranslator langTranslator; + langTranslator.load(locale, binaryName, "-", ":/translations/"); + application.installTranslator(&langTranslator); + + Window* w = application.newWindow(); + if (loaded) { + w->argumentsPassed(&args); + } else { + w->loadConfig(); + } + freeArguments(&args); + + if (graphicsOpts.multiplier) { + w->resizeFrame(QSize(VIDEO_HORIZONTAL_PIXELS * graphicsOpts.multiplier, VIDEO_VERTICAL_PIXELS * graphicsOpts.multiplier)); + } + if (graphicsOpts.fullscreen) { + w->enterFullScreen(); + } + + w->show(); return application.exec(); } From 63d475c350c413cac1b7098242f4761522cd3857 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 6 Jul 2017 11:27:42 -0700 Subject: [PATCH 39/41] Qt: Minor text fixes --- CHANGES | 2 ++ src/platform/qt/AboutScreen.ui | 2 +- src/platform/qt/MemorySearch.ui | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 6f34af0b5..177719906 100644 --- a/CHANGES +++ b/CHANGES @@ -157,6 +157,7 @@ Misc: 0.6 beta 2: (Future) Features: - Qt: Italian translation (by theheroGAC) + - Qt: Updated German translation Bugfixes: - Qt: Fix memory search close button (fixes mgba.io/i/769) - Qt: Fix window icon being stretched @@ -168,6 +169,7 @@ Bugfixes: Misc: - Qt: Add language selector - GBA Timer: Improve accuracy of timers + - Qt: Minor test fixes 0.6 beta 1: (2017-06-29) - Initial beta for 0.6 diff --git a/src/platform/qt/AboutScreen.ui b/src/platform/qt/AboutScreen.ui index 71bee0960..357760470 100644 --- a/src/platform/qt/AboutScreen.ui +++ b/src/platform/qt/AboutScreen.ui @@ -83,7 +83,7 @@ - © 2013 – 2016 Jeffrey Pfau, licensed under the Mozilla Public License, version 2.0 + © 2013 – 2017 Jeffrey Pfau, licensed under the Mozilla Public License, version 2.0 Game Boy Advance is a registered trademark of Nintendo Co., Ltd. diff --git a/src/platform/qt/MemorySearch.ui b/src/platform/qt/MemorySearch.ui index 2aa19e7a7..ccbe07076 100644 --- a/src/platform/qt/MemorySearch.ui +++ b/src/platform/qt/MemorySearch.ui @@ -17,7 +17,7 @@ - Form + Memory Search From 8f049e018346e9c0dee0d79b1a59b10b8217f9d6 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 6 Jul 2017 12:26:43 -0700 Subject: [PATCH 40/41] PSP2: Update toolchain to use vita.cmake --- CHANGES | 1 + src/platform/psp2/CMakeLists.txt | 40 ++++++------------------ src/platform/psp2/CMakeToolchain.vitasdk | 13 ++++++-- 3 files changed, 21 insertions(+), 33 deletions(-) diff --git a/CHANGES b/CHANGES index 177719906..a3413ef43 100644 --- a/CHANGES +++ b/CHANGES @@ -170,6 +170,7 @@ Misc: - Qt: Add language selector - GBA Timer: Improve accuracy of timers - Qt: Minor test fixes + - PSP2: Update toolchain to use vita.cmake 0.6 beta 1: (2017-06-29) - Initial beta for 0.6 diff --git a/src/platform/psp2/CMakeLists.txt b/src/platform/psp2/CMakeLists.txt index a6fb17017..8c127f735 100644 --- a/src/platform/psp2/CMakeLists.txt +++ b/src/platform/psp2/CMakeLists.txt @@ -1,9 +1,7 @@ -find_program(FIXUP vita-elf-create) -find_program(MAKE_FSELF vita-make-fself) -find_program(MAKE_SFO vita-mksfoex) +include("${VITASDK}/share/vita.cmake" REQUIRED) + find_program(OBJCOPY ${cross_prefix}objcopy) find_file(NIDDB db.json PATHS ${VITASDK} ${VITASDK}/bin ${VITASDK}/share) -find_program(STRIP ${cross_prefix}strip) set(OS_DEFINES IOAPI_NO_64) set(OS_DEFINES ${OS_DEFINES} PARENT_SCOPE) @@ -37,34 +35,16 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/backdrop.o COMMAND ${OBJCOPY_CMD} backdrop.png ${CMAKE_CURRENT_BINARY_DIR}/backdrop.o WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) -add_custom_target(${BINARY_NAME}.velf ALL - ${STRIP} --strip-unneeded -go ${BINARY_NAME}-stripped.elf ${BINARY_NAME}.elf - COMMAND ${FIXUP} ${BINARY_NAME}-stripped.elf ${BINARY_NAME}.velf ${NIDDB} - DEPENDS ${BINARY_NAME}.elf) - -add_custom_target(sce_sys ${CMAKE_COMMAND} -E make_directory sce_sys) - -add_custom_target(param.sfo - ${MAKE_SFO} ${PROJECT_NAME} -s TITLE_ID=MGBA00001 sce_sys/param.sfo - DEPENDS sce_sys) - -add_custom_target(eboot.bin - ${MAKE_FSELF} -s ${BINARY_NAME}.velf eboot.bin - DEPENDS ${BINARY_NAME}.velf) +vita_create_self(${BINARY_NAME}.self ${BINARY_NAME}.elf) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/template.xml.in ${CMAKE_CURRENT_BINARY_DIR}/template.xml) -add_custom_target(livearea - ${CMAKE_COMMAND} -E make_directory sce_sys/livearea/contents - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/icon0.png sce_sys - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/pic0.png sce_sys - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/template.xml sce_sys/livearea/contents - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bg.png sce_sys/livearea/contents - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/startup.png sce_sys/livearea/contents - DEPENDS sce_sys) - -add_custom_target(${BINARY_NAME}.vpk ALL - zip -qr ${BINARY_NAME}.vpk sce_sys eboot.bin - DEPENDS livearea eboot.bin param.sfo) +vita_create_vpk(${BINARY_NAME}.vpk MGBA00001 ${BINARY_NAME}.self + NAME ${PROJECT_NAME} + FILE ${CMAKE_CURRENT_SOURCE_DIR}/icon0.png sce_sys/icon0.png + FILE ${CMAKE_CURRENT_SOURCE_DIR}/pic0.png sce_sys/pic0.png + FILE ${CMAKE_CURRENT_SOURCE_DIR}/bg.png sce_sys/livearea/contents/bg.png + FILE ${CMAKE_CURRENT_SOURCE_DIR}/startup.png sce_sys/livearea/contents/startup.png + FILE ${CMAKE_CURRENT_BINARY_DIR}/template.xml sce_sys/livearea/contents/template.xml) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_NAME}.vpk DESTINATION . COMPONENT ${BINARY_NAME}-psp2) diff --git a/src/platform/psp2/CMakeToolchain.vitasdk b/src/platform/psp2/CMakeToolchain.vitasdk index fce2bd5f1..4334701e7 100644 --- a/src/platform/psp2/CMakeToolchain.vitasdk +++ b/src/platform/psp2/CMakeToolchain.vitasdk @@ -14,7 +14,7 @@ set(CMAKE_PROGRAM_PATH ${toolchain_dir}/bin) set(cross_prefix arm-vita-eabi-) set(inc_flags -I${toolchain_dir}/include) -set(link_flags "-L${toolchain_dir}/lib -Wl,-q") +set(link_flags "-L${toolchain_dir}/lib -Wl,-z,nocopyreloc") set(CMAKE_SYSTEM_NAME Generic CACHE INTERNAL "system name") set(CMAKE_SYSTEM_PROCESSOR armv7-a CACHE INTERNAL "processor") @@ -26,9 +26,9 @@ find_program(CMAKE_C_COMPILER ${cross_prefix}gcc${extension}) find_program(CMAKE_CXX_COMPILER ${cross_prefix}g++${extension}) find_program(CMAKE_ASM_COMPILER ${cross_prefix}gcc${extension}) find_program(CMAKE_LINKER ${cross_prefix}ld${extension}) -set(CMAKE_C_FLAGS ${inc_flags} CACHE INTERNAL "c compiler flags") +set(CMAKE_C_FLAGS "${inc_flags} -Wl,-q" CACHE INTERNAL "c compiler flags") set(CMAKE_ASM_FLAGS ${inc_flags} CACHE INTERNAL "assembler flags") -set(CMAKE_CXX_FLAGS ${inc_flags} CACHE INTERNAL "cxx compiler flags") +set(CMAKE_CXX_FLAGS "${inc_flags} -Wl,-q" CACHE INTERNAL "cxx compiler flags") set(CMAKE_EXE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "exe link flags") set(CMAKE_MODULE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "module link flags") @@ -41,6 +41,13 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY CACHE INTERNAL "") set(ENV{PKG_CONFIG_PATH} ${VITASDK}/arm-vita-eabi/lib/pkgconfig) set(ENV{PKG_CONFIG_LIBDIR} ${VITASDK}/arm-vita-eabi/lib/pkgconfig) +set(VITA_ELF_CREATE "${VITASDK}/bin/vita-elf-create${TOOL_OS_SUFFIX}" CACHE PATH "vita-elf-create") +set(VITA_ELF_EXPORT "${VITASDK}/bin/vita-elf-export${TOOL_OS_SUFFIX}" CACHE PATH "vita-elf-export") +set(VITA_LIBS_GEN "${VITASDK}/bin/vita-libs-gen${TOOL_OS_SUFFIX}" CACHE PATH "vita-libs-gen") +set(VITA_MAKE_FSELF "${VITASDK}/bin/vita-make-fself${TOOL_OS_SUFFIX}" CACHE PATH "vita-make-fself") +set(VITA_MKSFOEX "${VITASDK}/bin/vita-mksfoex${TOOL_OS_SUFFIX}" CACHE PATH "vita-mksfoex") +set(VITA_PACK_VPK "${VITASDK}/bin/vita-pack-vpk${TOOL_OS_SUFFIX}" CACHE PATH "vita-pack-vpk") + set(PSP2 ON) add_definitions(-DPSP2) set(M_LIBRARY m) From c184bc633720b29a17cb08cb0b8957edc21959c8 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 6 Jul 2017 12:37:10 -0700 Subject: [PATCH 41/41] PSP2: Use custom localtime_r since newlib version is broken (fixes #560) --- CHANGES | 1 + CMakeLists.txt | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index a3413ef43..b52b85969 100644 --- a/CHANGES +++ b/CHANGES @@ -166,6 +166,7 @@ Bugfixes: - Qt: Fix controls not saving on non-SDL builds - GB Video: Fix LYC regression - Qt: Fix translation initialization (fixes mgba.io/i/776) + - PSP2: Use custom localtime_r since newlib version is broken (fixes mgba.io/i/560) Misc: - Qt: Add language selector - GBA Timer: Improve accuracy of timers diff --git a/CMakeLists.txt b/CMakeLists.txt index a87678e0a..e31ee40ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -275,7 +275,9 @@ endif() include(CheckFunctionExists) check_function_exists(strdup HAVE_STRDUP) check_function_exists(strndup HAVE_STRNDUP) -check_function_exists(localtime_r HAVE_LOCALTIME_R) +if(NOT DEFINED PSP2) + check_function_exists(localtime_r HAVE_LOCALTIME_R) +endif() if(NOT CMAKE_SYSTEM_NAME STREQUAL "Generic") check_function_exists(snprintf_l HAVE_SNPRINTF_L) if(CMAKE_SYSTEM_NAME STREQUAL "Linux")