Re: A82: Mars Patrol 82 v2.0 (grayscale)


[Prev][Next][Index][Thread]

Re: A82: Mars Patrol 82 v2.0 (grayscale)



>
>so how did he do it?  I've never played the game

  I haven't looked at it that thoroughly, so I can't be exact, but I got the 
basic idea. Once I saw the general technique, the specifics were not that 
important because it is hardly revolutionary. As I said before, it is 
non-interrupt based 3 level grayscale. It takes two pictures (or rather 
backgrounds), displays one in the beginning of the mainloop and the other 
near the middle (or space them however so that the delays between pics is 
roughly equal). The gray effect is accomplished by alternating 
checkerboard-like pattern
pic1
%10101010
%01010101

pic2
%10101010
%01010101

  Because, at any given moment, half of the pixels in a given area are black 
(unlike regular grayscale which alternates all black and all white areas) 
and the other half are fading, the human eye won't detect the diagonal 
flicker. If you look really closely, you can detect a slight grainy quality 
to the gray. If you run the program on an emulator enlarged, it looks 
terrible.

  I suggest checking out the source code to Mars Patrol (it was included in 
the zip) on how to use it in a game. I've also attached a demo of the 
process which is simple and easy to see. There are a couple of downsides(I 
think):
1)The checkerboard technique will only work well for 3 level gray
2)Your main loop has to be fairly constant in speed

on the upside:
1)no interrupt = consistent results under different ROMs, contrasts, or 
battery powers.
2)little flicker

  It'll work on any size area too, a 3 level graysprite might look like 
this:

Circle:
.db %00011000
.db %00101100
.db %01010110
.db %10101011
.db %10000001
.db %01000010
.db %00100100
.db %00011000

.db %00011000
.db %00110100
.db %01101010
.db %11010101
.db %10000001
.db %01000010
.db %00100100
.db %00011000

  The top half of the circle would be gray, the bottom half white, and the 
border black.
  Sam
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

graytest.asm

GRAYTEST.82P