
3D animation with sound in 64 bytes of assembler - pera
https://old.reddit.com/r/tinycode/comments/d4kdco/3d_animation_with_sound_in_64_bytes_of_assembler/
======
rwmj
Since this only uses PC hardware and BIOS calls and so doesn't depend on DOS,
I turned it into a boot sector which runs in qemu:

    
    
        wget http://oirase.annexia.org/war
        qemu-system-i386 -hda war
    

Modified source is here:
[http://oirase.annexia.org/war.S](http://oirase.annexia.org/war.S)

~~~
fuzzfactor
Excellent.

The submitted file in2war64.com shows only the blue "background" when run from
bare-metal booted DOS floppy on a Pentium D (x64 based on dual x86) with its
associated Intel graphics hardware. No sound either.

Your file "war" is a nice binary, works natively as sector 0 of a floppy disk,
with a traditional FDD plugged directly into the legacy FDD parallel
connector.

On the same hardware.

Also works with USB floppy drive, even on a UEFI PC as long as the Legacy/CSM
is enabled and Secure Boot is disabled.

To use a common USB Flash Drive (UFD) natively instead of a floppy, legacy
BIOS can require a partition table to be also present on sector 0 of the
removable UFD. This can be effectively added by partitioning (format not
needed) after copying "war" to sector 0 of the UFD:

from Linux command line:

First copy "war" to sector 0 of the UFD, where X is the identifier of your
unmounted UFD:

(sudo) dd if=/<path to>/war of=/dev/sdX bs=512 count=1

This overwrites any MBR and partitontable that may already be on sector 0 of
the target X UFD; with the functional "war" replacing the MBR, and zeroes
replacing the partition table.

Only sector 0 is replaced, all other sectors remain unchanged.

At this point sector 0 of the UFD is no different from sector 0 of the working
floppy disk.

Then create a partition on the target X UFD using cfdisk:

(sudo) cfdisk /dev/sdX

make it primary, full size, bootable, type 0C

Only the final portion of sector 0 is altered (leaving the "war" binary intact
at the beginning of sector 0), all other sectors remain unchanged.

Then the UFD boots natively just like the floppy.

Still for UEFI need Legacy/CSM to be enabled and Secure Boot disabled.

Still no sound.

------
Keyframe
I was there at Function when it was shown on the big screen, we brought
something for c64. At first I expected something else to show up, but then I
remembered it was 64 bytes. Sixty four bytes! 256byte scene is insane. I've
noticed recent 256b releases are high res. Not sure how they do it, definitely
not 13h. Anyways, this 256b still takes the cake:
[https://youtu.be/eYNoaVERfR4](https://youtu.be/eYNoaVERfR4)

~~~
peterkelly
My cynicism about the widespread disregard for software bloat in the industry
is tempered whenever I see stuff like this. Ask a javascript developer to do
this and they'll end up with 1500 npm dependecies with an oddball collection
of incompatible React plugins, 3d visualisation frameworks, and a codebase
that'll be incompatible with the latest and greatest versions of all of these
six months from now.

Yeah I know assembly language isn't a sensible choice for all but a tiny
specialized niche of projects, hardware/bandwidth is far cheaper than
developer time and so on but it's still refreshing to see people doing this
kind of thing just out of pure passion.

~~~
K0SM0S
A little OT but this is why I fell in love with Go (Golang) I think. There's
something about the elegance of concise programs written in simple languages.

The 1500 npm dependencies problem you speak of is exactly what I expect to
never even see, let alone have to deal with, in the Go ecosystem. It's not
exactly surprising coming from one inventor of UNIX and C (Ken Thompson) and
Rob Pike, two greats from Bell Labs, but when I heard that the creator of
NodeJs had ditched that to go work in Go, now that I registered loud and
clear.

After seeing for myself, I can understand. Go is a wonder, truly, and such a
treat for systems (from sysadmin to CI/CD passing by performance, readability
and safety). Something like Js can only eventually collapse on itself, when
there's a better alternative. I mean, we could just as easily bundle a Python
interpreter in browsers (to name just one candidate), Js is the frontend bible
written in stone only because we keep it this way. Progressive apps are
already showing a way between browsers and OS and I expect this line to get
ever more blurry as virtualization (containers etc) continues its re-imaging
of the entire computed infrastructure.

~~~
enneff
It's no coincidence that the three creators of Go have been around long enough
to remember the simpler days.

~~~
K0SM0S
Oh indeed. And how enriching it is to the programming and systems ecosystem at
large.

I'm so thankful that computing evolved so fast that we can be here now, from
there/then, and yet still have relatively young giants walking among us. The
program-star hall of fame of very alive and active pioneers / creators is
honestly humbling and inspiring.

------
ben165
This demo on YouTube:
[https://www.youtube.com/watch?v=CAAuIgjrZWY](https://www.youtube.com/watch?v=CAAuIgjrZWY)

~~~
AndrewOMartin
The 1080p MP4 at that link is 32.5MiB.

------
parkertomatoes
In-browser emulation:
[https://parkertomatoes.github.io/v86/?type=com&content=FBO6M...](https://parkertomatoes.github.io/v86/?type=com&content=FBO6MAPzbs0QuE8M5kDi9x9oAKUHuM3M9%2BeJ6IDu9vb2kix%2F9uoCFmwEkjDG9u7UCZydLHSqr%2BvcyTiZRmdRfw%3D%3D)

~~~
saagarjha
I got this:

> The string contains invalid characters.

~~~
parkertomatoes
Thanks for reporting! What's your browser? I've only tested with a recent
Firefox and Chrome on Windows. I know iOS doesn't work but I don't have a
means to debug it.

~~~
mappu
Otter Browser provides an up-to-date Webkit (i.e. not Blink/Chromium) engine
on Windows, that replicated a lot of Safari-only bugs for me in the past.

~~~
parkertomatoes
Thanks for the recommendation!

------
raverbashing
One sad part of the obsolescence of "classical" BIOS is the loss of access to
basic functionality like simple graphics modes.

Of course it's one downside among many upsides but I think there's a point to
having a simpler interface to allow stuff like this

With 64 bytes you can't even initialize a window on Linux or Windows.

~~~
squarefoot
This is where small embedded devices come handy. Any small cheap board with
video output can be turned into a powerful demo (and games) playing machine,
at 1/50 or less the cost of hardware in the demoscene era.

------
d-d
As a programmer the demoscene has always fascinated me, but I don't know if I
can handle that rabbit hole.

------
lscotte
A go binary to do the same thing would be at least 50MB. ;-)

~~~
Intermernet
You can write plan 9 assembly straight into go. I'm not sure if it would work,
and it sort of defeats the purposes of go, but it wouldn't be 50mb.

------
rudolfwinestock
Here's another 64-byte demo by the same hacker.

[https://www.pouet.net/prod.php?which=78044](https://www.pouet.net/prod.php?which=78044)

I saw it discussed on Lobsters.

[https://lobste.rs/s/lpnlyd/tiny_64_bytes_ms_dos_ray_tracer](https://lobste.rs/s/lpnlyd/tiny_64_bytes_ms_dos_ray_tracer)

------
abductee_hg
demoscene ftw!

