1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-07-07 07:28:57 +00:00
6502bench/SourceGen/Examples
Andy McFadden fac2d6a51f Invoke extension scripts when labels they care about change
We were failing to update properly when a label changed if the label
was one that a plugin cared about.  The problem is that a label
add/remove operation skips the code analysis, and a label edit skips
everything but the display update.  Plugins only run during the code
analysis pass, so changes weren't being reflected in the display
list until something caused it to refresh.

The solution is to ask the plugin if the label being changed is one
that it cares about.  This allows the plugin to use the same
wildcard-match logic that it uses elsewhere.

For efficiency, and to reduce clutter in plugins that don't care
about symbols, a new interface class has been created to handle the
"here are the symbols" call and the "do you care about this label"
call.

The program in Examples/Scripts has been updated to show a very
simple single-call plugin and a slightly more complex multi-call
plugin.
2019-10-13 18:32:53 -07:00
..
A2-Amper-fdraw Changed naming convention in Applesoft/F8-ROM symbol files 2019-09-16 16:58:32 -07:00
A2-HP-CDA Initial file commit 2018-09-28 10:05:11 -07:00
A2-lz4fh Add inline string script sample 2019-10-08 10:44:49 -07:00
A2-Zippy Add inline string script sample 2019-10-08 10:44:49 -07:00
Scripts Invoke extension scripts when labels they care about change 2019-10-13 18:32:53 -07:00
Tutorial Add advanced tutorial 2018-10-09 14:55:16 -07:00
README.md Add inline string script sample 2019-10-08 10:44:49 -07:00

SourceGen Examples

These are some sample projects you can play with. The binaries are accompanied by the original source code, so you can compare the SourceGen project to the original.

  • Tutorial: simples project, intended for use with the tutorial in the manual.
  • Scripts: extension script samples.
  • A2-lz4fh: two functions for unpacking a simplified form of LZ4 compression. One is 6502, the other is 65816. This is pretty straightforward. (Full project)
  • A2-Amper-fdraw: 6502 code that provides an Applesoft BASIC interface to a machine-language graphics library. The public interface of the graphics library is defined in a .sym65 file. This example has multiple entry points in a jump table, and requires a bit more effort. (Full project)
  • A2-Zippy: a program for controlling an Apple IIgs CPU accelerator card. 65816 sources, with a little bit of ProDOS 8 and IIgs toolbox usage. Demonstrates how extension scripts are used during analysis. (Full project)
  • A2-HP-CDA: HardPressed Classic Desk Accessory. This is 65816 code in OMF loader format, which SourceGen doesn't support, so it's a little rough. (This is chiefly here to answer the question, "what does it look like when you disassemble OMF binaries?") (Full project)

(You may be wondering why some of the example files have filenames with things like "#061d60" in them. It's a method of preserving the file type for Apple II files used by some utilities. The potential advantage for disassembly is that the file type often determines the load address, possibly removing some initial guesswork.)