Thursday 27 October 2011

OLD VERSION: JClampy's 320x224 resolution 4x magnification Shadow Mask settings.

OLD VERSION:
This is an old version that is only for archival purposes at the moment and may get removed in the future.
Read about the NEW VERSION here;
http://gamingnos.blogspot.com/2011/11/new-jclampys-neo-geo-mame-hlsl-setup.html
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

These settings are for 320x224 resolution of which is currently about 1,500 games including clones (includes all Neo Geo games as well) for display at 4x magnification.

First you need my 4x Aperture available from my previous post here;
http://gamingnos.blogspot.com/2011/10/thoughts-on-mame-hlsl-when-using-shadow.html

These are the settings you should use:
mame.ini
effect             none      (old visual effects off)
scale_effect    none      (old visual effects off)
switchres           1        (enable resolution settings)
sleep                0        (power saving sleep mode off)
keepaspect        1        (maintain aspect ratios)
prescale            1        (no software prescale)
hwstretch          0        (hardware stretching off)
filter                 0        (bilinear filtering off)
artwork_crop      0        (crop border artwork off)

For 320x224 original game resolution output to 1280x896 4x magnification, inside a final output display resolution 1280x960:
mame.ini
aspect ratio      4:3       (correct aspect ratio for our final display output)
resolution    1280x960   (our final display output resolution)
view         pixel aspect  (keep to games aspect ratio 320x240 = 10:7)

hlsl.ini
hlsl_prescale_x     4      (4x zoom)
hlsl_prescale_y     4      (4x zoom)
hlsl_snap_width     1280   (rendered snapshots resolution width at correct output ratio for game pixels to shadow mask alignment)
hlsl_snap_height     960    (rendered snapshots resolution height at correct output ratio for game pixels to shadow mask alignment)
shadow_mask_alpha        0.200000 (my personal preference)
shadow_mask_texture        JClampyAperture4xPatternC.png
shadow_mask_x_count       256
shadow_mask_y_count       128
shadow_mask_usize         0.465000
shadow_mask_vsize         0.500000


For 320x224 original game resolution output to 1280x896 4x magnification, inside a final output display resolution 1280x1024:
mame.ini
aspect ratio      5:4       (correct aspect ratio for our final display output)
resolution    1280x1024   (our final display output resolution)
view         pixel aspect  (keep to games aspect ratio 320x240 = 10:7)

hlsl.ini
hlsl_prescale_x     4      (4x zoom)
hlsl_prescale_y     4      (4x zoom)
hlsl_snap_width     1280   (rendered snapshots resolution width at correct output ratio for game pixels to shadow mask alignment)
hlsl_snap_height     1024    (rendered snapshots resolution height at correct output ratio for game pixels to shadow mask alignment)
shadow_mask_alpha        0.200000 (my personal preference)
shadow_mask_texture        JClampyAperture4xPatternC.png
shadow_mask_x_count       256
shadow_mask_y_count       128
shadow_mask_usize         0.465000
shadow_mask_vsize         0.500000


In both situations the game will be shown in correct aspect ratio at correct resolution of 4x magnification. It will appear in center of the screen and MAME will create borders around the outside; looking like this:

For Neo Geo games that only use the centermost 304 pixels you mant want to enhance the look of the bordering (because as you can see above sometimes there are small glitches). To do this you can use MAME's 'Border Artwork' feature or even use/create some custom borders.

Here are some standard black borders that I have put together; includes 'Upper Border', 'Centered Display', and 'Lower Border' variations. If you wanted to create your own custom border artwork then you could use them as a template.

For Neo Geo 320x224 original game resolution output to 1280x896 4x magnification, inside a final output display resolution 1280x960:
You can get the file from here: http://www.mediafire.com/?78b2fe1wg7kr728
Then follow these three easy steps;
1. Copy the .zip file to your Mame/Artwork folder.
2. Rename the .zip file so that it will have the same name as the 'MAME Game .zip Name' that you want to play. IE; "Twinkle Star Sprites" would be twinspri.zip this way the border artwork will be automatically initialised by MAME when you run that game.
3. Inside the .zip file you also have to rename the 'change name to game zip name.lay' file as well. So for this example rename it to: twinspri.lay
Then you are all ready to go!

