Commit graph

1426 commits

Author SHA1 Message Date
JetSetIlly
116e329bb9 added annotation interface to coproc disassembly
implemented by ELF to annoate the entry point for strongarm functions
2025-02-27 21:32:32 +00:00
JetSetIlly
9a99ff7a3e fixed searching for PAL60 in filename and PAL60 sizing
added PAL60 specification. even though it isn't a real specification it
is more convenient and provides better user feedback

moved FrameInfo into frameinfo package, now called Current as in
frameinfo.Current

clarified storage of requested specification by the television:

how the television is probed for the specification has changed, in
particular the current spec is retreived via the GetFrameInfo()
function. in fact, this was how most other packages did it but there
also existed a GetSpecID() which was uncessary

GetReqSpecID() and GetCreationSpecID() removed, replaced with
GetResetSpecID() and IsAutoSpec()

simplified SetSpec(). removed the force argument

removed reset option for vcs.AttachCartridge()
2025-02-23 17:39:08 +00:00
JetSetIlly
62f7218456 changed signal.VideoBlack to signal.ZeroBlack for clarity
clarified how VideoBlack and ZeroBlack are related in the 2600

ZeroBlack is now a generated and cached colour for both legacy and new
colour models, rather than an implied zero RGB value

the result of this is that VideoBlack and ZeroBlack are now affected by
colour adjustment in the same way, as it is on real hardware. this
happens because the 2600 outputs 0.0 IRE for VideoBlack and not 7.5 IRE
as you might expect. the most immediate recent change to colour
generation used a VideoBlack value of 7.5

we don't yet emulate RGB mods that do use 7.5 for VideoBlack

legacy PAL palette corrected so that the four VideoBlack values are zero
2025-02-21 16:53:43 +00:00
JetSetIlly
f470f9413e improved rim reflection 2025-02-16 21:15:17 +00:00
JetSetIlly
33fee99a68 legacy colour gamma corrected
default setting legacy adjustment settings altered to compensate

NTSC/PAL Colour Signal section of the television preferences are
now drawn disabled if legacy colour model is active
2025-02-16 16:38:35 +00:00
JetSetIlly
9f4155fbfb added "blue ambient light" option
adds a blue tint to the bevel image around the screen. good for
simulating low light environments.

the strength of the bevel reflection is now dependent on the amount
of blue tint
2025-02-15 13:17:12 +00:00
JetSetIlly
18262a2ee6 legacy colour model is the default for now
I think the new colour model will cause confusion and there needs to be
a much more solid grounding before it becomes the default

legacy colour model can be colour adjusted. adjustment settings for
legacy and non-legacy are kept separate
2025-02-14 21:14:22 +00:00
JetSetIlly
fe326140c3 refined version package
window now includes revision information if the build is not a "release"
build

added version.Version() function to help with deciding if build is a
"release". supercedes the global Version and Revision variables in the
version package
2025-02-11 21:38:11 +00:00
JetSetIlly
4a94b54e67 sdl audio queue() function called less frequently 2025-02-09 18:47:50 +00:00
JetSetIlly
ff98f3e088 adjustments no longer applied to legacy colour model
this keeps things simple and should also encourage people to use the new
model

now that the colour adjustment only applies to the new colour model the
default values for brightness, contrast, saturation are once again set
to none neutral values
2025-02-08 18:02:22 +00:00
JetSetIlly
61b74be224 added "legacy" colour model option
the legacy model is the current Stella Standard palette, rather then the
qotile palette used by Gopher2600 previously
2025-02-06 08:44:26 +00:00
JetSetIlly
2efeea8025 small refactor of register package
changes originally part of curtainled refactor of the data type that was
intended to introduce origin tracking
2025-02-01 07:56:41 +00:00
JetSetIlly
17e6d70f2f added colour reflection on the bevel
the inside of the bevel nearest the screen reflects the colour from the
screen. it's not perfect but it's a nice effect and can form the basis
for something better

screen centering inside solid state bevel moved very slightly to the
right
2025-01-13 19:42:20 +00:00
JetSetIlly
18b9986fed lowered default Brightness and Saturation values
RF interference enabled by default
2025-01-13 18:45:59 +00:00
JetSetIlly
ea11b74bfa change of useBevel pref value calls the playscreen resize() function
simplified the use of FlipY in the CRT sequence

