1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-03 08:05:40 +00:00
Commit Graph

185 Commits

Author SHA1 Message Date
Thomas Harte
eeb0e134fd Started the transition towards a more natural collection of rolling buffers, with phosphor decay in mind. 2016-02-13 20:52:23 -05:00
Thomas Harte
7bc5a43c36 Fixed type warning. 2016-02-12 22:30:22 -05:00
Thomas Harte
0527888b15 Endeavoured to ensure safe shutdown. 2016-02-12 22:30:06 -05:00
Thomas Harte
a6574d1f96 Made an attempt to factor out and more clearly to document my implementation of flywheel synchronisation. 2016-02-11 22:12:12 -05:00
Thomas Harte
b5bcadb8d3 Reinstated clipped CRT output, with more appropriate ownership of the decision. 2016-02-07 22:18:55 -05:00
Thomas Harte
4d0a218a57 Certainly at least seriously considering a separate holder for the "compile a shader" logic. Otherwise taking steps back towards PAL/NTSC decoding. 2016-02-07 17:32:38 -05:00
Thomas Harte
602327cd9d Sketched out a quick class for rendering to texture. 2016-02-07 15:42:02 -05:00
Thomas Harte
d3d505b7bc That's one header file less. 2016-02-05 23:05:58 -05:00
Thomas Harte
6ab425deda There is now a semi-reasonable amount of screen output again. 2016-02-05 21:35:39 -05:00
Thomas Harte
80e7e5e602 Updated to return old behaviour of drawing only upon changes. 2016-02-04 23:05:47 -05:00
Thomas Harte
8bc3f8046d This endeavours to move everything into the CRT class except the final version of shader building. 2016-02-04 22:57:46 -05:00
Thomas Harte
e0d51408e4 Onward with carrying this through to the bitter end, this at least results in all the appropriate knowledge and call-ins occuring at the CRT. 2016-02-04 22:28:50 -05:00
Thomas Harte
4554abb755 Made an attempt to be more rigorous in display generation on the Electron, to make sure I deal with mid-line changes to/from blank line mode. Even if it turns out that they generate pixels. 2016-01-29 21:14:13 -05:00
Thomas Harte
0efe4b312c Disabled my various bits of rate interchange debugging; improved test for when to call update_display due to a RAM write. 2016-01-21 22:16:52 -05:00
Thomas Harte
de7218cdf0 Added a lot of commenting to the CPU6502 definition, simplifying its construction. Added missing nullability modifier to CSElectron. Fixed bad-habit Objective-C style naming on the Electron's Interrupt enum. 2016-01-20 21:55:38 -05:00
Thomas Harte
f727582911 Started making first moves towards stripping CSCathodeRayView of its responsibilities. If that can be merely an OpenGL view that presents things, things will be a lot more portable. 2016-01-20 08:21:33 -05:00
Thomas Harte
e65cd4cf06 Some data is marginally reaching the CPU from the tape. 2016-01-19 22:05:34 -05:00
Thomas Harte
956b90e203 Attempted further to improve latency; added view adjustment for non-4:3 output aspect ratios. The 4:3 is currently hardcoded, so further work will be required. 2016-01-18 23:55:52 -05:00
Thomas Harte
90eef1df74 Tightened to provide lower latency audio, hopefully. 2016-01-18 20:01:06 -06:00
Thomas Harte
03f683d588 Gave the audio queue something a lot like a spin lock on waiting to pipe out audio. 2016-01-18 19:57:18 -06:00
Thomas Harte
5a39e42413 Wired up enough such that some basic attempt at parsing a UEF occurs.` 2016-01-18 17:06:09 -06:00
Thomas Harte
2779f0e569 Statred working on support for at least the most fundamental file format. 2016-01-18 15:46:41 -06:00
Thomas Harte
b70fdc2de8 Switched to being explicitly careful about not wrapping around and stomping on data not yet output. 2016-01-18 13:56:20 -06:00
Thomas Harte
ddcc34740b Added lots of debugging output while I attempt to locate the source of audio scratchiness, also simplified manner of dealing with wraparound within the AudioQueue wrapper. 2016-01-18 13:50:19 -06:00
Thomas Harte
781249acf7 Fixed crash. 2016-01-14 20:35:36 -05:00
Thomas Harte
38ffcaa262 Here, at last, is _some_ audio output, at least. 2016-01-14 20:33:22 -05:00
Thomas Harte
afde8dac49 Closed the loop such that audio manages to bubble up into Objective-C. 2016-01-13 22:38:59 -05:00
Thomas Harte
d9a7ef9e46 Edging towards audio output; the speaker is given appropriate input and output rates, and then updated with current divider and enabled/disabled status. 2016-01-13 21:03:43 -05:00
Thomas Harte
d28abdc037 Made an attempt at correct timing, adding support for additional paged ROMs, added file association for .rom. 2016-01-12 22:34:26 -05:00
Thomas Harte
84ba4e2900 Tidied a little, started working towards supporting speaker output. 2016-01-12 22:19:56 -05:00
Thomas Harte
3437781abd Started sketching out an interface for sound generation. Which made me realise that the CRT in CRTDelegate was redundant, since C++ has namespaces. 2016-01-12 16:54:09 -05:00
Thomas Harte
6112f4ef6b Withdrew soft filtering for now; until the sampling frequency is passed on it's not sufficiently rigorous. 2016-01-12 16:42:16 -05:00
Thomas Harte
75d6ec354b Added some very basic filtering in RGB mode. 2016-01-12 16:27:09 -05:00
Thomas Harte
49a36ec9ac Added F12 as break. 2016-01-11 22:35:52 -05:00
Thomas Harte
650077feac Pulled a few things out as constants, zoomed in a little. Still in a 4:3 window though. 2016-01-11 22:18:34 -05:00
Thomas Harte
e93dbdb463 Implemented keyboard input. 2016-01-11 19:48:31 -05:00
Thomas Harte
ce916ebd6a Fixed runaway frame generator. 2016-01-10 23:32:57 -05:00
Thomas Harte
3d6f20b7b9 Output, at last! Though sync is clearly way off. 2016-01-09 21:53:33 -05:00
Thomas Harte
09df218c01 Some output! Showing that three lines of solid sync isn't smart. But here it is. 2016-01-09 21:48:53 -05:00
Thomas Harte
b4f31edea3 Made an attempt to get RGB output mode up and running, and showing at least a box where pixels would be. 2016-01-09 21:32:56 -05:00
Thomas Harte
a900bfed65 Fixed to ensure that frame rendering wraps around, and to properly connect the Electron to its view. Now I need a working pixel shader. 2016-01-09 20:34:22 -05:00
Thomas Harte
716bb3281b This at least now connects up a CRT, though it never talks to it. 2016-01-07 22:26:49 -05:00
Thomas Harte
47a7654c00 Added just enough that this is probably a successful boot. I guess I'm going to need to get invested in graphics next? Hmmm. 2016-01-07 21:01:13 -05:00
Thomas Harte
0db8938d27 Added the option for the CSCathodeRayView to show only a subsection of the full scan area. Zoomed in a little on the 2600. Put in enough piping to give the Electron sight of its ROMs at least. 2016-01-06 23:14:36 -05:00
Thomas Harte
bfd9957c81 You now get an Electron only if you ask for a new file. That'll do for now while it's the only thing that one might want to start without supplying a file. The 6502 now starts from a defined point — being reset. The Electron is starting to grow the absolute most simple buds of its memory map. 2016-01-06 21:09:49 -05:00
Thomas Harte
c69b3256ba Slightly simplified Swift usage. 2016-01-04 23:44:36 -05:00
Thomas Harte
616dc0b57c Okay, so this is the absolute bare minimum about of refactoring and wiring necessary to get the [unimplemented] Electron machine pumping. 2016-01-04 23:40:43 -05:00
Thomas Harte
43ab8bbad5 Okay, so then here's a first shot at the Objective-C -> C++ bridge for the Electron. 2016-01-04 23:16:37 -05:00
Thomas Harte
ab45c1d530 Started working on a shell for the Electron emulation, including factoring out the common CRT delegate -> Objective-C bridging, serial dispatch queue and frameskipping logic from the Atari 2600 shell. 2016-01-04 23:12:47 -05:00
Thomas Harte
22fa024546 Added document XIB. 2016-01-03 20:46:39 -05:00
Thomas Harte
aa0714fe27 Started sketching out an Acorn Electron emulation, as it's a platform I'm familiar with and will force me to figure out PAL decoding. Factored out NTSC-specific parts of the display decoding logic and hence added RGB output mode. 2016-01-03 20:41:43 -05:00
Thomas Harte
96503a3ac5 Switched to nicer nullable/nonnull syntax. 2016-01-02 17:59:21 -05:00
Thomas Harte
feeedbe33b The standard Xcode versioning updates. Nothing of substance. 2016-01-02 17:57:23 -05:00
Thomas Harte
675070c5dd Very, _very_ minor: switched to normal C++ constructor syntax for simple variable initialisation. 2015-12-06 16:53:37 -05:00
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
cc98534f94 Added test for NOP, discovering the undocumented ones to be the incorrect length. 2015-08-13 07:32:50 +01:00
Thomas Harte
6616265d93 Fixed collision tests, added a few more timing tests. 2015-08-13 03:33:45 +01:00
Thomas Harte
dd0f17130a Found and fixed some timing errors in absolute indexed and in (indirect), y addressing modes: neither is able in write or read-modify-write modes to shave a cycle as then can when reading. 2015-08-13 02:58:39 +01:00
Thomas Harte
975836c30f Added a quick snippet test, discovering that I've cut a cycle from read/modify/writes. 2015-08-13 02:18:41 +01:00
Thomas Harte
503d684af0 Added a couple of timing tests, both of which seem to pass for now. 2015-08-13 01:55:23 +01:00
Thomas Harte
e8f70398c1 Added one basic timing test, for now: implied nop should be two cycles. 2015-08-13 01:06:56 +01:00
Thomas Harte
d19f8ed507 Removed the implicit reset upon 6502 startup, adding a reset line. Hence all tests now pass again. Added an empty shell for timing tests, the all-RAM 6502 now counting bus cycles. 2015-08-13 00:51:06 +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
53dd5c8f16 Trying to fix my RDY line emulation. Switched to PAL timings, at least temporarily, since it's starting to make a difference. 2015-07-31 16:44:53 -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
20c2d98b9a Converted remaining spaces to real tabs. 2015-07-30 20:51:32 -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