Answer the question
In order to leave comments, you need to log in
Doesn't output a couple of pixels through double buffering, what's the matter (it works in the debugger and in the virtual machine)?
I am writing a program in the form of a loader that works in real time. I’m trying to figure out the graphics, namely 320x200 pixels, when working with sprites, blinking occurs, I found what I needed, the second buffer did everything as it should, and I already double-checked it 100 times in the emulator, virtual machine, it works, and when I run it on my hardware all the time that - something is wrong, then only a flooded screen with some color, then if without filling, there are a lot of oddities.
org 7c00h
use16
jmp start
e:
mov ax,cs
mov ds,ax
mov es,ax
ret
put_clear:
mov ax,8000h
mov ds,ax
mov al,200
mov ah,al
mov bx,0000h
put_clear0:
mov [bx],ax
add bx,02h
cmp bx,0FFFEh
jz e
jmp put_clear0
put_sprite:
mov ax,8000h
mov es,ax
mov di,0
mov bx,sprite
put_sprite0:
mov al,[bx]
cmp al,00h
jz e
stosb
inc bx
jmp put_sprite0
draw:
mov ax,8000h
mov ds,ax
mov ax,0A000h
mov es,ax
mov bx,0000h
mov di,0000h
draw0:
mov al,[bx]
stosb
cmp bx,0FFFFh
jz e
inc bx
jmp draw0
start:
call e
mov ax,0013h
int 10h
call put_clear ;; Заливка каким-то цветом, в буффер
call put_sprite ;; ложу "спрайт" в буффер
call draw ;; отображаю буффер на экран
mov ah,0
int 16h
db 250
db 250
db 250
db 200
db 200
db 200 ;; Это я так проверял баг, сделал растояние между кодом и спрайтом :D
sprite db 50,150,50,0
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question