Git Product home page Git Product logo

maskromtool's Introduction

Howdy y'all,

This is my CAD tool for taking photographs of a mask ROMs and extracting the bits, so that the contents of the ROM can be recovered.

The keyboard shortcuts in this tool are not optional. Please read the GUI documentation below before starting to explore.

--Travis Goodspeed

Screenshot of the tool.

Examples

gbrom-tutorial teaches you how to begin with photographs of the GameBoy's mask ROM and work your way to an accurate ROM image.

MYK82 ROM holds a completed dump of the ROM from the MYK82 chip in a Fortezza Card. This is the successor to the Clipper Chip, and the repository includes not just all ROM bits but also reshoots for error correction.

wersi-slm2-51173 is a Zilog Z8 ROM from a music synthesize module.

Release Changelog

master -- Gatorom's solver-set option now uses descriptive fiilenames. GUI can now export a set of solved results with File/Export/SolverSetBytes. Clearer selection rectangle. R and C will now draw the correct line type when the user confuses them. ^H now sets the home position. Zooming and movement keys now work in the second view. Perfectly duplicate lines are now culled during DRC by the V key. Rows and columns are now stored as sorted lists intead of sets. Rows and columns are now in a consistent order in the file export. Performance boosts in bit marking, background bit marking and alignment. Universal binary for macOS.

2024-07-14 -- Fixes crash when deleting a double-selected item. Delete and backspace now delete objects like D. Multiple disassemblers. Decodings are now updated as decoding thresholds are changed.

2024-06-23 -- Yara rule solving. Stability improvements. Crosshairs update to the angles of selected lines. Space now repeats the last line, whether row or column. Multiple items can be selected, and SHIFT+D duplicates them. Select with SHIFT to add more lines or CTRL (CMD on macOS) to remove lines. Right dragging moves multiple lines, previewing only relevant bits. Crosshair and selection colors are now selectable. Background is no longer tiled when zooming out.

2024-05-19 -- DRC violations are now cleared when bits are forced. Histogram export for ploting the color distributions in GNUPlot. Support for Wayland. Explicit wordsize support in CLI, GUI, solver and basic decoders. Solver sets, exporting all potential solutions as binary files. Unreliable aligner has been deprecated. GUI solver. Disassembler calls out to MAME's Unidasm.

2024-01-28 -- Undo and Redo. Strings dialog. Backslash key for layer visibility. Reliable alignment algorithm. Closing main window closes application.

2024-01-01 -- Fixes bus error in Z8 decoder when solving odd sizes. Verbose mode in the GatoROM CLI. squeeze-lr mode now in GUI decoder. Edit menu item to clear all bit fixes. E will select the next DRC violation. Perfectly vertical images no longer break the alignment algorithm.

2023-12-07 -- Selection highlight. Row/column counts in status bar. ASCII solver. Fixes multiple crashes in solver from awkward ROM sizes. GatoROM decoding in the GUI. Removal of redundant decoders. Hex viewer and highlighting of selected bytes. GatoROM CLI is now very strict about exiting on illegal access. Zilog Z8 ROM support.

2023-09-13 -- CLI option to disable OpenGL. Printing support. Working Windows build.

2023-08-06 -- OpenGL is now functional and default. GatoROM included for bit decoding.

2023-07-20 -- Secondary display support. Tall sampling. Fixes crash when hitting V after deleting a line.

2023-06-17 -- Added macOS on X86_64 and ARM64.

2023-05-30 -- First Windows release.

Building

This tool works in Windows, Linux, FreeBSD and MacOS, using QT6 with the QtCharts extension.

Building the tool is easiest from the CLI. In Debian Bullseye (11.x),

% sudo apt install make gcc g++ cmake git qt6-base-dev libqt6charts6-dev \
qt6-translations-l10n linguist-qt6 qt6-l10n-tools qt6-tools-\* qt6-image-formats-plugins
% git clone https://github.com/travisgoodspeed/maskromtool/
...
% cd maskromtool
% mkdir build; cd build
% cmake ..
% make -j 8 && sudo make install

In Windows and macOS, use the Qt for Open Source installer, being sure to include the Charts and Image Formats extensions. Then open CMakeLists.txt as a project. Ctrl+B will then compile maskromtool. If you have a problem with your import, such as choosing the wrong Qt installation, delete CMakeLists.txt.user and reopen the project to try again.

