Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Swirl by k06a
- ; Dedicated to my wife 9ka
- org 100h
- ; [106h] == 0
- main:
- mov si, 0A000h
- mov es, si
- mov di, RRR
- mov bp, 13 ; kruch
- ; ????????? ????? ?????? 320x200x256
- mov al, 13h
- int 10h
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; ?????????? ??? ????? ?????? ????????? ;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- paint:
- mov bh, 0FAh
- lp1:
- mov ax, bx
- xor dx, dx
- div word [_320+di-RRR]
- sub ax, 100
- sub dx, 160
- ; ?????? ? [sin] ??????? ???? ?? K2
- fninit
- mov word [si], ax ; COS
- fild word [si]
- mov word [si], dx ; SIN
- fild word [si]
- fpatan
- fimul word [vnum+di-RRR]
- fmul dword [glad+di-RRR]
- fistp word [si]
- imul ax, ax
- imul dx, dx
- add ax, dx
- xor dx, dx
- div bp
- add ax, [si]
- ; ?????? ???????
- dec bx
- mov byte [es:bx], al
- jnz lp1
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; ??????????? ????? ???????
- ; CL - ???????, ???????? ??????? ?? ?????
- ; CH - ?????!!! ???????? ????????
- loop_pal_out:
- add ch, cl ; [DELTA]
- ;;;;;;;;;;;;;;;;;;;;;;;;
- ; CL - Cycled Shifting ;
- ; AL := 0, AH := XXh ;
- ;;;;;;;;;;;;;;;;;;;;;;;;
- setPalette:
- xor al, al ; ??? ????????? ?????
- setPalette_loop:
- mov ah, al
- shr ah, 1
- ;call setColor
- ;;;;;;;;;;;;;;;;;;;;;;;;
- ; AL - ????? ? ??????? ;
- ; AH - Grayscale color ;
- ;;;;;;;;;;;;;;;;;;;;;;;;
- setColor:
- pusha
- add al, ch ; + ??????
- mov dx, 03c8h
- out dx, al
- inc dx
- mmm:
- mov al, ah
- and al, [di+bx]
- out dx, al
- inc bx
- jnp mmm
- popa
- xor al, 0xFF
- js setColor
- ;;;;;;;;;;;;;;;;;;;;;;;;
- inc al
- jns setPalette_loop
- ;;;;;;;;;;;;;;;;;;;;;;;;
- ; ???????? ?? ??????? ???????
- mov ah, 0Bh ; AX := 0B00h
- int 21h
- cmp al, 0ffh
- jmp_loop_pal_out:
- jne loop_pal_out
- ; ??????? ???????
- mov ah, 08h
- int 21h
- label_push_down:
- cmp al, 80
- jne label_push_up
- dec bp
- jnz paint_me
- inc_kruch_paint_me:
- inc bp
- paint_me:
- jmp paint
- label_push_up:
- cmp al, 72
- je inc_kruch_paint_me
- label_push_space:
- cmp al, ' '
- jne label_push_left
- mov cl, 0
- label_push_left:
- cmp al, 75
- jne label_push_right
- dec cx
- label_push_right:
- cmp al, 77
- jne label_push_R
- inc cx
- label_push_R:
- cmp al, 'r'
- je change_color
- inc bx
- cmp al, 'g'
- je change_color
- inc bx
- cmp al, 'b'
- jne label_push_digit
- change_color:
- not byte [di+bx]
- label_push_digit:
- xor bx, bx
- sub al, '0'
- cmp al, 9
- ja label_push_esc
- mov byte [vnum], al
- jmp paint_me
- label_push_esc:
- cmp al, 27-'0'
- jne jmp_loop_pal_out
- ret
- ;main endp
- RRR db 0
- GGG db 255
- BBB db 0
- glad dd 40.75 ; 163/4
- vnum dw 3
- _320 dw 320
- ;sign db 'Dedicated to my wife 9'
Add Comment
Please, Sign In to add comment