the best way to do this is to use fixedpoint maths:
int SamplePos=0;
int SampleSpeed;
SampleSpeed=65535*2; // Would play the sample at double it's original freq
SampleSpeed=65535; // would play the sample at is original freq
SampleSpeed=32768; // would play the sample at 1/2 is original freq...
>>Whoa,
>>Quick reply!
I'm at work and bored waiting for a build :(
>>The original code is using directsound, and making each channel and just doing:
>>channel->SetFrequency(freq);
>>I don't know exactly how I'd map that to GP32 sound stuff, so that's where I >>am, really.
umm you've got...
So say I was doing 8bit samples.
I'd want to make sure that it'd never go over 128 or under -127 because that's where it'd wrap and that's what causes the horrible distortion, correct?
yup - that wrapping would cause terrible distortion, so you've gotta clip to -127,128 - you still get...
So (Sum(Channel Values))/Num Channels is basic mixing, I think
no - there is no divide - just add the channels, simple really. Also you've got to clip the result else you'll get really really horrible distortion.
Snes Emulation is slow because of various reason - but the main ones are:
Custom GFX hardware - very powerful - very tough to emulate fast on a slow cpu (gp32)
Audio Hardware another can of worms in itself.
all these things have to by synchronised along with the cpu - this again takes even...
chunk-e-munk-e: If you're really lucky you'll be on a JAL 777 - which is simply the best airplane ever - they have user on demand movies, games the lot. I think they've also just upgrade to wi-fi too!!! if it's not a 777 - don't expect much apart from a jap movie about the life of a guide dog...
Mr Spiv: I'm really sorry, but didn't have time to catch that damn seacat - I'm really gutted about that - but I'm sure next time I'm in se (coz it's soo hot here in oz - I guess my summer hols will be in se) i'll pop over to booze with ya!! ;)
Robster: I'll almost certainly be on the south island around xmas time (for a short holiday) - so I'll give you a shout for a booze up.
Axeman: Man I miss the good ole drunken newport piss ups - I'll give you a shout next time I'm back :)
One really simply optimization to get it running at fs0 is to interlace the frames. What I mean is each frame draw alternative vertical scan lines for sprites background and blitting. Looks a bit crazy on fast moving games (sonic e.t.c) but certainly will get it running at fs0 and looks good on...
I'm pretty sure you'd never get it to work on the gp32. This emu's speed comes from the fact that the GBA and Snes hardware are quite similar and utilizes the gba's hardware to the max.
OK so your .dat file is a bit stream?
there are multiple solutions here
1) you can block load the .dat file into a temp array and bit stream parse into your destionation array
2) Fix the program that generates the .dat so it's optimal to load directly via a struct
3) Generate a H file and...
Also Just Noticed:
GpFileRead(h_file, buffer, offset, (ulong*)bytes );
should be
GpFileRead(h_file, buffer, offset, (ulong*)&bytes );
if the function is expecting a pointer :)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.