home *** CD-ROM | disk | FTP | other *** search
- This is a modification/correction to the TURBO PASCAL, Ver 2.00B, color
- patch provided by P.C. in Texas. In attempting to run P.C.'s patch, I found
- some operational problems.
-
- Specifically, the colors were fine while I was in the Editor. However,
- running the program, caused the screen to revert to Borland's default colors.
- In addition, I prefer that the background AND the border be the same color, or
- that I have, at least, control of the border color value.
-
- After some research, I arrived at the following patch which just fits the
- available 32 bytes (20 Hex). I have tried it and it seems to work, but NO
- guarantees. For instance, I don't know why P.C. set the AX register to 000E.
- I didn't have room for the 3 bytes, so I set the AL register to 0F (same as
- the original exit value) and assumed that AH would be OK since we didn't
- change its value. I, also, don't know why its necessary to set BX to 5007.
- The preceding code sets BH = 50 under 4 of 5 conditions (the 5th condition
- leaves BH = 28). P.C.'s original routine doesn't conform but seems to work.
- I elected to exit the routine with the registers essentially unchanged from
- Borland's original. Therefore, I left BH alone and set BL to 07.
-
- ***** ***** ***** ***** ***** ***** ***** ***** *****
-
- NOTE: To get proper operation while running a program, it is advisable to
- insert a "ClrScr;" ahead of the first occurrence of a "Write" or
- "Writeln". This will insure that the entire screen is a uniform color.
-
- NOTE: TURBO PASCAL is copywrited by and a trademark of Borland International.
-
- ***** ***** ***** ***** ***** ***** ***** ***** *****
-
- The following text is an exact duplicate (sans comments) of what appeared
- on my IBM PC screen as I was checking the code and assembling the patch.
- After your entering of the initial offset (U30D or A30D), the segment address
- and offsets are provided by the DEBUG program. The rest you'll have to type
- in. Read your DOS manual on the usage of DEBUG. Entering the segment address
- isn't necessary unless you wish to change it for some reason.
-
- If the code displayed after you type "U30D L20" is NOT as shown, you'll
- have to try and find it. It should be fairly close by (within 30 bytes or so).
-
-
- ** Screen Display ** ** {Comments} **
- -------------------------------------------------- ------------------------
-
- A>DEBUG {Run DEBUG.COM}
- -N TURBO.COM {Enter filename.ext}
- -L {Load file}
- -U30D L20 {Unassemble starting at}
- 0905:030D 803E5401FF CMP BYTE PTR [0154],FF {DS:030D for &H20 bytes}
- 0905:0312 7406 JZ 031A
- 0905:0314 B0FF MOV AL,FF
- 0905:0316 B3F7 MOV BL,F7
- 0905:0318 B10F MOV CL,0F
- 0905:031A 22C1 AND AL,CL
- 0905:031C A25101 MOV [0151],AL {Text color/background}
- 0905:031F A25501 MOV [0155],AL {Run color/background}
- 0905:0322 22D9 AND BL,CL
- 0905:0324 881E5201 MOV [0152],BL {Prompt color/bkgnd}
- 0905:0328 880E5301 MOV [0153],CL {Cursor color/bkgnd}
- 0905:032C C3 RET
- -N TURBOWHT.COM {New filename}
- -A30D {Assemble at DS:030D}
- 0905:030D PUSH DX {Save DX register}
- 0905:030E MOV AL,07 {Load White border}
- 0905:0310 MOV DX,03D9 {6845 mode register}
- 0905:0313 OUT DX,AL {Output the byte}
- 0905:0314 MOV AL,70 {White w/Black char.}
- 0905:0316 MOV [0151],AL {Save as main text}
- 0905:0319 MOV [0155],AL {And as Run text}
- 0905:031C MOV AL,75 {White w/Magenta char.}
- 0905:031E MOV [0152],AL {Save as Prompt char.}
- 0905:0321 MOV AL,76 {White w/Brown char.}
- 0905:0323 MOV [0153],AL {Save as cursor char.}
- 0905:0326 MOV AL,0F {Original exit value}
- 0905:0328 MOV BL,07 {Original exit value}
- 0905:032A NOP {Need one more Byte}
- 0905:032B POP DX {Restore DX register}
- 0905:032C RET {End of subroutine}
- 0905:032D^C {Ctrl-Break to end the}
- {assembly process}
- -W {Write the new file}
- Writing 8E80 bytes {Debug message}
- -Q {Quit Debug}
-
- A> {DOS prompt}
-
-
- The modification listed above, provides a White background and border,
- Black characters, a Magenta Prompt and a Brown cursor. This combination looks
- oddball (inverse characters) with a monochrome card but is entirely readable.
-
- The following alternate color scheme is good also. It looks very good
- with a monochrome card:
-
- 0905:030E MOV AL,01 {Load Blue border}
- 0905:0314 MOV AL,17 {Blue w/White char.}
- 0905:031C MOV AL,1E {Blue w/Yellow char.}
- 0905:0321 MOV AL,13 {Blue w/Cyan char.}
-
- Note: Changing the 1's, above, to 3's will give a Cyan instead of blue.
-
- The best color combination is a personal choice. The key to the colors
- is as follows:
- 1. Let BO = BOrder Nibble (4 bits = one Hex digit)
- 2. Let BA = BAckground Nibble
- 3. Let F = Foreground Nibble
- 4. Let I = Intensity bit
- 5. Let R = Red bit.
- 6. Let G = Green bit.
- 7. Let B = Blue bit.
- 8. Let BL = set character BLink bit.
-
- 9. To set the border color, BO = I R G B.
- (e.g. intense red = 1 1 0 0 = C in hex )
- ( cyan = 0 0 1 1 = 3 in hex )
- 10. To set the background color, BA = BL R G B.
- (e.g. a blue background = 0 0 0 1 )
- ( a white background = 0 1 1 1 )
- 11. To set the foreground (text) character, F = I R G B.
- ( same format as the border nibble )
- 12. Using the patch shown, the border byte at :030F is 0 BO.
- (example: for intense red it is 0C, cyan is 03, etc.)
- 13. For the characters, the background comes first, then the
- foreground (BA F).
- (e.g. a blue background with a red character is 14)
- ( or 0 0 0 1 0 1 0 0 )
- 14. If the border and background are the same, then BA = BO.
-
- I hope the above description isn't too confusing. - CTW.
-
- Be sure and save your different versions under different names. For
- example, I used: TURBOWHT.COM, TURBOBLU.COM and TURBOCYN.COM as alternate
- names for three different versions. That way I can choose the one I wish
- to use. By doing this, I also preserved the origional version of TURBO in
- case something gets screwed up.
-
- ***** ALWAYS do your work on a BACKUP disk. *****
- ** NEVER mess around with the origional since a mistake can wipe you out! **
-
- --- Have fun,
- C.T.Wiebe - San Jose, CA.
- 11/19/84, Revised 2/10/85