threading part 1
This commit is contained in:
parent
08bfc06cc9
commit
3e1386666b
|
@ -41,7 +41,7 @@ add_executable(shadps4
|
||||||
src/Core/PS4/HLE/Kernel/Objects/physical_memory.cpp
|
src/Core/PS4/HLE/Kernel/Objects/physical_memory.cpp
|
||||||
src/Util/string_util.cpp
|
src/Util/string_util.cpp
|
||||||
src/Util/string_util.cpp
|
src/Util/string_util.cpp
|
||||||
"src/Util/Singleton.h" "src/Util/Disassembler.cpp" "src/Util/Disassembler.h" "src/Core/PS4/Util/aerolib.h" "src/Core/PS4/Loader/SymbolsResolver.h" "src/Core/PS4/Loader/SymbolsResolver.cpp" "src/Core/PS4/HLE/Libs.cpp" "src/Core/PS4/HLE/Libs.h" "src/Core/PS4/HLE/LibC.cpp" "src/Core/PS4/HLE/LibC.h" "src/Lib/Timer.cpp" "src/Lib/Timer.h" "src/Core/PS4/HLE/LibKernel.cpp" "src/Core/PS4/HLE/LibKernel.h" "src/Core/PS4/HLE/LibSceVideoOut.cpp" "src/Core/PS4/HLE/LibSceVideoOut.h" "src/Core/PS4/HLE/LibSceGnmDriver.cpp" "src/Core/PS4/HLE/LibSceGnmDriver.h" "src/Core/PS4/HLE/Kernel/ThreadManagement.cpp" "src/Core/PS4/HLE/Kernel/ThreadManagement.h" "src/Core/PS4/HLE/ErrorCodes.h" "src/debug.h" "src/Core/PS4/HLE/Kernel/memory_management.cpp" "src/Core/PS4/HLE/Kernel/memory_management.h" "src/Core/PS4/GPU/gpu_memory.cpp" "src/Core/PS4/GPU/gpu_memory.h")
|
"src/Util/Singleton.h" "src/Util/Disassembler.cpp" "src/Util/Disassembler.h" "src/Core/PS4/Util/aerolib.h" "src/Core/PS4/Loader/SymbolsResolver.h" "src/Core/PS4/Loader/SymbolsResolver.cpp" "src/Core/PS4/HLE/Libs.cpp" "src/Core/PS4/HLE/Libs.h" "src/Core/PS4/HLE/LibC.cpp" "src/Core/PS4/HLE/LibC.h" "src/Lib/Timer.cpp" "src/Lib/Timer.h" "src/Core/PS4/HLE/LibKernel.cpp" "src/Core/PS4/HLE/LibKernel.h" "src/Core/PS4/HLE/LibSceVideoOut.cpp" "src/Core/PS4/HLE/LibSceVideoOut.h" "src/Core/PS4/HLE/LibSceGnmDriver.cpp" "src/Core/PS4/HLE/LibSceGnmDriver.h" "src/Core/PS4/HLE/Kernel/ThreadManagement.cpp" "src/Core/PS4/HLE/Kernel/ThreadManagement.h" "src/Core/PS4/HLE/ErrorCodes.h" "src/debug.h" "src/Core/PS4/HLE/Kernel/memory_management.cpp" "src/Core/PS4/HLE/Kernel/memory_management.h" "src/Core/PS4/GPU/gpu_memory.cpp" "src/Core/PS4/GPU/gpu_memory.h" "src/emulator.cpp" "src/emulator.h")
|
||||||
|
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
target_link_libraries(shadps4 PUBLIC fmt mincore spdlog IMGUI SDL3-shared ${OPENGL_LIBRARY})
|
target_link_libraries(shadps4 PUBLIC fmt mincore spdlog IMGUI SDL3-shared ${OPENGL_LIBRARY})
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
#include "emulator.h"
|
||||||
|
|
||||||
|
namespace Emulator {
|
||||||
|
void emuInit() {}
|
||||||
|
void emuRun() {
|
||||||
|
for (;;) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} // namespace emulator
|
|
@ -0,0 +1,6 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace Emulator {
|
||||||
|
void emuInit();
|
||||||
|
void emuRun();
|
||||||
|
}
|
16
src/main.cpp
16
src/main.cpp
|
@ -30,6 +30,7 @@
|
||||||
#include <Zydis/Zydis.h>
|
#include <Zydis/Zydis.h>
|
||||||
#include "Core/PS4/HLE/Libs.h"
|
#include "Core/PS4/HLE/Libs.h"
|
||||||
#include "Lib/Threads.h"
|
#include "Lib/Threads.h"
|
||||||
|
#include <emulator.h>
|
||||||
|
|
||||||
// Main code
|
// Main code
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
|
@ -40,15 +41,24 @@ int main(int argc, char* argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
logging::init(true); // init logging
|
logging::init(true); // init logging
|
||||||
|
Emulator::emuInit();
|
||||||
Lib::InitThreads();
|
Lib::InitThreads();
|
||||||
const char* const path = argv[1]; //argument 1 is the path of self file to boot
|
const char* const path = argv[1]; // argument 1 is the path of self file to boot
|
||||||
// const char* const path = "F:\\ps4games\\CUSA03840 - Resident Evil 6\\eboot.bin";
|
|
||||||
|
|
||||||
auto* linker = Singleton<Linker>::Instance();
|
auto* linker = Singleton<Linker>::Instance();
|
||||||
HLE::Libs::Init_HLE_Libs(linker->getHLESymbols());
|
HLE::Libs::Init_HLE_Libs(linker->getHLESymbols());
|
||||||
auto *module =linker->LoadModule(path);//load main executable
|
auto *module =linker->LoadModule(path);//load main executable
|
||||||
|
|
||||||
linker->Execute();
|
Lib::Thread mainthread(
|
||||||
|
[](void*) {
|
||||||
|
auto* linker = Singleton<Linker>::Instance();
|
||||||
|
linker->Execute();
|
||||||
|
},
|
||||||
|
nullptr);
|
||||||
|
mainthread.DetachThread();
|
||||||
|
Emulator::emuRun();
|
||||||
|
mainthread.JoinThread();
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// Setup SDL
|
// Setup SDL
|
||||||
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_GAMEPAD) != 0)
|
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_GAMEPAD) != 0)
|
||||||
|
|
Loading…
Reference in New Issue