Commit graph

89 commits

Author SHA1 Message Date
JetSetIlly
7f4126d226 added COMPARISON command
timeline window uses new command to make changes

comparison point can be locked
2023-06-18 21:25:07 +01:00
JetSetIlly
bde74a49b2 more timeline improvements/fixes
orange TV icon used to show current rewind position

fixed frame guide labelling

comparison point can be set from the popup menu
2023-06-18 21:25:07 +01:00
JetSetIlly
80518367b2 corrected rewind behaviour at beginning of ROM
added rewind.Peephole() function to better illustrate the current state
of the rewind history
2023-06-05 11:30:19 +01: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
28ffedbf11 removed emulation package. moved types to debugger/govern package
the emulation package has been unecessary since the amalgamation of the
debugger and play modes. in order to allow switching between the two
modes it was necessary to remove the playmode package and to move all
playmode loops and other considerations into the debugger package. as a
result the abstraction offered by the emulation package is uncessary
2022-08-31 14:37:00 +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
27ea04cf12 preferences are shared between emulation instances
this means that updating the preferences through the prefs window will
affect all emulation instances equally
2022-01-20 11:15:30 +00:00
JetSetIlly
3c288adf79 clarified some memory bus concepts
corrected/simplified how supercharger is accessed
2022-01-18 20:33:58 +00:00
JetSetIlly
20244b6085 6507 pinout window. shows values currently on the bus 2021-12-20 15:13:33 +00:00
JetSetIlly
58848acdf9 input system and ports system separated
playback/recorder and driven input systems moved out of the the ports
package and into a new input package. how the input systems interact has
been clarified and improved - for example, it is now posssible for a
playback file to be used to drive two emulations for comparison purposes

the debugger startup procedure has been clarified with two distinct
startup functions for playmode and debugger - each of which take
different arguments. the clarity has allowed the reintroduction of
recording and playback to the main play mode
2021-12-11 08:19:46 +00:00
JetSetIlly
89191d9a5a clarified some preferences concepts
set defaults for revisions, rewind and ARM tabs of the prefs window (in
addition to the CRT tab). set defaults button labelled appropriately

fixes some race conditions caused by pre/post hooks on prefs values -
prefs values are generally goroutine safe, except when pre/post hook is
defined
2021-12-05 20:17:43 +00:00
JetSetIlly
dddb166a72 timeline ratios are now reset on cartridge change 2021-11-20 23:20:28 +00:00
JetSetIlly
08a3adb69a the 'ejected' cartridge retuns NOP rather an error
fixed corner case caused by RSYNC being triggered on the first scanline

fixed some presentational issues (Nan and Inf floats) caused by running
an ejected ROM

possible to switch from playmode to debugger when ROM selector is active
in all situations.
2021-11-20 14:37:09 +00:00
JetSetIlly
68da3c95ea prefs window fully working in playmode
removed PREFS command. rewind preferences in their own tab. increased
default rewind to 250 and extended range of rewind prefs slider
2021-11-19 19:22:20 +00:00
JetSetIlly
249e3c4b60 timeline window now runs the rewind.GetState()/thumbnailer in the main emulation goroutine
the thumbnailer does the actual emulation in a new goroutine so there's
no lag here but it's necessary to PushRawEvent() so that
rewind.GetState() doesn't race
2021-11-18 21:51:44 +00:00
JetSetIlly
8a8a306670 corrected rewind splicing point
rewind.String() now produces correct summary in all instances

rewind reset on frequency change (in addition to the existing rule about
number of states). timeline no longer reset on this type of rewind
reset.

adjust coordinates function uses the correct zero value for color
clocks. the error could be seen on STEP BACK FRAME when the execution
would stop near clock 0 rathre than clock -68

