MAME HLSL CRT SCANLINE EMULATION PRESETS

The place for all discussion on gaming hardware
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

HLSL on/off

v0.4 gives you the option of disabling HLSL but still using custom brightness/contrast/gamma settings for each game.

Image
Press "n" and hit ENTER



1. Raw digital color from game _ . _ (too bright from this game, Black Tiger)

Image


2. No HLSL, only brightness/contrast/gamma adjusted _ . _ (ready for output to actual CRT, or perhaps GLSL)

Image


3. Yes HLSL _ . _ (scanlines, bloom, etc. Please use medium or high setting for your LCD backlight)

Image



Game-specific color settings and CRT mimicking are managed separately now.
This makes things much more flexible, it allows you to avoid HLSL
when you want to play mame games on 5" mobile device, or use 2xSAI, or use GLSL, or use actual 15KHz CRT.
User avatar
s8n
Posts: 254
Joined: Tue Sep 15, 2009 6:30 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by s8n »

hi NUeda , thanks for your help it is appreciated. I have gone ahead and used the settings you mentioned and now i get full speed , there is one small issue though i don't know the technical name for it but there is a bit of 'ghosting' when my character moves (Final Fight) and also (League Bowling) it's a sort of like a slight blur when movement occurs. I tried this on my Main PC with the settings you mentioned and it happens on it as well as my MAME PC.

any tips welcome

Code: Select all

#
# CORE CONFIGURATION OPTIONS
#
readconfig                1
writeconfig               0

#
# CORE SEARCH PATH OPTIONS
#
homepath                  .
rompath                   "f:\ps2 torrents\MAME 0.200 ROMs (merged)"
hashpath                  hash
samplepath                samples
artpath                   artwork
ctrlrpath                 ctrlr
inipath                   .;ini;ini/presets
fontpath                  .
cheatpath                 cheat
crosshairpath             crosshair
pluginspath               plugins
languagepath              language
swpath                    software

#
# CORE OUTPUT DIRECTORY OPTIONS
#
cfg_directory             cfg
nvram_directory           nvram
input_directory           inp
state_directory           sta
snapshot_directory        snap
diff_directory            diff
comment_directory         comments

#
# CORE STATE/PLAYBACK OPTIONS
#
state                     
autosave                  0
rewind                    0
rewind_capacity           100
playback                  
record                    
record_timecode           0
exit_after_playback       0
mngwrite                  
aviwrite                  
wavwrite                  
snapname                  %g/%i
snapsize                  auto
snapview                  internal
snapbilinear              1
statename                 %g
burnin                    0

#
# CORE PERFORMANCE OPTIONS
#
autoframeskip             0
frameskip                 0
seconds_to_run            0
throttle                  1
syncrefresh               1
autosync                  1
sleep                     1
speed                     1.0
refreshspeed              0

#
# CORE RENDER OPTIONS
#
keepaspect                1
unevenstretch             1
unevenstretchx            0
unevenstretchy            0
autostretchxy             0
intoverscan               0
intscalex                 0
intscaley                 0

#
# CORE ROTATION OPTIONS
#
rotate                    1
ror                       0
rol                       0
autoror                   1
autorol                   0
flipx                     0
flipy                     0

#
# CORE ARTWORK OPTIONS
#
artwork_crop              1
use_backdrops             0
use_overlays              0
use_bezels                0
use_cpanels               0
use_marquees              0
fallback_artwork          
override_artwork          

#
# CORE SCREEN OPTIONS
#
brightness                0.92
contrast                  1.18
gamma                     1.0
pause_brightness          0.65
effect                    none

#
# CORE VECTOR OPTIONS
#
beam_width_min            1.0
beam_width_max            1.0
beam_intensity_weight     0
flicker                   0

#
# CORE SOUND OPTIONS
#
samplerate                48000
samples                   1
volume                    0

#
# CORE INPUT OPTIONS
#
coin_lockout              1
ctrlr                     
mouse                     0
joystick                  1
lightgun                  0
multikeyboard             0
multimouse                0
steadykey                 0
ui_active                 0
offscreen_reload          0
joystick_map              auto
joystick_deadzone         0.3
joystick_saturation       0.85
natural                   0
joystick_contradictory    0
coin_impulse              0

#
# CORE INPUT AUTOMATIC ENABLE OPTIONS
#
paddle_device             keyboard
adstick_device            keyboard
pedal_device              keyboard
dial_device               keyboard
trackball_device          keyboard
lightgun_device           keyboard
positional_device         keyboard
mouse_device              mouse

#
# CORE DEBUGGING OPTIONS
#
verbose                   0
log                       0
oslog                     0
debug                     0
update_in_pause           0
debugscript               

