Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Zoomed sprites on SMS1

Reply to topic
Author Message
  • Joined: 30 Jul 2021
  • Posts: 13
Reply with quote
Zoomed sprites on SMS1
Post Posted: Tue Jun 28, 2022 9:47 pm
I'm trying to use zoomed sprites in a project (mostly to make more work for myself), but I'm noticing that on the SMS1, my sprites always seem to show up in the double-height version.

It looks like you actually need to have a full eight sprites on the scanline to have the first four actually zoom properly, otherwise you get the sprites stretched vertically but not horizontally. Has anyone else noticed this with the SMS1?
Screenshot 2022-06-28 17-37-51.png (67.03 KB)
Screenshot with stretched sprites
Screenshot 2022-06-28 17-37-51.png

  View user's profile Send private message Visit poster's website
  • Joined: 12 Dec 2021
  • Posts: 43
  • Location: Melbourne, Australia
Reply with quote
Post Posted: Wed Jun 29, 2022 3:09 am
Yeah, on the original SMS the sprite doubling only works for the first four sprites in a line. The last four will not be doubled. This was corrected in the SMS II hardware. It's also worth noting that sprite doubling is removed entirely from the MegaDrive backwards compatibility with SMS carts.

From https://www.smspower.org/uploads/Development/msvdp-20021112.txt :

Quote
When bit 0 of register #1 is set, sprite pixels are zoomed to double their size. 8x8 sprites are 16x16, 8x16 sprites become 16x32. There is a bug in how the original SMS VDP processes zoomed sprites compared to the SMS 2 and GG VDP; it will only allow the first four sprites of the eight shown on a scanline to be zoomed horizontally and vertically, and the remaining four will be zoomed vertically. The SMS 2 and GG allow all eight sprites to be zoomed in both directions.

In my opinion, this problem comes from the original TMS9918 which also supported zoomed sprites but only allowed four sprites to be shown per scanline. Perhaps the designers of the SMS VDP forgot to add 'horizontal zoom' flags to the extra four sprites they added, which is why only four of the eight sprites are affected.
  View user's profile Send private message
  • Joined: 29 Mar 2020
  • Posts: 5
Reply with quote
Post Posted: Wed Jun 29, 2022 3:18 am
Is there any games that you could not play on an SMS1 ? Interested in testing them
  View user's profile Send private message
  • Joined: 30 Jul 2021
  • Posts: 13
Reply with quote
Post Posted: Wed Jun 29, 2022 3:36 am
darkowl wrote
Yeah, on the original SMS the sprite doubling only works for the first four sprites in a line. The last four will not be doubled. This was corrected in the SMS II hardware. It's also worth noting that sprite doubling is removed entirely from the MegaDrive backwards compatibility with SMS carts.


Yeah I have read that document-- I was just noticing that on my SMS1 the behavior differs from that, in that screenshot I have no other sprites on the scanline except for those that make up the character, but the sprites are still stretched. Adding blank sprites so that there are a full eight sprites on the scanlines where I want double-sized sprites makes the four good ones work.

And yes double-sized sprite mode is pretty much useless due to all its limitations, here I could pre-double-size them myself and work on all SMS models without issue (except for wasting a bit more VRAM)...
  View user's profile Send private message Visit poster's website
  • Joined: 23 Jan 2010
  • Posts: 414
Reply with quote
Post Posted: Wed Jun 29, 2022 9:41 am
This problem could be solved with a mapper ou would be a eternal condemnation?
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3762
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Wed Jun 29, 2022 1:28 pm
Nicole Express wrote
Yeah I have read that document-- I was just noticing that on my SMS1 the behavior differs from that, in that screenshot I have no other sprites on the scanline except for those that make up the character, but the sprites are still stretched. Adding blank sprites so that there are a full eight sprites on the scanlines where I want double-sized sprites makes the four good ones work.


This is pretty weird! I suspect when it doesn't work properly you have offscreen/invisible sprites on the same scanlines and coming first in the SAT order, but then if you place more sprites you move those around in the SAT order and you get the first 4 working properly...
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3762
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Wed Jun 29, 2022 1:29 pm
segarule wrote
This problem could be solved with a mapper ou would be a eternal condemnation?


