Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!yale!mintaka!bloom-beacon!eru!luth!sunic!tut!hydra!hylka!teittinen From: teittinen@cc.helsinki.fi Newsgroups: comp.lang.pascal Subject: Re: 256 colour mode in TP5.0 Message-ID: <2074.25f9176a@cc.helsinki.fi> Date: 10 Mar 90 15:04:10 GMT References: <25F744E5.8753@maccs.dcss.mcmaster.ca> Organization: University of Helsinki Lines: 39 In article <25F744E5.8753@maccs.dcss.mcmaster.ca>, howard@maccs.dcss.mcmaster.ca (Howard Betel) writes: > Here's the problem. [Howard's problem was saving the palette information to disk with 320*200*256 VGA-mode picture] I hope you know how to use TP's intr-procedure, this answer requires it. To store the whole palette information (256 colors) you need following definitions in your program: Type ColorType = record R, G, B: Byte; end; Var Palette: array [0..255] of ColorType; Then you get the data in the array by using video interrupt (10 hex): INT $10 (video interrupt) AH = $10, AL = $17 (read block of color registers) BX = 0 (index of the first color to get) CX = 256 (number of colors to get) ES = Seg(Palette)\ DX = Ofs(Palette)-> (ES:DX points to Palette-array) Set these values to registers and then call interrupt $10, and you get the palette information to your array. Then you can save the palette information in the same file with the image before the image, after it or you can use a different file. When you want to display the picture, set palette using the following register values with interrupt $10: INT $10 (video) AH = $10, AL = $12 (set block of color registers) BX = 0 (index of the first color to set) CX = 256 (number of colors to set) ES = Seg(Palette)\ DX = Ofs(Palette)-> (ES:DX points to Palette-array) -- E-Mail: teittinen@finuh.bitnet ! "Studying is the only way teittinen@cc.helsinki.fi ! to do nothing without Marko Teittinen, student of computer science ! anyone blaming you" -me