On Sunday 10 December 2000 16:15, you wrote:

> > About V9938.c: the preparations for SCREEN8 reorder worked very well, I
> > had to change only 1 line. However, SCREEN7 is harder because it puts the
> > even pixels in the lowest 64K of VRAM and the odd pixels in the highest
> > 64K of VRAM. So a pair of pixels isn't located in a single byte like it
> > is in SCREEN5.
>
> I can vagely remember there was an issue with VRAM access in SCREEN 7 and
> 8. How exactly does it work Maarten? Any information would be appreciated.
> :-)

Both SCREEN7 and SCREEN8 are only available on machines with 128K VRAM. That 
128K VRAM is devided over 2 64K RAM ICs. To get the most speed out of the 
RAM, both ICs are addressed alternatingly (that's my theory anyway).

Every even pixel in SCREEN7/8 is located in the first IC, that is the first 
64K of VRAM. Every odd pixel is located in the second IC, the second 64K of 
VRAM.

Note that SCREEN10/11/12 are actually SCREEN8 with YJK conversion enabled. 
They use the same VRAM mapping as SCREEN8.

So in SCREEN8 the formula to get the address of a pixel is:
(taken from modified V9938.c)
#define VDP_VRMP8(X, Y) (VRAM + ((X&1)<<16) + ((Y&511)<<7) + ((X&255)>>1))

And in SCREEN7 the formula is:
#define VDP_VRMP7(X, Y) (VRAM + ((X&1)<<16) + ((Y&511)<<7) + ((X&511)>>2))

However, the VDP acts as if the VRAM is stored as one single area. So the 
programmer almost never notices this mapping. But when you switch screen 
modes and you continue to use the VRAM contents under a different mapping, 
you will have to take care of the mapping.

For example, Laydock 2 Last Attack loads SCREEN5 graphics while displaying 
its SCREEN12 title image. Without the reorder code, part of the intro demo 
animation is garbage.

SCREEN7 reorder is more difficult to implement than SCREEN8, because what 
appears to be a byte to the programmer is actually spread over two VRAM 
locations. For example, when a byte is written through port #98, it must be 
split into two nibbles which end up in different VRAM locations.

As mentioned before, Laydock 2 Last Attack depends on SCREEN8 reorder. I read 
Breaker Breaker does as well, but I haven't tested that yet. The only program 
I know that depends on SCREEN7 reorder is Almost Real, at the start of the 
title sequence where the Mayhem logo is rolled out over the system 
configuration text.

Bye,
                Maarten

--
For info, see http://www.stack.nl/~wynke/MSX/listinfo.html

Reply via email to