Fix imgui support + update README.md

This commit is contained in:
CocoSimone
2022-08-19 23:42:15 +02:00
parent 02636d38b6
commit 7962ae12e3
31 changed files with 53895 additions and 29 deletions

View File

@@ -3,7 +3,7 @@ project(natsukashii)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED true)
add_compile_definitions(VULKAN_DEBUG)
#add_compile_definitions(VULKAN_DEBUG)
file(COPY ${CMAKE_SOURCE_DIR}/../resources DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(n64)

View File

@@ -9,7 +9,7 @@ void App::Run() {
while (!done) {
SDL_Event event;
while (SDL_PollEvent(&event)) {
//ImGui_ImplSDL2_ProcessEvent(&event);
ImGui_ImplSDL2_ProcessEvent(&event);
switch(event.type) {
case SDL_QUIT: done = true; break;
case SDL_WINDOWEVENT:

View File

@@ -4,10 +4,12 @@
#include <Core.hpp>
#include <utility>
VkInstance instance{};
Window::Window(n64::Core& core) {
InitSDL();
InitParallelRDP(core.mem.GetRDRAM(), window);
//InitImgui();
InitImgui();
NFD::Init();
}
@@ -61,6 +63,8 @@ void Window::InitImgui() {
allocator = nullptr;
minImageCount = 2;
ImGui_ImplVulkan_LoadFunctions([](const char* function_name, void*) { return vkGetInstanceProcAddr(instance, function_name); });
{
VkDescriptorPoolSize poolSizes[] = {
{ VK_DESCRIPTOR_TYPE_SAMPLER, 1000 },
@@ -168,9 +172,9 @@ void Window::InitImgui() {
Window::~Window() {
VkResult err = vkDeviceWaitIdle(device);
check_vk_result(err);
//ImGui_ImplVulkan_Shutdown();
//ImGui_ImplSDL2_Shutdown();
//ImGui::DestroyContext();
ImGui_ImplVulkan_Shutdown();
ImGui_ImplSDL2_Shutdown();
ImGui::DestroyContext();
vkDestroyDescriptorPool(device, descriptorPool, nullptr);
vkDestroyDevice(device, nullptr);
vkDestroyInstance(instance, nullptr);
@@ -180,13 +184,13 @@ Window::~Window() {
}
ImDrawData* Window::Present(n64::Core& core) {
//ImGui_ImplVulkan_NewFrame();
//ImGui_ImplSDL2_NewFrame(window);
//ImGui::NewFrame();
ImGui_ImplVulkan_NewFrame();
ImGui_ImplSDL2_NewFrame(window);
ImGui::NewFrame();
//
Render(core);
//ImGui::Render();
ImGui::Render();
return ImGui::GetDrawData();
}

View File

@@ -19,7 +19,6 @@ private:
void InitImgui();
void Render(n64::Core& core);
VkInstance instance{};
VkPhysicalDevice physicalDevice{};
VkDevice device{};
uint32_t queueFamily{uint32_t(-1)};

View File

@@ -47,9 +47,9 @@ void Core::Run(Window& window) {
InterruptRaise(mmio.mi, cpu.regs, Interrupt::VI);
}
UpdateScreenParallelRdp(window, GetVI());
UpdateScreenParallelRdp(*this, window, GetVI());
} else {
UpdateScreenParallelRdpNoGame(window);
UpdateScreenParallelRdpNoGame(*this, window);
}
}
}

View File

@@ -12,6 +12,10 @@ Cpu::Cpu() {
if (cs_open(CS_ARCH_MIPS, CS_MODE_MIPS64, &handle)) {
util::panic("Could not initialize capstone!\n");
}
if (cs_option(handle, CS_OPT_UNSIGNED, CS_OPT_ON)) {
util::panic("Could not initialize capstone!\n");
}
}
Cpu::~Cpu() {