Commit graph

354 commits

Author SHA1 Message Date
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
a43ee21377 Merge branch 'future_REBASE_LIKELY' into release_0.40.0 2025-01-13 19:48:58 +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
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
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
393904abcb simplification of the memory sub-system
- preparation for adding 7800 emulation

cpu (6507) package uncoupled from upstream dependencies

- cpu no longer logs execution of KIL instruction
- randomisation of registers on startup can be handled by the called of
  the cpu's Reset() function
- address errors are filtered by an optional IsAddressError() function
  in the Memory interface implementation
- Error field removed from execution.Result type

all references to interface{} replaced with any
2024-11-23 14:56:37 +00:00
JetSetIlly
e4dea5c7b9 reverted SignalAttributes to a struct
profiling shows that the performance penalty is no longer that great.
the struct is preferable because the code is clearer
2024-11-23 14:56:37 +00:00
JetSetIlly
b7bedb56fe marginal improvement to TIA audio performance
removed audio overlay due to changes in TIA audio implementation. the
changes could be reflected accurately but the overlay is no longer as
useful as I originally thought
2024-11-23 14:56:36 +00:00
JetSetIlly
49178ad9ee marginal television performance improvements
signal history only copied if 'realtime' audio is being used.
the signal history is not required except for mitigations related to
'realtime' audio, so limiting the copy means a marginal performance
improvement for headless operation

TV Signal() implementation split into signalFull() and signalSimple().
the decision as to which is called is made once on instantiation, rather
than on every call to Signal()

small changes to tia/video and arm for clarity purposes
2024-10-02 07:32:34 +01:00
JetSetIlly
b212fa6486 TIA audio sampled every colour clock
sum of samples is averaged and output twice per scanline for an output
sample rate of 31.4KHz

this fixes issues with ROMs that change the volume of the audio multiple
times per scanline

added *.wav to .gitignore
2024-08-07 09:02:17 +01:00
JetSetIlly
dd1e1188ce LateCOLUPF expanded to include COLUBK register
when I implemented the feature I only knew of Quickstep as
being a problem ROM for some RGB mods. however, there is now
an example of a ROM where the COLUBK register is a problem.

rather than add a new option I simply renamed LateCOLUPF to
LateColor and set it to affect the COLUBK in addition to
COLUPF
2024-07-06 21:52:28 +01:00
JetSetIlly
0c8b2d2450 added audio comparison to comparison package
changed comparision/diff texture to linear and clamped scaling

comparison window will not be open on following session

if a comparison window was left open on program exit, it remained
open when the program is started again, even if there was no
comparison ROM specified. comparison window will now be closed
under those circumstances
2024-05-28 16:43:23 +01:00
JetSetIlly
42ff5a2587 spelling correction of "Thomas Jentzsch" in comments :-) 2024-05-28 16:43:18 +01:00
JetSetIlly
a196b21a93 logging functions called with real env instances from the hardware package
logger package will no longer create new log entires for environments
other than the main emulation (or the logging.Always shim)
2024-04-30 17:48:46 +01:00
JetSetIlly
cd2a00d4ba logger.Log() and logger.Logf() now require a logger.Permission instance
the logger.Permission interface indicates whether the environment making
the logging request is allowed to create new log entries. the
environment.Environment type satisifies the Permission interface

logger.Allow is provided as a convienient way of indicating the the log
entry should always be created
2024-04-30 11:23:40 +01:00
JetSetIlly
505661e3cf simplified/corrected string output for player, missile, ball sprites 2024-04-30 09:06:21 +01:00
JetSetIlly
9f6cbdad58 added CYCLE quantum
updated QUANTUM and STEP commands to accoodate new quantum

control window changed to support the three quantum options

improved/corrected the conditions under which the ONSTEP command is run

disassembly.ExecutedEntry() updates existing entry
2023-11-27 07:47:30 +00:00
JetSetIlly
eb09909e78 added CPU interface to TIA package
the TIA only needs to set the RDY flag. using an interface like this is
a better way of achieving that
2023-07-17 15:50:06 +01:00
JetSetIlly
1ad07dc020 environment correctly propogated after Plumb() event
AudioTick() function in tracker interface accepts TrackerEnvironment
instance. tracker implementation differentiates emulation instances and
records AudioTick() information accordingly
2023-04-17 17:07:03 +01:00
JetSetIlly
6c3035e143 renamed hardware/instance package to environment 2023-04-16 21:24:09 +01:00
JetSetIlly
aa4da3d979 improved tracker behaviour when rewinding
better visuals for tracker window

sketched in idea for a tracker "replay" feature that will allow a
selection of audio output to be replayed. it works in principal but is
not currently used
2023-04-16 10:46:57 +01:00
JetSetIlly
a65ceeb727 HMOVE Clk and MoreHMOVE state checked before calling sprite tickHBLANK()
modest performance improvement
2023-02-19 21:22:22 +00:00
JetSetIlly
0e0aa88c63 television.Signal() logs error rather than returning
this means that we can remove error checking from the tia step functions
2023-02-19 21:22:22 +00:00
JetSetIlly
b968c534ab chaged signature of Tick() function for delay.Event type
the function no longer returns (uint8, bool) tuple. it instead expects a
function that can be called from the Tick() function itself, in the case
of "success"

this has significant performance improvements due to the frequency of
calls to delay.Event.Tick()
2023-02-19 21:22:22 +00:00
JetSetIlly
3aa5885ebe removed curated pacakge. replaced with wrapped errors
curated package predated the standard errors package introduced in
go1.13

the standard package does a better job of what curated attempted to do