execution states are recorded and appended to the history every frame
regardless of the snapshot frequency schedule. they continue to be
trimmed in the usual way. on emulation halt meanwhile, the current
coordinates are recorded which is more flexible and allows for video
cycle granularity.
2021-11-18 10:29:33 +00:00
JetSetIlly
4f4bee0b36 thumbnail preview on timeline hover
introduced PlumbFromDifferentEmulation interface. the ARM emulation
doesn't like being moved between emulation instances so the ARM is
recreated when plumbing a state that originated in a different
emulation. not all mappers need to implement this interface.
2021-11-17 17:30:46 +00:00
JetSetIlly
b9720f9a41 rewind history was incomplete when switch from playmode to debugger
the splice point was being set wrong by RerunLastNFrames()
2021-11-16 23:04:15 +00:00
JetSetIlly
8df37d8b1e timeline reset at same time as rewind reset 2021-11-16 10:03:33 +00:00
JetSetIlly
3f6bd5fccb preview thumbnails in ROM selector
added thumbnailer package to support thumbnailing
2021-11-15 13:37:50 +00:00
JetSetIlly
a0a1f10289 fixed binary search bug in rewind package when snapshot frequency > 1
two issues here: (1) bug in deciding which half of the circular array to
search; (2) how we counted the period between snapshots was wrong. it is
now just a straight "current frame number % snapshot frequency"

rewind.SetComparison() makes a new snapshot, rather than using the
current splice point. the old method worked okay for a snapshot
frequency of one but not so well for anything larger
2021-11-14 17:47:44 +00:00
JetSetIlly
50434ae36b added Mode() to emulation interface 2021-11-14 09:16:56 +00:00
JetSetIlly
8a46ac5482 tidy up of rewind package. clarified some concepts and consolidated/removed dead functions
reoved GotoCoords() tempFrame in anticipation of a more flexible system.
GotoCoords() when snapshot frequency greater than one will be noticeably
slower in the meantime
2021-11-14 09:16:56 +00:00
JetSetIlly
f44707057b counting for the timeline removed from reflection package
new counter package added (sub-package of reflection)

this new counting method is fast enough to be run while in playmode,
which means that historical timeline information is immediately
available in the debugger
2021-11-13 10:21:45 +00:00
JetSetIlly
32499606a3 WSYNC/Coproc aren't counted in playmode so timeline now shows dotted lines
dotted lines indicate that those counts haven't been made during the
period shown
2021-11-10 14:29:53 +00:00
JetSetIlly
33cb5543aa controller input reset after rewind state plumbed in
this fixes the issue caused by rewinding and continuing from a state in
which a controller was active
2021-11-06 15:25:02 +00:00
JetSetIlly
5ae0f61b79 timeline info detailed in a tooltip (hover on timeline window) 2021-11-06 11:11:18 +00:00
JetSetIlly
af940e9ecd better interaction of window geometry preference saving with fullscreen setting
*.windowSize and *.windowPos preference values replaced with single *.windowGeometry value

prefs package type now have a pre-hook (called before new value is set).
existing hook/callback clarified to be a post-hook (called after new
value is set).

prefs generic type now handles prefs.GenericGetValueUndefined to
indicate that the value cannot be ascertained at this time (the prefs
package should use the most recent previous value instead)
2021-11-05 17:58:35 +00:00
JetSetIlly
92d96cc4e9 major refactor. amalgamated debugger/playmode emulations
switch between debugger and playmode with F6 or backtick key

pakage debugger remains for now but it will be renamed to emulator or
something like that. playmode package removed.

commandline options for both debugger and playmode are the same
currently, with some playmode features being lost (temporarily)
2021-11-04 09:38:35 +00:00
JetSetIlly
eb45d26471 fixed index OOB if GotoCoords() was called immediately after STEP FRAME 2021-11-03 12:48:27 +00:00
JetSetIlly
89fd7d009d corrected a false negative in the rewind.timeline integrity check 2021-10-30 09:02:31 +01:00
JetSetIlly
2834308791 tidy playmode/rewind packages 2021-10-28 12:24:54 +01:00
JetSetIlly
7629caf89d corrected how rewind package detects frames that don't exist yet
clarfied that the use of the Emulation type is for passive monitoring of
the underlying emulation. rewind package now monitors the emulation
passively.
2021-10-26 09:01:42 +01:00
JetSetIlly
31138f16f3 removed InstructionBoundary() interface and television.ReqState()
Instruction boundaries can be inferred by the debugging input loop,
which is the only place it is requred. reworked GetAdjustedCoords() in
the televsion package (now called AdjCoords()) to cope with this.

