Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix graphics debugger on 64bit #8

Merged
merged 3 commits into from
Mar 1, 2024

Conversation

Archez
Copy link

@Archez Archez commented Feb 28, 2024

The graphics debugger on 64bit machines was only printing the first word for each instruction. i.e. gsSP2Triangles would show zeros for the second triangle. This is because our Gfx uses uintptr_t types for the words, but the Gfx internal to libgfxd uses uint32_t. When the disassembler executes it treats our w0 as the value split over both w0 and w1.

To address this, I build a new input buffer as a vector<uint32_t> and only copy the first 32bits of each word into it, then pass that into the disassembler with the correct size value.


I also added the define wrapper around the libgfxd use so that we can have successful builds in the github actions. The GFX debugger will just print the opcode name when disassembly is not enabled.

Plus clang format

@Archez Archez force-pushed the fix-gfx-debugger-64bit branch from c625ccb to c74cb89 Compare February 28, 2024 07:00
@louist103 louist103 merged commit 7df976d into louist103:mm Mar 1, 2024
4 checks passed
louist103 pushed a commit that referenced this pull request Mar 2, 2024
* fix graphics debugger on 64bit

* wrap libgfxd use in define

* clang format
louist103 added a commit that referenced this pull request Mar 27, 2024
* MM

* Work for MM

* Fixed palette issues in MM (#1)

* Fixed palette issues with MM

* Test

* opcode for open/close disps

* Gfx Debugger (#2)

* BitConverter: fix type correcteness in loop

* gbi: get rid of LoadUcode macros

* Gui: add ability to make a GuiImage out of a LUS::Texture

* Add GfxDebugger

* GfxDebugger: add C Bridge

* gfx_pc: expose internal state + intergrate debugger

* Add GfxDebuggerWindow

* Context: integrate GfxDebuggerWindow

* update CMakeLists.txt

* GfxDebugger: move inline code from header to cpp file

* clean up comments and add a check for empty stacks

* fix cmake

* conflict

* implement bg 1cyc (#4)

* Implement point lights (#5)

* Remove debugging code

* Framebuffer Effects 1.0 (#6)

* Add initial copy framebuffer and draw framebuffer commands

* Implement DirectX framebuffer copy

* Implement OpenGL framebuffer copy

* Implement Metal framebuffer copy

* tweaks for metal viewport and int conversion

* resolve opengl msaa

* remove unused code paths

* Fix graphics debugger on 64bit (#8)

* fix graphics debugger on 64bit

* wrap libgfxd use in define

* clang format

* Fix light blinking in clocktown (#9)

* Revert changes to ResourceManager.cpp

* Format

* Fix

* merge

* ad setFB command

* Fix WiiU

* fix switch build error (#10)

* Remove commented g/abi.h files

* fix token pasting error on some compilers (#11)

* fix pop back without size check (#12)

* fix dl cmd increment (#13)

* add custom opcode for managing offset dl calls on 64bit (#14)

---------

Co-authored-by: Nicholas Estelami <[email protected]>
Co-authored-by: Random <[email protected]>
Co-authored-by: Archez <[email protected]>
Co-authored-by: Rozelette <[email protected]>
Co-authored-by: briaguya <[email protected]>
@Archez Archez deleted the fix-gfx-debugger-64bit branch September 13, 2024 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants