diff --git a/SniffEmu/README.md b/SniffEmu/README.md index 636a0af..dabc76b 100644 --- a/SniffEmu/README.md +++ b/SniffEmu/README.md @@ -1,6 +1,6 @@ # SniffEmu -CLI tool to "detect" if the system is running in emulator +Amiga CLI tool to "detect" if the system is running in emulator. ## Description @@ -8,12 +8,15 @@ SniffEmu is a small CLI tool to "detect" if the system is running in emulation-like environment, e.g. UAE. I use it to conditionally execute parts of Startup-Sequence, e.g. to can skip FBlit when the OS is booting on PiStorm. -Usage: SniffEmu HELP/S RTG/S MODE +Usage: SniffEmu HELP/S RTG/S SND/S MODE `MODE` is one of `EMU68`, `UAE` or `MUSASHI`. `RTG/S` allows you to specifically look for the emulator's RTG card, so you can e.g. set up the proper screen mode. +`SND/S` allows you to look for the emulator's sound card. This currently works +only with `UAESND` card in WinUAE. + Example: ``` @@ -47,6 +50,10 @@ AmigaOS 3.1+, MC68020+ ## Changelog +Version 1.1.0 (25.02.2023) + + * Added sound card detection. + Version 1.0.0 (16.02.2023) * Initial release. @@ -58,8 +65,8 @@ me through e-mail. ## Author -ScreenSaver is developed by [Tomek Wójcik](https://www.bthlabs.pl/). +SniffEmu is developed by [Tomek Wójcik](https://www.bthlabs.pl/). ## License -ScreenSaver is licensed under the MIT License. +SniffEmu is licensed under the MIT License. diff --git a/SniffEmu/SniffEmu/Readme b/SniffEmu/SniffEmu/Readme index 6898bcd..e574e97 100755 --- a/SniffEmu/SniffEmu/Readme +++ b/SniffEmu/SniffEmu/Readme @@ -4,11 +4,14 @@ SniffEmu is a small CLI tool to "detect" if the system is running in emulation-like environment, e.g. UAE. I use it to conditionally execute parts of Startup-Sequence, e.g. to can skip FBlit when the OS is booting on PiStorm. -Usage: SniffEmu HELP/S RTG/S MODE +Usage: SniffEmu HELP/S RTG/S SND/S MODE MODE is one of EMU68, UAE or MUSASHI. RTG/S allows you to specifically look for the emulator's RTG card, so you can e.g. set up the proper screen mode. +SND/S allows you to look for the emulator's sound card. This currently works +only with UAESND card in WinUAE. + Example: > SniffEmu EMU68 @@ -17,8 +20,8 @@ SniffEmu: Looking for board: 28019:-1... NOT FOUND > SniffEmu RTG UAE SniffEmu: Looking for board: 2011:96... FOUND -If the emulator (or RTG) was detected, the program will set the returncode to -WARN. Otherwise, it'll be OK. +If the emulator (or RTG/SND) was detected, the program will set the returncode +to WARN. Otherwise, it'll be OK. Example script: @@ -39,6 +42,10 @@ SniffEmu is licensed under the MIT License. Changelog --------- +Version 1.1.0 (25.02.2023) + + * Added sound card detection. + Version 1.0.0 (16.02.2023) * Initial release. diff --git a/SniffEmu/SniffEmu/SniffEmu b/SniffEmu/SniffEmu/SniffEmu index 983572f..7bf8610 100755 Binary files a/SniffEmu/SniffEmu/SniffEmu and b/SniffEmu/SniffEmu/SniffEmu differ diff --git a/SniffEmu/SniffEmu/Source/SniffEmu.c b/SniffEmu/SniffEmu/Source/SniffEmu.c index bb449f9..1bf65bc 100755 --- a/SniffEmu/SniffEmu/Source/SniffEmu.c +++ b/SniffEmu/SniffEmu/Source/SniffEmu.c @@ -39,11 +39,12 @@ static char *MODE_NAME_EMU68 = "EMU68"; static char *MODE_NAME_UAE = "UAE"; static char *MODE_NAME_MUSASHI = "MUSASHI"; -#define TEMPLATE "HELP/S,RTG/S,MODE" +#define TEMPLATE "HELP/S,RTG/S,SND/S,MODE" typedef enum { OPT_HELP, OPT_RTG, + OPT_SND, OPT_MODE, OPT_COUNT } OPT_ARGS; @@ -65,10 +66,11 @@ int help() { printf( "\n" - "Usage: SniffEmu HELP/S RTG/S MODE\n" + "Usage: SniffEmu HELP/S RTG/S SND/S MODE\n" "\n" "HELP : Print this help\n" "RTG : Sniff the RTG board\n" + "SND : Sniff the sound card\n" "MODE : Specify the emulator to sniff\n" " Valid values: EMU68, UAE, MUSASHI\n" ); @@ -145,6 +147,17 @@ int main(int argc, char *argv[]) { printf("SniffEmu: Can't reliably sniff RTG on Musashi :(\n"); product = MUSASHI_RTG; } + } else if (opts[OPT_SND]) { + if (mode == MODE_EMU68) { + printf("SniffEmu: Can't sniff SND on EMU68 :(\n"); + product = EMU68_SND; + } else if (mode == MODE_UAE) { + manufacturer = UAE_SND_MANUFACTURER; + product = UAE_SND; + } else if (mode == MODE_MUSASHI) { + printf("SniffEmu: Can't sniff SND on Musashi :(\n"); + product = MUSASHI_SND; + } } result = find_board(manufacturer, product); diff --git a/SniffEmu/SniffEmu/Source/SniffEmu.h b/SniffEmu/SniffEmu/Source/SniffEmu.h index 9015fc8..2ee7662 100755 --- a/SniffEmu/SniffEmu/Source/SniffEmu.h +++ b/SniffEmu/SniffEmu/Source/SniffEmu.h @@ -1,17 +1,21 @@ #ifndef __SNIFFEMU_H__ #define __SNIFFEMU_H__ -#define VERSION "1.0.0" -#define DATE "16.02.2023" +#define VERSION "1.1.0" +#define DATE "25.02.2023" #define APP_VSTRING "$VER: SniffEmu " VERSION " (" DATE ")" #define EMU68_MANUFACTURER (0x6d73) #define EMU68_RTG (0x24) +#define EMU68_SND (0xff) #define UAE_MANUFACTURER (0x7db) #define UAE_RTG (0x60) +#define UAE_SND_MANUFACTURER (0x1966) +#define UAE_SND (0x02) #define MUSASHI_MANUFACTURER (0x7db) #define MUSASHI_INTERACTION (0x6b) #define MUSASHI_RTG (0x6b) +#define MUSASHI_SND (0xff) #endif diff --git a/SniffEmu/dist/SniffEmu.readme b/SniffEmu/dist/SniffEmu.readme index 08d6b71..42edbc3 100644 --- a/SniffEmu/dist/SniffEmu.readme +++ b/SniffEmu/dist/SniffEmu.readme @@ -1,8 +1,8 @@ -Short: CLI tool to "detect" if the system is running in emulator +Short: Check if system is running in emulator Author: Tomek Wójcik Uploader: Tomek Wójcik Type: util/sys -Version: 1.0.0 +Version: 1.1.0 Architecture: m68k-amigaos Requires: AmigaOS 3.1+, MC68020+ @@ -12,11 +12,14 @@ SniffEmu is a small CLI tool to "detect" if the system is running in emulation-like environment, e.g. UAE. I use it to conditionally execute parts of Startup-Sequence, e.g. to can skip FBlit when the OS is booting on PiStorm. -Usage: SniffEmu HELP/S RTG/S MODE +Usage: SniffEmu HELP/S RTG/S SND/S MODE MODE is one of EMU68, UAE or MUSASHI. RTG/S allows you to specifically look for the emulator's RTG card, so you can e.g. set up the proper screen mode. +SND/S allows you to look for the emulator's sound card. This currently works +only with UAESND card in WinUAE. + Example: > SniffEmu EMU68 @@ -25,8 +28,8 @@ SniffEmu: Looking for board: 28019:-1... NOT FOUND > SniffEmu RTG UAE SniffEmu: Looking for board: 2011:96... FOUND -If the emulator (or RTG) was detected, the program will set the returncode to -WARN. Otherwise, it'll be OK. +If the emulator (or RTG/SND) was detected, the program will set the returncode +to WARN. Otherwise, it'll be OK. Example script: @@ -47,6 +50,11 @@ SniffEmu is licensed under the MIT License. Changelog --------- +Version 1.1.0 (25.02.2023) + + * Added sound card detection. + Version 1.0.0 (16.02.2023) * Initial release. +