|
|
| Посл.отвђт | Сообщенiе |
|
|
Дата: Июн 9, 2003 16:50:00 Здравствуйте все. У меня возникли проблемы с моей первой демкой(прога выводит звезды но они не двигаются и еще программа !виснет!). Пожалуйста помогите устранить баги. ;cut here: ======================== ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Project: Star version 0.1 ; ; Author: HexMan ; ; Mail to: HexMan@rambler.ru ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Sorry for my bad English ; tasm star.asm ; tlink star.obj /t /x model tiny .code .386 org 100h Start: ; Set Video mode 320*200*256 mov al,13h int 10h ; Palette mov si,offset Palette mov dx,03C8h xor al,al out dx,al inc dx mov cx,12h rep outsb ; Randomize call randomize ; Generate random Star(x,y) and their color mov cx,0ffh NextStar: pusha mov ax,64000 call random mov di,ax mov ax,6 call random mov offset [Buffer+di],al popa loop NextStar ; Main Loop push 0A000h pop es MainLoop: ; Wait retrace mov dx,03DAh WR1: in al,dx and al,08h jnz WR1 WR2: in al,dx and al,08h jz WR2 ; Output Buffer on Screen mov cx,64000 mov si,offset Buffer xor di,di rep movsb ;;;;;;;;;; ; This not optimizing code(it contains errors please correct their) ; it must displace star in right mov cx,0ffffh qwer: mov al,byte ptr [Buffer+di] cmp al,0 je qwer1 mov byte ptr [Buffer+di],0 push ax mov ax,di mov bx,2 ;How place in bx 0.1??? Without use FPU??? mul bx mov di,ax pop ax mov offset [Buffer+di],al ;And what delete the star if she was beyond the scope of screen? qwer1: loop qwer ;;;;;;;;;; ; Wait until the user have pressed ESC in al,60h dec al jnz MainLoop; ; Set textmode mov ax, 03 int 10h ; Exit ret ; Proc randomize Randomize Proc ; Get time and push their in Seed mov ah,2Ch int 21h mov Word ptr cs:[RandSeed],cx mov Word ptr cs:[RandSeed+2],dx ret Randomize endP ; Random function return number [0,ax-1] Random proc mov cx,ax mov ax,Word ptr cs:[RandSeed+2] mov bx,Word ptr cs:[RandSeed] mov si,ax mov di,bx mov dl,ah mov ah,al mov al,bh mov bh,bl xor bl,bl rcr dl,1 rcr ax,1 rcr bx,1 add bx,di adc ax,si add bx,62e9h adc ax,3619h mov word ptr cs:[RandSeed],bx mov word ptr cs:[RandSeed+2],ax xor dx,dx div cx mov ax,dx ret Random EndP ; Program Data RandSeed dd 0 Palette db 3 dup(0) db 3 dup (12) db 3 dup (24) db 3 dup (36) db 3 dup (48) db 3 dup (63) Buffer db 64000 dup (?) end Start ========================== ;EOF С уважением, HexMan. |
|
Powered by miniBB 1.6 © 2001-2002
Время загрузки страницы (сек.): 0.069 |