+Random Terrain Posted April 27, 2011 Share Posted April 27, 2011 There are 4 ways you can use Stella (the Atari 2600 emulator) to make sure your program isn't taking too long and has a scanline count at a steady 262 for NTSC and PAL/60 games or 312 for PAL/50 games: The Fast, On the Fly Way Hit Alt + L while a game is running in Stella to toggle the frame stats. It displays the scanline count, frames per second, display format, and bankswitch type. It's very useful and it might be all you'll need. Sometimes a game will have little sneaky spots you could miss with Alt + L, so you might want to scroll down and try the Faster, Easier Way that uses the debugger to automatically stop the game any time the scanline count goes above 262 (or 312 for PAL/50 games). The Slow and Clunky Way Run your program using Stella and hit the key above Tab (`) for the debugger. Watch the box next to Scanline: while holding down Alt + f and see if the number changes from frame to frame. (Holding down Alt + f is like quickly clicking on the Frame +1 button.) If it stays at 262, there's no problem, at least for the moment. The problem with using Alt + f is that it's still kind of slow and you could miss something. The good news is that there is a better way to make sure that no frame ever goes over 262 scanlines (or 312 for PAL/50 games). The Typing is Fun Way The next fastest way to check if you're going over 262 is to type breakif {_scan>#262} in the Prompt display, hit the Enter key, then hit the key above Tab (`) to exit the debugger. If your program goes over 262, the debugger will automatically reopen. (Replace 262 with 312 for PAL/50 games.) The Faster, Easier Way For an even easier way to do this with no tedious typing, you can make a file that will run every time you open the debugger. This is how to do it using a Windows PC: Open Notepad, then copy and paste breakif {_scan>#262} in there. _ Select Save As under the File menu and locate the Stella folder which is now in your User folder under AppData > Roaming. _ Copy and paste autoexec.script into the Save As file name box and select All Files (*.*) from the Save as type drop down menu. (That fixes it so you don't have to go back and remove ".txt" from the file name when you're finished.) That's it. You're done. Now when you test a game you're working on, all you have to do is run it in Stella, hit the key above Tab (`) for the debugger, which activates the code in the autoexec.script file, then hit the key above Tab (`) again to exit the debugger. From then on (until you close Stella) the debugger will automatically reopen if your program goes over 262. The file only runs after you open and close the debugger, so you can play other games normally as long as you don't open the debugger. (Replace 262 with 312 for PAL/50 games.) Update For older versions of Stella Below is the autoexec.stella file, so all you have to do is unzip it and put it in the Stella folder under AppData > Roaming. autoexec.zip For newer versions of Stella Below is the autoexec.script file (the file extension changed from .stella to .script), so all you have to do is unzip it and put it in the Stella folder under AppData > Roaming. autoexec.zip Windows 10 The AppData folder (C:\Users\YOUR_USER_NAME\AppData\Roaming\Stella) is hidden on Windows 10, so you'll have to go to your user folder, make sure the ribbon is showing, click on the View tab, click on Options, select Change Folder and Search Options, select the View tab in the dialog box, click on Show hidden files, folders and drives, then click the OK button. Test Program Here is a program that goes over 262 when you move the sprite. You can use it to see if the Faster, Easier Way is working correctly: test_over_262_find_border_coordinates.bin Related Links: How to Attach Files and Images Posting Tips for New bB Users Easy Software Versioning 5 1 Quote Link to comment Share on other sites More sharing options...
dwane413 Posted April 27, 2011 Share Posted April 27, 2011 Thanks. Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted November 11, 2012 Share Posted November 11, 2012 Detecting Too Few Scanlines Start the game, and hit ~ to enter the debugger. Scroll up just a little bit and look for some code similar to these two examples: Example 1 Example 2 Using the address (the line that the very first VSYNC is on), enter the following "breakif" statement in the prompt tab inside of the debugger, and then hit enter. For example 1, the address is 194E, and you would enter: breakif {pc==194E && _scan<#259} For example 1, the address is B08E, and you would enter: breakif {pc==B08E && _scan<#259} FYI, these scanline settings are tuned for NTSC, VSYNC takes 3 lines or the 262 lines total. So 262 - 3 = 259. 2 Quote Link to comment Share on other sites More sharing options...
+stephena Posted November 11, 2012 Share Posted November 11, 2012 Detecting Too Few Scanlines FYI, these scanline settings are tuned for NTSC, VSYNC takes 3 lines or the 262 lines total. So 262 - 3 = 259. At some point, I plan to add a 'pseudo-op' specifically for this case (so you wouldn't have to figure out the actual PC to use). When I find the time ... 1 Quote Link to comment Share on other sites More sharing options...
+Muddyfunster Posted January 22, 2019 Share Posted January 22, 2019 just wanted to give this a cheeky bump as this is so useful when trying to track down over cycling in bB (or any 2600 programming). 1 Quote Link to comment Share on other sites More sharing options...
+stephena Posted January 22, 2019 Share Posted January 22, 2019 This comment was made before Stella was at Github. Now that it is, the proper way to address it is to create an issue here. The fact that it wasn't mentioned anywhere else is why I forgot about it for 6 years 1 Quote Link to comment Share on other sites More sharing options...
+Muddyfunster Posted January 22, 2019 Share Posted January 22, 2019 I was referring to RT's note on how to activate breakpoints for overcycling, not any issue logging with Stella I spent about an hour trying to find that post Quote Link to comment Share on other sites More sharing options...
+stephena Posted January 22, 2019 Share Posted January 22, 2019 OK, fair enough. That being said, if anyone want the functionality to detect undercycling (is that even a word), I still suggest adding an issue for it on Stella Github. Quote Link to comment Share on other sites More sharing options...
winkdot Posted January 23, 2019 Share Posted January 23, 2019 OK, fair enough. That being said, if anyone want the functionality to detect undercycling (is that even a word), I still suggest adding an issue for it on Stella Github. So is the symptom of under cycling a black screen? Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted July 24, 2019 Author Share Posted July 24, 2019 The file extension for autoexec changed from .stella to .script in newer versions of Stella, so I put the new version and what to do on Windows 10 in the first post. 1 Quote Link to comment Share on other sites More sharing options...
Sprybug Posted July 26, 2019 Share Posted July 26, 2019 Thanks RT, I'll be sure to change that on mine, although I am still using Win 7. It sounds like the new version uses .script regardless of what OS you have. I use this feature to make sure I'm not going over cycle count on Zed. 2 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted July 26, 2019 Author Share Posted July 26, 2019 41 minutes ago, Sprybug said: Thanks RT, I'll be sure to change that on mine, although I am still using Win 7. It sounds like the new version uses .script regardless of what OS you have. I use this feature to make sure I'm not going over cycle count on Zed. Thanks. I probably shouldn't have combined Stella/Windows 10 in the same section. I'll split them apart later tonight. 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.