⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 copyvid.inc

📁 十七种模拟器源代码 非常有用的作课程设计不可缺少的
💻 INC
📖 第 1 页 / 共 5 页
字号:


copyvesa2320x480x8bs
.loopa
    mov ecx,64
.a
    mov eax,[esi]
    mov [es:edi],eax
    add esi,4
    add edi,4
    dec ecx
    jnz .a
.returnloop
    add esi,32
    add edi,64+320
    dec dl
    jnz .loopa
    pop es
    ret

copyvesa2320x480x8ng:
    mov ebx,1
.loopa
    cmp dword[ignor512],0
    je .ignore
    test byte[intrlng+ebx],01h
    jnz near .interlaced
.ignore
    cmp byte[Mode7HiRes],0
    je .nomode7hires
    test byte[mosenng+ebx],1
    jz .yesmode7hires
    cmp byte[mosszng+ebx],0
    jne .nomode7hires
.yesmode7hires
    test byte[intrlng+ebx],40h
    jnz .nomode7hires
    cmp byte[BGMA+ebx],7
    jne .nomode7hires
    cmp byte[BGMA+ebx+1],7
    je near .mode7hires
.nomode7hires

    mov ecx,64
.a
    mov eax,[esi]
    mov [es:edi],eax
    add esi,4
    add edi,4
    dec ecx
    jnz .a
    mov ecx,64
    add edi,64
    sub esi,256
.a2r
    mov eax,[esi]
    mov [es:edi],eax
    add esi,4
    add edi,4
    dec ecx
    jnz .a2r
.returnloop
    add esi,32
    add edi,64
    inc ebx
    dec dl
    jnz near .loopa
    pop es
    ret

.mode7hires
    mov ecx,64
.a7
    mov eax,[esi]
    mov [es:edi],eax
    add esi,4
    add edi,4
    dec ecx
    jnz .a7
    mov ecx,64
    add edi,64
    add esi,75036-256
.a2r7
    mov eax,[esi]
    mov [es:edi],eax
    add esi,4
    add edi,4
    dec ecx
    jnz .a2r7
    sub esi,75036
    jmp .returnloop

.interlaced
    test byte[cfield],1
    jz .b
    add edi,320
.b
    mov ecx,64
.ai
    mov eax,[esi]
    mov [es:edi],eax
    add esi,4
    add edi,4
    dec ecx
    jnz .ai
    test byte[cfield],1
    jnz .bi
    add edi,320
.bi
    jmp .returnloop

;*******************************************************
; Copy VESA2 640x480x8b  Copies buffer to 640x480x8bVBE2
;*******************************************************
%endif

ALIGN32
NEWSYM EagleHold, dd 0
NEWSYM smallscreenon, dd 0
NEWSYM smallscreence, dd 0
NEWSYM CurrentGUIOn, dd 0
vesavaland dd 0,0
mmxvalanda dd 11111111110000001111111111000000b,11111111110000001111111111000000b
mmxvalandb dd 00000000000111110000000000011111b,00000000000111110000000000011111b

%ifdef __MSDOS__
NEWSYM copyvesa2640x480x8bgui
    mov byte[CurrentGUIOn],1
    cmp byte[smallscreenon],1
    je near smallscreen640x480x8b
    cmp byte[ScreenScale],1
    je near smallscreen640x480x8b.fullscreen
    cmp byte[antienab],1
    je near proceagle
    cmp byte[scanlines],1
    je near copyvesa2640x480x8bs
    mov byte[res640],1
    cmp byte[curblank],40h
    jne .startcopy
    ret
.startcopy
    jmp copyvesa2640x480x8b.startcopy2

NEWSYM copyvesa2640x480x8b
    mov byte[CurrentGUIOn],0
    cmp byte[smallscreenon],1
    je near smallscreen640x480x8b
    cmp byte[ScreenScale],1
    je near smallscreen640x480x8b.fullscreen
    cmp byte[antienab],1
    je near proceagle
    cmp byte[scanlines],1
    je near copyvesa2640x480x8bs
    mov byte[res640],1
    cmp byte[curblank],40h
    jne .startcopy
    ret
.startcopy
    cmp byte[f3menuen],1
    je .startcopy2
    cmp byte[ForceNewGfxOff],0
    jne .startcopy2
    cmp byte[newengen],0
    jne near copyvesa2640x480x8ng
.startcopy2
    mov dword[ignor512],0
    push es
    mov ax,[vesa2selec]
    mov es,ax
    mov esi,[vidbuffer]
    mov edi,32*2           ; Draw @ Y from 9 to 247
    cmp word[resolutn],224
    jne .res239
    mov edi,8*640+32*2
.res239
    add edi,[VidStartDraw]
    add esi,16+256+32
    xor eax,eax
    mov ebx,hirestiledat+1
    mov dl,[resolutn]
    dec dl
    dec dl
.loopa
    cmp byte[Triplebufen],1
    je .ignorehr
    cmp byte[ebx],1
    je near .yeshires
.ignorehr
    mov ecx,128
.a
    mov al,[esi+1]
    mov ah,al
    shl eax,16
    mov al,[esi]
    mov ah,al
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .a
    mov ecx,128
    add edi,64*2
    sub esi,256
.a2r
    mov al,[esi+1]
    mov ah,al
    shl eax,16
    mov al,[esi]
    mov ah,al
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .a2r
.returnloop
    add esi,32
    add edi,64*2
    inc ebx
    dec dl
    jnz .loopa
    pop es
    cmp byte[Triplebufen],1
    je .ignorehr2
    xor byte[res512switch],1
.ignorehr2
    ret
.yeshires
    mov byte[ebx],0
    test byte[res512switch],1
    jnz .rightside
    mov ecx,256
.b
    mov al,[esi]
    mov [es:edi],al
    mov [es:edi+640],al
    inc esi
    add edi,2
    dec ecx
    jnz .b
    add edi,640
    jmp .returnloop
.rightside
    mov ecx,256
.b2
    mov al,[esi]
    mov [es:edi+1],al
    mov [es:edi+641],al
    inc esi
    add edi,2
    dec ecx
    jnz .b2
    add edi,640
    jmp .returnloop

NEWSYM copyvesa2640x480x8ng
    push es
    mov ax,[vesa2selec]
    mov es,ax
    mov esi,[vidbuffer]
    mov edi,32*2           ; Draw @ Y from 9 to 247
    cmp word[resolutn],224
    jne .res239
    mov edi,8*640+32*2
.res239
    add edi,[VidStartDraw]
    add esi,16+256+32
    xor eax,eax
    mov ebx,1
    mov dl,[resolutn]
    dec dl
    dec dl
.loopa
    mov ecx,256
    cmp dword[ignor512],0
    je .ignore
    test byte[intrlng+ebx],01h
    jnz near .interlaced
    cmp byte[BGMA+ebx],5
    je near .hires
    cmp byte[BGMA+ebx],6
    je near .hires
    cmp byte[Mode7HiRes],0
    je .nomode7hires
    test byte[mosenng+ebx],1
    jz .yesmode7hires
    cmp byte[mosszng+ebx],0
    jne .nomode7hires
.yesmode7hires
    test byte[intrlng+ebx],40h
    jnz .nomode7hires
    cmp byte[BGMA+ebx],7
    jne .nomode7hires
    cmp byte[BGMA+ebx+1],7
    je near .mode7hires
.nomode7hires
.ignore
    mov ecx,128
.a
    mov al,[esi+1]
    mov ah,al
    shl eax,16
    mov al,[esi]
    mov ah,al
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .a
    mov ecx,128
    add edi,64*2
    sub esi,256
.a2r
    mov al,[esi+1]
    mov ah,al
    shl eax,16
    mov al,[esi]
    mov ah,al
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .a2r
.returnloop
    add esi,32
    add edi,64*2 ;+640
    inc ebx
    dec dl
    jnz near .loopa
    mov dword[ignor512],0
    pop es
    ret
