Fubukimaru / asMSX

AsMSX, originally developed by Pitpan. More info: https://www.msx.org/wiki/AsMSX.
GNU General Public License v3.0
68 stars 9 forks source link

Custom output file #132

Open duhow opened 2 weeks ago

duhow commented 2 weeks ago

Describe the solution you'd like Add an argument to asmsx to generate another filename. All generated artifacts (SYM, TXT, ROM) must have this name as well.

This supersedes .FILE command.

Example:

asmsx test.asm -o MegaGame.Rom
# extract extension if present, and apply only to ROM, not to TXT/SYM. Other files must be named 

Describe alternatives you've considered

Additional context

Fubukimaru commented 1 week ago

Add test for file with extension (case-sensitive), and without ext

Do you expect for example the following commands to be functional?

asmsx test.asm -o MegaGame.Rom
asmsx test.asm -o MegaGame

The extension is currently being inserted in the write_bin function as it can be determined by some pseudoinstructions found in the code (e.g., ROM pseudo).

Making the second work would be easy. The first one might be trickier.

Also, if you say -o whatever.rom but inside you have the command to make a .com. Should it complain?

duhow commented 1 week ago

People may (wrongly) provide output file with or without extension, but it can also happen that any extension is provided, so we can't discard it...

asmsx test.asm -o MyGame.es
# don't remove extension, as we want MyGame.es.rom

So either we define any input as FILENAME, or we can skip certain / specific extension suffix.