Page 1 of 1

Megadrive Maps

Posted: Wed May 25, 2011 7:18 pm
by MintyTheCat
Hello,

I do not understand the Megadrive's map format.
could some one direct me to a source of information that I can use or perhaps offer a quick explanation/example please?

Failing that does anyone know which Megadrive Emulator has available sourcecode?

Thanks.

Posted: Wed May 25, 2011 8:36 pm
by Chilly Willy
It's just "standard" character mode graphics - each value in the map is not a pixel, it's an index into a table of tiles/characters. The tile itself defines a block of 8x8 pixels. So the map is a rectangle of these values - typically 64x32 or 64x64, of which 40x28 define a screen of 320x224 pixels (40x8)x(28x8). The map is larger than the display so you can scroll the display.

Each value is two bytes; the bits contain the index into the tiles, the color palette to use for the selected tile, two bits to specify flipping the tile horizontally and/or vertically, and a priority bit. If you are familiar with PC character modes, think of it like the character and attributes.

Posted: Thu May 26, 2011 6:03 pm
by MintyTheCat
Many thanks for the guidance Chilly.

I remember learning C many many years ago under Borland Turbo C but never did any Graphic programming under DOS, I had an Amiga for graphics :)

I am looking into DOS Character Mode programming now...

Thanks!

Posted: Thu May 26, 2011 8:59 pm
by GreenLine
DOS character mode is a very good example. By redefining some characters (=tiles) it was possible to obtain interesting results even in text mode:

Image

BTW a quick explanation of the tile system for Pacman can be found here:

http://aarongiles.com/mamemem/part3.html

With small variations, that's the same idea used in hundreds of arcade systems and consoles.