Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: crt_emudriver stopping mid-scanline?  (Read 2880 times)

0 Members and 1 Guest are viewing this topic.

rogerxyz

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 30
  • Last login:July 12, 2024, 09:57:27 pm
  • Building my very first cabinet!
crt_emudriver stopping mid-scanline?
« on: April 19, 2024, 07:51:41 pm »
Hey all! I think I've been living with this problem for years and it never really registered that maybe something was wrong...

So, the full image isn't drawn to my CRT. I'd say in 240p, the bottom 10 lines or so are missing, and this is really weird, but it also stops drawing halfway through the last scanline.

Additionally, I'm guessing this is related, there's maybe an extra one or two scanlines above the top of my screen that are mostly white but changing colors. No pic because I adjusted my CRT to push that off the top and promptly forgot it was happening. But now that I'm actually giving this some thought, it's probably wrapping around and trying to draw the bottom part of the image before the first real scanline.

Is there anything I can do to diagnose and correct this? I am using a consumer 15khz NTSC TV, with VGA → GreenAntz → Component in. My crt_range is basically generic15 with some minor tweaking, but I can try to see if resetting it back to generic15 does anything.

Bottom of my screen in "ninja spirit" - you can see all but the first 3.5 lines of the HUD is missing.


What it's supposed to look like


This is just an example - the bottom appears to be cut off at some point in all progressive 15khz modes (in other words 240p and the surrounding range 220-244p or whatever).

Any ideas? Thank you very much! :)
« Last Edit: April 19, 2024, 07:55:00 pm by rogerxyz »
Current build: originally a Dig-Dug cabinet, previously turned into an iCade w/ LCD, now a PC-powered MAME cabinet with consumer CRT TV, GreenAntz transcoder, and crt_emudriver.

Zebidee

  • Trade Count: (+9)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3322
  • Last login:Today at 07:37:27 am
Re: crt_emudriver stopping mid-scanline?
« Reply #1 on: April 19, 2024, 10:52:41 pm »
Hey all! I think I've been living with this problem for years and it never really registered that maybe something was wrong...

So, the full image isn't drawn to my CRT. I'd say in 240p, the bottom 10 lines or so are missing, and this is really weird, but it also stops drawing halfway through the last scanline.


Hi Roger, that's "overscan", deliberately oversizing the picture by 2%-10%, a feature of most TVs. When just "watching TV", people want to image to fill the screen. It would look weird otherwise. Losing a few lines/pixels around the edges doesn't matter, because all the main action happens in the middle of the screen.

Overscan isn't great for gaming though.

For vertical size/overscan, mostly it is best to try to adjust within the TV's service mode. Do you already have access to that?

Unfortunately you can't do much about vertical size by adjusting CRT_emulator monitor presets (porch settings). This approach can give good results for horizontal overscan though.

Some other ideas:

- run games in a higher resolution - for example, running 224-240p games in 256p or even 264p. You can force this by [romname].ini files, or force GM's hand by only creating 256p modes (no 240p) in the first place.
- While running Groovymame and in-game, press TAB to access a menu and various video size slider controls.

Quote
Additionally, I'm guessing this is related, there's maybe an extra one or two scanlines above the top of my screen that are mostly white but changing colors. No pic because I adjusted my CRT to push that off the top and promptly forgot it was happening. But now that I'm actually giving this some thought, it's probably wrapping around and trying to draw the bottom part of the image before the first real scanline.


This may be "foldover", an early sign of the TV's vertical deflection circuit starting to fail. Most likely aging electrolytic capacitors. Your TV is likely 20-30 years old by now. It sounds very minor at this stage, but you may want to consider getting the TV recapped.

Check out my completed projects!


rogerxyz

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 30
  • Last login:July 12, 2024, 09:57:27 pm
  • Building my very first cabinet!
Re: crt_emudriver stopping mid-scanline?
« Reply #2 on: April 20, 2024, 12:42:36 am »
Hi Zebidee, thank you for the reply!

I don't think this is an overscan issue - the last scanline is nowhere near the bottom of the screen. I've adjusted the vertical height way down so we can be sure there's no cropping on the top and bottom, and I'm going through the video modes in arcade OSD here:

https://drive.google.com/file/d/19tWdLeG8p_jrBBt_NsxS0sWWoReADpQX/view?usp=sharing

We can see that in some modes, for instance, 320x224@60 (15.66khz), the full image is drawn, you can see the bottom white border. Whereas the very close 320x248@59.97 (16.13khz) doesn't reach the bottom white border, and in fact, you can see that it in fact stops mid-scanline here...

