From 5122302da6298702395bb5731a605e199f6bcc44 Mon Sep 17 00:00:00 2001 From: Elliot Nunn Date: Mon, 19 Aug 2019 12:32:19 +0800 Subject: [PATCH] Reverse more of the OF interface --- patchset/Custer/8-source.patch | 75 +++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/patchset/Custer/8-source.patch b/patchset/Custer/8-source.patch index 7481aaa..2f68535 100644 --- a/patchset/Custer/8-source.patch +++ b/patchset/Custer/8-source.patch @@ -22877,7 +22877,7 @@ diff --git a/OS/StartMgr/OpenFirmware.c b/OS/StartMgr/OpenFirmware.c new file mode 100644 --- /dev/null +++ b/OS/StartMgr/OpenFirmware.c -@@ -0,0 +1,483 @@ +@@ -0,0 +1,556 @@ +#include +#include +#include @@ -23360,6 +23360,79 @@ new file mode 100644 + *(ProductInfo **)UnivInfoPtr = newPtr; +} + ++struct mysterystruct { ++ short a; ++ short b; ++ long c; ++ long d; ++ long e; ++}; ++ ++struct mysterystruct2 { ++ long a; ++ short b; // either short-char-char or char-char-short ++ char c; ++ char d; ++ long e; ++ long f; ++ long g; ++}; ++ ++void ++INTERC_1DB0(struct mysterystruct *x) ++{ ++ x->a = 1; ++ x->b = 0; ++ x->c = 0; ++ x->d = 0; ++ x->e = 0; ++} ++ ++void ++INTERC_1DE0(GDHandle gh, struct mysterystruct *x) ++{ ++ CntrlParam paramblk; ++ OSErr err; ++ ++ INTERC_1DB0(x); ++ ++ paramblk.ioNamePtr = NULL; ++ paramblk.ioCRefNum = (**gh).gdRefNum; ++ paramblk.csCode = 12; ++ *(struct mysterystruct **)(¶mblk.csParam) = x; ++ ++ err = PBStatusSync((ParmBlkPtr)(¶mblk)); ++} ++ ++OSErr ++INTERC_1E20(GDHandle gh, struct mysterystruct2 *x) ++{ ++ CntrlParam paramblk; ++ OSErr err = paramErr; ++ ++ if (gh == NULL) goto exit; ++ if (x == NULL) goto exit; ++ ++ x->b = 0; ++ x->c = 0; ++ x->d = 0; ++ x->e = 0; ++ x->f = 0; ++ x->g = 0; ++ ++ paramblk.ioNamePtr = NULL; ++ paramblk.ioCRefNum = (**gh).gdRefNum; ++ paramblk.csCode = 28; ++ *(struct mysterystruct2 **)(¶mblk.csParam) = x; ++ ++ err = PBStatusSync((ParmBlkPtr)(¶mblk)); ++ if (err != noErr) goto exit; ++ ++ if (x->a == -1) err = statusErr; ++ ++ exit: return err; ++} ++ +/* This file is complete... the remaining kilobytes to 0x2BC0 are filled by Amphibian DNA */ diff --git a/OS/StartMgr/OpenFirmware.c.idump b/OS/StartMgr/OpenFirmware.c.idump new file mode 100644