亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? xpbmclip.asm

?? 視頻游戲開發C語言源程序
?? ASM
?? 第 1 頁 / 共 3 頁
字號:
;-----------------------------------------------------------------------
; MODULE XPBMCLIP
;
; Clipped Planar Bitmap functions - System Ram <-> Video Ram
;
; Compile with Tasm.
; C callable.
;
;
; ****** XLIB - Mode X graphics library                ****************
; ******                                               ****************
; ****** Written By Themie Gouthas                     ****************
;
; egg@dstos3.dsto.gov.au
; teg@bart.dsto.gov.au
;-----------------------------------------------------------------------


COMMENT $

  This module implements a set of functions to operate on planar bitmaps.
  Planar bitmaps as used by these functions have the following structure:

  BYTE 0                 The bitmap width in bytes (4 pixel groups) range 1..255
  BYTE 1                 The bitmap height in rows range 1..255
  BYTE 2..n1             The plane 0 pixels width*height bytes
  BYTE n1..n2            The plane 1 pixels width*height bytes
  BYTE n2..n3            The plane 2 pixels width*height bytes
  BYTE n3..n4            The plane 3 pixels width*height bytes

  These functions provide the fastest possible bitmap blts from system ram to
  to video and further, the single bitmap is applicable to all pixel
  allignments. The masked functions do not need separate masks since all non
  zero pixels are considered to be masking pixels, hence if a pixel is 0 the
  corresponding screen destination pixel is left unchanged.


$
LOCALS
include xlib.inc
include xpbmclip.inc

	.code

;----------------------------------------------------------------------
; x_put_masked_pbm_clipx - mask write a planar bitmap from system ram to video
;			ram all zero source bitmap bytes indicate destination
;			byte to be left unchanged.
;                       Performs clipping in x directions. similar to
;		        "x_put_masked_pbm".
;
; See Also:  x_put_masked_pbm, x_put_masked_pbm_clipxy
;
; Clipping region variables: LeftClip,RightClip
;
; Written by Themie Gouthas
;
; This code is a SLOW hack, any better ideas are welcome
;----------------------------------------------------------------------
_x_put_masked_pbm_clipx  proc
ARG X:word,Y:word,ScrnOffs:word,Bitmap:dword
LOCAL   Plane:byte,CType,LeftSkip,DataInc,Width,Height,TopRow,LineInc:word=LocalStk
	push  bp
        mov   bp,sp
	sub   sp,LocalStk                 ; Create space for local variables
        push  si
        push  di
        push  ds
	cld

	les   si,[Bitmap]                 ; Point ES:SI to start of bitmap

	xor   ax,ax                       ; Clear AX
	mov   [CType],ax                  ; Clear Clip type descision var
	mov   al,byte ptr es:[si]         ; AX=width (byte coverted to word)


	mov   di,[X]                      ; DI = X coordinate of dest
	mov   cx,di                       ; copy to CX
	sar   di,2                        ; convert to offset in row


	;;;;; CLIP PROCESSING FOR LEFT CLIP BORDER ;;;;;;;;;;;;;;;;;;;

	mov   dx,[_LeftClip]              ; Is X Coord to the right of
	sub   dx,di                       ; LeftClip ?
	jle   @@NotLeftClip               ; Yes! => no left clipping
	cmp   dx,ax                       ; Is dist of X Coord from
	jnl   @@NotVisible                ; ClipLeft > Width ? yes => the
					  ; bitmap is not visible
	add   di,dx
	mov   [LeftSkip],dx
	mov   [DataInc],dx
	sub   ax,dx
	mov   [CType],1
	jmp   short @@HorizClipDone

	;;;; EXIT FOR COMPLETELY OBSCURED P.B.M's ;;;;;;;;;;;;;;;;;;;;;;

@@NotVisible:
	mov   ax,1
	pop   ds                          ; restore data segment
	pop   di                          ; restore registers
	pop   si
	mov   sp,bp                       ; dealloc local variables
	pop   bp
	ret

	;;;;; CLIP PROCESSING FOR RIGHT CLIP BORDER ;;;;;;;;;;;;;;;;;;;

