more ParallelRDP debugging
This commit is contained in:
12
external/parallel-rdp/ParallelRDPWrapper.cpp
vendored
12
external/parallel-rdp/ParallelRDPWrapper.cpp
vendored
@@ -124,7 +124,7 @@ WSI* LoadWSIPlatform(Vulkan::WSIPlatform* wsi_platform, std::unique_ptr<Parallel
|
||||
return wsi;
|
||||
}
|
||||
|
||||
void LoadParallelRDP(const u8* rdram) {
|
||||
void LoadParallelRDP(u8* rdram) {
|
||||
ResourceLayout vertLayout;
|
||||
ResourceLayout fragLayout;
|
||||
|
||||
@@ -166,7 +166,7 @@ void LoadParallelRDP(const u8* rdram) {
|
||||
}
|
||||
}
|
||||
|
||||
void InitParallelRDP(const u8* rdram, SDL_Window* window) {
|
||||
void InitParallelRDP(u8* rdram, SDL_Window* window) {
|
||||
g_Window = window;
|
||||
LoadWSIPlatform(new SDLWSIPlatform(), std::make_unique<SDLParallelRdpWindowInfo>());
|
||||
LoadParallelRDP(rdram);
|
||||
@@ -247,7 +247,7 @@ void UpdateScreen(Window& imguiWindow, Util::IntrusivePtr<Image> image) {
|
||||
wsi->end_frame();
|
||||
}
|
||||
|
||||
void UpdateScreenParallelRdp(Window& imguiWindow, const n64::VI& vi) {
|
||||
void UpdateScreenParallelRdp(Window& imguiWindow, n64::VI& vi) {
|
||||
command_processor->set_vi_register(VIRegister::Control, vi.status.raw);
|
||||
command_processor->set_vi_register(VIRegister::Origin, vi.origin);
|
||||
command_processor->set_vi_register(VIRegister::Width, vi.width);
|
||||
@@ -257,9 +257,9 @@ void UpdateScreenParallelRdp(Window& imguiWindow, const n64::VI& vi) {
|
||||
command_processor->set_vi_register(VIRegister::VSync, vi.vsync);
|
||||
command_processor->set_vi_register(VIRegister::HSync, vi.hsync);
|
||||
command_processor->set_vi_register(VIRegister::Leap, vi.hsyncLeap.raw);
|
||||
command_processor->set_vi_register(VIRegister::HStart, vi.hstart);
|
||||
command_processor->set_vi_register(VIRegister::VStart, vi.vstart);
|
||||
command_processor->set_vi_register(VIRegister::VBurst, vi.burst.raw);
|
||||
command_processor->set_vi_register(VIRegister::HStart, vi.hstart.raw);
|
||||
command_processor->set_vi_register(VIRegister::VStart, vi.vstart.raw);
|
||||
command_processor->set_vi_register(VIRegister::VBurst, vi.vburst);
|
||||
command_processor->set_vi_register(VIRegister::XScale, vi.xscale.raw);
|
||||
command_processor->set_vi_register(VIRegister::YScale, vi.yscale.raw);
|
||||
|
||||
|
||||
4
external/parallel-rdp/ParallelRDPWrapper.hpp
vendored
4
external/parallel-rdp/ParallelRDPWrapper.hpp
vendored
@@ -35,8 +35,8 @@ uint32_t GetVkGraphicsQueueFamily();
|
||||
VkFormat GetVkFormat();
|
||||
VkCommandBuffer GetVkCommandBuffer();
|
||||
void SubmitRequestedVkCommandBuffer();
|
||||
void InitParallelRDP(const u8* rdram, SDL_Window*);
|
||||
void UpdateScreenParallelRdp(Window& imguiWindow, const n64::VI& vi);
|
||||
void InitParallelRDP(u8* rdram, SDL_Window*);
|
||||
void UpdateScreenParallelRdp(Window& imguiWindow, n64::VI& vi);
|
||||
void ParallelRdpEnqueueCommand(int command_length, u32* buffer);
|
||||
void ParallelRdpOnFullSync();
|
||||
void UpdateScreenParallelRdpNoGame(Window& imguiWindow);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <Core.hpp>
|
||||
#include <utility>
|
||||
|
||||
Window::Window(const n64::Core& core) {
|
||||
Window::Window(n64::Core& core) {
|
||||
InitSDL();
|
||||
InitParallelRDP(core.GetRDRAM(), window);
|
||||
//InitImgui();
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <vector>
|
||||
|
||||
struct Window {
|
||||
explicit Window(const n64::Core& core);
|
||||
explicit Window(n64::Core& core);
|
||||
~Window();
|
||||
ImDrawData* Present();
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ struct Core {
|
||||
void Run();
|
||||
void PollInputs(SDL_Event);
|
||||
VI& GetVI() { return mem.mmio.vi; }
|
||||
const u8* GetRDRAM() const { return mem.rdram.data(); }
|
||||
u8* GetRDRAM() { return mem.rdram.data(); }
|
||||
bool romLoaded = false;
|
||||
private:
|
||||
Mem mem;
|
||||
|
||||
@@ -100,7 +100,7 @@ inline void HandleInterrupt(Registers& regs) {
|
||||
|
||||
void Cpu::LogInstruction(u32 instruction) {
|
||||
#ifndef NDEBUG
|
||||
u8 code[4]{};
|
||||
/*u8 code[4]{};
|
||||
u32 bswapped = be32toh(instruction);
|
||||
memcpy(code, &instruction, 4);
|
||||
count = cs_disasm(handle, code, 4, regs.pc, 0, &insn);
|
||||
@@ -112,7 +112,7 @@ void Cpu::LogInstruction(u32 instruction) {
|
||||
cs_free(insn, count);
|
||||
} else {
|
||||
util::panic("Failed to disassemble {:08X}!", instruction);
|
||||
}
|
||||
}*/
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ u32 VI::Read(u32 paddr) const {
|
||||
case 0x04400020: return hsyncLeap.raw;
|
||||
case 0x04400024: return hvideo.raw;
|
||||
case 0x04400028: return vvideo.raw;
|
||||
case 0x0440002C: return vburst.raw;
|
||||
case 0x0440002C: return vburst;
|
||||
case 0x04400030: return xscale.raw;
|
||||
case 0x04400034: return yscale.raw;
|
||||
default:
|
||||
@@ -74,7 +74,7 @@ void VI::Write(MI& mi, Registers& regs, u32 paddr, u32 val) {
|
||||
case 0x04400020: hsyncLeap.raw = val; break;
|
||||
case 0x04400024: hvideo.raw = val; break;
|
||||
case 0x04400028: vvideo.raw = val; break;
|
||||
case 0x0440002C: vburst.raw = val; break;
|
||||
case 0x0440002C: vburst = val; break;
|
||||
case 0x04400030: xscale.raw = val; break;
|
||||
case 0x04400034: yscale.raw = val; break;
|
||||
default:
|
||||
|
||||
@@ -3,23 +3,23 @@
|
||||
|
||||
namespace n64 {
|
||||
union VIBurst {
|
||||
struct {
|
||||
/*struct {
|
||||
unsigned hsyncW:8;
|
||||
unsigned burstW:8;
|
||||
unsigned vsyncW:4;
|
||||
unsigned burstStart:10;
|
||||
unsigned:2;
|
||||
};
|
||||
};*/
|
||||
u32 raw;
|
||||
};
|
||||
|
||||
union VIHsyncLeap {
|
||||
struct {
|
||||
/*struct {
|
||||
unsigned leapB:10;
|
||||
unsigned:6;
|
||||
unsigned leapA:10;
|
||||
unsigned:6;
|
||||
};
|
||||
};*/
|
||||
u32 raw;
|
||||
} ;
|
||||
|
||||
@@ -33,14 +33,20 @@ union VIVideo {
|
||||
u32 raw;
|
||||
};
|
||||
|
||||
union VIScale {
|
||||
union AxisScale {
|
||||
u32 raw;
|
||||
struct {
|
||||
unsigned scale:12;
|
||||
unsigned:4;
|
||||
unsigned offset:12;
|
||||
unsigned scaleDecimal:10;
|
||||
unsigned scaleInteger:2;
|
||||
unsigned subpixelOffsetDecimal:10;
|
||||
unsigned subpixelOffsetInteger:2;
|
||||
unsigned:4;
|
||||
};
|
||||
struct {
|
||||
unsigned scale:12;
|
||||
unsigned subpixelOffset:12;
|
||||
unsigned:4;
|
||||
};
|
||||
u32 raw;
|
||||
};
|
||||
|
||||
enum VIFormat {
|
||||
@@ -52,14 +58,30 @@ enum VIFormat {
|
||||
|
||||
union VIStatus {
|
||||
struct {
|
||||
u8 format:2;
|
||||
unsigned serrate:1;
|
||||
unsigned:29;
|
||||
u8 type:2;
|
||||
bool gamma_dither_enable:1;
|
||||
bool gamma_enable:1;
|
||||
bool divot_enable:1;
|
||||
bool reserved_always_off:1;
|
||||
bool serrate:1;
|
||||
bool reserved_diagnostics_only:1;
|
||||
unsigned antialias_mode:3;
|
||||
unsigned:21;
|
||||
};
|
||||
|
||||
u32 raw;
|
||||
};
|
||||
|
||||
union AxisStart {
|
||||
u32 raw;
|
||||
struct {
|
||||
unsigned end:10;
|
||||
unsigned:6;
|
||||
unsigned start:10;
|
||||
unsigned:6;
|
||||
};
|
||||
};
|
||||
|
||||
struct MI;
|
||||
struct Registers;
|
||||
|
||||
@@ -67,14 +89,15 @@ struct VI {
|
||||
VI();
|
||||
[[nodiscard]] u32 Read(u32) const;
|
||||
void Write(MI&, Registers&, u32, u32);
|
||||
VIScale xscale{}, yscale{};
|
||||
AxisScale xscale{}, yscale{};
|
||||
VIVideo hvideo{}, vvideo{};
|
||||
VIHsyncLeap hsyncLeap{};
|
||||
VIStatus status{};
|
||||
VIBurst burst{}, vburst{};
|
||||
VIBurst burst{};
|
||||
u32 vburst{};
|
||||
u32 origin, width, current;
|
||||
u32 vsync, hsync, intr;
|
||||
u32 hstart{}, vstart{};
|
||||
AxisStart hstart{}, vstart{};
|
||||
int swaps{};
|
||||
int numHalflines;
|
||||
int numFields;
|
||||
|
||||
Reference in New Issue
Block a user