Live data from Hacker News

A bootable CD image with a retro game in a single tweet

quaxio.com

61–70 of 150 posts

Re: A bootable CD image with a retro game in a single tweet

#61
post #26
post #4

I was confused as to how you could represent a bootable CD image in printable characters. It turns out that you can't. This is a tweet of a perl script which creates a cd.iso file that you can then boot from. The perl script significantly decompresses the data in the tweet. That said, this is a playable game in around 60 bytes of actual data which is impressive.

It's pretty light compression from what I can tell - basically just squashing down runs of nulls to a single count.

It's not compressed. It's run length encoding which is an encoding, not compression.

Re: A bootable CD image with a retro game in a single tweet

#62
post #8

Your snake game doesn't even have food for the snake to eat? The snake just grows without eating, until the head collides with the tail somewhere? Pssh, amateur hour... /s (Just kidding this is actually super cool.)

It's Tron-ish (the post says Tron, where did you read snake?) :P

Woops... I skimmed the article and watched the 30MB GIF

Re: A bootable CD image with a retro game in a single tweet

#63
post #58

This reminds me a bit of the science of nanoinformatics as described in one of the Expanse novellas (The Vital Abyss): " A thought experiment from my first course in the program: Take a bar of metal and put a single notch in it. The two lengths thus defined have a relationship that can be expressed as the ratio between them. In theory, therefore, any rational number can be expressed with a single mark on a bar of met…

Check out Arithmetic Coding: https://en.m.wikipedia.org/wiki/Arithmetic_coding

Yep, not fiction at all, pretty much what is used for state-of-the-art compression.

Re: A bootable CD image with a retro game in a single tweet

#65
post #58

This reminds me a bit of the science of nanoinformatics as described in one of the Expanse novellas (The Vital Abyss): " A thought experiment from my first course in the program: Take a bar of metal and put a single notch in it. The two lengths thus defined have a relationship that can be expressed as the ratio between them. In theory, therefore, any rational number can be expressed with a single mark on a bar of met…

The same has been said about Pi (3.14). If you can compute, store and search enough the digits of Pi, you can reference anything by just providing the 'start' and 'finish' locations. Unfortunately, with enough digits of Pi, the 'start' and 'finish' numbers can get quite long themselves.

Re: A bootable CD image with a retro game in a single tweet

#67

Earlier quoted context omitted.

> what we have now x86 processors still boot into real mode…

It's my understanding that UEFI actually comes up directly into long mode? "UEFI firmware performs those same steps, but also prepares a protected mode environment with flat segmentation and for x86-64 CPUs, a long mode environment with identity-mapped paging. The A20 gate is enabled as well." - https://wiki.osdev.org/UEFI

Unfortunately most BIOS services are only available in real mode, so it's often necessary to switch back and forth.

Re: A bootable CD image with a retro game in a single tweet

#68
post #58

This reminds me a bit of the science of nanoinformatics as described in one of the Expanse novellas (The Vital Abyss): " A thought experiment from my first course in the program: Take a bar of metal and put a single notch in it. The two lengths thus defined have a relationship that can be expressed as the ratio between them. In theory, therefore, any rational number can be expressed with a single mark on a bar of met…

The same has been said about Pi (3.14). If you can compute, store and search enough the digits of Pi, you can reference anything by just providing the 'start' and 'finish' locations. Unfortunately, with enough digits of Pi, the 'start' and 'finish' numbers can get quite long themselves.

Years ago I tried this and basically ended up proving that if Pi is random and you are "compressing" random data, on average the start and finish numbers together are at least as long as the numbers you are trying to "compress."

Re: A bootable CD image with a retro game in a single tweet

#69
post #50

Looks like the turbo button needs to be in the on position for this one: 0.05 FPS in a qemu KVM on my old P8600... I presume the game loop uses the hardware clock :P btw my base64 util needed lower case -d

There’s a comment on the page. For some reason, emulators (at least the ones I tried) wait 4x what real machines wait when you use BIOS int 15b 86h. You can tweak the code if you want to play at a faster speed. There’s probably a sound explanation for this discrepancy...

I can't say I entirely understand how the Elapsed Time Wait works, but testing in qemu, I was able to get it to a good speed by replacing the

  inc cl
with a

  nop
  inc dx
By opening in a hex editor, finding

  bf86 fec1
and replacing with

  bf86 9042
If you're on a very slow system, maybe just use 2 nops or a 2-byte nop.

Re: A bootable CD image with a retro game in a single tweet

#70

Earlier quoted context omitted.

Check out Arithmetic Coding: https://en.m.wikipedia.org/wiki/Arithmetic_coding

Yep, not fiction at all, pretty much what is used for state-of-the-art compression.

The fiction part is being able to notch the bar sufficiently precise to store any significant amount of data.
Post reply on HN