Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Discussion about displays and related hardware including MiSTer filters and video settings.
AmintaMister
Posts: 277
Joined: Thu Sep 16, 2021 10:54 pm
Has thanked: 720 times
Been thanked: 44 times

Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by AmintaMister »

Hi guys!

I own a Mister Fpga (this model: https://ultimatemister.com/product/ulti ... -blisster/) and I've connected it to mine Philips Cm8833 CRT monitor with a MiSTer VGA to RGB Scart Cable.

So far, so good. Being owner of many original retro machines, today I've tried to compare the Sega Master System Core output with my original Sega Master System attached to the same monitor via RF.

The game is the PAL version of Alex Kidd in Miracle World.

Here you can spot the difference:

MISTER
IMG_8636.jpeg
IMG_8636.jpeg (163.05 KiB) Viewed 5511 times

ORIGINAL MASTER SYSTEM
IMG_8637.jpeg
IMG_8637.jpeg (157.03 KiB) Viewed 5511 times

So, the difference is the black bar on the bottom.

Why, on Mister, the image doesn't fill the entire screen?

Another question: the video_mode I set is the same for the all cores or each core set itself the original resolution of the machine? If yes, where can I see this config?

As video_mode, I've set the PAL mode of Sega Master System, 256x192 (tried also 256x244: the bottom bar is always there...).

There is my mister.ini:

Code: Select all

[MiSTer]
key_menu_as_rgui=0     ; set to 1 to make the MENU key map to RGUI in Minimig (e.g. for Right Amiga)
forced_scandoubler=0   ; set to 1 to run scandoubler on VGA output always (depends on core).
ypbpr=0                ; set to 1 for YPbPr on VGA output.
composite_sync=1      ; set to 1 for composite sync on HSync signal of VGA output.
vga_scaler=0          ; set to 1 to connect VGA to scaler output.
hdmi_audio_96k=0       ; set to 1 for 96khz/16bit HDMI audio (48khz/16bit otherwise)
keyrah_mode=0x18d80002 ; VIDPID of keyrah for special code translation (0x23418037 for Arduino Micro)
vscale_mode=3         ; 0 - scale to fit the screen height.
                       ; 1 - use integer scale only.
                       ; 2 - use 0.5 steps of scale.
                       ; 3 - use 0.25 steps of scale.
vscale_border=0        ; set vertical border for TVs cutting the upper/bottom parts of screen (1-399)
;bootscreen=0          ; uncomment to disable boot screen of some cores like Minimig.
;mouse_throttle=10     ; 1-100 mouse speed divider. Useful for very sensitive mice
rbf_hide_datecode=0    ; 1 - hides datecodes from rbf file names. Press F2 for quick temporary toggle
menu_pal=1             ; 1 - PAL mode for menu core
hdmi_limited=0         ; 1 - use limited (16..235) color range over HDMI
                       ; 2 - use limited (16..255) color range over HDMI, for VGA converters.
direct_video=0         ; 1 - enable core video timing over HDMI, use only with VGA converters.
fb_size=0              ; 0 - automatic, 1 - full size, 2 - 1/2 of resolution, 4 - 1/4 of resolution.
fb_terminal=0          ; 1 - enabled (default), 0 - disabled
osd_timeout=30         ; 5-3600 timeout (in seconds) for OSD to disappear in Menu core. 30 seconds if not set.
                       ; Background picture will get darker after double timeout

; 1 - enables the recent file loaded/mounted.
; WARNING: This option will enable write to SD card on every load/mount which may wear the SD card after many writes to the same place
;          There is also higher chance to corrupt the File System if MiSTer will be reset or powered off while writing.
recents=0

; lastcore - Autoboot the last loaded core (corename autosaved in CONFIG/lastcore.dat) first found on the SD/USB
; lastexactcore - Autoboot the last loaded exact core (corename_yyyymmdd.rbf autosaved in CONFIG/lastcore.dat) first found on the SD/USB
; corename - Autoboot first corename_*.rbf found on the SD/USB
; corename_yyyymmdd.rbf - Autoboot first corename_yyyymmdd.rbf found on the SD/USB
;bootcore=lastcore    ; uncomment to autoboot a core, as the last loaded core.
bootcore_timeout=10  ; 10-30 timeout before autoboot, comment for autoboot without timeout.

; Option to load the custom font. Format is plain bitmap 8x8.
; Supported sizes of font:
;   768 bytes - chars 32-127 (only alpha + numeric)
;  1024 bytes - chars 0-127
;  1136 bytes - chars 0-141
;  up to 2048 - only chars 0-141 will be used.
; if first 32 chars are empty (for sizes 1024 bytes and more) then they are skipped.
font=font/myfont.pf

; USER button emulation by keybaord. Usually it's reset button.
; 0 - lctrl+lalt+ralt (lctrl+lgui+rgui on keyrah)
; 1 - lctrl+lgui+rgui
; 2 - lctrl+lalt+del
; 3 - same as 0 (lctrl+lalt+ralt on keyrah)
reset_combo=0

dvi_mode=0             ; set to 1 for DVI mode. Audio won't be transmitted through HDMI in DVI mode.

; 0 - 1280x720@60
; 1 - 1024x768@60
; 2 - 720x480@60
; 3 - 720x576@50
; 4 - 1280x1024@60
; 5 - 800x600@60
; 6 - 640x480@60
; 7 - 1280x720@50
; 8 - 1920x1080@60
; 9 - 1920x1080@50
;10 - 1366x768@60
;11 - 1024x600@60

; custom mode: hact,hfp,hs,hbp,vact,vfp,vs,vbp,Fpix_in_KHz
;   video_mode=1280,110,40,220,720,5,5,20,74250
; default: video_mode=0
; video_mode=320,16,30,34,240,2,3,22,6400
; video_mode=320,8,32,24,240,4,3,16,6048
;video_mode=320,16,30,34,240,2,3,22,6472
;video_mode=320,16,30,34,240,2,3,22,6400
;video_mode=320,16,30,34,240,2,3,22,6400
video_mode=256,18,25,42,192,50,3,67,5320

; set to 1-10 (seconds) to display video info on startup/change
video_info=5

; Set to 1 for automatic HDMI VSync rate adjust to match original VSync.
; Set to 2 for low latency mode (single buffer).
; This option makes video butter smooth like on original emulated system.
; Adjusting is done by changing pixel clock. Not every display supports variable pixel clock.
; For proper adjusting and to reduce possible out of range pixel clock, use 60Hz HDMI video
; modes as a base even for 50Hz systems.
vsync_adjust=0

; If you monitor doesn't support either very low (NTSC monitors may not support PAL) or
; very high (PAL monitors may not support NTSC) then you can set refresh_min and/or refresh_max
; parameters, so vsync_adjust won't be applied for refreshes outside specified.
; These parameters are valid only when vsync_adjust is non-zero.
refresh_min=0
refresh_max=0

; These parameters have the same format as video_mode.
; You need to supply both PAL and NTSC modes if you want vsync_adjust to switch between
; predefined modes as a base. This will reduce the range of pixel clock.
;video_mode_ntsc=0
;video_mode_pal=256,18,25,42,192,50,3,67,5320

; 1-10 (seconds) to display controller's button map upon first time key press
; 0 - disable
controller_info=6

; JammaSD keys to joysticks translation
; You have to provide correct VID and PID of your input device
jammasd_vid=0x04D8
jammasd_pid=0xF3AD

FoxbatStargazer
Top Contributor
Posts: 994
Joined: Thu Dec 10, 2020 5:44 pm
Has thanked: 309 times
Been thanked: 228 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by FoxbatStargazer »

Video_mode is for scaled output, it does nothing with direct VGA. You can turn it on with vga_scaler=1 but you shouldn't need to for most cores, usually makes "pixel perfect" more complicated.

Two things to check in the core's menu while running a game:

1) Set region to PAL, the SMS core cannot auto-detect region for games
2) Look for border option and set to Yes, might be under Video or such.

