mgba-emu / mgba

mGBA Game Boy Advance Emulator
https://mgba.io/
Mozilla Public License 2.0
5.65k stars 774 forks source link

[Feature Request] Give the disassembler the option to output decimal values to hexadecimal values #2553

Open tommai78101 opened 2 years ago

tommai78101 commented 2 years ago

Currently using Bizhawk 2.8 latest stable release for doing some TAS'ing projects. I'm using the Bizhawk's tool, called Trace Logger.

According to this code here:

https://github.com/TASEmulators/BizHawk/blob/90220b6506d1b5a6751c20aa7b2c1d8b22574fca/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.cs#L71

The Bizhawk trace logger uses the mGBA disassembler to generate the trace log messages, hence this ticket is reported here.

What I've noticed in the Trace Logger, whenever I wanted to log the disassembler's operands that occurs within a single frame using the mGBA core, I've noticed that some decimal values are always showing up, despite that all other values are formatted in hexadecimal values.

For instance:

00000128:  E3A00301  mov r0, #67108864

... some other operands ...

03000068:  1A000008  bne 0x03000090

... some other operands ...

08032190:      B083  sub sp, #12

#67108864 is actually 0x04000000 in hexadecimal value.

Some instructions like mov uses decimal numbers when logging, while other instructions use hexadecimal numbers. It makes reading the trace logs inconsistently unhelpful because I have to manually convert the decimal values to be hexadecimal values when I need to actually look into what values are put into certain registers and whether they do bit masking in some areas.

I believed there might be benefits for using decimal numbers in the instructions' operands, therefore this feature request is a request to allow the option to toggle a setting that would convert all decimal values to hexadecimal values during log tracing in the disassembler.

qwetboy10 commented 1 year ago

Hi. I'm a UT Student taking the virtualization course. Could I ask to work on this issue? Thanks.

tommai78101 commented 1 year ago

@qwetboy10 So as long as you follow the Contribution guidelines, you are free to work on this issue and submit a pull request when you are ready.

qwetboy10 commented 1 year ago

Unfortunately BizHawk actually uses darm to for disassembly. This issue should be closed and either moved to the BizHawk or darm repository.