AFPBridge/installcmds.c
Stephen Heumann 3b2f1b6a25 Pass through calls we don’t handle to the original AppleTalk stack.
It is now possible to have AFP volumes mounted over both AppleTalk and TCP/IP simultaneously.
2017-04-09 20:57:09 -05:00

42 lines
954 B
C

#pragma noroot
#include <types.h>
#include <AppleTalk.h>
#include "asmglue.h"
#include "cmdproc.h"
#include "installcmds.h"
typedef struct NewCmd {
Word cmdNum;
void (*cmdAddr)(void);
} NewCmd;
NewCmd newCmds[] = {
{aspGetStatusCommand, cmdProc},
{aspOpenSessionCommand, cmdProc},
{aspCloseSessionCommand, cmdProc},
{aspCommandCommand, cmdProc},
{aspWriteCommand, cmdProc},
{nbpLookupNameCommand, nbpCmdProc},
{0, 0}
};
LongWord *cmdTable = (LongWord *)0xE1D600;
LongWord oldCmds[MAX_CMD + 1]; /* holds old entries for commands we changed */
void installCmds(void) {
Word savedStateReg;
NewCmd *cmd;
savedStateReg = ForceLCBank2();
for (cmd = newCmds; cmd->cmdNum != 0; cmd++) {
oldCmds[cmd->cmdNum] = cmdTable[cmd->cmdNum];
cmdTable[cmd->cmdNum] =
(oldCmds[cmd->cmdNum] & 0xFF000000) | (LongWord)cmd->cmdAddr;
}
RestoreStateReg(savedStateReg);
}