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

📄 copyvid.inc

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

.quarterscanlines
.loopabhq
    mov ecx,256
    xor eax,eax
.abhq
    mov al,[esi]
    mov bx,[GUICPC+eax*2]
    mov [es:edi],bx
    mov [es:edi+2],bx
    inc esi
    add edi,4
    dec ecx
    jnz .abhq
    add edi,128*2
    mov ecx,256
    sub esi,256
.abh2q
    mov al,[esi]
    mov bx,[GUICPC+eax*2]
    shl ebx,16
    mov bx,[GUICPC+eax*2]
    and ebx,[vesa2_clbitng2]
    shr ebx,1
    mov eax,ebx
    and eax,[vesa2_clbitng2]
    shr eax,1
    add ebx,eax
    mov [es:edi],ebx
    xor eax,eax
    inc esi
    add edi,4
    dec ecx
    jnz .abh2q
    add esi,32
    add edi,128*2
    dec dl
    jnz .loopabhq
    pop es
    ret

NEWSYM smallscreen640x480x16bgui
    cmp byte[curblank],40h
    jne .startcopy
    ret
.startcopy
    push es
    mov ax,[vesa2selec]
    mov es,ax
    mov esi,[vidbuffer]
    mov edi,32*2*2           ; Draw @ Y from 9 to 247
    cmp word[resolutn],224
    jne .res239
    mov edi,8*640*2+32*2*2
.res239
    add edi,[VidStartDraw]
    add edi,128*2+120*640*2
    add esi,16+256+32
    xor eax,eax
    mov ebx,hirestiledat+1
    mov dl,[resolutn]
    dec dl
    dec dl
.loopa
    mov ecx,256
    xor eax,eax
.a3
    mov al,[esi]
    mov bx,[GUICPC+eax*2]
    mov [es:edi],bx
    inc esi
    add edi,2
    dec ecx
    jnz .a3
    add esi,32
    add edi,640*2-256*2
    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*320*2*2
.res239b
    add edi,[VidStartDraw]
    add esi,16+256+32
    xor eax,eax
    mov dl,[resolutn]
    dec dl
    dec dl
    cmp byte[scanlines],1
    je near .scanlines
.loopa2
    mov ecx,128
    xor eax,eax
.a
    mov al,[esi]
    mov bx,[GUICPC+eax*2]
    mov [es:edi],bx
    mov [es:edi+2],bx
    mov al,[esi+1]
    mov bx,[GUICPC+eax*2]
    mov [es:edi+4],bx
    mov [es:edi+6],bx
    mov [es:edi+8],bx
    add esi,2
    add edi,10
    dec ecx
    jnz .a
    sub esi,256
    mov ecx,128
.a2
    mov al,[esi]
    mov bx,[GUICPC+eax*2]
    mov [es:edi],bx
    mov [es:edi+2],bx
    mov al,[esi+1]
    mov bx,[GUICPC+eax*2]
    mov [es:edi+4],bx
    mov [es:edi+6],bx
    mov [es:edi+8],bx
    add esi,2
    add edi,10
    dec ecx
    jnz .a2
    add esi,32
    dec dl
    jnz near .loopa2
    pop es
    ret

.scanlines
.loopab
    mov ecx,128
    xor eax,eax
.ab
    mov al,[esi]
    mov bx,[GUICPC+eax*2]
    mov [es:edi],bx
    mov [es:edi+2],bx
    mov al,[esi+1]
    mov bx,[GUICPC+eax*2]
    mov [es:edi+4],bx
    mov [es:edi+6],bx
    mov [es:edi+8],bx
    add esi,2
    add edi,10
    dec ecx
    jnz .ab
    add esi,32
    add edi,640*2
    dec dl
    jnz .loopab
    pop es
    ret

NEWSYM copyvesa2640x480x16b
;    cmp byte[vesa2red10],1
;    je near copyvesa2640x480x16br
    cmp byte[vesa2red10],1
    jne .notbr
    call ConvertToAFormat
