So when do you guys think full speed SNES emulation with sound will be possible. The newest PPC's do a decent job with perfect settings and sound disabled, but really how soon will PPC's be available that can handle it all with no problem?
When will we have full speed SNES?
Two days
... can anyone expand on that?
Not in a looong time... get a laptop/tablet pc in the meantime. PPC manufacturers aren't trying to improve their PPCs to be better for proc-intensive gaming, and Microsoft really isn't helping much.
I think it's possible if someone takes the time to rewrite the core emulation in arm assembly. I read a post from someone who looked at the intermediate asm from pocketsnes and said a asm re-write would produce huge speed gains. I'd like to see a PPC PCEngine Emu full speed with sound. All the ones I've tried run about as well as the PPC Snes emu's. Though there's a guy who got a PCEngine emu to run on the StrongArm with sound over 60fps. The whole emulator is written in arm asm, source available. http://www.plasma.demon.co.uk/pcengine/pce.html
Assembly hurts my head. Any takers. I've emailed the the developer who thought that at least the core would be portable.
Assembly hurts my head. Any takers. I've emailed the the developer who thought that at least the core would be portable.
Actually, you might be right... PocketSNES isn't known for being well-written.
After all, the x86 version SNES9x does have a lot of assembly in it. HOWEVER, it still manages to not be full-speed on my 233 MHz Pentium II. (the one with the 512k cache, too)
After all, the x86 version SNES9x does have a lot of assembly in it. HOWEVER, it still manages to not be full-speed on my 233 MHz Pentium II. (the one with the 512k cache, too)
Make it so.
snesce runs full speed (albeit without sound)on the newer ppcs (especially at 300Mhz+)..
some taiwanese guy named sukon wrote it, and I still have no idea what he used to port it, becuase its availble on MIPS and ARM (so its doubtful ti was assembly) and runs extremely fast.
I think its still available on techmages site.
the only problem is that it wont run on some ppcs due to the display properties.. at the time it was setup for the first Ipaq which had the flipped screen...
okay im done now.
some taiwanese guy named sukon wrote it, and I still have no idea what he used to port it, becuase its availble on MIPS and ARM (so its doubtful ti was assembly) and runs extremely fast.
I think its still available on techmages site.
the only problem is that it wont run on some ppcs due to the display properties.. at the time it was setup for the first Ipaq which had the flipped screen...
okay im done now.
Full speed? Even games like Starfox?
No, Jaybot just has one of those funky H1910's
nah, the 1910 has portrait video drawing as opposed to the 5450 and other ipaqs.. so it wont display correctly.
starfox was an FX chip game.. however... i believe it may actually support it. Havent tried
starfox was an FX chip game.. however... i believe it may actually support it. Havent tried
And also, simply because someone writes a program in ASM doesn't mean it will run faster. In fact, that's what C++ compilers DO, they take easily understand programming language and change it into the most optimized ASM or Machine Language code it knows how to produce. ASM isn't some magic way of speeding things up, it's a language just like any other, it's just that it's a step more abstract for the person to program and harder for the illiterate to understand.
James Sonne wrote:
And also, simply because someone writes a program in ASM doesn't mean it will run faster. In fact, that's what C++ compilers DO, they take easily understand programming language and change it into the most optimized ASM or Machine Language code it knows how to produce. ASM isn't some magic way of speeding things up, it's a language just like any other, it's just that it's a step more abstract for the person to program and harder for the illiterate to understand.
normally you would be right, however it does actually make a difference in the context of emulators
Mostly because compilers, especially Microsofts, Don't optimize fully, if at all.
Yes... in pieces of code that are executed many times a second, it actually makes a difference how many instructions there are.
Compilers do not change it into the most optimized asm code out there. Many compilers do do some optimizations, but usually for size, not for speed. Hard-coded assembly will be faster than C++.
James Sonne wrote:
And also, simply because someone writes a program in ASM doesn't mean it will run faster. In fact, that's what C++ compilers DO, they take easily understand programming language and change it into the most optimized ASM or Machine Language code it knows how to produce. ASM isn't some magic way of speeding things up, it's a language just like any other, it's just that it's a step more abstract for the person to program and harder for the illiterate to understand.
My mistake, I assumed that programming in asm allows better optimization of code due to uneeded steps generated by the c/c++ compilier. I thought that's why alot of pc games are riddled with assembly both external and inline. Must be that programmers just use assembly to make games hardware dependent.
It allows more control over the actual functions of the program, I suppose, bit per bit... but there's no significant advantage. If you know ASM then go for it, but you're not going to be detrimmed simply because you program in C.
Can we get a response by a veteran programmer on asm versus C++? For some reason I just can't believe what I just read about C++ compilers making code just as fast as asm.
If you're good at ASM then you can theoretically create more efficient code than a compiler does, since a compiler is only a computer. But using ASM does not automatically mean it's going to be faster, because it's all the same machine language in the end.
To my original point.
http://forums.pocketmatrix.com/viewtopi ... hlight=asm
http://forums.pocketmatrix.com/viewtopi ... hlight=asm
And I do have to say that the new beta release of Morphgear.. the SNES is a helluva lot faster... some games are actually playable on it now. ESpecially if you have a 300+ MNhz ppc 
I'm not a veteran programmer, just a CS major getting ready to go to grad school, specializing in compilers and programming languages. I've done my share of C,C++, and x86 assembly, and can make a few points:
1) While its true that just using assembly won't make a program better, with a little bit of extra effort it is almost always the case that whatever a compiler generates for you, you can improve upon. The axim in programming is: the easier it is for you (a human) to understand the code, the slower it will run on the computer. This is why a language like Basic has so much overhead, while a C program is much more efficient to do the same task (well... eVB is also interpreted, so thats a problem too.) Why is this? Without getting too detailed (or using an example), its simply a question of human creativity. You as a programmer know exactly what your code needs to do, whereas a compiler generally uses templates of sort (before optimizations are done) to output code. One of my favorite examples is when examining a Java program I compiled that contained a loop with no body (using the conditional for a side effect) I found the compiler had generated code like this:
0: jmp 1
1: do something
Granted, optimizers can eliminate this kind of redundancy, but this is actual code i got. I've seen the research thats being done in compiler design, and its impressive, doing things that humans can't reasonably do to improve code design. But until these techniques are refined and incorporated (and possibly still afterwards) humans will have the upper hand.
2) C tends to be more efficient than C++ because of the overhead of Object Oriented programming.
Wow, this is too long of a post, hope that explains something. If you have any questions, I'll continue to lurk in these threads.
Jon
1) While its true that just using assembly won't make a program better, with a little bit of extra effort it is almost always the case that whatever a compiler generates for you, you can improve upon. The axim in programming is: the easier it is for you (a human) to understand the code, the slower it will run on the computer. This is why a language like Basic has so much overhead, while a C program is much more efficient to do the same task (well... eVB is also interpreted, so thats a problem too.) Why is this? Without getting too detailed (or using an example), its simply a question of human creativity. You as a programmer know exactly what your code needs to do, whereas a compiler generally uses templates of sort (before optimizations are done) to output code. One of my favorite examples is when examining a Java program I compiled that contained a loop with no body (using the conditional for a side effect) I found the compiler had generated code like this:
0: jmp 1
1: do something
Granted, optimizers can eliminate this kind of redundancy, but this is actual code i got. I've seen the research thats being done in compiler design, and its impressive, doing things that humans can't reasonably do to improve code design. But until these techniques are refined and incorporated (and possibly still afterwards) humans will have the upper hand.
2) C tends to be more efficient than C++ because of the overhead of Object Oriented programming.
Wow, this is too long of a post, hope that explains something. If you have any questions, I'll continue to lurk in these threads.
Jon
James Sonne wrote:
It allows more control over the actual functions of the program, I suppose, bit per bit... but there's no significant advantage. If you know ASM then go for it, but you're not going to be detrimmed simply because you program in C.
LOL - reasons for using ASM or C are *not* arbitrary!
Please don't just "go for it" just because you happen to know ASM.
If you know the 80:20 rule, and you are looking at a piece of your code and think it will make a big difference if you hand-write it in assembler, then by all means do it. But make sure you have a good reason.
There are certain cases when using Assembler is a good idea, one of them is dynamic recompilation (where it's pretty much vital). Another is when interpreting (emulating) a cpu.
However you can speed up SNES emulation in other ways first before abandoning C.
I'm guessing the problems with PocketSNES (based on SNES9X) are numerous:
* The cpu emulation is a port of the C version
I'm guessing this was never intended to be used in a real context - it's probably more for reference.
* The C code is quite slow (check out the cpu emulation loop code to see why)
* There is no ARM assembler version of the CPU core. (Obviously the PC version uses a x86 version of the CPU core)
* The graphics and sound emulation probably isn't that optimised (there was no real need running on 500Mhz+ PCs)
Try porting NLKSNES (if there is source available) or something maybe...
Do you think it would be possible for someone to write a dynamic recompiler for snes on the ppc? How much of a speed increase do you think it would give?
Dave H wrote:
* There is no ARM assembler version of the CPU core. (Obviously the PC version uses a x86 version of the CPU core)
Thank you. Someone agrees with my orignal post. All the best PC emu's I've seen have x86 asm cores. My point was that doing the same for PocketSNES should greatly improve speed. Unfortunately I am not versed in assembly. I was hoping my post might spark the interest of someone who was. If I could write the emu in perl or ksh I'd be all over it.
Well, Quake and Quake II used some assembly, and I doubt id didn't know what they were doing.
They did?
A bit was used, wasn't really substantial though IIRC.
Ok. I've searched for source code for NLKSNES and NLKE which added sound support. It does not appear that either went open source. I checked out the source of ZNES which is the fastest SNES emu I've tried. It's all assembly. Is there no way to programmatically convert between asm flavors?
That's what an emulator does, convert one type of machine language to another 
I think he means a compile-time translator, not a run-time translator (an emulator.) In all honesty, I've never seen one (doesn't mean one doesn't exist...) Though this would be an interesting tool, there are already cross-compilers, but "cross-assemblers" would be an entirely different story. Almost defeats the point of using assembler. For the best results (what we're looking for from an emulator) in a short development time, a good plan would be take an emulator written entirely in C, profile it, and use the aforementioned 80/20 rule, and see what would benefit from an asm rewrite. leave the rest C and let the compiler do the work.
This does leave me once again pondering a few other ways an emulator could be written. I've always wondered how difficult it would be to pretranslate the rom and have those instructions execute natively, with the emulator being a virtual machine to take care of only hardware functionality (e.g. sprite drawing routines.) This would be easiest on GBA games, since they run ARM processors, so no translation would need to be done.
But this too would require a programmatic way of converting one machine language to another.
Jon
This does leave me once again pondering a few other ways an emulator could be written. I've always wondered how difficult it would be to pretranslate the rom and have those instructions execute natively, with the emulator being a virtual machine to take care of only hardware functionality (e.g. sprite drawing routines.) This would be easiest on GBA games, since they run ARM processors, so no translation would need to be done.
But this too would require a programmatic way of converting one machine language to another.
Jon
Jon,
PocketSnesBe is written in c, except for an ipaq3800 bliting function written in asm. The lastest version contains a profiler build as well. Are you the asm guru this emu has been waiting for? As for the rom conversion I think this is a good idea. I believe this was done with the PalmBoy emu. The roms had to be converted prior to use.
PocketSnesBe is written in c, except for an ipaq3800 bliting function written in asm. The lastest version contains a profiler build as well. Are you the asm guru this emu has been waiting for? As for the rom conversion I think this is a good idea. I believe this was done with the PalmBoy emu. The roms had to be converted prior to use.
hmm, I've been meaning to learn ARM asm now that I have an ARM device. I did download the source to poke around in SNES BE before, but had trouble getting it to even compile at all. Not that i spent more than 10 minutes on it. I'll look into it, but this isn't the kind of thing that one learns overnight. I was actually going to wait and see what the author of PocketNester did, since thats such an excellent emulator. But we'll see. No promises
As for the palm emulator... I was never sure if that did any sort of conversion or if it just packed the rom into the requisite pdb file (since all palms can read are prc and pdb files.)
I've also seen some mention of an XScale compiler being released for eVC 3 sometime soon. I'd be curious to see what sort of performance boosts we could expect from something properly compiled for XScale.
I am in college, and finals are in 2 weeks, so this will be on the back burner, but like i said, I'll look into it.
Jon
As for the palm emulator... I was never sure if that did any sort of conversion or if it just packed the rom into the requisite pdb file (since all palms can read are prc and pdb files.)
I've also seen some mention of an XScale compiler being released for eVC 3 sometime soon. I'd be curious to see what sort of performance boosts we could expect from something properly compiled for XScale.
I am in college, and finals are in 2 weeks, so this will be on the back burner, but like i said, I'll look into it.
Jon
Sounds good, look into asm. I don't own an Xscale device, so would like many others see no benefit in a Xscale compiled program. I would think that asm optimized functions would benifit both StrongArm and Xscale devices.
All Palmboy does is pack the ROM into a PDB. When it was released, there were no Palms that COULDN'T use anything but the 2 mentioned formats.
Ok. So are there any other assembly programmers willing to take the time to convert an x86 asm SNES core to arm asm. Couldn't a good deal of the conversion be done with find and replaces. Or are the versions that different. They look similar to me moves, adds, subtracts, compares, etc... Please excuse my complete ignorance of assembly.
zinger":1pg8wt5e]
NO!! Please read the whole post, not just the bit you agree with!
The point I was making is the reason why PocketSNES is slow is quite simply because the code is very slow. That doesn't mean C code is slow. That means that the PocketSNES code (for a number of reasons...) is slow.
It also doesn't mean assembler will speed it up. You could quite easily rewrite it in assembler and get something slower. This has happened to me before.
This ALSO doesn't mean that it isn't possible to write a fast SNES emulator in C. Just because one piece of C code is slow, doesn't mean all pieces of C code are slow. The only thing I've said is that if you look at the cpu emulation C code, it's obviously very slow for a lot of reasons...
However it does remain true that the fastest cpu emulators will be the ones written in assembler not C. However that does NOT mean that every emulator written in assembler is faster than every C emulator.
Also be aware of why assembler is faster in the case of CPU emulation (aka CPU interpreter): it's to do with flag handling and opcode dispatch.
And this is what I've been saying.
I'm not disagreeing that a poorly written asm emu would be slower than a well written C version. I look at the fastest PC emus and they all at least have an asm core. Znes, the fastest I've tried, is completely x86 asm. Yes, I'm assuming based on the PC versions that optimized asm might get us reasonable speed with sound on the current PPC hardware, that could not be achieved using C alone.
But it's simply ignorant to say "let's make it ASM, it will be faster." That's what we're trying to say. Someone skilled in ASM will be able to write more efficient code than a C++ compiler will output simply because ASM allows a more direct access to the actual steps that the CPU takes. But that doesn't mean ASM is faster. It doesn't even mean that ASM is more often faster. It simple means a skilled programmer was able to take more control of the processing steps. The right tool for the right job.
I give up. Moose you're right, an optimized asm core will not make PocketSNES any faster. I have the source for PocketSNESBE, where do see general improvements that can be made in the C code.
*sigh* You're still not seeing what I'm saying
But whatever. If someone that knew ASM was interested in optimizing PocketSNES they would have done so, the source is widely available.
zinger wrote:
I'm assuming based on the PC versions that optimized asm might get us reasonable speed with sound on the current PPC hardware, that could not be achieved using C alone.
zinger: that's the bit I'm outright diasgreeing with...there is nothing to indicate you couldn't write a SNES emulator in C and have it run fullspeed. I mean we are talking about 200+ processors!
Bear in mind it's only a 2-3Mhz processor. To write a cpu emulator to fail to run a 2-3Mhz cpu on a 200+Mhz cpu is doing pretty bad...think what the PC requirements would be like if all emulators were that slow:
Genesis: 800Mhz
PSX: 3000Mhz
N64: 9000Mhz
GB: 400Mhz
GBA: 1600Mhz
Obviously PC emulators don't perform that slowly.
No Moose, you're not seeing what I'm saying. If you read my posts I've been stating an "optimized" asm core would make it faster. I've never said just throwing asm by an unskilled programmer would make it faster. Let me restate.
I believe that a "skilled" programmer could write an "optimized" asm core that would be faster than an "optimized" c core. In doing such I believe that it's possible to have a decent running SNES emulator with sound on the current hardware. This is my response to the original post.
I believe that a "skilled" programmer could write an "optimized" asm core that would be faster than an "optimized" c core. In doing such I believe that it's possible to have a decent running SNES emulator with sound on the current hardware. This is my response to the original post.
I agree with you James, but there has to be lots of optimizations that can be done because it really should not run that slowly.
And what is that suppose to be? If you want to support your own views then try googling for a technical document instead of some laymen that happens to spout the same thing you are verbalizing.
Ok well let me just say something. SNES is full speed on the e750 , razor , h5454( on the c1 models. If you haven't heard of them its a h5454 with a pxa255 under the name pxa250 c1. HP has swiched the h5454's to the pxa250 c1 insted of the pxa250 b1's)and it runs at 25-35 fps(depending on the game, some are more some are less but the avg. is about 30) on the h1910 and the v35. This is all without sound.
While playing sound I get like 10-20 fps on an avg so I would say double the speed on a ppc ( like a e750 at 800mhz with a 400mhz bus{i think even 700 300 would work}) and you would get full speed snes with sound. Who know's when that will come out. But when the newer pxa 255's with better speed (models like the asus and even devices w/ 500mhz , yes they are making models with 500mhz , a french one has already come out) overclocked 100 or 200mhz more should be good enough to get like 40fps on snes with sound. Not full speed but thats more then playable.
While playing sound I get like 10-20 fps on an avg so I would say double the speed on a ppc ( like a e750 at 800mhz with a 400mhz bus{i think even 700 300 would work}) and you would get full speed snes with sound. Who know's when that will come out. But when the newer pxa 255's with better speed (models like the asus and even devices w/ 500mhz , yes they are making models with 500mhz , a french one has already come out) overclocked 100 or 200mhz more should be good enough to get like 40fps on snes with sound. Not full speed but thats more then playable.
But would it be fun without any kind of special gamepad?
James Sonne wrote:
And what is that suppose to be? If you want to support your own views then try googling for a technical document instead of some laymen that happens to spout the same thing you are verbalizing.
Oh Moose. Did you look around the site that guide came from before slandering the author? If you did you would have seen an impressive list of emulators written by that spouting laymen. You will also find that some of his eums have been ported to PPC such as NES, GameGear and GameBoy Advance. Go buy em. I'm thinking he might know something about emualators, don't you?
Matt Keys wrote:
But would it be fun without any kind of special gamepad?
Yup, I love super nes on my h1910.
Sorry, I missed GameBoy and Coleco.
JonM wrote:
I think he means a compile-time translator, not a run-time translator (an emulator.) In all honesty, I've never seen one (doesn't mean one doesn't exist...) Though this would be an interesting tool, there are already cross-compilers, but "cross-assemblers" would be an entirely different story. Almost defeats the point of using assembler. For the best results (what we're looking for from an emulator) in a short development time, a good plan would be take an emulator written entirely in C, profile it, and use the aforementioned 80/20 rule, and see what would benefit from an asm rewrite. leave the rest C and let the compiler do the work.
There is stuff that does it, but it's not for consoles. The subject matter is called 'binary translation' (Workshops etc on it).
It's very interesting, and looks very promising, but it also looks very difficult (for example, handling indirect jumps looks deeply unpleasant - you have to make sure you have all targets. And that's not even to mention self-modifying code).
I think that if it was pushed to a best of breed approach you could probably write a decent Saturn emulator (not for PPCs) or get full speed emulation for loads of things on a PocketPC, but I can't see people doing it really.
James Sonne wrote:
And what is that suppose to be? If you want to support your own views then try googling for a technical document instead of some laymen that happens to spout the same thing you are verbalizing.
!
James, that is not 'some guy', that is the Marat Fayzullin. You don't know who he is?
Let me explain: he's basically the Godfather of emulation. He was the FIRST person EVER to emulate the NES, the Gameboy, and was one of the first people to emulate most of the major consoles, Sega Master System, MSX etc etc.
You know the NES Mapper ID which every single NES emulator uses? Guess who invented that system?
And you just put him down...? jesus christ
Dave H wrote:
That means that the PocketSNES code (for a number of reasons...) is slow.
The only thing I've said is that if you look at the cpu emulation C code, it's obviously very slow for a lot of reasons...
Dave H,
Could you expand a little in what you see in the PocketSNES code that is resulting in obvious slowness.
Thanks,
Brian
... in print it's liable 
Fight, I get a constant 30 FPS in Super Mario World on my iPaq H3955 right now and it's 400MHz XScale, the original "slow" brand.
Fight, I get a constant 30 FPS in Super Mario World on my iPaq H3955 right now and it's 400MHz XScale, the original "slow" brand.
zinger":2r6aassr]
Well it's been a while since I looked, but iirc the main cpu loop was really really long
not to resurrect, but if you follow sukons site you eventually find this
August 11, 2,003
Mold □
TWSFC □decided □again does not renew
Because □POCKETSNES does too good speed also □on TWSFC
The quick □year spatial window time I □in □have the flowers of the mind □□□on therefore □□put □
Other EMU renewal date □surely does not have does on □the renewal
If has other newly to be me also □male □not to use the anticipation in □□□everybody
□□west are only the works which the little brother □free time □whiles away the time
Author sukon to 11:49 AM
WHERE CAN I NOW FIND TWSFC, Does it support hi-res snes games? Thats why i want it - any other snes emus with hi-res support? thanks
August 11, 2,003
Mold □
TWSFC □decided □again does not renew
Because □POCKETSNES does too good speed also □on TWSFC
The quick □year spatial window time I □in □have the flowers of the mind □□□on therefore □□put □
Other EMU renewal date □surely does not have does on □the renewal
If has other newly to be me also □male □not to use the anticipation in □□□everybody
□□west are only the works which the little brother □free time □whiles away the time
Author sukon to 11:49 AM
WHERE CAN I NOW FIND TWSFC, Does it support hi-res snes games? Thats why i want it - any other snes emus with hi-res support? thanks
alright... lemme break this down for you
SNES Hi-Res is 512x254(or is it 280? same thing anyways)
PocketPC res is 320x240, that 512x254 buffer would have to be scaled down to fit on a pocketpc screen, and that is slow. AFAIK PocketSNES does a clip on the 256x240 SNES low-res mode and then directly blits it to the middle of the screen. At 512x280 it would be even worse.
SNES Hi-Res is 512x254(or is it 280? same thing anyways)
PocketPC res is 320x240, that 512x254 buffer would have to be scaled down to fit on a pocketpc screen, and that is slow. AFAIK PocketSNES does a clip on the 256x240 SNES low-res mode and then directly blits it to the middle of the screen. At 512x280 it would be even worse.
hmm, but i can already play the hi-res games themselves, the problem is that they are rpgs, and the text gets garbled in alot of them on my device,
does anyone know what i am talking about? i read somewhere that the text was made for hi-res. so i want a ppc snes emu that will display hi-res TEXT in lo-res (or anything legible)
am i looking for something that doesnt exist herE?
does anyone know what i am talking about? i read somewhere that the text was made for hi-res. so i want a ppc snes emu that will display hi-res TEXT in lo-res (or anything legible)
am i looking for something that doesnt exist herE?
hmm, but i can already play the hi-res games themselves, the problem is that they are rpgs, and the text gets garbled in alot of them on my device,
does anyone know what i am talking about? i read somewhere that the text was made for hi-res. so i want a ppc snes emu that will display hi-res TEXT in lo-res (or anything legible)
am i looking for something that doesnt exist herE?
does anyone know what i am talking about? i read somewhere that the text was made for hi-res. so i want a ppc snes emu that will display hi-res TEXT in lo-res (or anything legible)
am i looking for something that doesnt exist herE?