mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-27 10:38:46 -04:00
render passes: restore mod callback context after watchdog aborts
Adapted from the original feature commits, retaining their author credit: [6d44e21d](https://github.com/FractalEngineer/psxrecomp/commit/6d44e21df7ccedd1acbfa31844a53bf8bd8b316e) [35b209d4](https://github.com/FractalEngineer/psxrecomp/commit/35b209d406c168e14f51bb8bbd549742473c7388) Source scope and current-master validation: docs/internal/upstream/render-pass-mod-callback-rollback.md Co-authored-by: Yves <calibratedbeats@gmail.com>
This commit is contained in:
@@ -1603,6 +1603,17 @@ extern "C" int psx_mod_function_entry_active(void) {
|
||||
return PSXRecompV4::function_entry_depth != 0;
|
||||
}
|
||||
|
||||
extern "C" void mod_runtime_function_entry_context_save(ModFunctionEntryContext *out) {
|
||||
out->depth = PSXRecompV4::function_entry_depth;
|
||||
out->plugin = PSXRecompV4::state().current_plugin;
|
||||
}
|
||||
|
||||
extern "C" void mod_runtime_function_entry_context_restore(const ModFunctionEntryContext *in) {
|
||||
PSXRecompV4::function_entry_depth = in->depth;
|
||||
PSXRecompV4::state().current_plugin =
|
||||
static_cast<const PSXRecompV4::ModResolution::Plugin *>(in->plugin);
|
||||
}
|
||||
|
||||
extern "C" void mod_runtime_patch_disc_sector(uint32_t lba, int raw_sector,
|
||||
uint8_t* bytes, uint32_t size) {
|
||||
using namespace PSXRecompV4;
|
||||
|
||||
Reference in New Issue
Block a user