If that doesn't work, then maybe there is something up with the core's PAL analog out...
thorr
Top Contributor
Posts: 1099
Joined: Mon Jul 06, 2020 9:37 pm
Has thanked: 535 times
Been thanked: 252 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by thorr »

To me it looks like the whole picture is shifted up. If there are positioning controls, try moving it down (in the core controls or on the TV itself).
Also, my guess is that you are using a different input (composite vs component/SCART). This would explain it. The TV's service menu geometry is probably set up differently for each input. (Edit: I see you are using RF, confirming my suspicion). You should use a TV calibration rom and set up your geometry properly in the TV's service menu. The SNES version is probably the most popular.
MiSTer_Kirk
Posts: 210
Joined: Thu Feb 04, 2021 11:42 pm
Has thanked: 18 times
Been thanked: 46 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by MiSTer_Kirk »

How are you using RF ?
None of the Philips monitors have an RF input, both the 8833, and 8833 MkII.
The Mk1, has Composite, TTL, and Scart, only - no RF input.
akeley
Top Contributor
Posts: 1303
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 416 times
Been thanked: 399 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by akeley »

thorr wrote: Fri Sep 17, 2021 6:02 pm To me it looks like the whole picture is shifted up. If there are positioning controls, try moving it down (in the core controls or on the TV itself).
Also, my guess is that you are using a different input (composite vs component/SCART). This would explain it. The TV's service menu geometry is probably set up differently for each input. (Edit: I see you are using RF, confirming my suspicion). You should use a TV calibration rom and set up your geometry properly in the TV's service menu. The SNES version is probably the most popular.
I've tried it myself and get similar result to OP. In NTSC (with Border=On) the whole pic is filled, in PAL, there's that black bar at the bottom. And my output is pretty much uniform across most cores (already calibrated via 240p suite). So perhaps FoxbatS is right and it's actually a problem with the core.
thorr
Top Contributor
Posts: 1099
Joined: Mon Jul 06, 2020 9:37 pm
Has thanked: 535 times
Been thanked: 252 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by thorr »

