It is currently Tue Dec 18, 2018 3:25 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Sun Sep 23, 2018 3:03 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 4110
I was just watching some gameplay footage of the MSX version of Dragon Quest 2, and was surprised about how they did a great job of getting colorful character graphics on the screen despite the hardware limitations of the MSX.

Let's review the capabilties of the TMS9918 graphics chip (also found in the ColecoVision):
* 1bpp background tiles
* 1bpp sprites, up to 16x16 pixels large
* Each 8x1 pixel chunk of a background tile can pick two different colors.

So the game is drawing big 16x16 black/transparent sprites to black out the characters' shapes, then for the colors of the characters, it is using background tiles with 2 colors per 8x1 chunk. This allows the system to create graphics that look somewhat like a NES, only with two different colors per scanline instead of 3.

You can clearly see this when you look closely at the game's graphics, and count how many colors appear in a 8x1 area.

And amazingly enough, the NES graphics match the MSX graphics very closely. So you can see how hardware restrictions from the MSX affected how the NES version's graphics turned out. Especially look for things like flat horizontal lines.

Attachment:
dq2_msx.png
dq2_msx.png [ 836 Bytes | Viewed 2703 times ]

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Sun Sep 23, 2018 6:38 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20896
Location: NE Indiana, USA (NTSC)
In theory, if graphics use the common subset of MSX and NES capabilities (2 colors per 8x1 pixel sliver, 4 colors per sprite or 16x16 pixel tile), one could compress them to 11 bits per sliver, saving about one-third compared to raw 2bpp.


Top
 Profile  
 
PostPosted: Sun Sep 23, 2018 11:49 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7604
Location: Chexbres, VD, Switzerland
So basically the game uses background to draw sprites ? This sounds like it should have been a major hassle to code, I know what I'm talking about. Also wouldn't a huge black box appears behind the moveable characters if it was done that way ?

There was many variants of the MSX and they had different graphical limitations. I suspect most MSX games, especially ports from NES games, didn't run on the lowest-end earlier released MSX with the TMS9918, but were designed for later versions of the computer with a better chip. Considering how much NES games were ported to MSX I'd be surprised if all of them were running on the very limited TMS9918.

As for Dragon Quest II, it is far from even approaching to using NES graphics to it's limits...


Top
 Profile  
 
PostPosted: Mon Sep 24, 2018 12:32 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7842
Location: Seattle
It's only a problem if you try to do fine scrolling. But if everything just moves 8 pixels at a time (and it does), then you just move the sprite overlay at the same time as you update the tiles in the background.


Top
 Profile  
 
PostPosted: Mon Sep 24, 2018 3:00 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7604
Location: Chexbres, VD, Switzerland
How is it possible that MSX limits to 2 colors + transparent per line ? This makes few sense, as the total amount of possibilities is 3, not a power of two number, which makes it impossible to store efficiently (without ressorting to major hacks). On the other hand, 3 colours + transparent or single colour + transparent makes perfect sense.

PS :
Quote:
It's only a problem if you try to do fine scrolling. But if everything just moves 8 pixels at a time (and it does), then you just move the sprite overlay at the same time as you update the tiles in the background.

I know it might be less a hassle to code, but it's still going to be a hassle to code compared to just moving sprites around.


Last edited by Bregalad on Mon Sep 24, 2018 8:14 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Mon Sep 24, 2018 5:00 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20896
Location: NE Indiana, USA (NTSC)
For background tiles, it's two colors per 8x1-pixel area. For sprites, it's two 1-color sprites overlaid, where the 1-color sprite may specify a different color for each 8x1-pixel area.


Top
 Profile  
 
PostPosted: Mon Sep 24, 2018 9:25 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7842
Location: Seattle
Bregalad wrote:
How is it possible that MSX limits to 2 colors + transparent per line ?
Not 2 colors + transparent. Just two colors.

The datasheet for the TMS9918A explains Graphics 2 mode, which is honestly pretty weird to me, but whatever.

