Skip to content

Add more new stuff to c2ea (again)#11

Open
StanHash wants to merge 6 commits intomasterfrom
c2ea-rewrite-process
Open

Add more new stuff to c2ea (again)#11
StanHash wants to merge 6 commits intomasterfrom
c2ea-rewrite-process

Conversation

@StanHash
Copy link
Member

Stuff

  • add -q/--quiet command line option. With this option, c2ea won't print anything unless an error occured (more specifically it won't print "Wrote to x.event" for each file), and also won't prompt the user for input when it's done.
  • add --no-definitions command line option. With this option, c2ea won't add the #include "Table Definitions.txt" line to the master installer.
  • rewrote most of the process function to be cleaner and more robust (hopefully).
    • some parts of it have been moved to new other functions (such as generating the macro definition)
    • identifier generation from filenames is now better.
    • the handling of cell content has been made (hopefully) clearer, and each case should be handled properly (?)
      • cells that contain non-numbers are now either automatically put into parenthesis (so that the content is guaranteed to not interfere with adjacent cells) or reported as errored (in case the corresponding nmm entry doesn't allow for more complex expressions).
    • better errors! When encountering certain errors, c2ea will output the csv file, row and column of the problematic cell.
      • If we find other uncaught errors later, we can add in a better diagnosis using the same setup.
  • fixed a typo in help message.

This has been tested on the latest skill system and on VBA-BT; without apparent changes (checksums match).

New features have been tested individually and seem to work.

Future Plans

Maybe decouple the EA stuff and the generic table stuff by having process interface with an opaque object that manages formatting for EA? That way, we can reuse this to be able to target multiple output formats (such as asm? or maybe zahl's new thing? idk).

New Help

usage: c2ea.py [-h] [-q] [-csv CSV] [-nmm NMM] [-out OUT] [-folder FOLDER]
               [-installer INSTALLER] [--no-definitions]
               [rom]

Convert CSV file(s) to EA events using NMM file(s) as reference. Defaults to
looking for CSVs in the current directory. You can specify a directory to look
in using -folder, or you can switch to processing singles CSVs using -csv.

positional arguments:
  rom                   reference ROM (for pointer searching)

optional arguments:
  -h, --help            show this help message and exit
  -q, --quiet           disables console output
  -csv CSV              CSV for single csv processing
  -nmm NMM              (use with -csv) reference NMM (default:
                        [CSVFile]:.csv=.nmm)
  -out OUT              (use with -csv) output event (default:
                        [CSVFile]:.csv=.event)
  -folder FOLDER        folder to look for csvs in
  -installer INSTALLER  output installer event (default: [Folder]/Table
                        Installer.event)
  --no-definitions      disables installer including "Table Definitions.txt"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant