cfchiesa@bsu-cs.UUCP (Christopher Chiesa) (05/31/88)
Greetings.
Regular readers of this group may recall my postings over the past several
months, dealing with intermittent system problems which I attributed to my
aging Percom AT-88 disk drive. Unfortunately, the problem has always been spo-
radic enough to elude simple cause-and-effect diagnosis, and the software which
locks up has always been complex enough (AtariWriter, AtariWriter Plus, video
games) that the problem "could be anything" in the system.
Last night, however, all of that changed. I've been working on a little
graphics-demo program, in which the "main program" does the well-known "rain-
bow" effect with the "background" color, while a VBI routine "rotates" five
players (yes, five) horizontally across the central portion of the screen.
It's a short program, I understand it thoroughly, and it LOCKED UP on my com-
puter three separate times when it absolutely should NOT have. (Code is be-
low for those who want it.)
From this latest development, I've been able to deduce that yes, the prob-
lem IS heat-related. The first time this program locked up, the computer had
been on most of the day, and a hot day at that. Thinking back, most of the
other failures occurred when one or both of these factors was true. The clin-
cher was when I let the program run all night. It ran fine for a half hour
before I shut the monitor off at 2AM, then when I turned it back on at 10AM the
background ripple was gone, the player graphics data was corrupted, and the
program no longer responded to the "exit" command (START+SELECT+OPTION all
pressed at the same time.) The "main program," in other words, had died. The
VBI routine, however, was still running, rotating the players just as always.
THAT seems as though it ought to be significant; can anyone be more specific?
On discovering this situation, I felt around the case (this is an 800, not
an XL or XE) and found that the hottest place was in the right rear, where as
I recall from years ago, the RF drive circuitry lies. (I'm using a monitor
so the RF circuit is driving NOTHING; can that be enough of a problem to fry
the rest of the machine?) The "personality board" and three RAM boards inside
the main hatch (BACK of the cartridge slots) were warm to the near-touch, also.
There's a computer place north of here that for ten bucks will examine your
computer and tell you what's wrong with it. I am thinking of taking this beast
up there, but I sure don't want them to MISS anything. From what I've
described, can anyone here suggest the most likely / common cause of this
type of problem? I should point out that no one else I've known with an Atari
(although most of them are XLs, not originals like mine) has any problem run-
ning the VERY SAME COPY of any of the programs that lock up on my machine.
Thanks in advance for anything anyone can say. The disk drive problem is
one thing, but if my main box is fried that's another story entirely. SPARE
NO EXPENSE! etc.
Chris Chiesa
Ball State University
Muncie, IN
The following is the code for my short graphics-demo program. Put it on when
you go to bed tonight, and see if it is still running properly when you get up
tomorrow morning. If it IS, then I've got a problem. If it ISN'T then YOU'VE
got the SAME problem.
===========CUT HERE =============== CUT HERE =================================
; STRIPES -- "moving stripes" graphics demo
; v4.1, Chris Chiesa, 5/29/88
;
RTCLOK = $14
SDMCTL = $022F
GPRIOR = $026F
SIZEP0 = $D008
GRAFP0 = $D00D
COLPM0 = $D012
COLBK = $D01A
CONSOL = $D01F
POT0 = $D200
WSYNC = $D40A
SETVBV = $E45C
SYSVBV = $E45F
XITVBV = $E462
;
VBI = $06 ; "Immediate VBLANK Vector" - for SETVBV routine
ALLKEYS = $07 ; CONSOL value when OPTION, SELECT, START all pressed
COLRINC = $10 ; Color-rotation increment (players): clr +1, lum +0
;
DMADSB = $00 ; Turn display off entirely
DMAPM = $0C ; Enable Players/Missiles only
DMAENB = $22 ; Enable normal playfield display
;
LMAR = $40 ; P/M coordinate "Left Margin"
MID = $A0 ; P/M coordinate "threshold"
RMAR = $C0 ; P/M coordinate "Right Margin"
;
*= $2000
COLREG .BYTE 0 ; temporary Color Register
POSARR .BYTE $40,$60,$80,$A0,$C0 ; P/M positions 0 - 4
DATARR .BYTE $FF,$FF,$FF,$FF,$00 ; P/M graphic data, 0 - 4
;
START JSR INIT ; Initialize P/M graphics
;
INSTAL LDX # >SCROLL ; install P/M "scroll" routine as Immediate
LDY # <SCROLL ; VBI
LDA #VBI
JSR SETVBV
;
WAIT LDA CONSOL ; read console keys
AND #ALLKEYS ; all keys pressed?
BEQ QUIT ; yes - QUIT.
;
; Additional special effect: implement the famous Atari "rainbow" ripple:
;
LDA POT0 ; no -- get current-scanline count value
ADC RTCLOK ; add to "current video frame" count value
STA COLBK ; to obtain color value: alter BACKGROUND color
STA WSYNC ; synchronize with Horizontal Blank
JMP WAIT ; repeat
;
QUIT LDX SYSVBV+2 ; restore system-default Immediate VBLANK vector
LDY SYSVBV+1
LDA #VBI
JSR SETVBV
;
LDA #DMAENB ; retore normal playfield display
STA SDMCTL
RTS ; end; return to OS (DOS/XL)
;
; Immediate VBLANK Interrupt routine -- scroll players "one bit left" every
; VBLANK. Increment RTCLOK so that rainbow effect MOVES.
;
SCROLL INC RTCLOK ; remove this for STATIC rainbow background
;
LDX #$00 ; start with player 0
SLOOP DEC POSARR,X ; quad-width player must move 4 "color clocks"
DEC POSARR,X ; to equal one displayed bit-width.
DEC POSARR,X
DEC POSARR,X
LDA POSARR,X ; player's new position
;
TESTL CMP #LMAR ; sliding off at left margin?
BCS TESTR ; no - skip.
CLC ; yes; roll OFF bits in at left to compensate
ROR DATARR,X
JMP TEST0 ; skip right-margin test
;
TESTR CMP #MID ; sliding in at right margin?
BCC TEST0 ; no - skip.
SEC ; yes; roll ON bits in at left to compensate
ROR DATARR,X
;
TEST0 BNE UPDATE ; are all bits of player OFF? (true only when
; player has just slid off left margin completely
LDA #RMAR ; yes: prepare to bring player in at right on
STA POSARR,X ; next VBI pass.
LDA COLREG ; Give it the next color available.
JSR SETCLR
CLC
ADC COLRINC
STA COLREG
;
UPDATE LDA DATARR,X ; Give player computed new graphics data
STA GRAFP0,X
LDA POSARR,X ; Place player at computed new position
JSR SETPOS
;
INX ; next player
CPX #5 ; process players 0 - 4 ("fifth player" enabled)
BNE SLOOP
JMP (SYSVBV+1) ; exit from VBLANK when done
;
; Initialization of player parameters etc.
;
INIT LDA #DMADSB ; turn off display while initializing
STA SDMCTL
STA COLREG ; start with color 0, luminance 0
LDA #$11 ; players priority; enable 5th player
STA GPRIOR
;
LDX #$00 ; start with player 0
ILOOP LDA #$FF
STA SIZEP0,X ; quadruple width players
LDA DATARR,X
STA GRAFP0,X ; default graphics: P 0-3, all ON. P4, all OFF
LDA POSARR,X ; default positions
JSR SETPOS
LDA COLREG ; hand out colors in order
JSR SETCLR ; set "current" player to "current" color
CLC
ADC #COLRINC ; prepare "next" color for "next" player
STA COLREG
;
INX ; do for players 0 - 4
CPX #5
BNE ILOOP
LDA #DMAPM ; enable P/M display
STA SDMCTL
RTS
;
; SET COLOR OF PLAYER : handle fifth-player color-setting uniformly
;
SETCLR CPX #$04 ; fifth player gets special processing
BEQ CL4
STA $02C0,X ; player 0 - 3, simple offset
RTS
CL4 STA $02C7 ; player 4, location of its own
RTS
;
; SET POSITION OF PLAYER : handle fifth-player position-setting uniformly
;
SETPOS CPX #$04 ; fifth player gets special processing
BEQ POS4
STA $D000,X ; player 0-3 position registers contiguous
RTS
POS4 TAY ; save "position" value
TXA ; save "player number"
PHA
TYA ; restore "position" value
LDX #$03 ; player 4 -- 4 independent position registers;
; "reverse order" w/respect to graphics data bits
PLOOP STA $D004,X ; position 4 missiles comprising player 4, so
CLC ; graphics data is displayed in same format as
ADC #$08 ; true players
DEX
BPL PLOOP
;
PLA ; restore player numher and position value
TAX
TYA
RTS
;
*= $02E0 ; Load-N-Go
.WORD START
--
UUCP: <backbones>!{iuvax,pur-ee,uunet}!bsu-cs!cfchiesa
cfchiesa@bsu-cs.UUCP