diff --git a/build.sh b/build.sh index afa4748..3c15a93 100755 --- a/build.sh +++ b/build.sh @@ -36,8 +36,7 @@ fi if [ "${1}" = '--install' ]; then - cp bin/uxn11 bin/uxn11 - cp bin/uxnemu bin/uxnasm bin/uxncli $HOME/bin/ + cp bin/uxn11 bin/uxnasm bin/uxncli $HOME/bin/ fi # bin/uxnasm etc/polycat.tal bin/polycat.rom @@ -48,11 +47,13 @@ if [ "${1}" = '--norun' ]; then exit; fi # Test usage +./bin/uxnasm ./bin/uxncli ./bin/uxn11 # Test version +./bin/uxnasm -v ./bin/uxncli -v ./bin/uxn11 -v diff --git a/src/uxn11.c b/src/uxn11.c index beca53e..2ee9aff 100644 --- a/src/uxn11.c +++ b/src/uxn11.c @@ -207,7 +207,7 @@ main(int argc, char **argv) struct pollfd fds[3]; static const struct itimerspec screen_tspec = {{0, 16666666}, {0, 16666666}}; if(i == argc) - return system_error("usage", "uxn11 [-v][-2x][-3x] file.rom [args...]"); + return system_error("usage", "uxn11 [-v] file.rom [args...]"); /* Connect Varvara */ system_connect(0x0, SYSTEM_VERSION, SYSTEM_DEIMASK, SYSTEM_DEOMASK); system_connect(0x1, CONSOLE_VERSION, CONSOLE_DEIMASK, CONSOLE_DEOMASK); @@ -221,8 +221,6 @@ main(int argc, char **argv) if(argv[i][0] == '-' && argv[i][1] == 'v') return system_version("Uxn11 - Graphical Varvara Emulator", "8 Aug 2023"); - - rom_path = argv[1]; if(!uxn_boot(&u, (Uint8 *)calloc(0x10000 * RAM_PAGES, sizeof(Uint8)))) return system_error("boot", "Failed"); diff --git a/src/uxnasm.c b/src/uxnasm.c index df7a394..2cf0041 100644 --- a/src/uxnasm.c +++ b/src/uxnasm.c @@ -498,9 +498,12 @@ writesym(char *filename) int main(int argc, char *argv[]) { + int i = 1; FILE *src, *dst; - if(argc < 3) - return !error("usage", "uxnasm input.tal output.rom"); + if(i == argc) + return error("usage", "uxnasm [-v] input.tal output.rom"); + if(argv[i][0] == '-' && argv[i][1] == 'v') + return !fprintf(stdout, "Uxnasm - Uxntal Assembler, 8 Aug 2023\n"); if(!(src = fopen(argv[1], "r"))) return !error("Invalid input", argv[1]); if(!assemble(src))