[comp.sys.apple2] Bug contest

meekins@CIS.OHIO-STATE.EDU (timothy lee meekins) (02/05/91)

Hey, let's have a strangest most crazy ultimate and weird bug ever found
contest. I got the idea for the contest because I think I have the winning
entry.

Anyways, about a half hour ago, I was working on Z3D. To make things short,
the entire screen began scroll, almost like a screwed-up vertical hold on a
TV. very strange. I think the electron beam location is getting screwed
big time. If anyone has the foggiest notion of how this could happen, let
me know, it would be neat to take advantage of. The entire screen was
scrolling, border and all. Oh yeah, how did ACS italicize the text in
their "HAM mode" demo? They switch from graphics to text mode, so the
text is hardware text, not graphics, so, how was it italicized? Makes
me wonder if their are ways to fool the hardware to perform strange effects.


Anyways, let's here what other strange bugs eyou've all had!!

+---------------------------S-U-P-P-O-R-T-----------------------------------+
|/ Tim Meekins                  <<>> Snail Mail:           <<>>  Apple II  \|
|>   meekins@cis.ohio-state.edu <<>>   8372 Morris Rd.     <<>>  Forever!  <|
|\   timm@pro-tcc.cts.com       <<>>   Hilliard, OH 43026  <<>>            /|
+-------------------------S-H-A-R-E-W-A-R-E-!-------------------------------+

toddpw@nntp-server.caltech.edu (Todd P. Whitesel) (02/05/91)

meekins@CIS.OHIO-STATE.EDU (timothy lee meekins) writes:

>Anyways, about a half hour ago, I was working on Z3D. To make things short,
>the entire screen began scroll, almost like a screwed-up vertical hold on a
>TV. very strange. I think the electron beam location is getting screwed
>big time. If anyone has the foggiest notion of how this could happen, let
>me know, it would be neat to take advantage of. The entire screen was
>scrolling, border and all.

This is what happens if you set PAL video mode (50 hz vertical sync).
When you do a control-option-reset, one of the options is to set system
standards and 50 Hz -- this is for european/australian PAL video equipment.
In the hardware it is activated by bit 4 (mask $10) of $c02b, which is
described in the firmware reference (page 281 of the hardcover).

>Oh yeah, how did ACS italicize the text in
>their "HAM mode" demo? They switch from graphics to text mode, so the
>text is hardware text, not graphics, so, how was it italicized? Makes
>me wonder if their are ways to fool the hardware to perform strange effects.

