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

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

?? xmouse.asm

?? 視頻游戲開發C語言源程序
?? ASM
?? 第 1 頁 / 共 2 頁
字號:
;
; Written by Themie Gouthas
;----------------------------------------------------------------------
_x_hide_mouse proc
     push  bp
     mov   bp,sp

     cmp   [_MouseInstalled],FALSE   ; Make sure our handler is installed
     je    @@Done
     cmp   [_MouseHidden],FALSE      ; If cursor is already hidden exit
     jne   @@Done
     push  si
     push  di

@@WaitEndOfHandler:            ; Make sure handler not currently active
     mov   cl,[inhandler]
     or    cl,cl
     jnz   @@WaitEndOfHandler

     mov   [_MouseHidden],TRUE       ; Delete mouse cursor
     mov   di,[OldScrnOffs]
     mov   ax,[OldY]
     mov   bx,[OldX]
     call  restorebg
     pop   di
     pop   si
@@Done:
     pop   bp
     ret
_x_hide_mouse endp


;----------------------------------------------------------------------
; x_remove_mouse - removes mouse handler
;
; C Prototype
;
;  void x_remove_mouse()
;
; NOTE: This function MUST be called before quitting the program if
;       a mouse handler has been installed
;
; Written by Themie Gouthas
;----------------------------------------------------------------------
_x_mouse_remove proc
    push  bp
    mov   bp,sp
    cmp   [_MouseInstalled],FALSE  ; Check whether we have installed
    je    @@Done                   ;  our mouse handler
    call  _x_hide_mouse
    mov   ax,12                    ; FUNC 12: Install event handler
    xor   cx,cx                    ; Disable all events
    int   33h
    mov   [_MouseInstalled],FALSE
@@Done:
    pop   bp
    ret
_x_mouse_remove endp


;----------------------------------------------------------------------
; x_position_mouse - Positions the mouse cursor at the specified location
;
; C Prototype
;
;  void x_position_mouse(int x, int y)
;
;
; Written by Themie Gouthas
;----------------------------------------------------------------------
_x_position_mouse proc
ARG  X:word,Y:word
     push  bp
     mov   bp,sp

@@WaitEndOfHandler:               ; Make sure handler not currently active
     mov   bl,[inhandler]

     or    bl,bl
     jnz   @@WaitEndOfHandler

     mov   ax,4
     mov   cx,X
     mov   dx,Y
     mov   [_MouseX],cx
     mov   [_MouseY],dx
     shl   cx,1

     mov   [inhandler],1
     int   33h

     ; The handler doesnt get called so need
     ; to update manually;

     cmp   [_MouseHidden],FALSE
     jne   @@NotVisible
     push  di si
     call  update_cursor
     pop   si di

@@NotVisible:
     mov   [inhandler],0
     pop   bp
     ret
_x_position_mouse endp

;----------------------------------------------------------------------
; x_update_mouse - Forces the mouse position to be updated and cursor
;                  to be redrawn.
;
; C Prototype
;
;  void x_update_mouse()
;
; Note this function is useful when you have set "MouseFrozen" to true.
; Allows the cursor position to be updated manually rather than
; automatically by the installed handler.
;
;
; Written by Themie Gouthas
;----------------------------------------------------------------------
_x_update_mouse proc
     push  bp
     mov   bp,sp
     cmp   [_MouseInstalled],FALSE   ; Make sure our handler is installed
     je    @@Done
     cmp   [_MouseHidden],FALSE      ; If cursor is already hidden exit
     jne   @@Done
     push  si
     push  di
     mov   ax,03h                 ; FUNC 3: get cursor pos / button status
     int   33h                    ; Update position variables first
     shr   cx,1
     mov   [_MouseX],cx
     mov   [_MouseY],dx
     mov   [_MouseButtonStatus],bx    ; Update button status
     call  update_cursor
     pop   di
     pop   si
@@Done:
     pop   bp
     ret
_x_update_mouse endp


;----------------------------------------------------------------------
; x_put_cursor - Draws the mouse cursor
;
; C Prototype
;
; void x_put_cursor(int X, int Y, int TopClip, int BottomClip, WORD ScrnOffs)
;
;
; Written by Themie Gouthas
;----------------------------------------------------------------------
ALIGN 2
_x_put_cursor  proc
ARG X:word,Y:word,TopClip,BottomClip,ScrnOffs
LOCAL Height,TopRow,NextLineIncr:word=LocalStk
	push  bp
	mov   bp,sp
	sub   sp,LocalStk                 ; Create space for local variables
	push  si
	push  di
	push  ds
	mov   ax,@data
	mov   ds,ax
	cld

	mov   ax,14                   ; Get image height and save in AX
	mov   bx,Y
	; cx = top Row

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

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

	;;;; EXIT FOR COMPLETELY OBSCURED  ;;;;;;;;;;;;;;;;;;;;;;

