flat assembler
Message board for the users of flat assembler.

Index > MenuetOS > MenuetOS redrawing window blinks

Author
Thread Post new topic Reply to topic
Learner



Joined: 15 Mar 2024
Posts: 2
Learner 15 Mar 2024, 09:17
Hello everyone, newbie is here.

Recently I tried MenuetOS which is really cool and I'm impressed with it's performance. I wanted to make a simple animation by using FASM, and I already did. It's just a square moving time-by-time. But the problem is the window is blinking which is really frustrating. Below I'm leaving the source codes. I think the problem is I used wrong syscalls, maybe I gave wrong parameters to syscall 0(define and draw window) but I still couldn't find the problem.


Description:
Download
Filename: square_anim.zip
Filesize: 1.41 KB
Downloaded: 45 Time(s)

Post 15 Mar 2024, 09:17
View user's profile Send private message Reply with quote
Ville



Joined: 17 Jun 2003
Posts: 294
Ville 15 Mar 2024, 10:26
You can draw to the window from any part of the code, you dont need to call the draw_window function every time when making updates.

Code:
event_loop:

     call updateimage

     sys_delay_ms    50

     mov     rax,    SYS_check_for_event
     int     0x60

     test    rax,    1       ; rax & 1
     jnz     window_event
     test    rax,    4       ; 3-bit
     jnz     button_event

     jmp     event_loop


updateimage:

     ; clear old image
     sys_draw_rectangle [rect_x],[rect_y],20,20,0xffffff 
 
     ; calculate new position

     ; draw new image
     sys_draw_rectangle [rect_x],[rect_y],20,20,0xff0000

     ret
    
Post 15 Mar 2024, 10:26
View user's profile Send private message Reply with quote
Learner



Joined: 15 Mar 2024
Posts: 2
Learner 15 Mar 2024, 11:11
Ville wrote:
you dont need to call the draw_window function every time when making updates.


Thank you very much, now it's playing smoothly! I thought every time when I try to update window, I should call "12 - Window draw state" syscall.
Post 15 Mar 2024, 11:11
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.