;    call UnConvertToAFormat
.notbr
    cmp byte[smallscreenon],1
    je near smallscreen640x480x16b
    cmp byte[ScreenScale],1
    je near smallscreen640x480x16b.fullscreen
    cmp byte[curblank],40h
    jne .startcopy
    ret
.startcopy
    push es
    mov ax,[vesa2selec]
    mov es,ax
    mov esi,[vidbuffer]
    mov edi,32*2*2           ; Draw @ Y from 9 to 247
    cmp word[resolutn],224
    jne .res239
    mov edi,8*320*2*2+32*2*2
.res239
    add edi,[VidStartDraw]
    add esi,16*2+256*2+32*2
    xor eax,eax
    ; Check if interpolation mode
    cmp byte[GUIOn],1
    je .nointerp
    cmp byte[FPUCopy],2
    jne .nommx
    cmp byte[newgfx16b],0
    je .nommx
    cmp byte[En2xSaI],0
    jne near Process2xSaI
.nommx
    cmp byte[antienab],1
    je near interpolate640x480x16b
.nointerp
    mov dl,[resolutn]
    dec dl
    dec dl
    cmp byte[scanlines],1
    je near .scanlines
    cmp byte[scanlines],3
    je near .halfscanlines
    cmp byte[scanlines],2
    je near .quartscanlines
    mov ebx,hirestiledat+1
    cmp byte[newengen],0
    je .loopa
    mov ebx,SpecialLine+1
.loopa
    mov ecx,256
    cmp byte[Triplebufen],1
    je .ignorehr
    cmp byte[ebx],1
    je near .yeshires
    cmp byte[GUIOn],1
    je .ignorehr
    cmp byte[ebx],1
    ja near .yeshiresng
.ignorehr
    cmp byte[FPUCopy],2
    je near .mmx
.a
    mov ax,[esi]
    shl eax,16
    mov ax,[esi]
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .a
    sub esi,256*2
    add edi,128*2
    mov ecx,256
.a2
    mov ax,[esi]
    shl eax,16
    mov ax,[esi]
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .a2
.return
    add esi,64
    add edi,128*2
    inc ebx
    dec dl
    jnz near .loopa
    pop es
    cmp byte[Triplebufen],1
    je .ignorehr2
    xor byte[res512switch],1
.ignorehr2
    cmp byte[FPUCopy],2
    je .mmx2
    ret
.mmx2
    emms
    ret
.yeshires
    mov byte[ebx],0
    test byte[res512switch],1
    jnz .rightside
.b
    mov ax,[esi]
    mov [es:edi],ax
    mov [es:edi+1280],ax
    add esi,2
    add edi,4
    dec ecx
    jnz .b
    add edi,640*2
    jmp .return
.rightside
.c
    mov ax,[esi]
    mov [es:edi+2],ax
    mov [es:edi+1282],ax
    add esi,2
    add edi,4
    dec ecx
    jnz .c
    add edi,640*2
    jmp .return
.mmx
    mov eax,[spritetablea]
    mov ecx,64
    add eax,512
.mmxr
    movq mm0,[esi]
    movq mm1,mm0
    punpcklwd mm0,mm1
    movq [es:edi],mm0
    punpckhwd mm1,mm1
    movq [es:edi+8],mm1
    movq [eax],mm0
    movq [eax+8],mm1
    add esi,8
    add edi,16
    add eax,16
    dec ecx
    jnz .mmxr
.nextmmx
    mov eax,[spritetablea]
    mov ecx,32
    add eax,512
    add edi,128*2
.mmxr2
    movq mm0,[eax]
    movq [es:edi],mm0
    movq mm1,[eax+8]
    movq [es:edi+8],mm1
    movq mm2,[eax+16]
    movq [es:edi+16],mm2
    movq mm3,[eax+24]
    movq [es:edi+24],mm3
    add eax,32
    add edi,32
    dec ecx
    jnz .mmxr2
    jmp .return
.yeshiresng
    call HighResProc
    jmp .return

.scanlines
    mov ebx,hirestiledat+1
    cmp byte[GUIOn],1
    je .loopab
    cmp byte[newengen],0
    je .loopab
    mov ebx,SpecialLine+1
