Menu

#11 Trailing Spaces Bug

open
nobody
None
5
2002-07-01
2002-07-01
No

I ran into an odd bug today. The *real* odd thing about it
is that if you set 'debug' to 'yes', it didn't occur!! Well,
the truth is, it occurred but the nature of the debug
pauses fixes the problem - read on....

I moved Game Launcher from d:\glaunch to
d:\emulation\front_ends\glaunch.

BTW, *UNRELATED BUG*: If you put the glaunch
directory under a directory with spaces in it, the program
will fail to CD back into the glaunch directory when you
exit the emulator because of the space in the directory
name (at least under debug mode it will).

Okay, back to the real bug....

The other thing I did was set '-noafs -fs 0' in the global
parameters of each cfg file. I did this using the same
editor (UltraEdit) that I've always used to make config
changes.

Now, for some reason, after I moved it and changed the
shortcut/working-dirs for my icon, GL could no longer
launch games. It ran fine/played MP3s, but selected
games failed to start.

I commented out the frameskip options I had set and
tried again, but it had the same problem.

When I put it in debug mode, to see what it was doing, I
saw that instead of calling, say, 'mame ckong', it was
now calling 'mame ckong ' (note the two spaces on the
end).

So, what was really happening was MAME would get
the extra spaces on the end of ckong and say 'hey, I
know of duplicate ROMs that are *close* to that: ckong,
ckonga, etc...". Debug mode works around the problem
because the spaces get discarded between two of the
debug steps.

I went into the configuration files and saw that the "rom
extension to use" (sorry I can't remember the variable
name, I'm away from the machine) was still
blank 'whatevervar = ' (single trailing space) and
the "use rom extension" was also not
set 'use_extension = '.

In desperation, I set use_extension to 'no', and set the
rom extension to 'whatevervar =' (no trailing space), and
set the globals to 'global_parameters =' (no trailing
space).

AND IT WORKED!

I put back in the frameskip options ('global_parameters
=-noafs -fs 0' - no space between 'equals' and '-noafs')
and it still worked.

I don't claim to understand why the hell this never
happened before, since I always use the same editor
and had touched those files many times. I don't even
know if the rom extension piece had anything to do with
it. But, for some reason it was using the space to the
right of the 'global_parameters =', and *possibly* using a
space for the rom extension even though the 'use'
variable was not set.

Is this some side-effect of CR/LF Unix vs. DOS file
formatting???

Discussion


Log in to post a comment.