LOAD 'Macros.dump' INCLUDE 'Pict.equ' INCLUDE 'Driver.equ' IMPORT Q_ChangePictSize IMPORT Q_Copy2 IMPORT Q_Copy4 IMPORT D_KillFont IMPORT D_NeedHandle IMPORT Q_Nop IMPORT Q_PixRect IMPORT D_SelectFont IMPORT Q_addbytes IMPORT count IMPORT oldptr IMPORT Q_pictSCB IMPORT Q_picterr IMPORT temp IMPORT Q_theBGcolor IMPORT Q_theChExtra IMPORT Q_theFGcolor IMPORT Q_theFontFlags IMPORT Q_theMask IMPORT Q_thePnSize IMPORT Q_theSpExtra IMPORT Q_theTxFont IMPORT Q_theTxLoc IMPORT Q_theTxMode IMPORT Q_txtBounds IMPORT Q_txtHandle IMPORT Q_txtHsize IMPORT Q_txtImage IMPORT Q_txtPort IMPORT Q_txtPortLoc IMPORT Q_txtRect IMPORT Q_txtSCB IMPORT Q_txtWidth ENTRY Q_MakeTextImage **************************************************************** * ; * Q_Text rotating and flipping routines ; *______________________________________________________________* * ; * FUTURE EXTENSIONS: ; * ; * -- Don't actually record Q_Text size, style, ; * font, color, and flags opcodes in the ; * mangled picture ; * ; * -- Record them as part of a PicComment, along ; * with the orientation of the Q_Text image, so ; * that they can be restored as actual Q_Text ; * call if the picture is restored to its ; * original orientation. ; * ; * -- Add PostScript PicComments so that the ; * rotated/flipped Q_Text still prints out nice ; * and pretty. ; * ; **************************************************************** **************************************************************** * * Q_TextOps -- handle picture opcodes for Q_Text * **************************************************************** Q_TextOps PROC EXPORT ;Using Q_PictData EXPORT Q_FgColor EXPORT Q_BgColor EXPORT Q_TxFont EXPORT Q_TxFace EXPORT Q_TxSize EXPORT Q_TxMode EXPORT Q_ChExtra EXPORT Q_SpExtra EXPORT Q_FontFlags EXPORT Q_Text EXPORT Q_DhText EXPORT Q_DvText EXPORT Q_DhDvText EXPORT Q_LongText *--------------------------------------------------------------* * Remember the foreground color ; *--------------------------------------------------------------* Q_FgColor ; jsl Q_Nop ; move the opcode moveword [ and #7 clc adc Q_txtWidth sta Q_txtWidth ; NOW I've got it. asl a ; compute the adjusted ;pixel* width ldx Q_txtSCB ; 320 or 640? beq gotbnds asl a gotbnds sta Q_txtBounds+6 ; got it! spacelong pushword Q_txtWidth pushword Q_txtBounds+4 _Multiply addlong s,#34,Q_txtHsize ; (34 bytes for Q_PixRect parameters) spacelong ; allocate image handle pushlong Q_txtHsize pushword #$8010 ; lock it within one bank jsl D_NeedHandle sta Q_picterr ; store the error code pulllong ihand jcs abort ; (uh oh.) movelong [ihand],iptr addlong iptr,#34,Q_txtImage ; Adjust ptr back for portLoc movelong ihand,Q_txtHandle pushlong #Q_txtPortLoc _SetPortLoc _PenNormal pushword bg _SetSolidPenPat pushlong #Q_txtBounds _PaintRect pushlong Q_thePnSize _SetPenSize pushlong #Q_theMask _SetPenMask pushword fg _SetForeColor pushword bg _SetBackColor pushword Q_theFontFlags _SetFontFlags pushword #4 ; foreCopy _SetTextMode pushlong txtPoint _MoveTo pushlong txtPtr ; FINALLY! Draw the Q_Text! pushword txtCount _DrawText jsl D_KillFont *--------------------------------------------------------------* * Set up the fake BitsRect opcode structure ; *--------------------------------------------------------------* moveword #$90,[iptr] ; BitsRect opcode moveword Q_pictSCB,[iptr]:#2 ; SCB (MUST be same as picture's) moveword #0,[iptr]:#4 ; BWvsColor moveword Q_txtWidth,[iptr]:#6 ; width movelong #0,[iptr]:#8 ; top left of bounds Q_Rect moveword Q_txtBounds+4,[iptr]:#12 ; bottom of bounds Q_Rect lda Q_txtWidth asl a ; recompute the adjusted pixel width ldx Q_pictSCB ; 320 or 640? beq gotbnds2 asl a gotbnds2 moveword a,[iptr]:#14 ; store it movelong Q_txtRect,[iptr]:#16 ; top left of src Q_Rect (ADJUST?) moveword Q_txtRect+4,[iptr]:#20 ; bottom of src Q_Rect lda Q_txtRect+6 ; ---- ADJUST SOURCE Q_Rect RIGHT ---- ldx Q_txtSCB ; what mode was the Q_Text in? beq was320 ldx Q_pictSCB ; 640. Is the picture? bne putright dec a ; nope. adjust the source bounds lsr a inc a bra putright was320 ldx Q_pictSCB ; 320. Is the picture? beq putright asl a ; nope. adjust it. putright moveword a,[iptr]:#22 ; store it. subword Q_theTxLoc,txtPoint,[iptr]:#24 ; top of dest. subword Q_theTxLoc+2,txtPoint+2,[iptr]:#26 ; left of dest. addword [iptr]:#20,[iptr]:#24,[iptr]:#28 ; bot. of dest. addword [iptr]:#22,[iptr]:#26,[iptr]:#30 ; right of dest. moveword mode,[iptr]:#32 ; mode bra abort notext movelong #0,Q_txtHsize abort _SetPort ; restore the old port return Q_picterr ENDP END