.loopab
    mov ecx,256
    cmp byte[Triplebufen],1
    je .ignorehrb
    cmp byte[ebx],1
    je .yeshiresb
    cmp byte[ebx],1
    jbe .ignorehrb
    call HighResProc
    jmp .returnb
.ignorehrb
    cmp byte[FPUCopy],2
    je near .mmxsl
.ab
    mov ax,[esi]
    shl eax,16
    mov ax,[esi]
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .ab
.returnb
    add esi,64
    add edi,128*2+640*2
    inc ebx
    dec dl
    jnz .loopab
    pop es
    cmp byte[Triplebufen],1
    je .ignorehr2b
    xor byte[res512switch],1
.ignorehr2b
    cmp byte[FPUCopy],2
    je near .mmx2
    ret
.yeshiresb
    mov byte[ebx],0
    test byte[res512switch],1
    jnz .rightsideb
.bb
    mov ax,[esi]
    mov [es:edi],ax
    add esi,2
    add edi,4
    dec ecx
    jnz .bb
    jmp .returnb
.rightsideb
.cb
    mov ax,[esi]
    mov [es:edi+2],ax
    add esi,2
    add edi,4
    dec ecx
    jnz .cb
    jmp .returnb
.mmxsl
    mov ecx,64
.mmxrsl
    movq mm0,[esi]
    movq mm1,mm0
    punpcklwd mm0,mm1
    punpckhwd mm1,mm1
    movq [es:edi],mm0
    movq [es:edi+8],mm1
    add esi,8
    add edi,16
    add eax,16
    dec ecx
    jnz .mmxrsl
    jmp .returnb

.halfscanlines
    mov ebx,hirestiledat+1
    cmp byte[GUIOn],1
    je .loopabh
    cmp byte[newengen],0
    je .loopabh
    mov ebx,SpecialLine+1
.loopabh
    cmp byte[ebx],1
    jbe .ignorehrbh
    call HighResProc
    jmp .returnbh
.ignorehrbh
    cmp byte[FPUCopy],2
    je near .mmxslh
    mov ecx,256
.abh
    mov ax,[esi]
    shl eax,16
    mov ax,[esi]
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .abh
    mov ecx,256
    sub esi,512
    add edi,128*2
.abhs
    mov ax,[esi]
    shl eax,16
    mov ax,[esi]
    and eax,[vesa2_clbitng2]
    shr eax,1
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .abhs
.returnbh
    add esi,64
    add edi,128*2
    inc ebx
    dec dl
    jnz near .loopabh
    pop es
    cmp byte[FPUCopy],2
    je near .mmx2
    ret
.mmxslh
    mov eax,[spritetablea]
    mov ecx,64
    add eax,512
.mmxrslh
    movq mm0,[esi]
    movq mm1,mm0
    punpcklwd mm0,mm1
    punpckhwd mm1,mm1
    movq [es:edi],mm0
    movq [es:edi+8],mm1
    movq [eax],mm0
    movq [eax+8],mm1
    add esi,8
    add edi,16
    add eax,16
    dec ecx
    jnz .mmxrslh
    mov eax,[spritetablea]
    mov ecx,32
    add eax,512
    add edi,128*2
    movq mm4,[vesa2_clbitng2]
.mmxr2h
    movq mm0,[eax]
    movq mm1,[eax+8]
    movq mm2,[eax+16]
    movq mm3,[eax+24]
    pand mm0,mm4
    pand mm1,mm4
    pand mm2,mm4
    pand mm3,mm4
    psrlw mm0,1
    psrlw mm1,1
    psrlw mm2,1
    psrlw mm3,1
    movq [es:edi],mm0
    movq [es:edi+8],mm1
    movq [es:edi+16],mm2
    movq [es:edi+24],mm3
    add eax,32
    add edi,32
    dec ecx
    jnz .mmxr2h
    jmp .returnbh

.quartscanlines
    mov [lineleft],dl
    mov ebx,hirestiledat+1
    cmp byte[GUIOn],1
    je .loopabh2
    cmp byte[newengen],0
    je .loopabh2
    mov ebx,SpecialLine+1
