?? russia box.asm
字號:
mov eax,0
ret
lp1:
.elseif random2 == 3
.if rdtop == 1
mov bl,byte ptr[esi+2]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+3]
cmp byte ptr[edi+ebx],0
jnz @f
invoke _setbuff,0,10
invoke _setbuff,1,0
jmp lp2
@@:
mov eax,0
ret
lp2:
.elseif rdtop == 2
mov bl,byte ptr[esi]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+1]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+2]
cmp byte ptr[edi+ebx],0
jnz @f
invoke _setbuff,0,10
invoke _setbuff,1,0
jmp lp3
@@:
mov eax,0
ret
lp3:
.elseif rdtop == 3
mov bl,byte ptr[esi]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+3]
cmp byte ptr[edi+ebx],0
jnz @f
invoke _setbuff,0,10
invoke _setbuff,1,0
jmp lp4
@@:
mov eax,0
ret
lp4:
.else
mov bl,byte ptr[esi]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+1]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+3]
cmp byte ptr[edi+ebx],0
jnz @f
invoke _setbuff,0,10
invoke _setbuff,1,0
jmp lp_4
@@:
mov eax,0
ret
lp_4:
.endif
.elseif random2 == 4
.if rdtop == 1
mov bl,byte ptr[esi+2]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+3]
cmp byte ptr[edi+ebx],0
jnz @f
invoke _setbuff,0,10
invoke _setbuff,1,0
jmp lp5
@@:
mov eax,0
ret
lp5:
.elseif rdtop == 2
mov bl,byte ptr[esi]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+1]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+3]
cmp byte ptr[edi+ebx],0
jnz @f
invoke _setbuff,0,10
invoke _setbuff,1,0
jmp lp6
@@:
mov eax,0
ret
lp6:
.elseif rdtop == 3
mov bl,byte ptr[esi]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+3]
cmp byte ptr[edi+ebx],0
jnz @f
invoke _setbuff,0,10
invoke _setbuff,1,0
jmp lp7
@@:
mov eax,0
ret
lp7:
.else
mov bl,byte ptr[esi]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+1]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+2]
cmp byte ptr[edi+ebx],0
jnz @f
invoke _setbuff,0,10
invoke _setbuff,1,0
jmp lp8
@@:
mov eax,0
ret
lp8:
.endif
.elseif random2 == 5
.if rdtop == 1
mov bl,byte ptr[esi+1]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+2]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+3]
cmp byte ptr[edi+ebx],0
jnz @f
invoke _setbuff,0,10
invoke _setbuff,1,0
jmp lp9
@@:
mov eax,0
ret
lp9:
.elseif rdtop == 2
mov bl,byte ptr[esi]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+1]
cmp byte ptr[edi+ebx],0
jnz @f
invoke _setbuff,0,10
invoke _setbuff,1,0
jmp lp10
@@:
mov eax,0
ret
lp10:
.elseif rdtop == 3
mov bl,byte ptr[esi]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+1]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+3]
cmp byte ptr[edi+ebx],0
jnz @f
invoke _setbuff,0,10
invoke _setbuff,1,0
jmp lp11
@@:
mov eax,0
ret
lp11:
.else
mov bl,byte ptr[esi]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+3]
cmp byte ptr[edi+ebx],0
jnz @f
invoke _setbuff,0,10
invoke _setbuff,1,0
jmp lp12
@@:
mov eax,0
ret
lp12:
.endif
.elseif random2 == 6
.if rdtop == 1
mov bl,byte ptr[esi]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+2]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+3]
cmp byte ptr[edi+ebx],0
jnz @f
invoke _setbuff,0,10
invoke _setbuff,1,0
jmp lp13
@@:
mov eax,0
ret
lp13:
.elseif rdtop == 2
mov bl,byte ptr[esi]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+2]
cmp byte ptr[edi+ebx],0
jnz @f
invoke _setbuff,0,10
invoke _setbuff,1,0
jmp lp14
@@:
mov eax,0
ret
lp14:
.endif
.else
.if rdtop == 1
mov bl,byte ptr[esi+1]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+2]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+3]
cmp byte ptr[edi+ebx],0
jnz @f
invoke _setbuff,0,10
invoke _setbuff,1,0
jmp lp17
@@:
mov eax,0
ret
lp17:
.elseif rdtop == 2
mov bl,byte ptr[esi]
cmp byte ptr[edi+ebx],0
jnz @f
mov bl,byte ptr[esi+2]
cmp byte ptr[edi+ebx],0
jnz @f
invoke _setbuff,0,10
invoke _setbuff,1,0
jmp lp18
@@:
mov eax,0
ret
lp18:
.endif
.endif
mov eax,1
ret
_down endp
_printach proc hdc
LOCAL @stRect:RECT
pushad
lea esi,achbuff
add esi,4
mov eax,achievement
xor dx,dx
mov bx,10
@@:
div bx
add dl,30h
mov byte ptr[esi],dl
dec esi
xor dx,dx
or ax,ax
jnz @b
inc esi
mov @stRect.left,71
mov @stRect.top,44
mov @stRect.right,104
mov @stRect.bottom,54
invoke DrawText,hdc,esi,-1,addr @stRect,DT_SINGLELINE or DT_RIGHT or DT_VCENTER;輸出成績
popad
ret
_printach endp
_game proc
LOCAL hdc
pushad
invoke GetDC,hWinMain
mov hdc,eax
lea esi,rdcoord
add byte ptr[esi],10
add byte ptr[esi+1],10
add byte ptr[esi+2],10
add byte ptr[esi+3],10
mov ebx,10
invoke _down
.if eax == 0
mov ecx,20
lea edi,rdbuff
jiance: ;此循環用來判斷有無填滿的行,有幾行清幾行并加分
push edi
push ecx
mov ecx,10
dec edi
@@:
inc edi
cmp byte ptr[edi],1
jne ex ;當其中有一個沒有格子時不清行,跳出清行語句
loop @b
inc achievement;記錄成績
mov ecx,edi
inc ecx
lea ebx,rdbuff
sub ecx,ebx
sub ecx,10
@@:
mov al,byte ptr[edi-10] ;通過低位向高位移10格來清行
mov byte ptr[edi],al
dec edi
loop @b
ex:
pop ecx
pop edi
add edi,10
loop jiance
invoke _printach,hdc ;輸出新成績
lea esi,rdbuff
cmp word ptr[esi+24],0;放不下方塊時清除所有方塊
jz noclear
mov ecx,200
@@:
mov byte ptr[esi],0
inc esi
loop @b
noclear:
@@:
push random1
pop random2
invoke _ran
mov random1,eax
invoke _next,random1,hdc
invoke _init
.endif
invoke _scanplot,hdc
invoke ReleaseDC,hWinMain,hdc
popad
ret
_game endp
_testzero proc uses ebx esi edi firstaddr,degree,jump
mov esi,firstaddr
lea edi,rdbuff
add esi,edi
mov ecx,degree
@@:
cmp byte ptr[esi],0
jnz @f
add esi,jump
loop @b
mov eax,0
ret
@@:
mov eax,1
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -