mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-23 22:52:34 +01:00
byuu says: I'll post more detailed changes later, but basically: - fixed Baldur's Gate bug - guess if no flash ROM ID present (fixes Magical Vacation, many many others) - nall cleanups - sfc/cartridge major cleanups - bsxcartridge/"bsx" renamed to mcc/"mcc" after the logic chip it uses (consistency with SGB/ICD2) - ... and more!
31 lines
805 B
C++
31 lines
805 B
C++
#ifndef NALL_WINDOWS_GUID_HPP
|
|
#define NALL_WINDOWS_GUID_HPP
|
|
|
|
#include <nall/random.hpp>
|
|
#include <nall/string.hpp>
|
|
|
|
namespace nall {
|
|
|
|
//generate unique GUID
|
|
inline string guid() {
|
|
LinearFeedbackShiftRegisterGenerator lfsr;
|
|
lfsr.seed(time(nullptr));
|
|
for(unsigned n = 0; n < 256; n++) lfsr();
|
|
|
|
string output;
|
|
for(unsigned n = 0; n < 4; n++) output.append(hex(lfsr(), 2L));
|
|
output.append("-");
|
|
for(unsigned n = 0; n < 2; n++) output.append(hex(lfsr(), 2L));
|
|
output.append("-");
|
|
for(unsigned n = 0; n < 2; n++) output.append(hex(lfsr(), 2L));
|
|
output.append("-");
|
|
for(unsigned n = 0; n < 2; n++) output.append(hex(lfsr(), 2L));
|
|
output.append("-");
|
|
for(unsigned n = 0; n < 6; n++) output.append(hex(lfsr(), 2L));
|
|
return {"{", output, "}"};
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|