On Monday 11 December 2000 14:28, you wrote:

>       This effect of interlacing is already implemented in brmsx since
> version 2.6. It's used in the game Breaker. Instead of making a more
> complex vram retrieve, like you're doing, I opted for a complete shuffling
> of all the 128kb of vram each time you switch from a lower screen to a
> screen greater than 6. This should be a bit slower in games that change
> screen 5/7 in line interrupts, but it's much faster in the general case (I
> always optimize for the general case).

I implemented that approach about a year ago, but Marat rejected it.

The first reason is the one you mention: the reshufle takes a lot of time and 
if it's executed often (line interrupts) it will slow down the emulation a 
lot. However, I don't know of any existing program that changes between 
SCREEN7/8 and a lower screen mode on a line interrupt.

The second reason is that my implementation required a 128K auxiliary array. 
I know a way to implement it using a 64K auxiliary array. But I'm curious if 
it can be done with significantly less auxiliary memory. Well, ofcourse any 
permutation can be written as a series of swaps, but that may be a lot slower 
compared to the auxiliary array approach.

>       Check out the implementation in the brmsx source code,
> file V9938.ASM, routines vram_interlace and vram_deinterlace.

Why do you call this "interlace"?

Anyway, these are the routines I used:

  fprintf(stderr, "Reordering to 7/8...\n");
  Src0 = VRAM;
  Src1 = VRAM + (1<<16);
  Dst  = VRAM_ALT;
  for (Count = 1<<16; Count; Count--) {
    *Dst++ = *Src0++;
    *Dst++ = *Src1++;
  }

  fprintf(stderr, "Reordering from 7/8...\n");
  Src  = VRAM;
  Dst0 = VRAM_ALT;
  Dst1 = VRAM_ALT + (1<<16);
  for (Count = 1<<16; Count; Count--) {
    *Dst0++ = *Src++;
    *Dst1++ = *Src++;
  }

Bye,
                Maarten

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

Reply via email to