TASEmulators / BizHawk

BizHawk is a multi-system emulator written in C#. BizHawk provides nice features for casual gamers such as full screen, and joypad support in addition to full rerecording and debugging tools for all system cores.
http://tasvideos.org/BizHawk.html
Other
2.21k stars 385 forks source link

Implement faded (configurable colour) zeroes in the Hex Editor #4098

Open Asnivor opened 1 month ago

Asnivor commented 1 month ago

This implements a HexLabelEx control that replaces the LocaLabelEx 'AddressesLabel' control in HexEditor.cs. It overrides OnPaint(), parses the incoming string and draws the string out using different colours depending on whether the hex value is '00' or not. A new colour selector is also implemented within HexColor.cs so the user can choose which colour they want displayed for 00 values.

This addresses #3769 and the duplicate #3930

Notes:

  1. I could not find a way to have all this stuff directly within HexEditor.cs itself. Maybe it's just a lack of knowledge, but I needed to intercept the OnPaint control method and NOT call base.OnPaint(). But if I disable base.OnPaint() in the control, the PaintEventHandler is never called. shrug.
  2. I'm only able to test this on Windows currently. The various arbtrary spacing floats used in HexLabelEx would have to be tested on linux and modified accordingly (there is already an OSTailoredCode.IsUnixHost check in the constructor ready to be added to).

I'm sure it can all be cleaned up, but I'm stuck at the moment on the 'how'.

Asnivor commented 1 month ago

image

Asnivor commented 1 month ago

image

Morilli commented 1 month ago

This does not work when the data size isn't 1 byte.

Asnivor commented 1 month ago

Sounds like this needs a lot more work. It should probably integrate with the highlighting positioning code in the calling class. I'll work on it when I have time.