What they are doing is switching from graphics to text mode at the same place
on the screen consistently. SHR is controlled by the VGC chip, and all other
graphics modes are controlled by the Mega II chip -- the two are not perfectly
in sync, the VGC tracks the Mega II and lags it by about 5/4 of a microsecond.
(I had hoped that Apple would combine the Mega II and VGC into a single chip
driving VRAMs when they made the ROM 3, but they didn't :( .) As a result, when
you switch in and out of SHR mode, the sync signal 'slips' by that 5/4 of a
micro second. The monitor hasn't totally lost the signal, but it has been
knocked away from stable synchronization, and as it re-stabilizes itself the
displayed image appears to warp for ten lines or so, and this creates the
italic effect. (Actually, I think the ACS demo does something a bit trickier
to obtain a better italic effect, but I buried the disk somwhere so I can't
go check.) The following code will demonstrate what I'm talking about:
	lda	#$80
	ldx	#$90
	ldy	#$c0
lp1	cpx	$c02e
	bne	lp1
	tsb	$c029
lp2	cpy	$c02e
	bne	lp2
	trb	$c029
	bit	$c000
	bpl	lp1
	bit	$c010
	rts

Todd Whitesel
toddpw @ tybalt.caltech.edu

benji@euler.Berkeley.EDU (Benji Rudiak-Gould) (02/05/91)

In article <9102050238.AA18080@anaconda.cis.ohio-state.edu> meekins@CIS.OHIO-STATE.EDU (timothy lee meekins) writes:
>Hey, let's have a strangest most crazy ultimate and weird bug ever found
>contest. I got the idea for the contest because I think I have the winning
>entry.
>
   [ bug description squashed ]

YOU'VE got the winning entry?  Read and weep!  :-)

Many moons ago I was writing a simple output redirection program in machine
language (that's machine, not assembly) that would trap everything that
was printed to the screen and do something to it (I forget what) before
passing it on the the COUT routine at $FDF0.  I installed it with the
PR# A$300 command, and it worked.  (Which is of course amazing in itself. :-)
What's the point?  Well, the program had a bug.  It was supposed to
read (in part)

                [test some condition]
380: F0 0E     BEQ $390
382:            [other junk]
390: 4C F0 FD  JMP $FDF0                  ; we're done, send character to COUT

Note: addresses have been changed to protect the innocent (and also because
I don't remember what they really were).

However, I made a typo, and the BEQ $390 instruction was really a BEQ $391
instruction.  Now, take a look at the code at $391:

391: F0 FD

which as everyone knows, translates to:

               BEQ $390

It looks like that mistyped instruction got executed after all!  Voila, the
program worked!

I'd say this is a 1 in 65,536 chance...

BTW, since we can't have a contest without judges, I appoint myself judge.
I'll let you know of my decision shortly. :-) :-) :-)

--                       {_ "It's not how high you are, _}   Disclaimer:
Ben Rudiak-Gould          _}  it's Hi, how are you?"   {_  Opinions are mine...
benji@euler.berkeley.edu {_        -- Mike Sugarbaker   _} Mine... ALL MINE!!!!
___________________________}___________________________{   HA HA HAAA HAAAAAA!!

daveh@ccwf.cc.utexas.edu (David H. Huang) (02/05/91)

In article <9102050238.AA18080@anaconda.cis.ohio-state.edu> meekins@CIS.OHIO-STATE.EDU (timothy lee meekins) writes:
>Hey, let's have a strangest most crazy ultimate and weird bug ever found
>contest. I got the idea for the contest because I think I have the winning
>entry.

Gee, that's not fair, is it?? :-)

>Anyways, about a half hour ago, I was working on Z3D. To make things short,
>the entire screen began scroll, almost like a screwed-up vertical hold on a
>TV. very strange. I think the electron beam location is getting screwed
>big time. If anyone has the foggiest notion of how this could happen, let

I have no idea how that could happen, but I'd like to see it!

>me know, it would be neat to take advantage of. The entire screen was
>scrolling, border and all. Oh yeah, how did ACS italicize the text in
>their "HAM mode" demo? They switch from graphics to text mode, so the
>text is hardware text, not graphics, so, how was it italicized? Makes

Where can I get this HAM mode demo? I know in one of the other demos, there
is some text mixed with graphics, and if you go to the CDA menu to change
the border color to something non-black, the border gets really weird.
It's straight until the text mode is switched in, then it jumps about 1/2 in
to the right(or left), then curves back to its original position. You can
also see some of this in the Xmas Split demo. The scrolling text in the borders
is sort of skewed near the top and so is the french flag.

>me wonder if their are ways to fool the hardware to perform strange effects.
>
>Anyways, let's here what other strange bugs eyou've all had!!
>
>+---------------------------S-U-P-P-O-R-T-----------------------------------+
>|/ Tim Meekins                  <<>> Snail Mail:           <<>>  Apple II  \|
>|>   meekins@cis.ohio-state.edu <<>>   8372 Morris Rd.     <<>>  Forever!  <|
>|\   timm@pro-tcc.cts.com       <<>>   Hilliard, OH 43026  <<>>            /|
>+-------------------------S-H-A-R-E-W-A-R-E-!-------------------------------+


-- 
David Huang                                 |
Internet: daveh@ccwf.cc.utexas.edu          |     "My ganglion is stuck in
UUCP: ...!ut-emx!ccwf.cc.utexas.edu!daveh   |      a piece of chewing gum!"
America Online: DrWho29                     |

daveh@ccwf.cc.utexas.edu (David H. Huang) (02/06/91)

In article <1991Feb5.044339.25263@nntp-server.caltech.edu> toddpw@nntp-server.caltech.edu (Todd P. Whitesel) writes:
>meekins@CIS.OHIO-STATE.EDU (timothy lee meekins) writes:
>
>>Anyways, about a half hour ago, I was working on Z3D. To make things short,
>>the entire screen began scroll, almost like a screwed-up vertical hold on a
>>TV. very strange. I think the electron beam location is getting screwed
>>big time. If anyone has the foggiest notion of how this could happen, let
>>me know, it would be neat to take advantage of. The entire screen was
>>scrolling, border and all.
>
>This is what happens if you set PAL video mode (50 hz vertical sync).
>When you do a control-option-reset, one of the options is to set system
>standards and 50 Hz -- this is for european/australian PAL video equipment.
>In the hardware it is activated by bit 4 (mask $10) of $c02b, which is
>described in the firmware reference (page 281 of the hardcover).

That doesn't happen with my monitor... the sound it makes changes and the
picture expands and then kindof bounces off the top of the screen (The top
line of text gets turned upside down). This is easily remedied by adjusting the
vertical size control at the back of the monitor, but the picture is too small
when you go back to 60Hz. Also, I've heard that it makes the clock (time clock,
not CPU clock) run slow.

>Todd Whitesel
>toddpw @ tybalt.caltech.edu


-- 
David Huang                                 |
Internet: daveh@ccwf.cc.utexas.edu          |     "My ganglion is stuck in
UUCP: ...!ut-emx!ccwf.cc.utexas.edu!daveh   |      a piece of chewing gum!"
America Online: DrWho29                     |