Commit graph

209 commits

Author SHA1 Message Date
steve
f20bcb0287 added gui.Destroy to main loop 2020-01-14 11:55:29 +00:00
steve
1add64b3bd rewrite sdlplay and sdldebug
better and safer thread interaction
2020-01-13 19:04:59 +00:00
steve
97ccf7f7db better ctrl-c handling
main thread now installs a default ctrl-c handler. can be reset if the
run mode provides a better/context specific handler instead.

for example, debugger and playmode already provide handlers. we don't
want the default handler to conflict with it in any way.
2020-01-13 16:12:17 +00:00
steve
f0c6231aa8 improved gui threading
the last commit didn't fail as expected (!) so the code has been
polished a little. error return channel from main thread to sub-thread

commentary improvement

makefile: for some reason I had added the -+ flag to the "go build"
-gcflags. I must have misunderstood what it was for
2020-01-13 16:12:17 +00:00
steve
c8070fe38a gui created in main thread
last commit still did not work in MacOS. this is a second attempt.

it will still probably fail but in a different way. it should let us
know if we're on the right track though.
2020-01-13 16:12:17 +00:00
steve
86480caa23 gui events now serviced in main thread
sdl gui events are now serviced in the main thread. previously, the sdl
event had its own goroutine loop.  this worked on Linux systems but
didn't seem to work on MacOS

A new interface called gui.EventsLoop has been created. When a gui that
implements this interface has been created (such as sdlplay and
sdldebug), the interface is passed back to the main thread. the
ServiceEvents() function then becomes part of the main loop.
2020-01-13 16:12:17 +00:00
steve
1beb4b83bb better PAL specification detection
simplified PAL detection. removed remainder of cruft from earlier TV/GUI
implementation. the method was too complex.

Tapper now auto-detects PAL correctly. Chiphead demo likewise

removed gui.ReqSetOverscan. it was ugly and not needed
2020-01-08 21:35:20 +00:00
steve
4534da0db6 reworked paths package
the location of the configuration directory now depends on how the
binary is built. release versions of the binary will look for the
gopher2600 directory in the user's os configuration directory.
non-release versions will look for the .gopher2600 directory in the CWD.

paths.ResourcePath() will create the paths that don't exist

paths.ResourcePath() now clearly differentiates paths and files

added build target to the Makefile; disabled release target for now
2020-01-07 19:14:51 +00:00
steve
9f17a89259 audio fixes / overscan option
removed fixes previously added to account for Pitfall silences. caused
problems with other ROMs, particularly chiphead demo

added option to PLAY mode that presets window to use overscan area.
prevents excessive window resizing when overscan use is detected.

commentary fixes
2020-01-06 19:24:14 +00:00
steve
16b15fad95 o added licence headers to all files 2020-01-05 18:58:43 +00:00
steve
85bf8d672f o disassembly
- debugger command can now specify which bank to display
2020-01-05 18:58:43 +00:00
steve
206cca0bef o setup
- added television entry type
2020-01-05 18:58:43 +00:00
steve
6616bc2b88 o cpu
- result sub-package renamed to execution
    - renamed Instruction type therein to Instruction

o disassembly
    - reworked structure of pacakge
    - better grep. scope of grep can now be specified
    - display sub-package added
    - disassemblies now store instance of display.DisasmInstruction instead of a formatted string

o debugger
    - ammende GREP to support new disassembly features
2020-01-05 18:58:42 +00:00
steve
0f5a258482 o patch
- implemented patching

o setup
    - added patch entry type

o gopher2600
    - added patch flag to RUN mode
2020-01-05 18:58:42 +00:00
steve
6c210ee6c1 o debugger
- reorganised packages within the debugger package
    - commentary and documentation

o terminal
    - renaming of console to terminal in all instances
2020-01-05 18:58:41 +00:00
steve
73dcd24070 o disassembly
- FromMemory() now creates disassembly instance rather than being a
	function attached to the type
    - comments and documentation

o debugger
    - fixed usage of disassembly.FromMemory()
    - the reason we went with the old method for FromMemory() was to aid
     in how symbol tables were created and pointed to from debug-memory.
     however it was dumb and confusing. problem is now solved correctly
2020-01-05 18:58:41 +00:00
steve
aba69ec69a o added overview documentation for every package
o recorder
    - fixed recorder after recent changes made to digest/video
    - fdf3f2765c59de4097a01b7fdf736ae38e4398b4
2020-01-05 18:58:41 +00:00
steve
59056fb6a8 o regression
- fully implemented audio digest regression

o modalflag
    - can now print additional help text
2020-01-05 18:58:41 +00:00
steve
5698309e68 o database
- improved error messaging
    - sketched in support for audio and 'video & audio' digests in
	digest regression