For the convenience of Windows and macOS users, we have also made some Prebuilt Releases.

GUI Usage

First use File/Open ROM to open a ROM image as a photograph. Try to use uncompressed formats, but beware that macOS doesn't like TIFF files.

Holding the control key (command on macOS) while rolling the mouse wheel will zoom in and out. You can also pinch-zoom on a track pad. Dragging with the middle button will pan, or scroll with two fingers as your operating system likes.

By arbitrary convention, the bits should be in long columns with shorter rows. If decoder lines are visible, they ought to be at the top of the image. Feel free to photograph it one way, then rotate it for markup.

When you save your project, the image's filename will be extended with .json. This sorted and indented JSON file should be appropriate for use in version control, such as Git repositories.

These keyboard buttons then provide most of your input. For drawing lines, first click once to choose as start position and then press the key when the mouse is above the end position. Deleting an item or Setting its position will apply to the most recently placed line, unless you drag a box to select a line.

Select an item by dragging over it with a left mouse click and watching for it to turn green. The most recently placed item is automatically selected. Some commands work on multiple selected items; others just one.

You can delete a mistake with D or adjust its position a little with S, the arrow keys, or a right-click drag. During movement the bits of unrelated lines might be hidden for performance, and the M key or releasing the right mouse button will redraw them.

On macOS, ^ means Command instead of Ctrl.

Tab         -- Show/Hide bits.
\           -- Show/Hide rows and columns.
^\          -- Show/Hide background.
ALT \       -- Show/Hide crosshair.


R           -- Draw a row from the last left-click position.
SHIFT R     -- Repeat the last row.
C           -- Draw a column from the last left-click position.
SHIFT C     -- Repeat the last column.
SPACE       -- Repeat the last row or column.


D           -- Delete the selected objects.
SHIFT D     -- Duplicate the selected lines.
S           -- Set the selected object to the mouse position.
F           -- Jump to the selected item.
ARROWS      -- Move the selected items.

right-drag  -- Move the selected items. (SHIFT or ^)
middle-drag -- Pan the view.
^ wheel     -- Zoom.

Q           -- Zoom to zero.
A           -- Zoom in.
Z           -- Zoom out.
H           -- Jump to home position.
^H          -- Set the home position.


SHIFT F     -- Force a bit's value. (Again to flip.)
SHIFT A     -- Force a bit's ambiguity.  (Again to flip.)

M           -- Remark all of the bits.
SHIFT M     -- Update hex decoding and disassembly.
V           -- Run the Design Rule Checks.
SHIFT V     -- Clear the DRC violations.
E           -- Jump to next violation.

^Z          -- Undo
SHIFT ^Z    -- Redo

^S          -- Save changes.

When you first begin to mark bits, the software won't yet know the threshold between a one and a zero. You can configure this with View / Choose Bit Threshold.

Even the best bits won't all be perfectly marked, so use SHIFT+F to force bit values where you see that the software is wrong. SHIFT+A is similar, and marks a bit as being ambiguous or damaged. The DRC menu contains Design Rule Checks that will highlight problems in your project, such as weak bits or broken alignment.

If placing many lines becomes tedious, select a group with your left mouse button and duplicate the entire set with SHIFT+D. You can then drag it with the right mouse button to the new position, leaving another copy in the original position. If the framerate drops for this, use the TAB key to temporarily hide all bits, which greatly speeds up moving many lines in dense areas.

The crosshairs will adjust themselves to your most recently placed row and column. This should let them tilt a little to match the reality of your photographs.

After you have marked the bits and spot checked that they are accurate with DRC, run File/Export to dump them into ASCII for parsing with other tools, such as GatoROM, Bitviewer or ZorRom.

CLI Usage

In addition to the GUI, this tool has a command line interface that can be useful in scripting. Use the --help switch to see the latest parameters, and the --exit switch if you'd prefer the GUI not stay open for interactive use.

forum% maskromtool --help
Usage: maskromtool [options] image json
Mask ROM Tool

