Tiny Intro Toolbox Thread
category: code [glöplog]
you've got mail :)
you've got another mail. again - thank you. :)
is there a (dos-)sizecoding irc channel?
Nope - not yet I think. Just feel free to create one!
128.
128.
quasimodo: iirc #asm (efnet or ircnet, dont remember) used to have tiny intro competitions. dunno if they still are held though.
o.O
Just created a bootable DOS USB stick - now I can see the les bp,[bx] failing... ;)
Quote:
Nice move!Just created a bootable DOS USB stick
NASMIDE seems to be good enough for some minor code fixing while using the stick.
thanks for NASMIDE link las -- that's awesome sauce
I've found qemu to be very usable for running tiny dos intros. Depending on the intro with or without kvm (virtualization) enabled worked better. Unlike virtualbox its mode 13h emulation isn't limited to 0.000001fps and unlike dosbox it supports many (all?) instructions and is fast. If you have a cdrom driver loaded (the dos622.img that is floating around on the internet has one) you can just mount (and hot swap) an iso image with your files and with mkisofs you can create an .iso image from a directory.
With that I built a small shellscript that uses yasm (nasm clone but has some additional features I needed for something unrelated) to assemble, then mkisofs to rebuild the .iso and then tells qemu to reload the .iso and then displays the listing file yasm outputs. This gives a quite comfortable workflow.
It could probably be improved by using snapshots to avoid the occasional reboot of dos (I have no idea if qemu supports them) and automating keyboard input to the vm, but this is beyond my personal effort vs. saved-effort-in-return break even point.
With that I built a small shellscript that uses yasm (nasm clone but has some additional features I needed for something unrelated) to assemble, then mkisofs to rebuild the .iso and then tells qemu to reload the .iso and then displays the listing file yasm outputs. This gives a quite comfortable workflow.
It could probably be improved by using snapshots to avoid the occasional reboot of dos (I have no idea if qemu supports them) and automating keyboard input to the vm, but this is beyond my personal effort vs. saved-effort-in-return break even point.
Seruiosly, having read all of this, it's almost ridiculous to consider all of this sizecoding. If the standard procedure is to start a VM to run an intro, then the VM size should count as well. And then there are the other people complaining about d3dx dll dependecies on windows 4ks...
If all of that (d3dx, dosbox, qem) is allowed and doesn't count into the file size, then why can't we code a super mighty VM? Then I'll make you a 32b that'll make you shit bricks...
...just a thought :)
If all of that (d3dx, dosbox, qem) is allowed and doesn't count into the file size, then why can't we code a super mighty VM? Then I'll make you a 32b that'll make you shit bricks...
...just a thought :)
xTr2m: By your "logic" we should count the size of the OS and emulators as well since some people don't have the original HW/SW.
DOS is just an OS. Few people run it out of box, hence DOSbox and co. Same goes most oldschool platforms. Really few of us have a C64, VCS, A500, ST, Vectrex, Oric, ZX, .... laying around.
In other news, looks like you missed IBNIZ.
DOS is just an OS. Few people run it out of box, hence DOSbox and co. Same goes most oldschool platforms. Really few of us have a C64, VCS, A500, ST, Vectrex, Oric, ZX, .... laying around.
In other news, looks like you missed IBNIZ.
xTr1m: your argument is invalid.
Quote:
And then there are the other people complaining about d3dx dll dependecies on windows 4ks...
I've always found it easiest to just ignore people without a clue.
oh noes! the filename eats bytes too! :D
Nice rotation code from baze/3SC.
Any way to do it smaller with fpu only? :)
Code:
fsincos
fld st2
fmul st0, st1
fld st4
fmul st0, st3
fsubp st1, st0
fxch st3
fmulp st2, st0
fmulp st3, st0
faddp st2, st0
Input st0=A st1=X st2=Y st3=Z
Output st0=(cos(A)*X - sin(A)*Y) st1=(cos(A)*Y + sin(A)*X) st2=Z
Any way to do it smaller with fpu only? :)
this kind of function is typically what should be in first page of this topic. just like Raymarching toolbox thread.
Yep - I should have called this thread Tiny Intro Beginners Thread :)
what i mean is that we need more reusable functions / tips like this (that's what make this thread interesting, among other things like IDE ). someone should make a selection and put them in first page
Quote:
what i mean is that we need more reusable functions / tips like this (that's what make this thread interesting, among other things like IDE ). someone should make a selection and put them in first page
it would be great, but codegems enough. maybe...
Some simple ones
Absolute values of vector components - a bit swizzled
Input (B X Y Z)
Output (sqrt(X*X+Y*Y+Z*Z) B)
Maximum func
Improvements welcome.
Absolute values of vector components - a bit swizzled
Code:
fabs ; |X| Y Z
fxch st2 ; Z Y |X|
fabs ; |Z| Y |X|
fxch st1 ; Y |Z| |X|
fabs ; |Y| |Z| |X|
Input (B X Y Z)
Output (sqrt(X*X+Y*Y+Z*Z) B)
Code:
; B X Y Z
fxch st3 ; Z X Y B
fmul st0, st0 ; ZZ X Y B
fld st2 ; Y ZZ X Y B
fmulp st3, st0 ; ZZ X YY B
faddp st2, st0 ; X ZZ+YY B
fmul st0, st0 ; XX ZZ+YY B
faddp st1, st0 ; XX+YY+ZZ B
fsqrt ; L B
Maximum func
Code:
_max:
fcomi st0, st1
fcmovb st0, st1
fstp st1
ret
Improvements welcome.
Quote:
xTr1m: your argument is invalid.
las: and where's yours?
I didn't mean to start a long discussion... I acknowledge that DOS is a full valid platform and is as seldomly used as older platforms like c64 and amiga. I know, it was a silly statement. It's just kind of a pitty to require all that extra software around the intro in order to run it. And if everyone follows that pattern instead of using the real thing (a bare 486 with MS-DOS 6.22 for example) it becomes some sort of a fake. That's all I wanted to say.
Was wondering: would it be so hard to make a .COM "player" for modern OSes? Not a generic one: something able to set the stack up and intercept accesses to 0a000h, then load the code somewhere and execute it...