AVG programming question...

From: Clay Cowgill <ClayC_at_diamondmm.com>
Date: Thu Apr 15 1999 - 13:44:43 EDT

Hi everyone,

So this will probably be a limited audience for this message, but if any
of you know the answer feel free to pipe up. ;-)

(I'm figuring Al, Jeff, and Anders will probably be the likely
candidates...)

I'm doing my usual "write the menu system in MAME and then make it work
on real hardware" routine with the Tempest Multigame. I've got the
menu-system to a point I'm happy with, but alas the "real" Tempest
hardware doesn't take so kindly to it.

I've got a display at least now (it was what I thought, Al-- need to
have the VG reset and VG go right at the end of the ISR...), but here's
my question for any of you that have programmed on the AVG:

Does the AVG do anything "funny" with read-modify-write type
instructions accessing VRAM? I can't see any reason why it would, but
the symptom I'm having now is that it *looks* like the folliowing
doesn't work:

VRAM is from h'2000 - h'2FFF in Tempest, so I've got something like this
in VRAM...

Starting at 0x2000:

40 80 FF 71 06 6F 37 A9 ...

which basically means:

40 80 center beam

FF 71 zoom factor "really small"

06 6F color register 6 (had to do a 6F to make MAME happy, I don't think
the real hardware cares...)

37 A9 subroutine call to display the "TEMPEST" logo

(Yes, I did that all by memory. Did I happen to mention that I can now
read and write Tempest Vector Memory display lists in hex? Probably
never come up in final Jeopardy though... :-)

What I then do is basically:

        lda #0x01
        sta frame_done
zoom: dec 0x2002 ; zoom in the logo - decreasing the value of
that 0xFF in the display list above
wait: lda frame_done
        bne wait
        lda 0x2002
        cmp #0x18
        bne zoom
        ...

frame_done is a flag that is cleared by the ISR that starts the Vector
Generator drawing. (So once a frame is drawn frame_done is 1.)

What the above code does in MAME is decrement the zoom value of the
Tempest logo (making it get larger on the screen) once per frame update
until the zoom is equal to 0x18 after which it continues on to other
code.

What it seems to do on the *real* hardware is hang. The ISR is still
running, but the logo never zooms in.

I'm concerned that either the "dec 0x2002" isn't working (so the loop
never exits), or maybe that since my loop flag gets set in the ISR, but
possibly prior to the vector generator actually *finishing* drawing the
frame, maybe I'm getting a bus contention and "dec 0x2002" isn't able to
change the VRAM.

I don't know if Tempest *has* a VG-busy bit I can read to tell when
things are done drawing...

Any thoughts/theories/solutions welcome...

-Clay
Received on Thu Apr 15 12:45:26 1999

This archive was generated by hypermail 2.1.8 : Thu Jul 31 2003 - 23:00:45 EDT