Assembler is a noticeable redraw of the screen how to fix?

0 like 0 dislike
8 views
#make_boot# org 7c00h use16 jmp start e: mov ax,cs mov ds,ax ret put_pix: push ax push dx mov ax, 0a000h mov es, ax mov ax,320 mul cx pop dx add ax,dx mov di,ax pop ax stosb ret fill_disp: mov bx,0000h push ax mov ax,0A000h mov ds,ax pop ax mov ah,al mov [bx],ax p0: add bx,02h mov [bx],ax cmp bx,0FFFEh jz e jmp p0 e_draw: pop dx pop bx mov [x],dx mov [y],bx ret draw_sprite_nexline: inc si mov al,00h cmp al,[bx+si] jz e_draw dec si add [y],01h mov ax,[x_ret] mov [x],ax inc si jmp draw_sprite_1 draw_sprite: mov ax,bx mov dx,[x] mov bx,[y] push bx push dx mov bx,ax mov ax,[x] mov [x_ret],ax mov si,0000h draw_sprite_1: mov ax, 0a000h mov es, ax mov ax,320 mov cx,[y] mul cx mov dx,[x] add ax,dx mov di,ax mov al,[bx+si] cmp al,255 jz draw_sprite_2 stosb draw_sprite_2: inc si mov al,00h cmp al,[bx+si] jz draw_sprite_nexline add [x],1 jmp draw_sprite_1 start mov ah, 0 mov al, 13h int 10h p4: mov ah,00h int 1Ah mov bx,dx p0_cycl: mov ah,00h int 1Ah sub dx,bx cmp dx,1 jz p1_cycl jnz p0_cycl p1_cycl: mov al,89 call fill_disp add [x],1 mov bx,sprite mov di,0000h mov si,di call draw_sprite jmp p4 x_ret dw 0 x dw 0 y dw 100 sprite db 15,15,15,15,15,15,15,15,15,0,15,15,15,15,15,15,15,15,15,0,15,15,255,15,15,15,40,15,15,0,15,15,15,15,15,15,15,15,15,0,15,15,15,15,15,15,15,15,15,0,15,15,40,40,40,40,40,15,15,0,15,15,15,15,15,15,15,15,15,0,0


Dopusteno a little less than 64 000 KB of memory, so create a second buffer can not, and when you clean and re-rendering the sprite is something like a flicker, noticeable that the screen is cleared and drawn again everything. Don't know how to fix it...

PS: Just learning assembler...
by | 8 views

1 Answer

0 like 0 dislike
> create a second buffer can't
> the screen is cleared and drawn again
all right. without buffering as it should be.
the solution in the General case is to use buffering. in your case there is no solution, although I did not understand what the problem is to create a buffer having 64 MB of RAM.
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Jun 11, 2019 by MegaCraZy6
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
33,850 users