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

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

?? xmouse.asm

?? 視頻游戲開發C語言源程序
?? ASM
?? 第 1 頁 / 共 2 頁
字號:
;-----------------------------------------------------------------------
; MODULE XMOUSE
;
; Mouse functions functions for all MODE X 256 Color resolutions
;
; Compile with Tasm.
; C callable.
;
; ****** XLIB - Mode X graphics library                ****************
; ******                                               ****************
; ****** Written By Themie Gouthas                     ****************
;
; This module is based on Shane Hyde's module of the same name,
; posted to Rec.Games.Programmer, October 92.
;
;
; egg@dstos3.dsto.gov.au
; teg@bart.dsto.gov.au
;
; mouse cursor shape by Tiaan A Geldenhuys
;
;-----------------------------------------------------------------------

COMMENT  $


This is a module implementing very basic mouse functions.

It does not support the full functionality of:

  SPLIT SCREENS
  SCROLLED WINDOWS
  VIRTUAL WINDOWS

	      --------------------------------------

	      MS Mouse Driver Functions

	      Mouse Initialization                 0
	      Show Cursor                          1
	      Hide Cursor                          2
	      Get Mouse Position & Button Status   3
	      Set Mouse Cursor Position            4
	      Get Button Press Information         5
	      Get Button Release Information       6
	      Set Min/Max Horizontal Position      7
	      Set Min/Max Vertical Position        8
	      Define Graphics Cursor Block         9
	      Define Text Cursor                  10
	      Read Mouse Motion Counters          11
	      Define Event Handler                12
	      Light Pen Emulation Mode ON         13
	      Light Pen Emulation Mode OFF        14
	      Set Mouse Mickey/Pixel Ratio        15
	      Conditional Hide Cursor             16
	      Set Double-Speed Threshold          19
	      --------------------------------------
$

include xlib.inc
include xdetect.inc

.data

global   _MouseInstalled    :word
global   _MouseHidden       :word
global   _MouseButtonStatus :word
global   _MouseX            :word
global   _MouseY            :word
global   _MouseFrozen       :byte
global   _MouseColor        :byte

global   _x_define_mouse_cursor :proc
global   _x_show_mouse          :proc
global   _x_hide_mouse          :proc
global   _x_mouse_remove        :proc
global   _x_position_mouse      :proc
global   _x_put_cursor          :proc
global   _x_update_mouse        :proc
global   _x_mouse_init          :proc
global   _x_mouse_window        :proc


ALIGN 2



      InitMouseDef db 00000001b  ; Default mouse mask, note the reverse order
		db 00000011b
		db 00000111b
		db 00001111b
		db 00011111b
		db 00111111b
		db 01111111b
		db 11111111b
		db 00011111b
		db 00011011b
		db 00110001b
		db 00110000b
		db 01100000b
		db 01100000b



COMMENT $

   Old mouse definition

   InitMouseDef db 00000001b  ; Default mouse mask, note the reverse order
		db 00000011b
		db 00000111b
		db 00001111b
		db 00011111b
		db 00111111b
		db 01111111b
		db 11111111b
		db 00011100b
		db 00111100b
		db 01111100b
		db 00000000b
		db 00000000b
		db 00000000b

$

    MouseMask          db 168 dup(?)
    OldHandlerSeg      dw  ?
    OldHandlerOffs     dw  ?
    OldHandlerMask     dw  ?
    OldX               dw  ?
    OldY               dw  ?
    OldScrnOffs        dw  ?

    BGSaveOffs         dw  0

   _MouseInstalled     dw 0     ; Flag indicating whether mouse is installed
   _MouseHidden        dw 0     ; Flag indicating whether mouse is hidden
   _MouseButtonStatus  dw 0     ; Holds current button press information
   _MouseX             dw 0     ; Coords of cursor hot spot
   _MouseY             dw 0
   _MouseFrozen        db 0     ; Mouse motion enable/disable control
   _MouseColor         db 0     ; Mouse cursor colour

   inhandler           db 0