2020-01-05 18:58:41 +00:00
steve
9f50f3c77e o audio
- implemented audio
    - using Ron Fries' method as the basis
    - removed sample playback - performance of Fries' method is good
	enough that we'll never need it again
    - sdl audio routines using QueueAudio() - maybe better if we use
	callbacks?
    - sketched wavwriter AudioMixer - not usable yet
2020-01-05 18:58:40 +00:00
steve
261a379ae0 o gopher2600
- corrected error message output - superfluous asterisks
2020-01-05 18:58:40 +00:00
steve
8f7b1e08bf o gopher2600
- corrected heap allocation of modalflag instance
2020-01-05 18:58:40 +00:00
steve
e8e58abb07 o limiter
- removed overhead for fps capping

o gopher2600
    - renamed "time" flag to "duration" for PERFORMANCE mode
2020-01-05 18:58:40 +00:00
steve
02c46c8ae9 o renamed magicflags to modalflag
- simplified code significantly

o gopher2600
    - restructured to reflect changes to modalflag
2020-01-05 18:58:40 +00:00
steve
cbf81c6ce9 o sdlplay
- fps capping can now be turned on/off on command line for PLAY and
	PERFORMANCE modes
2020-01-05 18:58:40 +00:00
steve
3aa859a686 o replaced all instance of new(obj) with &new{} 2020-01-05 18:58:40 +00:00
steve
8ad481e132 o debugger / playmode
- removed references to SdlPlay and SdlDebug
    - constructors for debugger and playmode now expect instances of GUI
    and Television, rather than creating them
    - this should help future porting efforts

o peripherals
    - renamed Events to Actions
    - to avoid confusion with Events in the GUI package

o television
    - renamed StellaTelevision to television; a better name because
    it serves as a reference implementation and is the only television
    implementation currently needed.
    - originally, PixelRenderers were implemented as Television that
    embedded StellaTelevision; it made sense to use a more unique name
    - note that we're still keeping and using the Television interface
    - reworked specifications file
2020-01-05 18:58:39 +00:00
steve
cc8c14f0ae o regression
- saving scripts (playback and state scripts) are now prepended with
	info about what type of script it is. in practice it has proved
	useful to know this from a glance, rather than opening up the file.

o gopher2600
    - playing back recordings is now more intuitive
    - removed option to specify the filename that a new recording will
	save to but I think that's acceptable.
2020-01-05 18:58:39 +00:00
steve
17b5c599f2 o paths
- implemented paths package
    - handles building of paths using the most appropriate config path -
	the local directory or the user's home directory
2020-01-05 18:58:39 +00:00
steve
28d7352b52 o cartridgeloader
- moved from memory package
2020-01-05 18:58:39 +00:00
steve
05e9d2b2b5 o gopher2600
- moved argument parsing into new magicflags package
2020-01-05 18:58:38 +00:00
steve
a1bd179139 o cartridge
- Attaching of cartridges now uses CartridgeLoader type
    - CartridgeLoader type allows the caller to specify the cartridge
	path and the format of the cartridge, if fingerprinting needs to
	be overridden
    - An expected hash value for the loaded cartridge can also be
	supplied

o regression / playback
    - regression database and playback scripts now include entries
	specifying the cartridge format
2020-01-05 18:58:38 +00:00
steve
b0cb31bcd7 o database
- simplified internal structure
    - simplified Entry interface

o regression
    - tidied up error messages
2020-01-05 18:58:38 +00:00
steve
acc10f8d97 o errors
- renamed FormattedError to AtariError
    - renamed NewFormattedError to New
    - implemented Is() and IsAny() for more convenient testing
    + changed all error testing to use Is() and IsAny()
    - renamed FatalError to PanicError to better indicate the intent
2020-01-05 18:58:38 +00:00
steve
ca33e408f1 o CPU
- reworked index bug handling in CPU
    - fixed slo opcode defintion (wrong addressing mode specified)

o debugger
    - added BUG option to CPU command
    - debugger now optionally prints CPU BUG messages on the step it
	occurs
2020-01-05 18:58:37 +00:00
steve
9e32748b0a o gopher2600
- debugger can now be run in a cpu profiling loop
2020-01-05 18:58:37 +00:00
steve
62ba53254b o sprites
- implemented ball sprite
    - implemented missile sprite
    - altered compareHMOVE

o debugger
    - TIA DELAY and TIA DELAYS now differ in a meaningul way
    - DELAYS shows all queued delays; DELAY just the most recent
    - extended metavideo to include ball and missile sprites

o playfield / VBLANK
    - write delay increased to two
    - VBLANK given a delay of
    - both fix homebrew donkey kong
2020-01-05 18:58:36 +00:00
steve
d9b74bbc04 o tia
- better HMOVE clock stuffing
    - correctly ticking every four clocks
    - there is still an issue when hsync counter is at 14 (phase 0)

