most of you know that the 7800 architecture is different to 2600,5200, Lynx and 800... and is more like on older arcade games... and works with "zones" & object lists for scanlines...
quote from the atari 7800 dev guide:
"The group of rasters specified by one DLL entry is called a
"zone." Again, the number of rasters in a zone equals OFFSET+1.
Larger zones mean less RAM is needed for DLLs, Display Lists and
Character Maps (see DMA MODES below). But upon consideration of
how to use zones, you will realize that to achieve smooth
vertical motion each stamp must be padded at top and bottom with
zeros. For example, if the top raster of an object is to appear
on the last line of a 16 high zone, it must have 15 lines of
zeros above it. If that object is 8 pixels (2 bytes) wide, and
its top line of data is located at x'CF04', then you
will need two bytes of zeros at x'D004', x'D104', x'D304',...,
and x'DE04' (remember that OFFSET decrements). As this can add
up to many pages of zeros, you can specify that MARIA should
interpret certain data as zeros, even if it isn't. This is
called "Holey DMA" because DMA will see "holes" in the data that
aren't really there. This can be enabled and disabled on a zone
by zone basis via a DLL entry. Holey DMA has been aimed at 8 or
16 raster zones, but will have the same effect for other zone
sizes. MARIA can be told to interpret odd 4K blocks as zero,
for 16 high zones, or odd 2K blocks as zeros for 8 high zones.
This will only work for addresses above x '8000'. This means
that these blocks can hold meaningful code, or tables, or
graphics data used in a zone where Holey DMA is not on."
so... my 1st mistake was... i mixed up "odd" with "even"... which wasn't good...
then i went through Dan's vertical sprite demo and tried to understand how vertical sprite posititioning works on 7800 in detail. the basics are clear... but the holey DMA issue drove me crazy...
so... assuming you have build up the screen with zones covering each 16 scanlines. your sprite is f.e. 16x16 pixel...
remember that gfx data has to be layed out in ram with 256 bytes "scanlines"... f.e. the sprite would cover the adress space:
$a000-$a003
$a100-$a103
$a200-$a203
$a300-$a303
...
$af00-$af03
(16 pixel are in 160x2 mode, similar to antic e, 4 bytes as each byte holds 4 pixels)
for vertcial sprite positioning we have to modify the DLs for the zone(s) the sprite would appear... which means the starting adress of the sprite data... as it is written in the dev document...
to avoid a lot of wasting ROM space because of the "0" each sprite would need to be positioned smoothly... MARIA has the holeyDMA feature...
assuming holeyDMA16 (for 16 scanline zones) is set in the display list list (DLL) the dev doc says that now every odd 4k block above $8000 will be interpreted by MARIA as 0 even if there is no zero data...
ok... what does this mean? now my bad logical brain confused me... for me each 4k block is even, not odd... 4096 is even... but then i found this bit in the dev doc:
DLI - Display List Interrupt flag.
0 => No DLI.
1 => Interrupt after DMA on last line
of previous zone.
H16 - 16 high zone Holey DMA enable.
0 => Not enabled.
1 => Enabled. DMA interprets odd 4K
blocks as zeros. (A12 high => data=0)
H8 - 8 high zone Holey DMA enable.
0 => Not enabled.
1 => Enabled. DMA interprets odd 2K
blocks as zeros. (A11 high => data=0)
OFFSET - OFFSET starting value.
4 bits only.
DL ADDRESS - Address of Display List for this zone.
the interesting part is "A12 high => data=0" in the H16 section... now we have to think "binary". so let us perform a CLD in our brain...
A12 means the Bit12 of the sprite data adress (A0-A15)
now... let us check:
Bit counting from left to right 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
$a000 = %10100000 00000000 (high low)
$a100 = %10100001 00000000
$a200 = %10100010 00000000
...
etc... Bit 12 is always 0 = even in MARIA definition so gfx data is being visible on screen.
now...for vertical movement we would need data "on top of our sprite at $b000-$bf00 for being possible to set the sprite on scanline basis...
so... let us write $b000 etc... in binary mode
$b000 = %10110000 00000000
$b100 = %10110001 00000000
$b200 = %10110010 00000000
...
and voila... Bit 12 is set for the whole range $b000 - $bfff ergo is this ROM space "odd" for Maria when holeyDMA16 is enabled... so data lying here will not be interpreted as sprite data but instead as "zero" = 0
so... now your code has just to calculate on which zone(s) your sprite appears and has to modify the DL entries including the sprite adress pointer... but this is not more complicated then it looks...check out dan's sprite demo...
it's still not so comfortable like on "real hardware sprite" systems... where you just need to alter x,y hardware adresses but with this method is very similar as you move the sprites by altering the "high byte" of your sprite pointer... and this is similar to the above system...you have just to add the starting adress of your sprite data to the y-position... and voila...
MARIA designes had really fast gfx in mind... as the chip seems designed for speed (and having the 6502 in mind as well...) all counters count downwards, gfx data has to be stored "top-down", gfx data has to be stored with "256 bytes" long scanlines in mind... all neat tricks by hardware which we demo coder would use in our own productions...
i hope i could explain a little bit to the newbies...














