10-17-2014 09:35 AM
47 12
tools
  1. Andre o Botelho's Avatar
    Hey OP I have a bit of experience with emulator development, so maybe I can offer some helpful advice.

    Firstly regarding JIT there is allegedly a way to access the VirtualProtect() function you'd need to make data executable. I posted about it on these forums. Have you tried that in C++? it still isn't known if this technique will "pass the censors" either, if you go down this route it may be better to submit a small test app first that does something mundane while using this code.

    The second option is of course an assembly interpreter which is entirely feasible and above board store wise but obviously a lot of work. I would suggest starting small by converting your most heavily used leaf functions. You can profile the code to find these but you can usually guess what they'll be. Functions to decode CPU addressing modes are the first things that spring to my mind.

    Third you can also make use of ARM Neon intrinsics to vectorise code into native SIMD. While VS2012 can auto vectorise (for x86 at least), it can be annoying to re-write all your loops to get it to work.
    I don't believe that a app using self modifying code will pass certification, I've tried Neon Intrinsics and got slower that arm intrinsics but have to revise the code to see if it gets faster, I've made some changes on the interpreter but without writing Assembly code by hand is complicated to make it really faster, inline assembler would work but is not supported by the sdk, I must have to write a whole new interpreter that is really a lot of work. PS: the emulator is written in C++ or else I courd get 1FPS .
    07-02-2013 03:42 PM
  2. EdSherriff's Avatar
    Yeah it's pretty frustrating not having in-line ARM assembly available in visual studio. Can't you rewrite a small number of functions in assembly, then cross assemble them using armasm and just link to the resulting object files in VS2012?

    Have you checked the disassembly of your release build? I'd hope for some embarrassingly parallel operations like large memcpys to be vectorised by the compiler. I assume you've already taken care of the obvious C optimisations for an interpreter, for me these were:
    Using a tree of function pointers organised similarly to the real CPU's decode (such that the hardware decode time is roughly proportional to the call depth of the interpreter for a given instruction).
    Passing just the op code into the function tree as a constant. The addressing mode functions return pointers to members of the CPU context struct.
    Using pointers that can be leveraged directly by the target platform's addressing modes.
    Not using objects where they weren't needed (sacrifice maintainability for speed/reduced overhead).

    I have been toying with writing a Megadrive emulator for WP8, I wrote a nice little interpreter for the 68k in plain C, while the VDP is a class (haven't bothered with the audio yet:) ). But I decided I was going to wait for SDL to be ported to WP, I just can't stand all this DirectX boilerplate and DirectXTK seems half arsed in comparison to SDL 2.
    07-05-2013 04:05 PM
  3. Kyle Bridges's Avatar
    I've been away from WP's for since last year and have grown a love for android phones but not because of the hardware but because of the amount of emulators and 2nd the customization. I now have a Nokia 920 and would love to see a PSX emulator maybe even collaborate with themeister developer of a famous multiemulator called RetroArch. All he needs is someone to write a GUI as his app uses cores compatible with any device; that's my understanding as I've discussed this topic with him in the past. Still I hope PSX can be brought to the WP series I would gladly pay!
    07-08-2013 08:49 PM
  4. Andre o Botelho's Avatar
    Yeah it's pretty frustrating not having in-line ARM assembly available in visual studio. Can't you rewrite a small number of functions in assembly, then cross assemble them using armasm and just link to the resulting object files in VS2012?

    Have you checked the disassembly of your release build? I'd hope for some embarrassingly parallel operations like large memcpys to be vectorised by the compiler. I assume you've already taken care of the obvious C optimisations for an interpreter, for me these were:
    Using a tree of function pointers organised similarly to the real CPU's decode (such that the hardware decode time is roughly proportional to the call depth of the interpreter for a given instruction).
    Passing just the op code into the function tree as a constant. The addressing mode functions return pointers to members of the CPU context struct.
    Using pointers that can be leveraged directly by the target platform's addressing modes.
    Not using objects where they weren't needed (sacrifice maintainability for speed/reduced overhead).

    I have been toying with writing a Megadrive emulator for WP8, I wrote a nice little interpreter for the 68k in plain C, while the VDP is a class (haven't bothered with the audio yet:) ). But I decided I was going to wait for SDL to be ported to WP, I just can't stand all this DirectX boilerplate and DirectXTK seems half arsed in comparison to SDL 2.
    Thanks the tips, I've read a lot about fast interpreters and got a little more breath on the emulator changing from the original switch based interpreter to funcion table but with my limited knowledge on the ARM architeture I coudn't advance (tail call, multiple calls on a loop,returning next opcode, didn't work). If you can share the 68k code can give me some Ideas because I'm running out of it to speed UP the main loop, I would like to do something like recompilation at least for the simple opcodes...
    07-16-2013 02:29 PM
  5. Andre o Botelho's Avatar
    I've been away from WP's for since last year and have grown a love for android phones but not because of the hardware but because of the amount of emulators and 2nd the customization. I now have a Nokia 920 and would love to see a PSX emulator maybe even collaborate with themeister developer of a famous multiemulator called RetroArch. All he needs is someone to write a GUI as his app uses cores compatible with any device; that's my understanding as I've discussed this topic with him in the past. Still I hope PSX can be brought to the WP series I would gladly pay!
    by what i've read RetroArch uses DYNAREC (PCSX REARMED source)and maybe OpenGL ES so it is not useful on WP.
    07-16-2013 02:51 PM
  6. tester1998's Avatar
    07-26-2013 07:13 PM
  7. Roman Ekaterininsky's Avatar
    Thank you for beta! Testing Vagrant Story now. Default settings. Lumia 620

    445094263.png
    08-03-2013 09:40 AM
  8. EdSherriff's Avatar
    Thank you for beta! Testing Vagrant Story now. Default settings. Lumia 620
    Is the 17 fps indicative of the average frame rate? How variable is the frame rate and by how much does it vary?
    08-04-2013 03:18 AM
  9. Dk92's Avatar
    Is the emulator out?
    08-04-2013 03:44 AM
  10. Roman Ekaterininsky's Avatar
    Is the 17 fps indicative of the average frame rate? How variable is the frame rate and by how much does it vary?
    60 fps at the main video, 20-30 during game, 15-20 when fighting. FPS meter not very accurate it updates just every sec and seems to shows average FPS. Sound is not good but I didn`t change emulator settings.

    Is the emulator out?
    You can get beta if you send your Microsoft Account email to developer (Andre o Botelho)

    2 new pics for you:
    574029431.png
    14501045.png
    Last edited by Roman Ekaterininsky; 08-04-2013 at 05:25 AM. Reason: Pics
    08-04-2013 05:17 AM
  11. EdSherriff's Avatar
    60 fps at the main video, 20-30 during game, 15-20 when fighting. FPS meter not very accurate it updates just every sec and seems to shows average FPS. Sound is not good but I didn`t change emulator settings.
    Good stuff, Vagrant Story is quite a good benchmark for a PS1 emulator given the heavy use of 3D and lighting. If you're interested in benchmarking, the following games are the most graphically intensive on PSX (to the point that the original hardware exhibited slowdown on some of them).

    Full 3D
    Gran Turismo 2
    Tekken 3
    Driver 2

    2D/3D
    Final Fantasy IX
    Chrono Cross

    2D
    Adventures of Lomax
    Legend of Mana

    In any case I'd be grateful if you could post FPS numbers for any other games you test to give people an idea of what to expect performance wise.

    @Andre
    Are you still working to increase performance (with the threaded interpreter etc) or does the beta used by Roman reflect the best you can get out of the given hardware?
    08-04-2013 11:26 AM
  12. Andre o Botelho's Avatar
    I'm now working to get the emulator working, the speed is enough for while - there's lots of games playable, at low framerate but working - but there's lots of things that can be done to speed but involves changes on the source code and can be made after it is usable on WP, for full 3D games I've tested Gran Turismo and is slow to hell ^^, Tekken 3 is playable but there's some bug on the Interpreter that hangs on wrong opcodes randomly - I think is a timing issue, I can't test all games so the Beta Testers can help.
    PS: I've received some email about people wanting to get the beta - I'll add these as soon as I can.
    08-07-2013 10:20 PM
  13. EdSherriff's Avatar
    I've also been thinking some kind of game compatibility list for EmiPSX would probably help to reduce the number of ridiculous complaints about "X game not working! I demand you fix it this instant!". Pretty much guaranteed given the size of the PSX game catalog, widespread appeal of the concept and the extensive modifications you've had to make to port the core (which laymen will be oblivious to). It needs some kind of wiki like page or something for beta testers to contribute to (community any ideas?!). At least you could give would-be users something to refer to before they get the app by providing the URL in the app description.

    I'm still shocked by the number of idiots who seem to download emulator apps without any idea of what they or ROMs are or how they work then leave a one star review saying it doesn't work. I'm guessing your support mailbox will be bombarded with stuff like that if it isn't being already for Emigens.
    08-08-2013 03:41 PM
  14. Nathan McGraw's Avatar
    Glad I found this thread! Looks promising!
    08-12-2013 10:17 AM
  15. Amar Jamakovic's Avatar
    I registered simply because of this thread.

    Make this shenanigans happen, and you get a customer for your app if it's at reasonable, if a bit higher price than most (because this is a ******* PS EMULATOR!).

    Anyway, good luck and keep me posted :)
    08-12-2013 04:33 PM
  16. Victor Lima1's Avatar
    i'need this emulator...let me be a beta tester!
    my e-mail : victor_lima_xd@hotmail.com
    09-01-2013 05:31 PM
  17. mefistotelis's Avatar
    You have another customer! I'll pay a lot for this!
    09-23-2013 05:15 AM
  18. liquidkoshman's Avatar
    Please, let me give you my money...
    10-13-2013 12:45 PM
  19. amitnahar's Avatar
    Take my money.
    10-13-2013 12:59 PM
  20. Samuel Barger's Avatar
    kind sir, i would LOVE a ps emulator for the surface rt. well, if its on the ms store itll be good. but seriously, that would be fantastic, i know a ton of people who are looking for one.
    11-17-2013 02:13 PM
  21. Samuel Barger's Avatar
    if you need nore beta testers at any point, my email is gfslight@gmail.com
    11-17-2013 02:20 PM
  22. ajaya p's Avatar
    Plz add me my mail id- ajayapradhan@live.com
    10-17-2014 09:35 AM
47 12

Similar Threads

  1. My non-techie sister is interested in the Surface
    By Reflexx in forum Microsoft Surface for Windows RT
    Replies: 25
    Last Post: 10-18-2012, 02:51 AM
  2. What is level of interest in Adobe AIR on WP7?
    By cokathleen in forum Windows Phone 7
    Replies: 13
    Last Post: 01-28-2012, 01:29 PM
  3. What is the point in jailbreaking?
    By dj9928 in forum Windows Phone 7
    Replies: 12
    Last Post: 05-03-2011, 07:27 PM
  4. Replies: 9
    Last Post: 04-29-2011, 01:01 PM
  5. Anyone interested in podcasting?
    By Hombaca05 in forum Windows Phone 7
    Replies: 13
    Last Post: 03-04-2011, 01:21 PM
LINK TO POST COPIED TO CLIPBOARD