Not arguing, but some more thoughts. How do other PAL cores look? Do they all fill the screen? Regardless, it might be the specific timing with SMS on PAL since each system can move things around. Whether the core keeps the same timing as the original system, I am not sure. The fact that there are differences in the original post doesn't provide 100% proof of anything since different input methods are used.
akeley
Top Contributor
Posts: 1303
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 416 times
Been thanked: 399 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by akeley »

thorr wrote: Fri Sep 17, 2021 6:59 pm some more thoughts
Always welcome :) Consoles are tabula rasa for me, so I'm just thinking out loud.
Off top of my head, my PAL micros (ZX, A8, C64) look the same on MiSTer, even though not all have RGB. Possibly others too. From my experience comparing RF/Composite vs RGB on the micros the image differs very little regarding size and position.

Also, I've just had a look on the utubes, there are some people with PAL consoles +CRTs and some games fill the screen (by the means of the border of course).

This one is interesting, switches between PAL/NTSC in Alex Kidd and Shinobi: https://youtu.be/trysanXC5Ek
AK is like in OPs case, Shinobi though does have black borders. And it looks very similar on my MiSTer. So it seems some games filled the border, others didn't?

This one (Marksman bundle) fills the screen in PAL, doesn't on MiSTer, similar to Alex Kidd. https://youtu.be/33kj0Qy4zJM

And one more, Quartet, same story: https://youtu.be/Yg9EfQWQW-o

Don't know what it means but it'd be interesting to find out. Seems that the games which fill the border get shifted up for some reason.
AmintaMister
Posts: 277
Joined: Thu Sep 16, 2021 10:54 pm
Has thanked: 720 times
Been thanked: 44 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by AmintaMister »

First of all, THANKS to you all for the replies!

First I will make some clarifications, then I'll ask some questions.

Clarifications:

  • In the Sms Core Running Alex Kid Eu rom the region is set to PAL, the border option is set to Yes.
  • The picture is NOT shifted up. It is a the same top level of RF picture: if I move down the picture I'm having a black bar on the top
  • Other PAL cores look very fine and they all fill the screen

Questions:
  • Do you confirm that the resolutions are always set by the core and they are not editable-configurable by the user?
  • Why, if I set vga_scaler=1, the vertical synch of the monitor is lost?
  • When you switch between cores, what does it mean the resolution displayed for some seconds above and that displayed bottom?
