weed by g0blinish
[nfo]
|
||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||
|
popularity : 49% |
|||||||||
alltime top: #30369 |
|
|||||||||
|
||||||||||
added on the 2020-11-27 04:58:35 by g0blinish |
popularity helper
comments
I was browsing pouet, but then I got high
rulez added on the 2020-11-27 09:09:05 by gorgh
a weed leaf coded for MS-DOS
weed
Nice. Too bad you couldn't get below 128 bytes :(
what Tigrou said. Or pimping it to get 256 full. Herbert would approve.
Nice :)
Neat, but wrong category, should be 128b ;)
here's how to remove the needed 30 bytes
here's how to remove the needed 30 bytes
Code:
org 100h
use16
mov al,12h
int 10h
mov ch,32000/256-1
wlp:
push cx
; AA.f=A*#PI/16000
mov word [bp+si],cx
fldpi
fidiv word [byte bx+si-256+c1]
fimul word[bp+si]
fst dword [bp+si] ;AA
; D:= (1+Sin(A)) * (1+0.9*Cos(8*A)) * (1+0.1*Cos(24*A)) * (0.9+0.05*Cos(200*A));
FSIN
FLD1
FADDP ;ST(1) = ST(0) + ST(1),
;(1+0.9*Cos(8*A))
fld dword [bp+si]
fimul word [byte bx+si-256+c2]
fcos
fmul dword [byte bx+si-256+c3-2]
fld1
faddp
FMULP ;ST(1) = ST(0) * ST(1)
;(1+0.1*Cos(24*A))
fld dword [bp+si]
fimul word [byte bx+si-256+c6]
fcos
fmul dword [byte bx+si-256+c7-2]
fld1
faddp
FMULP
;(0.9+0.05*Cos(200*A))
fld dword [bp+si]
fimul word [byte bx+si-256+c4]
fcos
fmul dword [byte bx+si-256+c5-2]
fld dword [byte bx+si-256+c3-2]
faddp
fmulp
fimul word [byte bx+si-256+c8]
fstp dword [bp+si+4];D*S
; X:= Fix(D*Cos(A)*S); \convert polar to rectangular coordinates
; Y:= Fix(D*Sin(A)*S);
fld dword [bp+si]
fsincos
fmul dword [bp+si+4]
fistp word[bp+si] ;X
mov cx,320
add cx,[bp+si]
fmul dword [bp+si+4]
fistp word[bp+si] ;Y
mov dx,400
sub dx,word [bp+si]
; Point(X+320, 400-Y, 2\green\);
; Expects: AH 0cH
; AL color number (+80H means XOR with current value)
; BH video page (0-based)
; CX graphics column
; DX graphics row
; mov ax,0c12h
mov ah,0x0c
; xor bh,bh
int 10h
pop cx
; in al,60h
; dec al
; je exp
loop wlp
ret
c1: dw 16000
c2: dw 8
; c3: dd 0.9
c3: dw 0x3f66
c4: dw 200
; c5: dd 0.05
c5: dw 0x3d4c
c6: dw 24
; c7: dd 0.1
c7: dw 0x3dcc
c8: dw 100
Quote:
Good job.Neat, but wrong category, should be 128b ;)
here's how to remove the needed 30 bytes
But I'd save "mov ax,0c12h" (even "mov ax,0c02h") instead of "mov ax,0ch" else it will draw glitched on real systems because ah=0/int 10h returns al=20h (for graphic modes). DOSBox ignores this and saves input AL therefore it draws normal. There's no problem to use "mov ax" because your code is 127b ;)
P.S. I think calculation can be optimized too :)
Quote:
But I'd save "mov ax,0c12h" (even "mov ax,0c02h") instead of "mov ax,0ch" else it will draw glitched on real systems because ah=0/int 10h returns al=20h (for graphic modes). DOSBox ignores this and saves input AL therefore it draws normal. There's no problem to use "mov ax" because your code is 127b ;)
Totally right, i realized afterwards myself
Quote:
P.S. I think calculation can be optimized too :)
Heavily! But i stopped on 2^7 ;) 2^6 might be possible ;)
Quote:
Yeah, it's possible :)2^6 might be possible ;)
https://www.pouet.net/prod.php?which=87545
submit changes
if this prod is a fake, some info is false or the download link is broken,
do not post about it in the comments, it will get lost.
instead, click here !