Jump to content
IGNORED

Having some trouble with AUDV0


Recommended Posts

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)?

post-6010-0-08373200-1452674401_thumb.jpg

scanrate.asm

scanrate.bin

Edited by TheHoboInYourRoom
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. :)
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...