From effdf36f7e1ffb412d73f8e7b89e51bd6bf9b91b Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Mon, 13 Nov 2023 16:33:05 +0100 Subject: [PATCH] Print the list of models in the emulator --- src/emu/emu_args.c | 4 ++++ src/emu/models.c | 9 +++++++++ src/emu/models.h | 1 + 3 files changed, 14 insertions(+) diff --git a/src/emu/emu_args.c b/src/emu/emu_args.c index 8e4a050..daecbe9 100644 --- a/src/emu/emu_args.c +++ b/src/emu/emu_args.c @@ -6,6 +6,7 @@ #include "common.h" #include "ovni.h" #include "path.h" +#include "models.h" #include #include #include @@ -37,6 +38,9 @@ usage(void) rerr(" tracedir The output trace dir generated by ovni.\n"); rerr("\n"); rerr("The output PRV files are placed in the tracedir directory.\n"); + rerr("\n"); + rerr("Available emulation models:\n"); + models_print(); exit(EXIT_FAILURE); } diff --git a/src/emu/models.c b/src/emu/models.c index 124d45c..26a0f0c 100644 --- a/src/emu/models.c +++ b/src/emu/models.c @@ -50,3 +50,12 @@ models_get_version(const char *name) return NULL; } + +void +models_print(void) +{ + for (int i = 0; models[i] != NULL; i++) { + struct model_spec *spec = models[i]; + rerr(" %c %-8s %s\n", spec->model, spec->name, spec->version); + } +} diff --git a/src/emu/models.h b/src/emu/models.h index cb6b42f..e0ab0b4 100644 --- a/src/emu/models.h +++ b/src/emu/models.h @@ -9,5 +9,6 @@ struct model; USE_RET int models_register(struct model *model); USE_RET const char *models_get_version(const char *name); + void models_print(void); #endif /* MODELS_H */