Commit graph

1523 commits

Author SHA1 Message Date
steve
5b2f51197a o sdltv
- window is now resized according how and when VBLANK is
    switched on and off
    - implemented stability check to limit when window resizing occurs
    - Dragster now works correctly

o television
    - improved how out-of-spec television signals are handled
    - added new request type SETVISIBILITYWHENSTABLE
    - SETVISIBILITY request type now accepts optional second argument
    for whether the screen should be updated when visiblity is true
    (some code paths will deadlock otherwise)
    - updated Signal() interface - now propagates errors correctly

o gopher2600
    - run mode now uses SETVISIBILITYWHENSTABLE
2020-01-05 18:58:30 +00:00
steve
139fdd2ad5 o sdltv
- fixed onclose event
	- close callback is now called
	- this was inadvertently removed sometime between faaf21a99ea6bbe711d258b1785700f8c3f8a9fe
	    and a45d1fcdd0b198f04d9757cd27add880981e1e46
    - improved (slightly) how out-of-spec displays are handled

o regsiter_test
    - tweaked test functions

o futures
    - fixed resolution of individual instances
2020-01-05 18:58:30 +00:00
steve
6d77c65f35 o cpu
- further fixes to SBC
    - in addition to 573984396ccd8296d6fd8da2c05a61adea532b035
    - previous fix neglected to take into account subtraction of value=0
    and carry=0 (which means -1)
2020-01-05 18:58:30 +00:00
steve
ce1b15108a o debugger/memory
- moved memory debugging functions (peek & poke) from memory
	package to debugging package
    - implemented memory watches
2020-01-05 18:58:30 +00:00
steve
9644eb59f0 o memory
- (re)implemented POKE command
    - reworked PEEK a little bit
2020-01-05 18:58:30 +00:00
steve
10a786d998 o tia/video
- tweaked motion clock times (fixes Keystone Kapers ROM)
    - added delay to setting of COLUBK (fixes Keystone Kapers ROM)

o sprite
    - machine info functions now report the number of cycles remaining
    until reset
2020-01-05 18:58:30 +00:00
steve
372743b567 o video
- motion clock now works correctly
    - sprite ticks now called correctly on motion clock
    - vertical delay is now
    - parallel future write buffers
	- one for writes that tick off of the color clock
	- and another one off of the motion clock
	- additionally, each future instance has a ring buffer of length 3
	- 3 seems sufficiently long
    - ball sprite fixed (satisfies stress tests)
    - missile sprite fixed (satisfies stress tests)
    - player sprite fixed (satisfies stress tests)
    - horizontal position of sprite now reflected correctly when HMOVED
    - tidied up MachineInfo() and MachineInfoTerse() of all video elements

o television
    - mask now only drawn if top and bottom are correct
    - this fixes those roms that do not call vsync correctly
    - still not perfect but at least we can now see the screen
    - improved verbose machine info output

o cpu
    - instructions with a WRITE side-effect tweaked

o gopher2600
    - tv not displayed until it can be reasonably assured there will be
    no errors
2020-01-05 18:58:30 +00:00
steve
1a3ff0189f o unfinished changes 2020-01-05 18:58:30 +00:00
steve
d522b80e85 o cpu
- tidied up cpu.result package
2020-01-05 18:58:29 +00:00
steve
cb49bf2afb o disassembly
- dump() now uses a io.Writer interface rather than returning a
     string

o debugger
    - ansi code building now uses strings.Builder
2020-01-05 18:58:29 +00:00
steve
9118ebd304 o cpu
- corrected initial state of break and interrupt disable flags on
	startup
    - result.InstructionData now set as soon as possible in all
	instances
    - corrected RTI implementation
    - corrected RTS implementation
    - implemented some undocumented instructions:
	0x0c skw
	0xb3 lax
	0xc7 dcp
	0x4b asr
    - a homebrew version of pacman (pac-man_4k.bin) now works (up to a
	point; not sure if bug is in the implementation of the new
	instructions or is a video issue)
    - new effect classification "Interrupt" for BRK and RTI
    - instructions_gen program is now more robust

o disassembly
    - added validity check to ParseMemory() function
    - Dump() now uses strings.Builder

o result.Instruction
    - corrected GetString() function
	- function would panic when in videostep mode
	- bug most probably introduced in 58f452cf52343eb27fb495b3b0f6e6675806203f
    - improved output of IsValid()
	- disassembly of problem line is now included as part of the
	    error string
2020-01-05 18:58:29 +00:00
steve
6af91313fe o future write
- removed sanity-panic from future write schedule() function
    - this is to keep a BRK command from causing a panic when pushing
    onto an extended stack
    - i'm pretty sure the sanity-check is not needed
2020-01-05 18:58:29 +00:00
steve
49d429b6bf o cpu
- implemented BRK and RTI instructions - not fully tested
    - tidied up when NoSideEffect is checked