Options:
  -h, --help                 Displays help on commandline options.
  --help-all                 Displays help, including generic Qt options.
  -v, --version              Displays version information.
  -V, --verbose              Print verbose debugging messages.
  --stress                   Stress test bit marking.
  -e, --exit                 Exit after processing arguments.
  --disable-opengl           Disable OpenGL.
  --enable-opengl            Enable OpenGL.
  -d, --drc                  Run default Design Rule Checks.
  -D, --DRC                  Run all Design Rule Checks.
  --sampler <Default>        Bit Sampling Algorithm.
  --diff-ascii <file>        Compares against ASCII art, for finding errors.
  -a, --export-ascii <file>  Export ASCII bits.
  -o, --export <file>        Export ROM bytes.
  --export-histogram <file>  Export histogram.
  --export-csv <file>        Export CSV bits for use in Matlab or Excel.
  --export-json <file>       Export JSON bit positions.
  --export-python <file>     Export Python arrays.
  --export-photo <file>      Export a photograph.

Arguments:
  image                      ROM photograph to open.
  json                       JSON lines to open.

To run without a GUI, pass -platform offscreen. If the program crashes under Wayland, force Xorg usage by passing -platform xcb.

On Windows, it's awkward for an executable to have a GUI while retaining a log on the CLI. We solve this by producing two executables; please use maskromtool.exe for the GUI and maskromtoolcli.exe for the CLI.

A separate executable, gatorom, wraps the ROM bit decoder without the graphics. See GatoROM for details.

forum% gatorom 
Usage: gatorom [options] bitstream
Gato ROM: A Decoder for Mask ROM Bits

Options:
  -h, --help                        Displays help on commandline options.
  --help-all                        Displays help, including generic Qt
                                    options.
  -v, --version                     Displays version information.
  -V, --verbose                     Talk too much.
  -w, --wordsize <8>                Word size.bits
  -r, --rotate <degrees>            Rotates the image in multiples of 90
                                    degrees.
  --flipx                           Flips the bits along the X axis.
  --flipy                           Flips the bits along the Y axis.
  -i, --invert                      Inverts the bits.
  -o, --output <out.bin>            Output file.
  --random                          Randomize a ROM for testing.
  --Random                          Randomize a crazy ROM.
  --rawwidth, --seanriddle <width>  Width of a raw binary input, in Sean
                                    Riddle's style.
  -I, --info                        Info about input.
  -d, --dis <arch>                  Disassemble.
  --print                           Print with a GUI dialog.
  --printpdf <file.pdf>             Print to a PDF file.
  --decode-tlcs47font               Decodes as a TMP47C434N Font.
  --decode-z86x1                    Decodes as a Zilog Z86x1.
  --decode-cols-downl-swap          Decodes as a uCOM4 ROM.
  --decode-cols-downr               Decodes first down then right like a
                                    Gameboy.
  --decode-cols-downl               Decodes first down then left.
  --decode-cols-left                Decodes left-to-right.
  --decode-cols-right               Decodes right-to-left.
  --decode-squeeze-lr               Decodes even bits from the left, odd bits
                                    from right like in the TMS32C15.
  -z, --zorrom                      Zorrom compatibility mode, with flipx
                                    before rotation.
  --leftbank                        Only the left half of the bits.
  --rightbank                       Only the right half of the bits.
  -a, --print-bits                  Prints ASCII art of the transformed bits.
  -A, --print-pretty-bits           Prints ASCII art with spaces.
  --solve                           Solves for an unknown format.
  --solve-bytes <bytes>             Bytes as a hint to the solver.
                                    0:31,1:fe,2:ff
  --solve-ascii                     Look for ASCII strings.
  --solve-string <bytes>            Byte string as a hint to the solver.
                                    31,fe,ff
  --solve-yara <rule>               Yara rule file.
  --solve-set <prefix>              Exports all potential solutions.

Arguments:
  bitstream                         ASCII art of ROM to decode.

High Level Design

I've designed the GUI around a QGraphicsScene. The underlying data objects use the QT coordinate system, with floats for better-than-pixel precision.

After loading a ROM photograph, the user places Columns and Rows onto the photograph. Every intersection of a Column and a Row is considered to be a Bit, and a configurable color threshold determines the value of that Bit. Where the photograph is misread, you can also Force the bit to a known value.

