diff --git a/desmume/src/mc.cpp b/desmume/src/mc.cpp index 565ae050c..a87430f2b 100644 --- a/desmume/src/mc.cpp +++ b/desmume/src/mc.cpp @@ -550,7 +550,9 @@ bool BackupDevice::load_state(std::istream* is) read32le(&com,is); read32le(&addr_size,is); read32le(&addr_counter,is); - read32le((u32*)&state,is); + u32 temp; + read32le(&temp,is); + state = (STATE)temp; readbuffer(data,is); readbuffer(data_autodetect,is); } diff --git a/desmume/src/mc.h b/desmume/src/mc.h index ac340f27a..ead4e8aa7 100644 --- a/desmume/src/mc.h +++ b/desmume/src/mc.h @@ -97,7 +97,7 @@ private: std::string filename; std::vector data; std::vector data_autodetect; - enum : u32 { + enum STATE { DETECTING = 0, RUNNING = 1 } state;