Si78c: Memory-accurate reimplementation of Space Invaders in C
github.com
github.com
http://tipsgeneral.com/how-to/geek-trivia-the-screen-of-spac...
Though, having said that, this source I just looked up to get a screenshot suggests that's actually an enhancement added after the initial release.
edit to add: a better, non-blogspammy article that discusses this and provides an emulator:
That's just how interrupts work; it is not cooperative multitasking. Taking an interrupt which just returns (no scheduler) is not usually called preemption.
Especially since usually the entire point of an interrupt triggered by some hardware-related event (vsync, hsync etc) is that the main thread is not yielding or doing anything at all to cooperate.
The keyboard controls are:
a LEFT
d RIGHT
1 1P
2 2P
j FIRE
5 COIN
t TILT
TILT! I was surprised and amused to see that there's an actual tilt sensor input.I think most people with a passing familiarity with arcade machines know that pinball machines had "tilt" sensors. People would smack, shake, tilt, etc. the tables in an attempt to change the trajectory of the ball. Or, perhaps they just abused them out of frustration. So, there were tilt sensors built into pinball machines that would end your game and light up a "TILT" message if tried those potentially damaging shenanigans. After all, those machines weren't cheap.
I had no idea they were built into early solid state games like Space Invaders as well. That's hilarious.
I guess people tried jiggling the machines in order to help them avoid the aliens? Or Taito, at least, feared they would?
I suspect it was damage prevention, much more so than cheating.
Cheating only affected the arcade owners if you were cheating on a busy machine, and somehow cheating well enough to actually extend your game. Longer games = less quarters.
But, really, how many people were cheating at pinball well enough to extend their games? I think that would take some serious skill. I think most people banging the machines damaged the machines far more often than they extended their games. So I think it was mostly about that.
First you have to (or someone else has to) disassemble the original binary, since the original source code is usually long gone.
Then you have to actually go through the code to try to understand it all - this is difficult to do in a high level language, but even more so in assembly. Even if it's already disassembled and someone else has already added comments it's still not easy.
If you don't already know the ASM language being used, you have to also learn that as you go.
Only once you have a complete understanding of the ASM code can you even begin reimplementing it in C.
Then you have to test it and make sure it actually functions like the original.
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.
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.)
No need to imagine! https://github.com/diasurgical/devilution
This is >99% binary exact when compiling with the original toolchain.
Show HN: Space Invaders in C - https://news.ycombinator.com/item?id=21719575 - Dec 2019 (105 comments)
I did something similar in ARM7 (non-thumb) https://github.com/tuckerpo/MicroSpaceInvaders
wget https://archive.org/download/MAME2003_Reference_Set_MAME0.78_ROMs_CHDs_Samples/roms/invaders.zip
unzip invaders.zip -d inv1