[atari7800] 7800 DLI stuff
- From: "Eric Ball" <ek-ball@xxxxxxxxxx>
- To: <atari7800@xxxxxxxxxxxxx>
- Date: Wed, 19 Nov 2003 20:00:46 -0500
For those of you who haven't started attempting to program the 7800 a bit of
background first.
If the high bit of a DLL entry is set, MARIA will generate an NMI
(non-maskable interrupt, vector at $FFFA) when it completes processing the
last line of the _previous_ DLL.
What can this be used for? Lots of stuff; I've used it for:
1. changing the color registers so I could get all 256 colors onscreen at
once in my color grid demo
2. changing the background (non black active background) and CHARBASE
(vertical scrolling) registers in my (to be completed) tile scrolling demo
3. setting a flag in Spacewar at the end of the active screen so I can get a
jump on setting up the display lists for the next screen
It could also be used to change between 160 and 320 graphics modes.
Some important items to remember:
1. This is an interrupt routine, so you should save (either to zero page
"shadow" registers, or push on the stack) any registers you use and end the
routine with an RTI instruction.
2. You need to be efficient because you probably don't have that many cycles
before the start of the next line (depending on how many sprites were on the
previous line).
3. Some registers (CTRL and the color registers) should be updated only
after the start of the next line because they effect how the pixels are read
from the MARIA internal Line RAM. There are 7 fast CPU cycles* for this
purpose, so do a STA WSYNC before updating them.
4. One item which occurred to me today is that you shouldn't use STA WSYNC
in the main code if you are also using DLI. This is because STA WSYNC will
halt the 6502 until the start of the next row, so the NMI will also be
masked until then. (Anyone want to confirm this?)
Can anyone else think of useful things to do with a 7800 DLI?
*as opposed to slow CPU cycles when accessing the TIA or RIOT registers
- Follow-Ups:
- [atari7800] Re: 7800 DLI stuff
- From: Dennis Debro
- References:
- [atari7800] Re: Projects, introductions, and such
- From: Dan Boris
Other related posts:
- » [atari7800] 7800 DLI stuff
- » [atari7800] Re: 7800 DLI stuff
- » [atari7800] Re: 7800 DLI stuff
- » [atari7800] Re: 7800 DLI stuff
- [atari7800] Re: 7800 DLI stuff
- From: Dennis Debro
- [atari7800] Re: Projects, introductions, and such
- From: Dan Boris