Merge branch 'master' into medusa

This commit is contained in:
Vicki Pfau 2022-05-30 17:45:24 -07:00
commit 9b5ac94ca7
25 changed files with 5200 additions and 3846 deletions

View File

@ -8,7 +8,7 @@ install:
- git -C C:\Tools\vcpkg clean -dfq docs ports scripts toolsrc triplets versions - git -C C:\Tools\vcpkg clean -dfq docs ports scripts toolsrc triplets versions
- git -C C:\Tools\vcpkg pull --force --quiet - git -C C:\Tools\vcpkg pull --force --quiet
- C:\Tools\vcpkg\bootstrap-vcpkg - C:\Tools\vcpkg\bootstrap-vcpkg
- vcpkg --triplet x64-windows-release --recurse install ffmpeg libepoxy libpng libzip sdl2 sqlite3 - vcpkg --triplet x64-windows-release --recurse install ffmpeg libepoxy libpng libzip lua sdl2 sqlite3
- vcpkg --no-dry-run upgrade - vcpkg --no-dry-run upgrade
- rd /Q /S C:\Tools\vcpkg\buildtrees - rd /Q /S C:\Tools\vcpkg\buildtrees
before_build: before_build:

View File

@ -77,6 +77,7 @@ Emulation fixes:
- GBA Video: Ignore horizontally off-screen sprite timing (fixes mgba.io/i/2391) - GBA Video: Ignore horizontally off-screen sprite timing (fixes mgba.io/i/2391)
- GBA Video: Fix Hblank timing (fixes mgba.io/i/2131, mgba.io/i/2310) - GBA Video: Fix Hblank timing (fixes mgba.io/i/2131, mgba.io/i/2310)
- GBA Video: Fix rare crash in modes 3-5 - GBA Video: Fix rare crash in modes 3-5
- GBA Video: Fix sprites with mid-frame palette changes in GL (fixes mgba.io/i/2476)
Other fixes: Other fixes:
- Core: Don't attempt to restore rewind diffs past start of rewind - Core: Don't attempt to restore rewind diffs past start of rewind
- Core: Fix the runloop resuming after a game has crashed (fixes mgba.io/i/2451) - Core: Fix the runloop resuming after a game has crashed (fixes mgba.io/i/2451)
@ -88,6 +89,7 @@ Other fixes:
- mGUI: Fix FPS counter after closing menu - mGUI: Fix FPS counter after closing menu
- Qt: Fix some hangs when using the debugger console - Qt: Fix some hangs when using the debugger console
- Qt: Fix crash when clicking past last tile in viewer - Qt: Fix crash when clicking past last tile in viewer
- Qt: Fix preloading for ROM replacing
- VFS: Failed file mapping should return NULL on POSIX - VFS: Failed file mapping should return NULL on POSIX
Misc: Misc:
- Core: Suspend runloop when a core crashes - Core: Suspend runloop when a core crashes
@ -101,6 +103,7 @@ Misc:
- GBA Cheats: Implement "never" type codes (closes mgba.io/i/915) - GBA Cheats: Implement "never" type codes (closes mgba.io/i/915)
- GBA DMA: Enhanced logging (closes mgba.io/i/2454) - GBA DMA: Enhanced logging (closes mgba.io/i/2454)
- GBA Video: Implement layer placement for OpenGL renderer (fixes mgba.io/i/1962) - GBA Video: Implement layer placement for OpenGL renderer (fixes mgba.io/i/1962)
- GBA Video: Fix highlighting for sprites with mid-frame palette changes
- mGUI: Add margin to right-aligned menu text (fixes mgba.io/i/871) - mGUI: Add margin to right-aligned menu text (fixes mgba.io/i/871)
- mGUI: Autosave less frequently when fast-forwarding - mGUI: Autosave less frequently when fast-forwarding
- Qt: Rearrange menus some - Qt: Rearrange menus some

View File