Once you have the game running in MAME for the first time, you need to press the [Tab] key to bring up the 'in-game menu'. Then select and [Enter] into the 'video options' sub menu. From here you can select between the three new options; 'Upper Border', 'Centered Display', and 'Lower Border' by pressing [Enter] on them. Press the [Tab] key again to exit out of the 'in-game menu'. MAME will remember your selection from now on.


For Neo Geo 320x224 original game resolution output to 1280x896 4x magnification, inside a final output display resolution 1280x1024:
You can get the file from here: http://www.mediafire.com/?rsxxmyim3sd7sx8
Then follow these three easy steps;
1. Copy the .zip file to your Mame/Artwork folder.
2. Rename the .zip file so that it will have the same name as the 'MAME Game .zip Name' that you want to play. IE; "Twinkle Star Sprites" would be twinspri.zip this way the border artwork will be automatically initialised by MAME when you run that game.
3. Inside the .zip file you also have to rename the 'change name to game zip name.lay' file as well. So for this example rename it to: twinspri.lay
Then you are all ready to go!

Once you have the game running in MAME for the first time, you need to press the [Tab] key to bring up the 'in-game menu'. Then select and [Enter] into the 'video options' sub menu. From here you can select between the three new options; 'Upper Border', 'Centered Display', and 'Lower Border' by pressing [Enter] on them. Press the [Tab] key again to exit out of the 'in-game menu'. MAME will remember your selection from now on.

Wednesday 26 October 2011

JClampy's HLSL 'Rendered Snapshots' Shadow Mask

The HLSL 'Rendered Snapshots' feature can be used to create large resolution pre-rendered screenshots that can be of a resolution beyond what our video cards or monitors can even display. The image is pre-rendered by the computer in the background and is saved to file's instead of being sent to the monitor. The pre-rendered image is broken into four parts (each corner of the screen) and then saved to four files, all we need to do then is use an image editor to paste the four seperate images into one large image. This process of splitting the image into four sections is how it is possible for the video card to render an image larger than what would normally be possible. Each of the four corner images can have a resolution of up to the maximum texture size limit of your video card.

In MAME a normal snapshot can be taken by the [F12] key. For a 'rendered snapshot' you have to press the [LEFT ALT] & [F12] keys at the same time. The 'rendered snapshots' will appear in your 'MAME/SNAP/game name/' folder as four seperate file names; for example 0005_0.png + 0005_1.png +0005_2.png +0005_3.png. Alternatively a normal snapshot would have a filename like 0005.png, notice the difference. To finish making our 'rendered snapshot' we just need to paste the four numbered files into one large image using our favourite image editing software (I prefer the excellent free GIMP). file number '0' is for top left corner, '1' top right corner, '2' bottom left corner, '3' bottom right corner.

To choose the resolution that we want our final 'rendered snapshot' we use these settings in our hlsl.ini:
hlsl_snap_width       2560
hlsl_snap_height      1920
Ideally you should be using a 'magnification' (multiplication/zoom) of the games original resolution. In this example I am doing a 8x magnification of a 320x240 game.

At the moment this is doing a kind of 'software zoom' and can produce some blurriness to the image. To get around this we can use 'pre-scaling' which is what I will call 'hardware zoom'. This uses the power of the video card to pre-magnify the image without causing the unwanted blurriness. To use this feature we can use these settings in our hlsl.ini:
hlsl_prescale_x       8
hlsl_prescale_y       8
In this example I am getting the video card to pre-scale the image up to the 8x magnification before hand so to eliminate blurriness. Your video card must have enough 'Video RAM' to perform this; in this example it used about 350MB.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hot off the press, this is a new 'Shadow Mask' aperture file that I put together today. I was able to put some new theories into practise and got this working.

I have created a 'Shadow Mask' aperture for producing 12x magnification 'rendered snapshots'. You can get the file here;http://www.mediafire.com/?vk9xgsep8ozj0xb

You need to extract the NEW Shadow Mask .png file to your MAME or MESS artwork folder. At the moment I have only tested and calculated settings for one resolution;

320x240 original game resolution output to 3840x2880 12x magnification:
hlsl.ini
hlsl_prescale_x     12      (12x zoom)
hlsl_prescale_y     12      (12x zoom)
hlsl_snap_width     3840   (rendered snapshots resolution width at correct output ratio for game pixels to shadow mask alignment)
hlsl_snap_height     2880    (rendered snapshots resolution height at correct output ratio for game pixels to shadow mask alignment)
shadow_mask_alpha      0.250000    (my personal preference)
shadow_mask_texture        JClampyAperture12xPatternA.png
shadow_mask_x_count       256
shadow_mask_y_count       128
shadow_mask_usize         0.860000
shadow_mask_vsize         0.500000


