Commit graph

3372 commits

Author SHA1 Message Date
JetSetIlly
46d72edec2 changed colourburst value slightly for NTSC
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
2025-01-03 09:21:24 +00:00
JetSetIlly
4b5913cf67 added RegressRun() options 2025-01-01 16:28:26 +00:00
JetSetIlly
800b2d7005 reworked screenshotting
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
2024-12-29 18:38:31 +00:00
JetSetIlly
8ee08854c1 added CHANGED option to WATCH command
improved how WATCH command arguments are parsed
2024-12-29 08:25:05 +00:00
JetSetIlly
8c266ef984 change texture2D() to texture() in crt_effects.frag
texture2D() is not supported in current versions of the MacOS
2024-12-28 13:58:40 +00:00
JetSetIlly
5c1f071ca6 'using bevel' option in addition to 'pixel perfect' option
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
2024-12-28 13:58:40 +00:00
JetSetIlly
7907239e15 tidied up CRT related fragment shaders
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
2024-12-27 18:38:44 +00:00
JetSetIlly
e89384d194 added chroma interference 2024-12-27 15:29:38 +00:00
JetSetIlly
bcb74c2969 gamma value passed to and used in crt effects shader
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
2024-12-26 17:31:14 +00:00
JetSetIlly
94b797d119 small change to the instructions defintions table
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
2024-12-26 13:19:34 +00:00
JetSetIlly
40bf660e06 improved terminal messaging for PERIPHERAL command 2024-12-25 20:26:35 +00:00
JetSetIlly
ffce3427cc fixed key 3 for the right keypad 2024-12-24 17:02:15 +00:00
JetSetIlly
bbb7ed7833 changed default values for brightness, constrast, saturation
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
2024-12-23 22:25:21 +00:00
JetSetIlly
c9181c2e83 missile NUSIZx treated earlier in the colour clock
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
2024-12-23 15:24:27 +00:00
JetSetIlly
53f450be43 ROM select window set recentROM pref on open
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
2024-12-22 21:29:45 +00:00
JetSetIlly
047a848a0a crt effect refinements
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
2024-12-22 20:45:26 +00:00
JetSetIlly
1287a822d4 corrected constrast/brightness behaviour 2024-12-22 18:17:44 +00:00
JetSetIlly
c25049ed55 moved clock constants to new clocks package
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
2024-12-22 17:53:32 +00:00
JetSetIlly
574af1feb3 fixed caching of PAL colours
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
2024-12-22 15:44:02 +00:00
JetSetIlly
ab05b31960 archivefs: set complete flag in all instances
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
2024-12-22 11:53:47 +00:00
JetSetIlly
35c661b280 adjustment of YIQ/YUV signal done entirely in Go
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
2024-12-20 22:02:08 +00:00
JetSetIlly
a016524090 screen framequeue now stores TV signals and not images
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
2024-12-20 14:05:32 +00:00
JetSetIlly
33a446d412 improved process for centering on ROM in ROM select window
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
2024-12-20 14:05:32 +00:00
JetSetIlly
c7431e4512 moved recent ROM preference handling to sdlimgui
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
2024-12-20 14:05:32 +00:00
JetSetIlly
ecb8f15455 simplified prefs.Disk.Load() function
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
2024-12-20 14:05:32 +00:00
JetSetIlly
abddcd445e colour generation moved from specification to colourgen package
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
2024-12-20 14:05:32 +00:00
JetSetIlly
b24bc56f82 corrected condition for ball position reset
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
2024-12-19 20:39:29 +00:00
JetSetIlly
6894303639 improved palette performance
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
2024-12-18 13:56:20 +00:00
JetSetIlly
e4750c9d3f simplified sharpen shader
renamed function names involved with shader processing

removed textureSpec interface
2024-12-18 13:56:20 +00:00
JetSetIlly
f53356e416 fixed colour swatch in debugger TV window tooltip 2024-12-16 08:21:18 +00:00
JetSetIlly
4918e8eb19 shaders array turned into map
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
2024-12-15 18:33:36 +00:00
JetSetIlly
9a9d48aa32 preview palette added to television preferences window/tab 2024-12-15 18:33:36 +00:00
JetSetIlly
fcc8ca3f9e tv colour shader now called from GUI context
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
2024-12-15 18:33:36 +00:00
JetSetIlly
77684ea771 PAL/NTSC colour generation
SECAM is still palette lookup due to their being no need to ever change
the colours (as far as I can tell)

simplified how GUI handles the TV colours
2024-12-15 18:33:36 +00:00
JetSetIlly
f758871128 basic image sharpener value increased to 2 2024-12-15 18:33:36 +00:00
JetSetIlly
d892096dd7 changed undo frame advacement policy from ea8fd7bce
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
2024-12-15 18:33:36 +00:00
JetSetIlly
27456f0ca6 bevel texture uploaded to GFX card once on intialisation
the texture was uploaded to the GFX card every frame causing the CPU
load to be very high. render time has gone from 11ms to 2ms
2024-12-15 18:33:36 +00:00
JetSetIlly
8c63cf706a disabled sdl.HINT_VIDEO_X11_NET_WM_PING hint
this complements the commit that disables the bypass_compositor option

removed sdl.WINDOW_FOREIGN option because it is incorrect
2024-12-15 18:33:36 +00:00
JetSetIlly
d049c5ee31 disabled sdl.HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR hint
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.
2024-12-15 18:33:32 +00:00
JetSetIlly
534b629f8e simplified event polling
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
2024-12-15 18:32:34 +00:00
JetSetIlly
7002bb7563 fixed active pausing 2024-12-15 18:32:34 +00:00
JetSetIlly
4e0344286d screen reflections
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
2024-12-15 18:32:34 +00:00
JetSetIlly
600854615b fixed new 'go vet' errors
next version of go introduces more Errorf(), Sprintf() type checks
in the linter
2024-12-15 18:32:34 +00:00
JetSetIlly
067771407b added "telefunken" bevel option
at the moment there is no way to select a different bevel and the CRT
options are not set appropriately for the bevel by default
2024-12-15 18:32:34 +00:00
JetSetIlly
8f5c8e181e TV nudging has been disabled for now
the benefit of nudging is of dubious value. will likely be removed
completely in the future
2024-12-15 18:32:34 +00:00
JetSetIlly
7098984611 render "resync" is triggered if a frame takes too long
display average render time per frame in overlay along with an alert
whenever a frame takes too long
2024-12-15 18:32:34 +00:00
JetSetIlly
b476f902cf removed scanlines and shadowmask "fine" controls 2024-12-15 18:32:34 +00:00
JetSetIlly
d7adb54642 removed ticker option for GL swap interval
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'
2024-12-15 18:32:28 +00:00
JetSetIlly
96bcf125f3 reworked memstats overlay
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
2024-12-15 18:31:36 +00:00
JetSetIlly
1145b823b7 a short delay after every window event
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
2024-12-15 18:31:36 +00:00