Once all of the Bits have been marked and the Threshold chosen, the software will mark every light bit as Blue (0) and every dark bit as Red (1). These bits are then Aligned into linked lists of rows for export as ASCII, for use in other tools.

To identify errors, a set of Design Rule Checks (DRC) will critique the open project. While the primary interface is the GUI, a CLI is also available for scripting and testing.

Correcting Bit Errors

While a few thousand bits might be marked without an error, larger projects will inevitably need to manage their mistakes.

A good start is to use the DRC checks and careful configuration of the bit thresholds until no obvious errors remain. Then navigate the project and hit the tab key to show and hide the annotations, making sure that each bit is recognized properly.

When that is insufficient, such as for ROMs that are tens or hundreds of kilobits, it helps to annotate the same ROM multiple times, preferably from different photographs. Bit errors will happen in annotating each photograph, of course, but they will happen in different places. You can then use the --diff-ascii feature against the output of --export-ascii to compare images, reconciling their differences until all of your project files agree.

Sampling Algorithms

Most ROMs can be read simply by reading the color of a single pixel at the bit's center. For those, the Default sampling algorithm will work just fine.

Normal ROM Bits

For diffusion ROMs whose bits have been a little too delayered, the center of the bit does not have a unique color, but it is surrounded by slightly darker lines. The Wide algorithm will take the darkest color in each channel after sampling its size worth of bits in width, and Tall does the same but vertically.

Diffusion ROM Bits

Development

Patches and improvements to Mask ROM Tool are most welcome, but please do not spam the issue tracker with feature requests. Pull requests should be submitted through the Github page, and they should not entangle the project with dependencies upon third-party libraries.

The code is written in a conservative dialect of C++, with minimal use of advanced features. I've tried to comment the code and the class definitions thoroughly.

ROM Decoders

GatoROM is included as a command line decoder that solves for bit arrangements. Please see its own README file for CLI documentation, particularly for the solver methods that are not yet supported in the GUI.

Separately, GatoROM is used as a library for decoding within the MaskRomTool GUI. Use Edit/Decoding to define the decoding style and View/HexPreview to see a live decoding of the bits to hexadecimal.

Screenshot of MYK82 decoding.

From the decoder, you can highlight hex bytes and use View/Highlight Hex Selection to visualize the selected bytes. Here we see the first three words of the MYK82 ROM, which pack 32 bits into each position. Disassembly is also available when unidasm from MAME is in the path.

Screenshot of selected first three MYK82 words.

A scripted solver is also supported, in which simple masks or Yara rules describe the expected firmware. All matches are enumerated, and by jumping between them you can quickly decipher images that do not use interleving, row reversal, or other complications.

Screenshot of the Yara solver.

Related Tools

John McMaster's ZorRom is an excellent decoder and the inspiration for the decoding library in this tool.

Adam Laurie's RomPar might be the very first bit marking tool to be open sourced.

Chris Gerlinsky's Bitract is another open source tool for bit marking, and Bitviewer is his matching tool for decoding bits to bytes.

Peter Bosch's PLA Decode is a bit marking tool used for extracting old Intel microcode. See his Hardwear.io talk from 2020 for more details.

maskromtool's People

Contributors

ah-dl avatar ea avatar edgetriggered avatar lord-nightmare avatar stoneddiscord avatar travisgoodspeed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

maskromtool's Issues

Better Alignment Algorithm

The current alignment algorithm, RomAlignerNew works great when there's a little tilt to the image and overlap between rows is limited to a few bits in a row when sorted by the X axis. Images with no tilt at all, and images with more overlap, require that a threshold be set to calculate the appropriate number of bits that might arrive out of order in determining the first column.

Close this issue when we have a new alignment algorithm that does not require such fine tuning and works on all existing samples.

Background Threaded Updates

For small images, it's very convenient to redraw in the GUI thread. For larger images, this creates a lag that can become infuriating, as pending GUI updates queue behind one another rather than skipping the steps that will soon be deleted.

Moving updates into their own thread could dramatically improve the responsiveness of the GUI, if care is taken not to break the CLI. Maybe a unix-ish sync() function could write all pending updates, only as needed?

Offscreen OpenGL Warnings

