by thrwaway4137 · 7y ago · 0 comments
pacmanpacmanpacmanpacmanpacmanpacmanpacmanpacmanpacmanpacman
pacmanpacmanpacmanpacmanpacmanpacmanpacmanpacmanpacmanpacman
pacmanpacmanpacmanpacmanpacmanpacmanpacmanpacmanpacmanpacman
pacmanpacmanpacmanpacmanpacmanpacmanpacmanpacmanpacmanpacman
pacmanpacmanpacmanpacmanpacmanpacmanpacmanpacmanpacmanpacman
pacmanpacmanpacmanpacmanpacmanpacmanpacmanpacmanpacmanpacman
pacmanpacmanpacmanpacmanpacmanpacmanpacmanpacmanpacmanpacman
pacmanpacmanpacmanpacmanpacmanpacmanpacmanpacmanpacmanpacman
pacmanpacmanpacmanpacman
that's it. That's 512 characters/ascii bytes.You can see this in the original code on the line that reads,
db 0x55,0xaa ; Make it a bootable sector
So, 1% more impressive. (The original submission calls it "in 512 bytes" too.)Now, what I'm curious about is the filler before the signature. You have to pad the binary to 510B prior to emitting the signature, s.t. the signature is in the right place. The author pads with 0x4f … but why that octet, and not, say, 0x00?
¹Unless, I suppose, you realize you need a 0x55 0xaa in your code somewhere, and re-use the signature. But that is not the case here. But I wouldn't put it past some of these tiny code challenges, as the authors tend to be quite clever.
Technically, it is 512 bytes, but it does not give me any sense of scale. "There's a lot of pacmans in there, so 512 looks like a lot".
Granted, I looked at it from my phone, so that probably biases me towards long- or short-looking text (I even had to scroll).
Not only was there no framebuffer and only 128 bytes of RAM, but the graphics chip didn't generate any interrupts (it could halt the CPU until the start of the next scanline though). You had to wait and spinlock on a timer for the proper amount of time after finishing your frame and processing game state to start drawing the next frame.
You also manually had to tell the graphics chip to output VBLANK lines so you had to do that at the right time as well. If you got the timing wrong on that the vertical hold on your analog TV would lose sync and the screen would jitter or roll.
Are the Data lines still bidirectional? Or was this achieved by strobing the Address lines in a certain pattern?
Imagine candy crush for example - just just need a level counter (1 byte) and a bitmap of which candies have been collected (8 bytes).
If the original code was 512 (well, 510 if you deduct the signature, 446 if you also include the DOS partition table) bytes of asm source code, then the analogy might make sense.
512 characters isn't a whole heap. It's more than some, but not a lot, and less than the kind of binary most languages do produce today.
A visual demonstration doesn't need to be nitpicked. (293)