home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HyperLib 1997 Winter - Disc 1
/
HYPERLIB-1997-Winter-CD1.ISO.7z
/
HYPERLIB-1997-Winter-CD1.ISO
/
オンラインウェア
/
PRG
/
CPCoplandト.sit
/
CPCoplandƒ
/
CPCopland.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-10-01
|
1KB
|
52 lines
/*
File: CPCopland.c
Contains: Copland Control Panel under System 7 simulation.
Copyright: ゥ1995 Chris K. Thomas. All Rights Reserved.
*/
#include <Traps.h>
#include "ShowInitIcon.h"
OSErr _CoplandDispatchPatch(FileParamPtr inFPB: __A0) : __D0;
void _CoplandOldDispatchAddress(UniversalProcPtr: __A0);
void main()
{
Handle us = GetResource('INIT', 0);
// * should check for NULL here
DetachResource(us);
ShowInitIcon(128, true);
_CoplandOldDispatchAddress(GetOSTrapAddress(_HFSDispatch));
SetOSTrapAddress((UniversalProcPtr)_CoplandDispatchPatch, _HFSDispatch);
}
asm OSErr _CoplandDispatchPatch(FileParamPtr inFPB: __A0) : __D0
{
movea.l oldAddress, a1
jsr (a1)
// if (offset of ioFlFndrInfo (fdType is first field)) is 'APPC'
cmpi.l #'APPC', 0x20(a0)
bne done
// change it to 'APPL'
move.l #'APPL', 0x20(a0)
done:
rts
// store old address
entry static _CoplandOldDispatchAddress
lea oldAddress, a1
move.l a0, (a1)
rts
// old dispatch address storage
oldAddress:
dc.l 0x000000
}