flat assembler
Message board for the users of flat assembler.

Index > DOS > Blinking point

Author
Thread Post new topic Reply to topic
WiESi



Joined: 15 May 2006
Posts: 14
Location: Austria
WiESi 21 May 2006, 17:24
Hello!

I'm currently trying to write a little game in fasm. The game is running in mode 13h but the point I'm painting to the screen is blinking and I don't want that. How do I prevent the point (or all the stuff on the screen) from blinking?

Here's the code so far:
Code:
org 100h

start:
  mov al, 13h
  int 10h

jmp main

x dw 160
y dw 190

main:
  mov ax, 0a000h
  mov es, ax

  mov cx, 16000
  xor di, di
  xor ax, ax
  cld
  rep stosd

  mov ax, 320
  mul [y]
  add ax, [x]

  mov [es:eax], byte 15

  key_loop:
    pause
    in al, 60h
    cmp al, 0
    je key_loop
  cmp al, 1
  je quit
  cmp al, 4bh
  je key_left
  cmp al, 4dh
  je key_right
  cmp al, 48h
  je key_up
  cmp al, 50h
  je key_down
  jmp main

quit:
  mov ax, 4C00h
  int 21h

key_left:
  cmp [x], 0
  jle key_left2
  dec [x]
  jmp main
  key_left2:
    mov [x], 319
    jmp main

key_right:
  cmp [x], 319
  jae key_right2
  inc [x]
  jmp main
  key_right2:
    mov [x], 0
    jmp main

key_up:
  cmp [y], 0
  jle key_up2
  dec [y]
  jmp main
  key_up2:
    mov [y], 199
    jmp main

key_down:
  cmp [y], 199
  jae key_down2
  inc [y]
  jmp main
  key_down2:
    mov [y], 0
    jmp main    


Regards,
WiESi

_________________
JavaAmp
Post 21 May 2006, 17:24
View user's profile Send private message Visit poster's website Reply with quote
donkey7



Joined: 31 Jan 2005
Posts: 127
Location: Poland, Malopolska
donkey7 21 May 2006, 17:52
1. use backbuffer
2. write this:
Code:
wait_vr:
        mov     edx, 03dah
wvr_1:
        in      al, dx
        test    al, 8
        jz      wvr_1
wvr_2:
        in      al, dx
        test    al, 8
        jnz     wvr_2
        ret
    

before copying backbuffer to vga buffer.

or

1. move this piece of code:
Code:
  mov ax, 0a000h 
  mov es, ax 

  mov cx, 16000 
  xor di, di 
  xor ax, ax 
  cld 
  rep stosd
    

before main
2. replace this:
Code:
  mov [es:eax], byte 15 

  key_loop: 
    pause 
    in al, 60h 
    cmp al, 0 
    je key_loop
    

with:
Code:
  mov [es:eax], byte 15 
  push eax
  key_loop: 
    pause 
    in al, 60h 
    cmp al, 0 
    je key_loop
  pop eax
  mov [es:eax], byte 0 
    
Post 21 May 2006, 17:52
View user's profile Send private message Visit poster's website 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 cannot attach files in this forum
You can download files in this forum


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

Website powered by rwasa.