X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=16%2Fxx%2Fmxgp.asm;fp=16%2Fxx%2Fmxgp.asm;h=6c1431730cf4b395ef673ba970503b56b3ee2e00;hb=83d943df274889635acd01fd88fae54fa9de79d9;hp=0000000000000000000000000000000000000000;hpb=be883f10890316f1d5f84888eaecc16e05fa9571;p=16.git diff --git a/16/xx/mxgp.asm b/16/xx/mxgp.asm new file mode 100755 index 00000000..6c143173 --- /dev/null +++ b/16/xx/mxgp.asm @@ -0,0 +1,56 @@ +;----------------------------------------------------------- +; +; MXGP.ASM - Get palette function +; Copyright (c) 1993,1994 by Alessandro Scotti +; +;----------------------------------------------------------- +WARN PRO +INCLUDE MODEX.DEF + +PUBLIC mxGetPalette + +MX_TEXT SEGMENT USE16 PARA PUBLIC 'CODE' + ASSUME cs:MX_TEXT, ds:NOTHING, es:NOTHING + +;----------------------------------------------------------- +; +; Returns the current setting of the VGA palette. +; +; Input: +; Buffer = pointer to palette data (R,G,B) +; Start = index of first color to get +; Count = number of color to get +; Output: +; none +; +mxGetPalette PROC FAR + ARG Count:WORD, \ + Start:WORD, \ + Buffer:DWORD = ARG_SIZE + ASSUME ds:NOTHING + .enter 0 + .push es, di + + les di, [Buffer] + mov cx, [Count] + mov ax, [Start] + mov dx, 3C7h ; PEL read address register + out dx, al + inc dx + inc dx + cld +@@Loop: + in al, dx + stosb + in al, dx + stosb + in al, dx + stosb + loop @@Loop ; Loop until done + + .pop es, di + .leave ARG_SIZE +mxGetPalette ENDP + +MX_TEXT ENDS +END