Archived

This topic is now archived and is closed to further replies.

pimstead

DX Question - Snes9x, How'd they do that?

Recommended Posts

pimstead    122
This question refrences some of the interfaces used in the SNES emulator Snes9x. This emu is written for windows using DX. The thing that is cool about this emu is that it employs a menu that you can have appear using esc and when you do it resizes the client area. It also uses a number of windows dialog boxes for configuration purposes. All of this stuff appears to be standard windows api offerings, not some custom directX code that all runs while the program is in fullscreen mode. My question is how do they do it? Thanks for the help.

Share this post


Link to post
Share on other sites
Scooter    109
Basically there are two main parts to the program one is the windows/graphic interface (the stuff ya see) the other is the console CPU emulation (the program that acts like the CPU of the console, Snes in your case) So basically the program runs and acts like a SNES then all the calls to draw graphics are interfaced with DirectX/Windows and boom ya have a Win32 Snes Emulator. (Not an easy program to create!!!)

Share this post


Link to post
Share on other sites
pimstead    122
Hi, thanks for the reply. However, i understand how the emu works. I was wondering how they get menus and dialog boxes in a fullscreen directX application. Information on that area would be helpful.

Share this post


Link to post
Share on other sites
sysmark    122
Why not check out the sourcecode? You can download it from sourceforge (linked through www.zsnes.com). I wouldn''t know of a better reference.

Share this post


Link to post
Share on other sites
pimstead    122
Snes9x is a Snes emulator that runs on windows and is a windows program. Hence the 9x part of Snes9x. The program is written using WinAPI and DirectX and can run in windowed mode or fullscreen mode.

I was hoping I could get a reply from someone that has actually used Snes9x in one of it''s recent revisions / and or / has actually read my questions. Only one person has commented on windows controls even though they are talking about DOS and allegro which is way off the mark.

I would appreciate help on how they use a menu and dialog boxes in fullscreen DirectX mode. And no, they do NOT make their source code available (Snes9x is not ZSNES).

Thanks for anyone else who helps.

Share this post


Link to post
Share on other sites
Daishim    244
Snes9x is windows based if I remember right. What I think he''s asking... I think I got this right.

In the fullscreen mode, the menu bar disappears (File, Options etc...). By hitting escape the menu bar reappears on the screen. Hitting escape again, will make it disappear.

Now, I don''t know much about win32 yet so I don''t know how to do that with the actual menu bar control. But it shouldn''t be too hard to create your own menu bar.

Share this post


Link to post
Share on other sites
minerjr    122
To get the dialog messages to work you just need to call them like you would usually. But you need to pass in the hWnd of the Dx window. This will show the dialog box in full screen. I imagine that the menus work the same. Just pass in the hWnd of the Dx window or the instince of it. I hope this helps you a little bit.

Minerjr

Share this post


Link to post
Share on other sites