From e672f29a9caabbe79461bf92925b0ce18bc43385 Mon Sep 17 00:00:00 2001 From: Andreas 'phix' Jonsson Date: Mon, 18 Dec 2023 15:12:55 +0100 Subject: [PATCH] Minor cleanup --- tools/emuctrl/emuctrl.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/emuctrl/emuctrl.c b/tools/emuctrl/emuctrl.c index 3bc6427e..03c1315e 100644 --- a/tools/emuctrl/emuctrl.c +++ b/tools/emuctrl/emuctrl.c @@ -2,6 +2,10 @@ #include #include +#define VERSION "1.0.0" +#define COMMAND_PORT 0xB4 +#define DATA_PORT 0xB5 + #if !defined(__BCC__) || !defined(__MSDOS__) #error Use BCC to produce MSDOS executable! #endif @@ -27,7 +31,7 @@ enum { static int read_status(void) { #asm xor ax, ax - in al, 0xB4 + in al, COMMAND_PORT #endasm } @@ -36,7 +40,7 @@ static void write_command_(unsigned char c) { push bx mov bx, sp mov al, [bx+4] - out 0xB4, al + out COMMAND_PORT, al pop bx #endasm } @@ -56,7 +60,7 @@ static void write_data(unsigned char c) { push bx mov bx, sp mov al, [bx+4] - out 0xB5, al + out DATA_PORT, al pop bx #endasm } @@ -64,13 +68,14 @@ static void write_data(unsigned char c) { static unsigned char read_data(void) { #asm xor ax, ax - in al, 0xB5 + in al, DATA_PORT #endasm } static void print_help(void) { printf( "Usage: emuctrl [cmd] \n\n" + " version Display software information\n" " shutdown Terminates the emulator\n" " popen Execute command on host and pipe input to guest\n" " push [src] [dest] Upload file from guest to host\n" @@ -169,6 +174,9 @@ int main(int argc, char *argv[]) { write_command(FRONTEND_CTRL_FCLOSE); fclose(fp); + } else if (!strcmp(argv[1], "version")) { + printf("VirtualXT Control Software\n"); + printf("Version: %s\n", VERSION); } else { print_help(); }