no mapper can solve this, the zoom feature is bugged on the first revision VDP so you either don't use it or you have to be creative and workaround the limitations...
  View user's profile Send private message Visit poster's website
  • Joined: 23 Jan 2010
  • Posts: 414
Reply with quote
Post Posted: Wed Jun 29, 2022 7:44 pm
sverx wrote
segarule wrote
This problem could be solved with a mapper ou would be a eternal condemnation?


no mapper can solve this, the zoom feature is bugged on the first revision VDP so you either don't use it or you have to be creative and workaround the limitations...

Thanks for you dont be harsh with my very noob question. Im ever learning with Maxim´s, Calindro, your and other posts about hardware. I was wondering if in some way, for example a mapper, could turn 'horizontal zoom' flags left active/on in SMS1 . But if not, thanks for your clarification.
  View user's profile Send private message
  • Joined: 30 Jul 2021
  • Posts: 13
Reply with quote
Post Posted: Wed Jun 29, 2022 10:17 pm
segarule wrote
Thanks for you dont be harsh with my very noob question. Im ever learning with Maxim´s, Calindro, your and other posts about hardware. I was wondering if in some way, for example a mapper, could turn 'horizontal zoom' flags left active/on in SMS1 . But if not, thanks for your clarification.

This is a bug inside the VDP itself unfortunately, so external accesses can't fix it.

Not that it matters that much since the feature doesn't even work on the Power Base Converter. I wonder what systems are most used by people playing the Master System these days...
  View user's profile Send private message Visit poster's website
  • Joined: 17 Sep 2013
  • Posts: 128
  • Location: Gravataí, RS, Brazil
Reply with quote
Post Posted: Thu Jun 30, 2022 2:24 am
Nicole Express wrote
darkowl wrote
Yeah, on the original SMS the sprite doubling only works for the first four sprites in a line. The last four will not be doubled. This was corrected in the SMS II hardware. It's also worth noting that sprite doubling is removed entirely from the MegaDrive backwards compatibility with SMS carts.


Yeah I have read that document-- I was just noticing that on my SMS1 the behavior differs from that, in that screenshot I have no other sprites on the scanline except for those that make up the character, but the sprites are still stretched. Adding blank sprites so that there are a full eight sprites on the scanlines where I want double-sized sprites makes the four good ones work.

And yes double-sized sprite mode is pretty much useless due to all its limitations, here I could pre-double-size them myself and work on all SMS models without issue (except for wasting a bit more VRAM)...


