Profile cover photo
Profile photo
Nate Downes
Nate's interests
View all
Nate's posts

Post has shared content
Was fun

Post has shared content
This week: a PET 2001 emulator in obfuscated C takes the shape of a PET, incorporates a 6502 emulation and all in just 66 lines.  Stephen Sykes won the 2005 IOCCC with this entry. He includes a 6502 test suite, a chess program and a Basic demo.  See this album of screenshots for details.

As is usual with obfuscated C contest entries, even a source code formatter does not help to understand it. Processing it with the preprocessor and re-formatting converts it into something that starts making sense. Keyboard input is written to $a2 into memory instead of being passed through a VIA emulation. The LOAD vector on $ffd5 is trapped to load files. The CPU emulation, however, is still ... ungrokable. Awesome piece of code - although I would not want to maintain it :)

For all the files, see
For more PET facts, see the FAQ at or the index at
For the memory map, see
The chess program is (probably) a conversion of a previous IOCCC entry - see
PET (shaped) Emulator from IOCCC
11 Photos - View album
Wait while more posts are being loaded