Finally, inspecting better my two pictures I think the problem can be in the core: in my opinion, the main game image is exactly the same. The only difference is the TOP ADDED BORDER that is not tall as the bottom one.

Do you agree?
thorr
Top Contributor
Posts: 1099
Joined: Mon Jul 06, 2020 9:37 pm
Has thanked: 535 times
Been thanked: 252 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by thorr »

akeley wrote: Fri Sep 17, 2021 7:45 pm Off top of my head, my PAL micros (ZX, A8, C64) look the same on MiSTer, even though not all have RGB. Possibly others too. From my experience comparing RF/Composite vs RGB on the micros the image differs very little regarding size and position.
Thanks. I am a little confused exactly what you mean by "same on MiSTer". Are you saying that you have physical hardware for ZX, etc. and the video output looks the same as it does on the MiSTer? Or are you saying that running different MiSTer cores look the same as each other? Or are you saying that your physical machines look the same as each other? Or are you saying that the physical machines have the same black bar at the bottom issue?
thorr
Top Contributor
Posts: 1099
Joined: Mon Jul 06, 2020 9:37 pm
Has thanked: 535 times
Been thanked: 252 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by thorr »

AmintaMister wrote: Fri Sep 17, 2021 9:04 pm
  • Do you confirm that the resolutions are always set by the core and they are not editable-configurable by the user?
  • Why, if I set vga_scaler=1, the vertical synch of the monitor is lost?
  • When you switch between cores, what does it mean the resolution displayed for some seconds above and that displayed bottom?
1) Correct, unless you turn on the scaler, but you do not want to do this!
2) Because you are using the scaler. This scales the original resolution and video timings to whatever your scaled resolution is configured as
3) I am not sure I understand the question. If you mean the little pop up that tells you what resolution you are using, this can be turned off in the INI file.
AmintaMister
Posts: 277
Joined: Thu Sep 16, 2021 10:54 pm
Has thanked: 720 times
Been thanked: 44 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by AmintaMister »

Yes @thorr I mean that pop up, but what is the meaning of the two resolutions displayed?
akeley
Top Contributor
Posts: 1303
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 416 times
Been thanked: 399 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by akeley »

thorr wrote: Fri Sep 17, 2021 9:27 pm Are you saying that you have physical hardware for ZX, etc. and the video output looks the same as it does on the MiSTer?
This one. C64 core had a border size issue but it was fixed recently. Overall they are very, very close, I've even measured it with a ruler at some point. Definitely no big bars like in this case. But micros might be different from consoles (though I think the idea of the border space is similar)
AmintaMister wrote: Fri Sep 17, 2021 9:04 pm
  • The picture is NOT shifted up. It is a the same top level of RF picture: if I move down the picture I'm having a black bar on the top
[...]
Finally, inspecting better my two pictures I think the problem can be in the core: in my opinion, the main game image is exactly the same. The only difference is the TOP ADDED BORDER that is not tall as the bottom one.
Now I'm confused :) To me it looks like there is not enough border PLUS the image is shifted a little bit up. If I go into service menu, I can drag the image down and center it, and the result will be: top black bar, top blue border, game proper, bottom blue border, bottom black bar. That's not how it looks in your image or the Alex Kidd vid I linked to, where the screen is filled with no black bars.
MiSTer_Kirk
Posts: 210
Joined: Thu Feb 04, 2021 11:42 pm
Has thanked: 18 times
Been thanked: 46 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by MiSTer_Kirk »

For what it's worth, I hooked up my Master System 1 to my Philips 8833 Mk2 using an RGB Scart cable, and almost every game I tried had a border at the bottom. Some games had a border at the top and bottom, although the top border was tiny. I didn't use any original carts, I used a Master Everdrive X7 to load roms. I also have the 8833 Mk1, but this is hooked up to a BBC Master, and in a different room, so I couldn't test this.

Just to Edit :- I flicked between the Master System 1, and my Mister running the same rom, and they're very close, with the Mister image moved slightly to the left, and slightly sharper image. The Master System does show a slightly brighter image, more contrast.
FoxbatStargazer
Top Contributor
Posts: 994
Joined: Thu Dec 10, 2020 5:44 pm
Has thanked: 309 times
Been thanked: 228 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by FoxbatStargazer »

