Commit graph

117 commits

Author SHA1 Message Date
JetSetIlly
d2b597240a removed visual updates for low FPS in debugger
it doesn't work well since we changed how pixels are pushed to the pixel
rendered. nothing of value is really lost I don't think
2021-11-20 18:40:03 +00:00
JetSetIlly
1649442a3b fixed matchRefreshRate flag in the television framerate limiter
this affected Supercharger tape loader. noticeable in the audio
2021-11-20 18:20:02 +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
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
b5c6fc0f79 and automatic change of TV spec reset framenumber count. this upset the rewind.timeline
more care now taken when SetSpec() is called in television.newFrame()
2021-11-16 10:03:33 +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
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
d551fb9614 frame rate limiter will match refresh rate only after a period of stability 2021-11-02 15:39:26 +00:00
JetSetIlly
8f5c0aaf6b small audio error noticeable during long periods of "non-zero" silence
(zero being whatever SDL detects as the silence value for the sound
card - usually zero).

the error was noticeable when a ROM used a non-zero silence value and
simply an unchanging value instead (which the speaker treats as silence
- because the cone never moves).

queuing audio signals from the television signal array used all signals
from the beginning of the array but because of the way the television
writes to the array the first couple of entries have probably never been
written to. in other words, a audio value of zero was sneaking it's way
into the audio queue, creating a buzz.

affected moviecart ROMS
2021-10-30 19:23:32 +01:00
JetSetIlly
b46dc6db58 added tracker package and audio tracking window 2021-10-28 19:49:15 +01:00
JetSetIlly
66abac33ae changed how realtime audio demand is handled 2021-10-28 12:24:54 +01:00
JetSetIlly
180f2b5003 added rewind system to playmode
update userinput.EventKeyboard to support Repeat keypresses

in playmode rewind forward/backward occurs on shift-left or shit-right
cursor keys (with repeat)

removed the pause feature (sdlimgui) that caused two-frame kernels to
appear "complete" when paused.
    a) it wasn't consistent
    b) it can cause single-frame kernels to shimmer
    c) it doesn't really work with the rewind system
it'll be addressed in a future commit
2021-10-26 18:48:35 +01:00
JetSetIlly
ac8440e8c2 altered audio realtime demand 2021-10-25 18:17:16 +01:00
JetSetIlly
df7dd96e0f added realtime audio mixer interface in addition to the existing audio interface
sdlaudio added to the television as a realtime audio mixer. television
implementation altered to handle realtime audio.

audio is better than what it was but still room for improvement I think.
2021-10-24 22:23:19 +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
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
5c75a68114 added timeline to rewind package and added rewind window 2021-10-16 18:35:20 +01:00
JetSetIlly
3c1b30623d removed visible artefact on debug screen when pausing emulation
caused by changes introduced in dda5ed5d5c

taking the clock/scanline values from LazyTV was a good idea but the
time it takes for the lazy system to update is just long enough for the
old value to be visible.

an additional argument to PixelRender.SetPixels() is required but it
can't be helped.
2021-09-27 22:08:15 +01:00
JetSetIlly
db2342193e simplified how signals are processed by PixelRenderers
entire signal history is sent to SetPixels(). this makes it easier to
handle and to synchronise with the reflection package.
2021-09-27 22:07:43 +01:00
JetSetIlly
60b8601e1e mix audio even when emulation is rewinding 2021-09-27 16:28:31 +01:00
JetSetIlly
0a2e40be49 reworked how television signals are sent to the PixelRenderer
all signals are now sent with SetPixels(). this simplifies PixelRenderer
implementations. removed the current flag, that information can be
obtained with television.GetState()

