Skip to content

Commit 2319d4e

Browse files
Add: 68k support (no opcode size fallback yet, but feature complete)
1 parent 21d46d8 commit 2319d4e

File tree

6 files changed

+3947
-1514
lines changed

6 files changed

+3947
-1514
lines changed

C64Models/Parser/ASMFileParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8968,7 +8968,7 @@ private void AppendOpcodeValue( LineInfo Info, ulong ResultingOpcodePatchValue )
89688968
int insertPos = 0;
89698969
if ( Info.Opcode.UpperU64OpcodeValue != 0 )
89708970
{
8971-
int numBytes = RequiredNumberOfBytes( Info.Opcode.UpperU64OpcodeValue );
8971+
int numBytes = Info.Opcode.OpcodeSize - 8;// RequiredNumberOfBytes( Info.Opcode.UpperU64OpcodeValue );
89728972
ulong workValue = Info.Opcode.UpperU64OpcodeValue;
89738973
insertPos = 8;
89748974

C64Models/Processors/Processor.68K.cs

Lines changed: 2002 additions & 388 deletions
Large diffs are not rendered by default.

C64Studio/Documents/SourceASMEx.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4141,11 +4141,14 @@ internal int DetermineNumberOfMacroArguments( int LineIndex, int SourcePosition
41414141
int charPos = editSource.PositionToPlace( SourcePosition ).iChar;
41424142

41434143
var tokens = Parser.PrepareLineTokens( editSource.Lines[LineIndex], new GR.Collections.Map<byte, byte>() );
4144-
var currentToken = tokens.FirstOrDefault( t => ( t.StartPos <= charPos ) && ( charPos < t.StartPos + t.Length ) );
4145-
if ( currentToken != null )
4144+
if ( tokens != null )
41464145
{
4147-
int tokenIndexOfMacro = tokens.IndexOf( currentToken );
4148-
return Parser.EstimateNumberOfParameters( tokens, tokenIndexOfMacro + 1, tokens.Count - tokenIndexOfMacro - 1 );
4146+
var currentToken = tokens.FirstOrDefault( t => ( t.StartPos <= charPos ) && ( charPos < t.StartPos + t.Length ) );
4147+
if ( currentToken != null )
4148+
{
4149+
int tokenIndexOfMacro = tokens.IndexOf( currentToken );
4150+
return Parser.EstimateNumberOfParameters( tokens, tokenIndexOfMacro + 1, tokens.Count - tokenIndexOfMacro - 1 );
4151+
}
41494152
}
41504153
return -1;
41514154
}

FastColoredTextBox/Commands.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,8 @@ internal static void InsertText( string insertedText, TextSource ts, bool Column
526526
InsertCharCommand.InsertChar( c, ref cc, ts );
527527
}
528528
}
529-
ts.NeedRecalc( new TextSource.TextChangedEventArgs( 0, lines.Length - 1 ) );
530-
endPos = new Place( maxEnd, tb.Selection.Start.iLine - 1 );
529+
ts.NeedRecalc( new TextSource.TextChangedEventArgs( 0, lines.Length ) );
530+
endPos = new Place( maxEnd, tb.Selection.Start.iLine );
531531
startPos = origStartPos;
532532
tb.Selection.Start = new Place( maxEnd, endPos.iLine );
533533
}

0 commit comments

Comments
 (0)