mame.ini
effect             none      (old visual effects off)
scale_effect    none      (old visual effects off)
switchres           1        (enable resolution settings)
sleep                0        (power saving sleep mode off)
keepaspect        1        (maintain aspect ratios)
prescale            1        (no software prescale)
hwstretch          0        (hardware stretching off)
filter                 0        (bilinear filtering off)
artwork_crop      0        (crop border artwork off)


This 12x prescale required 800MB of video RAM going from 320x240 to 3840x2880.
Here is a zoomed in area of the final image showing the shadow mask;

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Finding correct settings is a long, difficult, and slow process. If you
think you could help with this process then please contact me.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Please do not steal or use my work or settings without crediting me.
Otherwise I will take everything offline for my personal use only.


Special credit/thanks to Ryan Holtz aka 'Just Desserts', Bat Country Entertainment, cgwg and all those involved in creating and maintaining the HLSL filter for MAME and MESS.

Saturday 15 October 2011

JClampy's Shadow Mask's for MAME/MESS HLSL Filter!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Update 27-10-2011 ~ Just fine tuning some settings

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Ok, this is a WIP so I will update my blog as I get further progress with this.

I will not explain how all this works as it is very complicated. If anyone wants to help find settings for resolutions then make contact with me, either here or this thread here. It is quite difficult and involved, so not for the feint of heart. On average it can take one hour to find settings for one resolution.

I have a square screen, not a widescreen, so cannot test for widescreen displays. If you use a widescreen and can't get desired effects then you will have to use MAME's 'Border Artwork' feature to get the game image displayed in a correct aspect ratio window.

These settings work, so if they do not work for you then;
1. You are not doing something right!
2. You are using 'Aperture4xZoom.png' while not outputing game at a 4x zoomed resolution. Or 'Aperture3xZoom.png' while not outputing game at a 3x zoomed resolution.
3. You are not using correctly matched 'shadow_mask_usize' & shadow_mask_vsize' settings for the resolution you are outputting at.
4. Double check all MAME & HLSL settings, maybe delete all individual game ini and cfg files if you have too?
5. Your graphic card must be compatible with Shader Version 3.0 to use HLSL
6. You are not doing something right!

First you need my "JClampy's NEW aperture" files;
Aperture to be used with 4x magnification http://www.mediafire.com/?5n79r8noxbf9vr6
Aperture to be used with 3x magnification http://www.mediafire.com/?buuwcc1dcxy4xt7

You need to extract the NEW Shadow Mask .png files to your MAME or MESS artwork folder. Then you need to use these following settings;

mame.ini
effect             none      (old visual effects off)
scale_effect    none      (old visual effects off)
switchres           1        (enable resolution settings)
sleep                0        (power saving sleep mode off)
keepaspect        1        (maintain aspect ratios)
prescale            1        (no software prescale)
hwstretch          0        (hardware stretching off)
filter                 0        (bilinear filtering off)
artwork_crop      0        (crop border artwork off)


320x240 original game resolution output to 1280x960 4x magnification:
mame.ini
aspect ratio      4:3       (correct aspect ratio)
resolution    1280x960   (4x magnification resolution)
view         pixel aspect  (keep to games aspect ratio)

hlsl.ini
hlsl_prescale_x     4      (4x zoom)
hlsl_prescale_y     4      (4x zoom)
hlsl_snap_width     1280   (rendered snapshots resolution width at correct output ratio for game pixels to shadow mask alignment)
hlsl_snap_height     960    (rendered snapshots resolution height at correct output ratio for game pixels to shadow mask alignment)
shadow_mask_alpha        0.150000 (my personal preference)
shadow_mask_texture        JClampyAperture4xPatternC.png
shadow_mask_x_count       256
shadow_mask_y_count       128
shadow_mask_usize         0.465000
shadow_mask_vsize         0.500000


320x256 original game resolution output to 1280x1024 4x magnification:


mame.ini
aspect ratio      5:4        (correct aspect ratio)
resolution    1280x1024  (4x magnification resolution)
view         pixel aspect   (keep to games aspect ratio)

