AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Free pascal 5.53/23/2023 Here’s what the zztgo version looks like (pretty close, right!): To get it to look like real ZZT, you have to adjust your font and terminal colours to match the old DOS ones. It currently uses terminal “graphics” via tcell. Once I got it to compile, I had to add in the video functionality. I moved the Go code to its own /benhoyt/zztgo repo and systematically worked through the errors.txt file, fixing issues as well as removing less important source code (sound functions). The first step was getting it to compile without errors. Once the semi-automated conversion was done, it still had dozens of Go compile errors. For example, take a small Pascal function in OOP.PAS:įunc WorldGetFlagPosition ( name string ) ( WorldGetFlagPosition int16 ) The Go port Go’s structure and declaration syntax actually has quite a number of similarities to Pascal, so this made the overall structure of the converter pretty straight-forward. So I wrote a not-very-complete Turbo Pascal parser, and a converter that takes the Pascal syntax tree and tries to write it out with Go types and syntax. I enjoy tinkering around with interpreters and compilers, so I wanted to see if I could write a program to convert Adrian’s Pascal reconstruction to Go semi-automatically. However, when the Pascal reconstruction came out, I had another (ahem) go. A Pascal-to-Go converterĪ while back I started trying to write a version of ZZT in Go, but after making a tiny bit of progress, I gave up – it seemed like too big a job for a side project. He has since gone further, and created libzoo, a portable C reimplementation of the ZZT game engine with a permissive license for use in other ZZT ports. I for one find that an amazing feat! See the original Hacker News discussion and the article Adrian wrote later about how he did it. In March 2020, Adrian published his Reconstruction of ZZT, a reverse-engineered recreation of the Pascal source code that, when compiled with the original Turbo Pascal 5.5 used by ZZT, compiles to a byte-for-byte identical. And Adrian Siekierka is the author of Zeta, a specialized DOS emulator just for running ZZT. The original source code for ZZT was lost in a computer crash, but there have been various attempts over the years to recreate the game in other languages, including C++, a partial implementation in JavaScript, and even an accurate reimplementation in Rust. So people created thousands of their own worlds and shared them – hundreds of which are downloadable and even playable online at the Museum of ZZT, a kind of for ZZT worlds. The world editor had a scripting language called ZZT-OOP, where the “O” in OOP referred to ZZT’s “objects”, which are programmable game characters or robots. Here’s what the original shareware “Town of ZZT” title screen looked like: Even in its time the graphics were far from revolutionary … but the reason ZZT did so well, and still has something of a cult following, was because of the world editor (that came free, even with the shareware version). I’m not “a gamer”, but one of the games I enjoyed playing as a teenager was Epic MegaGames’ ZZT – an old text-mode DOS game that came out in 1991. This article describes my Pascal-to-Go converter and my (not exactly complete) Go port of ZZT. Summary: After seeing Adrian Siekierka’s “Reconstruction of ZZT”, I wrote a program to translate his Turbo Pascal code to Go. ZZT in Go (using a Pascal-to-Go converter)
0 Comments
Read More
Leave a Reply. |