Commit 3b6fe404 authored by ROOL's avatar ROOL 🤖
Browse files

This commit was manufactured by cvs2git to create branch 'unlabeled-4.1.3.1.2'.

Sprout from StrongARM 1996-11-06 03:06:12 UTC Neil Turton <nturton@gitlab.riscosopen.org> 'Import from cleaned 370 CD'
Delete:
    !Mk,fd7
    !MkClean,fd7
    !MkInstall,fd7
    Doc/ToDo
    Makefile
    s/Core/ColTrans
    s/Core/Colour
    s/Core/Constants
    s/Core/Device
    s/Core/Draw
    s/Core/Error
    s/Core/FontSWI
    s/Core/Header
    s/Core/Intercept
    s/Core/JPEGSWI
    s/Core/JobManager
    s/Core/MsgCode
    s/Core/OSByte
    s/Core/PDriver
    s/Core/SWIs
    s/Core/Sprite
    s/Core/Vdu5
    s/Core/Workspace
    s/Core/Wrch
    s/PDriverDP/Colour
    s/PDriverDP/Configure
    s/PDriverDP/Constants
    s/PDriverDP/Draw
    s/PDriverDP/Font
    s/PDriverDP/GlobalWS
    s/PDriverDP/JPEG
    s/PDriverDP/JobWS
    s/PDriverDP/Macros
    s/PDriverDP/ManageJob
    s/PDriverDP/MiscOp
    s/PDriverDP/PageBox
    s/PDriverDP/Picture
    s/PDriverDP/Plot
    s/PDriverDP/Private2
    s/PDriverDP/ScreenDump
    s/PDriverDP/Sprite
    s/PDriverDP/TranSprite
    s/PDriverDP/Vdu5
    s/PDriverPS/Colour
    s/PDriverPS/Configure
    s/PDriverPS/Constants
    s/PDriverPS/Draw
    s/PDriverPS/Font
    s/PDriverPS/GlobalWS
    s/PDriverPS/JPEG
    s/PDriverPS/JobWS
    s/PDriverPS/Macros
    s/PDriverPS/ManageJob
    s/PDriverPS/MiscOp
    s/PDriverPS/PageBox
    s/PDriverPS/Picture
    s/PDriverPS/Plot
    s/PDriverPS/Private
    s/PDriverPS/ScreenDump
    s/PDriverPS/Sprite
    s/PDriverPS/TranSprite
    s/PDriverPS/Vdu5
    s/PrinterDP
    s/PrinterPS
