Skip to content

Commit

Permalink
Reverse printing glue
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotnunn committed Dec 26, 2017
1 parent 76713a2 commit 8cc7afa
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
Binary file removed BuildResults/RISC/Obj/Printing.a.o
Binary file not shown.
Binary file added BuildResults/RISC/Obj/PrintingExtra.a.o
Binary file not shown.
21 changes: 17 additions & 4 deletions Toolbox/Printing/PrintGlue.a
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,12 @@ GotPDEF
_GetHandleSize ; How big is our PDEF Handle <LW2> fau
cmp.l #32,D0 ; Is it "small" <LW2> fau
bhi.s @RealPDEF ; no, don't flush the cache <LW2> fau
jsr ([jCacheFlush]) ; else, flush the caches. <LW2> fau
move.l A0,-(SP)
move.l (A0),A0
move.l D0,A1
import FLUSHCRANGE
bsr.l FLUSHCRANGE ; else, flush the caches.
move.l (SP)+,A0
@RealPDEF ; <LW2> fau
_HLock
;<22Feb87> JNP Restore curMap before jumping into the print code.
Expand All @@ -375,7 +380,7 @@ GotPDEF
Add.b ParmByt(a6),d0
Sub.w d0,sp ; We know the thing isn't actually more than a word wide
Move.l sp,a1 ; Beginning of destination
_BlockMove ; Note: Leaves d0 = 0
_BlockMoveData ; Note: Leaves d0 = 0
; Call the routine. The offset into the PDEF to jump to is given by the glue parameter
Move.b CodeOfs(a6),d0 ; Get offset (note high part of d0 is still 0)
Andi.b #$7F,d0 ; Mask off the unlock bit that is stored there
Expand Down Expand Up @@ -543,9 +548,17 @@ SetError
LLOut
Add.w #IOQElSize,sp ; Strip parameter block
Move.w d0,PrintVars+iPrErr ; Set return code
GlueOut
GlueOut
;
; Get the number of bytes of parameter to this entry in d1
Move.l sp,-(sp)
Moveq.l #0,d0
Move.b FuncByt(a6),d0
Lsr.b #3,d0
Move.l d0,-(sp)
Import PRINTINGNEWFUNC_337D0
Bsr PRINTINGNEWFUNC_337D0
Addq #8,sp
Moveq #0,d1
Move.b ParmByt(a6),d1 ; Get from the table, source of all knowledge...
; Copy the function value, if any, back up to the caller's stack frame
Expand Down Expand Up @@ -670,7 +683,7 @@ kAliasID EQU -8192 ; System Printer alias's resID
MOVE.B (A0), D0 ; which is this long
ADDQ.B #1, D0 ; plus that length byte!
LEA sysFileSpec + FSSpec.name(A6), A1 ; to the FSSpec
_BlockMove
_BlockMoveData

; ResolveDriver: Resolve the alias using the system file's FSSpec.

Expand Down
12 changes: 12 additions & 0 deletions Toolbox/Printing/Printing.make
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PrintingObjs = "{ObjDir}PrintGlue.a.o" ¶
"{ObjDir}PrintingExtra.a.o"


"{ObjDir}PrintGlue.a.o" Ä "{ObjDir}StandardEqu.d" ¶
"{AIncludes}PrPrivate.a" ¶
"{PrintingDir}PrintGlue.a"
Asm {StdAOpts} -o "{Targ}" "{PrintingDir}PrintGlue.a"


"{LibDir}Printing.lib" Ä {PrintingObjs}
Lib {StdLibOpts} -o "{Targ}" {PrintingObjs}
4 changes: 3 additions & 1 deletion Toolbox/Toolbox.make
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ToolboxObjs = "{ObjDir}PackageMgr.a.o"
"{ObjDir}GetMgr.a.o" ¶
"{ObjDir}TextEdit.lib" ¶
"{ObjDir}ScrapMgr.a.o" ¶
"{ObjDir}Printing.a.o" ¶
"{LibDir}Printing.lib" ¶
"{ObjDir}SexyDate.a.o"


Expand Down Expand Up @@ -44,6 +44,7 @@ ToolboxObjs = "{ObjDir}PackageMgr.a.o"

# The following libs are *not* part of Toolbox.lib

PrintingDir = "{ToolBoxDir}Printing:"
AliasMgrDir = "{ToolBoxDir}AliasMgr:"
ComponentMgrDir = "{ToolBoxDir}ComponentMgr:"
DataAccessDir = "{ToolBoxDir}DataAccessMgr:"
Expand All @@ -61,6 +62,7 @@ FontMgrDir = "{ToolBoxDir}FontMgr:"
SANEDir = "{ToolBoxDir}SANE:"
InSaneDir = "{ToolBoxDir}InSANE:"

#include "{PrintingDir}Printing.make"
#include "{AliasMgrDir}AliasMgr.make"
#include "{ComponentMgrDir}ComponentMgr.make"
#include "{DataAccessDir}DataAccessMgr.make"
Expand Down

0 comments on commit 8cc7afa

Please sign in to comment.