1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-28 08:29:34 +00:00
A latency-hating emulator of 8- and 16-bit platforms: the Acorn Electron, Amstrad CPC, Apple II/II+/IIe and early Macintosh, Atari 2600 and ST, ColecoVision, Enterprise 64/128, Commodore Vic-20 and Amiga, MSX 1, Oric 1/Atmos, Sega Master System, Sinclair
Go to file
2016-07-12 20:23:56 -04:00
Components Fixed accidental indentation. 2016-07-10 08:05:05 -04:00
Machines Completed handing of the disk all the way to the 1540. 2016-07-10 16:24:46 -04:00
OSBindings/Mac Sketched out an interface for a digial PLL. Not persuaded yet. Baby steps. 2016-07-11 22:12:58 -04:00
Outputs Moved opening bracket appropriately. 2016-07-04 21:14:28 -04:00
Processors/6502 Since the ROM is well disassembled, let's actually try to be a 1541 first. 2016-07-06 22:17:32 -04:00
ROMImages Furthered fleshing out of the 1540. Though it doesn't yet receive a ROM so won't even attempt to do anything meaningful. 2016-07-05 16:39:18 -04:00
SignalProcessing Fixed run extension, temporarily forced colour amplitude. 2016-04-23 14:16:49 -04:00
Storage Started sketching out the basic form here, albeit that it doesn't yet do _the only thing it advertises itself as useful for_. 2016-07-12 20:23:56 -04:00
.gitignore Reorganised system ROMs out of the Mac-specific folder, adjusted Mac code to expect to find them organised hierarchically (as how many os.roms am I going to have?) and added readme files to explain what's missing from the Git repository. 2016-06-05 08:33:01 -04:00
LICENSE Initial commit 2015-07-16 19:46:52 -04:00
README.md Update README.md 2016-06-29 11:12:03 -04:00

CLK

An attempt to unify various bits of emulation; features:

  • a best-in-class emulation of the Acorn Electron; and
  • mediocre emulations of the Atari 2600 and Commodore Vic-20.

All code is motivated by a signals processing approach and a distinction between execution units and bus logic.

If simulating a TV, the CRT emulation uses your GPU to decode (and, as required by the emulated platform, possibly to encode) a genuine composite video stream — dot crawl et al are present and correct as a natural consequence, not as a post-processing effect. If a machine generates audio at 2Mhz then the source wave is modelled at 2Mhz and a standard windowing filter produces a 44Khz-or-so stream.

The hard emulation parts are C++11 and assume the OpenGL Core Profile; an Objective-C++/Swift UI binding for the Mac is present, making this completely native for Mac users. The intention is to provide additional OS bindings and ensure operation within ES 3.0 environments.

TV Emulation

Composite decoding is currently performed purely by notch filtering; this produces worse separation than a comb but remained the predominant method for cheap TVs into the 1980s so is nevertheless not unrealistic. As I have yet to introduce any sort of inter-line processing, when running in PAL mode mine is the equivalent of a PAL-S. Since all signals propagate within a closed circuit there's no opportunity for a phase change that would produce Hanover bars but it's probably something that needs addressing regardless.

I've hesitated on a comb since it becomes complicated with machines — including the already-supported Atari 2600 — that use a not-strictly-conformant line length†, or, more substantially, with those that reset phase every line††.

All filtering is windowed finite impulse response, coefficients via Kaisser-Bessel, with up to 21 taps (adjacent samples are obtained from a single point via bilinear filtering where possible but that requires the adjacent coefficients to have the same sign; where that's not possible the number of taps may drop as the number of GLSL samples remains the same; it'll almost certainly be either 19 or 21 taps given the other operating conditions).

† per the documentation, its 228 cycles per line make each of its pixels exactly one NTSC colour clock long. There are 227.5 NTSC colour clocks per line so its hardware would appear to produce longer-than-specified lines (albeit still well within tolerable variation).

†† I suspect that a real TV will switch to a notch if adjacent colour bursts appear to keep resetting the colour oscillator, amongst other sanity checks, as analogue delay lines have a physically-fixed duration. I just need to do the same.