In offscreen mode, the primary and secondary views cannot enable OpenGL. This doesn't break anything, but the warning messages are a little distracting. We can fix this by skipping the OpenGL enablement if the platform is offscreen.

air% maskromtool msp430f149.bmp -a msp430f149.txt -platform offscreen -e -d
QOpenGLWidget is not supported on this platform.
QOpenGLWidget is not supported on this platform.
This plugin does not support createPlatformOpenGLContext!
This plugin does not support createPlatformOpenGLContext!
QOpenGLWidget: Failed to create context
Exporting to ASCII.
air% 

Image Tearing in Windows

Shown in the image below, windows sometimes tears when panning under Microsoft Windows. The image is restored by resetting the zoom on the keyboard.

image

First observed on this Intel NUC.

Processor	11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz   2.42 GHz
Installed RAM	16.0 GB (15.7 GB usable)
Device ID	B6C0D57E-B14A-4A46-94AD-519A2671BE3A
Product ID	00330-54283-81039-AAOEM
System type	64-bit operating system, x64-based processor
Pen and touch	No pen or touch input is available for this display
Edition	Windows 11 Pro
Version	22H2
Installed on	‎2023-‎07-‎18
OS build	22621.1992
Experience	Windows Feature Experience Pack 1000.22644.1000.0

Performance Test

Performance is decently fast, but it can be a little frustrating in projects of hundreds of thousands of bits. A performance test would allow us to judge algorithmic improvements and scale to millions of bits.

Selectable SKIPCOUNTTHRESHOLD

Currently the SKIPCOUNTTHRESHOLD definition in romalignernew.cpp defines how many pixels can be found out of order before the first column. It is also a source of confusing bugs, because if the first two columns do not overlap, but instead form a \/ or /\, there will be no skipped bits between real bits and the algorithm might be confused.

Close this issue when the threshold is selectable. 5 should be a decent default.

Home Key Combo

Close this issue when:

  • Pressing H will jump to a home location.
  • Pressing Shift+H will assign a new home location.

Printing

When GatoROM can't solve a ROM, it would be handy to print the bits to paper for manual exploration. Close this ticket when we have QT Printing support for printing the ASCII art to a single page.

Printing an image might also be handy, but that's not tracked by this issue.

Windows Release Builds

A release copy for Windows would be handy, as many Windows users aren't comfortable compiling C++ code. Use this issue to track its builds and close when it's decently repeatable.

Selecting Image Error Windows

Describe the bug
I can run your Mask ROM Tool by compiling it through QT Creator.
However, when clicking File -> Open ROM I cannot select any .bmp image. It does not show the file in the file explorer.
You have to type the file name in manually to load up the image.

To Reproduce

  1. Clicking File -> Open ROM

Expected behavior
You should be able to select/see the files in the file explorer

Screenshots
Screenshot 2022-10-17 140549 (1)

Desktop (please complete the following information):

  • Windows 10

ARM6 / MYK82 Decoder

It would be nice to have built in support for decoding the MYK82 ROM.

Here's a rough python script.

#!/usr/bin/env python3

from rom10 import bits;


### This is a partial decoder by Travis Goodspeed for the MYK82 ROM.
### As things stand, rows of 16 words (512 bits) are properly decoded.

### Output is a nasm source file, describing the row numbers and 32-bit words.

lastrow=-1
def fetchword(adr):
    """Fetches a 32-bit word from an aligned address."""
    global lastrow
    
    wordadr=adr>>2
    row=wordadr>>4;

    word=0
    for majorcolumn in range(0,32):
        # There are sixteen pairs of major columns.  If you look
        # closely as rom10.bmp, you can see that the three right most
        # bits are almost always set, because most ARM instructions
        # begin with 0xE.
        biti=31-majorcolumn
        # Like the bits being MSBit on the right,
        # the words count in from the right.
        wordi=0xF-((wordadr&0xF))  
        word=word<<1;
        word|= bits[row][16*biti+wordi];

    if row!=lastrow:
        print(";; Row %d"%row);
        lastrow=row;
    return word;

Annotations

It would be nice to add text annotations of a selectable color, so that features can be explained within the project rather than in scattered screenshots.

Adjustable Line Colors

The default color scheme works will on brightfield microscopy but is difficult to see in darkfield. Close this issue when the colors are adjustable.