@@NotLeftClip:
	mov   dx,[_RightClip]
	sub   dx,di
	js    @@NotVisible
	mov   [LeftSkip],0
	mov   [DataInc],0
	cmp   dx,ax
	jge   @@HorizClipDone       ; was jg
	inc   dx
	sub   ax,dx
	mov   [DataInc],ax
	mov   ax,dx
	mov   [CType],-1

@@HorizClipDone:

	xor   bh,bh
	mov   bl,byte ptr es:[si+1]       ; BX = height

	mov   [Width],ax                  ; Save width and height of clipped
	mov   [Height],bx                 ;  image


	add   si,2                        ; Skip dimension bytes in source
	add   si,[LeftSkip]               ; Skip pixels in front of row that
					  ;  are clipped


	mov   bx,[_ScrnLogicalByteWidth]  ; Set BX to Logical Screen Width
	mov   dx,bx                       ; BX - Width of image = No. bytes
	sub   dx,ax                       ;  to first byte of next screen
	mov   [LineInc],dx                ;  row.

	mov   ax,[Y]                      ; Calculate screen start row
	mul   bx                          ;  then adding screen offset
	add   di,ax
	add   di,[ScrnOffs]
	mov   ax,es                       ; copy ES to DS
	mov   ds,ax
	mov   ax,SCREEN_SEG               ; Point ES to VGA segment
	mov   es,ax

	and   cx,3
	mov   ah,11h                      ; Set up initial plane mask
	shl   ah,cl

	mov   dx,SC_INDEX                 ; Prepare VGA for cpu to video writes
	mov   al,MAP_MASK
	out   dx,al
	inc   dx
	mov   [Plane],4                   ; Set plane counter to 4
	mov   bh,byte ptr [Width]         ; set bh to width for fast looping
@@PlaneLoop:
	push  di 			  ; Save bitmap's start dest. offset
	mov   bl,byte ptr [Height]        ; Reset row counter (BL)
	mov   al,ah
	out   dx,al                       ; set vga write plane
@@RowLoop:
	mov   cl,bh                       ; Reset Column counter cl
	jcxz  @@NoWidth
@@ColLoop:
	lodsb        		          ; Get next source bitmap byte
	or    al,al                       ; If not zero then write to dest.
	jz    @@NoPixel                   ; otherwise skip to next byte
	mov   es:[di],al
@@NoPixel:
	inc   di
	loop @@ColLoop
@@NoWidth:
	add   si,[DataInc]                ; Move to next source row
	add   di,[LineInc]                ; Move to next screen row
	dec   bl                          ; decrement row counter
	jnz   @@RowLoop                   ; Jump if more rows left
	pop   di                          ; Restore bitmaps start dest byte
	rol   ah,1		          ; Shift mask for next plane

	; Plane Transition (A HACK but it works!)

	jnb   @@Nocarry                   ; Jump if not plane transition
	mov   bl,ah                       ; Save Plane Mask
	mov   ax,[CType]                  ; set AX to clip type inc variable
	add   bh,al                       ; Update advancing variables
	sub   [DataInc],ax                ;
	sub   [LineInc],ax                ;
	cmp   al,0                        ; What type of clip do we have
	mov   ah,bl                       ;   restore Plane mask
	jg    @@RightAdvance              ; jump on a right clip!
	inc   di                          ; otherwise increment DI
	jmp   @@Nocarry
@@RightAdvance:
	dec si
@@Nocarry:
	dec   [Plane]                     ; Decrement plane counter
	jnz   @@PlaneLoop                 ; Jump if more planes left

	xor   ax,ax
	pop   ds                          ; restore data segment
	pop   di                          ; restore registers
	pop   si
	mov   sp,bp                       ; dealloc local variables
	pop   bp
	ret
_x_put_masked_pbm_clipx  endp