changed ranges for phophor/pixel-fade settings
2025-01-12 17:25:09 +00:00
JetSetIlly
0288e3d968 simplified realtime audio mixer
realtime audio mixers, like SDL audio implementation, are expected to
self-regulate. this makes more sense and the Regulate() idea didn't work
as expected

SDL audio now repeats or drops short bursts of samples as they are
received, in order keep the queue inside a generous window. this seems
to work very well and far better than the previous efforts at regulation

there could maybe be more thought around how many samples should be
repeated or dropped such that it isn't audible

the difference between a realtime mixer and a regular mixer is now just
the SetSpec() function. I'll consider adding the SetSpec() function to
the regular mixer interface and dropping the realtime mixer altogether
2025-01-12 10:12:54 +00:00
JetSetIlly
f4e8d9d7f7 moved CRT prefrences from display to sdlimgui package
we needed more control over the post-change hooks for CRT values. in
particular we wanted the pixel perfect value to call the playscreen's
resize() function when changed. it would be awkward to do that from
a different package

incidentally, the resize() function needs to be called when toggling
pixel perfect mode becaus the CRT and pixel perfect screens may have
different scaling requirements
2025-01-11 23:06:55 +00:00
JetSetIlly
6b3677a20b television ratio wasn't correct on start when bevel is enabled
the bevel requires a bias for the Y scaling that wasn't applied
at program start because the bevel preference hadn't been loaded

you could see the error by resizing the window which forced a
recalculation taking the bevel pref and therefore the bias into
consideration
2025-01-11 21:39:09 +00:00
JetSetIlly
314e1d2dd4 reworked audio system
television signal split into video and audio signal. The audio signal is
only sent then a new sample from the TIA is ready

realtime mixer concept change. the mixer can be informed of a change of
TV spec. this allows the realtime mixer to make an informed judgement
about the required sample rate

the sample rate is unlikely to be ideal however unless the number of
scanlines in the TV image is the same as given in the basic TV
specification (ie. 262 lines for NTSC, 312 for PAL). because of that,
the realtime mixer can also indirectly regulate the rate of calls to
SetAudio(). the Regulate() function is called by the television which
then alters the call frequency to SetAudio() depending on the regulate
value. this effectively keeps the audio buffer nicely filled - neither
too long which would be audibly laggy, or too short which would result
in clipped audio

the values that control the regulation in both the sdlaudio package and
television package will need tweaking to find the best values
2025-01-11 16:14:47 +00:00
JetSetIlly
49c223b90f simplified VSYNC and screen roll
changed how 'force' parameter for television.SetReqSpec() works

debugger TV Screen shows drawing pixel in all instances, even in areas
that are "covered" by no-signal area
2025-01-10 17:46:41 +00:00
JetSetIlly
c15dc076ee changed default for rf interference
lowered bottom range for interference values in the prefs window
2025-01-07 10:22:34 +00:00
JetSetIlly
5c2f22b80b removed CRT preview from debugger TV Screen
a CRT preview directly in the debugger should be a separate window.
there's no real value in having the debugging information applied
directly to a CRT rendering
2025-01-07 10:21:08 +00:00
JetSetIlly
d7a832ca61 improved end-of-screen indicator in uncropped TV screen
there was previously a flyback line but that left a large black area for
most ROMs, with no explanation

sensible tooltip for TV screen when outside of TV frame

removed striping parameters for dbgscr_overlay shader

improved VSYNC/VBLANK reflection colours. distinguished how VSYNC is
indicated in the overlay when VBLANK is active and when it is not
2025-01-07 09:54:00 +00:00
JetSetIlly
b93cf1ab8f anything but normal rotation inhibits use of the bevel
bevel bias only applied if bevel is being used

small tv width correction when screen is rotated vertically
2025-01-06 22:48:24 +00:00
JetSetIlly
77a5f24659 divided interference preference into RF noise/ghosting
the noise and ghosting level can be set seperately
2025-01-06 21:02:00 +00:00
JetSetIlly
9088935c5c pixel presentation disables some rendering options if emulation is too slow
it is likely that CPU performance in the pause state can be improved,
particularly for non-active pauses. but we would need to be careful with
the colourgen package - we want changes to the colourgen prefs values to
show up on the screen even when paused. some sort of trigger from the
colourgen package would work but I'm not sure if the added complexity
is worth it
2025-01-03 09:22:06 +00:00
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
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
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
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
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
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
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