Weird Interrupt Timing

Started by airship, September 20, 2007, 02:03 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

airship

Load this file in VICE and SYS 32000 to play it:

http://landover.no-ip.com/cbc/invno13.prg

It's choppy as all get-out, right?

Now set the emulator speed to 101%. It runs smooth as silk. Set it to 99%. Same thing. Set it to ANYTHING else and the interrupt timing is just fine. So why does it work at all speeds EXCEPT 100%?
Serving up content-free posts on the Interwebs since 1983.
History of INFO Magazine

nikoniko

Doesn't make the song choppy for me, but it does come out a bit screwy. Whenever I set WinVICE to 100%, the reported CPU speed drifts all over the place from as low as 93% up to 115%. However, if I set it a custom speed other than 100%, it will hold that speed constant.

airship

I would think 100% should be 100%. I can't imagine why they let it drift like that.

I'm sure it works a bit differently on different machines. But if setting anything other than 100% is rock-solid, you'd think 100% would be too! Very annoying.
Serving up content-free posts on the Interwebs since 1983.
History of INFO Magazine

nikoniko

Well, after a little thought, I realized what was causing the issue on my system. Sometimes I switch my monitor to its lowest refresh of 60Hz, set VICE to emulate an NTSC machine, and turn on VBLANK synchronization for a nice smooth experience. Well, I had VICE in PAL mode this time, my monitor at 90Hz (its highest reliable setting -- it's old), and had forgotten to turn off VBLANK synchronization. So, due to the mismatch, VICE's timing was affected. When VICE is set to any value other than 100%, it ignores VBLANK entirely regardless of the setting, so that's why the speed was stable with any speed besides 100%.

hydrophilic

Another (possibly related) timing issue.  When I switch VICE to NTSC mode, the frame rate stays at 50fps and the CPU slows down to 88%.  I can't do anything to get the video up to 60fps.  If I set video to 1/2 the frame rate goes to 25fps instead of 30fps and the CPU stays at 88%.  Can anyone confirm this problem?

I wonder if this has anything to do with my 2MHz patch?  It is now in the official release after all.  On the other hand, 2MHz works fine for 1.20 and 1.21 so it may be coincidence.

nikoniko

That's a bizarre one. Which platform are you using VICE on?

I guess you already checked VBLANK sync, right? Maybe that could happen if you have your monitor at 100Hz and sync on, but I'm not sure what else could cause it. What happens when you enter a custom CPU speed like 99% or 101%?

I doubt it's related to your patch. I've run both your initial release and the official 1.22 and can do 60fps just fine.

EDIT: Now that I think about it, VBLANK sync isn't even supposed to affect VICE unless it's fullscreen. So my problem being fixed by changing that setting doesn't make any sense. I'll have to look at the source code and see if it's utilizing VBLANK settings even the display isn't fullscreen.

airship

I've got VICE up right now and it shows 100% speed at 60fps. Of course, it drifts. :(

I've got 94% at 56fps, then 102%,at 63fps, etc. It's all over the map. This is version 1.21.
Serving up content-free posts on the Interwebs since 1983.
History of INFO Magazine

hydrophilic

I don't have any problem with 1.20 or 1.21 with or without 2MHz.  Its the new 1.22 with built-in 2MHz that causes trouble.

I didn't check the VBLANK setting cuz I was running in a window, in fullscreen I can't tell what the speed is.  You get 60fps just fine?  Must be my machine is too slow for the new release then.  I tried it on Windows 2000.  I'll try it again on Windows 95/98/Me and see if its any better.

nikoniko

My machine's pretty pokey, too, but it can get 100% most of the time. Certain demos can slow it down, though.

Does turning off sound playback bring up your CPU speed and/or frame rate at all?

hydrophilic

Thanks for your feedback guys.  I guess the timing thing is down right buggy.  I tried it again on Windows 2000 (with several open apps) and it went to 100%,60fps right away.  Then I turned on true drive emulation and did a DIRECTORY and the speed dropped a wee bit then shot right back to 100% 60fps after the BLOCKS FREE.  I am so happy :) :) :)

I guess I need to submit a patch for the buggy NTSC char ROM.  I've asked them about it a few times and they only seemed indirectly to acknowledge the problem exists.  It hasn't always existed, it appeared somewhere near 1.13 and still exists!  Proof: (NTSC mode), start emulator and at READY prompt type GRAPHIC4,1

Oooh the horror! :(