protected override string Generate(int offset, int length) { // what we're given: a PC offset in ROM. // what we need to find: any labels (SNES addresses) that refer to it. // // i.e. given that we are at PC offset = 0, // we find valid SNES offsets mirrored of 0xC08000 and 0x808000 which both refer to the same place // // TODO: we may still need to deal with that mirroring here // TODO: eventually, support multiple labels tagging the same address, it may not always be just one. var snesAddress = Data.ConvertPCtoSnes(offset); var label = Data.Labels.GetLabelName(snesAddress); if (label == null) { return(""); } LogCreator.OnLabelVisited(snesAddress); var noColon = label.Length == 0 || label[0] == '-' || label[0] == '+'; var str = $"{label}{(noColon ? "" : ":")}"; return(Util.LeftAlign(length, str)); }