#
# CORE COMM OPTIONS
#
comm_localhost            0.0.0.0
comm_localport            15112
comm_remotehost           127.0.0.1
comm_remoteport           15112
comm_framesync            0

#
# CORE MISC OPTIONS
#
drc                       1
drc_use_c                 0
drc_log_uml               0
drc_log_native            0
bios                      
cheat                     0
skip_gameinfo             0
uifont                    default
ui                        cabinet
ramsize                   
confirm_quit              0
ui_mouse                  1
language                  English
nvram_save                1

#
# SCRIPTING OPTIONS
#
autoboot_command          
autoboot_delay            0
autoboot_script           
console                   0
plugins                   1
plugin                    
noplugin                  

#
# HTTP SERVER OPTIONS
#
http                      0
http_port                 8080
http_root                 web

#
# CORE SWITCHRES OPTIONS
#
modeline_generation       1
monitor                   lcd
orientation               horizontal
connector                 auto
interlace                 1
doublescan                1
super_width               2560
changeres                 1
powerstrip                0
lock_system_modes         1
lock_unsupported_modes    1
refresh_dont_care         0
dotclock_min              0
sync_refresh_tolerance    2.0
frame_delay               0
vsync_offset              0
black_frame_insertion     0
modeline                  auto
ps_timing                 auto
lcd_range                 auto
crt_range0                auto
crt_range1                auto
crt_range2                auto
crt_range3                auto
crt_range4                auto
crt_range5                auto
crt_range6                auto
crt_range7                auto
crt_range8                auto
crt_range9                auto

#
# OSD KEYBOARD MAPPING OPTIONS
#
uimodekey                 SCRLOCK

#
# OSD FONT OPTIONS
#
uifontprovider            auto

#
# OSD OUTPUT OPTIONS
#
output                    auto

#
# OSD INPUT OPTIONS
#
keyboardprovider          auto
mouseprovider             auto
lightgunprovider          auto
joystickprovider          auto

#
# OSD DEBUGGING OPTIONS
#
debugger                  auto
debugger_font             auto
debugger_font_size        0
watchdog                  0

#
# OSD PERFORMANCE OPTIONS
#
numprocessors             auto
bench                     0

#
# OSD VIDEO OPTIONS
#
video                     auto
numscreens                1
window                    0
maximize                  1
waitvsync                 1
monitorprovider           auto

#
# OSD PER-WINDOW VIDEO OPTIONS
#
screen                    auto
aspect                    auto
resolution                auto
view                      auto
screen0                   auto
aspect0                   auto
resolution0               auto
view0                     auto
screen1                   auto
aspect1                   auto
resolution1               auto
view1                     auto
screen2                   auto
aspect2                   auto
resolution2               auto
view2                     auto
screen3                   auto
aspect3                   auto
resolution3               auto
view3                     auto

#
# OSD FULL SCREEN OPTIONS
#
switchres                 1

#
# OSD ACCELERATED VIDEO OPTIONS
#
filter                    0
prescale                  1

#
# OpenGL-SPECIFIC OPTIONS
#
gl_forcepow2texture       0
gl_notexturerect          0
gl_vbo                    1
gl_pbo                    1
gl_glsl                   0
gl_glsl_filter            1
glsl_shader_mame0         none
glsl_shader_mame1         none
glsl_shader_mame2         none
glsl_shader_mame3         none
glsl_shader_mame4         none
glsl_shader_mame5         none
glsl_shader_mame6         none
glsl_shader_mame7         none
glsl_shader_mame8         none
glsl_shader_mame9         none
glsl_shader_screen0       none
glsl_shader_screen1       none
glsl_shader_screen2       none
glsl_shader_screen3       none
glsl_shader_screen4       none
glsl_shader_screen5       none
glsl_shader_screen6       none
glsl_shader_screen7       none
glsl_shader_screen8       none
glsl_shader_screen9       none

#
# OSD SOUND OPTIONS
#
sound                     auto
audio_latency             2.0

#
# PORTAUDIO OPTIONS
#
pa_api                    none
pa_device                 none
pa_latency                0

#
# BGFX POST-PROCESSING OPTIONS
#
bgfx_path                 bgfx
bgfx_backend              auto
bgfx_debug                0
bgfx_screen_chains        default
bgfx_shadow_mask          slot-mask.png
bgfx_avi_name             auto

#
# WINDOWS PERFORMANCE OPTIONS
#
priority                  0
profile                   0

#
# WINDOWS VIDEO OPTIONS
#
menu                      0

