1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-07-14 20:28:59 +00:00
6502bench/SourceGen/RuntimeData
Andy McFadden 0fc121c9cb Add ability to "erase" previously-defined platform symbols
While disassembling some code I found that I wanted the ROM entry
points, but the zero page usage was significantly different and the
ROM labels were distracting.  Splitting the symbol file in two was
a possibility, but I'm afraid this will lead to a very large
collection of very small files, and we'll lose any sense of relation
between the ROM entry points and the ZP addresses used to pass
arguments.

Platform symbols have the lowest priority when resolving by address,
but using that to hide the unwanted labels requires creating project
symbols or local variables for things that you might not know what
they do yet.  It's possible to hide a platform symbol by adding
another symbol with the same label and an invalid value.

This change formalizes and extends the "hiding" of platform symbols
to full erasure, so that they don't clutter up the symbol table.
This also tightens up the platform symbol parser to only accept
values in the range 0 <= value <= 0x00ffffff (24-bit positive
integers).

An "F8-ROM-nozp" symbol file is now part of the standard set.  A
project can include that to erase the zero-page definitions.

(I'm not entirely convinced this is the right approach, so I'm not
doing this treatment on other symbol files... consider this an
experiment.  Another approach would be some sort of conditional
inclusion, or perhaps erase-by-tag, but that requires some UI work
in the app to define what you want included or excluded.)
2019-10-27 11:09:16 -07:00
..
Apple Add ability to "erase" previously-defined platform symbols 2019-10-27 11:09:16 -07:00
Atari External symbol I/O direction and address mask, part 2 2019-10-16 14:55:10 -07:00
Commodore Add a C128 Kernal entry point list 2018-10-11 10:46:47 -07:00
Help Add ability to "erase" previously-defined platform symbols 2019-10-27 11:09:16 -07:00
Nintendo Initial file commit 2018-09-28 10:05:11 -07:00
TestData Initial file commit 2018-09-28 10:05:11 -07:00
ExportTemplate.html Minor updates 2019-10-25 18:16:09 -07:00
LegalStuff.txt Initial file commit 2018-09-28 10:05:11 -07:00
README.md Add default text encoding mode to system definition 2019-08-14 18:03:40 -07:00
RuntimeData.csproj Initial file commit 2018-09-28 10:05:11 -07:00
SGStyle.css Make links less distracting in HTML output 2019-09-22 16:45:08 -07:00
SystemDefs.json Add Apple-1 symbols 2019-10-26 08:28:49 -07:00

Runtime Data

Symbol files and analyzer scripts are split into directories by platform manufacturer.

The Visual Studio project (RuntimeData.csproj) exists so you can edit scripts with IntelliSense and error highlighting. Everything here is distributed as source, not in compiled form; all compilation occurs at run time.

SystemDefs.json

This file defines the systems available in the "new project" screen. The following fields are mandatory:

  • Name - Short name that identifies the system.
  • GroupName - Short string used to group common items together in the UI.
  • CPU - Type of CPU used. The string must be part of the known set (see CpuDef.cs)
  • Speed - Clock rate, in MHz, of the CPU on the system. When multiple speeds are possible, use the most common, favoring NTSC over PAL.
  • SymbolFiles - List of platform symbol file identifiers (see below).
  • ExtensionScripts - List of extension script file identifiers (see below).
  • Parameters - List of optional parameters (see below).

The currently-supported parameters are:

  • load-address=<addr> - Specify the initial load address. The default is 0x1000.
  • entry-flags=<flag-set> - Specify the processor status flag values to use at entry points. This is intended for use on the 65802/65816, and may be one of "emulation", "native-short", and "native-long". The default is "emulation".
  • undocumented-opcodes={true|false} - Enable or disable undocumented opcodes. They are disabled by default.
  • first-word-is-load-addr={true|false} - If true, the first two bytes of the file contain the load address.
  • default-text-encoding=<mode> - Specify default character encoding. Use "c64-petscii" for PETSCII. The default is low/high ASCII.

All of these things can be changed after the project has begun, but it's nice to have them configured in advance.

SymbolFiles and ExtensionScripts use file identifiers, which look like "RT:Apple/ProDOS8.sym65". The "RT:" means that the file lives in the RuntimeData directory, and the rest is a partial pathname. Files that live in the same directory as the project file are prefixed with "PROJ:". All symbol files and extension scripts must live in the RuntimeData directory or project file directory, or they will not be loaded.

All "RT:" identifier paths are relative to the RuntimeData directory. The Group Name is not automatically added.

Platform Symbol Files and Extension Scripts

These are described in the "Advanced Topics" section of the manual (here).

Misc Files

LegalStuff.txt, Logo.png, and AboutImage.png are displayed by SourceGen, on the start screen and the About box.