mirror of
https://github.com/Mr-Wiseguy/Zelda64Recomp.git
synced 2025-01-11 19:59:11 +01:00
used a static atomic instead of a namespace boolean.
This commit is contained in:
parent
9e98499684
commit
50d2a2ac51
@ -6,7 +6,7 @@ namespace zelda64 {
|
||||
//void quicksave_save();
|
||||
//void quicksave_load();
|
||||
|
||||
extern bool should_game_reset;
|
||||
void enqueue_game_reset();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -15,8 +15,10 @@
|
||||
#include "ultramodern/ultramodern.hpp"
|
||||
#include "ultramodern/config.hpp"
|
||||
|
||||
namespace zelda64 {
|
||||
bool should_game_reset;
|
||||
static std::atomic<uint8_t> should_game_reset = 0x00;
|
||||
|
||||
void zelda64::enqueue_game_reset() {
|
||||
should_game_reset.store(0x01);
|
||||
}
|
||||
|
||||
extern "C" void recomp_update_inputs(uint8_t* rdram, recomp_context* ctx) {
|
||||
@ -174,8 +176,5 @@ extern "C" void recomp_set_right_analog_suppressed(uint8_t* rdram, recomp_contex
|
||||
|
||||
|
||||
extern "C" void recomp_should_reset_game(uint8_t* rdram, recomp_context* ctx) {
|
||||
bool retVal = zelda64::should_game_reset;
|
||||
zelda64::should_game_reset = false;
|
||||
|
||||
_return(ctx, retVal);
|
||||
_return(ctx, should_game_reset.exchange(0x00));
|
||||
}
|
@ -287,7 +287,7 @@ void zelda64::open_reset_game_prompt() {
|
||||
"Quit",
|
||||
"Cancel",
|
||||
[]() {
|
||||
should_game_reset = true;
|
||||
zelda64::enqueue_game_reset();
|
||||
close_config_menu();
|
||||
},
|
||||
[]() {},
|
||||
|
Loading…
x
Reference in New Issue
Block a user