Closed GoogleCodeExporter closed 9 years ago
OK well I found the bug. In SPU2.cpp of SPU2null and in the other SPU2 plugins
we
have this code:
u32 RateTable[160];
...
void InitADSR() // INIT ADSR
{
unsigned long r,rs,rd;
int i;
memset(RateTable,0,sizeof(unsigned long)*160);
Obviously this doesn't work so well on 64 bit machines where sizeof(unsigned
long) is
8! I fixed it and now it doesn't crash.
Are none of the developers on 64 bit machines? Bet you wish all bug reports
were like
this!
Original comment by tdh...@gmail.com
on 17 May 2009 at 4:03
Ah, yup. That'd do it. I'll assign to arcum for fixing.
>> Are none of the developers on 64 bit machines?
Not all, but most. However that doesn't matter since two reasons:
* With the exception of Arum we're Windows developers, and windows provisions us with a
foolproof 32-bit environment without any hassle or even a first or second
thought.
* MSVC compiles C code using uniform type sizes. 'long' in 64 bit modes is still 4 bytes,
which is the *LOGICAL* thing to do since compilers have long (aha pun) since
introduced
special 64 and 128 bit data types. GCC deciding to upgrade 'long' to 64 bits
just for x64
builds is useless from a programmer's standpoint, and only serves to break old
code.
For that matter, gcc in -m32 mode *should* be using a 32 bit value for longs.
Even if there
is some justifiable reason for using 64 bit longs when in 64 bit target mode,
there's no
reason to do so with the -m32 option specified.
Original comment by Jake.Stine
on 17 May 2009 at 5:54
Ah cool. I checked and -m32 does give 4-byte longs. I'm kind of with you on the
long
issue, but then again it has always been emphasized that long has a *minimum*
size of
4 bytes. C++0x should fix this issue anyway by introducing fixed-size types.
Anyway, it would still be good to have a configure flag. I think all it needs
to do
is add -m32 to all the C*FLAGS and make sure that cpu64=yes never happens (see
the
configure.ac file). This should be fairly easy to do. It won't completely solve
things because it is still a hassle to actually install the 32 bit libs. I
think you
can fairly easily do most of them using ia32-apt-get, but the nvidia-cg-toolkit
is a
pain.
I have given up for now and will install windows on a spare partition! Keep up
the
good work.
Original comment by tdh...@gmail.com
on 17 May 2009 at 6:41
-m32's already on all the flags, and I've taken out the stuff in configure.ac
throughout svn now, as well as fixed the section you mentioned in zerospu2 and
SPU2Null.
I'll go over some of the other plugins and pcsx2 a few times and change what I
can as
far as longs and unsigned longs. A 32-bit chroots still the easiest method, and
it's
what I personally use. I was able to build pcsx2 with plugins outside of a
chroot and
boot into the bios and KH1 today as of r1214, though I cheated a little.
(Since I had the chroot handy, I copied a few of the 32 bit libraries from it to
where my distribution keeps 32 bit libraries, /usr/lib32. Easier then trying to
find
them...)
Original comment by arcum42@gmail.com
on 18 May 2009 at 9:41
I'd consider this one fixed, since I've made the changes to SPU2null &
ZeroSPU2, and
removed the cpu64 code in the various configure.a files, though I'll continue
checking other files for unsigned longs...
Original comment by arcum42@gmail.com
on 19 May 2009 at 9:31
Sounds good. It will still be possible to compile in 64 bit mode right? I might
try
my hand at making it work as well as the windows version (with the one PS2 game
I
have)... I have a feeling it is a problem with the GS plugin - the zeroGS one
is the
only available one on Linux and it didn't work too well when I tried it in
windows
either.
Original comment by tdh...@gmail.com
on 19 May 2009 at 10:05
Yeah, I don't even recommend ZeroGS on pcsx2 despite the fact that it's the
only one
in the trunk that works on Linux. Use ZZogl on Linux:
http://forums.pcsx2.net/thread-4108.html
And on Windows, I'd use GSdx.
Original comment by arcum42@gmail.com
on 19 May 2009 at 10:08
Original issue reported on code.google.com by
tdh...@gmail.com
on 17 May 2009 at 3:51