;----------------------------------------------------------------------
; x_put_masked_pbm_clipy - mask write a planar bitmap from system ram to video
;			ram all zero source bitmap bytes indicate destination
;			byte to be left unchanged.
;                       Performs clipping in y direction. similar to
;		        "x_put_masked_pbm".
;
; See Also:  x_put_masked_pbm, x_put_masked_pbm_clipx, x_put_masked_pbm_clipy
;
; Clipping region variables: TopClip,BottomClip
;
; Written by Themie Gouthas
;----------------------------------------------------------------------
_x_put_masked_pbm_clipy  proc
ARG X:word,Y:word,ScrnOffs:word,Bitmap:dword
LOCAL   Width,Height,TopRow,LineInc,PlaneInc:word=LocalStk
	push  bp
	mov   bp,sp
	sub   sp,LocalStk                 ; Create space for local variables
	push  si
	push  di
	push  ds
	cld

	les   si,[Bitmap]

	xor   bh,bh
	mov   bl,byte ptr es:[si+1]       ; BX = height

	xor   ah,ah
	mov   al,byte ptr es:[si]         ; AX = width

	mov   cx,ax                       ; Save AX
	mul   bx                          ; AX = AX*BX = bytes/plane
	mov   [PlaneInc],ax               ;  save as PlaneInc
	mov   ax,cx                       ; Restore AX

	mov   di,[X]
	mov   cx,di
	shr   di,2

	;;;;; CLIP PROCESSING FOR TOP CLIP BORDER ;;;;;;;;;;;;;;;;;;;;;

	mov   dx,[_TopClip]           ; Compare u.l. Y coord with Top
	sub   dx,[Y]                  ; clipping border
	jle   @@NotTopClip            ; jump if VBM not clipped from above
	cmp   dx,bx
	jnl   @@NotVisible            ; jump if VBM is completely obscured
	mov   [TopRow],dx
	sub   bx,dx
	add   [Y],dx
	jmp   short @@VertClipDone

	;;;; EXIT FOR COMPLETELY OBSCURED P.B.M's ;;;;;;;;;;;;;;;;;;;;;;

@@NotVisible:
	mov   ax,1
	pop   ds                          ; restore data segment
	pop   di                          ; restore registers
	pop   si
	mov   sp,bp                       ; dealloc local variables
	pop   bp
	ret

	;;;;; CLIP PROCESSING FOR BOTTOM CLIP BORDER ;;;;;;;;;;;;;;;;;;;

@@NotTopClip:
	mov   dx,[_BottomClip]
	sub   dx,[Y]
	js    @@NotVisible
	mov   [TopRow],0
	cmp   dx,bx
	jg    @@VertClipDone
	inc   dx
	mov   bx,dx

@@VertClipDone:

	mov   [Width],ax
	mov   [Height],bx                 ; Calculate relative offset in data
	mul   [TopRow]                    ;  of first visible scanline
	add   ax,2                        ; Skip dimension bytes in source
	add   si,ax                       ; Skip top rows that arent visible


	mov   ax,[Y]                      ; Calculate screen row
	mov   bx,[_ScrnLogicalByteWidth]  ;  by mult. Y coord by Screen
	mul   bx                          ;  width then adding screen offset
	add   di,ax
	add   di,[ScrnOffs]
	sub   bx,[Width]                  ; calculate difference from end of
	mov   [LineInc],bx                ; b.m. in curr line to beginning of
					  ; b.m. on next scan line
	mov   ax,es                       ; copy ES to DS
	mov   ds,ax
	mov   ax,SCREEN_SEG               ; Point ES to VGA segment
	mov   es,ax

	mov   ah,11h                      ; Set up initial plane mask
	and   cx,3
	shl   ah,cl

	mov   dx,SC_INDEX                 ; Prepare VGA for cpu to video writes
	mov   al,MAP_MASK
	out   dx,al
	inc   dx
	mov   bh,4                        ; Set plane counter to 4
@@PlaneLoop:
	push  di 			  ; Save bitmap's start dest. offset
	push  si                          ; Save Bitmaps data offset
	mov   bl,byte ptr [Height]        ; Reset row counter (BL)
	mov   al,ah
	out   dx,al                       ; set vga write plane
