5 ms·
For those interesed, I was among the not-confused-but-curious (I'm old enough to even have inserted cassette tapes on a computer) and found out this [0] explana
by dordoka 11y ago
For those interesed, I was among the not-confused-but-curious (I'm old enough to even have inserted cassette tapes on a computer) and found out this [0] explanation :) Nice story, thanks ksherlock.
[0]: http://www.geek.com/games/karateka-apple-ii-floppy-disk-had-a-side-b-played-game-upside-down-1509335/ http://www.geek.com/games/karateka-apple-ii-floppy-disk-had-...
- speeder 11y agoUnfortunately it is not explained HOW they did it. It is somewhere on Mechner site and diaries, but I can't find it again. Basically, one day while coding, he found out that one single bit caused a bug in rendering that flipped the whole game upside down, it was completely unintentional. But he thought it would be hilarious to make the easter egg (indeed, it was). Later he used the same technique on Prince of Persia game (there is an area of the game where you drink a potion that flips that bit, flipping the whole game upset down, this had to be emulated for non-Apple systems, probably caused some pain to people porting the game :P)
- wang_li 11y agoThe Apple II floppy drives were single sided. It would be trivial to put different code on the other side of the floppy disk itself. A single bit error that would simply flip everything upside down seems quite improbable given the Apple II hardware. I wouldn't be surprised if a bug inspired the easter egg, but I'd be shocked if there was a single bit difference between the front and back of the floppy.
- speeder 11y agoI think it was related to something about how a pointer to the video data worked in the game engine (not a property of Apple II itself). Maybe it was the positive/negative bit that was flipped, and made the pointer read backwards and underflow, but end rendering anyway due to some hardware quirk.
- wang_li 11y agoI don't believe that the 6502 had such a thing as a positive/negative bit that would have this kind of effect. On that hardware, if I was going to do this, I'd just reverse the order of the entries in the scanline lookup table. On the Apple II the address of the first pixel of each scanline did not follow immediately after the address of the last pixel of the prior scanline. So every program that did any graphics work used a lookup table to get the address of a particular scanline. As long as you were consistent in your use of this table, that would be the only necessary change to flip the game upside down.
- apricot 11y agoReversing the scanline lookup table is indeed how it was done. Source: I disassembled it, a long time ago.