AmintaMister wrote: Fri Sep 17, 2021 10:35 pm Yes @thorr I mean that pop up, but what is the meaning of the two resolutions displayed?
Top resolution is the original/direct signal, which is usually output from VGA on the Analog I/O board. Bottom resolution is the scaled resolution, which is usually output from the HDMI port.
AmintaMister
Posts: 277
Joined: Thu Sep 16, 2021 10:54 pm
Has thanked: 720 times
Been thanked: 44 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by AmintaMister »

I hooked up my Master System 1 to my Philips 8833 Mk2 using an RGB Scart cable, and almost every game I tried had a border at the bottom.
Thanks!

Is it a bottom BLACK border as tall as that on Mister?
akeley
Top Contributor
Posts: 1303
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 416 times
Been thanked: 399 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by akeley »

MiSTer_Kirk wrote: Sat Sep 18, 2021 1:05 am For what it's worth, I hooked up my Master System 1 to my Philips 8833 Mk2 using an RGB Scart cable, and almost every game I tried had a border at the bottom. Some games had a border at the top and bottom, although the top border was tiny.
By border, do you mean black bars? I think black bars are natural for most games, but some fill that space with colour.

https://www.smspower.org/forums/16056-W ... temBorders

Did you try Alex Kidd? If it has a bottom black border on your setup, then maybe it really is composite vs RGB thing (people in these videos seem to be using RF or composite).

I think Sonic is another game with colour-filled border.
AmintaMister
Posts: 277
Joined: Thu Sep 16, 2021 10:54 pm
Has thanked: 720 times
Been thanked: 44 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by AmintaMister »

Did you try Alex Kidd? If it has a bottom black border on your setup, then maybe it really is composite vs RGB thing (people in these videos seem to be using RF or composite).
Me too I suspect it is Rf vs RGB behavior but we can be sure of this only if we can watch a video with a real Sega Master System playing Alex Kidd on RGB...
MiSTer_Kirk
Posts: 210
Joined: Thu Feb 04, 2021 11:42 pm
Has thanked: 18 times
Been thanked: 46 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by MiSTer_Kirk »

Yeah, the bars were black bars, both top and bottom. I could make the games fullscreen using the Philip's front controls, but then every other system would be too stretched.

I tried 4 Alex Kidd games. Miracle World, Shinobi World, Lost Stars, and High-Tech World. I will also say, some games have bigger borders than others, so it looks like the Master System, maybe, uses slightly different resolutions ?
AmintaMister
Posts: 277
Joined: Thu Sep 16, 2021 10:54 pm
Has thanked: 720 times
Been thanked: 44 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by AmintaMister »

MiSTer_Kirk wrote: Sat Sep 18, 2021 11:04 am Yeah, the bars were black bars, both top and bottom. I could make the games fullscreen using the Philip's front controls, but then every other system would be too stretched.

I tried 4 Alex Kidd games. Miracle World, Shinobi World, Lost Stars, and High-Tech World. I will also say, some games have bigger borders than others, so it looks like the Master System, maybe, uses slightly different resolutions ?
Ok, THANKS! So at this point I think that Mister outputs the correct behavior of the Sega Master System Pal RGB output!
akeley
Top Contributor
Posts: 1303
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 416 times
Been thanked: 399 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by akeley »

It's odd that RGB vs composite/etc shape would differ so much...but it seems it does. Hmph.

I was considering getting an original one but in my neck of the woods only SMS II is available, and that one needs to be modded for RGB...
MiSTer_Kirk
Posts: 210
Joined: Thu Feb 04, 2021 11:42 pm
Has thanked: 18 times
Been thanked: 46 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by MiSTer_Kirk »