#
# DIRECT3D POST-PROCESSING OPTIONS
#
hlslpath                  hlsl
hlsl_enable               1
hlsl_oversampling         0
hlsl_write                auto
hlsl_snap_width           2048
hlsl_snap_height          1536
shadow_mask_tile_mode     0
shadow_mask_alpha         0
shadow_mask_texture       shadow-mask.png
shadow_mask_x_count       12
shadow_mask_y_count       6
shadow_mask_usize         0.5
shadow_mask_vsize         0.5
shadow_mask_uoffset       0.0
shadow_mask_voffset       0.0
distortion                0.0
cubic_distortion          0.0
distort_corner            0.0
round_corner              0.0
smooth_border             0.0
reflection                0.0
vignetting                0.0
scanline_alpha            0.3
scanline_size             1.0
scanline_height           1.0
scanline_variation        1.0
scanline_bright_scale     2.0
scanline_bright_offset    0.0
scanline_jitter           0.0
hum_bar_alpha             0.0
defocus                   0.75,0.0
converge_x                0.0,0.0,0.0
converge_y                0.0,0.0,0.0
radial_converge_x         0.0,0.0,0.0
radial_converge_y         0.0,0.0,0.0
red_ratio                 1.05,0.00,0.10
grn_ratio                 -0.10,1.00,0.25
blu_ratio                 -0.25,0.25,1.25
saturation                1.25
offset                    -0.30,-0.20,-0.05
scale                     1.15,1.05,0.90
power                     0.90,0.90,1.15
floor                     0.025,0.025,0.025
phosphor_life             0.25,0.25,0.25

#
# NTSC POST-PROCESSING OPTIONS
#
yiq_enable                0
yiq_jitter                0.0
yiq_cc                    3.57954545
yiq_a                     0.5
yiq_b                     0.5
yiq_o                     0.0
yiq_p                     1.0
yiq_n                     1.0
yiq_y                     6.0
yiq_i                     1.2
yiq_q                     0.6
yiq_scan_time             52.6
yiq_phase_count           2

#
# VECTOR POST-PROCESSING OPTIONS
#
vector_beam_smooth        0.0
vector_length_scale       0.5
vector_length_ratio       0.5

#
# BLOOM POST-PROCESSING OPTIONS
#
bloom_blend_mode          0
bloom_scale               0
bloom_overdrive           1.00,1.00,1.00
bloom_lvl0_weight         1.00
bloom_lvl1_weight         0.64
bloom_lvl2_weight         0.32
bloom_lvl3_weight         0.16
bloom_lvl4_weight         0.08
bloom_lvl5_weight         0.06
bloom_lvl6_weight         0.04
bloom_lvl7_weight         0.02
bloom_lvl8_weight         0.01

#
# FULL SCREEN OPTIONS
#
triplebuffer              0
full_screen_brightness    1.0
full_screen_contrast      1.0
full_screen_gamma         1.0

#
# INPUT DEVICE OPTIONS
#
global_inputs             0
dual_lightgun             0

Image
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

That's a nice kraylix. or is it from Arcadeworx ?

s8n wrote:but there is a bit of 'ghosting' when my character moves (Final Fight) and also (League Bowling) it's a sort of like a slight blur when movement occurs.
That ghosting issue can be solved by applying the following:

Code: Select all

phosphor_life             0,0,0

For final fight, I would make following adjustments, just to get cleaner colors:

Code: Select all

brightness                0.82
contrast                  1.18
gamma                     1.0

red_ratio                 1,0,0
grn_ratio                 0,1,0
blu_ratio                 0,0,1
saturation                1

offset                    -0.02,-0.02,-0.02
scale                     1.02,1.01,0.98
power                     1,1,1

floor                     0,0,0

For league bowling, everything is same as above (final fight) except

Code: Select all

brightness                1.0
contrast                  1.0

scale                     0.98,0.99,1.02
Last edited by NUeda on Mon Aug 27, 2018 3:50 am, edited 1 time in total.
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

Cleaner Colors, Sharper Pixels

Image
v0.3 (approximation)


Image
v0.4 Default setting


Image
v0.3 (approximation)


Image
v0.4 Default setting



v0.4 is still far from perfect but it's looking sharper/cleaner than previous version.



If you want to use previous version instead, it's offered as EXTRA preset: "film photo".
You can activate it by running INI_Creator_EXTRA.bat and choosing that preset in the menu.

Image
Press "n" and hit ENTER

Image
Press "2" and hit ENTER
User avatar
s8n
Posts: 254
Joined: Tue Sep 15, 2009 6:30 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by s8n »

hi NUeda , yes that's right it is from Arcadeworx in Australia Robert was amazing with everything. Thank You NUeda for the updated .ini settings i will try them ASAP , btw pics of between 0.3 and 0.4 are awesome the difference is impressive.
User avatar
s8n
Posts: 254
Joined: Tue Sep 15, 2009 6:30 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by s8n »

i'm back , phosphor_life definitely fixed my 'ghosting' issues. NU would i be correct the settings for Final Fight CPS1 are the same for CPS2 ?. Also i play Simpsons (Konami) do you have any suggestions for the .ini ?.