hlsl.ini
hlsl_prescale_x     4      (4x zoom)
hlsl_prescale_y     4      (4x zoom)
hlsl_snap_width     1280   (rendered snapshots resolution width at correct output ratio for game pixels to shadow mask alignment)
hlsl_snap_height    1024   (rendered snapshots resolution height at correct output ratio for game pixels to shadow mask alignment)
shadow_mask_alpha       0.150000    (my personal preference)
shadow_mask_texture      JClampyAperture4xPatternC.png
shadow_mask_x_count      256
shadow_mask_y_count      256
shadow_mask_usize        0.460000
shadow_mask_vsize        0.440000


288x216 original game resolution output to 1152x864 4x magnification:
mame.ini
aspect ratio      4:3       (correct aspect ratio)
resolution    1152x864   (4x magnification resolution)
view         pixel aspect  (keep to games aspect ratio)

hlsl.ini
hlsl_prescale_x     4      (4x zoom)
hlsl_prescale_y     4      (4x zoom)
hlsl_snap_width     1152   (rendered snapshots resolution width at correct output ratio for game pixels to shadow mask alignment)
hlsl_snap_height     864    (rendered snapshots resolution height at correct output ratio for game pixels to shadow mask alignment)
shadow_mask_alpha        0.150000 (my personal preference)
shadow_mask_texture        JClampyAperture4xPatternC.png
shadow_mask_x_count       256
shadow_mask_y_count       128
shadow_mask_usize         0.455000
shadow_mask_vsize         0.487500


256x192 original game resolution output to 1024x768 4x magnification:
mame.ini
aspect ratio      4:3       (correct aspect ratio)
resolution    1024x768   (4x magnification resolution)
view         pixel aspect  (keep to games aspect ratio)

hlsl.ini
hlsl_prescale_x     4      (4x zoom)
hlsl_prescale_y     4      (4x zoom)
hlsl_snap_width     1024   (rendered snapshots resolution width at correct output ratio for game pixels to shadow mask alignment)
hlsl_snap_height     768    (rendered snapshots resolution height at correct output ratio for game pixels to shadow mask alignment)
shadow_mask_alpha        0.150000 (my personal preference)
shadow_mask_texture        JClampyAperture4xPatternC.png
shadow_mask_x_count       256
shadow_mask_y_count       128
shadow_mask_usize         0.445000
shadow_mask_vsize         0.480000


320x240 original game resolution output to 960x720 3x magnification:
(shown in example screenshot using border artwork)
mame.ini
aspect ratio      5:4       (correct aspect ratio)
resolution    1280x1024   (output resolution including border artwork)
view         pixel aspect  (keep to games aspect ratio)

hlsl.ini
hlsl_prescale_x     3      (3x zoom)
hlsl_prescale_y     3      (3x zoom)
hlsl_snap_width     960   (rendered snapshots resolution width at correct output ratio for game pixels to shadow mask alignment)
hlsl_snap_height     720    (rendered snapshots resolution height at correct output ratio for game pixels to shadow mask alignment)
shadow_mask_alpha        0.150000 (my personal preference)
shadow_mask_texture        JClampyAperture3xPatternC.png
shadow_mask_x_count       128
shadow_mask_y_count       64
shadow_mask_usize         0.750000
shadow_mask_vsize         0.707500

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Finding correct settings is a long, difficult, and slow process. If you
think you could help with this process then please contact me.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Please do not steal or use my work or settings without crediting me.
Otherwise I will take everything offline for my personal use only.


Special credit/thanks to Ryan Holtz aka 'Just Desserts', Bat Country Entertainment, cgwg and all those involved in creating and maintaining the HLSL filter for MAME and MESS.

Friday 14 October 2011

Quick Start MAME HLSL Guide

If you are missing the HLSL folder in your Mame, you can get it from here.
http://www.mediafire.com/?ns2gn8pf2wf8ngy
Extract the .zip file to your Mame folder and it will automatically create the HLSL folder for you.

*Sometimes with HLSL if you try to [ALT][TAB] to desktop, Mame will crash when you go back to it. If you need to go to your desktop then you probably want to use save states for the game you are playing. Does not happen with all games though.
**You may notice a error box come up everytime you exit from a game. That is an on going bug between HLSL and Mame that has not been fixed yet. On further inspection it might actually be a conflict/bug with the M+GUI. Just ignore it as does not crash Mame and you can load another game up straight away.