I also notice that in my previous project (https://www.smspower.org/forums/18983-MixingVideoModesMostlyOnMegaDrive#120575).

I used the collision flag on zoomed sprites to determine witch revision of the VDP I was running (SMS1, SMS2 or Genesis).Turns out, in my experience the behaviour of zommed sprites on SMS1 is diferent.If I remember correctly, it's not the first four on a scanline that are propertly zoomed. t's the first sprites after four that are:
If there are 5 sprites on a scanline, the first one will be zoomed correclty, If there are 6, the first two, and so on.

There is also a bug on my rom in that project, I was forcing the test to Genesis in some situations.
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3762
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Thu Jun 30, 2022 7:02 am
Last edited by sverx on Thu Jun 30, 2022 7:10 am; edited 2 times in total
gvx32 wrote
I used the collision flag on zoomed sprites to determine witch revision of the VDP I was running (SMS1, SMS2 or Genesis).Turns out, in my experience the behaviour of zommed sprites on SMS1 is diferent.If I remember correctly, it's not the first four on a scanline that are propertly zoomed. t's the first sprites after four that are:
If there are 5 sprites on a scanline, the first one will be zoomed correclty, If there are 6, the first two, and so on.


As far as I can tell, this doesn't match with what I observed, even if it seems to match with what Nicole observed.

In SMS Test Suite I'm testing the collision flag with zoomed sprites to determine the VDP version too. [What's not well known is that there's a bug on the collision flag too which I stumbled upon while coding the test suite which makes the zoomed sprites NOT collide even when overlapped vertically]
What I do is to place 6 sprites on the same scanline. The first 5 are horizontally evenly spaced at 16 pixels and the 6th sprite is only 15 pixels to the right of the 5th.
Since the bug affects the 5th sprite (and the 6th too, but that's not interesting) horizontally, you don't get the 5th sprite collide with the 6th on a first revision VDP.

You can check my detection routine here.
Let me know if you find a bug! :)

edit: oh, wait, I just realized it would work even with your description. So bad I don't have a first revision SMS to test myself!
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3762
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Thu Jun 30, 2022 7:07 am
segarule wrote
Thanks for you dont be harsh with my very noob question.


I didn't mean to be harsh at all, sorry if it sounded so, I'm not a native speaker and I just try to do my best.
  View user's profile Send private message Visit poster's website
  • Joined: 23 Jan 2010
  • Posts: 414
Reply with quote
Post Posted: Thu Jun 30, 2022 9:45 am
sverx wrote
segarule wrote
Thanks for you dont be harsh with my very noob question.


I didn't mean to be harsh at all, sorry if it sounded so, I'm not a native speaker and I just try to do my best.

No. On the contrary, your words were friendly, even my question being noob. Thanks for not have been harsh with my question. BTW i have other question. I was playing your homebrew, Waimanu, in my original SMS1. When i complete the stage sucessfully the penguin celebrate at end and it seems zoomed in emulator - Fusion - but not in my SMS1. We are treating typically of VDP bug in zoomed sprites in SMS1´s VDP?
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3762
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Thu Jun 30, 2022 10:05 am
LOL I was thinking about asking someone to perform that exact test for me! Thank you so much for that!

Waimanu is supposed to zoom (I detect if it's a MegaDrive to avoid that) in the second half of the celebration animation. As I never had a first revision SMS I couldn't try that on that specific hardware, so I supposed that since I was using only a few sprites I would not incur in the famous bug.

TIL - years later!
  View user's profile Send private message Visit poster's website
  • Joined: 17 Sep 2013
  • Posts: 128
  • Location: Gravataí, RS, Brazil
Reply with quote
Post Posted: Fri Jul 01, 2022 2:25 am
Last edited by gvx32 on Fri Jul 01, 2022 12:23 pm; edited 1 time in total
Just a confirmation of what I said previously.
I modified my rom to show the sprites of the VDP revision test, and by the way they appear, there is no doubt that the behaviour I described is correct. You can skip the test by pressing any button (Also, ryu's animation is not working, I don't no why, but I can assure that you still can send data to the VDP as fast as you like while in text mode).
VdpMapper.zip (9.62 KB)
Sprites testing debug

  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3762
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Fri Jul 01, 2022 6:41 am
gvx32 wrote
Just a confirmation of what I said previously.
I modified my rom to show the sprites of the VDP revision test, and by the way they appear, there is doubt that the behaviour I described is correct.


can you share a picture too?
  View user's profile Send private message Visit poster's website
  • Joined: 17 Sep 2013
  • Posts: 128
  • Location: Gravataí, RS, Brazil
Reply with quote
Post Posted: Fri Jul 01, 2022 11:47 am
sverx wrote
gvx32 wrote
Just a confirmation of what I said previously.
I modified my rom to show the sprites of the VDP revision test, and by the way they appear, there is doubt that the behaviour I described is correct.


can you share a picture too?


Sure.
The test runs in two steps.
In the first step, sprite zero have a Y's coordinate of 32. If the sprite collision flag is detected here, than we already know that the VDP is a SMS2.
In the second step, sprite zero is put at a Y's coordinate of zero. The sprite collision flag than will decide if the vdp is of a Genesis or a SMS1.

edit: just saw my previous post. When I said "there's doubt", I meant "there's no doubt". Already corrected there.
IMG_20220701_083158306.jpg (600.5 KB)
Picture.
IMG_20220701_083158306.jpg

  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3762
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Sat Jul 02, 2022 9:36 am
To check if the VDP has no sprite zoom capability at all, I just put two 8×8 zoomed sprites one above (Y) the other offset by 15 pixels so that they should collide both on SMS and SMSII but not on Genesis/MD (any offset 9 to 15 pixels would work btw)

Then, to further check if it's a first or a second revision VDP, you need more sprites of course.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3762
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Wed Jul 06, 2022 2:01 pm
I just realized that even that could be done just by checking two zoomed sprites only, as they would overlap if 8 pixels apart horizontally only on an SMSII
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!