btw when you mentioned earlier about updating my GFX Card it didn't go unnoticed. I looked into it and my MAME PC ASUS Motherboard can do PCI Express 2.0 x16. The GFX Card you mentioned needs PCI Express 3.0 x16 , sure it will sort of revert back to 2.0 but i'm unsure if it will be able to achieve a benchmark of 1500+........thoughts ?

https://www.videocardbenchmark.net/gpu. ... 50&id=3588
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

Glad to hear the ghosting issue is fixed.

For final fight and most CPS1 games (not all), I would use

Code: Select all

brightness                0.82
contrast                  1.18
gamma                     1.0
For CPS2 games and simpsons (konami), I would use

Code: Select all

brightness                0.86
contrast                  1.14
gamma                     1.0
It's only a small difference but the colors of shadow/dark objects within the games
benefit from fine-tuning like this.




s8n wrote: it will be able to achieve a benchmark of 1500+........thoughts ?
I wouldn't worry about PCIe 2 vs 3.
There is a difference but it's not enough to ruin the general performance of the GPU.


GeForce GTX 980 Ti
Image


GeForce 700 (7xx) series Titan SLI
Image

https://www.hardwaresecrets.com/pci-exp ... ce-gain/4/
https://www.anandtech.com/show/7089/gef ... -vs-pcie-3


I'm told x4, x16 lane count is far more important.
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

s8n, I hope you didn't purchase any GPU yet.

Earlier I recommended getting GeForce GT 1030 (or Radeon R7 450) just for mame HLSL
but I just found out GT 1030 has some serious naming issues:

There are 2 models being sold with that name, one with DDR4 and the other with GDDR5
and GDDR5 model is at least twice as fast as the other.

They are both still below $100 but please be careful and double-check the specifications
if you were thinking of purchasing GT 1030.

Or you could just go with Radeon to avoid retailer making mistakes,
retailers don't read specifications and they just order items for inventory by name.
User avatar
s8n
Posts: 254
Joined: Tue Sep 15, 2009 6:30 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by s8n »

hi NU , thank you for the graphs you went to a lot of trouble and it's appreciated. I haven't bought a GFX Card yet but i thought i would take my Radeon 7770 from my main PC and put that in the MAME PC , then i would buy new GFX Card for my main PC.

Radeon 7770 Passsmark Score 2215

https://www.videocardbenchmark.net/gpu. ... 770&id=322

i have taken measurements for a PSU for the MAME PC and it will fit as well as the 7770 , i am going to do some tests today with HLSL V0.4 on my main PC that has the 7770 in it and make sure it can handle the task.

also thanks for the added info and warning on GFX Cards
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

no problem sir, I'm just trying to be useful.
User avatar
Antiriad
Posts: 32
Joined: Sun Sep 09, 2012 9:28 pm
Location: Italy

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Antiriad »

Hello NUeda and THANK YOU VERY MUCH for your great HLSL script, it's simply awesome.

I'd like to ask: I'm using a 16:9 gaming led monitor at 1920x1080@60hz. Do I need to manually alter some v.04 options to match my monitor resolution?
Thank you very much
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

hey Antiriad, I'm glad to hear it's useful for you.

v0.4 was designed for 1280x1024 monitor (= 1280x960 for 4:3) and
that is similar enough to 1920x1080 monitor (= 1440x1080 for 4:3),
so you don't have to change anything for the resolution difference.

Enjoy your games sir! :mrgreen:
User avatar
cyborc
Posts: 308
Joined: Wed Mar 25, 2009 6:26 am
Location: USA

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by cyborc »

NUeda,

Thanks for your hard work. I'm using your gamma/brightness tweaks on a CRT TV and games look much better now.
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

cyborc, you're welcome. :mrgreen:

I love how neogeo games need no brightness/gamma adjustment,
they are ready for CRT output even with their raw colors.




Speaking of which, I made a wrong guess here few years ago about why so many Japanese games have excessively bright colors,
back then I said it was for photography but now I too understand that can't be the reason.


My current guess is:

1. CRT monitors get darker as they age (NOTE: I read somewhere trinitron monitors get brighter)

2. arcade monitors are in constant operation, and at some point
they will get so dark that even the brightness control at max setting won't bring out dark color details

3. so to allow low-budget arcade operators to continue using old monitors and just upgrade to new game PCB,
game manufacturers deliberately designed the color palette to look well-balanced even when the monitor cannot show dark color details.

Or perhaps it was about selling (or renting out?) cabinets with company logo on them, like Capcom, and
making sure the game screen will be legible few years later, even on the aged CRT,
when newly released game PCB is installed.