My first thought is that anything over 15.6kHz can't be displayed by this Sony KV-XXX, but then 336x224@60 (15.66kHz) works fine but one at a little lower frequency 384x240@59.98 (15.65kHz) does not work.

Is there something here I can adjust in the range when generating modes, or the service menu, that could assist with these couple modes that appear not to be drawing the whole image? Or is maybe something else going on here - failure to sync is one thing, it obviously can display these modes, but cutting off scanlines is
something else...

My preset is

monitor "roger", "Sony KV-20FS100", "4:3"
        crt_range0 15625-16750, 56.0-65.00, 2.000, 4.700, 8.000, 0.064, 0.192, 1.024, 0, 0, 170, 262, 448, 526


I did just replace my modelines with the ntsc preset, rebooted, and it doesn't seem to have done anything.

Is this what foldover looks like? I thought foldover looked like the image "bouncing" off the top or the bottom and drawing again over top of itself, like it had been folded at the edge, but I could have a misconception.
« Last Edit: April 20, 2024, 12:58:04 am by rogerxyz »
Current build: originally a Dig-Dug cabinet, previously turned into an iCade w/ LCD, now a PC-powered MAME cabinet with consumer CRT TV, GreenAntz transcoder, and crt_emudriver.

psakhis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 465
  • Last login:September 24, 2024, 11:54:25 am
  • I want to build my own arcade controls!
Re: crt_emudriver stopping mid-scanline?
« Reply #3 on: April 20, 2024, 03:45:50 am »
That game is 384x256@55hz.
Probably your tv isn't changing to PAL mode.

Zebidee

  • Trade Count: (+9)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3322
  • Last login:Today at 07:37:27 am
Re: crt_emudriver stopping mid-scanline?
« Reply #4 on: April 20, 2024, 10:56:17 am »
OK, saw the video. Overscan is not your real issue here.

Try NTSC presets (you tried that).

Try increasing the vertical size via service menu. Guess you tried that too.

Otherwise, I suspect TV is in early stages of vertical collapse. The main symptom is a shrunk picture, and may exhibit foldover (usually at top). Foldover will look like changing colours, much like you described. It can look like a really pronounced image reflection when quite bad. Should change (get worse) over time.

Changing the electrolytic caps, at least the ones near vertical deflection IC, may help.

Pull out the chassis and have a close look at all the caps. Failing caps might be bulging at top, might be leaking fluid. Sometimes failing caps show nothing, though an ESR meter can usually reveal them. You may need to solder, or find someone that can.
Check out my completed projects!


rogerxyz

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 30
  • Last login:July 12, 2024, 09:57:27 pm
  • Building my very first cabinet!
Re: crt_emudriver stopping mid-scanline?
« Reply #5 on: April 20, 2024, 09:19:58 pm »
Thank you again Zeb! It seems not unlikely that some issue in the deflection circuitry is to blame. Before I start putting together a cap list, I think one final test is in order:

I'll hook up another monitor - maybe a sibling Trinitron just for apples-to-apples - to the video card and see if it fares any better.

I just have to make some time for that....
Current build: originally a Dig-Dug cabinet, previously turned into an iCade w/ LCD, now a PC-powered MAME cabinet with consumer CRT TV, GreenAntz transcoder, and crt_emudriver.

makya

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 84
  • Last login:August 17, 2024, 05:49:23 am
  • I want to build my own arcade controls!
Re: crt_emudriver stopping mid-scanline?
« Reply #6 on: April 22, 2024, 03:19:53 pm »
Hi, please post a log. Without we can only try to guess. However, that's a sure thing that ninja spirit will not display correctly using generic15 (according to my experience with euro TVs at least).
« Last Edit: April 22, 2024, 03:40:11 pm by makya »

Zebidee

  • Trade Count: (+9)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3322
  • Last login:Today at 07:37:27 am
Re: crt_emudriver stopping mid-scanline?
« Reply #7 on: April 22, 2024, 08:51:04 pm »
I looked at your video again, and your TV definitely doesn't like anything over 240p/480i. It cuts the bottom off anything over that, even 248p. It is clearly struggling to even sync with anything over 240p/480i (see the zigzag at top). Unsurprisingly, it seems to be an NTSC TV (says so right there), so use the NTSC monitor preset as your template.

If you've used the NTSC monitor preset to regenerate video modes properly, GM should not be selecting modes with vertical lines over 240p/480i.

An in-game log could help. That starting info screen can help too, as it provides video mode selection and screen sizing information. You can opt to hide them, but I prefer to leave them there.