o debugger
    - fixed breakAndTrapCallback
    - fixed instruction result validity check crash caused when
	instruction step resulted a runtime error

o cartridge
    - added support for half-size cartridges
    - tidied up error handling

o various commentary cleanups/clarifications

o move test files to test/ directory
2020-01-05 18:58:29 +00:00
steve
4613bcc4cf o cpu
- marginal speed improvement by converting opcode map to an array
    - changed instructions_gen accordingly

o added benchmarking to repository
2020-01-05 18:58:29 +00:00
steve
bb97be04a6 o register
- generalised initialisation to allow for N bit sized registers
	- fixed tests
2020-01-05 18:58:29 +00:00
steve
e19c99a182 o tia/video
- implemented RESMP0/1
	- gave the trigger a 2 video cycle delay but I'm not sure if
 	this is necessary
		* Yar's Revenge now works

o polycounter
	- fixed polycounter testing routines
	- implemented Sync()
2020-01-05 18:58:29 +00:00
steve
ccdedee2f1 o tia
- tidied up future type and delay values

o sdltv
	- fixed drawing of paused image
	- faded image of previous frame was drawn over the current frame
2020-01-05 18:58:29 +00:00
steve
552ca5edbe o tia/video
- nailed playfield rendering
	- I couldn't find a delay value for playfield-writing which
	satisfied the ROMs I was testing with:
		* Flappy
		* Adventure
		* Bezerk
	- by making sure we use the initial playfield-pixel value for
	the duration of the four video cycles, even if playfield data
	is changed, then a delay value of 4 satisfies the test ROMs

	- I'm now wondering if this idea is applicable to sprite
	rendering - a simple rule, rather than the crufty logic I've
	been experimenting with

	- split Tick() into TickPlayfield and TickFutureWrites()
2020-01-05 18:58:29 +00:00
steve
5f3a2bf7bf o polycounter
- fixed polycounter test
2020-01-05 18:58:29 +00:00
steve
90dda38102 o cpu
- fixed SBC command
	- it *was* taking 2's complement and passing to the ADC operation
	with an inverted carry flag
	- the correct behaviour however, is to take 2's complement only
	of the operand if carry flag is true; otherwise, we need to take
	1's complement only
	- in either case, we pass a carry flag of false to ADC
	- we hadn't spotted this because in the tests we hadn't used a
	carry flag of false when subtracting past zero
2020-01-05 18:58:29 +00:00
steve
eaa206151b o tia
- another attempt at rsync
2020-01-05 18:58:29 +00:00
steve
0ea1638bbd o cpu
- rogue cycle in post indexed indirect addressing mode

o debugger
	- leading # interpreted as a comment
2020-01-05 18:58:29 +00:00
steve
eeaa9602ca o tia/video
UNFINISHED

	- playfield tick, and future-write resolution, now occurs after
	sprite ticking
	- corrected trigger list for NUSIZ0/1 0x04
2020-01-05 18:58:29 +00:00
steve
ba8e767ad8 o debugger
- implemented step-traps
2020-01-05 18:58:29 +00:00
steve
5af5daacb0 o sdltv
- readded cursor to pause television display
	- inadvertently removed in b28bddf149be01e9996c1f178b474c3ece332209
2020-01-05 18:58:28 +00:00
steve
e7ed5fde34 o debugger
- added TIA FUTURE command
2020-01-05 18:58:28 +00:00
steve
cc9d079a4e o tia/video
UNFINISHED

	more tweaking of video sprites - trying to normalise everything
	so there's no special conditions

	- removed ColorClock type - color-clock is now just an instance
	of a polycounter within video type
	- implemented motion clock - this seems to fix a lot of
	positioning problems
2020-01-05 18:58:28 +00:00
steve
c64ba3b675 o tia/video
- writing of player data and the enable bit for missile and ball
	sprites is now delayed correctly
	- this seems to fix the timing problem related to the writing of
	player data
	- NOTE that there are still visual issues that are not resolved
	by this realisation but it brings us closer to a correct
	emulation
2020-01-05 18:58:28 +00:00
steve
ba8e03ab7d o television
- reworked television module(s)
	- SetVisibility()/SetPause() replaced with RequestSetAttr()

o debugger
	- "DISPLAY SCALE n" now works
	- tightening up of command template parsing - more error
	conditions/messages
2020-01-05 18:58:28 +00:00
steve
74bf70437b o fixed video timings
- broken in adfe91457d3d3021b9f3b289aac95e5d96d912e4
2020-01-05 18:58:28 +00:00
steve
05a5159827 o fixed future type
- broken in f83356dbf9ffeacf939a03f23f10300bf04eca2c
2020-01-05 18:58:28 +00:00
steve
31d2c0a815 o debugger
- fixed prompt when in video step mode

o cpu
	- tweaked instruction timings
