4 ms·
Holy Moly, look at that monster struct at line 125. So much code for such a simple game. Now imagine the code base of original Diablo. And yet, it run (still
by wheelerof4te 5y ago
Holy Moly, look at that monster struct at line 125.
So much code for such a simple game.
Now imagine the code base of original Diablo. And yet, it run (still does) on a toaster.
- wizzwizz4 5y agoThat struct wouldn't actually have been in the original game. The idiomatic C analogue would be static variables inside functions, or (occasionally) global variables, but that wouldn't make it a memory-accurate reimplementation. I think the game code proper starts around line 670, but still, there's quite a lot of emulator code interspersed with the game logic after that point. (Multiple-line functions for something that would've been a single memory read in the original game.)
- deleted 5y ago[deleted]
- kazinator 5y agoWell, that struct is that toaster, or its memory layout declared in C syntax, including all the game's global variables. It's surprising how many there are.
- seritools 5y ago> Now imagine the code base of original Diablo. No need to imagine! https://github.com/diasurgical/devilution https://github.com/diasurgical/devilution This is >99% binary exact when compiling with the original toolchain.