I used a hue "value-1" as the basis for the phi calculation. however,
it makes much more sense to use "value" and then rotate by 33° (YUV to
YIQ conversion)
clarified (comments etc.) how the base phi value is adjusted before
taking the sin/cos, for both NTSC and PAL generation
change of phase slider in preferences window rounds the value to one
decimal place before saving to prefs value. this means that matching to
the preset value can be achieved
single, flicker and composite replaced with single, double, triple
added a new movement mode (hotkey alt-F12). this tries to recreate the
old composite mode
screenshotting is now much simpler and uses gl.ReadPixels() to capture
the screen buffer as it is displayed
currently include any windows and icons etc that have also been drawn to
the screen
if pixel perfect is disabled and using bevel is enabled, then the curve
and rounded corners amount are fixed values specific to the selected
bevel. currently only the 'solid state' bevel is allowed
set new default values for crt preferences
increased perlin noise value for CRT screen
including the removal of 'ghosting' shader. this was useful for
exagerrating the zookeeper brick effect but it wasn't necessary (because
of how we scale the image). also, it was a confusing name with regards
to the ghosting effect inherent in the chroma interference. rather than
change the name I just removed it
the crt 'enabled' setting has been renamed to 'pixel perfect' (which is
an inverted value). I find this easier to think about
the RGB value in the screen texture is gamma corrected but some effects
work best with YIQ values. converting to and from YIQ requires undoing
and redoing the gamma correction
instructions.Definitions can just be accessed directly. not sure why I
thought I needed the GetDefintions() function. I'm confident that it
isn't necessary
undocumented flag was flipped (ie. normal instructions were flagged as
undocumented and vice-versa). fortunately, we don't actually use this
flag for anything so it would have gone unnoticed except for some
experiments into peripheral fingerprinting
the defaults work well for all three colour methods
all tv specifications use the same gamma value
removed computed CRT bevel effect. removed CRT flicker effect
reverted vignette effect changes
brightness of interference effect regulated to match brightness when
interference effect is disabled
refined scanline/mask effect. now works on Y channel rather than the RGB
for lack of better evidence changes to NUSIZx was handled towards the
end of the colour clock. however, an example has now been found that
demonstrates that it should happen earlier
for the time being only the missile NUSIZx is treated in this way. a
note has been added to say that the player NUSIZx should also be handled
at the same time. the note goes onto say however, that the player NUSIZx
function has been tuned with the assumption that it happens later. a
very old comment also exists saying that the player NUSIZx function
looks complicated and could probably be simplified. I think that's
correct and the earlier handling is the key to that
this covers the situation where a ROM was selected on the command line.
we want the ROM select window to behave as though the command line ROM
was selected in the window
perlin noise no longer used as part of the interference effect. it's
still used to add a small amount of noise to help remove banding, but
it's always there
added YIQ interference
the aberration effect is also always appled. the difference with this
commit is that the when the effect is disabled, the intensity of the
effect is simply reduced to zero. this isn't the same as no applying
the effect at all
the aberration effect accumulates two pixels into one. previously an
average was taken but allowing the intensity to increase slightly is
effective and has been kept at 70% (rather than 50%)
black correction shader folded into crt effects shader
increased base saturation during colour generation
tweaked screen offset for solidstate bevel
increased magnitude of vignette effect
colour generation uses clock values as appropriate for NTSC and PAL.
special treatment of PAL-M is not considered yet (for colour
generation), it's just the NTSC palette, but we could add that in the
future relatively easily
NTSC cache used for PAL grayscale value. this clearly slows down PAL
colour generation (recalculation of uncached values) and wrecks NTSC
caching for NTSC ROMs loaded after a PAL ROM
if the name of the directory to be read hadn't changed then the result
was returned immediately but with the complete flag being set
this caused the ROM select window to forever centre on the currently
selected file. the bug was not noticeable unless the select window was
used for a second time in a session
the archivefs set channel now expects an instance of an Options type.
added a force option to instruct archivefs to always re-read directory
removed tv_color fragment shader. this simplifies the render path
considerably. there's a little extra load on the CPU when retreiving
colour values from the cache and a little more when generating (which
only happens once on startup and when TV controls are changed) but it's
very minimal
SECAM colours generated rather than using a precomputed RGB palette
preferences for TV brightness/contrast/saturation/hue moved to colourgen
pacakge
this means the image is generated in the GUI goroutine as required
an advantage of this is that the image is repsonsive to changes in
colour generation without having to clear the frame queue
added Complete field to AsyncResults in archivefs package. set to true
once all entries have been read into the Entries list
previously it was possible for the centreOnFile flag to be set to
false prematurely, leaving the select window incorrectly centered on th
most recent file
this allows us to remove the global DisableSaving flag from the prefs
package. it also allows us to remove the preferences.go file from the
debugger package, simplifying things a little bit
the ReqROMSelector request has been removed from the gui package and
handling from the sdlimgui package. the decision on whether to open the
ROM selector is done entirely inside the sdlimgui package now. this is
good because there shouldn't be any need for the debugger package to
worry about that kind of thing
removed the saveOnFirstUse argument. this means the EnableSaving()
function added in the previous commit can be removed
the reason for adding the EnableSaving() was so that we could intialise
the ColourGen type without writing to a preferences file. this was a
problem for testing because it meant that the global ColourGen
initialisation created a preference file for each test, which is
definitely something we don't want
there is still the global DisableSaving flag that would ideally be
removed in the future. it's currently only needed by the
debugger_test.go test which initialises a Debugger instance and
indirectly causes the preferences file to be saved on exit
saving for an individual prefs.Disk() can be disabled/enabled. this was
added because colourgen is currently a global instance. this is fine
because all access to it is implicitely race protected. however, because
it's a global instance, testing packages will trigger it to save, which
we don't want (.gopher directories in package directories)
for the global instance of colourgen (in the specification package)
prefs saving is disabled by default
the behaviour of the ball reset is slightly different under HMOVE. the
previous condition wasn't quite correct
the condition for missile reset has also been changed, under the
assumption that it behaves the same as the ball. no additional test for
the missile has been identified but the new code passes all existing
test ROMs
pushing/popping the new TV Colour marking into the drawlist happened
too frequently
clearer handling of tooltips and drag-and-drop in the palette windows
for conveinece and to prevent ordering accidents. it's a small point but
creating shaders when appending to the array has to be done in the
correct order. it's clearer and safer to use a map
renamed name of textureType type to shaderType
enabling and disabling of TV colour in the GUI now uses texture IDs for
a specially allocated texture, removing any possibility of accidentally
misuing a real texture ID
in other words, the shader can be called for specific pixels in the GUI
texture. previously, the shader was only used for specific textures,
which is fine but for that meant GUI elements were not rendered
correctly with regard to the current TV settings (brightness, contrast,
etc.)
this will be particularly important when we move the YIQ generation to
the shader
for cases where the refresh rate of the monitor is similar to the
emulated TVs the policy was fine
when the refresh rate was dissimilar however, the policy wasn't really
suitable. for these cases the advancment is undone by one frame rather
than two
this is on by default and seems to be the cause of the occassional loss
of VSYNC (for want of a better description) seen when displaying ROMs
with flicker kernels
note that disabling the bypass_compositor option doesn't completely
solve the VSYNC problems when running under the muffin window manager.
it does however solve the problem under other window managers that have
been tested. either way, the issue is purely one for X11 and doesn't
affect Windows of MacOS
I've also removed the artificial window event delays added in 28c22cb34.
the delays seemed to mitigate the problem but not solve it.
the previous version used a strange mix of pumping and peeking. this was
in an attempt to fix the issue with the display losing vsync when in
windowed mode. but this was a misguided solution
corrected scaling/positioning of screen relative to bevel image. the
position of the bevel inside the window needs to be taken into account
in order for the offset values to be consistent
it never worked very well and was likely to cause screen tearing
added SetConstraint() function to the types in the prefs package. this
is used to make sure the old ticker value is replaced with the value
indicating 'sync with vertical retrace'
removed TotalAlloc field because it's meaningless really and
causes people to think more memory is being allocated than is
reality
added GC CPU % field
this seems to help the screen rendering to mesh with the monitor's
VSYNC. this method was already in place when switching between
full-screen and windowed mode
the current policy is to run time.Sleep() for the duration of a frame
(1000/60ms for a 60Hz monitor) before calling GLSwap() and to do that
for 5 consecutive frames
for the specific instance of WINDOWEVENT_RESIZED the GLSwap() is
also completely inhibited for a frame
outside of the window event period a random sleep of between 1 and 10
microseconds is introduced
tweaked frame queue slack indicator