2020-01-05 18:58:28 +00:00
steve
0da75cc3ef o television
- setVisibility() now takes showOverscan argument
2020-01-05 18:58:28 +00:00
steve
b39ff8ce60 o TIA
- fixed timer so that it updates INTIM on the first cycle
	- fixed pixel ordering

o cpu definitions
	- fixed definitions
	- branch insructions now flagged as page sensitive
	- store instructions flagged as page sensitive

o debugger
	- added instruction result verification
2020-01-05 18:58:28 +00:00
steve
9179c79ac2 o symbols
- search symbols now searches all tables and returns table id of found table

o memory
	- renamed some files in memory package
	- MapAddress now takes additional argument, readAddress -
	used to apply the additional readMask is necessary
	- removed readMask application from chipbus.Read() functions
	- more convenient for readMask to be in MapAddress only

o debugger
	- fixed DEBUGGERSTATE command
	- ONHALT and ONSTEP now has optional ECHO argument
2020-01-05 18:58:28 +00:00
steve
786fb5b254 o 6502 instructions
- added 0x80 - immediate 3-byte nop

o vcs
	- reset operation now resets TIA and RIOT in addition to CPU

o cpu
	- reset attempt mid-instruction now returns suitable error
	instead of panicking

o debugger
	- fixed breakpoint/trap check when it occurs mid-instruction
	- broken in 6045b9a9b65d623800b8e386e06fe0fdfb71998f
	- fixed PEEK command
	- fixed SYMBOL command
	- SYMBOL command now takes optional ALL argument - prints every
	mirror address of the resolved symbol
2020-01-05 18:58:28 +00:00
steve
74d8f6e297 o debugger
- implemented DROP command
2020-01-05 18:58:28 +00:00
steve
bdd330bc2f o television
- tv breakpoints now set with right mouse button, not left
	button

o debugger
	- moved top-level command parser into commands file
2020-01-05 18:58:28 +00:00
steve
3a20e6d394 o breakpoints
- reworked breakpoints so that we can AND conditions together
	- breakpoints are now checked every video cycle regardless of
	current step mode - this is required if we want to break on
	attributes like Horiz Pos (HP) which may jump over values in CPU
	step mode
2020-01-05 18:58:28 +00:00
steve
0a8267d7d6 o television
- tidy up how state requests are made
	- added info requests
	- implemented MOUSE info request

o debugger
	- implemented 'LAST DEFN'. prints the definition of the last
	instruction executed
	- STEP now takes optional CPU or VIDEO keywords
	- removed critical sections and replaced with channel
	communication
2020-01-05 18:58:28 +00:00
steve
e96f052c1f o debugger/input
- parser package renamed to input
	- tokeniser moved to input
	- command templates are now specified using a simple markup
	language
2020-01-05 18:58:28 +00:00
steve
d744e6229a o debugger
- better lexing/parsing of command input
	- break/trap on instruction effect (read, write, etc.)
	(we had to implement a more flexible way of satisfying the
	target interface for this. it works but it's a bit ugly)
2020-01-05 18:58:28 +00:00
steve
d569fb4bca o targets
- started to generalise targets a little. preparation for future
		changes

o register
	- split register operations into a separate file - for clarity
2020-01-05 18:58:28 +00:00
steve
0c4b644a4a o vcs
- there is now a way of operating the vcs with a "monolithic"
	cpu; that is, for the vcs to cycle the TIA only when the CPU has
	completed an instruction, rather than after a every cycle
	- no purpose to this except to compare correct and incorrect
	behaviour
2020-01-05 18:58:28 +00:00
steve
09c90b72f7 o tia/video
- removed unnecessary new*() methods
2020-01-05 18:58:28 +00:00
steve
35e31cccb7 o errors
- refined error package
2020-01-05 18:58:28 +00:00
steve
ec173372c9 o gopher2600
- "mode PLAY" is now a synonym for "mode RUN"

o chip memory
	- implemented PeriphBus interface
	- controller now uses PeriphBus interface
	- panel now uses PeriphBus interface

o hardware
	- consolidated controller and panel packages into peripheral
		package

o assert
	- added GetGoRoutineID function to help with debugging/testing
	- not for general use. it's too slow and in bad taste
2020-01-05 18:58:28 +00:00
steve
d5895261bd o television
- refactored SDL television
	- implemented close window for SDL windows
	- backquote key toggles screen-mode (debug guides on/off)
	- window resizes to fit screen-mode
	- sketched in mouse support for SDL implementation
	   - the intention here is to be able to select breakpoints
	     with the mouse

o concurrency
	- made sure shared memory is locked for all go routines

o errors
	- reworked gopher errors a little
2020-01-05 18:58:28 +00:00
steve
10a768c863 o video
- more timing tweaking - still not correct
2020-01-05 18:58:28 +00:00
steve
9f4ca060cd o debugger
- fixed ctrl-c handling again. stupid race condition between the
		go routine and setting of the "running" variable to true
2020-01-05 18:58:28 +00:00