Documentation ¶
Overview ¶
Package hardware is the base package for the VCS emulation. It and its sub-package contain everything required for a headless emulation.
The VCS type is the root of the emulation and contains external references to all the VCS sub-systems. From here, the emulation can either be started to run continuously (with optional callback to check for continuation); or it can be stepped cycle by cycle. Both CPU and video cycle stepping are supported.
Index ¶
- Constants
- type VCS
- func (vcs *VCS) AttachCartridge(cartload cartridgeloader.Loader) error
- func (vcs *VCS) DetatchEmulationExtras()
- func (vcs *VCS) End()
- func (vcs *VCS) Reset() error
- func (vcs *VCS) Run(continueCheck func() (emulation.State, error)) error
- func (vcs *VCS) RunForFrameCount(numFrames int, continueCheck func(frame int) (emulation.State, error)) error
- func (vcs *VCS) SetClockSpeed(tvSpec string) error
- func (vcs *VCS) Step(videoCycleCallback func() error) error
Constants ¶
const ColorClocksPerCPUCycle = 3
The number of times the TIA updates every CPU cycle.
const PerformanceBrake = 100
While the continueCheck() function only runs at the end of a CPU instruction (unlike the corresponding function in VCS.Step() which runs every video cycle), it can still be expensive to do a full continue check every time.
It depends on context whether it is used or not but the PerformanceBrake is a standard value that can be used to filter out expensive code paths within a continueCheck() implementation. For example:
performanceFilter++ if performanceFilter >= hardware.PerfomrmanceBrake { performanceFilter = 0 if end_condition == true { return emulation.Ending, nill } } return emulation.Running, nill
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type VCS ¶
type VCS struct { Prefs *preferences.Preferences TV *television.Television // references to the different components of the VCS. do not take copies of // these pointer values because the rewind feature will change them. CPU *cpu.CPU Mem *memory.Memory RIOT *riot.RIOT TIA *tia.TIA // The Clock defines the basic speed at which the the machine is runningt. This governs // the speed of the CPU, the RIOT and attached peripherals. The TIA runs at // exactly three times this speed. // // The different clock speeds are due to the nature of the different TV // specifications. Put simply, a PAL machine must run slightly slower in // order to be able to send a correct PAL signal to the television. // // Unlike the real hardware however, it is not the console that governs the // clock speed but the television. A ROM will send a signal to the // television, the timings of which will be used by the tv implementation // to decide what type of TV signal (PAL or NTSC) is being sent. When the // television detects a change in the TV signal it will notify the emulated // console, allowing it to note the new implied clock speed. Clock float32 }
VCS struct is the main container for the emulated components of the VCS.
func NewVCS ¶
func NewVCS(tv *television.Television) (*VCS, error)
NewVCS creates a new VCS and everything associated with the hardware. It is used for all aspects of emulation: debugging sessions, and regular play.
func (*VCS) AttachCartridge ¶
func (vcs *VCS) AttachCartridge(cartload cartridgeloader.Loader) error
AttachCartridge to this VCS. While this function can be called directly it is advised that the setup package be used in most circumstances.
func (*VCS) DetatchEmulationExtras ¶ added in v0.15.0
func (vcs *VCS) DetatchEmulationExtras()
DetatchEmulationExtras removes all possible monitors, recorders, etc. from the emulation. Currently this mean: the TIA audio tracker, the RIOT event recorders and playback, and RIOT plug monitor.
func (*VCS) End ¶ added in v0.15.0
func (vcs *VCS) End()
End cleans up any resources that may be dangling.
func (*VCS) Run ¶
Run sets the emulation running as quickly as possible. continuteCheck() should return false when an external event (eg. a GUI event) indicates that the emulation should stop.
func (*VCS) RunForFrameCount ¶
func (vcs *VCS) RunForFrameCount(numFrames int, continueCheck func(frame int) (emulation.State, error)) error
RunForFrameCount sets emulator running for the specified number of frames. Useful for FPS and regression tests. Not used by the debugger because traps (and volatile traps) are more flexible.
func (*VCS) SetClockSpeed ¶ added in v0.8.0
SetClockSpeed is an implemtation of the television.VCSReturnChannel interface.
Directories ¶
Path | Synopsis |
---|---|
Package cpu emulates the 6507 microprocessor found in the Atari VCS.
|
Package cpu emulates the 6507 microprocessor found in the Atari VCS. |
execution
Package execution tracks the result of instruction execution on the CPU.
|
Package execution tracks the result of instruction execution on the CPU. |
instructions
Package instructions defines the table of instruction for the 6507.
|
Package instructions defines the table of instruction for the 6507. |
registers
Package registers implements the three types of registers found in the 6507.
|
Package registers implements the three types of registers found in the 6507. |
registers/test
Package test contains functions useful for testing CPU registers.
|
Package test contains functions useful for testing CPU registers. |
Package memory implements the Atari VCS memory model.
|
Package memory implements the Atari VCS memory model. |
addresses
Package addresses contains all information about VCS addresses and registers, including canonical symbols for read and write addresses and registers.
|
Package addresses contains all information about VCS addresses and registers, including canonical symbols for read and write addresses and registers. |
bus
Package bus defines the memory bus concept.
|
Package bus defines the memory bus concept. |
cartridge
Package cartridge fully implements loading of mapping of cartridge memory.
|
Package cartridge fully implements loading of mapping of cartridge memory. |
cartridge/harmony
Package harmony implements the Harmony cartridge.
|
Package harmony implements the Harmony cartridge. |
cartridge/harmony/arm7tdmi
Package arm7tdmi imlplements the ARM7TDMI instruction set as defined in the ARM7TDMI Instruction Set Reference: http://www.ecs.csun.edu/~smirzaei/docs/ece425/arm7tdmi_instruction_set_reference.pdf For this project we only need to emulte the Thumb architecture.
|
Package arm7tdmi imlplements the ARM7TDMI instruction set as defined in the ARM7TDMI Instruction Set Reference: http://www.ecs.csun.edu/~smirzaei/docs/ece425/arm7tdmi_instruction_set_reference.pdf For this project we only need to emulte the Thumb architecture. |
cartridge/harmony/callfn
Package Callfn facilitates the ARM CALLFN process common to both DPC+ and CDF* cartridge mappers.
|
Package Callfn facilitates the ARM CALLFN process common to both DPC+ and CDF* cartridge mappers. |
cartridge/harmony/cdf
Package cdf implemnents the various CDF type cartridge mappers including CDFJ.
|
Package cdf implemnents the various CDF type cartridge mappers including CDFJ. |
cartridge/harmony/dpcplus
Package dpcplus implements the DPC+ cartridge mapper.
|
Package dpcplus implements the DPC+ cartridge mapper. |
cartridge/mapper
Package mapper contains the CartMapper interface.
|
Package mapper contains the CartMapper interface. |
cartridge/moviecart
Package moviecart implements the Movie Cart special cartridge type.
|
Package moviecart implements the Movie Cart special cartridge type. |
cartridge/plusrom
Package plusrom implements the PlusROM cartridge as developed by Wolfgang Stubig.
|
Package plusrom implements the PlusROM cartridge as developed by Wolfgang Stubig. |
cartridge/supercharger
Package supercharger implements the tape based cartridge format.
|
Package supercharger implements the tape based cartridge format. |
memorymap
Package memorymap facilitates the translation of addresses to primary address equivalents.
|
Package memorymap facilitates the translation of addresses to primary address equivalents. |
vcs
Package vcs represents the areas of memory that are internal to the VCS hardware.
|
Package vcs represents the areas of memory that are internal to the VCS hardware. |
Package preferences (sub-package of the hardware package) coordinates the options for all variations in hardware operation.
|
Package preferences (sub-package of the hardware package) coordinates the options for all variations in hardware operation. |
Package riot (RIOT) represents the active part of the PIA 6532.
|
Package riot (RIOT) represents the active part of the PIA 6532. |
ports
Package ports represents the input/output parts of the VCS (the IO in RIOT).
|
Package ports represents the input/output parts of the VCS (the IO in RIOT). |
ports/controllers
Package controllers contains the implementations for all the emulated controllers for the VCS.
|
Package controllers contains the implementations for all the emulated controllers for the VCS. |
ports/panel
Package panel implements the front control panel of the VCS.
|
Package panel implements the front control panel of the VCS. |
ports/plugging
Package plugging conceptualises the act of plugging devices into the VCS ports.
|
Package plugging conceptualises the act of plugging devices into the VCS ports. |
ports/savekey
Package savekey implements the SaveKey external memory card.
|
Package savekey implements the SaveKey external memory card. |
timer
Package timer represents the timer part of the RIOT (the T in RIOT).
|
Package timer represents the timer part of the RIOT (the T in RIOT). |
Package television implements the output device of the emulated VCS.
|
Package television implements the output device of the emulated VCS. |
coords
Package coords represents and can work with television coorindates Coordinates represent the state of the emulation from the point of the television and are used throughout the emulation for rewinding, recording/playback and general information.
|
Package coords represents and can work with television coorindates Coordinates represent the state of the emulation from the point of the television and are used throughout the emulation for rewinding, recording/playback and general information. |
signal
Package signal exposes the interface between the VCS and the television implementation.
|
Package signal exposes the interface between the VCS and the television implementation. |
specification
Package specification contains the definitions, including colour, of the PAL and NTSC television protocols supported by the emulation.
|
Package specification contains the definitions, including colour, of the PAL and NTSC television protocols supported by the emulation. |
Package TIA implements the custom video/audio chip found in the the VCS.
|
Package TIA implements the custom video/audio chip found in the the VCS. |
audio
Package audio implements the audio generation of the TIA.
|
Package audio implements the audio generation of the TIA. |
audio/mix
Package mix is used to combine two distinct sound sources into either a mono or stereo signal.
|
Package mix is used to combine two distinct sound sources into either a mono or stereo signal. |
delay
Package delay is a replacement for the future package, which has now been removed.
|
Package delay is a replacement for the future package, which has now been removed. |
hmove
Package hmove represents the TIA HMOVE process.
|
Package hmove represents the TIA HMOVE process. |
phaseclock
Package phaseclock defines the two phase clock generator used to drive the various polynomial counters in the TIA.
|
Package phaseclock defines the two phase clock generator used to drive the various polynomial counters in the TIA. |
polycounter
Package polycounter implements the polynomial counters found in the TIA.
|
Package polycounter implements the polynomial counters found in the TIA. |
revision
Package revision handles/documents the differences in the TIA across different models of the Atari 2600.
|
Package revision handles/documents the differences in the TIA across different models of the Atari 2600. |
video
Package video implements pixel generation for the emulated TIA.
|
Package video implements pixel generation for the emulated TIA. |