I could be wrong, but this has monetary reasons so I think it makes some sense.
User avatar
Antiriad
Posts: 32
Joined: Sun Sep 09, 2012 9:28 pm
Location: Italy

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Antiriad »

Hi NUeda,
after running INI_Creator, I'd like to (slightly) "tweak" some aspects (brightness, bloom, curvature etc.) of (all) the games.
Is this possible? which file should I manually edit?

Thank you!
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

yes!
They're just .txt and .ini files so they're fully editable by the end-user.

INI creator looks at small .ini files inside its own _ini folder, like
03_9300k_240p.ini and 1991_japan_90s.ini and more
and
combines them and outputs single .ini file for each game into MAME/ini folder, like
sf2ce.ini.




If I was playing a game and wanted to change its picture settings, here's what I would do:


1. go to ini folder in your main MAME folder. (not in INI creator folder)

2. open .ini file for the game you want to adjust.

3. look at the # lines to know where the settings/numbers are coming from.
(MAME will ignore lines that start with # so they're used as reminder for the user)

4. use text editor to open those smaller files inside _ini folder (inside INI creator folder), edit them, and run INI creator again.



For example, if I want to change brightness settings for Street Fighter 2 CE,
I would go open sf2ce.ini in ini folder (in MAME folder) to see what is going on.
This is one section from inside sf2ce.ini :

Code: Select all

#--------------------------------

brightness                0.86
contrast                  1.14
gamma                     1.0


# INI_creator_-_list_config.txt 
# _list\list_1991_japan_90s.txt
# _ini\1991_japan_90s.ini
#--------------------------------
For this section, the numbers/settings are coming from 1991_japan_90s.ini
in _ini folder (inside INI creator folder).

Code: Select all

brightness                0.86
contrast                  1.14
gamma                     1.0
I can go open 1991_japan_90s.ini and change the brightness setting inside
and save that change and go run INI creator again.

NOTE:
For most games, sum of brightness + contrast must be 2.0
to ensure white pixels are showing RGB 255 white.

If it's lower than 2.0, white pixels will be darker than RGB 255 white.
If it's higher than 2.0, bright color pixels will start turning into RGB 255 white.

There are some games that don't show RGB 255 white for its brightest pixels
so for those you actually want brightness + contrast that is higher than 2.0.
Mega Drive/Genesis is like this.







For curvature,
majority of games will get numbers from 13_TV_trinitron_240p.ini or 02_6500k_240p.ini or 03_9300k_240p.ini.
The exact part you want to look at is:

Code: Select all

distortion                0.05
cubic_distortion          0.0
distort_corner            0.08
round_corner              0.2
I would adjust distortion to get the overall roundness I want
and then use just slightly higher number than that for distort_corner.

NOTE:
I wanted to use higher number for distortion
but it was starting to mess up shadow mask pattern.



And adjust round_corner to get the feel of small vs. larger CRT.






For bloom,
majority of games will get numbers from _yiq_0_trinitron.ini or _yiq_0.ini.

Code: Select all

scanline_bright_scale     1.4
scanline_bright_offset    0.4

yiq_enable                0

bloom_scale               0.05
I would suggest changing bloom_scale.

You can ignore yiq_enable.



scanline_bright_scale makes the pixels brighter against dark scanlines but with zero blur.

NOTE:
At high numbers it doesn't look correct, it gets this "burned" look to the colors.




scanline_bright_offset is functioning like bloom too, but it's not as blurry as bloom_scale.

NOTE:
But at high numbers it ruins the consistency of scanlines so I'm combining little bit of bloom_scale.








If there are more issues, please ask me again. :mrgreen:
User avatar
Antiriad
Posts: 32
Joined: Sun Sep 09, 2012 9:28 pm
Location: Italy

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Antiriad »

Thank you very much for your kind feedback!

What about games without specific ini files? (e.g. ffight)
Thank you
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

Hey, I'm just glad I could help.

When a game doesn't have its own .ini file in ini folder,
MAME will likely use the .ini file for that game's (system) driver.

Image

For final fight, if there is no ffight.ini, MAME will look at cps1.ini.
That .ini file will be inside mame/ini/source folder.

And if there is no cps1.ini, MAME will look at raster.ini and then mame.ini.


This method is good because you don't have to make .ini file for every single game if they are using same settings.
There are about 150 games for NeoGeo and they are all looking at neogeo.ini for picture settings.
User avatar
Antiriad
Posts: 32
Joined: Sun Sep 09, 2012 9:28 pm
Location: Italy

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Antiriad »

Great,
thank you very much for your explanation!

An "off-topic" question: it is possibile to assign (also) bezels by driver and not only by single rom?

Thank you
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

You're very much welcome!

About the bezel, sorry but I don't have a solution,
I too would like to know the solution for assigning it to the driver, not every rom. :|



I guess the decision is based on how American arcade cabinets have different bezel design for each game,
MAME will do a search for the artwork folder that has same name as the rom and load it automatically.



Few months ago I tried messing around with .ini file for the rom and assigning a different artwork folder
but MAME still wanted a folder that has same name with the rom.
That was 0.200 from August 2018. I don't know about latest version.
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

New HLSL setting designed for integrated GPU & outdated GPU
(This will be included in next version of INI Creator)

This setting was confirmed to output smooth 60 fps on Intel HD 2000 + 1280x1024 LCD so it should work fine on any office PC or laptop released during past 5 years.

Image

Image

(Click to see full size image. It will open in this window so do right click -> open in new tab)



I suggest applying these numbers to appropriate parts in your mame.ini and then
running INI creator v0.4 and choosing the custom setting that avoids HLSL.

HLSL setting will get read from mame.ini and brightness/contrast/gamma settings will be read from .ini file for each game.

Code: Select all

waitvsync                 1

hlsl_enable               1
hlsl_oversampling         0

shadow_mask_tile_mode     0
shadow_mask_alpha         0.2
shadow_mask_texture       aperture-grille.png
shadow_mask_x_count       16
shadow_mask_y_count       16
shadow_mask_usize         1
shadow_mask_vsize         1
shadow_mask_uoffset       0.0
shadow_mask_voffset       0.0

distortion                0
cubic_distortion          0
distort_corner            0
round_corner              0
smooth_border             0
reflection                0
vignetting                0

scanline_alpha            0.8
scanline_size             1.0
scanline_height           1.0
scanline_variation        1.0
scanline_bright_scale     1.0
scanline_bright_offset    1
scanline_jitter           0.2
hum_bar_alpha             0.03

defocus                   0,0

offset                    -0.02,-0.02,-0.02
scale                     0.98,1.02,1.10
power                     1.25,1.25,1.25

phosphor_life             0,0,0

yiq_enable                0

bloom_scale               0
It turns out fast GPU is not necessary for color adjustments, scanlines, and shadow masks.
However, you need discrete GPU for
distortion (curvature), defocus (blur), phosphor persistence, bloom (glow).


Incidentally, this setting gives sharp square pixels.
I imagine some people will prefer this sharp look. I personally prefer slightly blurry round pixels.

If you are happy with this setting, NUC/mini PC could be enough for your MAME + LCD setup.
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

HLSL Setting for integrated GPU & old entry-level GPU (updated from above setting)

Everything is same as above, except for:

Code: Select all

shadow_mask_alpha         0.35
shadow_mask_texture       aperture2x4rb.png
shadow_mask_x_count       4
shadow_mask_y_count       1024

scanline_alpha            1

scale                     0.90,0.94,1.02
power                     1.3,1.3,1.3
I recommend sitting somewhat far from the screen when playing game with this setting. The sharp pixels can be very tiring for your eyes.



(Click to see full size image. It will open in this window so do right click -> open in new tab)

Image

Image

Image

Image

Image

Image

Image

Image

Image

Image

Image

Image

Image
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

What about 720p LCD ?

Above HLSL settings are designed for windows PC that doesn't have proper GPU. (= office PC and laptops)

But what about a very basic windows laptop that doesn't even have 1080p screen ?

example:
Image
GPD Win (2016)
5.5" 1280x720
Intel Atom x7-Z8750 + integrated GPU



It turns out it is possible to use MAME HLSL + shadow mask + scanlines
on a laptop/PC that has 1280x720 (or 1366x768) LCD and no proper GPU.

Go to appropriate section in mame.ini file and use these numbers:

Code: Select all

keepaspect                1
unevenstretch             1
unevenstretchx            0
unevenstretchy            0
autostretchxy             1
intoverscan               0
intscalex                 0
intscaley                 0


shadow_mask_alpha         0.2

scanline_jitter           0
This will apply flexible scaling for horizontal resolution but integer scaling for vertical resolution.
(integer scaling becomes very important when using low-resolution LCD)

The scanlines will be perfectly consistent
at the cost of having black borders around the game screen.
(224 lines x 3 = 672, 720p - 672 = 48, black border of 24 pixels on top and 24 pixels on bottom.)

These screenshots are taken from 1280x720 output and cropped to 960x720.

Image

Image
NOTE: some NeoGeo games have black bars on both sides.
Rasp
Posts: 12
Joined: Sat Apr 08, 2017 10:22 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Rasp »

Hi Nueda

This is the first time I have used ini creator and I must say it has improved many of my favorite games.

I just have one question. In the waaay beginning of this thread you had a picture of Super Contra’s xenomorph that looked amazing. The contrast, gamma settings looked identical to a CRT. But after running ini creator that scene still is coming up as a lifeless gray color. Did you include the settings you used in that pic? The picture had like a bluish hue.

Also if I wanted to add Quadric Distortion Amount globally to all the ini’s how would I do that?
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

Hey Rasp,

I'm glad to hear it's being useful for your retro gaming enjoyment.

I have to tell you though, that bluish color and darkened gamma are very much exaggerated,
at the time I was trying to make everything look like game photographs in printed ads and flyers.
It looks good for this demo screen but will make everything too dark during actual game play.

Image . Image

____________________________ bluish and photographic ____________________________ . ____________________________ actually more accurate ______________________________





I can think of 2 methods for getting these colors again:


Method 1
This is the quickest way to get a similar picture setting, without editing the contents of any file.

1. go into _INI_Creator_v0.4 folder

2. go into _ini_EXTRA folder

3. find EXTRA_film_photo.ini and make duplicate of it (copy and then paste into different directory)

4. rename it to SCONTRA.ini

5. move that SCONTRA.ini into ini folder inside your mame folder.
(it will probably ask you about overwriting file, say yes)

MAME will look at this file to get picture settings when you play Super Contra.



Method 2
You could instead add SCONTRA to the list of games and run INI_Creator_EXTRA.bat.

1. go into _INI_Creator_v0.4 folder

2. go to _list_EXTRA folder

3. open list_EXTRA_film_photo.txt in a text editor.
you will see something like this:

Code: Select all

;==================================================
;%%L		%%M		%%N		%%O			%%P
;
;pixels 	lines	h/v		name		driver
;==================================================

no	no	h	cps1	.cpp
no	no	h	cps2	.cpp
no	no	h	cps3	.cpp
no	no	h	model1	.cpp
no	no	h	neogeo	.cpp
no	no	h	nes		.cpp
no	no	h	snes	.cpp

;--------------------------------------------------
add this item to the list

Code: Select all

no	no	v	SCONTRA   thunderx
and perhaps add ; in front of other lines
to not process them when running INI_Creator_EXTRA.bat.


4. return to _INI_Creator_v0.4 folder and run INI_Creator_EXTRA.bat
Image
and choose "n" when asked "Delete and exit script?"

Image
and choose "2" when asked about which list to process.

This will do the EXACT same thing as the 1st method.








About applying quadratic distortion (curvature) globally,
I'm sorry, there is no way right now for making change to just one file and have it distributed to all ini files
while using INI Creator package.
(actually there is one method but it breaks a rule about aperture grille monitors)


The change has to be made to 3 or more ini files in order to get it applied to majority of games.

1. go to _INI_Creator_v0.4 folder

2. go to _ini folder

3. use text editor to change appropriate sections inside files like these:
. 02_6500k_240p.ini
. 03_9300k_240p.ini
. 11_TV_240p.ini

4. run INI_Creator_v0.4.bat as you normally would.


Actually,
if you are okay with aperture grille + spherical curved screen,
then you could change quadratic distortion (curvature) number inside 13_TV_trinitron_240p.ini
and choose "y" when asked about default settings when running INI_Creator_v0.4.bat.

If you choose "y" when asked about default settings,
most games will get HLSL settings from 13_TV_trinitron_240p.ini
so this would be the closest thing to using a global HLSL setting in INI Creator.

You can also copy over shadow mask settings from 03_9300k_240p.ini
so 13_TV_trinitron_240p.ini stops using aperture grille.



Feel free to ask me again if there are more issues.
Last edited by NUeda on Fri Oct 26, 2018 1:09 pm, edited 1 time in total.
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

Rasp,
I did a bit more comparison and now I am feeling indecisive about Super Contra.
You may be right about the bluish colors, they seem to make more sense for this game.

Image . Image
Rasp
Posts: 12
Joined: Sat Apr 08, 2017 10:22 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Rasp »

Nueda, thanks for the detailed response.

So I watched some videos of the Super Contra PCB hooked to a CRT and it seems that gray color is correct, but it looks off imo. I think the blue tint brings the game out more. I guess I can just alter the ini file to make it look like how I want.
themanuel
Posts: 3
Joined: Sat Oct 27, 2018 1:28 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by themanuel »

Hi, all.

I've been working on catching up my setup to the latest mame revision but HLSL has changed so much that my old parameters don't work correctly anymore.

My biggest problem at the moment is with the shadow mask. In my old setup, it blended with the scanline and created a CRT monitor effect that I really like. However, now it only changes the color of the image and is otherwise invisible so only scanlines are obvious. I slapped my old setup together from examples from people that knew what they were doing (maybe even from this forum) and tweaked a thing or two.

Can somebody help translate my old parameters to the new HLSL system?
I've added both below.

Finally, how do the old "curvature" and "pincushion" correlate with the new distortion, cubic distortion, distort corner, round corner, etc.?

Old HLSL code:

Code: Select all

hlsl_enable               1
hlslpath                  hlsl
hlsl_prescale_x           4
hlsl_prescale_y           4
hlsl_preset               -1	
hlsl_write                
hlsl_snap_width           1024
hlsl_snap_height          768

shadow_mask_alpha         0.25
shadow_mask_texture       aperture.png
shadow_mask_x_count       320
shadow_mask_y_count       240
shadow_mask_usize         0.09375
shadow_mask_vsize         0.109375
#shadow_mask_usize         1
#shadow_mask_vsize         1
curvature                 0.03
pincushion                0.03
scanline_alpha            0.5
scanline_size             1.0
scanline_height           0.5
scanline_bright_scale     1.0
scanline_bright_offset    0.0
scanline_jitter           0.05
#defocus                   0.0,0.0
defocus                   0.5,0.5
converge_x                0.0,0.0,0.0
converge_y                0.0,0.0,0.0
radial_converge_x         0.0,0.0,0.0
radial_converge_y         0.0,0.0,0.0
saturation                1.0
red_ratio                 1.0,0.0,0.0
grn_ratio                 0.0,1.0,0.0
blu_ratio                 0.0,0.0,1.0
offset                    0.0,0.0,0.0
scale                     1.0,1.0,1.0
power                     1,1,1
#power                     0.9,0.9,0.9
floor                     0.0,0.0,0.0
phosphor_life             0.25,0.25,0.25
My attempt at applying it to the latest MAME:

Code: Select all

hlslpath                  hlsl
hlsl_enable               1
hlsl_oversampling         1
hlsl_write                auto
hlsl_snap_width           2048
hlsl_snap_height          1536
#shadow_mask_tile_mode     0
shadow_mask_tile_mode     1
#shadow_mask_alpha         0.0
shadow_mask_alpha         0.25
#shadow_mask_texture       shadow-mask.png
shadow_mask_texture       aperture.png
#shadow_mask_x_count       6
#shadow_mask_y_count       4
shadow_mask_x_count       320
shadow_mask_y_count       240
#shadow_mask_usize         0.1875
#shadow_mask_vsize         0.25
shadow_mask_usize         0.09375
shadow_mask_vsize         0.109375
shadow_mask_uoffset       0.0
shadow_mask_voffset       0.0
distortion                0.0
cubic_distortion          0.0
distort_corner            0.0
round_corner              0.0
smooth_border             0.0
reflection                0.0
vignetting                0.0
#scanline_alpha            0.0
scanline_alpha            0.5
scanline_size             1.0
#scanline_height           1.0
scanline_height           0.5
scanline_variation        1.0
scanline_bright_scale     1.0
scanline_bright_offset    0.0
#scanline_jitter           0.0
scanline_jitter           0.05
hum_bar_alpha             0.0
#defocus                   0.0,0.0
defocus                   0.5,0.5
converge_x                0.0,0.0,0.0
converge_y                0.0,0.0,0.0
radial_converge_x         0.0,0.0,0.0
radial_converge_y         0.0,0.0,0.0
red_ratio                 1.0,0.0,0.0
grn_ratio                 0.0,1.0,0.0
blu_ratio                 0.0,0.0,1.0
saturation                1.0
offset                    0.0,0.0,0.0
scale                     1.0,1.0,1.0
power                     1.0,1.0,1.0
floor                     0.0,0.0,0.0
#phosphor_life             0.0,0.0,0.0
phosphor_life             0.25,0.25,0.25
Thanks in advance.
energizerfellow‌
Posts: 208
Joined: Thu Sep 27, 2018 1:04 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by energizerfellow‌ »

What white point is your display calibrated for? That looks like a 6500k vs 9300k (aka D65 and D93) issue. Arcade monitors and Japanese TVs prior to the mid-90s or so are 9300k, so a game like Super Contra is almost certainly made for 9300k and would need a LUT for a modern D65 calibrated display. This is almost certainly the root cause of the NES color controversy, generally speaking. NUeda's Super Contra examples on the right definitely look more accurate for how a CRT of the right color temperature would display the image.
Rasp
Posts: 12
Joined: Sat Apr 08, 2017 10:22 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Rasp »

energizerfellow‌ wrote:What white point is your display calibrated for? That looks like a 6500k vs 9300k (aka D65 and D93) issue. Arcade monitors and Japanese TVs prior to the mid-90s or so are 9300k, so a game like Super Contra is almost certainly made for 9300k and would need a LUT for a modern D65 calibrated display. This is almost certainly the root cause of the NES color controversy, generally speaking. NUeda's Super Contra examples on the right definitely look more accurate for how a CRT of the right color temperature would display the image.

My display? Or Nueda’s?

So you’re saying that the “bluish” tint is correct?
Post Reply