.code

;----------------------------------------------------------------------
; Local function that updates the cursor position
;
; Destroys SI,DI,AX,BX
;
;----------------------------------------------------------------------
proc update_cursor near
   WaitVsyncStart

   mov di,[OldScrnOffs]             ; Delete cursor (restore old background)
   mov ax,[OldY]
   mov bx,[OldX]

   call restorebg

   mov si,[_VisiblePageOffs]        ; Save cursor background
   mov ax,[_MouseY]
   mov bx,[_MouseX]
   mov [OldScrnOffs],si
   mov [OldY],ax
   mov [OldX],bx
   call getbg

   push [_VisiblePageOffs]          ; Draw the cursor
   mov  ax,[_ScrnPhysicalHeight]
   push ax
   mov  ax,0
   push ax
   push [OldY]
   push [OldX]
   call _x_put_cursor
   add  sp,10
   ret
update_cursor endp


;----------------------------------------------------------------------
; x_mouse_init - Initialise Mode X mouse handler
;
; C Prototype
;
;  int x_mouse_init()
;
; This is the first function you must call before using any of the mouse
; functions
;
; WARNING: This function uses and updates "NonVisual_Offset" to allocate
;          video ram for the saved mouse background.
;
; This mouse code uses the fastest possible techniques to save and restore
; mouse backgrounds and to draw the mouse cursor.
;
; LIMITATIONS: No clipping is supported horizontally for the mouse cursor
;              No validity checking is performed for NonVisual_Offs
;
;
; **WARNING** Hide or freeze mouse while drawing using any of the other
;             Modules. VGA register settings are not preserved which will
;             result in unpredictable drawing behavior.
;             If you know the drawing will occur away from the mouse cursor
;             set MouseFrozen to TRUE (1), do your drawing then set it to
;             FALSE (0). Alternatively call "x_hide_mouse", perform your
;             drawing and then call "x_show_mouse"
;
;
; Written by Themie Gouthas
;----------------------------------------------------------------------
_x_mouse_init proc
     push  bp
     mov   bp,sp

     cmp   [_MouseButtonCount],0  ; Dont initialize if mouse detection
     jne   @@DontInitialize       ; or initialization function previously
				  ;   called
     xor   ax,ax                  ; FUNC 0: Mouse Initialization
     int   33h                    ;
     or    ax,ax                  ; Is there a mouse installed ?
     jz    @@Done
     mov   [_MouseButtonCount],bx ; Set the button count