@@NotVisible:
	pop   ds
	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,bx
	js    @@NotVisible
	mov   cx,0
	cmp   dx,ax
	jg    @@VertClipDone
	inc   dx
	mov   ax,dx

@@VertClipDone:

	mov   [Height],ax
	mov   [TopRow],cx

	mov   ax,SCREEN_SEG               ; Point es to VGA segment
	mov   es,ax

	mov   ax,bx
	mov   cx,[_ScrnLogicalByteWidth]  ; Find required screen address
	mul   cx
	mov   di,ax

	sub   cx,3                        ; Distance to next screen row
	mov   [NextLineIncr],cx


	mov   cx,[X]
	mov   bx,cx
	shr   cx,2
	add   di,cx
	and   bx,3
	add   di,[ScrnOffs]

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


	mov   ax,42
	mul   bx
	mov   si,offset MouseMask
	add   si,ax

	mov   ax,3                        ; Increment DS:BX and DS:SI to
	mul   [TopRow]                    ;  been clipped by the top border
	add   si,ax                       ; by the L.H.S border

	mov   dx,SC_INDEX                 ; Point SC register to map mask
	mov   al,MAP_MASK                 ; in preperation for masking data
	out   dx,al
	inc   dx                          ; Point dx to SC data register
	mov   ah,byte ptr [Height]        ; AH = Scanline loop counter
	mov   bl,[_MouseColor]
@@RowLoop:
	mov   cx,3                        ; Width in bytes across
@@ColLoop:
	lodsb                             ; load plane mask and set MAP MASK
	out   dx,al
	mov   es:[di],bl                  ; store color to specified planes
	inc   di
	loop  @@ColLoop

	add   di,[NextLineIncr]
	dec   ah
	jnz   @@RowLoop

	pop   ds
	pop   di                          ; restore registers
	pop   si
	mov   sp,bp                       ; dealloc local variables
	pop   bp
	ret
_x_put_cursor  endp


;----------------------------------------------------------------------
; getbg - saves cursor background
;
; C Prototype
;
; local function using register parameters
;
; si = screen offset
; ax  = y
; bx  = x
;
; Written by Themie Gouthas
;----------------------------------------------------------------------
ALIGN 2
getbg  proc near

	push  bp
	mov   bp,sp
	push  ds
	cld

	mov   cx,[_ScrnLogicalByteWidth]  ;  by mult. dest Y coord by Screen
	mul   cx                          ;  width then adding screen offset
	add   si,ax                       ; Add Dest Screen Row to di
	sub   cx,3
	shr   bx,2
	add   si,bx
	mov   bx,cx

	mov   di,BGSaveOffs
	mov   ax,SCREEN_SEG               ; Point es to VGA segment
	mov   es,ax
	mov   ds,ax

	mov   dx,GC_INDEX                 ; Set bit mask for all bits from
	mov   ax,BIT_MASK                 ; VGA latches and none from CPU
	out   dx,ax

	mov   dx,SC_INDEX                 ; Point SC register to map mask
	mov   al,MAP_MASK           ; in preperation for masking data
	out   dx,al
	inc   dx
	mov   al,0fh
	out   dx,al

	mov   cx,14
@@Loop:
	movsb
	movsb
	movsb
	add si,bx
	loop @@Loop

mov     dx,GC_INDEX+1 ;restore the bit mask to its default,
	mov     al,0ffh       ; which selects all bits from the CPU
	out     dx,al         ; and none from the latches (the GC
			      ; Index still points to Bit Mask)

	pop   ds
	mov   sp,bp                       ; dealloc local variables
	pop   bp
	ret
getbg  endp

