DEMO.DESIGN
Frequently Asked Questions
 
оглавление | demo party в ex-СССР | infused bytes e-mag | новости от ib/news | другие проекты | письмо | win koi lat

следующий фpагмент (2)
Function GetPixel10(x,y : word) : byte;assembler; asm { Convert x,y address into OFFSET:SEGMENT and get MASK } MOV BX,X {Fetch X coordinate} MOV AX,Y {Fetch Y coordinate in ES:BX, Mask in CL} MOV CX,640/8 {Fetch bytes per raster} MUL CX {Compute offset past y rasters} MOV CL,BL {Keep copy of x for later} SHR BX,1 {Get offset within raster as x mod 8} SHR BX,1 SHR BX,1 ADD BX,AX {Add offsets together and keep in BX} MOV AX,0a000h {Fetch segment and copy it into ES} MOV ES,AX { Compute MASK within byte from x coordinate} AND CL,07H {Compute which bit in a byte} MOV AL,80H {and use it to rotate mask into positio} ROR AL,CL MOV CL,AL {Keep mask in CL} { Set MAP MASK register to read next plane and read next plane } MOV DX,3ceh MOV AL,04H {Select MAP MASK register} OUT DX,AL INC DX MOV SI,BX {Copy offset into register SI} XOR BH,BH {Clear color} MOV BL,CL {Copy mask into register CL} MOV CX,4 {Initialize loop counter} @Read_Plane_Loop: SHL BH,1 MOV AL,CL {Select next plane for read} DEC AL OUT DX,AL MOV AH,ES:[SI] {Fetch values for 8 pixels in plane 0} AND AH,BL {Mask of the bit for our pixel (mask in} JZ @Zero_Value { Put 0 into next color bit} OR BH,1 {Put 1 into next color bit} @Zero_Value: LOOP @Read_Plane_Loop MOV AL,BH {Put result into AX} XOR AH,AH end;

Всего 1 фpагмент(а/ов) |пpедыдущий фpагмент (1)

Если вы хотите дополнить FAQ - пожалуйста пишите.

design/collection/some content by Frog,
DEMO DESIGN FAQ (C) Realm Of Illusion 1994-2000,
При перепечатке материалов этой страницы пожалуйста ссылайтесь на источник: "DEMO.DESIGN FAQ, http://www.enlight.ru/demo/faq".