AbsoluteMaxScanlines increased to 313. this is to accomodate ROMS that
use the absolute limit of the PAL specification and turn off VSYNC such
that it tips over into the extra line.
2021-09-26 17:53:02 +01:00
JetSetIlly
52cb3e94ce improved screen roll (playmode)
adjusted the number of stable frame required by television on startup
2021-09-25 07:38:30 +01:00
JetSetIlly
486d587a99 fixed screen rolling broken in 240f0680a2
we now detect a refresh rate change in the PixelRenderer implementation
rather than the television
2021-09-24 22:42:36 +01:00
JetSetIlly
6d1a3ef6db sdlimgui screen will "render" NoSignal
this fixes instances that can sometimes be seen during rewind events
2021-09-23 20:22:19 +01:00
JetSetIlly
8b2773e4d6 corrected how scanlines are adjusted by ReqAdjust()
using FrameInfo.VisibleScanlines value instead of FrameInfo.TotalScanlines
2021-09-23 18:44:41 +01:00
JetSetIlly
8746afa177 television and gatherer now reaction to SetEmulationState()
this supercedes Pause() and DisableRendering() and pause-triggers concept
2021-09-23 18:44:41 +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
240f0680a2 television no longer reports frame descyn on change of scanline number
frame sync is now purely based on whether a correct VSYNC signal is
detected (as it should be)
2021-09-19 18:36:09 +01:00
JetSetIlly
9a5fb8fd1f updated README and lint fixes 2021-09-16 12:34:05 +01:00
JetSetIlly
2a6cb49741 audio mixing is now a separate pacakge
TIA now puts both audio channels in the SignalAttributes separately

it is up to television.AudioMixer implementions to mix the two
channels as required
2021-09-15 18:53:48 +01:00
JetSetIlly
4eb873e675 simplified reflection package and clarified some concepts 2021-09-15 16:06:13 +01:00
JetSetIlly
c3b8d8318c clarified some concepts relating to the television and PixelRenderer 2021-09-15 07:20:35 +01:00
JetSetIlly
d31271f7a6 simplified PixelRenderer interface/protocol 2021-09-13 22:27:31 +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
fe9a3b33f9 fixed slicing bug introduced in 9a8019d654
this may also be connected to a rewind bug that causes the screen redraw
to be incorrect. this fix is a boundary check similar to another
boundary check that would disguise the screen redraw bug
2021-09-08 22:27:44 +01:00
JetSetIlly
648da0fab8 audio generation mixes volumes of the two channels correctly
using Chris Brenner's research found in "TIA Sounding Off In The Digital
Domain"

this fixes the subtleties in the sound of Ms PacMan, for example
2021-09-07 08:01:40 +01:00
JetSetIlly
9a8019d654 SetAudio() in AudioMixer interface now expects a slice of SignalAttributes
This allows a single call to SetAudio() and for the loop to happen
inside that function - as opposed to looping over the slice and calling
SetAudio() multiple times
2021-09-02 14:59:34 +01:00
JetSetIlly
61b4125d74 replaced SignalAttributes struct with a single uint64 value
more efficient memory usage and marginally faster performance. maybe
possible to compress to a single uint32 value?
2021-09-02 14:20:44 +01:00
JetSetIlly
88c3f97a35 remeasure FPS on unpause event to television
means the actual FPS reported is less misleading for the first second
2021-08-17 19:30:13 +01:00
JetSetIlly
3761dc0bab VSYNC count reset correctly
fixes smooth playfield scrolling demos. bug introduced in
0f169f41bc. demo ROMs not in regression
database
2021-08-17 19:30:13 +01:00
JetSetIlly
69321b43ee throttled how often the frame resizing check is performed
significant improvement in frame rate
2021-08-14 08:29:16 +01:00
JetSetIlly
2dd30c26d5 simplified telelvision frame limiter 2021-08-14 08:29:16 +01:00
JetSetIlly
9bd7fc59e4 reduced the frequency at which FPS performance is checked
the measurement was/is limited by a one second clock pulse but we were
checking to see if the pulse had ticked every TV clock. we now only
check the pulse every frame.
2021-08-13 21:52:06 +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
682aa62121 lint fix 2021-06-27 18:32:10 +01:00
JetSetIlly
20b1755651 TV Hz in menu of debugger 2021-06-25 10:10:56 +01:00
JetSetIlly
0f169f41bc TV fps now adjusted to match incoming signal
TV frame will never resize if frame is unsynced

Play-screen FPS counter shows target frame frequency

sdlimgui playscreen: screen will not roll on first couple of non-synced
frames. the screen is tolerant of the odd rogue frame.

gui vsync options renamed to monitor sync to clarify distinction wth
emulated television VSYNC
2021-06-22 22:22:07 +01:00
JetSetIlly
588cd66a80 resize will use extent of non-black pixels more selectively
if VBLANK is used by the ROM then non-black pixels are used to size the
screen, otherwise we take the VBLANK as intended (while still obeying
the safe top/bottom values
2021-06-20 18:26:46 +01:00