2017-06-04 32 views
0

我在清除屏幕時遇到問題。在組裝中更快地清除屏幕

我正在使用致電Clrscr但它很慢。它不夠快,所以我有屏幕,黑色,沒有數字,因爲等待功能Clrscr完成。

call Clrscr 

    ; Write a string to the console: 
    INVOKE WriteConsole, 
     consoleHandle,    ;console output handle 
     ADDR HANGMAN_GOODGAME_00,    ; string pointer 
     messageSizeGoodGame,    ; string length 
     ADDR bytesWritten,   ; returns num bytes written 
     0       ; not used 

    mov eax, drowDelay 
    call Delay 
    call Clrscr 

    ; Write a string to the console: 
    INVOKE WriteConsole, 
     consoleHandle,    ;console output handle 
     ADDR HANGMAN_GOODGAME_01,    ; string pointer 
     messageSizeGoodGame,    ; string length 
     ADDR bytesWritten,   ; returns num bytes written 
     0       ; not used 

    mov eax, drowDelay 
    call Delay 
    call Clrscr 

    ........ 

這是照片。它的外觀沒有沉悶。我試圖讓動畫.. :)

enter image description here

+1

難道你不能只輸出足夠多的'換行符'向上滾動視圖?編輯 - 對不起,我誤解了,你想讓被絞死的人揮手。多麼可怕。文本控制檯並不是真正適合動畫的地方。 –

+0

我知道它很可怕,但我看到,在一個youtube .. XD和我想補充說,我的項目.. :)這是組裝,它的doble可怕.. – SakaSerbia

+1

是的,以及如果模仿你在YouTube上看到的東西是按照你的中國諺語,好運7給你。 –

回答

2

只需將光標位置。
只需使用setcursorpos從WINAPI:

push 0 
push 0 
call [SetCursorPos] 

它在user32.dll中

編輯:它wokrs的方法很簡單,你設置光標位置左上角使得運動感