.hires
    mov ecx,128
.a3
    mov al,[esi+1]
    mov ah,[esi+75037]
    shl eax,16
    mov al,[esi]
    mov ah,[esi+75036]
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .a3
    add edi,64*2
    sub esi,256
    mov ecx,128
.a6
    mov al,[esi+1]
    mov ah,[esi+75037]
    shl eax,16
    mov al,[esi]
    mov ah,[esi+75036]
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .a6
    jmp .returnloop

.interlaced
    mov ecx,128
    cmp byte[BGMA+ebx],5
    je .hiresi
    cmp byte[BGMA+ebx],6
    je .hiresi
    test byte[cfield],1
    jz .b
    add edi,640
.b
.a2
    mov al,[esi+1]
    mov ah,al
    shl eax,16
    mov al,[esi]
    mov ah,al
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .a2
    test byte[cfield],1
    jnz .bi
    add edi,640
.bi
    jmp .returnloop

.hiresi
    test byte[cfield],1
    jz .b2
    add edi,640
.b2
.a4
    mov al,[esi+1]
    mov ah,[esi+75037]
    shl eax,16
    mov al,[esi]
    mov ah,[esi+75036]
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .a4
    test byte[cfield],1
    jnz .bi2
    add edi,640
.bi2
    jmp .returnloop

.mode7hires
    cmp byte[mode7hr+ebx],1
    je near .mode7hiresb
    mov ecx,128
.a7
    mov al,[esi+1]
    mov ah,al
    shl eax,16
    mov al,[esi]
    mov ah,al
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .a7
    mov ecx,128
    add edi,64*2
    add esi,75036-256
.a7r
    mov al,[esi+1]
    mov ah,al
    shl eax,16
    mov al,[esi]
    mov ah,al
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .a7r
    sub esi,75036
    jmp .returnloop

.mode7hiresb
    mov ecx,64
.a7hr
    mov eax,[esi]
    mov [es:edi],eax
    add esi,4
    add edi,4
    dec ecx
    jnz .a7hr
    mov ecx,64
    add esi,75036*2-256
.a7hrb
    mov eax,[esi]
    mov [es:edi],eax
    add esi,4
    add edi,4
    dec ecx
    jnz .a7hrb
    sub esi,75036*2
    add edi,64*2
    add esi,75036-256
    mov ecx,64
.a7hrr
    mov eax,[esi]
    mov [es:edi],eax
    add esi,4
    add edi,4
    dec ecx
    jnz .a7hrr
    mov ecx,64
    add esi,75036*2-256
.a7hrbr
    mov eax,[esi]
    mov [es:edi],eax
    add esi,4
    add edi,4
    dec ecx
    jnz .a7hrbr
    sub esi,75036*3
    jmp .returnloop

NEWSYM smallscreen640x480x8b
    mov byte[res640],0
    cmp byte[curblank],40h
    jne .startcopy
    ret
.startcopy
    push es
    mov ax,[vesa2selec]
    mov es,ax
    mov esi,[vidbuffer]
    mov edi,32*2           ; Draw @ Y from 9 to 247
    cmp word[resolutn],224
    jne .res239
    mov edi,8*640+32*2
.res239
    add edi,[VidStartDraw]
    add edi,128+120*640
    add esi,16+256+32
    xor eax,eax
    mov ebx,hirestiledat+1
    mov dl,[resolutn]
    dec dl
    dec dl
.loopa
    mov ecx,64
    rep movsd
    add esi,32
    add edi,640-256
    inc ebx
    dec dl
    jnz .loopa
    pop es
    ret

.fullscreen
    cmp byte[curblank],40h
    jne .startcopy2
    ret
.startcopy2
    push es
    mov ax,[vesa2selec]
    mov es,ax
    mov esi,[vidbuffer]
    xor edi,edi
    cmp word[resolutn],224
    jne .res239b
    mov edi,8*640