ReqState() is totally replaced by GetCoords()
2021-10-23 10:50:19 +01:00
JetSetIlly
63b188b997 moved TelevisionCoords from signal package to new package coords
Equals() and GreaterThanOrEqual() are no pacakge level functions (in the
coords package)
2021-10-22 20:23:55 +01:00
JetSetIlly
19dc94c192 added TelevisionCoords to signals package
makes it more convenient/clearer when working with all three coordinate
values (frame, scanline and clock)

changed all packages to GetCoords() where appropriate
2021-10-22 20:02:02 +01:00
JetSetIlly
a5b2c0101c coprocessor disassembly is disabled by default
renamed "last execution" window to "coprocessor disassembly" where
the actual name of the coprocessor is used

coproc disassembly window now shows an enable and a disable button. if
the emulation is paused the previous two frames of the emulation will be
rerun in order to generate a disassembly

coprocessor disassembly and last execution are shown in tabs. if
disassembly is disabled then the last execution tab will show nothing
but the disassembly tab will show what we have, with a note that it is
not bing udpated
2021-10-22 18:43:16 +01:00
JetSetIlly
64ab9e0be5 trying to record rewind state would panic on legitimate CPU error
legitimate errors include reading cartridge address with no cartridge
inserted. rewind will now check for CPU/Result state before logging and
returning before any recording has taken place

BRK instruction consumes two bytes but records only one. when
video-stepping over a BRK instruction this caused an error because the
adjustment to the number of bytes read value was done too late
2021-10-20 14:57:13 +01:00
JetSetIlly
0570ab4116 TimelineCounter interface. implemented by reflection.Gatherer
provides count information about the VCS system that would otherwise be
awkward to gather otherwise
2021-10-18 23:00:19 +01:00
JetSetIlly
1bce67a039 player input trace in timeline window
rewind state can be moved by clicking on trace in timeline window.
removed frame slider from control window.
2021-10-16 18:50:45 +01:00
JetSetIlly
5c75a68114 added timeline to rewind package and added rewind window 2021-10-16 18:35:20 +01:00
JetSetIlly
e5bd938b41 renamed paths package to resources package
ResourcePath() is now called JoinPath()

UniqueFilename() moved to a new package named unique and renamed to
Filename()
2021-10-03 13:32:08 +01:00
JetSetIlly
0025d2ee3a refined how ResourcePath in paths package works
now works more like the standard filepath.Join() function
2021-10-03 13:32:08 +01:00
JetSetIlly
22c4a803f9 refined debug screen rewind (goto coords)
if the mouse is over an area of the screen that has no underlying state,
the coordinates are constrained to the area that does have an underlying
state. this feels more natural.
2021-09-28 16:47:48 +01:00
JetSetIlly
ab4162faf7 updated rewind package docs
RecordFrameState() and RecordExecutionState() check that machine is not
in the middle of a CPU instruction.
2021-09-24 14:58:01 +01:00
JetSetIlly
e30fcc3eba added callback to CatchUpLoop
this allows the rewind system to save adhoc frames if necessary. the
functionality was there before we started to refactor the way the
catchup loop was implemented.
2021-09-23 22:47:07 +01:00
JetSetIlly
a7513e3e90 corrected how rewind enters and leaves the inputLoop particular in relation to videoCycles
tidied up inputLoop. more comments. clarification of concepts

removed PauseRendering() concept from television
2021-09-23 18:44:41 +01:00
JetSetIlly
eb571e270e GOTO command 2021-09-22 15:36:13 +01:00
JetSetIlly
1ed7386004 television sends every signal required for frame even for "short frames"
sometimes a television frame will be "shorter" than previous frames.
previously the television only sent the signals for the shorter frame,
this could play havoc with PixelRenderers under certain circumstances;
particularly visible under rewind conditions.

this was noticed when rewinding a moviecart over frames between the
attract screen and the beginning of the movie.

to fix this. the television now sends null signals (video black) for
every required signal in the current frame (whatever size that might be)

there doesn't seem to be any performance penalty
2021-09-13 09:30:40 +01:00
JetSetIlly
4bdba33551 television package keeps better track of current frame information
this simplifies the sdlimgui/screen type in addition to the NewFrame()
and Resize() functions in the PixelRenderer interface

will allow better overview and summarising of television performance

playscreen F7 window shows "total scanlines" rather than "visible
scanlines"
2021-08-12 11:28:59 +01:00