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

📄 ctv.asm

📁 DGen源码最后版本
💻 ASM
字号:
; CTV!

bits 32
section .text
;extern "C" int blur_bitmap_16
;  (unsigned char *dest,int len);

global _blur_bitmap_16
times ($$-$) & 3 db 0
_blur_bitmap_16
push edi ; point to screen
push edx ; temporary for unwrapping
push ecx ; count
push ebx ; last pixel

; ax = current pixel

xor ebx,ebx ; Last pixel

mov edi,[esp+20] ; edi is a pointer to the bitmap
mov ecx,[esp+24] ; ecx is the amount of pixels to blur

blur16_loop:
mov ax,word[edi]

mov dx,ax
and ax,0x07e0
and dx,0xf81f
rol eax,16
mov ax,dx
; Now we have unwrapped the green middle out of eax
mov edx,eax ; ebx=this pixel (unwrapped) before we changed it
add eax,ebx ; add last pixel to this one
mov ebx,edx ; ebx=this pixel for next time

sar eax,1

; wrap up again
mov edx,eax
ror edx,16
and dx,0x07e0
and ax,0xf81f
or  ax,dx
;finished pixel in ax

;mov word[edi],ax
;add edi,2
stosw
loop blur16_loop

pop  ebx
pop  ecx
pop  edx
pop  edi
xor eax,eax
ret


; --------------------------------------

bits 32
section .text
;extern "C" int blur_bitmap_15
;  (unsigned char *dest,int len);

global _blur_bitmap_15
times ($$-$) & 3 db 0
_blur_bitmap_15
push edi ; point to screen
push edx ; temporary for unwrapping
push ecx ; count
push ebx ; last pixel

; ax = current pixel

xor ebx,ebx ; Last pixel

mov edi,[esp+20] ; edi is a pointer to the bitmap
mov ecx,[esp+24] ; ecx is the amount of pixels to blur

blur15_loop:
mov ax,word[edi]

mov dx,ax
and ax,0x03e0
and dx,0x7c1f
rol eax,16
mov ax,dx
; Now we have unwrapped the green middle out of eax
mov edx,eax ; ebx=this pixel (unwrapped) before we changed it
add eax,ebx ; add last pixel to this one
mov ebx,edx ; ebx=this pixel for next time

sar eax,1

; wrap up again
mov edx,eax
ror edx,16
and dx,0x03e0
and ax,0x7c1f
or  ax,dx
;finished pixel in ax

;mov word[edi],ax
;add edi,2
stosw
loop blur15_loop

pop  ebx
pop  ecx
pop  edx
pop  edi
xor eax,eax
ret




⌨️ 快捷键说明

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