After reading and researching numerous documents, and scanning other peoples source code for clues, I've produced one of the hardest projects I've ever worked on... a Nintendo Emulator. Yep, you can play the good ol 8 bit NES on your PC. It has both software rendering (StretchDIBits) and Hardware rendering (DirectX). It's practically the only NES emulator written in vb6 that actually has pure sound using DirectSound! I also put in a low pass filter for the sound. You can also seemlessly go from windowed to fullscreen and back with no issues in both software and hardware. And has Load States and Save States. I even included the classic Super Mario Bros so you can test it out right away.
Note: in IDE mode, it'll be way too slow for testing (6-8 fps with sound on, 12-15 fps with sound off). You must compile to exe and use the exe for a full speed of 60 fps. Another thing is that you must have the vb6 version of DirectX to even use the sound or hardware mode. In other words, you must have the dx8vb.dll on your computer over in your system folder and have it registered using regsvr32.exe. This is needed if you have Windows 7 or 8. Windows Vista and below should already have it preinstalled so you don't need the file let alone have to go through a process of registering it.
Note For Windows 7 & 8 users: this will not be shown in your References. And you will only need to do these parts once ever:
- Put the dx8vb.dll file in your Windows\SysWOW64 folder.
- Drag it into regsvr32.exe to register it in order to use it in VB6 from now on and have it shown in References.
- Go ahead and reopen Visual Basic 6 and check the References again to see if it's there.
If it's still not there, the best approach is to run Command Prompt as an Administrator and reference it, as sometimes simply dragging a file into regsvr32 is not enough. To do this:
- Goto your Start Menu.
- click on the bottom where it says > All Programs and goto Accessories
- Right click Command Prompt.
- Click Run as administrator (should be located under Open).
- Next type regsvr32 "YOUR FILE PATH HERE OF DX8VB.DLL" For example:
regsvr32 "C:\Windows\SysWOW64\dx8vb.dll"
I still have a looooong way to go before its complete but here are the version numbers history of known issues and hot fixes:
Version 0.55
Version 0.50
I will be constantly updating this program with new revisions as I go along. Enjoy :bigyello:
Note: in IDE mode, it'll be way too slow for testing (6-8 fps with sound on, 12-15 fps with sound off). You must compile to exe and use the exe for a full speed of 60 fps. Another thing is that you must have the vb6 version of DirectX to even use the sound or hardware mode. In other words, you must have the dx8vb.dll on your computer over in your system folder and have it registered using regsvr32.exe. This is needed if you have Windows 7 or 8. Windows Vista and below should already have it preinstalled so you don't need the file let alone have to go through a process of registering it.
Note For Windows 7 & 8 users: this will not be shown in your References. And you will only need to do these parts once ever:
- Put the dx8vb.dll file in your Windows\SysWOW64 folder.
- Drag it into regsvr32.exe to register it in order to use it in VB6 from now on and have it shown in References.
- Go ahead and reopen Visual Basic 6 and check the References again to see if it's there.
If it's still not there, the best approach is to run Command Prompt as an Administrator and reference it, as sometimes simply dragging a file into regsvr32 is not enough. To do this:
- Goto your Start Menu.
- click on the bottom where it says > All Programs and goto Accessories
- Right click Command Prompt.
- Click Run as administrator (should be located under Open).
- Next type regsvr32 "YOUR FILE PATH HERE OF DX8VB.DLL" For example:
regsvr32 "C:\Windows\SysWOW64\dx8vb.dll"
I still have a looooong way to go before its complete but here are the version numbers history of known issues and hot fixes:
Version 0.55
- Added Mapper 1 support for games such as
-Double Dragon
-Castlevania 2: Simons Quest
-Legend of Zelda
..and much more. Again refer to the NES mapper list on Google to find out more Mapper 1 games. - Fixed the Triangle sound channel. Now it plays and halts perfectly as should.
- Added a much more sophisticated sound debugger.
Version 0.50
- Only mapper 0 games are supported in the mean time till I perfect everything.
-Super Mario Bros
-1942 (J)
-Kung Fu
-10 Yard Fight
-Robot Block (Stack-Up)
-Robot Gyro (Gyromite)
...etc
Google up NES Mapper List to see a complete list to find other mapper 0 games.
- Nametable Scrolling for the background is a little messed up. So you'll see anomalies such as flickering on the score board in Super Mario Bros ever other section of each level.
- The NES has 5 channels for sound. Rectangle 1, Rectangle 2, Triangle, Noise, and DMC. I shut off Noise by enabling it false cause it causes slowdown later on. This is a known issue thatll be resolved soon. I also didn't program the DMC yet. So only 3 sound channels are working.
- The sound itself is good but sometimes a tiny bit scratchy.
- 1942 (J) when paused causes the SamplingCount to skyrocket at warp speed even though no sound is playing, causing overflow if left for a short period of time.
I will be constantly updating this program with new revisions as I go along. Enjoy :bigyello: