summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Expansionoff10.lhabin3477 -> 0 bytes
-rw-r--r--README21
-rw-r--r--README.md8
-rw-r--r--expansionoffbin0 -> 2348 bytes
-rw-r--r--expansionoff.c124
5 files changed, 145 insertions, 8 deletions
diff --git a/Expansionoff10.lha b/Expansionoff10.lha
deleted file mode 100644
index 101071b..0000000
--- a/Expansionoff10.lha
+++ /dev/null
Binary files 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
--- /dev/null
+++ b/expansionoff
Binary files 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 <string.h>
+#include <dos/dos.h>
+#include <dos/exall.h>
+#include <proto/dos.h>
+#include <exec/memory.h>
+#include <proto/exec.h>
+#include <libraries/expansion.h>
+#include <libraries/configvars.h>
+#define __NOLIBBASE__
+#include <proto/expansion.h>
+
+
+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";