go-studybox/script
Zorchenhimer 193ce21297
[script] Rework CDL & Label stuff
Labels are now in a json file instead of a dumb custom format.  This
should make things easier to maintain, both in code and data.  Address
values are in hexadecimal format inside strings.

The CDL handling has been cleaned up a bit.  Internally, all the values
are indexed by CPU address instead of by file offset.  This is done
because it seems that *all* of the tapes put *all* of their scripts
starting at $6000.  The only difference between locations is the bank ID
used.  An offset of +/-0x6000 has been added in a bunch of places to keep
the index values in CPU address space.

Additionally, setting CDL data for Data has been fixed.  This includes
creating tokens for Unknown and Data bytes so they can be output in the
source.  They will have a label of either "UNKN" or "DATA" in the
bytecode column.

Some smaller things:
- EntryPoints array is now in the CDL, allowing to add more starting
  points for SmartParse().
- script-decode.go now accepts a --no-addr-prefix to suppress the
  address output on the beginning of each line of script.  This enables
  diffing scripts and having the output mean something.
- `push_data` string has been tweaked.  Instead of using %q for
  everything, we build a string from scratch.  If there are no bytes
  outside of the ASCII printable character range just print the ASCII.
  Otherwise, print out the hex value for every byte.  If an individual
  byte is printable ASCII, print that charater in curly brackets.
- Label files will be updated with auto-generated labels.
- Provding a non-existent filename for labels or CDL will print a
  warning, but will write out a file if no other errors occur.
- Added DebugCDL() that will write the raw CDL values to a file.  This
  enables comparing the CDL values directly to the script binary.
- Added newlines after `long_return` and `long_jump`
2025-09-21 22:26:59 -04:00
..
cdl.go [script] Rework CDL & Label stuff 2025-09-21 22:26:59 -04:00
instructions.go [script] Update Op Codes 2025-09-21 17:23:13 -04:00
labels.go [script] Rework CDL & Label stuff 2025-09-21 22:26:59 -04:00
parser.go [script] Rework CDL & Label stuff 2025-09-21 22:26:59 -04:00
script.go [script] Rework CDL & Label stuff 2025-09-21 22:26:59 -04:00
stats.go [script] Move InstrStat to script/stats.go 2025-09-13 14:03:45 -04:00
tokens.go [script] Rework CDL & Label stuff 2025-09-21 22:26:59 -04:00
values.go Initial commit 2024-04-27 15:19:14 -04:00