mirror of
https://github.com/fadden/6502bench.git
synced 2025-01-14 07:29:44 +00:00
Eliminate duplicate function
This commit is contained in:
parent
32d1147eec
commit
2fa5fdc237
@ -309,22 +309,6 @@ namespace SourceGen.AsmGen {
|
||||
}
|
||||
}
|
||||
|
||||
private CharEncoding.Encoding FormatDescriptorToCharEncoding(FormatDescriptor dfd) {
|
||||
switch (dfd.FormatSubType) {
|
||||
case FormatDescriptor.SubType.Ascii:
|
||||
return CharEncoding.Encoding.Ascii;
|
||||
case FormatDescriptor.SubType.HighAscii:
|
||||
return CharEncoding.Encoding.HighAscii;
|
||||
case FormatDescriptor.SubType.C64Petscii:
|
||||
return CharEncoding.Encoding.C64Petscii;
|
||||
case FormatDescriptor.SubType.C64Screen:
|
||||
return CharEncoding.Encoding.C64ScreenCode;
|
||||
case FormatDescriptor.SubType.ASCII_GENERIC:
|
||||
default:
|
||||
return CharEncoding.Encoding.Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
// IGenerator
|
||||
public string ModifyOpcode(int offset, OpDef op) {
|
||||
if (op.IsUndocumented) {
|
||||
@ -358,7 +342,7 @@ namespace SourceGen.AsmGen {
|
||||
|
||||
// IGenerator
|
||||
public void UpdateCharacterEncoding(FormatDescriptor dfd) {
|
||||
CharEncoding.Encoding newEnc = FormatDescriptorToCharEncoding(dfd);
|
||||
CharEncoding.Encoding newEnc = PseudoOp.SubTypeToEnc(dfd.FormatSubType);
|
||||
if (newEnc == CharEncoding.Encoding.Unknown) {
|
||||
// probably not a character operand
|
||||
return;
|
||||
|
@ -499,6 +499,12 @@ namespace SourceGen {
|
||||
HasHashPrefix, // operand has a leading '#', avoiding ambiguity in some cases
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a FormatDescriptor SubType to a CharEncoding.Encoding value.
|
||||
/// </summary>
|
||||
/// <param name="subType">FormatDescriptor sub-type.</param>
|
||||
/// <returns>The corresponding CharEncoding.Encoding value, or Encoding.Unknown
|
||||
/// if the sub-type isn't a character encoding.</returns>
|
||||
public static CharEncoding.Encoding SubTypeToEnc(FormatDescriptor.SubType subType) {
|
||||
switch (subType) {
|
||||
case FormatDescriptor.SubType.Ascii:
|
||||
|
Loading…
x
Reference in New Issue
Block a user