.loopabh2
    cmp byte[ebx],1
    jbe .ignorehrbh2
    call HighResProc
    jmp .returnbh2
.ignorehrbh2
    cmp byte[FPUCopy],2
    je near .mmxslh2
    mov ecx,256
.abh2
    mov ax,[esi]
    shl eax,16
    mov ax,[esi]
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .abh2
    mov ecx,256
    sub esi,512
    add edi,128*2
.abhs2
    mov ax,[esi]
    shl eax,16
    mov ax,[esi]
    and eax,[vesa2_clbitng2]
    shr eax,1
    mov edx,eax
    and edx,[vesa2_clbitng2]
    shr edx,1
    add eax,edx
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .abhs2
.returnbh2
    add esi,64
    add edi,128*2
    inc ebx
    dec byte[lineleft]
    jnz near .loopabh2
    pop es
    cmp byte[FPUCopy],2
    je near .mmx2
    ret
.mmxslh2
    mov eax,[spritetablea]
    mov ecx,64
    add eax,512
.mmxrslh2
    movq mm0,[esi]
    movq mm1,mm0
    punpcklwd mm0,mm1
    punpckhwd mm1,mm1
    movq [es:edi],mm0
    movq [es:edi+8],mm1
    movq [eax],mm0
    movq [eax+8],mm1
    add esi,8
    add edi,16
    add eax,16
    dec ecx
    jnz .mmxrslh2
    mov eax,[spritetablea]
    mov ecx,64
    add eax,512
    add edi,128*2
    movq mm4,[vesa2_clbitng2]
.mmxr2h2
    movq mm0,[eax]
    movq mm1,[eax+8]
    pand mm0,mm4
    pand mm1,mm4
    psrlw mm0,1
    psrlw mm1,1
    movq mm2,mm0
    movq mm3,mm1
    pand mm2,mm4
    pand mm3,mm4
    psrlw mm2,1
    psrlw mm3,1
    paddd mm0,mm2
    paddd mm1,mm3
    movq [es:edi],mm0
    movq [es:edi+8],mm1
    add eax,16
    add edi,16
    dec ecx
    jnz .mmxr2h2
    jmp .returnbh2

HighResProc:
    mov ecx,256
    cmp byte[ebx],3
    je near .hiresmode7
    cmp byte[ebx],7
    je near .hiresmode7
    test byte[ebx],4
    jz .nofield
    cmp byte[scanlines],0
    jne .nofield
    test byte[cfield],1
    jz .nofield
    add edi,640*2
.nofield
    test byte[ebx],3
    jnz near .hires
.a
    mov ax,[esi]
    shl eax,16
    mov ax,[esi]
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .a
    cmp byte[scanlines],0
    jne .nofield
    test byte[cfield],1
    jnz .nofielde
    add edi,640*2
.nofielde
    ret
.hiresmode7
    cmp byte[FPUCopy],2
    je .yeshiresngmmxmode7
.a2
    mov ax,[esi]
    shl eax,16
    mov ax,[esi]
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .a2
    add edi,128*2
    sub esi,512
    mov ecx,256
    add esi,75036*4
.a2b
    mov ax,[esi]
    shl eax,16
    mov ax,[esi]
    mov [es:edi],eax
    add esi,2
    add edi,4
    dec ecx
    jnz .a2b
    sub esi,75036*4
    ret
.yeshiresngmmxmode7
    mov ecx,64
.mmxr
    movq mm0,[esi]
    movq mm1,mm0
    punpcklwd mm0,mm1
    movq [es:edi],mm0
    punpckhwd mm1,mm1
    movq [es:edi+8],mm1
    add esi,8
    add edi,16
    add eax,16
    dec ecx
    jnz .mmxr
    add edi,128*2
    sub esi,512
    add esi,75036*4
    mov ecx,64
.mmxrb
    movq mm0,[esi]
    movq mm1,mm0
    punpcklwd mm0,mm1
    movq [es:edi],mm0
    punpckhwd mm1,mm1
    movq [es

⌨️ 快捷键说明

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