Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-midtunit: Added optional debug #define to emit JSON metadata about e…
…ach DMA draw call. [Ryan Holtz]
- Loading branch information
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6c9ab2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This stuff should go into a custom debug command, not a compile switch.
You can checkout src/mame/machine/xbox.cpp or src/mame/machine/model2.cpp for usage, should be pretty straightforward.
6c9ab2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with what I assume is your concern about the code rotting over time, but I disagree with the performance implications of checking a debug flag for every single DMA-draw call that Midway T-Unit games (and therefore, also Wolf-Unit and X-Unit games) make.
6c9ab2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compile switches are bad cause, as the name implies, you have to compile in order to enable them. Which also makes zero usefulness if for instance I want to check the behaviour in a specific MAME version.
As for the performance concern, think about the trace command: it's not always enabled but user decides when to turn on or off at will.
6c9ab2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems you feel very strongly about this. By all means, feel free to improve it and hook it up to a debugger command.
6c9ab2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've taken your suggestion and implemented a debugger command for logging PNGs, rather than having it stuck behind a #define.
However, when I type "help" in the debugger, it seems that driver-specific debugger commands are not listed. So how is a user supposed to know what debugger commands have been exposed by a given driver? That makes this an unacceptable solution, in my opinion.
6c9ab2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's actually an inconvenience of the custom commands: the help itself should tell the user that there actually are per-driver commands registered.
6c9ab2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does now, sort of. There's now a 'helpcustom' command which will look for registered debug commands that have been flagged as having custom help, and display their help lists.
6c9ab2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I found the Available Midway Blitter command and believe I enabled midblit pngdma by performing the following: "midblit pngdma enable c:\mame\roms\nbajamte\pngs logjson"
How to I get MAME to dump the sprites?
6c9ab2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay...how do I use the feature to log PNGs? There is no instruction on how to input the path. Admittedly I'm not a coder, but like messing with MAME / ROMS in my spare time. I was smart enough to compile MAME and get to the debug feature, but I am not familiar enough with C++ to make the debug feature work. Any help would be appreciated.
6c9ab2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You enable it from the debugger.
6c9ab2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get to the point where I type midblit pngdma enable but I don't believe I am inputting the path correctly. How do I give the path?
6c9ab2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the included 'help' command. Github is not intended to be a support forum.