private Project Setup(IAddRomDataCommand romAddCmd)
    {
        Debug.Assert(beforeAddRun);

        // we're called now after the romBytes have been loaded and all other checks are clear.
        romAddCmd.ShouldProjectCartTitleMatchRomBytes = previousCartTitleMatchState;

        return(romAddCmd.Root?.Project);
    }
    public void OnLoadingBeforeAddLinkedRom(IAddRomDataCommand romAddCmd)
    {
        // this will have the loader skip checking the cart title name.
        // we'll down our own check later.
        previousCartTitleMatchState = romAddCmd.ShouldProjectCartTitleMatchRomBytes;
        romAddCmd.ShouldProjectCartTitleMatchRomBytes = false;

        beforeAddRun = true;
    }
    public void OnLoadingAfterAddLinkedRom(IAddRomDataCommand romAddCmd)
    {
        var project = Setup(romAddCmd);

        if (!IsMitigationNeeded(project))
        {
            return;
        }

        ApplyMitigation(project);
    }