Commit graph

78 commits

Author SHA1 Message Date
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
JetSetIlly
b0e973a0fd first attempt at screen roll 2021-06-15 06:55:13 +01:00
JetSetIlly
b072be8162 improved CRT preview in debugging screen
readded mouse selection to debugger when in crt preview mode

video-black correction in a separate shader to the the phosphor shader
2021-05-23 20:13:03 +01:00
JetSetIlly
f2911f95ec more work on deep poking
still not fully working in all situations. not all tia controls are
enabled to use it. funtionality disabled for now

see win_tia_deeppoke.go to enable it
2021-04-16 07:57:44 +01:00
JetSetIlly
6621cfcd19 fixed TIA plumbing on rewind
this didn't effect the rewinding in practice but none-the-less it was
wrong and had side-effects when using the rewind mechanism for
deep-poking.
2021-04-14 20:25:27 +01:00
JetSetIlly
aee8cb1f4b more work on deep poking. not complete. 2021-04-01 01:06:59 +01:00
JetSetIlly
94150de4a5 clarified some concepts in the rewind package
SearchRegisterWrite() now correctly leaves the found state in a usable
state at a CPU instruction boundary

DeepPoke runs from found ultimate found state to the "current" state

updated README
2021-03-25 21:19:22 +00:00
JetSetIlly
36e7c3bd61 first pass at deep-poking
implemented deep-poking of playfield values. there may be pathological
instances where this does not work. not all addressing modes have been
added to the deep-poke function.

to be clear, non-playfield graphic elements (player, missile, ball) have
not had this feature added yet.

will probably also require some way of feeding back information, making
it clear what has actually happened or actually changed. changing of an
immediate value should probably trigger a redisassembly.
2021-03-23 11:27:28 +00:00
JetSetIlly
d4f72c3b40 Logf() function in logger package
replaced all instances of logger.Log() that used fmt.Sprintf() to build
the details argument
2021-03-06 08:01:48 +00:00
JetSetIlly
84ab48118b updated Control deugging window to support STEP BACK command 2021-03-05 23:08:31 +00:00
JetSetIlly
b8ecaefebb TIA optimisations
TIA sub-components no longer pass values around in return values. it
turns out to be far cheaper computationally to store calculated values
in the TIA sub-types and retrieving them as required.

on my machine this turns out to be around 2fps saving
2021-01-20 23:50:46 +00:00
JetSetIlly
8dd5b7106e goto button in coprocessor last execution window
rewinds emulation to just after the point the coprocessor program was
last executed
2021-01-19 17:34:43 +00:00