From 728d1f3df1ccf48292fbf57509c5144fc0f2c74d Mon Sep 17 00:00:00 2001 From: norly Date: Thu, 5 Dec 2024 20:13:02 +0900 Subject: Decompress original files --- Expansionoff10.lha | Bin 3477 -> 0 bytes README | 21 +++++++++ README.md | 8 ---- expansionoff | Bin 0 -> 2348 bytes expansionoff.c | 124 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 145 insertions(+), 8 deletions(-) delete mode 100644 Expansionoff10.lha create mode 100644 README delete mode 100644 README.md create mode 100644 expansionoff create mode 100644 expansionoff.c diff --git a/Expansionoff10.lha b/Expansionoff10.lha deleted file mode 100644 index 101071b..0000000 Binary files a/Expansionoff10.lha and /dev/null differ diff --git a/README b/README new file mode 100644 index 0000000..63446b9 --- /dev/null +++ b/README @@ -0,0 +1,21 @@ + expansionoff 1.0 + + disable Zorro-II/III Expansions by software + + (C) 2019 Henryk Richter + + This tool can either mark expansions as invalid + (Shutup flag) or remove them from the active expansion + board list. Please note that this is in software + only and won't help if the hidden (presumably broken) + devices interfere with the operation of other boards. + + A more reliable way to disable Zorro devices would + need to patch expansion.library, which is beyond the + scope of this tool. + + compilation: + m68k-amigaos-gcc expansionoff.c -o expansionoff -noixemul -Wall -s + or + sc expansionoff.c link + diff --git a/README.md b/README.md deleted file mode 100644 index 5b3b178..0000000 --- a/README.md +++ /dev/null @@ -1,8 +0,0 @@ -This is the original source code and binary release package, as posted by -Henryk "buggs" Richter at: - - https://www.a1k.org/forum/index.php?threads/70833/post-1290558 - -and then released under the MIT license at: - - https://www.a1k.org/forum/index.php?threads/70833/post-1815403 diff --git a/expansionoff b/expansionoff new file mode 100644 index 0000000..c0754f0 Binary files /dev/null and b/expansionoff differ diff --git a/expansionoff.c b/expansionoff.c new file mode 100644 index 0000000..c0aab81 --- /dev/null +++ b/expansionoff.c @@ -0,0 +1,124 @@ +/* + disable Zorro-II/III Expansions by software + + (C) 2019 Henryk Richter + + This tool can either mark expansions as invalid + (Shutup flag) or remove them from the active expansion + board list. Please note that this is in software + only and won't help if the hidden (presumably broken) + devices interfere with the operation of other boards. + + A more reliable way to disable Zorro devices would + need to patch expansion.library, which is beyond the + scope of this tool. + + compilation: + m68k-amigaos-gcc expansionoff.c -o expansionoff -noixemul -Wall -s + or + sc expansionoff.c link + +*/ +#include +#include +#include +#include +#include +#include +#include +#include +#define __NOLIBBASE__ +#include + + +struct Library *ExpansionBase; /* struct ExpansionBase *ExpansionBase; */ + +/* don't use amiga.lib */ +#define REMOVE(n) ((void)(\ + ((struct Node *)n)->ln_Pred->ln_Succ = ((struct Node *)n)->ln_Succ,\ + ((struct Node *)n)->ln_Succ->ln_Pred = ((struct Node *)n)->ln_Pred )) + + +/*----------------- options template -----------------------------------------*/ +#define OPT_TEMPLATE "MANUFACTURER=VENDOR/K/N/A,DEVICE=DEV/K/N/A,SHUTUP=S/S,REMOVE=R/S" + +struct progopts { + ULONG *vendor; + ULONG *dev; + ULONG shutup; + ULONG remove; +}; +const char opt_template[]; + +int main( int argc, char**argv ) +{ + struct progopts opts; + struct RDArgs *rdargs; + ULONG syntax; + ULONG rcount=0,scount=0; + struct ConfigDev *cfg = (0),*cfg2; + + ExpansionBase = OpenLibrary( (STRPTR)EXPANSIONNAME, 34 ); + if( !ExpansionBase ) + { + Printf("Cannot open expansion.library v34\n"); + return 10; + } + + do + { + memset( &opts, 0, sizeof( struct progopts )); + syntax=1; + if( (rdargs = ReadArgs( (char*)opt_template,(LONG*)&opts,NULL) ) ) + { + if( (opts.vendor) && (opts.dev) ) + syntax = 0; + } + + if( syntax ) + { + Printf("Syntax: %s\n",(ULONG)opt_template); + break; + } + + cfg = FindConfigDev( cfg, *opts.vendor, *opts.dev ); + if( !cfg ) + { + Printf("Board %ld %ld not found\n",*opts.vendor, *opts.dev); + break; + } + + while( (cfg) ) + { + cfg2 = FindConfigDev( cfg, *opts.vendor, *opts.dev ); + + if( opts.remove ) + { + Disable(); + REMOVE(cfg); + Enable(); + rcount++; + Printf("rem\n"); + } + else + { + cfg->cd_Flags |= CDF_SHUTUP; + scount++; + } + + cfg = cfg2; + } + } + while(0); + + Printf("Done. Removed %ld boards, Shutup %ld boards\n",rcount,scount); + + if( rdargs ) FreeArgs(rdargs); + + CloseLibrary( (struct Library*)ExpansionBase ); + return 0; +} + +/* some strings down here */ +const char opt_template[] = OPT_TEMPLATE; +const char verstring[] = "$VER: expansionoff 1.0 (03.06.2019) Disable Zorro Expansions (C) Henryk Richter"; -- cgit v1.2.3