Previously the CgramWidget would render the selected color outline as a
17% white, 83% black dashed line on Qt5 with a QT_SCALE_FACTOR of 2.
This commit changes the CgramWidget so that the selected color outline
is drawn as a 50% white, 50% black dashed line, independent of the
device pixel ratio.
This commit also fixes a glitch in Qt5 where the outline of some
selected TilemapViewer cells were not rendered correctly if the zoom was
set to a prime number.
Qt5's default pen width is 1.0 and therefore the grid line thickness
increases when zooming in.
This commit changes the grid pen width to the inverse of zoom so it is
rendered same thickness independent of the zoom setting.
Optiroc has mentioned that the selected tile box's position and size is
multiplied by two on his Mac. This is caused by either
`painter->combinedTransform()` returning the wrong value for hi-dpi
displays or `painter->resetTransform()` not working as expected on
hi-dpi displays.
The new code does not call `painter->resetTransform()` but instead sets
the pen width and cell adjust to the inverse of the zoom, which cancels
out the transform and should render as one pixel to the user.
Decided to move the OAM name table bit into the "Char" column so it will
be included in the sort.
Also decided that refresh() should not change the user selected row.
This required me remember the selected row so it could be re-selected
after QTreeWidget has sorted the model. Unfortunately this can lead to
the occasional infinite signal call loop, necessitating the
inRefreshCall test to ensure refresh() is only called once.
On my system this dramatically reduces cpu usage from 18.5% to 4.6%
when quickly scrolling the VRAM viewer scrollbar[1].
[1]: Tested on a i5-3317U 1.70GHz CPU and no ROM loaded in the emulator.
This allows me to use a script to automatically fill the bsnes debugger
with breakpoints. For instance, the following bash line:
bsnes --show-debugger `grep BREAKPOINT "$symfile" | awk '{print "-b " $1 ":x"}'` "$romfile"
Will open the debugger window and create a CPUBus execute breakpoint
for all symbols containing BREAKPOINT in the symbol file.
See `bsnes --help` or `Application::printArguments` for the format of
the breakpoint string.