diff --git a/afpbridge.c b/afpbridge.c index 9160032..9303436 100644 --- a/afpbridge.c +++ b/afpbridge.c @@ -12,6 +12,7 @@ #include "installcmds.h" #include "aspinterface.h" #include "asmglue.h" +#include "cmdproc.h" const char bootInfoString[] = "AFPBridge v1.0b1"; LongWord version = 0x01006001; /* in rVersion format */ @@ -69,6 +70,7 @@ int main(void) { FSTInfoRecGS fstInfoRec; NotifyProcRecGS addNotifyProcRec; VersionMessageRec versionMessageRec; + PFIHooksRec pfiHooksRec; /* * Check for presence of AppleShare FST. We error out and unload @@ -137,6 +139,21 @@ int main(void) { oldSoftReset = *SoftResetPtr; *SoftResetPtr = ((LongWord)&resetRoutine << 8) | JML; + /* + * Install our own attention vector that bypasses the one in the + * ATalk driver in problematic cases (for session number > 8). + */ + pfiHooksRec.async = 0; + pfiHooksRec.command = pfiHooksCommand; + pfiHooksRec.hookFlag = 0; /* get GS/OS hooks */ + _CALLAT(&pfiHooksRec); + if (pfiHooksRec.result == 0) { + jmlOldAttentionVec = (pfiHooksRec.attentionVector << 8) | JML; + pfiHooksRec.attentionVector = (LongWord)&attentionVec; + pfiHooksRec.hookFlag = pfiHooksSetHooks; /* set GS/OS hooks */ + _CALLAT(&pfiHooksRec); + } + return; error: diff --git a/cmdproc.asm b/cmdproc.asm index 5ad3d93..7483b7c 100644 --- a/cmdproc.asm +++ b/cmdproc.asm @@ -1,6 +1,8 @@ case on mcopy cmdproc.macros +SESSION_NUM_START gequ $F8 + RamGoComp gequ $E1100C RamForbid gequ $E11018 RamPermit gequ $E1101C @@ -128,3 +130,29 @@ skip jsl RamPermit plb rtl end + +* Replacement attention vector to be called from PFI. +* This calls the previous attention vector (from the ATalk driver) for ASP +* sessions (numbered 1-8), but not for the higher-numbered DSI sessions. +* This is needed because ATalk's attention vector is hard-coded for session +* numbers 1-8 only and trashes memory when called with higher numbers. +attentionVec start + phd + phy + phx + tsc + tcd + lda [1] + plx + ply + pld + + and #$00FF + cmp #SESSION_NUM_START + bge skip +jmlOldAttentionVec entry + jml attentionVec ;to be changed to old attention vec +skip clc + rtl + end + diff --git a/cmdproc.h b/cmdproc.h index e49a316..aaa8af1 100644 --- a/cmdproc.h +++ b/cmdproc.h @@ -13,4 +13,7 @@ void pfiListSessions2CmdProc(void); extern LongWord jslOldPFIListSessions2; void CallCompletionRoutine(void *); +extern void attentionVec(void); +extern LongWord jmlOldAttentionVec; + #endif