@@DontInitialize:

     mov   [_MouseInstalled],ax
     or    ax,ax                  ; Do we have an installed mouse driver ?
     jz    @@Done                 ; Nop!

     mov   ax,[_NonVisual_Offs];  ; Allocate VRAM for saved background
     mov   BGSaveOffs,ax

     add   ax,14*3
     mov   [_NonVisual_Offs],ax   ; Update NonVisualOffset

     mov   ax,02                  ; FUNC 2: Hide Cursor
     int   33h                    ;  (hide the mouse driver's default cursor)
     mov   _MouseInstalled,TRUE   ; Indicate user mouse driver present

     mov   ax,07h                 ; FUNC 7:Set min/max horizontal position
     mov   cx,0
     mov   dx,[_ScrnPhysicalPixelWidth]
     shl   dx,1                   ; Mult X by 2 as cursor steps by 2 pixels
     int   33h                    ; 0 < X < _ScrnPhysicalPixelWidth

     mov   ax,08h                 ; FUNC 8:Set min/max vertical position
     mov   cx,0
     mov   dx,_ScrnPhysicalHeight
     int   33h                    ; 0 < Y < _ScrnPhysicalHeight

     mov   ax,0fh                 ; FUNC 15: Mouse Hor/Vert resolution
     mov   cx,4                   ; Horiz speed  >> Value => << Speed
     mov   dx,8                   ; Vert Speed
     int   33h

     mov   ax,3                   ; FUNC 3: Get mouse pos & button status
     int   33h
     mov   [_MouseY],dx
     shr   cx,1
     mov   [_MouseX],cx

     mov   ax,12                  ; FUNC 12: Define Event Handler
     mov   bx,seg mouse_handler   ;  ES:DX -> Event handler
     mov   es,bx
     mov   dx,offset mouse_handler
     mov   cx,1fh                 ;  Set handler for all events
     int   33h



     mov   [_MouseHidden],TRUE    ; Mouse initially hidden

     push  ds                     ; Set the default cursor shape
     mov   ax,offset InitMouseDef
     push  ax
     call  _x_define_mouse_cursor
     add   sp,04h

     mov   ax,[_MouseInstalled]   ; Return MouseInstalled flag
@@Done:
     pop   bp
     ret
_x_mouse_init endp

;----------------------------------------------------------------------
; x_mouse_window - Define a mouse window
;
; C Prototype
;
;  void x_mouse_window(int x0, int y0, int x1, int y1);
;
;
; Written by Themie Gouthas
;----------------------------------------------------------------------
_x_mouse_window proc
ARG x0:word,y0:word,x1:word,y1:word
     push  bp
     mov   bp,sp

     mov   ax,7       ; FUNC 7: Set X range
     mov   cx,x0
     shl   cx,1
     mov   dx,x1
     shl   dx,1
     int   33h

     mov   ax,8       ; FUNC 8: Set Y range
     mov   cx,y0
     mov   dx,y1
     int   33h
     pop   bp
     ret
_x_mouse_window endp


;----------------------------------------------------------------------
; x_define_mouse_cursor - Define a mouse cursor from an input bitmask
;
; C Prototype
;
;  void x_define_mouse_cursor(char far *MouseDef, unsigned char MouseColor)
;
; WARNING: This function assumes MouseDef points to 14 bytes.
;
; Note: Bit order is in reverse. ie bit 7 represents pixel 0 ..
;       bit 0 represents pixel 7 in each "MouseDef" byte.
;
; Written by Themie Gouthas
;----------------------------------------------------------------------
_x_define_mouse_cursor proc
ARG MouseDef:dword,MouseColor:byte
     push  bp
     mov   bp,sp

     cmp  [_MouseInstalled],FALSE   ; Check whether we have installed
     je   @@Done                    ;  our mouse handler and leave if not

     mov  al,[MouseColor]           ; Set the mouse pointers color
     mov  [_MouseColor],al

     push  si
     push  di
     push  ds
     mov   ax,ds                ; ES:DI -> Stored plane mask for all
     mov   es,ax                ;   pixel alignments of mouse cursor
     mov   di,offset MouseMask
     lds   si,MouseDef
     xor   cl,cl                ; CL = current alignment (initially zero)
@@AlignmentLoop:
     push  si                   ; save MouseDef ptr for next alignment
     mov   dh,14                ; Init Row counter to Cursor Height
@@RowLoop:
     lodsb                      ; Load first cursor def byte each bit
				;  representing pixel in the row
     xor   ah,ah                ; AH is the shift overflow byte
     shl   ax,cl                ; Shift mask for current alignment

     mov   bl,al                ; store first three nibbles of ax into
     and   bl,0fh               ;  consecutive bytes in the destination
     mov   es:[di],bl           ;  buffer
     inc   di
     shr   al,4
     stosw

     dec   dh                   ; Next row for this alignment if there
     jnz   @@RowLoop            ;  are more to do

     pop   si                   ; point to the start of the cursor def.
     inc   cl                   ; Select next pixel alignment
     cmp   cl,4                 ; If there are more alignments to do
     jne   @@AlignmentLoop      ;   then jump

     pop   ds
     pop   di
     pop   si
@@Done:
     pop   bp
     ret
_x_define_mouse_cursor endp


;----------------------------------------------------------------------
; x_show_mouse - Shows a previously hidden mouse cursor
;
; C Prototype
;
;  void x_show_mouse()
;
; Written by Themie Gouthas
;----------------------------------------------------------------------
_x_show_mouse proc
     push  bp
     mov   bp,sp
     cmp   [_MouseInstalled],FALSE  ; Make sure our handler is installed
     je    @@Done
     cmp   [_MouseHidden],FALSE     ; If not hidden then exit
     je    @@Done
     push  si
     push  di


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


     mov   si,[_VisiblePageOffs]  ; Save mouse background and pos details
     mov   ax,[_MouseY]
     mov   bx,[_MouseX]
     mov   [OldScrnOffs],si
     mov   [OldY],ax
     mov   [OldX],bx
     call  getbg

     push [_VisiblePageOffs]      ; Draw cursor
     push [_ScrnLogicalHeight]
     xor  ax,ax
     push ax
     push [OldY]
     push [OldX]
     call _x_put_cursor
     add  sp,10

     mov   [_MouseHidden],FALSE   ; Indicate mouse cursor no longer hidden

     pop  di
     pop  si
@@Done:
     pop   bp
     ret
_x_show_mouse endp


;----------------------------------------------------------------------
; x_hide_mouse - Hides a previously visible mouse cursor
;
; C Prototype
;
;  void x_hide_mouse()

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩免费观看一区三区| 国产目拍亚洲精品99久久精品 | 久久精品999| 懂色av一区二区夜夜嗨| 欧美伦理电影网| 国产精品福利影院| 国产一区二区三区免费在线观看 | 国产一区二区三区蝌蚪| 欧美三级视频在线| 亚洲品质自拍视频| 成人黄色在线看| 久久久99免费| 狠狠色综合日日| 欧美一区二区黄| 日韩高清电影一区| 在线精品视频免费播放| 亚洲欧美精品午睡沙发| 成人免费视频播放| 国产色婷婷亚洲99精品小说| 久久国产人妖系列| 欧美一区二区精品| 免费成人结看片| 欧美一区2区视频在线观看| 五月婷婷激情综合网| 欧美性生活影院| 亚洲电影中文字幕在线观看| 日本精品裸体写真集在线观看| 国产精品蜜臀在线观看| 成人a区在线观看| 欧美激情一区在线观看| 成人av午夜影院| 综合亚洲深深色噜噜狠狠网站| 成人午夜视频福利| 国产精品久久久久桃色tv| 北条麻妃一区二区三区| 综合激情成人伊人| 色一情一乱一乱一91av| 亚洲精品写真福利| 欧美唯美清纯偷拍| 性做久久久久久免费观看欧美| 欧美日本视频在线| 国内精品自线一区二区三区视频| 欧美成人激情免费网| 激情文学综合丁香| 国产精品视频一区二区三区不卡| 99久久精品免费精品国产| 亚洲人成网站色在线观看| 欧美色电影在线| 日本欧美一区二区三区乱码 | 久久不见久久见中文字幕免费| 欧美一区国产二区| 国产一区二区三区久久悠悠色av| 欧美国产精品劲爆| 色屁屁一区二区| 午夜电影网一区| 久久美女高清视频| 91美女蜜桃在线| 免费人成黄页网站在线一区二区| 久久综合av免费| 91九色02白丝porn| 久久99国产精品久久99| 国产精品美女久久久久久| 欧美日韩午夜在线| 国产suv精品一区二区三区| 尤物av一区二区| 精品国产乱子伦一区| 色综合激情久久| 久久成人18免费观看| 亚洲视频中文字幕| 日韩亚洲欧美成人一区| 99视频有精品| 久久精品国产一区二区三区免费看| 久久久不卡网国产精品二区| 欧美色爱综合网| 成人免费毛片片v| 日av在线不卡| 亚洲麻豆国产自偷在线| 26uuu精品一区二区| 欧美视频三区在线播放| 国产精品资源在线看| 午夜精品在线视频一区| 国产精品福利影院| 久久久综合网站| 91麻豆精品91久久久久同性| 99久久精品国产一区二区三区| 久久精品国产澳门| 亚洲国产日韩综合久久精品| 亚洲国产精品99久久久久久久久| 欧美一区二区三区四区五区 | 成人美女在线观看| 秋霞国产午夜精品免费视频| 一区二区三区免费网站| 国产精品伦一区二区三级视频| 日韩欧美中文字幕公布| 欧美日韩一二三区| 在线亚洲一区二区| 91视频在线观看| jlzzjlzz亚洲女人18| 国产成人精品免费一区二区| 久久se这里有精品| 日本三级亚洲精品| 日韩av在线发布| 亚洲第一福利一区| 亚洲电影第三页| 亚洲欧洲中文日韩久久av乱码| 中国av一区二区三区| 精品国产不卡一区二区三区| 欧美一区二区三区免费观看视频 | 欧美中文字幕一二三区视频| 99麻豆久久久国产精品免费| 成人午夜视频在线观看| 不卡影院免费观看| av高清久久久| 99re这里只有精品首页| 91猫先生在线| 色域天天综合网| 欧美这里有精品| 欧美日韩国产乱码电影| 欧美人牲a欧美精品| 欧美精品第1页| 精品少妇一区二区三区日产乱码| 日韩欧美一区在线| 久久久久久久久岛国免费| 国产调教视频一区| 国产精品第四页| 亚洲专区一二三| 日韩av网站在线观看| 激情综合网av| 97久久精品人人做人人爽50路| 一本到一区二区三区| 欧美日韩在线播放一区| 91精品国产高清一区二区三区蜜臀 | 国产成人精品三级| 91亚洲国产成人精品一区二区三| 色妹子一区二区| 91精品国产综合久久蜜臀| xnxx国产精品| 亚洲日本在线a| 日一区二区三区| 国产乱码精品一区二区三区忘忧草| 国产激情视频一区二区三区欧美| av午夜一区麻豆| 欧美久久一二区| 国产调教视频一区| 亚洲五码中文字幕| 国产在线一区观看| 欧美中文字幕亚洲一区二区va在线 | 国产三级精品三级| 一区二区在线观看视频| 精品在线观看视频| 91小视频免费观看| 日韩一级片在线观看| 国产精品久久久久久久岛一牛影视 | 欧美国产日韩精品免费观看| 亚洲一区二区欧美日韩| 精品午夜久久福利影院| 欧美中文字幕一区二区三区亚洲 | 国产一区二三区好的| 色婷婷精品大在线视频| 精品国产91久久久久久久妲己| 亚洲天堂2014| 久久se这里有精品| 91成人在线免费观看| 久久亚洲精品小早川怜子| 亚洲五码中文字幕| av一区二区不卡| 日韩精品一区二| 夜夜精品视频一区二区| 丰满少妇久久久久久久| 91精品国产品国语在线不卡| 国产精品初高中害羞小美女文| 蜜臀av亚洲一区中文字幕| 在线观看一区二区精品视频| 国产午夜精品在线观看| 免费在线观看视频一区| 欧美在线观看禁18| 国产精品国产三级国产aⅴ中文| 免费欧美在线视频| 欧美性大战xxxxx久久久| 国产精品久久精品日日| 国产综合成人久久大片91| 欧美日韩www| 亚洲精品伦理在线| jizzjizzjizz欧美| 国产亚洲女人久久久久毛片| 麻豆91在线观看| 日韩一区二区三区在线视频| 午夜免费久久看| 欧美熟乱第一页| 亚洲精品日日夜夜| 91蜜桃在线免费视频| 中文字幕亚洲综合久久菠萝蜜| 久久av中文字幕片| 日韩欧美的一区二区| 日本特黄久久久高潮| 欧美一区在线视频| 美女网站在线免费欧美精品| 欧美一区二区三区在线观看视频 | 亚洲精品一区二区三区蜜桃下载| 日韩电影免费一区|