o vcs
    - added commentary to explain how CPU and TIA interact in the
    emulation

o player sprite
    - delay of one cycle on VDEL

o regression
    - fixed adding of playback scripts
2020-01-05 18:58:36 +00:00
steve
9654d0111b o regression
- added state option to frame regression
    - records CPU-step granularity recording of the TV state
    - intended to test for integrity of TV state recording
    - feedback from regression entries now crop filenames to just the
	last part of the path
    - moved database code into its own package
    - correctly filters PlaybackHashErrors - results in "failure" rather
    than "error"

o gopher2600 / regression
    - added VERBOSE argument to REGRESS RUN mode - prints error messages
    - added FAIL argument to REGRESS RUN mode - regression test that end
    in an error normally cause the sesssion to end. this option forces
    it to continue

o RIOT
    - removed randomised start value for INTIM
    - makes regression tests more reliable

o television
    - renamed BasicTelevision to StellaTelevision
    - the source file had been renamed already
2020-01-05 18:58:36 +00:00
steve
de5e3ffc25 o gopher2600
- fixed command line parsing bug
    - default run mode was broken such that flags were not recognised
    - bug introduced in bf03447dc79fde2b21d0e9f0c62211ba5f77f601
2020-01-05 18:58:34 +00:00
steve
e818387c28 o gopher2600
- seeding of random number generator
	* some areas of the emulated hardware start in a randomised
	state (not committed yet)
    - better argument parsing. better help messages for sub-modes
2020-01-05 18:58:34 +00:00
steve
d42ec8e911 o television
- reworked basic television
    - added AUTO tv type to the command line - switches tv specification
	to PAL automatically when visible screen exceeds NTSC limits
    - updated all renderer implementation (sdl, digesttv, imagetv) to
	handle specification switches
2020-01-05 18:58:34 +00:00
steve
e18f17ca37 o regression
- added progress meter for playback regression types

o errors
    - added FatalError type. intended to be used instead of panic()

o limiter
    - created limiter package
    - moved sdl fpsLimiter to new package
    - added HasWaited() function in additio to Wait() function
2020-01-05 18:58:33 +00:00
steve
c36459e1d2 o recorder/playback
- fixed bug caused by interaction between basictv and digesttv
    - some roms (games_that_do_bad_things_to_hmove) failed playback when
    the screen limits changed
    - the best solution I could find was to prevent basictv calling
    registered renderers once the last possible scanline was reached
    - in previous versions, the last scanline was redrawn over and over
    until a new frame was ready
    - this however, caused a hashing issue in digesttv when playing back
    recording input. it is unclear to me why this hashing issue arose.
    however, the solution is a more natural response to end of frame
    conditions as well as a being a fix for this bug

o regression
    - regression top level functions now output to an io.Writer passed
    as an argument, rather than to Stdout directly
    - playback will now save an image of the current frame (via imagetv)
    in the event of playback failure

o television
    - NewFrame() and NewScanline() implementations both require a
    frameNum and scanlineNum argument
2020-01-05 18:58:33 +00:00
steve
1073c53724 o performance
- added performance package
    - moved fps() function from gopher.go to new package
    - added percentage of full-speed indicator to fps

o gopher2600
    - changed FPS mode to PERFORMANCE

o polycounter
    - squeezed a little more time out of polycounter by changing the
    receivers of some frequently called functions to pointer receivers.

o television / colors
    - changed how colors are transalted from signals
    - the color specifications are pre-processed in an init() function
2020-01-05 18:58:33 +00:00
steve
6272b90892 o debugger/script
- renamed Recorder to Scribe
    - any references to script "recording" has been altered

o errors
    - some effort expended tidying up error messages display and
    construction
    - commandline package now uses errors package

o removed panics that would be better served with errors

o removed extraneous calls to fmt.Println and fmt.Printf
2020-01-05 18:58:33 +00:00
steve
61c39d5a93 o regression
- added regression entry listing operation
    - added playback regression type
    - playback regression makes a local copy of playback script. delete
    operation deletes it
    - better database key handling
    - running of regression tests can now be limited to a list of
    specific keys
2020-01-05 18:58:33 +00:00
steve
609ab331a2 o regression
- tidied up regression database operation
    - removed UPDATE option (for now). it's probably never needed but we
    can add it again if it's ever needed
2020-01-05 18:58:33 +00:00
steve
218c3d7823 o recorder
- digest tv support added to recorder/playback module
2020-01-05 18:58:33 +00:00
steve
99d04c747b o debugger
- commands can now be deemed unsafe
    - script recording can handle embedded scripts
    - script playback/recording moved to their own package
    - videocycle prompt changed

o gopher2600
    - improved default command line parsing

o general tidying up

o sdl/imagetv
    - wrong error reporting
2020-01-05 18:58:33 +00:00