Search the Community
Showing results for tags 'STIC'.
Found 1 result
Ok, this has got to be the absolute WEIRDEST bug I've ever seen. I discovered it while chasing down a bizarre "Flip to Color Stack" bug in my program. Here's the scenario: I have a function that resides at $C022 in the memory map. It was a simple "spin and wait for keypress" function. Every so often, calling it would flip the display into color stack mode! Now, I'm already aware that the STIC is read-sensitive at location $C021, due to aliasing. And reading $C021 will pop the display into color stack mode. But, I wasn't reading $C021, at least not directly. I've constructed a minimal test case (attached). The key comes down to the highlighted two lines: @@loop: NOP ; Take this out, and it goes away CALL BUG B @@loop .... ORG $C022 BUG MVI $1FE, R0 ; Take this out, and it goes away JR R5 I think the NOP can be any instruction, so long as there's a linear fetch leading into CALL BUG. I tried putting the @@loop label on CALL BUG and it didn't trigger. Likewise, if I try to remove the MVI $1FE, R0 in the BUG function, it goes away. But, if I bracket it with "PSHR R5/PULR PC", it still triggers(!). That is, if I rewrite BUG as follows, the bug still triggers, as long as I also keep that MVI in there too: BUG PSHR R5 MVI $1FE, R0 ; Take this out, and it goes away PULR PC What the code should do is stay in FGBG mode. In that mode, you'll get gobbledegook on a black screen. (See attached expected result.) But, on a real Intellivision, you get the attached photo instead. Is it only my Intellivision? (I haven't had the time to dig out an Intellivision 2 or even try it on another Intellivision 1.) This is a totally bizarre bug! I worked around it in my code by moving the function down. But still... it was and still is a true head scratcher. I have no idea what the root cause might be. I don't own a logic analyzer either, so I can't really see what's happening on the bus. I will say this: I saw the bug both with a CC3 and a JLP board, so the board isn't likely to be the culprit. weird_bug.zip