;----------------------------------------------------------------------
; restorebg - restores cursor background
;
; C Prototype
;
; local function using register parameters
;
; di = screen offset
; ax  = y
; bx  = x
;
; Written by Themie Gouthas
;----------------------------------------------------------------------
ALIGN 2
restorebg  proc near
;di = scrn offs
;ax  = y
;bx  = x
	push  bp
	mov   bp,sp
	push  ds
	cld

	mov   cx,[_ScrnLogicalByteWidth]  ;  by mult. dest Y coord by Screen
	mul   cx                          ;  width then adding screen offset
	add   di,ax                       ; Add Dest Screen Row to di
	sub   cx,3
	shr   bx,2
	add   di,bx
	mov   si,BGSaveOffs
	mov   ax,SCREEN_SEG               ; Point es to VGA segment
	mov   es,ax
	mov   ds,ax

	mov   dx,GC_INDEX                 ; Set bit mask for all bits from
	mov   ax,BIT_MASK                 ; VGA latches and none from CPU
	out   dx,ax

	mov   dx,SC_INDEX                 ; Point SC register to map mask
	mov   al,MAP_MASK                 ; in preperation for masking data
	out   dx,al
	inc   dx
	mov   al,0fh
	out   dx,al

	mov   bx,cx
	mov   cx,14
@@Loop:
	movsb
	movsb
	movsb
	add di,bx
	loop @@Loop
	mov  dx,GC_INDEX+1 ;restore the bit mask to its default,
	mov  al,0ffh       ; which selects all bits from the CPU
	out  dx,al         ; and none from the latches (the GC
			   ; Index still points to Bit Mask)
	pop   ds
	pop   bp
	ret
restorebg  endp



;********************** The Mouse event handler *************************

ALIGN 2
mouse_handler proc far
   push  bp
   mov   bp,sp
   push  ds

   mov   di,@data                   ; Make sure DS points to data segment
   mov   ds,di
   cmp   [inhandler],1
   jne   @@NotActive
   pop   ds
   pop   bp
   ret

@@NotActive:
   mov   [inhandler],1
   mov   [_MouseButtonStatus],bx    ; Update button status
   test  ax,1                       ; Is this a motion event ?
   jz    @@Done                     ; No Jump

   shr  cx,1                        ; convert X coord to pixel coords
   mov  [_MouseX],cx                ; save mouse position
   mov  [_MouseY],dx

   cmp  [_MouseHidden],TRUE         ; If mouse hidden dont bother drawing
   je   @@Done

   cmp  [_MouseFrozen],TRUE         ; If mouse hidden dont bother drawing
   je   @@Done

   call update_cursor
@@Done:
   mov  [inhandler],0
   pop  ds
   pop  bp
   ret
mouse_handler endp