@ -514,30 +514,30 @@ mSCRIPT_DEFINE_STRUCT(mCore)
mSCRIPT_DEFINE_END; mSCRIPT_DEFINE_END;
mSCRIPT_DEFINE_STRUCT_BINDING_DEFAULTS(mCore, checksum) mSCRIPT_DEFINE_STRUCT_BINDING_DEFAULTS(mCore, checksum)
mSCRIPT_MAKE_S32(mCHECKSUM_CRC32) mSCRIPT_S32(mCHECKSUM_CRC32)
mSCRIPT_DEFINE_DEFAULTS_END; mSCRIPT_DEFINE_DEFAULTS_END;
mSCRIPT_DEFINE_STRUCT_BINDING_DEFAULTS(mCore, saveStateSlot) mSCRIPT_DEFINE_STRUCT_BINDING_DEFAULTS(mCore, saveStateSlot)
mSCRIPT_NO_DEFAULT, mSCRIPT_NO_DEFAULT,
mSCRIPT_MAKE_S32(SAVESTATE_ALL) mSCRIPT_S32(SAVESTATE_ALL)
mSCRIPT_DEFINE_DEFAULTS_END; mSCRIPT_DEFINE_DEFAULTS_END;
mSCRIPT_DEFINE_STRUCT_BINDING_DEFAULTS(mCore, loadStateSlot) mSCRIPT_DEFINE_STRUCT_BINDING_DEFAULTS(mCore, loadStateSlot)
mSCRIPT_NO_DEFAULT, mSCRIPT_NO_DEFAULT,
mSCRIPT_MAKE_S32(SAVESTATE_ALL & ~SAVESTATE_SAVEDATA) mSCRIPT_S32(SAVESTATE_ALL & ~SAVESTATE_SAVEDATA)
mSCRIPT_DEFINE_DEFAULTS_END; mSCRIPT_DEFINE_DEFAULTS_END;
mSCRIPT_DEFINE_STRUCT_BINDING_DEFAULTS(mCore, saveStateBuffer) mSCRIPT_DEFINE_STRUCT_BINDING_DEFAULTS(mCore, saveStateBuffer)
mSCRIPT_MAKE_S32(SAVESTATE_ALL) mSCRIPT_S32(SAVESTATE_ALL)
mSCRIPT_DEFINE_DEFAULTS_END; mSCRIPT_DEFINE_DEFAULTS_END;
mSCRIPT_DEFINE_STRUCT_BINDING_DEFAULTS(mCore, loadStateBuffer) mSCRIPT_DEFINE_STRUCT_BINDING_DEFAULTS(mCore, loadStateBuffer)
mSCRIPT_NO_DEFAULT, mSCRIPT_NO_DEFAULT,
mSCRIPT_MAKE_S32(SAVESTATE_ALL & ~SAVESTATE_SAVEDATA) mSCRIPT_S32(SAVESTATE_ALL & ~SAVESTATE_SAVEDATA)
mSCRIPT_DEFINE_DEFAULTS_END; mSCRIPT_DEFINE_DEFAULTS_END;
mSCRIPT_DEFINE_STRUCT_BINDING_DEFAULTS(mCore, screenshot) mSCRIPT_DEFINE_STRUCT_BINDING_DEFAULTS(mCore, screenshot)
mSCRIPT_MAKE_CHARP(NULL) mSCRIPT_CHARP(NULL)
mSCRIPT_DEFINE_DEFAULTS_END; mSCRIPT_DEFINE_DEFAULTS_END;
static void _clearMemoryMap(struct mScriptContext* context, struct mScriptCoreAdapter* adapter, bool clear) { static void _clearMemoryMap(struct mScriptContext* context, struct mScriptCoreAdapter* adapter, bool clear) {
@ -707,7 +707,7 @@ mSCRIPT_DEFINE_STRUCT(mScriptConsole)
mSCRIPT_DEFINE_END; mSCRIPT_DEFINE_END;
mSCRIPT_DEFINE_STRUCT_BINDING_DEFAULTS(mScriptConsole, createBuffer) mSCRIPT_DEFINE_STRUCT_BINDING_DEFAULTS(mScriptConsole, createBuffer)
mSCRIPT_MAKE_CHARP(NULL) mSCRIPT_CHARP(NULL)
mSCRIPT_DEFINE_DEFAULTS_END; mSCRIPT_DEFINE_DEFAULTS_END;
void mScriptContextAttachLogger(struct mScriptContext* context, struct mLogger* logger) { void mScriptContextAttachLogger(struct mScriptContext* context, struct mLogger* logger) {

View File

@ -462,7 +462,7 @@ static const char* const _renderObj =
" discard;\n" " discard;\n"
" }\n" " }\n"
" int paletteEntry = renderTile((coord.x >> 3) + (coord.y >> 3) * stride, localPalette, coord & 7);\n" " int paletteEntry = renderTile((coord.x >> 3) + (coord.y >> 3) * stride, localPalette, coord & 7);\n"
" color = texelFetch(palette, ivec2(paletteEntry + 256, coord.y), 0);\n" " color = texelFetch(palette, ivec2(paletteEntry + 256, int(texCoord.y) + mosaic.w), 0);\n"
" flags = inflags;\n" " flags = inflags;\n"
" gl_FragDepth = float(flags.x) / 16.;\n" " gl_FragDepth = float(flags.x) / 16.;\n"
" window = ivec4(objwin, 0);\n" " window = ivec4(objwin, 0);\n"

View File

@ -455,6 +455,14 @@ static void GBAVideoSoftwareRendererWritePalette(struct GBAVideoRenderer* render
} else if (softwareRenderer->blendEffect == BLEND_DARKEN) { } else if (softwareRenderer->blendEffect == BLEND_DARKEN) {
softwareRenderer->variantPalette[address >> 1] = _darken(color, softwareRenderer->bldy); softwareRenderer->variantPalette[address >> 1] = _darken(color, softwareRenderer->bldy);
} }
int highlightAmount = renderer->highlightAmount >> 4;
if (highlightAmount) {
softwareRenderer->highlightPalette[address >> 1] = mColorMix5Bit(0x10 - highlightAmount, softwareRenderer->normalPalette[address >> 1], highlightAmount, renderer->highlightColor);
softwareRenderer->highlightVariantPalette[address >> 1] = mColorMix5Bit(0x10 - highlightAmount, softwareRenderer->variantPalette[address >> 1], highlightAmount, renderer->highlightColor);
} else {
softwareRenderer->highlightPalette[address >> 1] = softwareRenderer->normalPalette[address >> 1];
softwareRenderer->highlightVariantPalette[address >> 1] = softwareRenderer->variantPalette[address >> 1];
}
if (renderer->cache) { if (renderer->cache) {
mCacheSetWritePalette(renderer->cache, address >> 1, color); mCacheSetWritePalette(renderer->cache, address >> 1, color);
} }

View File

@ -291,6 +291,7 @@ void CoreController::loadConfig(ConfigController* config) {
m_fastForwardMute = config->getOption("fastForwardMute", -1).toInt(); m_fastForwardMute = config->getOption("fastForwardMute", -1).toInt();
mCoreConfigCopyValue(&m_threadContext.core->config, config->config(), "volume"); mCoreConfigCopyValue(&m_threadContext.core->config, config->config(), "volume");
mCoreConfigCopyValue(&m_threadContext.core->config, config->config(), "mute"); mCoreConfigCopyValue(&m_threadContext.core->config, config->config(), "mute");
m_preload = config->getOption("preload").toInt();
int playerId = m_multiplayer->playerId(this) + 1; int playerId = m_multiplayer->playerId(this) + 1;
QVariant savePlayerId = config->getOption("savePlayerId"); QVariant savePlayerId = config->getOption("savePlayerId");
@ -834,7 +835,11 @@ void CoreController::replaceGame(const QString& path) {
QString fname = info.canonicalFilePath(); QString fname = info.canonicalFilePath();
Interrupter interrupter(this); Interrupter interrupter(this);
mDirectorySetDetachBase(&m_threadContext.core->dirs); mDirectorySetDetachBase(&m_threadContext.core->dirs);
mCoreLoadFile(m_threadContext.core, fname.toUtf8().constData()); if (m_preload) {
mCorePreloadFile(m_threadContext.core, fname.toUtf8().constData());
} else {
mCoreLoadFile(m_threadContext.core, fname.toUtf8().constData());
}
updateROMInfo(); updateROMInfo();
} }

View File

@ -239,6 +239,7 @@ private:
mCoreThread m_threadContext{}; mCoreThread m_threadContext{};
bool m_patched = false; bool m_patched = false;
bool m_preload = false;
uint32_t m_crc32; uint32_t m_crc32;
QString m_internalTitle; QString m_internalTitle;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff