Re: [stella] Don't say you weren't warned....

Subject: Re: [stella] Don't say you weren't warned....
From: emooney@xxxxxxxxxxxxxxxx (Erik Mooney)
Date: Sun, 15 Aug 1999 21:26:33 GMT
>> It starts at RAM location $FF (also accessible via
>> $1FF, $20FF, $21FF, $40FF, $41FF, etc) and expands
>> downward.
>
>$FF is zero page and fastest, right?

Correct.  Although the stack instructions (PHA, PLA, PHP, PLP, JSR, RTS)
access RAM via addresses $180 to $1FF - not zeropage.

>> RAM is located from $80 to $FF, also accessible via
>> $180 through $1FF, $2080 through $20FF, $2180 through
>> $21FF, etc.
>
>Same as above?

Yes.  Accessing the RAM through other than a zeropage address takes at
least one (rarely more) extra cycle.

>> Right.  Feel free to look through some source code...
>> my own INV includes a lot of this stuff; looking at
>> the source  might help with the syntax.
>
>Umm...where can I find this code of INV?  Is it at The Dig?  Is it
>commented out, too?

It's at Nick Bensema's page, http://www.primenet.com/~nickb/atariprg.htm .
It's fairly well commented.

>Just to make sure I'm clear on this:  would TIM64T be set for 37, or
>the number of color clocks, or what?  And fits into the program how?  I
>set it for whatever number, it automatically counts down and I check
>for when it hits 0, then start drawing the screen?  Is TIM64T just a

That's about right.  What you do is, right at the beginning of vertical
blank, set it for the number of CPU clocks during vertical blank divided
by 64.  (TIM64T decrements every 64 CPU clocks.)  So you'd write
(76*37)/64 = (round down) 43 to that register.  Then, after you've done
all your game calcs, you do a loop
Wait1  LDA INTTIM
BNE Wait1
and then start drawing your screen.

>number to check and I still need the WSYNC in the overscan period, or
>is that handled by the command?  Also, would I store at TIM64T the
>number for the overscan AFTER the frame, since it would be when that
>expires that I VSYNC three times, then just reset the number for the 37
>before the next frame?

Do you have the Stella Programmer's Manual docs?  TIM64T is pretty well
explained in there, IIRC.  It's linked to at Nick's site.

>> WSYNC is a strobe register; doing STA WSYNC doesn't
>> actually shut anything on or off.  It's a signal to
>> the TIA to keep the CPU in a halt state until the
>> current scanline finishes.
>
>So that makes it my responsibility to tell the program to switch it on
>and off with a specific number that turns that bit on or off, right?

No; writing any value to WSYNC triggers the halt-until-scanline-finished.

>> The LDA sets the zero flag (that BNE tests) without
>> need for a compare.
>
>Whoa, no kidding.  Then which branch commands need a compare command
>first, and which can just be done without it?

You'll probably want to use a compare command almost always.  LDA is sort
of a special case; the CPU sets the zero flag accordingly when the LDA
executes (the transfer instructions TXY et al also do this); it could be
thought of as getting a free invisible CMP #0 after those instructions.

--
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/

Current Thread