end

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品少妇一区二区三区| 国产精品三级视频| 91福利在线看| 波多野结衣亚洲一区| 国产一区二区免费视频| 黑人精品欧美一区二区蜜桃| 久久激情五月婷婷| 国产原创一区二区三区| 国产老女人精品毛片久久| 国产一区二区三区精品欧美日韩一区二区三区 | 欧美一区二区福利视频| 欧美一区二区性放荡片| 精品国产免费人成在线观看| 国产午夜精品一区二区| 国产精品麻豆视频| 亚洲最大成人网4388xx| 日韩在线观看一区二区| 国产九色sp调教91| 99久久精品国产导航| 精品婷婷伊人一区三区三| 日韩一区二区三区视频在线观看| 久久久久高清精品| 亚洲综合激情另类小说区| 日韩精品视频网站| 国产白丝网站精品污在线入口| 91免费版在线| 欧美一级日韩一级| 国产精品乱码妇女bbbb| 亚洲成人www| 国产成人亚洲综合色影视| 色综合视频一区二区三区高清| 欧美精品久久久久久久久老牛影院| 日韩精品中午字幕| 亚洲欧美日韩久久精品| 捆绑调教美女网站视频一区| 国产91精品一区二区麻豆网站 | 国产精品天天看| 亚洲第一狼人社区| 国产成人综合自拍| 欧美乱妇23p| 中文字幕日韩精品一区| 美女一区二区三区| 91视频一区二区| 精品少妇一区二区三区在线播放 | 久久精品欧美日韩精品| 亚洲国产精品久久久久婷婷884| 国产中文字幕精品| 欧美日韩一区不卡| 中文字幕一区二区三区精华液| 日韩av在线发布| 色综合天天性综合| 国产亚洲成av人在线观看导航| 性做久久久久久| 99久久精品免费看| 久久久99精品免费观看| 五月激情丁香一区二区三区| 99久久精品国产毛片| 日本一区二区三区视频视频| 午夜激情久久久| 欧美亚洲国产一卡| 伊人一区二区三区| 99久久夜色精品国产网站| 精品盗摄一区二区三区| 日韩av在线播放中文字幕| 在线中文字幕不卡| 亚洲欧洲制服丝袜| hitomi一区二区三区精品| 亚洲精品一区在线观看| 奇米影视一区二区三区| 欧美日韩国产在线播放网站| 有坂深雪av一区二区精品| av在线免费不卡| 中文字幕一区二区在线观看| 成人av网站在线| 国产精品视频观看| 成人av午夜影院| 日韩一区日韩二区| 91免费观看国产| 亚洲精品成人悠悠色影视| 9i在线看片成人免费| 国产精品福利一区二区| av成人免费在线观看| 国产精品美女www爽爽爽| 成人aa视频在线观看| 国产精品久久久久精k8| 91香蕉视频在线| 一区二区视频在线看| 欧美熟乱第一页| 午夜精品一区在线观看| 日韩欧美成人一区| 国产福利一区二区三区视频在线| 欧美国产精品一区| 色域天天综合网| 爽好多水快深点欧美视频| 日韩一区二区三| 国产福利视频一区二区三区| 亚洲欧洲成人av每日更新| 色噜噜狠狠色综合欧洲selulu| 亚洲午夜视频在线| 日韩精品综合一本久道在线视频| 国产裸体歌舞团一区二区| 国产精品三级久久久久三级| 91麻豆精品一区二区三区| 香蕉成人啪国产精品视频综合网| 在线不卡中文字幕播放| 激情av综合网| 亚洲精品国产一区二区精华液| 欧美日韩一区二区三区高清| 免费高清视频精品| 欧美极品aⅴ影院| 一本色道久久综合精品竹菊| 日韩不卡手机在线v区| 国产午夜精品理论片a级大结局| 91女人视频在线观看| 亚洲国产精品自拍| 欧美videos中文字幕| 丁香婷婷综合色啪| 亚洲午夜精品在线| 久久先锋资源网| 在线精品观看国产| 国产精品1区2区3区| 亚洲一二三四在线| 久久亚洲欧美国产精品乐播| 欧美亚洲一区二区三区四区| 美女被吸乳得到大胸91| 亚洲天堂精品视频| 久久先锋影音av鲁色资源网| 在线亚洲一区二区| 国产精品一卡二卡在线观看| 亚洲一二三专区| 中文字幕乱码亚洲精品一区| 欧美丰满一区二区免费视频| 91在线精品一区二区三区| 九九精品视频在线看| 亚洲精品国产成人久久av盗摄| 欧美精品一区二区三区一线天视频 | 日韩精品乱码免费| **欧美大码日韩| 久久九九全国免费| 51久久夜色精品国产麻豆| 97精品超碰一区二区三区| 精品午夜久久福利影院| 亚洲福利视频导航| 亚洲天堂2014| 日本一区二区高清| 欧美tickling网站挠脚心| 欧美精品电影在线播放| 欧洲激情一区二区| 99国产精品久久久久久久久久久 | 蜜桃视频在线一区| 亚洲高清在线精品| 亚洲精品亚洲人成人网| 一区精品在线播放| 一区二区中文字幕在线| 中文字幕av在线一区二区三区| www国产亚洲精品久久麻豆| 91精品综合久久久久久| 3d动漫精品啪啪1区2区免费| 一本大道av伊人久久综合| 91热门视频在线观看| 99精品视频在线免费观看| 成人综合婷婷国产精品久久免费| 极品少妇一区二区三区精品视频| 日韩高清一级片| 免费成人深夜小野草| 蜜桃视频在线观看一区二区| 日本91福利区| 国产综合色产在线精品| 精油按摩中文字幕久久| 久久99日本精品| 国产一区二区成人久久免费影院| 国产一区二区免费在线| 国产丶欧美丶日本不卡视频| 高潮精品一区videoshd| 99精品国产热久久91蜜凸| 91在线视频观看| 91久久精品网| 91麻豆精品国产91久久久资源速度 | 国产精品免费aⅴ片在线观看| 国产喷白浆一区二区三区| 久久久蜜桃精品| 国产精品电影院| 亚洲国产一区二区a毛片| 日韩av中文在线观看| 国产在线视频一区二区| 波多野结衣视频一区| 欧美色图片你懂的| 日韩午夜在线播放| 国产亚洲精品bt天堂精选| 成人免费在线播放视频| 亚洲午夜一区二区三区| 国产专区综合网| 色综合天天综合网天天看片| 欧美一区二区三区思思人| 国产日韩影视精品| 亚洲午夜视频在线观看| 国产在线不卡一卡二卡三卡四卡| 97久久久精品综合88久久| 9191国产精品| 综合分类小说区另类春色亚洲小说欧美|