Merge "Move misc.cpp to the right place and fix build" into emu-master-dev