This contains the code to allow EMIT to write directly to video RAM rather than using BIOS calls. You might want to copy the appropriate blocks to PYGMY.SCR, perhaps after block 177, and add a line to block 135 to load them. Or, the easiest way to try out this code is to open this file at unit #4 and use block 4001 as the load block. It will create DPYGMY.COM which will use the new version of EMIT. Test it out by browsing through PYGMY.SCR in the editor using the PgDn and PgUp keys. Switch between the BIOS and direct versions of EMIT by typing >SCR and >DIRECT and see if you can tell a difference in the speed. It is impressively faster on an XT or other slow hardware, less so on a '386 or better. Block 4001 has the phrase $3F ATTR ! commented out. If you have a color monitor you can remove the parentheses to set the colors to the ones I'm currently using. -- Frank, 10 August 93 ( load block to create a test file named DPYGMY.COM, which allows EMIT to write directly to video RAM rather than using BIOS calls. On slow, standard hardware, this will be much faster than using the BIOS.) 4002 4005 THRU : (BOOT2 ( -) INIT-VIDEO >DIRECT (BOOT ( $3F ATTR ! ) ; ' (BOOT2 IS BOOT SAVE DPYGMY.COM ( direct video EMIT on this & next 3 blocks ) VARIABLE VSEG VARIABLE 'CRTC VARIABLE CURSOR 80 CONSTANT C/LINE 25 CONSTANT L/SCR : INIT-VIDEO $B800 $40 $10 LC@ $30 AND $30 = $800 AND - VSEG ! $40 $63 L@ 'CRTC ! ; INIT-VIDEO ( VSEG is B800 for color and B000 for mono) ( 'CRTC is 03D4 for color and 03B4 for mono) HEX ( direct video EMIT ) CODE (DEMIT ( c) BX AX MOV, CURSOR ) DI MOV, ATTR ) BH MOV, ( keep attr in BH) SI PUSH, DS PUSH, ( save'em) VSEG ) CX MOV, CX DS MOV, CX ES MOV, ( pt to video ram) 0D #, AL CMP, 0=, IF, C/LINE #, CL MOV, DI AX MOV, 1 #, AX SHR, CL IDIV, AH AL MOV, AH AH SUB, C/LINE #, CX MOV, AX CX SUB, ( # words to fill) 20 #, AL MOV, BH AH MOV, ( add attr) REP, AX STOS, C/LINE 2* #, DI SUB, ELSE, 0A #, AL CMP, 0=, IF, C/LINE 2* #, DI ADD, ELSE, 07 #, AL CMP, 0=, IF, ( bell) 61 #, DX MOV, AL IN, 3 #, AL OR, AL OUT, -1 #, CX MOV, BEGIN, LOOP, FC #, AL AND, AL OUT, ELSE, 08 #, AL CMP, 0=, IF, ( bs) DI DEC, DI DEC, 20 #, AL MOV, BH AH MOV, AX 0 [DI] MOV, ( continued on next screen ) HEX ( direct video EMIT (DEMIT continued ) ELSE, 0 #, AL CMP, 0=, IF, ( do nothing except set cursor) ELSE, BH AH MOV, AX STOS, ( CS: #OUT INC ) THEN, THEN, THEN, THEN, THEN, C/LINE L/SCR * 2* #, DI CMP, <, NOT, IF, DI DI SUB, C/LINE 2* #, SI MOV, C/LINE L/SCR 1- * #, CX MOV, REP, AX MOVS, C/LINE #, CX MOV, 20 #, AL MOV, BH AH MOV, REP, AX STOS, C/LINE 2* #, DI SUB, THEN, CX POP, CX DS MOV, DI CURSOR ) MOV, 'CRTC ) DX MOV, ( 6845 index) 1 #, DI SHR, 0E #, AL MOV, AL OUT, DX INC, DI AX MOV, AH AL MOV, AL OUT, DX DEC, 0F #, AL MOV, AL OUT, DX INC, DI AX MOV, AL OUT, SI POP, BX POP, ( restore 'em) NXT, END-CODE ( direct video EMIT continued ) : (DAT ( row col) SWAP C/LINE * + 2* CURSOR ! 0 (DEMIT ; : (DCUR@ ( - row col) CURSOR @ 2/ C/LINE U/MOD SWAP ; : (DCLS ( -) 0 0 2DUP (DAT L/SCR FOR CR NEXT (DAT ; : >DIRECT CUR@ (DAT ['] (DEMIT DUP IS EMIT IS DEFAULT-EMIT ['] (DAT IS AT ['] (DCUR@ IS CUR@ ['] (DCLS IS CLS ; : >SCR CUR@ (AT ['] (EMIT DUP IS EMIT IS DEFAULT-EMIT ['] (AT IS AT ['] (CUR@ IS CUR@ ['] (CLS IS CLS ;