; ; Hacks to match MacOS (most recent first): ; ; 8/3/92 Overall, changed this file back from 'BassExtensions' ROM routines to ; 'BassPatches' linked patches (but without actually renaming it). Changed ; several plain exported Procs back to self-executing Patch/InstallProcs. ; Reverted to use the nice dcImportResident-based dispatch table ; from <1>. Recovered PatchProcs from MemMgrBoot.a to flush the outline ; font cache when an app heap is clobbered (unclear when the code was ; deleted). Recreated the <5> patch that was removed some time before ; in 6/8/92, which rescues ATM's FMSwapFont and StdText patches from ; crashing when a spline font is loaded. ; 9/2/94 SuperMario ROM source dump (header preserved below) ; ; File: BassExtensions.a ; ; Contains: This file was formerly part of the 'lpch' resource which loads the Spline ; Package. It is now part of the SuperMario ROM. ; ; Written by: Charlton E. Lui ; ; Copyright: © 1988-1993 by Apple Computer, Inc. All rights reserved. ; ; Change History (most recent first): ; ; 5/21/93 CSS Fix the fontmgr gestalt call to return the correct number of ; bits for double byte support. And expand DispatchFontCache table ; to support InitializePartialFonts and InitializeDiskCache which ; are enabled once the gestalt call turns on the new bits. Per ; Reality BassPatches.a <14> comment follows: ; <14> 3/9/92 DTY #1023997: Don’t call InitializePartialFonts and ; InitializeDiskCache as part of the TrueType installation process ; any more. Instead, make them selectors off of vFontCache so that ; they can be called by the Universal Two Byte Extension, since ; two byte systems are the only clients for these features at the ; moment. This way, about 150K is saved in the base system. ; 11/3/92 SWC Changed ToolEqu.a->ToolUtils.a and QuickEqu.a->QuickDraw.a. ; 8/25/92 chp The DispatchFontCache and DispatchFontScaler tables have been ; moved back to the system heap using the old format of absolute ; long address vectors initialized at boot time. The StyleWriter ; driver depends on this patchable format. ; 6/8/92 CSS Roll-in Reality Changes: Note that <15> was not applied as the fix applies to ; the ATM patch that is no longer part of this file. ; <16> 4/1/92 YK #1023997: Ignore case for InitializePartialFonts and ; InitializeDiskcache since they are pascal functions now. ; <14> 3/9/92 DTY #1023997: Don’t call InitializePartialFonts and ; InitializeDiskCache as part of the TrueType installation process ; any more. Instead, make them selectors off of vFontCache so that ; they can be called by the Universal Two Byte Extension, since ; two byte systems are the only clients for these features at the ; moment. This way, about 150K is saved in the base system. ; 4/16/92 PN first checked in ; <13> 10/25/91 RB Fix selectors to support new TT calls for embedded bitmaps. ; <12> 10/23/91 ngk KON, Add InstallProc for myGetSeek to load it only when 32-bit ; QD is not present. ; <11> 10/22/91 RB Add support for sfnt-embedded-bitmaps ; <10> 9/25/91 jlf Rolled in modifications from Pacific TrueType project: added ; initialization calls to InitializePartialFonts and ; InitializeDiskCache; added SetAppBase and InitApplZone ; patches to remove caches when an application heap is reformatted ; (the CloseResFile patch doesn't catch a Finder or MultiFinder ; launch when the system font is an outline font). ; <9> 7/10/91 JSM Remove obsolete SysVers conditionals, remove unused DISK_CACHE ; equate. ; <8> 6/14/91 JL Removed benign redefinition of spare1 declared in Private.a. ; <7> 6/12/91 LN added #include 'SysPrivateEqu.a' ; <6> 2/4/91 CL (MR)Conditionalizing the CacheCleaner code in this file to only ; be used for the Guadi init. The cleaning code for 7.0 is moved ; to MiscPatches.a in the CleanupApplication routine. Taking out ; old dead code. ; <5> 12/17/90 MR [ph] Add patch to SetTrapAddress to protect ATM from crashing if ; they try to draw when a TrueType font is currently loaded. ; <4> 12/5/90 MR Add Gestalt selector 'font'. [cl] ; <3> 10/30/90 CL (MR)Adding in fs_LowestPPEM to realfont. ; <2> 10/23/90 CL (MR)Kill fontTools. ; <14> 10/9/90 CL Added preflight call to the dispatcher. ; <16> 10/2/90 CL Of course we have more memory manager stuff. Accidently ; installed memory manager grow zone patch into the init ; on machines besides the MacPlus. Fixing it up! ; <15> 10/2/90 CL Fixing memory manager patch on the system heap grow zone. ; <14> 10/1/90 CL The prglue patch does not work in Finder mode since the printing ; code does in fact get memory for the app heap not the system ; heap. Need to check which mode and set accordingly. ; <13> 9/27/90 CL Adding in Dave Harrison’s cool memory patch for the MacPlus ROM. ; <12> 9/24/90 CL Adding sb_searchForcache back into vector table. ; <11> 9/13/90 CL Taking out MachineType since it is no longer needed for the ; MultiFinder exist check. Memory manager has a bad bug. It ; sometimes loops forever. This bug was fixed in the Mac SE ; memory manager but was never rolled back into the Plus ROM ; Now we include this 5k patch into the Gaudi init build. ; Set mfExists to true if we're in System 7.0. ; <10> 9/7/90 CL Fixing a Prglue heap corruption problem. ; <9> 9/7/90 MR Remove PSName calls since they now live in the LW driver. ; <8> 8/31/90 CL got rid of call to the now unneeded sb_initmemory. When the ; link patches got rolled in the rom address for putpicdata for ; the portable was wrong. Pictures died on the Guadi init. ; Took out extra ifdef out code. ; <7> 8/10/90 MR change detachfontface to getfontfacefamily ; <6> 7/31/90 KSM Fix bug in JStdTxMeas where address was getting SUB.W instead of ; SUB.L. ; <5> 7/27/90 CL Added the SetFractEnable and SetFScaleDisable patches in since ; they are not defined in the MacPlus Rom. ; <4> 7/23/90 MR Remove duplicate dispatch entries, fix jmp bug at SplineCall ; <3> 7/21/90 DTY Took out _Debugger in _GetSeek patch. ; <2> 7/20/90 DTY No change. Just cleaning up the change history. ; <1> 7/20/90 DTY Bass: The Linked Patch. This file used to be BassComm_Tail. ; Contents of BassBW_Tail, BassCQD_Tail, DispatchBass, and ; BPatcher have been merged in. All Head files are gone now that ; Bass is a linked patch. The dispatch tables are now formed by ; using the dcImportResident macro instead of copying them into a ; block in the system heap. The cache cleaning traps have been ; modified to use the jmpOld macro to return to the real toolbox ; routine, so these addresses don’t have to be saved in ; ExdpandMem. GetDevPix has been moved into FontMgr.a since ; that’s where it’s being called. ; ; BassCommTail.a --> BassPatches.a ; ; <11> 7/16/90 CL Made Finder compatible for the Goudy init. ; <10> 7/13/90 MR Add GetFontGlyph ; <9> 6/26/90 MR Modify ToolBox calls ; <8> 6/22/90 CL Adding fontPrivate.a include ; <7> 6/19/90 MR Add GetPSFontName to the trap ; <6> 6/5/90 MR Add font toolbox and get rid of readmvt and mapcharcodes ; <5> 5/29/90 CL Added conditionalized support for disk caching. ; <4> 5/3/90 CL Adding non-sys newhandle clear. Taking out old encrypt selector. ; Added fs_MapCharCodes and fs_ReadMVT to dispatcher. ; <3> 4/10/90 CL Conditionalize for ROM… ; <2> 2/27/90 CL Getting bbs headers ; <2.1> 11/14/89 CEL Moved globals from BassComm_MiddleJump.a to this file. ; <2.0> 9/28/89 CEL Took out killing the caches when an application quits. ; <1.9> 9/25/89 CEL Kill the caches in the application heap when quiting. ; <1.8> 9/15/89 CEL Changed to case sensitive obj code. ; <1.7> 8/14/89 CEL Set up machinetype & mfexists var for later checking. ; <1.6> 8/1/89 CEL Font scaler with composites update… ; <1.5> 6/10/89 CEL Moved Private.a QuickDraw Equates into proper QuickDraw private ; file (colorequ.a), got rid of QuickDraw nFiles dependencies and ; fixed up necessary files… ; <1.4> 6/6/89 CEL 32-bit QD is a new tool, need to change GetTrapAddress for check ; for 32-bit QD to work right ; <1.3> 6/2/89 CEL Changed Bind labels to new labels to references in patchmacs.a ; <1.2> 5/26/89 CEL Integrated the new Font Scaler 1.0 into Spline Fonts ; <•1.1> 5/3/89 CEL All kinks worked out, Blasting in bass files… ; <1.0> 5/1/89 cel Adding Bass for first time… ; ;—————————————————————————————————————————————————————————————————————————————————————————— STRING PASCAL CASE OBJ machine mc68020 ; BASS_INIT equ 0 IF (&TYPE('SCRIPT_CHAR_EXTRA') = 'UNDEFINED') THEN ; <3> CEL SCRIPT_CHAR_EXTRA EQU 1 ENDIF ;—————————————————————————————————————————————————————————————————————————————————————————— ; Includes… ;—————————————————————————————————————————————————————————————————————————————————————————— ;wholeErrors EQU 1 ;Ed added dsBadPatch error, so it needs this equate ;USE_MAKESYSFREE EQU 1 ;MakeSysFree flag ATM_HACK EQU 1 INCLUDE 'Traps.a' INCLUDE 'SysEqu.a' INCLUDE 'SysErr.a' INCLUDE 'ToolUtils.a' INCLUDE 'QuickDraw.a' INCLUDE 'SplineDefines.a' INCLUDE 'fontPrivate.a' INCLUDE 'LinkedPatchMacros.a' INCLUDE 'ColorEqu.a' INCLUDE 'GestaltEqu.a' include 'GestaltPrivateEqu.a' ; CSS INCLUDE 'SysPrivateEqu.a' ;—————————————————————————————————————————————————————————————————————————————————————————— ; Install Bass patches to QuickDraw & FontMgr routines. ;—————————————————————————————————————————————————————————————————————————————————————————— ;—————————————————————————————————————————————————————————————————————————————————————————— ; Misc routines ;—————————————————————————————————————————————————————————————————————————————————————————— ArithMode PROC EXPORT ; hilite ;avg addPin addOver subPin trans max subOver min DC.B srcCopy, srcBic, srcXor, srcOr, srcOr, srcBic, srcXor, srcOr EndProc JStdTxMeas PROC EXPORT dc.l $E00+($ED*4) ; Space to hold vector to StdTxMeas routine ENDPROC ;—————————————————————————————————————————————————————————————————————————————————————————— ; Remove any application memory allocated by Bass whenever the application heap is ; reformatted. SetAppBase and InitApplZone must be patched since they both trash the ; application heap. ;—————————————————————————————————————————————————————————————————————————————————————————— MACRO ; start of code from MemMgrBoot.a oneCopyOfPatchCode ; MOVEM.L A0-A2/D0-D3,-(sp) ; save registers CLR.L -(SP) ; room for result MOVE.L applZone,A0 ; point to zone hdr MOVE.L A0,-(SP) ; push start ptr MOVE.L (A0),-(SP) ; push zone trailer _sbKillSomeCaches ; ADDQ #4,SP ; ignore result MOVEM.L (sp)+,A0-A2/D0-D3 ; restore registers @SkipIt JMPOLD ; (changed from MemMgrBoot.a RTS) ENDM ; ...end of code from MemMgrBoot.a SetAppBaseCacheCleaner PatchProc $A057,(Plus,SE,II,Portable,IIci) ;SetAppBase Changed back from a plain PROC oneCopyOfPatchCode ; InitApplZoneCacheCleaner PatchProc $A02C,(Plus,SE,II,Portable,IIci) ;InitApplZone Changed back from a plain PROC oneCopyOfPatchCode ; ;—————————————————————————————————————————————————————————————————————————————————————————— ; ATM lovely hack remains with system files ;—————————————————————————————————————————————————————————————————————————————————————————— ATMSwapFontWrapper PROC EXPORT ; reconstruction of <5> CLR.L -(SP) ; First call the pre-ATM FMSwapFont to safely change the font. MOVE.L 8(SP),-(SP) MOVE.L ATMSwapFontWrapperCallees+4,A0 JSR (A0) MOVE.L (SP)+,A1 MOVE.L WidthTabHandle,A0 ; Test whether it set a spline font. MOVE.L (A0),A0 TST.B WidthIsSpline(A0) BNE.S @unsafe MOVE.L ATMSwapFontWrapperCallees,A0 ; Non-spline font => safe to call ATM trap handler. JMP (A0) ; (ATM will call FMSwapFont again, but no harm done.) @unsafe MOVE.L (SP)+,A0 ; Spline font => unsafe to call ATM trap handler. ADDQ #4,SP MOVE.L A1,(SP) ; We already called FMSwapFont above, so just return the saved result. JMP (A0) EXPORT ATMSwapFontWrapperCallees ; These fields are initialized by ATMPatch: ATMSwapFontWrapperCallees DC.L 0 ; Address of ATM trap handler DC.L 0 ; Address of Pre-ATM trap handler ATMStdTextWrapper PROC EXPORT ; reconstruction of <5> LINK A6,#0 ; Do the 'numer' and 'denom' scaling args imply a spline font? CLR.W -(SP) MOVE.L 12(A6),-(SP) MOVE.L 8(A6),-(SP) _IsOutline TST.W (SP)+ UNLK A6 BNE.S @unsafe MOVE.L ATMStdTextWrapperCallees,A0 ; Non-spline font => safe to call ATM trap handler. JMP (A0) @unsafe MOVE.L ATMStdTextWrapperCallees+4,A0 ; Spline font => unsafe to call ATM trap handler. JMP (A0) EXPORT ATMStdTextWrapperCallees ; These fields are initialized by ATMPatch: ATMStdTextWrapperCallees DC.L 0 ; Address of ATM trap handler DC.L 0 ; Address of Pre-ATM trap handler ; Compare the routine passed to SetToolTrapAddress against ATMPatch's checksum table ; ; Args: A0 = proposed new trap routine ; A1 = table of checksums from various ATM versions ; Returns: EQ if checksum matches ChecksumATMPatch PROC EXPORT ; reconstruction of <5> MOVEM.L D0/D1/A0,-(SP) ; Save registers. MOVE.W (A0)+,D0 ; Check for and follow the initial JMP $xxxxxxxx. CMP.W #$4EF9,D0 BNE.S @return ; (If no JMP, return NE.) MOVE.L (A0),A0 ; Checksum the target of the JMP. MOVEQ #0,D0 MOVE.W #50,D1 @mksum ADD.L (A0)+,D0 DBRA D1,@mksum @chksum MOVE.L (A1)+,D1 ; Return EQ if there is a match, NE if not. BEQ.S @notfnd CMP.L D1,D0 BEQ.S @return BRA.S @chksum @notfnd MOVEQ #1,D0 @return MOVEM.L (SP)+,D0/D1/A0 ; Restore registers (except CCR) and return. RTS ; Sniff ATM's non-Spline-savvy patches to FMSwapFont and StdText, and wrap ; them in our protective routines (above) to prevent a crash. ATMPatch PatchProc _SetTrapAddress, (Plus,SE,II,Portable,IIci) ; reconstruction of <5> EXPORT ATMPatchReturn IMPORT ATMSwapFontWrapper, ATMSwapFontWrapperCallees IMPORT ATMStdTextWrapper, ATMStdTextWrapperCallees ; ATMPatchReturn is exported so that ATMPatchDisable can disable this patch ; by copying our own 'JMPOLD' right here. CMP.W #$A647,D1 ; Patch SetToolTrapAddress only. BNE.S ATMPatchReturn CMP.W #$A901,D0 ; SetToolTrapAddress(A0, FMSwapFont)? BNE.S @NotThatTrap LEARESIDENT ATMSwapFontWrapper,A2 PEA ATMSwapFontWrapperCallees LEA ATMSwapFontChecksums,A1 BRA.S @GotOurTrap @NotThatTrap CMP.W #$A882,D0 ; SetToolTrapAddress(A0, StdText)? BNE.S ATMPatchReturn LEARESIDENT ATMStdTextWrapper,A2 PEA ATMStdTextWrapperCallees LEA ATMStdTextChecksums,A1 @GotOurTrap JSR ChecksumATMPatch ; Compare the patch to our checksum list: is it from ATM? MOVE.L (SP)+,A1 BNE.S ATMPatchReturn ; Prepare our wrapper if so, otherwise proceed with SetToolTrapAddress. MOVE.L A0,(A1)+ ; Tell our wrapper about ATM's patch. MOVEM.L D0,-(SP) _GetToolTrapAddress MOVEM.L (SP)+,D0 MOVE.L A0,(A1) ; Tell our wrapper about the pre-ATM trap code. MOVE.L A2,A0 ; Finally, SetToolTrapAddress with OUR WRAPPER. ATMPatchReturn JMPOLD ATMSwapFontChecksums ; These checksums were derived from various ATM versions. DC.L $417FFC36 DC.L $2D71904E DC.L $44EDD323 DC.L $40CFFC7E DC.L $2CC19096 DC.L $4535D273 DC.L 0 ATMStdTextChecksums DC.L $E339FCB4 DC.L $86FDFDCE DC.L $36B5833C DC.L $E335FCB4 DC.L $86F9FDCE DC.L $36B1833C DC.L 0 ; Disable the above ATMPatch when system startup is complete ATMPatchDisable PatchProc _Launch, (Plus,SE,II,Portable,IIci) ; reconstruction of <5> IMPORT ATMPatch, ATMPatchReturn LEA ATMPatch,A1 ; A1 = destination of JMPOLD MOVE.W #$4EF9,(A1)+ LEA ATMPatchReturn,A2 ; A2 = source of JMPOLD ADDQ #2,A2 MOVE.L (A2),(A1) ; Slam it home JMPOLD ;—————————————————————————————————————————————————————————————————————————————————————————— ; Bass Dispatcher ;—————————————————————————————————————————————————————————————————————————————————————————— SplineCall PatchProc $A854,(Plus,SE,II,Portable,IIci) ; Changed back from a plain PROC MOVE.L expandMem, A0 ; get low mem expand MOVE.L ExpandMemRec.emSplineKey(A0),D1 ; splineKey invalid? BEQ.S @bailOut ; yes -> bail out MOVE.L D1,A0 ; load splineKey handle MOVE.L (A0),A0 ; load splineKey pointer MOVE.L SplineKeyRec.vFontCache(A0),A1 ; load font cache vectors. TST.W D0 ; High bit set? BPL.S @fontCache ; no -> it belongs to the font cache. AND.W #$7FFF,D0 ; clear high bit flag. MOVE.L SplineKeyRec.vFontScaler(A0),A1 ; load font scaler vectors. @fontCache MOVE.L (A1)+,D1 ; load vector table size. CMP.W D1,D0 ; valid selector? BGE.S @bailOut ; no -> bail out. @loadVector lsl.l #2,D0 ; ex Instead of d0*4 below... move.l (a1,d0),a1 ; Get address of routine jmp (a1) ; Jump to routine @bailOut SWAP D0 ; Get number of params CLR.L D1 ; clear a long. MOVE.B D0,D1 ; isolate arguments length. LSR.L #8,D0 ; isolate results length. ADD.W D1,SP ; pop the arguments. MOVE.L SP,A1 ; copy the stack pointer. BRA.S @2 ; enter loop at bottom. @1 MOVE.B #$FF, (A1)+ ; clear a byte. @2 DBRA D0,@1 ; do the next byte. JMP (A1) ; return to the caller. ENDPROC ;—————————————————————————————————————————————————————————————————————————————————————————— ; This is the gestalt call back function. mrr ; ; pascal OSErr FontMgrGestalt(OSType selector, long* response) ;—————————————————————————————————————————————————————————————————————————————————————————— FontMgrGestalt PROC EXPORT MOVE.L (sp)+, a0 ; return address MOVE.L (sp)+, a1 ; addr of response ADDQ #4, sp ; eat the selector MOVE.L #(1 << gestaltOutlineFonts) | \ ; <14> (1 << gestaltPartialFonts) | \ ; <14> (1 << gestaltDiskCachedFonts) \ ; <14> ,(a1) CLR.W (sp) ; no error JMP (a0) ; go home ENDPROC ;—————————————————————————————————————————————————————————————————————————————————————————— ; EntryTables… ;—————————————————————————————————————————————————————————————————————————————————————————— FREE_SPOT PROC EXPORT ; Just a place holder RTS ENDPROC ; Current versions of the StyleWriter driver know about the structure of the ; DispatchFontCache table and patch it, so the table cannot change until ; the StyleWriter driver changes (post Cube-E). For now, DispatchFontCache ; is a template for a nonrelocatable block of memory in the system heap. ; DispatchFontScaler needs to have the same general structure as the former ; table since it is used in the same manner by the same dispatch routine. DispatchFontCache record 0 ; entries ds.l 1 vIsOutline ds.l 1 ; selector 0 vSetOutlinePreferred ds.l 1 ; selector 1 vSB_KillSomeCaches ds.l 1 ; selector 2 vsb_FillPrinterWidths ds.l 1 ; selector 3 vsb_RetrieveGlyph ds.l 1 ; selector 4 vsb_FillWidthTab ds.l 1 ; selector 5 vsb_SearchForCache ds.l 1 ; selector 6 vsb_PreFlightFontMem ds.l 1 ; selector 7 vOutlineMetrics ds.l 1 ; selector 8 vGetOutlinePreferred ds.l 1 ; selector 9 vSetPreserveGlyph ds.l 1 ; selector a vGetPreserveGlyph ds.l 1 ; selector b vsb_FlushFonts ds.l 1 ; selector c vsb_SFNTMatchSize ds.l 1 ; selector d vfs_LowestPPEM ds.l 1 ; selector e InitializePartialFonts ds.l 1 ; selector f <14> InitializeDiskCache ds.l 1 ; selector 10 <14> size equ * endr DispatchFontScaler record 0 entries ds.l 1 vfs_OpenFonts ds.l 1 ; selector 0 vfs_Initialize ds.l 1 ; selector 1 vfs_NewSfnt ds.l 1 ; selector 2 vfs_NewTransformation ds.l 1 ; selector 3 vfs_NewGlyph ds.l 1 ; selector 4 vfs_GetAdvanceWidth ds.l 1 ; selector 5 vfs_ContourGridFit ds.l 1 ; selector 6 vfs_ContourNoGridFit ds.l 1 ; selector 7 vfs_FindBitMapSize ds.l 1 ; selector 8 vfs_SizeOfOutlines ds.l 1 ; selector 9 vfs_SaveOutlines ds.l 1 ; selector a vfs_RestoreOutlines ds.l 1 ; selector b vfs_ContourScan ds.l 1 ; selector c vfs_CloseFonts ds.l 1 ; selector d if TheFuture then vfs_GetGlyphInfo ds.l 1 ; selector e vfs_GetGlyphData ds.l 1 ; selector f vfs_GetBitMapInfo ds.l 1 ; selector 10 vfs_GetBitMapData ds.l 1 ; selector 11 endif size equ * endr ; FontCacheTable PROC EXPORT ; ex dc.l (@end-*)/4 CASE OFF dcImportResident IsOutline dcImportResident SetOutlinePreferred dcImportResident SB_KillSomeCaches dcImportResident sb_FillPrinterWidths dcImportResident sb_RetrieveGlyph dcImportResident sb_FillWidthTab dcImportResident sb_SearchForCache dcImportResident sb_PreflightFontMem dcImportResident OutlineMetrics dcImportResident GetOutlinePreferred dcImportResident SetPreserveGlyph dcImportResident GetPreserveGlyph dcImportResident sb_FlushFonts dcImportResident sb_SFNTMatchSize dcImportResident fs_LowestPPEM dcImportResident InitializePartialFonts dcImportResident InitializeDiskCache CASE OBJ @end FontScalerTable PROC EXPORT ; ex dc.l (@end-*)/4 CASE OFF dcImportResident fs_OpenFonts dcImportResident fs_Initialize dcImportResident fs_NewSfnt dcImportResident fs_NewTransformation dcImportResident fs_NewGlyph dcImportResident fs_GetAdvanceWidth dcImportResident fs_ContourGridFit dcImportResident fs_ContourNoGridFit dcImportResident fs_FindBitMapSize dcImportResident fs_SizeOfOutlines dcImportResident fs_SaveOutlines dcImportResident fs_RestoreOutlines dcImportResident fs_ContourScan dcImportResident fs_CloseFonts CASE OBJ @end ;—————————————————————————————————————————————————————————————————————————————————————————— ; Boot-time initialization code, if any, goes here. ;—————————————————————————————————————————————————————————————————————————————————————————— InstallBassCommon InstallProc (Plus,SE,II,Portable,IIci) ; Changed back from a plain PROC ;—————————————————————————————————————————————————————————————————————————————————————————— ; Allocate splinekey memory… ;—————————————————————————————————————————————————————————————————————————————————————————— MOVE.L #splineKeyRec.splineKeySize, D0 ;Size of splinekey _NewHandle ,SYS,CLEAR BNE @bailOut ; We are hosed MOVE.L expandMem, A2 ; get low mem expand MOVE.L A0, ExpandMemRec.emSplineKey(A2) ; Handle to splineKey MOVE.L (A0), A2 ; Get the ptr in a reg MOVE.B #1, splineKeyRec.mfExists(A2) ; multiFinder always exists in 7.0 _HLock ; ;—————————————————————————————————————————————————————————————————————————————————————————— ; Fill out dispatch tables… ;—————————————————————————————————————————————————————————————————————————————————————————— leaResident FontCacheTable,A0 ; ex Instead of making a NewPtr MOVE.L A0, splineKeyRec.vFontCache(A2) ; Save dispatch table ptr (fontCache) ; ex ...No need to fill table leaResident FontScalerTable,A0 ; ex Instead of making a NewPtr MOVE.L A0, splineKeyRec.vFontScaler(A2) ; Save dispatch table ptr (fontScaler) ; ex ...No need to fill table ;—————————————————————————————————————————————————————————————————————————————————————————— ; Initialize the splinePreferred flag… ;—————————————————————————————————————————————————————————————————————————————————————————— BCLR #preserveGlyph, HiliteMode ;Do not always blit everything unless set BCLR #splinePreferred, HiliteMode ;Clear the low mem bit ;—————————————————————————————————————————————————————————————————————————————————————————— ; Set up flags… ;—————————————————————————————————————————————————————————————————————————————————————————— MOVE.L #$A89F, D0 ;Unimplemented trap _GetTrapAddress MOVE.L A0, D3 MOVE.L #$AB03, D0 _GetTrapAddress newTool ; see where trap is CMP.L A0, D3 SNE.B splineKeyRec.is32bit(A2) ;Set the 32 bit color flag ;—————————————————————————————————————————————————————————————————————————————————————————— ; Unlock the splineKey globals… ; A2 no longer has splineKeyPtr. ; Must unlock before calling SB_INITMEMORY. ;—————————————————————————————————————————————————————————————————————————————————————————— MOVE.L expandMem, A0 ; get low mem expand MOVE.L ExpandMemRec.emSplineKey(A0),A0 ; Handle to splineKey _HUnlock ; Unlock splineKey globals rts ; Exit anyway @bailOut MOVE.L expandMem, A2 ; get low mem expand CLR.L ExpandMemRec.emSplineKey(A2) ; Handle to splineKey RTS ; <=== in any case ;—————————————————————————————————————————————————————————————————————————————————————————— ; Force _InitFonts to be called. ; Don’t include Mac Plus in ROM list, since FMExist doesn’t on the Plus. ;—————————————————————————————————————————————————————————————————————————————————————————— ForceInitFontsCall InstallProc (SE,II,Portable,IIci) ; Changed back from a plain PROC ST FMExist rts ENDPROC ;—————————————————————————————————————————————————————————————————————————————————————————— ; Correct the proc that contains a pointer into the trap table. ;—————————————————————————————————————————————————————————————————————————————————————————— PlusCorrectTxMeasVector InstallProc (Plus) ; Recreated IMPORT JStdTxMeas LEA JStdTxMeas,A0 SUB.L #$200,(A0) ; Delta between ToolTable on Plus vs everywhere else RTS ENDPROC ;—————————————————————————————————————————————————————————————————————————————————————————— ; Init the outline font cache ;—————————————————————————————————————————————————————————————————————————————————————————— InitPartialFonts InstallProc (Plus,SE,II,Portable,IIci) ; Recreated SUBQ #2,SP MOVE.L #10*1024,-(SP) ; Font cache size _InitializePartialFonts ADDQ #2,SP RTS ENDPROC ;—————————————————————————————————————————————————————————————————————————————————————————— ; Register our selector 'font' ;—————————————————————————————————————————————————————————————————————————————————————————— InstallFontGestalt InstallProc (Plus,SE,II,Portable,IIci) ; Changed back from a plain PROC IMPORT FontMgrGestalt MOVE.L #gestaltFontMgrAttr, D0 LEARESIDENT FontMgrGestalt, A0 ; _NewGestalt ; Install our function ; BEQ.S @noError ; error is in D0 ; DC.W $A9FF ; let me know if it failed ;@noError RTS EndProc ;••••••••••••••••••••••••Temporary hack for InitZone ;---------------------------------------------------------------------- ; ; Procedure InitZoneGlue(growProc: ProcPtr; ; moreMasters: Integer; ; limitPtr,startPtr : Ptr); ; Creates and initializes a fresh zone from unstructured storage ; ; Arguments: ; growProc: points to grow procedure for this zone ; moreMasters: number of master pointers to create at a time ; limitPtr: points one past last byte of raw storage ; startPtr: points to first byte of raw storage ; ; Registers: ; D0 - result code from InitApplZone ; INITZONEGLUE PROC EXPORT MOVE.L (SP)+,A1 ;return address Move.L SP,A0 ;stack parameters form req blk _InitZone Add #14,SP ;strip parameters JMP (A1) ;return via A1 ;••••••••••••••••••••••••••••••••••••••• ;—————————————————————————————————————————————————————————————————————————————————————————— ; END Spline_PatcheeTail.a!!! ;—————————————————————————————————————————————————————————————————————————————————————————— End