the change of package also gave me a opportunity to clean up the error
messages a little bit
2023-02-13 21:58:39 +00:00
JetSetIlly
178f05f17b updated go minimum version to 1.20
applied gofmt to source tree to update the documentation comments
2023-02-12 13:09:07 +00:00
JetSetIlly
7656bea678 added audio reflection layer
fixed imgui.EndChild() error for tracker window
2023-02-01 16:47:11 +00:00
JetSetIlly
896436f2e6 refined stereo effect 2023-01-31 18:52:17 +00:00
JetSetIlly
85c3ac8a2d audio clock no longer sychronised on RSYNC 2023-01-31 18:51:52 +00:00
JetSetIlly
878457542b missile sprite plumbed to resetToPlayer() function
this affects missiles that rely on resetToPlayer(). a really good
demonstration of this is the trucks/cars in "The Official Frogger".
without this fix they would go bezerk after a gameplay rewind
2022-08-20 19:10:03 +01:00
JetSetIlly
e4ff521c39 first attempt at "paint" window 2022-06-07 08:43:55 +01:00
JetSetIlly
92d4f170f8 hsync events differentiated by typedefed integer instead of a string 2022-05-28 19:12:16 +01:00
JetSetIlly
d7b1f0df71 simplified conditions underwhich playfield and sprites tick()
also triggerMissileReset() is passed to missile at init time and not on
call to Missile.tick()

small performance improvement
2022-05-28 19:12:16 +01:00
JetSetIlly
8241f85f0f corrected when playfield "ticks" and added an early return condition 2022-05-27 23:19:54 +01:00
JetSetIlly
bacfa2c2f1 added UpdateTracker() to Audio package. not part of the Step() function
this isn't a performance improvement but it Step() is now clearer and
UpdateTracker() can be called less often
2022-05-27 22:15:24 +01:00
JetSetIlly
6b089f5f57 ChipHasChanged() used to decide whether to call Step() or QuickStep()
small speed increase because we can use QuickStep() more often than
Step() when processing the TIA and RIOT
2022-05-27 21:27:11 +01:00
JetSetIlly
3d67309adc commenting and variable naming change in TIA implementation
changes intended to clarify the thinking behind optimisation strategy in
the TIA
2022-05-26 08:37:34 +01:00
JetSetIlly
7e0e2a4714 altered how ineffective TIA/RIOT writes are handled
removed frequent and relatively expensive map lookups resulting in a
small performance increase
2022-05-23 18:02:40 +01:00
JetSetIlly
6422c08ddf QuickStep() added to complement Step() for TIA and RIOT
QuickStep() removes all checking for changed memory state. moreover, if
the CPU RDY flag is false, we can say that QuickStep() is always
prefered to Step() because by definition the state of memory cannot have
changed

a small but significant performance improvement. a side effect of this
improvement is that execution speed will increase depending on the
number and length of WSYNCs
2022-05-23 18:02:40 +01:00
JetSetIlly
5fb2bcc5b2 triggerMissileReset() only called on missile tick when necessary
small but significant performance improvement. the previous method by
which triggerMissileReset() could be considered a bug as it differed
from the intention. current code is correct with regards to intention
2022-05-23 18:02:40 +01:00
JetSetIlly
bb707e5818 tidied Audio.Step() function 2022-05-23 14:29:33 +01:00
JetSetIlly
e8194e29d5 adjust missile reset missile conditions for double width player
noticed by @ale-79 in https://github.com/stella-emu/stella/issues/889
2022-04-22 17:00:55 +01:00
JetSetIlly
5885c9e776 fixed race condition in instance caused by timeline
thumbnailer was running in a different goroutine to that which the state
being used to generate the thumbnail was create in. there's no way of
making that safe except through mutexes or similar. that's too much
overhead for something as inconsequential as a timeline thumbnailer

timeline thumbnailer now runs in the same goroutine as the main
emulation, bypassing these problems. scheduling of when thumbnailer runs
is now done manually

"Live" TIA Revision values replaced with atomics. small performance
improvement
2022-04-04 21:27:56 +01:00
JetSetIlly
f2379ae0bb first attempt at AtariVox support. festival used for synthesis
added Unplug() function to Peripheral interface. existing peripherals
updated to satisfy interface

volume mix increased. better balance with festival default volume

path to festival is currently hardcoded to be /usr/bin/festival
2022-03-07 09:18:52 +00:00
JetSetIlly
49fd3e3c4d TIA revision preference values accessed through "Live" structure
sharing of preferences between emulation instances is safe due to the
nature of the underlying prefs package.

however for performance purposes the TIA emulation requires plain
variables rather than the goroutine-safe prefs values. this caused
race-errors when two emulation instances were running side by side and
when the TIA revision information was changed

to remedy this, the instance package now makes a copy of the live
revision preference values. the TIA emulation accesses revision
information through the LiveRevisionPreferences type rather than the
RevisionPreferences type directly
2022-01-20 11:16:23 +00:00
JetSetIlly
f2fb0091e7 simplified/clarified memory interface
addresses and bus interface removed and split into cpubus and chipbus
packages.

ReadZeroPage() no longer has any distinction from normal Read()
function.
2021-12-26 19:00:11 +00:00
JetSetIlly
ac1fa60d81 collisions uses ChipRefer() instead of using local copy of collision registers
collision window pokes changed collision value correctly
2021-12-24 19:08:50 +00:00
JetSetIlly
1a0edad162 added Ports window. feedback is now correct
INPTx input is masked correctly

RIOT.Ports no longer keep private copies of SWCHA, SWACNT, SWCHB or
SWBCNT. added ChipRefer() to ChipBus interface. this makes the interface
with memory more natural. for example, a POKE command will now correctly
be referred to by the Ports implementation in all instances.
2021-12-23 11:28:51 +00:00
JetSetIlly
20244b6085 6507 pinout window. shows values currently on the bus 2021-12-20 15:13:33 +00:00