parent 445e0179
| Copyright 1996 Acorn Computers Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine all
| Copyright 1996 Acorn Computers Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine clean
| Copyright 1996 Acorn Computers Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine install INSTDIR=<Install$Dir>.Disc.Printing.!Printers.Modules
SWI Documentation:
PDriver_DeclareFont
PDriver_DeclareDriver
PDriver_RemoveDriver
PDriver_SelectDriver
PDriver_EnumerateDrivers
PDriver_MiscOp
PDriver_MiscOpForDriver
PDriver_SetDriver
New structure of Printer drivers, ie. pdumpers, pdriver, pdriverXX
Notes on writing your own printer drivers
Driver numbers *upto date list*
PDumpers:
What are they
How do they work
Writing them
Limitations
Suggested practices, suggested interface.
--------------------------------------------
PDriverPS: need to think of a defined method for ISVs to add their own
procs. Don't want them polluting PDdict, but we could reserve one entry
in PDDict (say ISVdict) for them to define and use. Then need code to
ensure that it is on the dict stack whenever required:
PDDict begin ISVdict begin % but with a check that ISVdict exists...
and need to ensure that "def" definitions go to the right place!! One way would
be to ensure that stuff in PDDict never assumes the PDDict is on the top of the dict
stack.
Also need: a way for ISVs to augment the prologue on the fly
PDDict begin
/ISVDict 1 dict def
end
PDDict begin ISVDict begin
end /ISVDict 100 dict begin ... definitions in ISVdict ...
end end
--------------------------------------------
PDriverPS: Remapping to fonts with funny encodings
==================================================
SAH: 3FEB93
At present any font that is mapped to a native printer font will get
re-encoded. If the font does have an Encoding associated with it (either by
the based-on method or by having an Encoding file in it) then we currently
just default to Old Latin 1. This causes problems when the font is
non-alphabetic (eg Dingbats). We should perhaps assume that the font should
not be re-encoded in this case, and hope the glyph positions match up
adequately; alternatively, make use of the encoding information specified in
FontPrint. The latter approach is much better because we know that Old
Latin 1 and Adobe Standard differ quite a lot.
Augment the information specified in the Encoding menu of FontPrint to include
an "As Is" option, which does forces MakePSFont to not re-encode:-
Adobe.Standard -> use Old Latin 1
Adobe.Special -> use Sidney encoding
Adobe.Dingbats -> use Selwyn encoding.
As Is -> do not re-encode; assume the printer encoding is same as ours.
This is not perfect, but will probably be a lot more helpful
than using Old Latin 1 if the font is a symbolic one!
Could be implemented by replacing the contents of the Adobe directory (not
used at present) by files containing OUR versions of the Adobe encodings;
for example, Adobe.Standard would contain Old Latin 1, Adobe.Special would
contain Sidney encoding. The scheme is extensible; the FontPrint menu
is generated with reference to this directory. It would be necessary
to carefully document what is going on so that people do not assume that
these files *are* the Adobe ones. MakePSFont would then need to be modified
to use these specified encoding file if it can't pick the "right" one
by the normal methods.
The "do not re-encode" option would need special support in FontPrint and
MakePSFont; should be quite easy to do.
--------------------------------------------
PDriverPS: Determining when to generate EPS
===========================================
SAH: 17FEB93
Traditionally all PDriver_SelectIllustration jobs are output as EPS under
the assumption that they need to be includable in other PS jobs.
Unfortunately programs like Draw *always* use PDriver_SelectIllustration,
even though the user typically wants to send the result to the printer
straight away.
The problem is that illustration jobs don't have device setup code, because
this violates EPS structuring rules, so these jobs do not work properly when
printed standalone! (As a workaround the current version of PageBox on the
SrcFiler (3.41) has the test commented out, so that *all* jobs get device
setup code, even if they are illustrations).
The situation is not satisfactory. The assumption appears to have been that
all 1-page jobs can be done as EPS, but this is clearly wrong; in fact the
decision as to whether EPS should be produced should be made by the USER.
Ideally I'd like to add an option button to the PostScript printer
configuration window, saying "Produce EPS". Only if this is set AND the job
is an illustration one, then the EPS header should be produced. This avoids
making any changes to other apps, which can still call
PDriver_SelectIllustration for single-page jobs, and PDriver_SelectJob
otherwise.
(As a bodge-up, we could just alter the code so that
PDriver_SelectIllustration gets treated the same as PDriver_SelectJob unless
output is to a file. But this would not help people who are just spooling
to a floppy to take to a remote printer. Doing this bodge would only add to
the confusion, so let's not do it.)
BCockburn 17-Feb-93
As a follow-on to the comments above about an EPS button in the printer
configuration window perhaps with this interface the difference between
PDriver_SelectIllustration and PDriver_SelectJob could be removed! If EPS
is not selected the job is output with job setup information and as many
pages as required, if EPS is selected then no job setup information is
included. If more than one page starts to emerge and the job is going to
disc then create Printout.Page001, and Printout.Page002 etc. as separate
files each truly EPS conformant!
# Copyright 1996 Acorn Computers Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Makefile for PDModules (Printer Driver Modules - Dot Matrix & PostScript)
#
# ***********************************
# *** C h a n g e L i s t ***
# ***********************************
# Date Name Description
# ---- ---- -----------
# 04-Jul-94 AMcC Created.
#
#
# Program specific options:
#
COMPONENT = PDModules
TARGETS = rm.PDriverDP \
rm.PDriverPS
#
# Generic options:
#
MKDIR = cdir
AS = aasm
CP = copy
RM = remove
CCFLAGS = -c -depend !Depend -IC:
ASFLAGS = -depend !Depend -Stamp -quit -module
CPFLAGS = ~cfr~v
#
# Generic rules:
#
all: ${TARGETS}
@echo ${COMPONENT}: all built (disc)
rom: ${TARGETS}
@echo ${COMPONENT}: all built (rom)
export: ${EXPORTS}
@echo ${COMPONENT}: export complete
install: ${TARGETS}
${CP} rm.PDriverDP ${INSTDIR}.PDriverDP ${CPFLAGS}
${CP} rm.PDriverPS ${INSTDIR}.PDriverPS ${CPFLAGS}
Access ${INSTDIR}.PDriverDP lr/r
Access ${INSTDIR}.PDriverPS lr/r
@echo ${COMPONENT}: installed (disc)
install_rom: ${TARGETS}
${CP} rm.PDriverDP ${INSTDIR}.PDriverDP ${CPFLAGS}
${CP} rm.PDriverPS ${INSTDIR}.PDriverPS ${CPFLAGS}
@echo ${COMPONENT}: installed (rom)
clean:
${RM} rm.PDriverDP
${RM} rm.PDriverPS
@echo ${COMPONENT}: cleaned
rm.PDriverDP: s.PrinterDP
${AS} ${ASFLAGS} -To $@ -From s.PrinterDP
rm.PDriverPS: s.PrinterPS
${AS} ${ASFLAGS} -To $@ -From s.PrinterPS
# Dynamic dependencies:
This diff is collapsed.
; Copyright 1996 Acorn Computers Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
; Core.Colour
;----------------------------------------------------------------------------
;
; Colour handling subroutines
;
;----------------------------------------------------------------------------
; Routine to work out the RGB value that corresponds to a particular GCOL/
; tint combination.
;
; Entry: R1 = GCOL in bits 15-8, tint in bits 7-0
; Exit: R1 = &BBGGRR00
; NB does not return errors. V not significant on exit.
[ Medusa
; 8bpp full palette: as for 8bpp non-full palette
; 16/32bpp: need to generate the &BBGGRR00 as for a
; standard palette from the GCOL and TINT
]
gcol_lookup
Push "R0,R2,R3,LR"
LDR R2,lgbpp
[ Medusa
TEQ R2, #4 ;16bpp?
TEQNE R2, #5 ; or 32bpp?
BEQ gcol_lookup_16or32 ; then rip the bits out directly
]
TEQ R2,#3
MOVNE R0,R1,LSR #8
MOVEQ R1,R1,LSR #6 ;If 256 colour, convert to pixel
ANDEQ R0,R1,#&87 ; value
ANDEQ R2,R1,#&38
ORREQ R0,R0,R2,LSL #1
ANDEQ R2,R1,#&40
ORREQ R0,R0,R2,LSR #3
gcol_lookup_common
MOV R1,#16
BL intcolour_readpalette
MOV R1,R2 ;Return colour in R1
Pull "R0,R2,R3,PC"
[ Medusa
gcol_lookup_16or32
Debuga Medusa, "gcol_lookup of ", R1
MOV R0, R1, LSR #8 ;GCol in R0
MOV R1, R1, LSR #6 ;Tint in R1 bits 0..1
AND R1, R1, #3 ; with other bits clear
AND R2, R0, #4_0003 ;Extract red
ORR R2, R1, R2, LSL #2 ; or the tint in
MOV R3, R2, LSL #15-4 ; place it in destination bits
AND R2, R0, #4_0030 ;Extract green
ORR R2, R1, R2 ; or the tint in
ORR R3, R3, R2, LSL #23-4 ; place it in destination bits
AND R2, R0, #4_0300 ;Extract blue
ORR R2, R1, R2, LSR #2 ; or the tint in
ORR R3, R3, R2, LSL #31-4 ; place it in destination bits
ORR R1, R3, R3, LSR #4 ; duplicate nibbles
Debug Medusa, "Returns ", R1
Pull "R0,R2,R3,PC"
]
; A similar routine that looks up a pixel value, supplied in bits 0-7 of R1.
pixval_lookup
Push "R0,R2,R3,LR"
MOV R0,R1
B gcol_lookup_common
; Routine to read interesting variables about the current screen mode and
; do some preprocessing on them.
readcurvduvariables
Push "R0,R1,LR"
ADR R0,vduvariableswanted
ADR R1,fgmode
SWI XOS_ReadVduVariables
ADRVC R1,fggcol ;Combine foreground GCOL and TINT
LDMVCIA R1,{R0,R1} ; into a single word
ORRVC R1,R0,R1,LSL #8
STRVC R1,fggcol
ADRVC R1,bggcol ;Combine background GCOL and TINT
LDMVCIA R1,{R0,R1} ; into a single word
ORRVC R1,R0,R1,LSL #8
STRVC R1,bggcol
STRVS R0,[R13]
Pull "R0,R1,PC"
ASSERT fggcol = fgmode + 4
ASSERT fgrgb = fggcol + 4
ASSERT bgmode = fgrgb + 4
ASSERT bggcol = bgmode + 4
ASSERT bgrgb = bggcol + 4
ASSERT lgbpp = bgrgb + 4
ASSERT currxeig = lgbpp + 4
ASSERT curryeig = currxeig + 4
vduvariableswanted
DCD VduExt_GPLFMD
DCD VduExt_GFTint
DCD VduExt_GFCOL
DCD VduExt_GPLBMD
DCD VduExt_GBTint
DCD VduExt_GBCOL
DCD VduExt_Log2BPP
DCD VduExt_XEigFactor
DCD VduExt_YEigFactor
DCD -1
; Routine to determine the foreground or background colour.
; Entry: HI if background wanted, LS if foreground wanted
; R1 contains set of 'disabled' flags to ignore.
; Exit: disabled_colour bit of 'disabled' set or cleared as appropriate,
; EQ set and R1 = &BBGGRR00 <=> all appropriate bits of disabled are
; zero; R1 corrupt otherwise.
gcol_lookupfgorbg
BHI gcol_lookupbg
; Routine to determine the foreground colour.
; Entry: R1 contains set of 'disabled' flags to ignore.
; Exit: disabled_colour bit of 'disabled' set or cleared as appropriate,
; EQ set and R1 = &BBGGRR00 <=> all appropriate bits of disabled are
; zero; R1 corrupt otherwise.
; NB does not return errors. V insignificant on return
gcol_lookupfg
Push "R0,R2,R3,LR"
ASSERT fggcol = fgmode + 4
ASSERT fgrgb = fggcol + 4
ADR LR,fgmode
B gcol_lookupcommon
; Routine to determine the background colour.
; Entry: R1 contains set of 'disabled' flags to ignore.
; Exit: disabled_colour bit of 'disabled' set or cleared as appropriate,
; EQ set and R1 = &BBGGRR00 <=> all appropriate bits of disabled are
; zero; R1 corrupt otherwise.
; NB does not return errors. V insignificant on return
gcol_lookupbg
Push "R0,R2,R3,LR"
ASSERT bggcol = bgmode + 4
ASSERT bgrgb = bggcol + 4
ADR LR,bgmode
gcol_lookupcommon
MOV R3,R1
LDMIA LR,{R0,R1,R2}
TST R0,#7
LDRB LR,disabled
ORRNE LR,LR,#disabled_colour
BICEQ LR,LR,#disabled_colour
STRB LR,disabled
BICS LR,LR,R3
Pull "R0,R2,R3,PC",NE
TEQ R1,#0
MOVMI R1,R2
BLPL gcol_lookup
TEQ R0,R0 ;Set EQ again
Pull "R0,R2,R3,PC"
END
; Copyright 1996 Acorn Computers Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
; > Core.Constants
;----------------------------------------------------------------------------
;
; Local constants
;
;----------------------------------------------------------------------------
; The top bit set value
TopBit EQU &80000000
; A very big number to trick the Font Manager ScanString calls
BigNum EQU &02000000
; Values for the 'disabled' flags.
disabled_vdu EQU 1:SHL:0 ;Disabled because VDU drivers are.
disabled_colour EQU 1:SHL:1 ;Disabled because GCOL action is not
; 0 MOD 8.
disabled_nopage EQU 1:SHL:2 ;Disabled because there's no current
; page.
disabled_nullclip EQU 1:SHL:3 ;Disabled because of a null clipping
; region.
; Values for the 'intercepting' and 'shouldintercept' flags.
; Note: only one spare bit! (only byte-wide flags in workspace)
intercept_wrch EQU 2_00000001
intercept_col EQU 2_00000010
intercept_draw EQU 2_00000100
intercept_spr EQU 2_00001000
intercept_byte EQU 2_00010000
intercept_font EQU 2_00100000
intercept_jpeg EQU 2_01000000
intercept_all EQU 2_01111111
; Values for the 'passthrough' flags.
passthrough_wrch EQU intercept_wrch
passthrough_col EQU intercept_col
passthrough_draw EQU intercept_draw
passthrough_spr EQU intercept_spr
passthrough_byte EQU intercept_byte
; Flags used by Font_Paint
fontpaintflag_justify EQU 1:SHL:0
fontpaintflag_rubout EQU 1:SHL:1
fontpaintflag_mpoint EQU 1:SHL:4
fontpaintflag_coordsblk EQU 1:SHL:5
fontpaintflag_matrix EQU 1:SHL:6
fontpaintflag_length EQU 1:SHL:7
fontpaintflag_usehandle EQU 1:SHL:8
fontpaintflag_kern EQU 1:SHL:9
fontpaintflag_reversed EQU 1:SHL:10
; Flags used by ColourTrans_SelectTable
selecttableflag_AbsoluteSprite EQU 1:SHL:0
selecttableflag_UseCurrent EQU 1:SHL:1
; The maximum legal error block length.
errorbufferlen EQU 256
globalerrorbufferlen EQU 256
; The length of the VDU 5/PLOT &D0-&D7 character buffer
textbufferlen EQU 256
; ***PRINTER SPECIFIC INFORMATION***
; Each type of printer may need its own constant declarations. These should
; be given in the following file.
; This file should only contain constant declarations and comments.
GET s.PDriver$DirSuffix..Constants
END
This diff is collapsed.
; Copyright 1996 Acorn Computers Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
; > Core.Draw
;----------------------------------------------------------------------------
;
; The DrawV interception routine
;
;----------------------------------------------------------------------------
interceptdraw
Push "LR"
; Is this Draw output we're not interested in?
LDRB LR,passthrough
TST LR,#passthrough_draw
Pull "PC",NE
; intercept but do precisely nothing if it is a counting pass
LDR LR, counting_pass
; Debug PageBox, "draw counting_pass = ",LR
CMP LR, #0
Pull "LR,PC",NE
; Intercept Draw_Fill, Draw_Stroke and Draw_ProcessPath calls.
TEQ R8,#DrawReas_Fill
BEQ intdraw_fill
TEQ R8,#DrawReas_Stroke
BEQ intdraw_stroke
TEQ R8,#DrawReas_ProcessPath
Pull "PC",NE
; This is a Draw_ProcessPath call. We can hand it on to the Draw module if
; it isn't meant to produce screen output. Otherwise, we produce an error.
SUB LR,R7,#1
CMP LR,#2-1
Pull "PC",HI
Push "R10,R11"
ASSERT :BASE:currenthandle = R12
ASSERT :INDEX:currenthandle = 0
ASSERT currentws = currenthandle + 4
LDMIA R12,{R10,R11} ;R10:=currenthandle, R11:=currentws
BL checkpersistenterror
BVS intdraw_process_persistentreturn
ADR r0, ErrorBlock_PrintCantDrawPlot
BL LookupSingle ; Always sets the V flag
BL makepersistenterror
intdraw_process_persistentreturn
Pull "R10,R11,PC"
MakeInternatErrorBlock PrintCantDrawPlot,,NoDPlot
; This is a Draw_Fill call. Main problem is whether printer drivers can
; manage the fill style requested. At present, we only allow fill styles
; 2_0000X0, 2_0110X0, 2_1000X0, 2_1100X0, 2_1110X0 and 2_1111X0.
intdraw_fill
Push "R1,R9-R11"
MOV R9,R1 ;Put fill style somewhere safe
; Pick up current job's workspace, check for persistent errors, enable
; ESCAPEs and pass through recursive OS_WriteC's
ASSERT :BASE:currenthandle = R12
ASSERT :INDEX:currenthandle = 0
ASSERT currentws = currenthandle + 4
LDMIA R12,{R10,R11} ;R10:=currenthandle, R11:=currentws
BL checkpersistenterror
BVS intdraw_fill_persistentreturn