.res239b
    add edi,[VidStartDraw]
    add esi,16+256+32
    xor eax,eax
    mov ebx,hirestiledat+1
    mov dl,[resolutn]
    dec dl
    dec dl
    cmp byte[scanlines],1
    je near .scanlines
.loopa3
    mov ecx,128
.loopa2
    mov al,[esi]
    mov [es:edi],al
    mov [es:edi+1],al
    mov [es:edi+640],al
    mov [es:edi+641],al
    mov al,[esi+1]
    mov [es:edi+2],al
    mov [es:edi+3],al
    mov [es:edi+4],al
    mov [es:edi+642],al
    mov [es:edi+643],al
    mov [es:edi+644],al
    add esi,2
    add edi,5
    dec ecx
    jnz .loopa2
    add esi,32
    add edi,640
    inc ebx
    dec dl
    jnz .loopa3
    pop es
    ret

.scanlines
.loopa5
    mov ecx,128
.loopa4
    mov al,[esi]
    mov [es:edi],al
    mov [es:edi+1],al
    mov al,[esi+1]
    mov [es:edi+2],al
    mov [es:edi+3],al
    mov [es:edi+4],al
    add esi,2
    add edi,5
    dec ecx
    jnz .loopa4
    add esi,32
    add edi,640
    inc ebx
    dec dl
    jnz .loopa5
    pop es
    ret

NEWSYM copyvesa2640x480x8bs
    cmp byte[curblank],40h
    jne .startcopy
    ret
.startcopy
    mov byte[res640],2
    push es
    mov ax,[vesa2selec]
    mov es,ax
    mov esi,[vidbuffer]
    mov edi,32*2           ; Draw @ Y from 9 to 247
    cmp word[resolutn],224
    jne .res239
    mov edi,8*640+32*2
.res239
    add edi,[VidStartDraw]
    add esi,16+256+32
    xor eax,eax
    mov ebx,hirestiledat+1
    mov dl,[resolutn]
    dec dl
    dec dl
    cmp byte[CurrentGUIOn],1
    je .loopa
    cmp byte[ForceNewGfxOff],0
    jne .loopa
    cmp byte[newengen],0
    jne near copyvesa2640x480x8bsng
.loopa
    cmp byte[Triplebufen],1
    je .ignorehr
    cmp byte[ebx],1
    je .yeshires
.ignorehr
    mov ecx,256
.a
    mov al,[esi]
    mov [es:edi],al
    mov [es:edi+1],al
    inc esi
    add edi,2
    dec ecx
    jnz .a
.returnloop
    add esi,32
    add edi,64*2+640
    inc ebx
    dec dl
    jnz .loopa
    pop es
    cmp byte[Triplebufen],1
    je .ignorehr2
    xor byte[res512switch],1
.ignorehr2
    ret
.yeshires
    mov byte[ebx],0
    test byte[res512switch],1
    jnz .rightside
    mov ecx,256
.b
    mov al,[esi]
    mov [es:edi],al
    inc esi
    add edi,2
    dec ecx
    jnz .b
    jmp .returnloop
.rightside
    mov ecx,256
.b2
    mov al,[esi]
    mov [es:edi+1],al
    inc esi
    add edi,2
    dec ecx
    jnz .b2
    jmp .returnloop

copyvesa2640x480x8bsng:
    xor ebx,ebx
.loopa
    cmp byte[BGMA+ebx],5
    je near .hires
    cmp byte[BGMA+ebx],6
    je near .hires
    mov ecx,128
.a
    mov al,[esi+1]
    mov ah,al
    shl eax,16
    mov al,[esi]
    mov ah,al
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .a
.returnloop
    add esi,32
    add edi,64*2+640
    inc ebx
    dec dl
    jnz .loopa
    pop es
    xor byte[res512switch],1
    ret
.hires
    mov ecx,128
.a2
    mov al,[esi+1]
    mov ah,[esi+75037]
    shl eax,16
    mov al,[esi]

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -