[SniffEmu] v1.1.0

master
Tomek Wójcik 2023-02-25 14:41:47 +01:00
parent 2afb5eba89
commit 4638927f13
6 changed files with 55 additions and 16 deletions

View File

@ -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.

View File

@ -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.

Binary file not shown.

View File

@ -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);

View File

@ -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

View File

@ -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 <contact@bthlabs.pl>
Uploader: Tomek Wójcik <contact@bthlabs.pl>
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.