Please help consolidate Megadrive info for pixel artists

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Post Reply
Bitbeam
Newbie
Posts: 3
Joined: Thu May 18, 2017 6:33 pm

Please help consolidate Megadrive info for pixel artists

Post by Bitbeam » Tue May 30, 2017 1:26 pm

Hi everyone. I'm a long time pro pixel artist (and also Genesis/Megadrive fan) and I'm working on rounding up concise and clear (artist friendly) info to help pixel artist who want to make authentic moc-ups and game art for the Megadrive. (I'm also doing this for all the other popular classic consoles.)

I want to create as clear and concise a document as possible (for artists) where every sentence offers definitive guidance for exactly what rules and limits to follow, without drowning, confusing or intimidating artists with lots of technical jargon.

The final document will eventually be a web page, with attached images, animations, examples, and links to communities like this, and also special thanks to anyone who helped improve or confirm or clarify any of the information. This information will also be distributed with the industry standard pixel art program, so It's my hope this will encourage and entice many of today's best pixel artists to fall in love with developing art and games for the Megadrive.


Here's (below) what I have so far. Can anyone who's interested please suggest edits, additions and provide the critical missing info?

One thing I know I really need to add is proper instructions for that special darken and brighten mode the Megadrive had which could darken parts of the screen or brighten. Does anyone know how we artists should approach using/representing this feature? Firstly, what is the exact math used by the Megadrive to do the darkening and the brightening. Secondly, does this work over both background layers and sprites at the same time? Thirdly, can artists paint directly using those darkened and lightened versions of the colors, or only create monochrome overlays to effect the underlying graphics, similar to having layers in Photoshop set to screen and multiply mode?


_____________________________________________________________________________________________________________________________________________________________________




Sega Megadrive/Genesis

Graphical summary


Standard game resolution: 320x224 or 256x224

color range: The Megadrive uses 3 bits per color channel, providing a palette of 512 colors.

Number of color indexes available: Typically 64 indexes used, broken into four 16 color palettes. The first color index of each 16 color palette is always used for transparent/

Background graphics color limitations:
The Megadrive allows for 2 scrolling layers, 1 sprite layer, and one non scrolling “window” layer typically used for the games HUD (life bars, score etc.). Each scrolling layer is made of 8x8 pixel tiles. Each tile can be 16 colors, using one of any of the 4 available 16 color palettes.

Unlike 8 bit consoles, there is not a fixed number of unique tiles that can be used, as you can store tile images in any part of available vram.
The number of background tiles can range from 64 to 1808 tiles

Background tiles CAN be flipped horizontally or vertically OR BOTH at the same time!

On top of the 2 separate background layers, either of them can be individually sliced horizontally in order to add even more parts of the background scrolling at separate speeds to create the illusion or dept in scrolling games.


Sprites

Sprites: The Megadrive can display 20 fifteen color (plus a “clear” index for transparent pixels) sprites per scan line (row of pixels on screen).
Each sprite can use any of the four 16 color palettes, with the first color index of each 16 color palette being used for transparent pixels.

80 sprites on screen in total, but any more than 20 per scan line will result in some sprites not being displayed.

Each sprite can be set to any combination of the following dimensions for either width and height separately: 8,16,24 and 32 pixels, resulting in 16 different possible sprite sizes. Each sprite can be set to its own dimensions (from these options) regardless of the size settings for the other sprites. Making the sprites larger than 8x8 does not reduce the possible number of on-screen sprites or number of sprites per scan line BUT once 320 pixels of sprite data are drawn per scan line, no more sprites will be drawn on that scan line.

Up to 1280 tiles can be dedicated to sprites, separate from the background tiles.

Sprites can be horizontally or vertically flipped or both at the same time!

For more detailed technical references:
http://md.squee.co/VDP
https://emudocs.org/Genesis/Graphics/genvdp.txt
http://www.genny4ever.net/index.php?page=docs
http://segaretro.org/Sega_Mega_Drive
___________________________________________________________________________________________________________________________________________________________________

Thanks so much for your time, any help would be greatly appreciated.

Hik
Very interested
Posts: 62
Joined: Thu Jul 30, 2015 11:39 pm
Location: Iceland

Re: Please help consolidate Megadrive info for pixel artists

Post by Hik » Tue May 30, 2017 1:59 pm

On PAL systems the resolution could be 320x240 but I'm just using 320x224,
about the 256x224 one, haven't seen that used but suppose you could use anything smaller than 320x224 (in tiles) safely.
(I don't think you can do half tile resolution or something so I mean size in tiles)

The shadow/highlight modes are pretty limited, there's a thread here which explains it somewhat;
viewtopic.php?f=19&t=2561&p=30803&hilit ... ght#p30803

You can also use the search function to find threads which often contain some helpful information.

User avatar
Flygon
Very interested
Posts: 60
Joined: Mon Sep 28, 2009 11:26 am
Contact:

Re: Please help consolidate Megadrive info for pixel artists

Post by Flygon » Wed May 31, 2017 2:15 am

A lot of software used the 256-wide mode. Shining Force is the first series to come to mind. I'm actually quite curious as to if anyone's tested out seeing if the pixels are the same shape with 256-wide mode stretched to a 4:3 aspect ratio, as 320-wide mode stretched to 16:9.

Close enough pixel ratios would very well allow somewhat 'easy' implementation for widescreen games, assuming all of the game's artwork is drawn for the anamorphic aspect ratio. :o

User avatar
flamewing
Interested
Posts: 38
Joined: Tue Sep 23, 2014 2:39 pm
Location: France

Re: Please help consolidate Megadrive info for pixel artists

Post by flamewing » Wed May 31, 2017 5:45 am

The VDP takes the same amount of time to render both 256 and 320 pixel lines. This means that if you draw in 256 pixel width and stretch to 320 pixels (keeping the same height), you will get the right results.

Drawing anamorphic images (if your program supports it) will also work, and will allow you to tune the output better.

But why would you want to stretch the 320-wide image to 16:9 ratio?

User avatar
Flygon
Very interested
Posts: 60
Joined: Mon Sep 28, 2009 11:26 am
Contact:

Re: Please help consolidate Megadrive info for pixel artists

Post by Flygon » Thu Jun 01, 2017 11:47 am

flamewing wrote:But why would you want to stretch the 320-wide image to 16:9 ratio?
So that you can crop 32px from each side of the screen, and render the scene for 4:3 displays using the 256-wide mode. You use the exact same art assets for both 4:3 and 16:9 modes. Compatibility with both types of TV.

Or so the theory goes.

It's sure as hell a lot cleaner than designing the game to switch between using 224/240 lines, or only 176ish for TVs that crop a letterboxed image to widescreen. :)

User avatar
TmEE co.(TM)
Very interested
Posts: 2285
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Re: Please help consolidate Megadrive info for pixel artists

Post by TmEE co.(TM) » Thu Jun 01, 2017 12:20 pm

I suppose the most important thing is that the RGB color levels are not linear.
This thread has all the relevant info about the video output : viewtopic.php?f=22&t=2188
Unlike 8 bit consoles, there is not a fixed number of unique tiles that can be used, as you can store tile images in any part of available vram.
The number of background tiles can range from 64 to 1808 tiles

Up to 1280 tiles can be dedicated to sprites, separate from the background tiles.
VRAM can hold up to 2048 tiles, but VRAM also holds tilemaps, line scroll table and sprite list, some of which have size depending on current configuration.

Sprite list is 512 bytes (16 tiles) in size in H256 and 640 bytes (20 tiles) in H320. Line scroll table is 4 bytes (1/8th of a tile) in full screen scroll and 896 bytes (28 tiles) in V224/V448 and 960 bytes (30 tiles) in V240/V480 in the other modes (column scroll actually has gaps between entries and few bytes less in the end but those gaps are not usable for GFX tiles).

Tilemaps sizes available and how much space and tiles they use :
32x32 (2KB, 64 tiles)
32x64 (4KB, 128 tiles)
32x128 (8KB, 256 tiles)
64x32 (4KB, 128 tiles))
64x64 (8KB, 256 tiles)
128x32 (8KB, 256 tiles)
32x1 (64 bytes, 2 tiles)

Both A and B layer share size, you cannot have A with 32x32 and B with 128x32.

The window layer is fixed to 32x28/30 in H256 and 64x28/30 H320 and you can freely use the unused parts for tiles. You can put one extra tile in the offscreen rows in the window tilemap in H320 (actually 1.5). One row takes 2 tiles in H256 and 4 tiles in H320 (of which 1.5 tiles can be used for other purposes). Window layer also replaces A layer whereever there's W, the two cannot coexist in same place. The implication is you cannot really have holes in the window, because you'll have B layer showing through of them, there isn't gonna be any W on top, then A then B, only W and B as W replaced A in that spot.

To get amount of tiles both BGs and sprites can use, subtract the number of tiles the current configuration needs from 2048.
In a typical config where A and B are 64x32 bytes in size and not overlapping, W is not used, H320 with linescroll you get :
2048 - 20(sprites) - 28(scroll) - 128(A tilemap) - 128(B tilemap) = 1744 tiles for sprites and BGs.
Most hostile config (H320+V240 with linescroll and W that covers all rows, max tilemap size):
2048 - 20(sprites) - 30(scroll) - 256(A) - 256(B) - 30*4=120(W) = 1366

Sprites and BGs can use any tile in VRAM to show stuff (including the non GFX tiles, but that's not useful unless you want to show garbage), there is no 1280 tiles that sprites can use, they can use all 2048 like BGs can. Only thing that matters is sprite tiles ordering in VRAM for different sprite sizes. Sprites use column first then next row approach so you get this kind of arrangement when the tiles are 0123456789ABCDEF order in VRAM :

Code: Select all

x  8 16 24  32
 
8  0 01 012 0123

16 0 02 024 0246
   1 13 135 1357

24 0 03 036 0369
   1 14 147 147A
   2 25 258 258B

32 0 04 048 048C
   1 15 159 159D
   2 26 26A 26AE
   3 37 37B 37BF
Top to bottom is vertical size, left to right is horizontal size and the grid shows the tile ordering that make up the 8x8 to 32x32 sprite.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Bitbeam
Newbie
Posts: 3
Joined: Thu May 18, 2017 6:33 pm

Re: Please help consolidate Megadrive info for pixel artists

Post by Bitbeam » Thu Jun 01, 2017 6:12 pm

Fantastic info! Thanks everyone!

User avatar
flamewing
Interested
Posts: 38
Joined: Tue Sep 23, 2014 2:39 pm
Location: France

Re: Please help consolidate Megadrive info for pixel artists

Post by flamewing » Fri Jun 02, 2017 6:07 am

Flygon wrote:So that you can crop 32px from each side of the screen, and render the scene for 4:3 displays using the 256-wide mode. You use the exact same art assets for both 4:3 and 16:9 modes. Compatibility with both types of TV.

Or so the theory goes.
At least as far as of consoles go, the "theory" is wrong on every count if you are going for authentic mockups: the MD, for example, renders 320- and 256-pixel wide lines with the same physical lenght: they images produced have the same physical aspect ratio, even though they have different logical lengths (number of pixels per line) and aspect ratio. Unless you use a modern TV to force the output to a different aspect ratio, you won't ever see a screenshot like what you describe being produced by a MD.

Miquel
Very interested
Posts: 181
Joined: Sat Jul 30, 2016 12:33 am

Re: Please help consolidate Megadrive info for pixel artists

Post by Miquel » Fri Jun 02, 2017 9:54 am

Bitbeam wrote: Number of color indexes available: Typically 64 indexes used, broken into four 16 color palettes. The first color index of each 16 color palette is always used for transparent/
There is also the background colour. An alternative (not perfect) way to see it: the most background plane/layer has 16 visible colours.

This colour is always at the most distant background, regardless priority.
Confused? Just ask!

User avatar
TmEE co.(TM)
Very interested
Posts: 2285
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Re: Please help consolidate Megadrive info for pixel artists

Post by TmEE co.(TM) » Fri Jun 02, 2017 10:51 am

flamewing wrote:At least as far as of consoles go, the "theory" is wrong on every count if you are going for authentic mockups: the MD, for example, renders 320- and 256-pixel wide lines with the same physical lenght: they images produced have the same physical aspect ratio, even though they have different logical lengths (number of pixels per line) and aspect ratio. Unless you use a modern TV to force the output to a different aspect ratio, you won't ever see a screenshot like what you describe being produced by a MD.
Lines having same timing is why it would work, it all boils down to pixel width to height ratio. H256 in 4:3 vs H320 in 16:9 only has about 6% difference in pixel dimensions (H320 in 16:9 giving slightly wider pixels compared to H256 in 4:3), which is probably small enough that you need no compensation in art between the two modes and that's the main appeal.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Trihook
Newbie
Posts: 5
Joined: Sun May 01, 2016 7:22 am

Re: Please help consolidate Megadrive info for pixel artists

Post by Trihook » Wed Jun 07, 2017 1:49 pm

I made a similar thread here some time ago, maybe it can be helpful to you:
viewtopic.php?t=2438

Bitbeam
Newbie
Posts: 3
Joined: Thu May 18, 2017 6:33 pm

Re: Please help consolidate Megadrive info for pixel artists

Post by Bitbeam » Wed Jun 07, 2017 3:13 pm

Trihook wrote:I made a similar thread here some time ago, maybe it can be helpful to you:
viewtopic.php?t=2438
Thanks. It does help. cheers.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest