2017-03-31 23:04:57 +00:00
|
|
|
#pragma noroot
|
|
|
|
|
|
|
|
#include <types.h>
|
|
|
|
#include <AppleTalk.h>
|
|
|
|
#include "asmglue.h"
|
2017-04-03 00:01:49 +00:00
|
|
|
#include "cmdproc.h"
|
2017-04-10 01:56:19 +00:00
|
|
|
#include "installcmds.h"
|
2017-03-31 23:04:57 +00:00
|
|
|
|
|
|
|
typedef struct NewCmd {
|
|
|
|
Word cmdNum;
|
|
|
|
void (*cmdAddr)(void);
|
2017-04-18 22:46:33 +00:00
|
|
|
LongWord *jslOldCmdLocation;
|
2017-03-31 23:04:57 +00:00
|
|
|
} NewCmd;
|
|
|
|
|
|
|
|
NewCmd newCmds[] = {
|
2017-04-18 22:46:33 +00:00
|
|
|
{aspGetStatusCommand, cmdProc, NULL},
|
|
|
|
{aspOpenSessionCommand, cmdProc, NULL},
|
|
|
|
{aspCloseSessionCommand, cmdProc, NULL},
|
|
|
|
{aspCommandCommand, cmdProc, NULL},
|
|
|
|
{aspWriteCommand, cmdProc, NULL},
|
|
|
|
{nbpLookupNameCommand, nbpCmdProc, NULL},
|
|
|
|
{pfiLoginCommand, pfiLoginCmdProc, &jslOldPFILogin},
|
|
|
|
{pfiLogin2Command, pfiLogin2CmdProc, &jslOldPFILogin2},
|
|
|
|
{pfiListSessions2Command, pfiListSessions2CmdProc, &jslOldPFIListSessions2},
|
|
|
|
{0, 0, 0}
|
2017-03-31 23:04:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
LongWord *cmdTable = (LongWord *)0xE1D600;
|
|
|
|
|
|
|
|
LongWord oldCmds[MAX_CMD + 1]; /* holds old entries for commands we changed */
|
|
|
|
|
2017-04-18 22:46:33 +00:00
|
|
|
#define JSL 0x22
|
|
|
|
|
2017-03-31 23:04:57 +00:00
|
|
|
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;
|
2017-04-18 22:46:33 +00:00
|
|
|
if (cmd->jslOldCmdLocation != NULL)
|
|
|
|
*cmd->jslOldCmdLocation = JSL | (oldCmds[cmd->cmdNum] << 8);
|
2017-03-31 23:04:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RestoreStateReg(savedStateReg);
|
|
|
|
}
|