AmintaMister wrote: Sat Sep 18, 2021 11:14 am Ok, THANKS! So at this point I think that Mister outputs the correct behavior of the Sega Master System Pal RGB output!
Yeah, the Mister is probably the correct output. Although, the colours kind of make it look like an emulator running, they're too perfect, no artefacts. On the real thing, the slightly higher contrast makes the sky blue, seen in your shots, look more cyan blue. Also, more contrast makes a CRT glow more, and I do like more bloom/glow in the image, as it sometimes softens the image, making it not so sharp, or harsh.
I was considering getting an original one but in my neck of the woods only SMS II is available, and that one needs to be modded for RGB...
I love the original, it has a very iconic shape, which I thought (at the time) gave it a futuristic look. Shame they dropped RGB in the Mk2, probably to save costs.
Yim
Posts: 125
Joined: Mon Jan 18, 2021 11:51 pm
Has thanked: 3 times
Been thanked: 87 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by Yim »

I think this might actually be an inaccuracy in the handling of PAL mode in the SMS core. A PAL video signal has 576 lines (dropped to 288 by the console to double the frame rate) versus NTSC's 480 lines (dropped to 240). The SMS should be filling the area outside of its active display with the background colour, which is what having border on does, but the border doesn't distinguish between PAL and NTSC and so I think it's smaller than it should be in PAL.

According to Charles MacDonald's SMS VDP documentation (the accuracy of which I can't vouch for, but it's hosted on SMS Power and those guys take the SMS pretty seriously):
A NTSC machine displays 60 frames per second, each frame has 262 scanlines.
A PAL machine displays 50 frames per second, each frame has 313 scanlines.
These are more scanlines than the TV should be able to display, because they are not all supposed to be seen. The image is supposed to go over the edges of the screen, but the active part, 192 lines within the 262/313 lines, should be visible.
NTSC, 256x192 wrote:

Code: Select all

 Lines  Description

 192    Active display
 24     Bottom border
 3      Bottom blanking
 3      Vertical blanking
 13     Top blanking
 27     Top border
On NTSC from the top of the screen down, there's a 27 line top border, then 192 lines of picture, then a 24 line bottom border. This is pretty close to what turning borders on in the SMS core does - that gives a 24 line border at both top and bottom. The border is coloured in whatever colour is set as the background colour on the console. Sometimes black, sometimes others (blue in the Alex Kidd shots at the start of this thread, for example). The blanking lines are black and should be well offscreen.
PAL, 256x192 wrote:

Code: Select all

Lines  Description

 192    Active display
 48     Bottom border
 3      Bottom blanking
 3      Vertical blanking
 13     Top blanking
 54     Top border
PAL mode has much bigger borders because of the extra screen real estate, 48 lines below and 54 lines above. Together with the 192 lines of active display this is 294 lines, slightly more than the 288 lines expected in PAL. This doesn't matter because the extras will be off the edge of the screen (or not, it's an analogue system, it depends how the display is adjusted). In the SMS core, this is still 24 lines above and 24 below. So the image generated only fills 240 lines of the 288 the screen is supposed to display.

