Commit graph

1670 commits

Author SHA1 Message Date
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
68f5a8dd9a fixed DPC detection by adding the missing known size value
clarified through comments what the ideal size and the meaning of dumps
that are larger than the ideal size. (it is output from the cartridges
random number generator)

fixed RNG pump so that it more closely matches the description in the
DPC patent. clarfied that a reset value of 0xff for the RNG will produce
an endless sequence of 0xff values
2025-02-21 16:53:43 +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
96a0e1f7c3 clarified how callfn.Step() result is used 2025-02-20 20:48:06 +00:00
JetSetIlly
e8e9b09d4b arm breakpoints is not enabled unless source is available
by not enabling breakpoint checking the codepath is much shorter
resulting in faster execution of an ARM instruction
2025-02-19 21:44:02 +00:00
JetSetIlly
aadb023bd6 split arm peripherals package into rng and timer
both arm timer implementations now defer complex accumulation until
every 10000 ARM steps or when the current value is required
2025-02-19 16:20:41 +00:00
JetSetIlly
5fe2dd5ba6 ELF strongArmFunctions field is now a sparse array 2025-02-19 07:12:55 +00:00
JetSetIlly
20c59d6272 added debugging flag to elfSection
save checking for .debug string in section name on every
call to inMemory()
2025-02-19 07:12:55 +00:00
JetSetIlly
1c88e1e752 integrity test for legacy colour values
the testing documents the history of the 'standard' stella palette, in
the stella git history, to what seems like the first appearance
2025-02-18 19:57:37 +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
7e0b5e5eda ARM cycle accumulation now uses math.Modf()
the Modf() function generates far more efficient code for separating
the integer and fractional part of a number

added comment about the use of a sparse array for the ARM 'execution
cache' and in particular why one is used despite changes to the map
implementation in v1.24.0 of the go compiler
2025-02-15 10:36:13 +00:00
JetSetIlly
0ea4c2f5ca altered default brightness/saturation values for legacy colour model 2025-02-15 08:24:51 +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
52a098cff0 updated legacy PAL palette
stella updated the palette data in stella commit 8cebddc
2025-02-09 12:06:31 +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
bd0f16f206 contrast adjust assumes gray level of 7.5% (IRE standard)
brightness adjusted by addition rather than multiplication

value of hue0/lum0 set to 7.5%. I've heard conflicting opinions that
hum0/lum0 outputs at 0% which is what the previous version did, but I'm
not sure that's really true
2025-02-08 17:31:50 +00:00
JetSetIlly
928aba0333 IQ and UV no longer multiplied Y
ie 'Y * Saturation * sin(phi)' is now 'Saturation * sin(phi)'

this results in more vivid colour throughout the luminance range, which
I believe is more correct

changed generation saturation and contrast ranges

bright/contr/sat default value set to 1.0 and hue value to 0.0
2025-02-06 22:57:27 +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
e42ca15142 NTSC colour burst correction
the position of hue 1 on the colour wheel was not correct
2025-01-19 20:54:26 +00:00
JetSetIlly
a43ee21377 Merge branch 'future_REBASE_LIKELY' into release_0.40.0 2025-01-13 19:48:58 +00:00
JetSetIlly
18b9986fed lowered default Brightness and Saturation values
RF interference enabled by default
2025-01-13 18:45:59 +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
3bd457d2e7 refresh rate for unsynced frame was not correct
the current scanline was used when it should have been the
adjusted total scanlines for the fied. usually the two are
the same when newFrame() is called but will not be when
frame is unsynchronised AND the immediate desync option
is disabled

also tweaked conditions for natural flyback
2025-01-11 16:14:47 +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
ed238613f2 committed to VSYNC counting on HSYNC end
it seems to work well and means that games that you would expect
to work with a three scanline requirement, don't fail to sync
2025-01-10 19:22:36 +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
f2ae53db30 extended visible screen resizing only happens when screen is synced
added explanatory commentary about how VSYNC is counted

removed vsync history (not used)
2025-01-07 18:57:59 +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
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
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
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
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
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
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
58d289ec41 corrected how PlusROM reads host/path information
fixes issue #35
2024-12-14 09:09:58 +00:00
JetSetIlly
b8eea8a976 user input recorded for rewind system
input is re-inserted as appropriate on playback
2024-12-14 09:09:58 +00:00
JetSetIlly
650b893af8 television tolerates a brief change in refresh rate
Real Sports Tennis would cause a brief instability during the logo
bounce. the difference in VSYNC is one frame long and shouldn't
affect the stability
2024-12-14 09:09:58 +00:00
JetSetIlly
03d46e072e corrected VSYNC behaviour in some instances
the MsPacman VSYNC event (when the bouncing fruit appears) revealed the
error in using the VSYNC history to make a decision

removed the "immediate desynchronise" option
2024-12-14 09:09:58 +00:00
JetSetIlly
1ab1a5ea67 improved search for TV spec in filename
previous scheme had too many false matches. for example, palleteTest.bin
would say it required a PAL TV when in fact it does not
2024-12-14 09:09:58 +00:00
JetSetIlly
70ad97c6db added BF mapper, including SC option
added proper fingerprinting for SB mapper
2024-11-23 14:56:37 +00:00
JetSetIlly
71ab13dbf0 fixed CPU functional test package
also removed 6507_functional_test build tag from the package. the
original idea was to exclude the package because it took relatively
longer than other tests but it is now considerably faster. the speed
comes from not recording the execution history, which is only needed if
the functional test fails for some reason. if the test does fail, then
the test is run again with history recording enabled

added ExpectApproximate() function to test package

the test harness can also create a pprof if required
2024-11-23 14:56:37 +00:00