+stephena Posted May 1, 2012 Author Share Posted May 1, 2012 The following is the code structure from the Blargg implementation I'm using, showing the different aspects that can (eventually) be tweaked. I don't know if I'll have all of them 'tweakable' for 3.7, since I'm not sure what some of them even mean. Don't worry if the code itself doesn't make sense; I think the comments should suffice. typedef struct atari_ntsc_setup_t { /* Basic parameters */ double hue; /* -1 = -180 degrees +1 = +180 degrees */ double saturation; /* -1 = grayscale (0.0) +1 = oversaturated colors (2.0) */ double contrast; /* -1 = dark (0.5) +1 = light (1.5) */ double brightness; /* -1 = dark (0.5) +1 = light (1.5) */ double sharpness; /* edge contrast enhancement/blurring */ /* Advanced parameters */ double gamma; /* -1 = dark (1.5) +1 = light (0.5) */ double resolution; /* image resolution */ double artifacts; /* artifacts caused by color changes */ double fringing; /* color artifacts caused by brightness changes */ double bleed; /* color bleed (color resolution reduction) */ float const* decoder_matrix; /* optional RGB decoder matrix, 6 elements */ /* You can replace the standard TI color generation with an RGB palette. */ unsigned char const* palette;/* optional RGB palette in, 3 bytes per color */ unsigned char* palette_out; /* optional RGB palette out, 3 bytes per color */ /* Atari change: additional setup fields */ double burst_phase; /* Phase at which colorburst signal is turned on; this defines colors of artifacts. In radians; -1.0 = -180 degrees, 1.0 = +180 degrees */ double* yiq_palette; } atari_ntsc_setup_t; The scanline stuff I still need to look into. But I think it's very easy to do, since all this stuff will require OpenGL, and creating a scanline pattern in OpenGL is extremely easy. And bilinear filtering is easy too; in fact, it's already in Stella, and named 'Linear'. Quote Link to comment Share on other sites More sharing options...
Trebor Posted May 1, 2012 Share Posted May 1, 2012 (edited) Awesome. Thanks for sharing the code details and the additional information. Edited May 1, 2012 by Trebor Quote Link to comment Share on other sites More sharing options...
eshu Posted May 1, 2012 Share Posted May 1, 2012 looking great! - I can't wait Quote Link to comment Share on other sites More sharing options...
israelg Posted May 2, 2012 Share Posted May 2, 2012 Looking much better now...! Waiting for the release... I am willing to be used as a tester if you need help... I.G Quote Link to comment Share on other sites More sharing options...
+stephena Posted May 2, 2012 Author Share Posted May 2, 2012 Looking much better now...! Waiting for the release... I am willing to be used as a tester if you need help... I.G Let me know which system you need a build for (Windows 32/64, Linux 32/64, OSX). In the interests of time, I can only do one build for one platform. Quote Link to comment Share on other sites More sharing options...
israelg Posted May 2, 2012 Share Posted May 2, 2012 Looking much better now...! Waiting for the release... I am willing to be used as a tester if you need help... I.G Let me know which system you need a build for (Windows 32/64, Linux 32/64, OSX). In the interests of time, I can only do one build for one platform. Windows 64 Thanks, I.G Quote Link to comment Share on other sites More sharing options...
israelg Posted May 2, 2012 Share Posted May 2, 2012 I can connect my REAL Atari 2600 with a Sony CRT TV and make some side by side comparing with my computer & Stella using Blargg... I have the CRT TV and my computer on the same room... Quote Link to comment Share on other sites More sharing options...
+stephena Posted May 7, 2012 Author Share Posted May 7, 2012 OK, here's the first releasable version of Stella with Blargg TV effects. Some quick notes about what doesn't work/isn't finished: This isn't close to the final release, so there may be other things broken Blargg 'custom' mode isn't actually customizable There's no GUI whatsoever, so no knobs can be tweaked The scanlines don't have interpolation Phosphor mode doesn't work in TV modes And now for what does work: Alt-1 to Alt-6 set TV mode to off/composite/svideo/rgb/bad/custom (right now, custom is simply a copy of composite) Alt-7 increases scanline intensity, and Shift-Alt-7 decreases it (currently 20% - 100%) These effects require an OpenGL video card and supported drivers (see your video card manufacturer website for more info). I've tested on several Linux and OSX systems (real) and Windows (virtual), and things are working reasonably well. I don't know how it will perform on lower-end systems, and I'd be interested in any feedback you can provide. I recommend turning on GL v'sync in OpenGL modes anyway, but particularly for the TV effects (to eliminate 'tearing' in the images). Finally, I'd hoped to get this released by May 15 (and I still may make that date), but I'd also like to fix problem 5 above, and that's probably going to take some more time. Anyway, here's a build for Windows 32/64-bit. Quote Link to comment Share on other sites More sharing options...
eshu Posted May 7, 2012 Share Posted May 7, 2012 (edited) This is looking great as expected - Thanks for making the test build available..... I think there may be an issue when running with a zoom setting different than 2x - I get some weird artifacts that don't look like they belong, I'm guessing it might be using the 2x hardcoded somewhere by accident? Edit: actually 4x zoom looks fine to, just 3x has the problem - let me know if you want screenshots Edited May 7, 2012 by eshu Quote Link to comment Share on other sites More sharing options...
+stephena Posted May 7, 2012 Author Share Posted May 7, 2012 Yes, provide snapshots indicating what doesn't look quite correct to you. Since this is all visual anyway, the only way to really describe it is with snapshots. Also, make sure to try windowed vs. fullscreen modes (toggle with Alt-Enter) and see if the problems you mention appear in one but not the other. Quote Link to comment Share on other sites More sharing options...
eshu Posted May 8, 2012 Share Posted May 8, 2012 The effect is most pronounced on the left hand side about 2/3 down from the top of the screen. It only shows up when 3x is selected for zoom and effects all roms I've tested, and effects all options except filter off, in both windowed and full-screen mode. Quote Link to comment Share on other sites More sharing options...
+stephena Posted May 8, 2012 Author Share Posted May 8, 2012 The effect is most pronounced on the left hand side about 2/3 down from the top of the screen. It only shows up when 3x is selected for zoom and effects all roms I've tested, and effects all options except filter off, in both windowed and full-screen mode. It would also be helpful if you could either provide this ROM, or we both do testing on some other agreed-upon ROM. Also, what type of video card do you have? Quote Link to comment Share on other sites More sharing options...
eshu Posted May 8, 2012 Share Posted May 8, 2012 Here's the issue on a more standard ROM. My videocard is a Nvidia NVS 4200M Quote Link to comment Share on other sites More sharing options...
+stephena Posted May 8, 2012 Author Share Posted May 8, 2012 Try turning scanlines down as far as possible with Shift-Alt-7. Currently, the lowest it can go is 20%, but I'll do another build later this evening where it can be 0% (effectively turning off scanlines). If the problem starts to go away, then it's the scanline emulation, not the Blargg stuff (in Stella, these two things are done separately). Quote Link to comment Share on other sites More sharing options...
eshu Posted May 8, 2012 Share Posted May 8, 2012 (edited) That last snapshot was at 20%, but the effect becomes much more pronounced if I turn scanlines up, so I think that's the culprit. Once again just have to say how awesome this is - can't wait for the final build of 3.7! Scanlines at 100%: Edit to add snapshot Edited May 8, 2012 by eshu Quote Link to comment Share on other sites More sharing options...
israelg Posted May 8, 2012 Share Posted May 8, 2012 I am very happy with the visuals but I have vSync problem, I turned the vSync on but I still have tearing problems in games like barnstorming... Update: It was force off in my video card settings and after changing it to the application settings everything is OK...! I hope will have the time this weekend and do some side by side comparing real CRT vs CRT simulation... Thanks, I.G Quote Link to comment Share on other sites More sharing options...
+stephena Posted May 8, 2012 Author Share Posted May 8, 2012 I'll try to find some time today or this evening to look into the scanlines issue. BTW, I also recommend setting GL aspect (NTSC) to 90 or so, which makes the pixels more square and hence more authentic. Quote Link to comment Share on other sites More sharing options...
eshu Posted May 8, 2012 Share Posted May 8, 2012 I've realised PAL roms are differently effected - thought that might help you get to the bottom of the issue: Quote Link to comment Share on other sites More sharing options...
+stephena Posted May 8, 2012 Author Share Posted May 8, 2012 Unfortunately something has come up this evening, so I won't get to the scanline issue until tomorrow. However, here's a new test build with the following improvements: the range for scanline intensity is now 0-100%. So pressing Shift-Alt-7 will lower intensity down to 0, which essentially makes the scanlines invisible added scanline interpolation option, which can be toggled with Alt-8, and defaults to on (this allows blending of scanlines into the scene, making them less sharp and pronounced) I'd like to confirm that the above graphical glitches are from the scanlines. Please test by turning scanline intensity to 0 and confirm if the issues disappear. Quote Link to comment Share on other sites More sharing options...
eshu Posted May 8, 2012 Share Posted May 8, 2012 The issue didn't appear again until I disabled scanline interpolation - and disappears with intensity 0. Quote Link to comment Share on other sites More sharing options...
PFL Posted May 8, 2012 Share Posted May 8, 2012 Running the test build on my Dell Mini 9 with 32 bit Windows XP seems to work fine though it feels a little slower than the previous couple of releases. That may be a little psychological as I've been playing a lot on the real hardware of late so I'll continue playing around and let you know how I get on with a low end machine (Open GL 1.2). Quote Link to comment Share on other sites More sharing options...
Keatah Posted May 8, 2012 Share Posted May 8, 2012 I don't think this will work with openGL 1.2 It isn't working on 1.3, so... Quote Link to comment Share on other sites More sharing options...
Keatah Posted May 8, 2012 Share Posted May 8, 2012 I don't think this will work with openGL 1.2 It isn't working on 1.3, so... My bad. So that's how you turn it on. Must read the instructions. It is working with openGL 1.2 Quote Link to comment Share on other sites More sharing options...
+stephena Posted May 8, 2012 Author Share Posted May 8, 2012 This is designed to work with OpenGLES, which is many ways is simply OpenGL 1.3 or so. I don't really use many advanced OpenGL features, mostly just 2D texture scaling, filtering and blending. Also keep in mind that these extra features are going to be slower; there's no way around that. I would guess that it uses probably 30% more resources than before. So if the old release took 10% of your CPU, these new TV effects would probably push it to 13-14% or so. I'll try to test on the slowest system I have and see the results (800Mhz VIA CPU on an embedded board). But I suspect that any system from the past 5 years should be able to handle this. EDIT: Good news. I've been able to duplicate the scanline issues on my Macbook Pro, so that should make it much easier to fix the problem (it's always easier to fix something when I can personally see it happening). Quote Link to comment Share on other sites More sharing options...
Keatah Posted May 9, 2012 Share Posted May 9, 2012 I tested the speed on a 10 year old lappy with intel EXTREME graphics and a Dothan 1.7GHz cpu. It seems fine. But, how do I view the FPS. According to the documentation I have to be in some sort of TIA mode? And use ALT + 1 ?? That doesn't work. Either that, or I don't know what TIA mode is..? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.