1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-11-26 21:49:45 +00:00
6502bench/SourceGen/SGTestData/2011-hinting.cs
Andy McFadden 0616e4e4a4 Define interfaces for inline call handlers and BRK
Instead of providing no-op CheckJsr/CheckJsl, plugins now declare
which calls they support by defining interfaces on the plugin class.

I added a CheckBrk call for code like Apple /// SOS calls, which
use BRK as an OS call mechanism.  The formatting doesn't work quite
right yet because I've been treating BRK as a two-byte instruction.
Hardly anything else does, and I think it's time I stopped (but not
in this commit).

Note: THIS BREAKS ALL PLUGINS that use the inline JSR/JSL feature,
which is pretty much all of them.
2019-08-02 16:06:27 -07:00

37 lines
1.1 KiB
C#

// Copyright 2018 faddenSoft. All Rights Reserved.
// See the LICENSE.txt file for distribution terms (Apache 2.0).
using System;
using System.Collections.Generic;
using PluginCommon;
namespace RuntimeData.Test2011 {
public class Test2011 : MarshalByRefObject, IPlugin, IPlugin_InlineJsr {
private IApplication mAppRef;
private byte[] mFileData;
public string Identifier {
get {
return "Test 2011-hinting";
}
}
public void Prepare(IApplication appRef, byte[] fileData, List<PlatSym> platSyms) {
mAppRef = appRef;
mFileData = fileData;
mAppRef.DebugLog("Test2011(id=" + AppDomain.CurrentDomain.Id + "): prepare()");
}
public void CheckJsr(int offset, out bool noContinue) {
noContinue = false;
if (offset + 7 < mFileData.Length &&
mFileData[offset + 1] == 0x56 && mFileData[offset + 2] == 0x24) {
mAppRef.SetInlineDataFormat(offset + 3, 4, DataType.NumericLE,
DataSubType.None, null);
}
}
}
}