@@RowLoop:
	mov   cl,byte ptr [Width]         ; Reset Column counter cl
@@ColLoop:
	lodsb                             ; Get next source bitmap byte
	or    al,al                       ; If not zero then write to dest.
	jz    @@NoPixel                   ; otherwise skip to next byte
	mov   es:[di],al
@@NoPixel:
	inc   di
	loop  @@ColLoop                   ; loop if more columns left
	add   di,[LineInc]                ; Move to next row
	dec   bl                          ; decrement row counter
	jnz   @@RowLoop                   ; Jump if more rows left
	pop   si                          ; Restore SI and set to offset of
	add   si,[PlaneInc]               ; first vis pixel in next plane data
	pop   di                          ; Restore bitmaps start dest byte
	rol   ah,1                        ; Shift mask for next plane
	adc   di,0                        ; if carry increment screen offset
	dec   bh                          ; Decrement plane counter
	jnz   @@PlaneLoop                 ; Jump if more planes left

	xor   ax,ax
	pop   ds                          ; restore data segment
	pop   di                          ; restore registers
	pop   si
	mov   sp,bp                       ; dealloc local variables
	pop   bp
	ret
_x_put_masked_pbm_clipy   endp

;----------------------------------------------------------------------
; x_put_masked_pbm_clipxy - Write a planar bitmap from system ram to video

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人激情午夜影院| 日韩电影免费在线观看网站| 亚洲欧洲性图库| 亚洲综合成人在线视频| 日韩国产成人精品| 国产精品一二三区在线| 91美女福利视频| 欧美精品丝袜久久久中文字幕| 精品久久久久久无| 亚洲精品日日夜夜| 免费成人你懂的| voyeur盗摄精品| 日韩一区国产二区欧美三区| 中文无字幕一区二区三区 | 久久99国产精品麻豆| 国产成人av电影在线| 欧美在线视频日韩| 国产性做久久久久久| 亚洲18色成人| 成人av影视在线观看| 884aa四虎影成人精品一区| 国产精品久久久久一区| 爽好久久久欧美精品| 成人午夜激情在线| 91精品国模一区二区三区| 国产精品久久久久久久久搜平片 | 欧美日韩一区二区三区不卡| 精品国产乱码久久久久久免费| 亚洲日穴在线视频| 国产在线精品国自产拍免费| 精品视频一区三区九区| 中文字幕av资源一区| 免费欧美在线视频| 欧美亚洲一区二区在线| 国产精品久久久久一区二区三区共 | 国产揄拍国内精品对白| 欧美在线观看一二区| 国产三级精品视频| 久久国产欧美日韩精品| 欧美日韩1234| 一级做a爱片久久| 成人深夜视频在线观看| 亚洲精品一区二区三区99| 午夜电影网一区| 在线免费亚洲电影| 亚洲欧美日韩国产另类专区 | 欧美激情中文字幕一区二区| 奇米精品一区二区三区在线观看 | 亚洲三级久久久| 成人精品视频.| 日韩精品一区二| 日本不卡一二三| 欧美另类变人与禽xxxxx| 亚洲尤物在线视频观看| 色就色 综合激情| 亚洲欧美在线观看| 成人毛片老司机大片| 国产欧美日韩三区| 风间由美性色一区二区三区| 久久久久亚洲综合| 精品一区二区av| 日韩午夜激情免费电影| 日韩国产在线一| 欧美日韩精品三区| 亚洲第一主播视频| 欧美日韩国产免费一区二区| 亚洲一二三四久久| 欧美丝袜丝交足nylons图片| 亚洲欧美日韩久久精品| 成人h精品动漫一区二区三区| 国产欧美日韩一区二区三区在线观看| 国内精品久久久久影院薰衣草| 欧美成人一区二区三区片免费 | 91精品国产色综合久久久蜜香臀| 亚洲狠狠爱一区二区三区| 色成年激情久久综合| 亚洲综合区在线| 欧洲激情一区二区| 日韩国产欧美视频| 日韩视频一区二区| 国产一区二区三区久久悠悠色av | 高清不卡在线观看| 中文字幕欧美一区| 日本高清不卡一区| 亚洲国产成人高清精品| 欧美日韩视频在线第一区 | xfplay精品久久| 粉嫩av一区二区三区| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 欧美日韩黄色影视| 日本视频免费一区| 精品99999| www.久久久久久久久| 一区二区三区在线视频免费| 欧美视频一区二区三区| 免费高清在线视频一区·| www国产成人| 99精品视频在线免费观看| 一区二区三区免费看视频| 欧美精品丝袜久久久中文字幕| 久久99热国产| 国产精品美女久久久久久久| 一本一本大道香蕉久在线精品| 天堂久久久久va久久久久| 26uuu国产在线精品一区二区| 国产成人午夜视频| 一区二区三区在线播放| 91精品国产综合久久香蕉麻豆| 乱一区二区av| 日韩毛片高清在线播放| 欧美日本国产一区| 国产一区二区三区在线观看免费 | 高清视频一区二区| 亚洲午夜羞羞片| 精品国产91乱码一区二区三区 | 亚洲综合小说图片| 欧美精品一区二区在线播放| 成人丝袜视频网| 日精品一区二区| 国产欧美日韩精品一区| 欧美日韩精品三区| 国产99精品国产| 亚洲国产精品自拍| 国产日韩欧美一区二区三区乱码| 国产在线一区二区| 亚洲福利视频一区二区| 久久久久国产精品人| 欧美日韩成人综合天天影院 | 久久精品日韩一区二区三区| 色哟哟一区二区在线观看| 久久99久国产精品黄毛片色诱| 亚洲色图清纯唯美| ww久久中文字幕| 欧美日韩国产成人在线91| av午夜精品一区二区三区| 麻豆91在线播放免费| 一区二区三区中文免费| 久久午夜电影网| 在线播放91灌醉迷j高跟美女| av在线免费不卡| 久久国产精品99久久人人澡| 亚洲综合图片区| 国产精品免费看片| 久久这里只有精品首页| 欧美日韩免费电影| 91美女片黄在线| 国产成人精品影视| 久久91精品国产91久久小草| 亚洲小说欧美激情另类| 中文字幕一区二区视频| 精品国精品国产| 欧美一区二区三区性视频| 欧美性色综合网| 91欧美一区二区| 丁香一区二区三区| 国产精品夜夜爽| 久久精品国产99| 日韩国产欧美在线观看| 亚洲午夜在线电影| 一区二区三区资源| 中文字幕日本不卡| 国产精品久久久久影院| 久久久99精品久久| 精品福利av导航| 日韩精品资源二区在线| 宅男噜噜噜66一区二区66| 色婷婷久久久亚洲一区二区三区| 成人禁用看黄a在线| 国产成人精品免费看| 韩国三级电影一区二区| 男女视频一区二区| 丝袜a∨在线一区二区三区不卡| 亚洲综合免费观看高清完整版| 亚洲欧美国产高清| 亚洲欧美日韩在线播放| 国产精品不卡在线| 国产精品美女久久久久aⅴ国产馆| 欧美精品一区视频| 久久综合狠狠综合| 欧美极品少妇xxxxⅹ高跟鞋 | 91免费在线看| 91女神在线视频| 91福利在线免费观看| 在线观看免费亚洲| 欧美性生活久久| 欧美视频在线观看一区| 欧美三级乱人伦电影| 欧美日韩的一区二区| 欧美一区二区三区不卡| 日韩视频一区二区三区| 久久香蕉国产线看观看99| 久久综合久久久久88| 国产色综合一区| 中文字幕欧美激情一区| 亚洲男同性视频| 亚洲国产精品久久久久婷婷884 | 欧美成人bangbros| 久久免费美女视频| 国产精品久久精品日日| 一区二区三区欧美亚洲|