Wayland Support

Running in Wayland mode makes the program very unstable, and users are forced to fall back to X11 mode by passing -platform xcb on the CLI. You can repeat the crash by opening a large project file and holding the Tab button to rapidly show and hide all of the bits.

Close this issue when Wayland is stable.

Crash after running DRC with deleted bits.

The tool will crash if you first delete a line and then hit V to run the DRC rules. This was probably introduced with performance optimizations.

We can fix this by running markBits() before the DRC rules. That's probably more stable than carefully maintaining the the dirty status of the alignment.

GatoROM::fromDescription(QString)

The GatoROM class contains a description() method that returns a QString of the configured parameters, suitable for use on the CLI. What we don't yet have, but sorely need, is a method to configure a GatoROM instance from such a string, to facility loading and saving in the GUI.

Drift-Tolerant Sampling

Absolute thresholds usually work well for Diffusion and Via ROMs, but sometimes focal drift or the chemical etching drift of an Implant ROM means that one region of the image will decode better than others.

Close this issue when the program supports comparing a bit to a rolling average of recent bits, matching it to either a one or a zero by relative rather than absolute thresholds.

Prominently Display Size

I screwed up decoding the MYK82 ROM for about a week because I was only reading half the words on each row. Close this issue when we have this added to the status line, so I don't make such mistakes in the future.

GatoROM GUI Integration

Now that libraries have been integrated with #42, let's use this issue to track adjustments to integrate it into the GUI.

  • Settings for GatoROM maintained in .json.
  • Search GUI.
  • Hex GUI.
  • Visualizing bits in the main display.

Missing CMake install target

Running cmake --install or make install does not perform any actions due to a missing install section in CMakeLists.txt.

OpenGL by Default

Now that OpenGL is enabled, and on some machines faster or more stable, we should make it the default.

Grid Object

Currently the bits are marked by the intersection of row and column lines. It would reduce the operator's labor to be able to draw grids, marking many evenly spaced rows and columns in a single burst.

Note that the grid will not exclude row and column markings. They may be mixed.

Overview Windows / Dual Screen

An operator can sometimes get lost within a large project file, and it would be handy to have a small view on the side of the whole project, so that high level navigation can occur without adjusting the zoom.

  • Second view is visible.
  • Keyboard presses apply to both.
  • Crosshairs extend through both views, not just the active one.

Windows CLI/GUI Separation

On Windows, a PE file includes a flag to describe whether it is a console or a GUI application. Close this issue when our CMakefile has been modified to produce two executables on windows, one that blocks for the CLI and one that launches as a GUI application.

Open Recent

Users launching the GUI directly would like to be able to re-open the most recent project file. Close this issue when that exists in the File menu.

Gatorom Integration

Gatorom is a CLI tool and C++ library that I've written for decoding bitstreams into logical bytes, something of a friendly competitor to Zorrom. We'll use this issue to track its inclusion into MaskRomTool's git repository and binary distributions.

  • Code
  • Documentation
  • Tests
  • Binaries on macOS.
  • Binaries on Windows.
  • Binaries on Linux.
  • Library integration to MRT.

Very large images fail to load.

Very large files, those over one gigabyte, fail to load. That's more than we need for many ROMs, but will become inconvenient at some point.

Faster Alignment Strategy

The alignment strategy implemented in RomAlignerDefault is accurate, but it takes many seconds on large project files. Close this issue when faster strategies are available for selection and a test case to compare the alignment of a large project between two strategies.

GatoROM: Sean Riddle's Raw Format

Sean Riddle has an excellent collection of decapsulated ROMs from old video games, but he shares the dumps as binary files rather than the ASCII art that others have standardized on. Use this issue to track support for his format.

Some details and a Python decoder can be found in Zorrom.

Missing DLLs on Windows

Running the application on Windows requires the Visual Studio redistributable package. Without it, the following error will pop up when the app has been built with Visual Studio 2022 and installed on a brand new machine. This is difficult to reproduce on a development machine because, of course, that machine will already have its own Visual Studio installed.

image

We can fix this by either:

  1. Linking to the latest redistributable package; or,
  2. Including concrt140.dll, msvcp140.dll, vccorlib140.dll, and vcruntime140.dll and perhaps some others when buildrelease.bat builds the package.