Another matter is the suspected vertical collapse. Whether that line at top is foldover or not, I can't be 100% sure without a closer look, but the image definitely seems shrunken and now I notice it seems to have bit of pincushioning at the corners. It only gets worse over time, picture shrinking from top and bottom. Final stage is a single fat bright line across the middle. Replacing old caps may help and may help prevent other damage down the track.

Check out my completed projects!


rogerxyz

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 30
  • Last login:July 12, 2024, 09:57:27 pm
  • Building my very first cabinet!
Re: crt_emudriver stopping mid-scanline?
« Reply #8 on: May 16, 2024, 09:02:43 pm »
I ran the experiment - same PC, graphics card, GM, rom, etc., just plugged into a different TV. This one showed the same thing, so I'm doubtful it's the TV. It's not that it's failing to sync at any of the ~15kHz modes, all of them sync, just a smattering of the video modes show this issue where the image just stops drawing mid-scanline before the last line. However, some progressive 240±10 line modes do this and others don't!

Further, as I said, it appears this way on another set. I've adjusted the vertical shift so you can more easily see the bottom.



I could even try this on an LCD next, I think I'll show the same thing...

So here's also logs running under GM 0.227 and GM 0.256. I can try with the latest 0.265 but I have my doubts anything will change. At this point I've reverted to the ntsc timings.

The logs show the video is supposed to be 256 lines for this game, and.... well you know what? I'm not surprised 256p won't draw every line on a consumer NTSC TV....  ::)

Switchres: normal (384x256@55.017605)->(2560x256@56.000000)

Maybe it really is as simple as that? The video mode will sync but there's no coaxing a consumer NTSC set to display 248 lines? This modeline comes out to 15.68khz.

Again referring back to the video https://drive.google.com/file/d/19tWdLeG8p_jrBBt_NsxS0sWWoReADpQX/view:

All of the following modelines SYNC. The ones marked with X don't draw the bottom-most line (i should see a white border). The ones marked with O draw the top and bottom white borders. (Again, in this video, the service menu has been used to artificially compress the v size so that we can be certain that the image is not being cropped.)


O 240x192@60p 15.656khz
O 240x200@60p 15.656khz
O 248x192@60p 15.671khz
O 256x192@60p 15.655khz
O 256x224@60p 15.655khz
X 256x240@60p 15.655khz
X 256x248@60p 16.131khz
X 256x256@60p 16.619khz
O 320x224@60p 15.660khz
X 320x240@60p 15.649khz
X 320x248@60p 16.132khz
X 320x256@60p 15.745khz
O 336x224@60p 15.659khz
X 384x240@60p 15.655khz
X 512x448@60i 15.693khz
X 512x480@60i 15.693khz
X 512x512@60i 16.647khz
X 544x248@60p 16.138khz
O 640x200@60p 15.661khz
X 640x480@30i 15.685khz
X 640x480@60i 15.680khz
X 680x510@60i 16.593khz
X 768x512@60i 16.654khz

X 2560x240@60p 15.661khz
X 2560x248@60p 16.140khz
X 2560x256@60p 16.619khz
X 2560x448@60i 15.691khz
O 2560x464@60i 15.691khz
X 2560x480@60i 15.691khz
X 2560x496@60i 16.170khz
X 2560x510@60i 16.590khz
X 2560x512@60i 16.649khz


Is this expected, that some modes will sync perfectly but depending on the monitor, the bottom scanlines will simply not be reached?

I don't have unreasonable expectations of pushing this consumer set beyond 240p/480i. But when so many of the 240p modes also get cut off, I just wonder if there's something wrong I can try to fix!
« Last Edit: May 16, 2024, 10:53:02 pm by rogerxyz »
Current build: originally a Dig-Dug cabinet, previously turned into an iCade w/ LCD, now a PC-powered MAME cabinet with consumer CRT TV, GreenAntz transcoder, and crt_emudriver.

Zebidee

  • Trade Count: (+9)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3322
  • Last login:Today at 07:37:27 am
Re: crt_emudriver stopping mid-scanline?
« Reply #9 on: May 17, 2024, 01:19:18 am »
The logs show the video is supposed to be 256 lines for this game, and.... well you know what? I'm not surprised 256p won't draw every line on a consumer NTSC TV....  ::)
...
Maybe it really is as simple as that? The video mode will sync but there's no coaxing a consumer NTSC set to display 248 lines?

After all this - yes, I think so.

According to your 0.256 log, you are using this crt_range to allow 256p modes:

Quote
Monitor range 15625.00-16750.00,56.00-65.00,2.000,4.700,8.000,0.064,0.192,1.024,0,0,170,262,448,526

