M EQU Byte Ptr 0[BX] TITLE 'Rasterize Objects in the Vector list into Bit map' DGROUP GROUP DATA ; **************************************************************************** ; * * ; * DORASTER : RASTER CONVERTS THE VECTOR LISTS STORED IN THE OBJECT * ; * LIST BUFFER (OBJLST) INTO THE PRINTER BITMAP BUFFER * ; * * ; **************************************************************************** ; * ; Revision : Jan. 26, 1984 File "DORASTER.A86" GSX-86 V1.3b 1-0 * ; * ;***** MODE NOTES : ********************************************************* ; * ; Dec-21-83 Save Es, The bit map buffer memory segment register * ; Nov-19-83 Reinitialize Current Device Attribute List, Move values from * ; NDINIT to ndlnsz * ; Apr-26-83 Add Bar Fill Optimization Code, DOGDP routine * ; Jan-26-84 Check Error Flag and rasterizes no more object * ; * ;***** MODE NOTES : ********************************************************* ; ; ; * ; Raster (objcnt, objlst) * ; * ; Input : * ; * ; OBJLST : Object List Buffer * ; * ; Output : * ; * ; BITMAP : Bitmap buffer ready for scan output to the printer * ; * ; Description : * ; Get the Parameter Block Address Pointer from and * ; Jump to the Program identified by the Opcode in Contrl(1) * ; * ; do i = 1, objcnt * ; Get opcode * ; Call Subroutine * ; * ; Program Jump Table : * ; * ; DOTBL : Sequence of addresses pointing to the start address of * ; a number of different programs supporting the graphic * ; function required * ; i.e. DOTBL(0) = Start address of the Polyline routine * ; DOTBL(1) = Start address of the Polymaker routine * ; DOTBL(2) = Start address of the Text routine * ; * ; * ;***************************************************************************** PUBLIC RASTER dseg EXTRN NDINIT:word, Error_flg:byte EXTRN XMAX:word, YMAX:word, XMIN:word, YMIN:word EXTRN NDLNSZ:byte, NDTXSZ:byte, NDMKSZ:byte, NDTXRT:byte EXTRN WKID:byte, NDLNTY:byte, NDLNCO:byte, NDMKTY:byte EXTRN NDMKCO:byte, NDTXTY:byte, NDTXCO:byte, ndrite:byte EXTRN NDINTY:byte, NDFITY:byte, NDFICO:byte EXTRN OBJCNT:word, OBJLST:word, RSTAT:byte, BNEXT:word cseg EXTRN DOLINE:near, DOMARK:near, DOTEXT:near EXTRN DOBAR:near EXTRN DOFILL:near, dogdp:near EXTRN docell:near EXTRN SELNTY:near, SELNSZ:near, SELNCO:near EXTRN SETXSZ:near, SETXRT:near, SETXTY:near, SETXCO:near EXTRN SEFITY:near, SEFINX:near, SEFICO:near EXTRN GETNXT:near, SEMKTY:near, SEMKSZ:near, SEMKCO:near EXTRN DOROLL:near, NOFILE:near, serite:near dseg ;----------------------------------------------------------------------------+ ; The Opcode Program Jump Table + ;----------------------------------------------------------------------------+ DOTBL: DW (Offset noact) ; Escape Sequences, Opcode = 5 DW (Offset DOLINE) ; PolyLine, Opcode = 6 DW (Offset DOMARK) ; Polymarker, Opcode = 7 DW (Offset DOTEXT) ; Text, Opcode = 8 DW (Offset DOFILL) ; Fill Area, Opcode = 9 ; cell array currently outlined by polyline routine, docell is a dummy module ; declared in dogdp routine DW (Offset DOCELL) ; Cell Array, Opcode = 10 ; GDP Bar is supported by dobar in Fill Area (dofill) routine DW (Offset dogdp) ; GDP, Bar Opcode = 11,1 DW (Offset SETXSZ) ; Set Char Height Opcode = 12 DW (Offset SETXRT) ; Set Char Up Vector Opcode = 13 DW (Offset noact) ; Set Color Rep Opcode = 14 DW (Offset SELNTY) ; Set Polyline Type Opcode = 15 DW (Offset SELNSZ) ; Set Polyline Width Opcode = 16 DW (Offset SELNCO) ; Set Polyline Color Opcode = 17 DW (Offset SEMKTY) ; Set Polymarker Typ Opcode = 18 DW (Offset SEMKSZ) ; Set Polymarker Scl Opcode = 19 DW (Offset SEMKCO) ; Set Polymarker Clr Opcode = 20 DW (Offset SETXTY) ; Set Text Font Opcode = 21 DW (Offset SETXCO) ; Set Text Color Opcode = 22 DW (Offset SEFITY) ; Set Fill Int Style Opcode = 23 DW (Offset SEFINX) ; Set Fill Sty Index Opcode = 24 DW (Offset SEFICO) ; Set Fill Color Opcode = 25 DW (Offset noact) ; Inq Color Rep Opcode = 26 DW (Offset noact) ; Inq Cell Array Opcode = 27 DW (Offset noact) ; Input Locator Opcode = 28 DW (Offset noact) ; Input Valuator Opcode = 29 DW (Offset noact) ; Input Choice Opcode = 30 DW (Offset noact) ; Input String Opcode = 31 DW (Offset serite) ; Set Writing Mode Opcode = 32 DW (Offset noact) ; Set Input Mode Opcode = 33 cseg INDEX EQU (Offset DOTBL)-10 ; Base Offset from Opcode 0 RASTER: ; Initialize Device Default Attribute Value List Push Es MOV AX,DS ;Setup DS:SI and ES:DI MOV ES,AX MOV DI,(Offset ndlnsz) ;These Are the Current Attibute Values MOV SI,(Offset NDINIT) ;These Default Values Never get Modified MOV CX,30 CLD ;Auto Increment Move Direction REP MOVSW Pop Es ; Initialize OBJLST buffer and Roll-Out Area Byte Pointer, ; The entire object list must be rasterized for each plot strip MOV AL,Byte Ptr RSTAT ;Object List Buffer Roll-Out File Status AND AL,AL ;Was Roll-Out File Created ? JZ RASJ02 ;Initialize Object List Buffer Address ;Pointers CALL DOROLL ;Reset Roll-Out Area with The First JMPS RASJ03 ;Roll-Out File Record RASJ02: CALL NOFILE RASJ03: ; Decrement objcnt MOV BX,Word Ptr OBJCNT RASL01: ;Check Error Flag and skip list if file error occured Cmp Byte Ptr Error_flg, 0FFh Je Rasj99 DEC BX ; Object count = 0 ? JS RASJ99 ;Yes, Done ; No, next opcode from objlst PUSH BX ;Save objcnt on stack CALL GETNXT ; Jump to the required program identified by the opcode MOV BX, INDEX ;Program jump table Base address ROL AL,1 ADD AL,BL ;Compute the Opcode Offset : * 2 MOV BL,AL MOV AL,0 ;Add offset to base ADC AL,BH MOV BH,AL ; = Program Location Pointer MOV DL,M INC BX MOV DH,M ; = Program start address MOV BX,(Offset DONEXT) ;Set up Return address on stack PUSH BX XCHG BX,DX JMP BX ;and Go do it ; Next Object DONEXT: POP BX JMPS RASL01 NOACT: RASJ99: RET END