[hatari-devel] OS X frameskip issue
Eero Tamminen
eerot at users.berlios.de
Thu Jul 23 19:44:47 CEST 2009
Hi,
(I changed the subject as this isn't anymore about the convertors)
On Thursday 23 July 2009, Kåre Andersen wrote:
> >> > -int nFrameSkips; /* speed up by skipping video frames */
> >> > +int nFrameSkips=0; /* speed up by skipping video frames */
> >>
> >> It's possible that because you explicitly set the variable, it goes
> >> to a different section in the binary (.data instead of .bss)[1], but
> >> that should not have any effect on it's value as globals are
> >> automatically zeroed. (Apple documentation I referred in my earlier
> >> mail already stated that .bss should be zeroed.)
> >
> > I agree with Eero here. I hardly can believe that the .bss is not
> > initialized to zero on Mac OS X (it's a BSD/Unix based OS, and all such
> > systems clear the BSS as far as I know).
>
> Ok, talking to my guru gives the same answer: The C standard defines
> that bss should be cleared. And Eero found the info that i could not
> find, so I back down from this... Sorry for jumping the gun - again -
> bad habit. I guess the fix was just too simple to be correct....
>
> > So the real problem (a wrong memory access) might still persist, it's
> > just not visible anymore since the variable has been moved to another
> > location in memory.
>
> I will try to track this down as best as I can tomorrow daytime.
> Better get as much done as possible before holidays end....
Could you remove zeroing of the nFrameSkips and do following change:
--------------------
--- a/src/video.c Tue Jul 21 23:37:35 2009 +0300
+++ b/src/video.c Thu Jul 23 20:40:53 2009 +0300
@@ -2483,6 +2483,14 @@
static void Video_DrawScreen(void)
{
bool bScreenChanged;
+
+ static int OldFrameSkips = 0;
+
+ if (nFrameSkips != OldFrameSkips) {
+ fprintf(stderr, "DEBUG: nFrameSkips, old: %d, new: %d\n",
+ OldFrameSkips, nFrameSkips);
+ OldFrameSkips = nFrameSkips;
+ }
/* Skip frame if need to */
if (nVBLs % (nFrameSkips+1))
--------------------
Then run Hatari in a way that earlier produced the issue and mail
us what it outputs.
I want to know what the problematic value is and whether it changes.
If it's because of overwrite from some other variable, the bogus frameskip
value(s) could tell what does the overwriting.
- Eero
More information about the hatari-devel
mailing list