Highlight Selections

It's currently difficult to tell which item is selected before operating on it. Close this issue when we have a visual indicator, such as a highlight box or changing the color of the lines.

Very Small ROMs

Describe the bug
The alignment algorithm fails when there are a very small number of bits marked on the screen.

To Reproduce
Steps to reproduce the behavior:

  1. Mark the first eight columns and eight rows of any ROM.
  2. Export to ASCII.
  3. The export will not show the proper number of rows and columns.

Expected behavior
We expect that eight columns and eight rows will be identified, instead of the mismash that are. Larger ROMs are not affected.

Screenshots

Screenshot 2023-03-20 at 12 16 49

Fast Line Removal, Movement

A performance test recently showed that 73% of time in a tight markBits() loop was spent in QGraphicsScenePrivate::removeItemHelper. We could therefore dramatically improve performance by only removing those bits on a line when moving it, rather than regenerating all bits.

Similarly, when we move a line, we can simply cut all of its bits and then recreate them in the new position. This will be much faster than removing all bits to regenerate them.

Bit Inversion

Close this issue when we have a convenient setting to choose whether the bits are inverted. Specifically, I need this for some photos of the MYK82.

Missing Fonts in Offscreen Environment on macOS

Qt contains a "best effort" model for adjusting the internal font when none is available in the GUI. This way if we don't have a font, a similar font will be selected, and no one but a graphic designer ought to care. This works well enough in GUI mode.

When running in CLI mode, many users add -platform offscreen -e to prevent any windows from opening and to exit when the program is done. On macOS, this has the unintended side effect of preventing the font substitution code in Qt from caching the replacement font, resulting in warning messages like this one.

qt.qpa.fonts: Populating font family aliases took 444 ms. Replace uses of
missing font family "Sans Serif" with one that exists to avoid this cost. 

The fix is simple: Just define a macOS font if none exists in offline mode.

Log Scale Color Histograms

Linear bit histograms work great for ROMs, in which ones and zeroes occur with roughly equal quantity, but it's a rather poor way to view HAL logic arrays, in which ones are rather rare and zeroes are plentiful. Close this ticket when we have a checkbox to view the histogram on a log scale, where the difference is less troublesome.

OpenGL Support

We currently have the beginnings of support for OpenGL, but it is not yet useful. Close this issue when we've fixed the following OpenGL bugs:

  • Large background images become black in OpenGL.
  • The crosshairs cease to move in OpenGL mode.
  • Zooming out makes sections of row and column lines become invisible in OpenGL mode.

RGB Export

Statistical analysis of the pixel values might be interesting. Close this issue when we can export the bit RGB values.

Tall Sampler

Our wide sampler is quite effective on diffusion ROMs that need it. Close this issue when we have a tall sampler as well.

Error Diffs

After annotating a ROM, it's nice to know that the bits are correct. One way to do that is to have two projects, and to compare them, correcting disagreeing bits until all of them match.

Close this issue when we support that in the GUI and in the CLI.

GATOROM: uCOM4 Bit Format

NEC's uCOM4 chips use a custom format which is much like cols-downl except that every other pair of pages is swapped. Close this issue when it has been implemented and we have a passing test case for Fabulous Fred.

  • Fabulous Fred Decodes
  • uCOM4 binaries are solved.
  • Module is cleaned and parameterized.

Adjustable Sample Point Sizes

We currently sample just one pixel for each bit. This is surprisingly effective but some, particularly diffusion ROMs under good focus and magnification, require other sampling methods.

Close this issue when we can adjust the sample size, perhaps with some choices as to how the colors of the sample spot are merged.

Item Translations (Sliding)

Marking a row or column just a little bit off with make the bits unreadable, and users often need to translate the position of the object just a little bit. Currently this is done by using the S key to Set the position to where the mouse is, but that can be convenient for very long lines or when the far end of the line is the anchor point.

Close this issue when three new methods of translation are available:

  • Three fingered drag on a trackpad.
  • Right-click drag with a mouse.
  • Keyboard steps.

Reload Slop from Saved File

Many projects have identical slopes for every row or column. While we can't choose the best slope when reopening, in these files it might suffice to re-use the first row or column's tilt as the default for all other lines.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.