Megadrive Maps

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Post Reply
MintyTheCat
Very interested
Posts: 484
Joined: Sat Mar 05, 2011 11:11 pm
Location: Berlin, Germany

Megadrive Maps

Post by MintyTheCat » Wed May 25, 2011 7:18 pm

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.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed May 25, 2011 8:36 pm

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.

MintyTheCat
Very interested
Posts: 484
Joined: Sat Mar 05, 2011 11:11 pm
Location: Berlin, Germany

Post by MintyTheCat » Thu May 26, 2011 6:03 pm

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!

GreenLine
Interested
Posts: 17
Joined: Tue May 10, 2011 3:42 pm

Post by GreenLine » Thu May 26, 2011 8:59 pm

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.

Post Reply