Which looks mostly like "generic_15", except the max/min lines numbers have been altered from default. I've highlighted them above. There are two sets of min (red) and max (blue), for progressive and interlaced respectively.

I suggest you to try the default NTSC crt_range, which is:

Quote
monitor "ntsc", "NTSC TV - 60 Hz/525", "4:3"
        crt_range0 15734.26-15734.26, 59.94-59.94, 1.500, 4.700, 4.700, 0.191, 0.191, 0.953, 0, 0, 192, 240, 448, 480

If yours has been altered, you could always just replace your monitor.ini file with a fresh one from the download package. If you want to try further customisation to get 248p lines or whatever, try using NTSC preset as your base.

After you've updated monitor range presets, video modes and everything in VMMaker: go to "Edit Settings", then "MAME" (last tab), and be sure to tick the box marked "Export monitor settings to GroovyMAME". Then click "Browse" to make sure it is pointing to the right executable. Then click "OK" to update the mame.ini file.

If you do all this, you'll see a message in the VMMaker command window:

Quote
Exporting settings to mame.ini...

This will stop GM trying to display 256p modes on your TV. Unfortunately you may need to look at other options for those games (like using interlaced modes or stretching or somesuch).

I'm not sure why you still get lines cutoff even in some 240p modes. If the NTSC monitor range doesn't help, I'd look in TVs service menus.

Maybe being hopeful here, but I'd dive deeply and search through the TV service menu to see if there is an NTSC/PAL option somewhere. While looking, you might find something about screen size etc. Toshiba TVs around 2000 era (like yours alternative TV seems to be) all used these huge jungle chips with everything preloaded already, so maybe you just need to flip a bit. Many manufacturers at that time used Toshiba jungle chips, so they are fairly generic. I expect there to be up to 20 pages of settings, most of which might not be available unless you flip a special "PAGE" bit (it might be called something else) or even enter another code. Unfortunately some manufacturers for US market also might've tried to save a few cents by not bothering to put on something as simple as a PAL frequency crystal oscillator, so I might just be "dreaming". Anyway, worth a good look in the service menu to see what options are there.

Take care and exercise discretion with service menu options, setting the wrong thing can make the service menu inaccessible. It is possible to backup the TV EEPROM (which saves all the data) if you want to really get into it.

Sorry, this post has gotten long. From a practical perspective, looks like you are stuck with a snug 240p for now at least  :hissy:
Check out my completed projects!


rogerxyz

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 30
  • Last login:July 12, 2024, 09:57:27 pm
  • Building my very first cabinet!
Re: crt_emudriver stopping mid-scanline?
« Reply #10 on: May 17, 2024, 04:19:11 pm »
Thanks as always Zeb, you really helped me untangle this.

I had thought I reverted to vanilla ntsc but perhaps what happened is that VMM modified another GM install's mame.ini. That should teach me, if I keep around old versions I should at least make /mame, a fixed path, the current one or something.

So, I did this to myself, and here's how:
  • I tweaked the VMM timings by pushing this particular set to the very edge until it lost sync
  • I used that to generate new modes
  • I didn't quite realize that, stable sync doesn't mean every scanline can be drawn, so I inadvertently created my own modelines with these problems

Indeed, when regenerating modelines based on vanilla NTSC, and when making sure this actually modifies the RIGHT mame.ini, I don't have the >240 line modes and, for example, Ninja Spirit displays 480i or something and the whole image is visible. Readjusted my geometry for the new timings and I think I'm back on track.

Lesson learned!

UPDATE: Okay there was one new problem, but easy enough to fix. The first 2 modelines generated crashed my graphics card, so I set the minimum dotclock to 4.7MHz and now I think I've got a usable set.
« Last Edit: May 17, 2024, 04:47:00 pm by rogerxyz »
Current build: originally a Dig-Dug cabinet, previously turned into an iCade w/ LCD, now a PC-powered MAME cabinet with consumer CRT TV, GreenAntz transcoder, and crt_emudriver.

haynor666

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1505
  • Last login:November 08, 2024, 11:36:19 am
  • retro maniac
Re: crt_emudriver stopping mid-scanline?
« Reply #11 on: May 22, 2024, 11:51:28 am »
Please, read this - https://forum.arcadecontrols.com/index.php/topic,148828.msg1638016.html#msg1638016

and  https://forum.arcadecontrols.com/index.php/topic,159586.msg1678392.html#msg1678392

Please not that it's rather TVs problem not a modelines since such behavior I can observer on original SNES on my TV for example on Konami white logos last line ends in the midle.

In my case Sony TV was problem.
« Last Edit: May 22, 2024, 11:58:55 am by haynor666 »