Thomas Harte
5feef2110f
Added a very basic attempt at shadow mask emulation.
2015-09-24 21:23:16 -04:00
Thomas Harte
63b648be65
Switched down to four samples per pixel, just more than half as many, to fit into a vec4. Edges aren't as smooth but I'm wondering whether it'll make much odds when I implement a shadow mask.
2015-09-17 19:25:15 -04:00
Thomas Harte
5d6bee4927
Of course, being in-phase means being the cosine wave.
2015-09-10 21:30:39 -04:00
Thomas Harte
6a0b4e86c8
An Xcode beta version bump, nothing more.
2015-09-05 17:21:36 -04:00
Thomas Harte
53e699516b
Disabled multisampling unless and until I can get the per-pixel cost down.
2015-09-05 17:21:16 -04:00
Thomas Harte
39027b675d
Fixed YIQ conversion and made sampling pattern slightly more rational.
2015-09-05 17:09:24 -04:00
Thomas Harte
80cf3d9301
Formally gave the 2600 responsibility for providing the code that decodes one of the things it has put into a buffer into a composite sample.
2015-09-03 12:28:16 -04:00
Thomas Harte
ac8fc9a1a0
Experimenting with pre-encoding luminance and chrominance separation over on the
...
CPU as otherwise the GPU does them repetitively and more awkwardly (as it's working purely in floats). It means uploading twice as much data though, so I don't
know. Still only half as much as the RGBA path of a few days ago. Will experiment.
Also slightly adjusted division of responsibility in the fragment shader per the
desire to have the `sample` function owned externally.
2015-09-03 11:15:23 -04:00
Thomas Harte
11acf3f2d3
Made some further minor attempted improvements.
2015-09-02 20:51:56 -04:00
Thomas Harte
161450942a
Removed outdated comment. This is better now than it was.
2015-09-02 17:20:23 -04:00
Thomas Harte
0d6094d842
Attempted very basic vectorisation, plus some minor other clean-ups.
2015-09-02 17:17:22 -04:00
Thomas Harte
f60ba4f487
Added a note about horribleness to the source. You never know who's looking.
2015-09-01 22:38:15 -04:00
Thomas Harte
cb6e6e8acb
It's the worst fragment shader you'll ever see. The worst. But this attempts NTSC composite video emulation, artefacts included.
2015-09-01 22:36:45 -04:00
Thomas Harte
5fe0cff692
Fine. I'll accept 'bin' files if I must.
2015-08-19 21:36:50 -04:00
Thomas Harte
a62c7f5c56
At last! Discovered CRT scanning bug; was always moving by the full proposed run length along the scan, not the time until the next event. Using this, have implemented proper vertical sync at last (I think). Have disabled scanline banding too, as now everything meets up it's more helpful to be able to see with clarity.
2015-08-18 22:22:47 -04:00
Thomas Harte
462a791ed3
Ensured that no backlog accumulates of cycles to run. Otherwise the background queue was lagging behind.
2015-08-18 21:13:54 -04:00
Thomas Harte
ca6b54536e
Added fire and reset inputs.
2015-08-18 20:58:05 -04:00
Thomas Harte
bc805a90fe
Wired up joystick directions, at least, and fire button presses get as far as the C++. But there's some latching to figure out before they'll work.
2015-08-18 20:33:24 -04:00
Thomas Harte
902795d61c
Switched vertical sync detection method, at least for now. They never happen automatically (I need to fix that) and just always take effect if detected in the lower half of the display. PAL/NTSC is determined just by looking at the refresh rate.
2015-08-18 00:17:03 -04:00
Thomas Harte
a693c081f8
Switched on the appropriate compiler warnings re: signed comparisons and implicit conversions. Fixed all less-than-explicit calls.
2015-08-16 16:08:29 -04:00
Thomas Harte
1cc479affd
Removed redundant GL call.
2015-08-16 15:40:03 -04:00
Thomas Harte
391789e75c
Removed stray space.
2015-08-13 23:22:51 +01:00
Thomas Harte
cbe76ea5d5
Got rid of the thread hopping in order to redraw the GL view. Which appears to help significantly with total application cost.
2015-08-13 22:01:25 +01:00
Thomas Harte
0e52b7365e
Removed redundant code.
2015-08-10 16:42:25 +01:00
Thomas Harte
eb23a493e5
Switched back to one texel per colour clock, at least for now. Attempted to break _RGBA assumption within the cathode ray view.
2015-08-05 23:36:04 -04:00
Thomas Harte
fd36f13baf
The cathode ray view no longer hard codes the frame size. So that's one less coupling. Doubled pixel output size to give sufficient sampling detail to capture the NTSC colour clock (ummm, hopefully).
2015-08-05 21:45:47 -04:00
Thomas Harte
67e82c713f
Broke assumption that every item in a vertex description is a short, specifically turning lateral into a byte. Which buys me a byte for phase, if that's sufficient.
2015-08-05 21:12:33 -04:00
Thomas Harte
5644b3a1cc
Fixed scanline sizing and fill issues, as well as shortening vsync to the correct Atari length.
2015-08-05 20:55:27 -04:00
Thomas Harte
5313b48ebd
I'm ashamed to admit, I: played with numbers until enough things looked stable such that I can investigate other things. Discovery: my PAL autodetection was way off. Fixed, hopefully.
2015-08-02 20:32:18 -04:00
Thomas Harte
6e52e5df1c
Full separate 'lateral' usage is go. Also probably at some point I need to throw in a phase property, which this new flexibility will help with.
2015-08-02 14:32:29 -04:00
Thomas Harte
3ab6585789
Started making the format of data included in a CRTFrame less a matter of variously hard-coded magic constants. Which will allow me to separate the idea of an internal lateral position from the direct texture coordinate, avoiding precision sampling errors at the top and bottom.
2015-08-02 14:25:21 -04:00
Thomas Harte
be421587ad
Eliminated the vertical retrace counter; vertical retrace ends when the beam gets back to the top.
2015-08-02 13:48:35 -04:00
Thomas Harte
9c91f1a2eb
Added an attempt at NTSC/PAL autodetection, based on number of missed vertical syncs.
2015-07-31 18:04:33 -04:00
Thomas Harte
a5d66e9dd6
Factored out a few more constants, started trying to ensure there's enough slack and the mechanisms in place for the CathodeRayView to hold onto two frames if it desires, for potential phosphor simulation, switched once again to additive blending — much more like a real CRT — and added a sine function across the width of spans per my understanding of how an electron gun actually fires.
...
Why do all this when overall timing is still so far off? It helps me more easily see how overall timing is so far off.
2015-07-31 17:47:10 -04:00
Thomas Harte
e4615cda2e
Switched back to unrealistic solid raster beams for the time being.
2015-07-30 23:01:59 -04:00
Thomas Harte
cfe758daa0
A tweak here, a tweak there, to help with debugging.
2015-07-30 21:29:40 -04:00
Thomas Harte
98efae2536
Reintroduced emergency vertical sync — so that output occurs even when the emulation isn't catching syncs properly — and switched some spaces to tabs.
2015-07-30 17:16:49 -04:00
Thomas Harte
828ae66a45
It appears ARC extends its reach into C++ nowadays. Fixed additional retain cycle.
2015-07-27 21:17:53 -04:00
Thomas Harte
3c25ead1f3
Started working out some of my retain cycles and general failures to release. Switched .mm filename so that Xcode will stop getting confused when I try to switch between implementation and interface files.
2015-07-27 21:15:10 -04:00
Thomas Harte
1cbebdafcc
This now uploads only a portion of the source buffer if possible. Which is usually possible.
2015-07-27 20:58:51 -04:00
Thomas Harte
1f229ee6f7
More tweaks to provide a stable image, at least for the time being.
2015-07-27 20:18:25 -04:00
Thomas Harte
01109d441b
Made an attempt at NTSC colours. Hard coded in RGB, not composite. Short cuts, tsk.
2015-07-27 19:04:03 -04:00
Thomas Harte
662e7942ac
Enabled multisampling. This is hardly an expensive use case.
2015-07-27 16:57:11 -04:00
Thomas Harte
b9cf6fd4dc
Implemented a virtual skew control, hard coded to what is conveniently exactly the right number.
2015-07-27 16:44:47 -04:00
Thomas Harte
caffe56a2d
Slightly expanded width of cathode ray gun, decided to figure out exactly how to deal with off-by-one lengths and precision at a later date, ensured that failure to catch vertical sync doesn't cause out-of-bounds buffer access on the hard-coded, assumed large enough, 512x512 data textures.
2015-07-27 00:28:47 -04:00
Thomas Harte
65bb31d55b
With around about a thousand issues, not the least of which being sometimes unsafe memory accesses, I've at last got pixels on screen.
2015-07-26 23:50:43 -04:00
Thomas Harte
cd0a62d21e
With a slight tweak to the informal protocol used for 6502 memory access cycles, ensured the wait strobe actually halts the CPU, to give a more accurate linking of machine time to real time.
2015-07-26 15:55:19 -04:00
Thomas Harte
6252f6030f
Switched to idiomatic source name, ensured latest project name is in all appropriate header places, threw texture coordinates slightly into the shader mix.
2015-07-26 15:25:11 -04:00
Thomas Harte
e53fbcf9ea
Reshuffled to make the OpenGL view explicitly a conduit for CRT-style output, and to give it responsibility for frame drawing. Which is still an awkward thread hop for the time being, but I've yet to read up on the advocated approach to multithreading with an NSOpenGLView; it looked like special provisions were available.
2015-07-26 15:13:46 -04:00
Thomas Harte
78a91b67c5
Quickie: make sure the correct context is adjusted; use the intended convertPointToBacking:.
2015-07-24 23:42:19 -04:00