TheHoboInYourRoom Posted January 13, 2016 Share Posted January 13, 2016 (edited) I know that sample playback is not exactly "for newbies", but I'm having some trouble even getting started with it. I decided to push out a sample on every scanline, so I threw together the attached program to put out a square wave and confirm that I'm on the right track (also to directly measure the NTSC Atari's HSync frequency, but I've already found the answer to that question). It works in Stella, but when I run it on my real VCS, I hear a tiny beep and then my TV completely loses sync (photo attached). I should note that Pitfall II and DPC+ audio demos do actually work on my TV. Stepping through the code in Stella's debugger, the write to AUDV0 is taking effect on the third cycle of every scanline. So my questions are: - When is the earliest safe time to write to AUDVx? - What part of the TV signal is being interfered with (if anyone knows)? scanrate.asm scanrate.bin Edited January 13, 2016 by TheHoboInYourRoom Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted January 13, 2016 Share Posted January 13, 2016 Your missing the fact that it's up to your program to generate the display. That includes triggering the sync signal once per frame. Go check out my blog series Collect. Step 1 is all about generating the display. Once you understand what's going on, check out Step 2 which rewrites the code in Step 1 to use timers. Once you wrap your head around the code in Step 2, try to add your AUDV0 code to it. Quote Link to comment Share on other sites More sharing options...
TheHoboInYourRoom Posted January 13, 2016 Author Share Posted January 13, 2016 I already know about generating the sync signal. My intention is to blank the display when the sample plays, like how Quadrun does it. As it happens, I added the CLEAN_START macro from macro.h to the beginning of my code, and the updated version actually works as intended now. Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted January 13, 2016 Share Posted January 13, 2016 My intention is to blank the display when the sample plays, like how Quadrun does it. You did not mention that, you only said your TV was losing sync. As such, when I took the time to look at your source and noticed there was not any sync signal logic, I was lead to believe you didn't understand that aspect of 2600 programming. Quote Link to comment Share on other sites More sharing options...
TheHoboInYourRoom Posted January 13, 2016 Author Share Posted January 13, 2016 You did not mention that, you only said your TV was losing sync. As such, when I took the time to look at your source and noticed there was not any sync signal logic, I was lead to believe you didn't understand that aspect of 2600 programming. My apologies. Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted January 14, 2016 Share Posted January 14, 2016 I already know about generating the sync signal. My intention is to blank the display when the sample plays, like how Quadrun does it. As it happens, I added the CLEAN_START macro from macro.h to the beginning of my code, and the updated version actually works as intended now.You will run into trouble on so some modern TV's if you blank the display and let go of handling VSYNC. I have a Toshiba 55" LED TV, and when it looses sync it mutes the sound. There is no setting to stop that. I discovered this when I was testing iesposta's speech strings for the Dr Who hack of Berzerk. I would see a black screen with no sound, and then the gameplay would return. Ultimately We went with a kernel that blanked the screen while still keeping sync to solve the problem. If you're updating the audio every line, or every second line, then it is easy to do. Dr Who was a little more work as it was every 4 lines, and 262 is not divisible by 4. I didn't want to do 260 or 264 line game. I've read of some TV's rolling while being off by only 1 scanline. It's best to do things to maintain maximum compatibility whenever you can. Quote Link to comment Share on other sites More sharing options...
TheHoboInYourRoom Posted January 14, 2016 Author Share Posted January 14, 2016 You will run into trouble on so some modern TV's if you blank the display and let go of handling VSYNC. I have a Toshiba 55" LED TV, and when it looses sync it mutes the sound. There is no setting to stop that. I discovered this when I was testing iesposta's speech strings for the Dr Who hack of Berzerk. I would see a black screen with no sound, and then the gameplay would return. Ultimately We went with a kernel that blanked the screen while still keeping sync to solve the problem. If you're updating the audio every line, or every second line, then it is easy to do. Dr Who was a little more work as it was every 4 lines, and 262 is not divisible by 4. I didn't want to do 260 or 264 line game. I've read of some TV's rolling while being off by only 1 scanline. It's best to do things to maintain maximum compatibility whenever you can. Well, you've convinced me. I'll find a way to include VSYNC. 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.