I think this is a pretty easy fix. video.vhd in the source code is what determines the size of the borders (I've cut a few lines relating to unusual video modes from this for simplicity):

Code: Select all

	vbl_st  <= conv_std_logic_vector(216,9) when border = '1' and gg = '0'
			else conv_std_logic_vector(192,9) when (border xor gg) = '0'
			else conv_std_logic_vector(168,9);
			
	vbl_end <= conv_std_logic_vector(488,9) when border = '1' and gg = '0'
			else conv_std_logic_vector(000,9) when (border xor gg) = '0'
			else conv_std_logic_vector(024,9);
The numbers are kind of confusing, the vertical count runs from 0 to 511, skipping from two-hundred-and-something to four-hundred-and-something along the way (the exact number depends on the video mode). Lines 0-191 contain the active image, then comes the bottom border, and the lines leading up to 511 have the top border. vbl_st is the point at which the mister stops showing the image, and vbl_end is where it starts again. If the border is on and we're not playing a game gear game (border='1' and gg='0'), then it shows the first 216 lines - 192 active lines and 24 lines of bottom border. Then it restarts at 488 for 24 lines of top border (488 through 511). This is appropriate for NTSC, but not enough for PAL. So I've added a couple of lines:

Code: Select all

	vbl_st  <= conv_std_logic_vector(216,9) when border = '1' and gg = '0' and pal = '0'
			else conv_std_logic_vector(240,9) when border = '1' and gg = '0' and pal = '1'
			else conv_std_logic_vector(192,9) when (border xor gg) = '0'
			else conv_std_logic_vector(168,9);
			
	vbl_end <= conv_std_logic_vector(488,9) when border = '1' and gg = '0' and pal = '0'
			else conv_std_logic_vector(464,9) when border = '1' and gg = '0' and pal = '1'
			else conv_std_logic_vector(000,9) when (border xor gg) = '0'
			else conv_std_logic_vector(024,9);
Basically, if the border is on and it's not PAL, it's the same as before. If PAL is on ("and pal = '1'" is redundant here, but I thought it made it easier to read), then blanking starts a bit later, giving a 48 line lower border, and starts a bit earlier to give a 48 line upper border. This gives a total image of 288 lines, which should fill a PAL CRT. I know I said earlier the upper border should be 54 lines, but doing that would land vbl_end in the vsync period and I'm not sure what the result of that would be.

I've compiled with this and it seems to have worked, at least in terms of giving a 48 line border above and below in PAL mode. Here's the RBF. I don't have a CRT to try it out on, so if you could give it a go on yours AmintaMister I'd be interested to know if it works. If so, maybe I'll submit the code for inclusion in the official core.
akeley
Top Contributor
Posts: 1303
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 416 times
Been thanked: 399 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by akeley »

Ha...the plot thickens. Thanks, Yim.
mister-0001-resize.jpg
mister-0001-resize.jpg (541.38 KiB) Viewed 4436 times
mister-0006-resize.jpg
mister-0006-resize.jpg (500.13 KiB) Viewed 4436 times
mister-0004-resize.jpg
mister-0004-resize.jpg (443.65 KiB) Viewed 4436 times
mister-0005-resize.jpg
mister-0005-resize.jpg (423.62 KiB) Viewed 4436 times

These shots are the new vs old core. So it does work indeed, although there is still a little gap left on the bottom. When I go into the service menu I can shift the image down, and the blue border data is there - so it's possible to get a perfect fill, but then of course displaying all my other coures would get down-shifted as well, and they're fine atm.
So, any chance to move the whole image down within the core? Please note that not all of the the bottom black border is the actual display, only about 0.8 cm of it is active - the rest is just some sort of TV border, similar to the top and sides.

And this still leaves the question of why on Mister_Kirk's display there is a black bar on the bottom... The above solution is welcome, because it does look better and it seems to be the intended way on a non-RGB output. But is it a hack, or a fix? ;) :?:
AmintaMister
Posts: 277
Joined: Thu Sep 16, 2021 10:54 pm
Has thanked: 720 times
Been thanked: 44 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by AmintaMister »

Yim wrote: Sat Sep 18, 2021 2:15 pm I think this might actually be an inaccuracy in the handling of PAL mode in the SMS core. A PAL video signal has 576 lines (dropped to 288 by the
I've compiled with this and it seems to have worked, at least in terms of giving a 48 line border above and below in PAL mode. Here's the RBF. I don't have a CRT to try it out on, so if you could give it a go on yours AmintaMister I'd be interested to know if it works. If so, maybe I'll submit the code for inclusion in the official core.
Hi Yim, this is an ASTONISHING fix from you!

Now the bottom of the image has not more a black bottom but a filled color one, like the original Master System has!

Original Sms
IMG_8692.jpeg
IMG_8692.jpeg (172.7 KiB) Viewed 4924 times
Sms on Mister with Yim fix
IMG_8691.jpeg
IMG_8691.jpeg (171.77 KiB) Viewed 4924 times
MiSTer_Kirk
Posts: 210
Joined: Thu Feb 04, 2021 11:42 pm
Has thanked: 18 times
Been thanked: 46 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by MiSTer_Kirk »

The Mister image is still shifted to the upper part of the screen, even though the black is now filled in.
I see differences in colour brightness, like I saw with mine. Although, yours looks the opposite, the Mister looks brighter. The black outlines in the original, are now grey in the Mister shot.
Also, does the aspects look different ? Or is that the angle of the camera shot ?
I might try my SMS on one of my PVMs, tomorrow, and see how they both differ on a PVM.

Edit. Also bear in mind, I am using a 8833 Mark II, and it doesn't have a scart input, it has a 9-pin input (RGB), and I am using Scart to 9-pin.
AmintaMister
Posts: 277
Joined: Thu Sep 16, 2021 10:54 pm
Has thanked: 720 times
Been thanked: 44 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by AmintaMister »

MiSTer_Kirk wrote: Sat Sep 18, 2021 8:54 pm The Mister image is still shifted to the upper part of the screen, even though the black is now filled in.
I see differences in colour brightness, like I saw with mine. Although, yours looks the opposite, the Mister looks brighter. The black outlines in the original, are now grey in the Mister shot.
Also, does the aspects look different ? Or is that the angle of the camera shot ?
I might try my SMS on one of my PVMs, tomorrow, and see how they both differ on a PVM.
Sure there are differences in color brightness but I think they are related to RGB vs RF output; no difference in aspects, only a different camera angel in the shot. And, yes, you're right, the two colored borders on top and bottom are not still even...
Yim
Posts: 125
Joined: Mon Jan 18, 2021 11:51 pm
Has thanked: 3 times
Been thanked: 87 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by Yim »

Not sure about this but the difference in vertical position might have to do with the timing of the vsync. According to the document I quoted in my last post, it should go from line 243 to line 245. Looking at the code in video.vhd, the vsync goes from line 260 to 263 (if I’m counting right). I’m not certain about this, but I think triggering the vsync late like this would result in blank lines that should be at the top winding up at the bottom and so the picture being moved upwards.

There’s also what looks like a bug in the code for PAL 256x240 mode: vsync goes from vcount 478 to 481, but vcount skips from 266 to 482, meaning vsync never happens. I don’t know if there are any games that use this mode anyway, but that doesn’t seem right.
Yim
Posts: 125
Joined: Mon Jan 18, 2021 11:51 pm
Has thanked: 3 times
Been thanked: 87 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by Yim »

OK, I've compiled another version with the vsync signal moved to match what's in Charles MacDonald's SMS specs when in PAL 256x192 mode. If I'm right about this, that should move the active image down to match what the actual console is putting out. I also adjusted the vertical border size to match, so it's 54 lines above and 48 below. I don't think that'll make any difference to what you see on the CRT, the extra border area should be off the top of the screen anyway. I don't have a CRT to test this out on, though, so AmintaMister if you could try it out and take some more photos I'd appreciate it.

Here's the new RBF.

Unrelated to that, I changed the vsync in PAL 256x240 mode so that it will actually occur. It took me a while to find any software that uses that mode, but I got there: the program posted in the third to last post of this forum thread (in ras.zip). Load that ROM and press button 1 once so that a number 1 is displayed on screen, and you'll have be in 256x240 mode. Could anyone with a CRT could try that in both my version of the core and the official one, both while set to PAL, and tell me if there's any difference?
akeley
Top Contributor
Posts: 1303
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 416 times
Been thanked: 399 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by akeley »

The new rbf makes it all good on my Trinitron. The whole image is shifted down and so the bottom black bar is gone. I've tried it in Alex Kidd and Sonic (two games of the games which use colour in border) and the borders are nicely filled and the main image centered now.

On your new rbf, that ras.sms displays a rectangle in the upper part of the screen, filled horizontally with big black bar beneath (in mode 1). On the old core loading it up and pressing 1 makes my TV lose sync.
MiSTer_Kirk
Posts: 210
Joined: Thu Feb 04, 2021 11:42 pm
Has thanked: 18 times
Been thanked: 46 times

Re: Can't understand how to get pixel perfect resolution on my Philips CM8833 CRT

Unread post by MiSTer_Kirk »

Thanks for the rbf, Yim.
I will test this on my 8833 MkII, but I will also try my 9" PVM, just to see how that looks.
Makes you wonder how the other cores compare to the real thing, on a CRT. I have a lot of real hardware, and everdrives, or modern SDCard solutions, so I could do some testing, and get some photos.
Post Reply