Basically
1- Unlike the NES, the "color tables" apply to the pattern tables, not the name tables. (Regardless of video mode.)
2- In Graphics 2, the color table specifies a unique pair of colors per 8x1 sliver of pattern.

Bregalad wrote:
I know it might be less a hassle to code, but it's still going to be a hassle to code compared to just moving sprites around.
There's no hardware support for scrolling. If you're going to implement any scrolling at all, you have to move all the data in the name table. At that point updating a single X,Y coordinate for a masking sprite is incrementally negligible.

Also, the Sprite Attribute Table is in the same address space as the name table; there's no need to prepare OAM for DMA.


Top
 Profile  
 
PostPosted: Mon Sep 24, 2018 11:14 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7026
Location: Canada
Bregalad wrote:
How is it possible that MSX limits to 2 colors + transparent per line ? This makes few sense, as the total amount of possibilities is 3, not a power of two number, which makes it impossible to store efficiently (without ressorting to major hacks). On the other hand, 3 colours + transparent or single colour + transparent makes perfect sense.

The description confused me for a moment too.

The two colours per line is all in the underlying background tiles. Then there is a rectangular black masking sprite on top to "cut out" the shape. (So underneath the black parts, the background is still just 2 colours per line.)

1 bpp solid + 1 bpp transparent = 3 colours?

Might have been good for the illustration to show what the backgrounds look like under the sprites, maybe blinking on and off with an animated GIF.


Top
 Profile  
 
PostPosted: Mon Sep 24, 2018 2:39 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7842
Location: Seattle
By the way, it turns out it's not a black mask anyway.


Attachments:
dragon-quest-msx-1-layers-animation.gif
dragon-quest-msx-1-layers-animation.gif [ 11.53 KiB | Viewed 2542 times ]
Top
 Profile  
 
PostPosted: Mon Sep 24, 2018 3:17 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 11015
Location: Rio de Janeiro - Brazil
So it's black + another color per line on the background, and 2 single-color sprites on top, is that it?


Top
 Profile  
 
PostPosted: Mon Sep 24, 2018 3:31 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 4110
lidnariq wrote:
By the way, it turns out it's not a black mask anyway.

You're right, and while either solution can achieve the same 3 colors, this means that when 4 16x16 sprites meet in a single scanline, the large solid color is what will flicker, not the mask.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Mon Sep 24, 2018 3:32 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7842
Location: Seattle
A single single-color sprite. Sprites on the TMS9928A are globally 8x8 or 16x16, unlike the 2C02.

And it could be two arbitrary colors per 8x1 sliver in the background, but all the ones I saw used black for one of the two colors.

Dwedit wrote:
this means that when 4 16x16 sprites meet in a single scanline, the large solid color is what will flicker, not the mask.
I assume you mean five sprites?


Top
 Profile  
 
PostPosted: Mon Sep 24, 2018 3:36 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 4110
Must have misread the documentation, thought it was 4 sprites per scanline.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Mon Sep 24, 2018 3:55 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7842
Location: Seattle
It is, but that means that the 5th sprite is what drops out...?


Top
 Profile  
 
PostPosted: Mon Sep 24, 2018 11:29 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7604
Location: Chexbres, VD, Switzerland
So this is even more complicated than I feared.
So backgrounds are not shown under sprites, and are used instead to draw sprites with 2 colours per line (black + another customizable colour). Then a single-colour sprite is used on top of that to add another colour, which makes a total of 2 colours per line + black. Is that correct ?

What looks particularly awful is not the fact there's one less colour per line than on the NES, but the fact the background is solid black behind sprites. This is ugly.

There is many NES games ported to MSX, I wonder how others managed to do this. I think of Gradius, Double Dragon, Vampire Hunter (clone of Castlevania), etc.... Did those have the same limitations as Dragon Warrior II, or were they ported to a superior version of the MSX ?

Final Fantasy in particular has very colorful graphics on MSX; which definitely added colours as opposed to the NES version. Even though the scrolling is still shitty.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group