I have not tested whether multiple individual HLSL settings files are working yet so I will say easiest way for people to test at the moment is to use a single HLSL.ini file for all games which I will show you how to setup below:

You must have two files in your artwork folder (aperture.png & white.png) these are the default ones that are included with the HLSL filter:
http://www.mediafire.com/?5u2t6zm25op8of2

***DO NOT MAKE CHANGES TO HLSL SETTINGS INSIDE MAME, USE NOTEPAD***
HLSL is still tricky to work with, but here is some tips;
1. In Mame folder mame.ini make sure these are setup:
#
# DIRECT3D POST-PROCESSING OPTIONS
#
hlsl_enable 1 (Turn HLSL on with 1 or Turn HLSL off with 0)
hlslpath hlsl (Folder inside MAME where HLSL files are kept)
hlsl_ini_read 1 (Tells MAME to read HLSL ini file for settings otherwise read from inside mame.ini only)
hlsl_ini_write 0 (Tells MAME to write any HLSL changes made in mame.ini to hlsl.ini, in previous versions 'overwriting' settings was problematic so was recommended not to use this option and make adjustments to hlsl.ini manually. I have not tested whether it is fixed yet or not.)
hlslini hlsl.ini (Name of hlsl settings file, I just use hlsl.ini at moment)
hlsl_preset -1 (Currently an undocumented setting)
shadow_mask_texture aperture.png (Name of shadow_mask 'overlay' file)

You must have hlsl.ini file in your hlsl folder, you can download my example for "Metal Slug 1" here but you need to change settings to suit as in step2 below:
http://www.mediafire.com/?c41stv15oetuft1

***DO NOT COPY AND PASTE THIS AS MY EXTRA COMMENTS WILL BREAK FILE***
2. In HLSL folder hlsl.ini is where you do all your settings manually in notepad:
hlsl_enable 1 (Turn HLSL on with 1 or Turn HLSL off with 0, best to configure this setting in mame.ini)
hlsl_prescale_x 2 (This setting can give you a 'sharper' image depending on what resolution you play games at. For example, if you are playing a 320x240 game at 1280x960 then you are using a 4x magnification. Here you put 4 for a 4x pre-multiplication in horizontal pixels)
hlsl_prescale_y 2 (This setting can give you a 'sharper' image depending on what resolution you play games at. For example, if you are playing a 320x240 game at 960x720 then you are using a 3x magnification. Here you put 3 for a 3x pre-multiplication in vertical pixels)
hlsl_preset -1 (Currently an undocumented setting)
hlsl_snap_width 5120 (This setting sets the width for huge resolution 'rendered snapshots' that can be created by default hotkey [LEFT ALT] & [F12]. Usually best used at a multiple of your playing output resolution. For example 1280 wide x4 = 4160)
hlsl_snap_height 3840 (This setting sets the height for huge resolution 'rendered snapshots' that can be created by default hotkey [LEFT ALT] & [F12]. Usually best used at a multiple of your playing output resolution. For example 960 high x4 = 3840)
shadow_mask_alpha 0.050000 (visibility of shadow mask, when using big game display output use small numbers here. If you use the default aperture.png you need to use an even smaller number here to remove the moiré effect)
shadow_mask_texture aperture.png (Name of shadow_mask 'overlay' file)
shadow_mask_x_count 320 (Here is where we tell the HLSL file how many times to tile the 'aperture.png' to fill the resolution. Using the default 'aperture.png' you will notice moiré effects. To remove this problem input the original games width resolution here)
shadow_mask_y_count 240 (Here is where we tell the HLSL file how many times to tile the 'aperture.png' to fill the resolution. Using the default 'aperture.png' you will notice moiré effects. To remove this problem input the original games height resolution here)
shadow_mask_usize 0.187500 (This tells the HLSL filter how to wrap the 'aperture.png' horizontally so that when tiling everything will line up correctly. Doesn't work correctly with the default 'aperture.png')
shadow_mask_vsize 0.093750 (This tells the HLSL filter how to wrap the 'aperture.png' vertically so that when tiling everything will line up correctly. Doesn't work correctly with the default 'aperture.png')
curvature 0.150000 (Suppose to curve the 'aperture.png' with the curve of the screen if you also use pincushin? Is working with recent HLSL versions)
pincushion 0.150000 (This can give you that cool fishbowl effect. Is working with recent HLSL versions)
scanline_alpha 0.100000 (visibility of scanlines, when using big game display output use small numbers here)
scanline_size 1.000000 (just set to one if you want them? Unrevised setting)
scanline_height 0.750000 (this is like 75% scanline which is personal preference? Undocumented setting)
scanline_bright_scale 1.000000 (just set to one if you want them? Unrevised setting)
scanline_bright_offset 0.500000 (this is like 50% so they don't show up too strong? Unrevised setting)
scanline_jitter 0.000000 (I don't use, makes scanlines shimmer up and down. Is working with recent HLSL versions. Unrevised setting)
defocus 0.000000,0.000000 (I don't use defocus as is only used to add blurriness to your game image, yuck!)
converge_x 0.000000,0.000000,0.000000 (I don't use, suppose to offset pixel position by colours)
converge_y 0.000000,0.000000,0.000000 (I don't use, suppose to offset pixel position by colours)
radial_converge_x 0.000000,0.000000,0.000000 (I don't use, suppose to offset pixel position by colours)
radial_converge_y 0.000000,0.000000,0.000000 (I don't use, suppose to offset pixel position by colours)
red_ratio 1.000000,0.000000,0.000000 (leave alone, red ratio 100%)
grn_ratio 0.000000,1.000000,0.000000 (leave alone, green ratio 100%)
blu_ratio 0.000000,0.000000,1.000000 (leave alone, blue ratio 100%)
saturation 1.150000 (this is saturation, how strong colours look/bleed, don't set too high)
offset 0.000000,0.000000,0.000000 (I don't use, suppose to offset strength of red,blue,green)
scale 0.950000,0.950000,0.950000 (I think of this like brightness control, where 1.0 = 100%)
power 1.100000,1.100000,1.100000 (I think of this like contrast control, where 1.0 = 100%)
floor 0.000000,0.000000,0.000000 (I think of this like gamma control, I don't like gamma creates washed out colours)
phosphor_life 0.200000,0.200000,0.200000 (can create a ghosting effect on fast moving sprites, up to you if you like or not? When using big game display output use small numbers here)

*What I mean by big game display output is like when you take original game resolution of 320x240 and output that at 1280x960 or even bigger for example. Some of the above settings are very sensitive to this and so we have to use smaller numbers, for example 0.200000 instead of 1.000000.
**Game output resolution is setup inside Mame, so you would have already done that before and know what your output resolution is.
**To keep aspect ratio with big output resolutions you may need to use Mame's bezel border artwork feature to do this. It is actually a very powerful feature that is fully customizable, for instance you could set it up so you just have plain black borders with no artwork if you want. Can even create some nice transparent edged borders instead of hard edged and you can also place the game display box in any position of screen. Also is really good because you can create any magnification or aspect ratio for game output display as you like as is unlimited possibilities. When making my own border artwork I find it is best to work in 1:1 ratio, for example if my display output is 1280x1024 then I make my border artwork at 1280x1024 and then put a 304x224 game 4x aspect ratio 1216x896 into a box inside the border of 1280x1024. Looks really good and crystal clear.    

4. Having everything setup like above means that there is only one hlsl.ini file that is used all the time for all games.
I find that best way to setup hlsl.ini file is per original game resolutions. For example one hlsl.ini file for all 320x240 games, one hlsl.ini file for all 288x224 games, etc, etc....
If some games of certain driver all have same resolution maybe you could make a hlsl.ini just for NeoGeo games for example???
This means you have to create your own backup of hlsl.ini with names that you can remember and then copy and paste hlsl.ini when you want to play a game. I know sounds sucky but that is only way it works at moment because the current HLSL implementation does not overwrite settings properly from inside Mame which is why we have to modify hlsl.ini manually with notepad. Maybe in future will work properly and no longer a problem?

5. You can have Mame running and quit out of game. Then make changes in hlsl.ini with notepad and save. Then switch back to Mame and start game up. Then quit out of game and make more changes to hlsl.ini with notepad and save. Then switch back to Mame and start game up. Repeat, repeat, repeat... (You don't need to exit Mame and then restart Mame, each time, see).

Once you have seen HLSL setup properly you can never go back!
Here is an example of MSlug1 320x224 (original game res including internal aspect ratio black borders) HLSL to 1280x896 then displayed inside custom made bezel artworked canvas of 1280x1024 (native res of my monitor)
http://i49.servimg.com/u/f49/16/79/18/18/best_m10.jpg