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 - SMS2 VDP 224/240-line modes

Reply to topic
Author Message
  • Joined: 18 Sep 1999
  • Posts: 498
  • Location: Portland, Oregon USA
Reply with quote
SMS2 VDP 224/240-line modes
Post Posted: Fri Feb 24, 2006 12:56 am
Does anyone know which (commercial) games use the SMS2 VDP 224- and 240-line modes?

Also, Charles MacDonald's SMS VDP document may have an error in it. From Section 9, Horizontal Scrolling:

Quote
Most video display hardware will show part of the column that appears in the left 1-7 pixels of the display as the fine scroll value is increased (such as the NES, Genesis, TurboGrafx-16). However, the SMS VDP does not, and instead this area is filled with the backdrop color (and sometimes pattern data from sprite #0, but exactly how this is selected is unknown).


I believe Charles once informed me that palette entry 0, not the backdrop color (from vreg 7), is used to fill the 1-7 pixel area on the left side of the screen. Charles, can you confirm this one way or the other? The SMS1 VDP in MesaDX currently uses palette entry 0, not the backdrop color.

Thanks.

--
Eric R. Quinn
  View user's profile Send private message Visit poster's website
  • Joined: 28 Sep 1999
  • Posts: 1197
Reply with quote
Post Posted: Fri Feb 24, 2006 1:48 am
Quote
I believe Charles once informed me that palette entry 0, not the backdrop color (from vreg 7), is used to fill the 1-7 pixel area on the left side of the screen. Charles, can you confirm this one way or the other? The SMS1 VDP in MesaDX currently uses palette entry 0, not the backdrop color.


Yes, it's background color #0 that's shown, and not the backdrop color. I'll double check again, but I'm quite sure that's correct and the document hadn't been updated properly. Oops!

If you end up compiling a list of which games use the extended screen modes, I'll add those too. Cosmic Spacehead, Fantastic Dizzy, and Micro Machines (all Codemasters games) all use the 224-line mode.

I think earlier versions of GGT used them, for the advantage of having a 32x32 name table. Maybe Martin can comment if that's correct or not, I can't exactly remember.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Fri Feb 24, 2006 9:28 am
Both Star Trek games on the Game Gear uses 256x224 video mode.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Jan 2006
  • Posts: 36
Reply with quote
Post Posted: Fri Feb 24, 2006 10:25 am
Ok this might be the place to ask the questions that have been on my mind lately (and was going to ask anyway)

1. When I last looked Charles Macdonald's VDP documentation and the SMS Power Wiki disagree on the mode bits required to enable these extented modes. Which is correct? I'm not 100% up on the subject but I think the Wiki says that M2 or M3 needs to be set and Charles' document says that M1 and M2 or M3 would be needed. (Please interchange numbers as required). So is M1 ignored on say an SMS2?

2. What happens when an extended screenmode is enabled mid-frame? Does the VDP continue to the end of the frame and then update for the next (like the vertical scroll), or does the update happen there and then? I'm about to add extended mode support to my emulator to get Fantastic Dizzy and those other Codemasters titles running properly and this information would be quite useful. I don't think this is covered in Charles' documentation.

3. This might have been covered elsewhere in some depth but I'll ask anyway. How does the GG handle the 224 line display?

Sorry once again.
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14688
  • Location: London
Reply with quote
Post Posted: Fri Feb 24, 2006 10:35 am
The wiki is unclear (notice the not-written-page link to "VDP.Modes") - you need both the extra height enable bit set (M2) and the extra height mode selection (M1/M3) to enable extra height modes on all SMS/GG VDPs.

The GG screen is reportedly more "full" in SMS mode GG games when the 224-line mode is used (no black bars). I don't know what it does in GG mode.

I'd imagine that changing the settings mid-screen wouldn't take effect until the next frame, given that the VDP avoids checking anything per-line if it can avoid it. I wouldn't have thought that any game actually does this, since the screen should be turned off while changing this kind of thing.
  View user's profile Send private message Visit poster's website
  • Joined: 04 Nov 2004
  • Posts: 273
Reply with quote
Post Posted: Fri Feb 24, 2006 11:38 am
Of course Charles is correct about GGT using the 224-line mode.
  View user's profile Send private message Visit poster's website
  • Joined: 28 Sep 1999
  • Posts: 1197
Reply with quote
Post Posted: Fri Feb 24, 2006 5:28 pm
Quote
2. What happens when an extended screenmode is enabled mid-frame? Does the VDP continue to the end of the frame and then update for the next (like the vertical scroll), or does the update happen there and then? I'm about to add extended mode support to my emulator to get Fantastic Dizzy and those other Codemasters titles running properly and this information would be quite useful. I don't think this is covered in Charles' documentation.


The video hardware checks the screen height at several points in the display. Depending on which scanline you make the change, you can fool it into disabling blanking and even remove the vertical sync period. I think I was able to make 256 of 263 scanlines visible by carefully switching modes at different lines, though you have to use the vertical hold control on your monitor to see it all.

If you really want to support this kind of thing, I can try to figure out the exact points where the mode settings matter and determine what happens.

Quote
3. This might have been covered elsewhere in some depth but I'll ask anyway. How does the GG handle the 224 line display?


The 224/240 line modes work the same as they do on the SMS; the only difference is that the resolution does not change (the 160x144 window is at the same offset). So the frame interrupt position changes, the name table is 32x32, sprite table goes on a $700 byte boundary, etc.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Jan 2006
  • Posts: 36
Reply with quote
Post Posted: Fri Feb 24, 2006 7:39 pm
Quote

The video hardware checks the screen height at several points in the display. Depending on which scanline you make the change, you can fool it into disabling blanking and even remove the vertical sync period. I think I was able to make 256 of 263 scanlines visible by carefully switching modes at different lines, though you have to use the vertical hold control on your monitor to see it all.


Sounds cool. I was just interested because it doesn't say in your documentation when a requested change in mode is processed. From an implementation standpoint I'd ideally like to be able to get away with as few changes to the application window size as possible (i.e at the end of the frame). For accuracy you'd want to get the hardware spot on. I guess it would be a nice thing to know.

Thanks very much.
  View user's profile Send private message
  • Joined: 23 Sep 2021
  • Posts: 96
  • Location: Poland
Reply with quote
Post Posted: Tue May 02, 2023 10:29 am
I would like to make sure - is it possible to run the SMS rom in 240 Line mode on Sega GG?
I wrote a simple demo for testing and it doesn't run on GG (works on PAL SMS II of course).

  View user's profile Send private message Visit poster's website
  • Joined: 25 Jul 2007
  • Posts: 716
  • Location: Melbourne, Australia
Reply with quote
Post Posted: Tue May 02, 2023 2:48 pm
I've already tested this out, 240 line mode does not work on GG (results in a freeze)
  View user's profile Send private message
  • Joined: 24 Mar 2021
  • Posts: 120
Reply with quote
Post Posted: Tue May 02, 2023 6:00 pm
The CPU freezes and only power cycling fixes it? The screen stops updating?

Does anyone have one of the earlier models of GG where it looks like there's access to the 50/60Hz jumper? Has anyone played with that?
  View user's profile Send private message
  • Joined: 23 Jan 2010
  • Posts: 417
Reply with quote
Post Posted: Tue May 02, 2023 6:53 pm
Quote
I would like to make sure - is it possible to run the SMS rom in 240 Line mode on Sega GG?

I want the inverse. A 224 line game running in192 line ie a codemasters games running in SMS old vdp. I dont understood the chart. My fault is vero:
Here's a list of all possible display modes:

M4 M3 M2 M1 SMS VDP SMS 2 / GG VDP
-- -- -- -- ---------- -------------------------
0 0 0 0 Graphic I Graphic I
0 0 0 1 Text Text
0 0 1 0 Graphic 2 Graphic 2
0 0 1 1 Mode 1+2 Mode 1+2
0 1 0 0 Multicolor Multicolor
0 1 0 1 Mode 1+3 Mode 1+3
0 1 1 0 Mode 2+3 Mode 2+3
0 1 1 1 Mode 1+2+3 Mode 1+2+3
1 0 0 0 Mode 4 Mode 4
1 0 0 1 Invalid text mode Invalid text mode
1 0 1 0 Mode 4 Mode 4
1 0 1 1 Invalid text mode Mode 4 (224-line display)
1 1 0 0 Mode 4 Mode 4
1 1 0 1 Invalid text mode Invalid text mode
1 1 1 0 Mode 4 Mode 4 (240-line display)
1 1 1 1 Invalid text mode Mode 4

For the undocumented TMS9918 modes, I used the same naming convention
as in Sean Young's TMS9918 documentation.

To summarize from the above chart, for the SMS 2 and GG VDP only, the M1 and
M3 bits select the display resolution only when M2 is set. If both bits are
set, the regular 192-line display is used. If M2 is cleared, then M3 has no
effect and M1 will select the invalid text mode.

The invalid text mode is identical to TMS9918 text mode. It uses CRAM for
colors instead of using a fixed palette and register #7 for selecting the
text color. Each tile is repeated four times on the display, which limits
the usefulness of this mode. Scrolling only moves the tile graphics
around within their 6x8 cells, the actual position in the name table is not
changed. If bit 7 of register #0 is set, columns 0-23, 32-39 can scroll
vertically while columns 24-31 do not. If bit 6 of register #1 is set,
rows 0 and 1 will not scroll horizontally. Finally, setting the horizontal
scroll to values of 6 or 7 will cause each tile to be filled with the
backdrop color.

If the GameGear is in GG mode, it's resolution is fixed and does not
change when the extended resolutions are used. However, the differences
in sprite and background processing are still used. (e.g. end of sprite
list marker doesn't work, background starts at $0700 offsets, etc.)


Looking the chart i understood that a "VDP 2" use bits 1011 for 224 line and i would need enable 1000 or 1010 for 192 mode but
the M1 and M3 bits select the display resolution only when M2 is set. If both bits are
set, the regular 192-line display is used. If M2 is cleared, then M3 has no
effect and M1 will select the invalid text mode.
Im confused about that bits need set to 192 considering that M2 need is set.
  View user's profile Send private message
  • Joined: 23 Sep 2021
  • Posts: 96
  • Location: Poland
Reply with quote
Post Posted: Sun Feb 25, 2024 3:14 pm
The 32x30 (240 Line) mode takes up 1920 Bytes of screen memory - so there is only 128 Bytes left for Sprites, right? Using mode 240 reduces the number of Sprites to 32 instead of 64? Correct?
  View user's profile Send private message Visit poster's website
  • Joined: 06 Mar 2022
  • Posts: 597
  • Location: London, UK
Reply with quote
Post Posted: Sun Feb 25, 2024 3:55 pm
The sprite attribute table can be moved basically anywhere in VRAM using register 5, so the extra screen map space needed doesn't necessarily need to impinge on SAT space. You can sacrifice tile space to maintain a usable 256 byte SAT.
  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!