Results 1 to 27 of 27

Thread: Nintendo Emulator v0.65 (VB6)

  1. #1
    The DirectXpert Jacob Roman's Avatar
    Join Date
    Aug 04
    Location
    Miami Beach, FL
    Posts
    4,847

    Nintendo Emulator v0.65 (VB6)

    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.65
    • Fixed some of the nametable scrolling issues such as Super Mario Bros' scrollboard flickering
    • Added the ability to view the frames per second in windowed and fullscreen. Although ghetto, itll suffice for now.
    • Inlined some of the subs to speed things up a notch.
    • Minor sound calibration tweaks.


    Version 0.60
    • The ENTIRE color palette has been changed into authentic NES color to the actual NES. Although there is no true palette values from the actual NES, and too many sites produced misleading information on the palette, I found the true composite colors from a forum post, added it to my emulator, and compared it to my real NES. It was exactly the same, and the greens weren't too green like the real NES, the sky in Super Mario was exactly alike, etc. How do I know this when brightness, contrasts, and tint could be different from a TV and monitor? My computer is hooked into my TV through an HDMI cable. I can just bounce back and forth between HDMI and Video to compare.
    • Fixed and added Noise channel. However, although sounds great on many games such as Double Dragon, I'm not hearing bricks breaking in Super Mario Bros.
    • Added Mapper 2 support so you can play games such as Contra!
    • Fixed the looping sound issue when you have focus on the menu.
    • Reading and Writing from the address registers from $0000 to $FFFF has been inlined which produced a huge increase in emulator speed. No more minor slowdowns from time to time like before.
    • Sound has been tweaked to make it a tad more authentic and consistant with the documentation.
    • Sound Debugger got many more things added such as noise channel, and square channels now show sweep info.
    • Code has been cleaned up a notch.
    • Many other minor fixes I can't name from the top of my head.


    Known Issues for v0.60:
    • Legend of Zelda is saving a save file, and loading but in game, it shows no save game exist. Possibly need to play further to really know for sure.
    • Square channels work great but doesn't sound authentic enough. Go into a pipe to see what I mean in Super Mario Bros.
    • Noise channel works great but doesn't sound authentic enough such as no brick breaking noise in Super Mario Bros.
    • DMC channel has NOT been programmed yet for voice samples. Play Kung Fu and you'll notice something missing to see what I mean.


    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




    [EDIT] I will no longer delete each old project to replace it with a new one. Instead I will have up just 5 of the latest just so the number of downloads don't keep getting knocked back to 0, and you can examine the old code for educational purposes. If the project gets complete enough, I may port this to VB.Net as well just so an NES emulator in VB.Net exists if it doesn't already.
    Attached Files Attached Files
    Last edited by Jacob Roman; May 14th, 2013 at 03:50 PM.
    Useful Forum Tips:

    - If you found any post that was useful, please consider rating their post

    - Give sensible thread titles, please!
    - Be sure to use [HIGHLIGHT=VB][/HIGHLIGHT] tags when posting code written in VB.
    - Write posts like a conversation, not like an email. That way you can avoid saying "Dear so and so" in every post.
    - When your problem is solved, go up to Thread Tools and click on Mark Thread Resolved

    My Contributions: Massive DirectX 2D Tutorials For VB5/VB6/VB.NET || 3D Engine In Pure VB || Friction Force ||DJ Turntable Simulation || Scratching Wavs || Time Based Movement || Newton Physics Simulation || Managed Game Loop || Rigid Body Collision Detection || World of Warcraft RGB Battle System || Bosskillers (World of Warcraft 2D Clone) || Street Fighter Controls (Flawless Simulation) || A* Pathfinding (VB6 & VB.NET) *UPDATED || *NEW* Nintendo Entertainment System Emulator (VB6) || *NEW* Video Game Making Tips (VB6 & VB.Net)

    Expert. Ask me anything NES!

    My Smilies:


  2. #2
    The DirectXpert Jacob Roman's Avatar
    Join Date
    Aug 04
    Location
    Miami Beach, FL
    Posts
    4,847

    Re: Nintendo Emulator v0.55 (VB6)

    The NES Emulator has been updated to Version 0.55. Here are the current fixes made:

    • 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.
    Useful Forum Tips:

    - If you found any post that was useful, please consider rating their post

    - Give sensible thread titles, please!
    - Be sure to use [HIGHLIGHT=VB][/HIGHLIGHT] tags when posting code written in VB.
    - Write posts like a conversation, not like an email. That way you can avoid saying "Dear so and so" in every post.
    - When your problem is solved, go up to Thread Tools and click on Mark Thread Resolved

    My Contributions: Massive DirectX 2D Tutorials For VB5/VB6/VB.NET || 3D Engine In Pure VB || Friction Force ||DJ Turntable Simulation || Scratching Wavs || Time Based Movement || Newton Physics Simulation || Managed Game Loop || Rigid Body Collision Detection || World of Warcraft RGB Battle System || Bosskillers (World of Warcraft 2D Clone) || Street Fighter Controls (Flawless Simulation) || A* Pathfinding (VB6 & VB.NET) *UPDATED || *NEW* Nintendo Entertainment System Emulator (VB6) || *NEW* Video Game Making Tips (VB6 & VB.Net)

    Expert. Ask me anything NES!

    My Smilies:


  3. #3
    PowerPoster joaquim's Avatar
    Join Date
    Apr 07
    Posts
    2,496

    Re: Nintendo Emulator v0.55 (VB6)

    ok.. i have tested, like and i have something for tell you:
    1 - when the user go to the menu: pause the game inclued sound off(or you think that you are ear risk CD). play a game and go to menu and you see what i mean;
    2 - let user choose the keys(joypad too, if possible);
    3 - i see some(rare, but i see) flickers.
    but it's great.. good job
    (maybe you can share what you read for doing these)
    VB6 2D Sprite control

    To live is difficult, but we do it.

  4. #4
    The DirectXpert Jacob Roman's Avatar
    Join Date
    Aug 04
    Location
    Miami Beach, FL
    Posts
    4,847

    Re: Nintendo Emulator v0.55 (VB6)

    Sure I can share. I can share a lot

    As for the flickering, thats the Nametable Scrolling issue I was talking about, and its minor. Ill try and fix most of the problems you mentioned but at the moment im still tweeking with the sound so its authentic and perfect. The Noise channel is better but a notch off on some games. i havent uploaded it yet but the slowdown is gone from the noise as well as the horrific sound from that channel. I have more documentation if you need it.

    NES Doc.pdf
    NES Mapper Grid
    NES Mapper List
    Everything you need to know about the NES
    NES Dev
    NES Dev Wiki
    Zophars Domain NES Documentation
    Nintendo Entertainment System Architechture
    6502 Instruction Set
    6502 Opcodes
    NES Technical Emulation FAQs
    NES APU Technical Documentation
    NES Audio.pdf
    My NES Emulator C# Sourecode
    YoshiNES VB6 Open Source Emulator
    2A03 Technical Reference
    Emu Docs.org NES
    Last edited by Jacob Roman; Mar 5th, 2013 at 03:51 PM.
    Useful Forum Tips:

    - If you found any post that was useful, please consider rating their post

    - Give sensible thread titles, please!
    - Be sure to use [HIGHLIGHT=VB][/HIGHLIGHT] tags when posting code written in VB.
    - Write posts like a conversation, not like an email. That way you can avoid saying "Dear so and so" in every post.
    - When your problem is solved, go up to Thread Tools and click on Mark Thread Resolved

    My Contributions: Massive DirectX 2D Tutorials For VB5/VB6/VB.NET || 3D Engine In Pure VB || Friction Force ||DJ Turntable Simulation || Scratching Wavs || Time Based Movement || Newton Physics Simulation || Managed Game Loop || Rigid Body Collision Detection || World of Warcraft RGB Battle System || Bosskillers (World of Warcraft 2D Clone) || Street Fighter Controls (Flawless Simulation) || A* Pathfinding (VB6 & VB.NET) *UPDATED || *NEW* Nintendo Entertainment System Emulator (VB6) || *NEW* Video Game Making Tips (VB6 & VB.Net)

    Expert. Ask me anything NES!

    My Smilies:


  5. #5
    Lively Member
    Join Date
    Aug 08
    Location
    Denmark
    Posts
    66

    Re: Nintendo Emulator v0.55 (VB6)

    Very large job - well done
    Unfortunately it was very slow on my old xp box Pentium D 3.0 Ghz (both with Dx and Non)
    I tested only with the the super mario rom and with compiled code. It was about 4 fps and sound was breaking up every second or so.
    Sound debugged showed check marks in all boxes and my sound card is Dx compatible.

  6. #6
    The DirectXpert Jacob Roman's Avatar
    Join Date
    Aug 04
    Location
    Miami Beach, FL
    Posts
    4,847

    Re: Nintendo Emulator v0.55 (VB6)

    Thanks for the feedback. I think before I upload the update which I was gonna do this weekend, I should inline a few functions and subs to help give it a speed boost. If you disable the sound you might make it a little faster, since the for loop is mixing the sound and probably causing a one sec delay on your comp. On my comp it goes 60 fps when compiled. But, nothing wrong with a little optimization
    Useful Forum Tips:

    - If you found any post that was useful, please consider rating their post

    - Give sensible thread titles, please!
    - Be sure to use [HIGHLIGHT=VB][/HIGHLIGHT] tags when posting code written in VB.
    - Write posts like a conversation, not like an email. That way you can avoid saying "Dear so and so" in every post.
    - When your problem is solved, go up to Thread Tools and click on Mark Thread Resolved

    My Contributions: Massive DirectX 2D Tutorials For VB5/VB6/VB.NET || 3D Engine In Pure VB || Friction Force ||DJ Turntable Simulation || Scratching Wavs || Time Based Movement || Newton Physics Simulation || Managed Game Loop || Rigid Body Collision Detection || World of Warcraft RGB Battle System || Bosskillers (World of Warcraft 2D Clone) || Street Fighter Controls (Flawless Simulation) || A* Pathfinding (VB6 & VB.NET) *UPDATED || *NEW* Nintendo Entertainment System Emulator (VB6) || *NEW* Video Game Making Tips (VB6 & VB.Net)

    Expert. Ask me anything NES!

    My Smilies:


  7. #7
    The DirectXpert Jacob Roman's Avatar
    Join Date
    Aug 04
    Location
    Miami Beach, FL
    Posts
    4,847

    Re: Nintendo Emulator v0.60 (VB6)

    Version 0.60 is finally here! See the first post for the update.
    Useful Forum Tips:

    - If you found any post that was useful, please consider rating their post

    - Give sensible thread titles, please!
    - Be sure to use [HIGHLIGHT=VB][/HIGHLIGHT] tags when posting code written in VB.
    - Write posts like a conversation, not like an email. That way you can avoid saying "Dear so and so" in every post.
    - When your problem is solved, go up to Thread Tools and click on Mark Thread Resolved

    My Contributions: Massive DirectX 2D Tutorials For VB5/VB6/VB.NET || 3D Engine In Pure VB || Friction Force ||DJ Turntable Simulation || Scratching Wavs || Time Based Movement || Newton Physics Simulation || Managed Game Loop || Rigid Body Collision Detection || World of Warcraft RGB Battle System || Bosskillers (World of Warcraft 2D Clone) || Street Fighter Controls (Flawless Simulation) || A* Pathfinding (VB6 & VB.NET) *UPDATED || *NEW* Nintendo Entertainment System Emulator (VB6) || *NEW* Video Game Making Tips (VB6 & VB.Net)

    Expert. Ask me anything NES!

    My Smilies:


  8. #8
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 01
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    59,467

    Re: Nintendo Emulator v0.60 (VB6)

    Looks cool and great job JR! I will try this in a few but where do you get the games?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (VBA, VB 6, VB.NET, C#)
    Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Star Wars Gangsta Rap Reps & Rating PostsVS.NET on Vista (New)Multiple .NET Framework Versions (New)Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 150 GB HDs RAID 1, 2 GBs DDR2 667 MHz RAM, 3 Viewsonic 17" LCDs, Windows Vista RTM, IE 7, Office 2007

  9. #9
    The DirectXpert Jacob Roman's Avatar
    Join Date
    Aug 04
    Location
    Miami Beach, FL
    Posts
    4,847

    Re: Nintendo Emulator v0.60 (VB6)

    Try coolrom.com but note I only have mappers 0 to 2 supported out of 255
    Useful Forum Tips:

    - If you found any post that was useful, please consider rating their post

    - Give sensible thread titles, please!
    - Be sure to use [HIGHLIGHT=VB][/HIGHLIGHT] tags when posting code written in VB.
    - Write posts like a conversation, not like an email. That way you can avoid saying "Dear so and so" in every post.
    - When your problem is solved, go up to Thread Tools and click on Mark Thread Resolved

    My Contributions: Massive DirectX 2D Tutorials For VB5/VB6/VB.NET || 3D Engine In Pure VB || Friction Force ||DJ Turntable Simulation || Scratching Wavs || Time Based Movement || Newton Physics Simulation || Managed Game Loop || Rigid Body Collision Detection || World of Warcraft RGB Battle System || Bosskillers (World of Warcraft 2D Clone) || Street Fighter Controls (Flawless Simulation) || A* Pathfinding (VB6 & VB.NET) *UPDATED || *NEW* Nintendo Entertainment System Emulator (VB6) || *NEW* Video Game Making Tips (VB6 & VB.Net)

    Expert. Ask me anything NES!

    My Smilies:


  10. #10
    The DirectXpert Jacob Roman's Avatar
    Join Date
    Aug 04
    Location
    Miami Beach, FL
    Posts
    4,847

    Re: Nintendo Emulator v0.60 (VB6)

    Ok after a number of requests I received, apparently its slow on the slower computers, but 60 fps on mine. So I did a little research on some speed optimization starting with VB6 compiler speed tips. For example, I don't need the overflow checks. So doing things like that will dramatically boost the speed of the emulator. I also need to see how I can boost the speed of the program itself with all the things that are doing but it comes at a cost unfortunately...readability. First thing I'm gonna do is a lot of experimenting with another program and test whats faster such as just having a sub/function there or literally Call the sub/function. I also heard \ is faster than both / and * so I'm gonna test it to truely know for sure. Inlining some functions and subs is another way. And it just goes on an on what I need to do. I also got a request to fix the menu exit, so I'm also gonna do that.
    Useful Forum Tips:

    - If you found any post that was useful, please consider rating their post

    - Give sensible thread titles, please!
    - Be sure to use [HIGHLIGHT=VB][/HIGHLIGHT] tags when posting code written in VB.
    - Write posts like a conversation, not like an email. That way you can avoid saying "Dear so and so" in every post.
    - When your problem is solved, go up to Thread Tools and click on Mark Thread Resolved

    My Contributions: Massive DirectX 2D Tutorials For VB5/VB6/VB.NET || 3D Engine In Pure VB || Friction Force ||DJ Turntable Simulation || Scratching Wavs || Time Based Movement || Newton Physics Simulation || Managed Game Loop || Rigid Body Collision Detection || World of Warcraft RGB Battle System || Bosskillers (World of Warcraft 2D Clone) || Street Fighter Controls (Flawless Simulation) || A* Pathfinding (VB6 & VB.NET) *UPDATED || *NEW* Nintendo Entertainment System Emulator (VB6) || *NEW* Video Game Making Tips (VB6 & VB.Net)

    Expert. Ask me anything NES!

    My Smilies:


  11. #11
    New Member
    Join Date
    May 13
    Posts
    7

    Re: Nintendo Emulator v0.60 (VB6)

    Hi, I'm omundodogabriel, creator of YoshiNES. I did YoshiNES alone, using as a basis the code BasicNES. I'm happy to see that there is still someone who cares for emulation in vb6.

    Well, I wanted to implement the sound wave using WaveOut in vb6, but I not have much experience working with this sound API.

    I have been interested in trying to make your sound code work with WaveOut API, if you authorize. Using Directx with vb6 I did not find very interesting, because it only supports up to DirectX 7 and has no compatibility with older versions of windows.

    Take a look at YoshiNES 0.7, where some of the bugs you mentioned have been fixed.

  12. #12
    The DirectXpert Jacob Roman's Avatar
    Join Date
    Aug 04
    Location
    Miami Beach, FL
    Posts
    4,847

    Re: Nintendo Emulator v0.60 (VB6)

    Sure if you want to. Its freely available for modification. And if you really want to, maybe we can work on this project together. Btw VB6 also supports DirectX8 and with some minor tweeks even DirectX9. Operating systems XP and up have DirectX already preinstalled with the operating system. So its ok to work with DirectX in VB6. My emulator uses DirectX8. That file I have above are for those who have Windows 7 and Windows 8 since MS has dropped support for vb6.

    Glad to finally chat with the creator of YoshiNES We should totally work on this thing. Best to work as a team and share knowledge
    Last edited by Jacob Roman; May 12th, 2013 at 12:39 PM.
    Useful Forum Tips:

    - If you found any post that was useful, please consider rating their post

    - Give sensible thread titles, please!
    - Be sure to use [HIGHLIGHT=VB][/HIGHLIGHT] tags when posting code written in VB.
    - Write posts like a conversation, not like an email. That way you can avoid saying "Dear so and so" in every post.
    - When your problem is solved, go up to Thread Tools and click on Mark Thread Resolved

    My Contributions: Massive DirectX 2D Tutorials For VB5/VB6/VB.NET || 3D Engine In Pure VB || Friction Force ||DJ Turntable Simulation || Scratching Wavs || Time Based Movement || Newton Physics Simulation || Managed Game Loop || Rigid Body Collision Detection || World of Warcraft RGB Battle System || Bosskillers (World of Warcraft 2D Clone) || Street Fighter Controls (Flawless Simulation) || A* Pathfinding (VB6 & VB.NET) *UPDATED || *NEW* Nintendo Entertainment System Emulator (VB6) || *NEW* Video Game Making Tips (VB6 & VB.Net)

    Expert. Ask me anything NES!

    My Smilies:


  13. #13
    New Member
    Join Date
    May 13
    Posts
    7

    Re: Nintendo Emulator v0.60 (VB6)

    Most of the credits go to Don Jarret and David Finch, the authors of bnes, who wrote the code for the CPU. I think it is worth trying to use DirectX 9 in vb.

    I agree that we should work together on this project, just can't help with APU emulation. I'll stop the development of YoshiNES to work on this project.

    I'm currently working on the support Mapper 5, which is one of the most complex of the NES in my opinion. Only Castlevania 3 is working at the moment, and only menu. : (

    I have a code that generates the Nes pallete and looks very similar to the original. I think it might be useful.

    I'll send you my email via pm.

  14. #14
    The DirectXpert Jacob Roman's Avatar
    Join Date
    Aug 04
    Location
    Miami Beach, FL
    Posts
    4,847

    Re: Nintendo Emulator v0.60 (VB6)

    Just one problem. They based their cpu off of the 6502c processor, not the 6502. Plus the execution cycle times differed from the 6502. So many thanks to the 2 links up there I found on the 6502 instruction set, so as a result I created a better 6502 module. I also found a couple opcodes needed more code or slightly changed after examining numerous opensource emulators as well as some other documentation on how to execute each instruction.

    My APU is currently in its beta stages, and whats really slowing it down is the For Loop on the sound buffer where the sound is mixed. Most languages can handle this such as C# and C++. But making it fast in vb6 is a real challenge. I may have to split up the buffers more so, so the for loop isnt stressing the main loop. Inlining some functions is another way, but it comes at an unfortunate cost, which is readability. Funny thing is, I get a blazing 320 fps average with the sound on my computer when I shut off the Lock_FPS, which locks the framerate to whatever frames per second you desire. And thats with software rendering. So on my computer the sounds fine. However I'm gonna continue to optimize it. Well....it could be because I already optimized the hell out of it but didn't upload it yet.

    [EDIT] For now I'm gonna stick with DirectX8 since it coincides with vb6 by default, and not too many people don't know how to get vb6 to work with DX9. I don't wanna risk running into problems and end up reverting back to DirectX8. That would suck!

    Also, since you messaged me about mapper 5, here are a couple of files to get you on the go, with C# source code you might be able to convert to vb6, as well as this link to all the mappers with docs to each:

    Mapper Grid
    Attached Files Attached Files
    Last edited by Jacob Roman; May 13th, 2013 at 12:46 AM.
    Useful Forum Tips:

    - If you found any post that was useful, please consider rating their post

    - Give sensible thread titles, please!
    - Be sure to use [HIGHLIGHT=VB][/HIGHLIGHT] tags when posting code written in VB.
    - Write posts like a conversation, not like an email. That way you can avoid saying "Dear so and so" in every post.
    - When your problem is solved, go up to Thread Tools and click on Mark Thread Resolved

    My Contributions: Massive DirectX 2D Tutorials For VB5/VB6/VB.NET || 3D Engine In Pure VB || Friction Force ||DJ Turntable Simulation || Scratching Wavs || Time Based Movement || Newton Physics Simulation || Managed Game Loop || Rigid Body Collision Detection || World of Warcraft RGB Battle System || Bosskillers (World of Warcraft 2D Clone) || Street Fighter Controls (Flawless Simulation) || A* Pathfinding (VB6 & VB.NET) *UPDATED || *NEW* Nintendo Entertainment System Emulator (VB6) || *NEW* Video Game Making Tips (VB6 & VB.Net)

    Expert. Ask me anything NES!

    My Smilies:


  15. #15
    New Member
    Join Date
    May 13
    Posts
    7

    Re: Nintendo Emulator v0.60 (VB6)

    After searching for the problem that was causing flicker when scrolling, I managed to fix using jsnes code.
    It was actually very simple, I just replaced this code on write6502 function:
    PPUAddress2 = (PPUAddress2 And &HFFE0&) Or (Value And &HF8) \ 8
    - with this -
    PPUAddress2 = Value \ 8 And &H1F
    And flickers are gone. However, when trying to use the code on your emulator, it not worked

    I am attaching the YoshiNES code with the bug fixed. I hope you can adapt to your emulator.
    YoshiNES scroll_fix.zip

    You also need to take a look at your 6502 code. vb returned an overflow error in SP on function Push8 after a while playing battletoads.

  16. #16
    The DirectXpert Jacob Roman's Avatar
    Join Date
    Aug 04
    Location
    Miami Beach, FL
    Posts
    4,847

    Re: Nintendo Emulator v0.60 (VB6)

    Ok I'll look into it right away.

    [EDIT] Guess what. I put it in my updated version of my NES emulator (the one I didn't upload yet) and it works o.O. Also for some reason the sound was a little funky on your YoshiNES v0.8. I think it has a lot to do with register $4015 where theres suppose to be a call to Sound_Channel_Write_Status_Register. I had some comments why I created this too:

    Code:
        'http://wiki.nesdev.com/w/index.php/APU
        '   Writing a zero to any of the channel enable bits will silence that channel and "immediately" set its length counter to 0.
        
        'Note: Not having length counter = 0 when channel is disabled immediately afterwards, or placing length counter = 0 somewhere else in another sub produces
        '      horrific results.
        'Examples: In Super Mario Bros.
        '          - going into a pipe will cause the sound to loop
        '          - finishing a level and the score being tallied with your alloted time, the sound keeps looping even after it stopped
        '          - worse of all, the dark levels such as level 2, almost all the sounds are sweeping waaaaay too hard producing ear piercing results!
        
        'So be sure to keep LengthCounter = 0 here in this sub. Its what the NES does immediately when the channels enabled flag is false anyways.
    I'll have to examine your code some more but Im just guessing thats why. Either that or you forgot something from my emulator related to sound.
    Last edited by Jacob Roman; May 14th, 2013 at 02:51 PM.
    Useful Forum Tips:

    - If you found any post that was useful, please consider rating their post

    - Give sensible thread titles, please!
    - Be sure to use [HIGHLIGHT=VB][/HIGHLIGHT] tags when posting code written in VB.
    - Write posts like a conversation, not like an email. That way you can avoid saying "Dear so and so" in every post.
    - When your problem is solved, go up to Thread Tools and click on Mark Thread Resolved

    My Contributions: Massive DirectX 2D Tutorials For VB5/VB6/VB.NET || 3D Engine In Pure VB || Friction Force ||DJ Turntable Simulation || Scratching Wavs || Time Based Movement || Newton Physics Simulation || Managed Game Loop || Rigid Body Collision Detection || World of Warcraft RGB Battle System || Bosskillers (World of Warcraft 2D Clone) || Street Fighter Controls (Flawless Simulation) || A* Pathfinding (VB6 & VB.NET) *UPDATED || *NEW* Nintendo Entertainment System Emulator (VB6) || *NEW* Video Game Making Tips (VB6 & VB.Net)

    Expert. Ask me anything NES!

    My Smilies:


  17. #17
    The DirectXpert Jacob Roman's Avatar
    Join Date
    Aug 04
    Location
    Miami Beach, FL
    Posts
    4,847

    Re: Nintendo Emulator v0.60 (VB6)

    I was right. You are missing a write to $4015, so add this:

    Case &H4015&: Sound_Channel_Write_Status_Register Value

    I'm looking into my Push8, but it seems ok. Did it crash in a particular opcode? And also even though we fixed Super Mario Bros, Castlevania 1 has minor scrolling problems with the score board.
    Last edited by Jacob Roman; May 14th, 2013 at 03:06 PM.
    Useful Forum Tips:

    - If you found any post that was useful, please consider rating their post

    - Give sensible thread titles, please!
    - Be sure to use [HIGHLIGHT=VB][/HIGHLIGHT] tags when posting code written in VB.
    - Write posts like a conversation, not like an email. That way you can avoid saying "Dear so and so" in every post.
    - When your problem is solved, go up to Thread Tools and click on Mark Thread Resolved

    My Contributions: Massive DirectX 2D Tutorials For VB5/VB6/VB.NET || 3D Engine In Pure VB || Friction Force ||DJ Turntable Simulation || Scratching Wavs || Time Based Movement || Newton Physics Simulation || Managed Game Loop || Rigid Body Collision Detection || World of Warcraft RGB Battle System || Bosskillers (World of Warcraft 2D Clone) || Street Fighter Controls (Flawless Simulation) || A* Pathfinding (VB6 & VB.NET) *UPDATED || *NEW* Nintendo Entertainment System Emulator (VB6) || *NEW* Video Game Making Tips (VB6 & VB.Net)

    Expert. Ask me anything NES!

    My Smilies:


  18. #18
    New Member
    Join Date
    May 13
    Posts
    7

    Re: Nintendo Emulator v0.60 (VB6)

    "or you forgot something from my emulator related to sound." - most likely because I have not tidied up the code (you may have noticed that is very messy for now).

    good that the code worked I still have to fix the timing problems on my emulator

    [EDIT] Thanks, will fix the sound right now!
    I'll take look on castlevania and see what I can do.
    Last edited by omundodogabriel; May 14th, 2013 at 03:19 PM.

  19. #19
    The DirectXpert Jacob Roman's Avatar
    Join Date
    Aug 04
    Location
    Miami Beach, FL
    Posts
    4,847

    Re: Nintendo Emulator v0.60 (VB6)

    For the heck of it, I'm gonna upload v0.65. Was gonna add DMC but I'll save that for the next update.
    Useful Forum Tips:

    - If you found any post that was useful, please consider rating their post

    - Give sensible thread titles, please!
    - Be sure to use [HIGHLIGHT=VB][/HIGHLIGHT] tags when posting code written in VB.
    - Write posts like a conversation, not like an email. That way you can avoid saying "Dear so and so" in every post.
    - When your problem is solved, go up to Thread Tools and click on Mark Thread Resolved

    My Contributions: Massive DirectX 2D Tutorials For VB5/VB6/VB.NET || 3D Engine In Pure VB || Friction Force ||DJ Turntable Simulation || Scratching Wavs || Time Based Movement || Newton Physics Simulation || Managed Game Loop || Rigid Body Collision Detection || World of Warcraft RGB Battle System || Bosskillers (World of Warcraft 2D Clone) || Street Fighter Controls (Flawless Simulation) || A* Pathfinding (VB6 & VB.NET) *UPDATED || *NEW* Nintendo Entertainment System Emulator (VB6) || *NEW* Video Game Making Tips (VB6 & VB.Net)

    Expert. Ask me anything NES!

    My Smilies:


  20. #20
    Angel of Code Niya's Avatar
    Join Date
    Nov 11
    Posts
    3,143

    Re: Nintendo Emulator v0.65 (VB6)

    Watching you guys converse is quite intriguing since I have no idea what yall are talking about. lol I'm jealous
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | Create Sortable BindingList(not mine) | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading


    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. -jmcilhinney

  21. #21
    New Member
    Join Date
    May 13
    Posts
    7

    Re: Nintendo Emulator v0.65 (VB6)

    I found out why it had not worked when I tried to fix the scrolling, the function Write_PPU_Register is not used, instead the ppu code is on the WriteMemory8_Inline function.

    The sound is better now, and the emulator a little faster. I'm waiting dmc to hear the characters voices

  22. #22
    The DirectXpert Jacob Roman's Avatar
    Join Date
    Aug 04
    Location
    Miami Beach, FL
    Posts
    4,847

    Re: Nintendo Emulator v0.65 (VB6)

    Quote Originally Posted by Niya View Post
    Watching you guys converse is quite intriguing since I have no idea what yall are talking about. lol I'm jealous
    Would you like to learn?
    Useful Forum Tips:

    - If you found any post that was useful, please consider rating their post

    - Give sensible thread titles, please!
    - Be sure to use [HIGHLIGHT=VB][/HIGHLIGHT] tags when posting code written in VB.
    - Write posts like a conversation, not like an email. That way you can avoid saying "Dear so and so" in every post.
    - When your problem is solved, go up to Thread Tools and click on Mark Thread Resolved

    My Contributions: Massive DirectX 2D Tutorials For VB5/VB6/VB.NET || 3D Engine In Pure VB || Friction Force ||DJ Turntable Simulation || Scratching Wavs || Time Based Movement || Newton Physics Simulation || Managed Game Loop || Rigid Body Collision Detection || World of Warcraft RGB Battle System || Bosskillers (World of Warcraft 2D Clone) || Street Fighter Controls (Flawless Simulation) || A* Pathfinding (VB6 & VB.NET) *UPDATED || *NEW* Nintendo Entertainment System Emulator (VB6) || *NEW* Video Game Making Tips (VB6 & VB.Net)

    Expert. Ask me anything NES!

    My Smilies:


  23. #23
    Angel of Code Niya's Avatar
    Join Date
    Nov 11
    Posts
    3,143

    Re: Nintendo Emulator v0.65 (VB6)

    Quote Originally Posted by Jacob Roman View Post
    Would you like to learn?
    If only I had the time, I would. I'm fascinated with things like that but unfortunately, at the moment I have to invest the time into boring yet marketable stuff. Hopefully in the future, when I have a solid base to make income, I can spend my coding time doing things that don't pay but are nonetheless, immensely enjoyable. God knows, I have so many pet projects that I'd like to finish and so many new things I'd like to learn.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | Create Sortable BindingList(not mine) | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading


    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. -jmcilhinney

  24. #24
    The DirectXpert Jacob Roman's Avatar
    Join Date
    Aug 04
    Location
    Miami Beach, FL
    Posts
    4,847

    Re: Nintendo Emulator v0.65 (VB6)

    There are known problems with my emulator, and this is what I know so far that either I or omundodogabriel need to fix:
    • The noise channels 93 step mode (I believe) isnt playng sound, which is why in Super Mario Bros you don't hear bricks breaking and only hear half the percussion. However in Double Dragon, its perfect, because it remains in 32767 mode the entire time. But if you remove the .Length_Counter > 0 from the if statement in the Noise_Channel_Render_Sample function, run Super Mario Bros, ignor the constant noise for a min, grab a mushroom, and break a block, you will finally hear the brick breaking noise that was missing. So I may have to create a look up table to XOR tap like this C++ NES emulator I have did.
    • The rectangle channels sounds semi perfect, but going into pipes in Super Mario Bros doesnt sound authentic enough. Those channels might need a minor tweak.
    • DMC channel is in the works for voice samples.
    • Games such as Castlevania still has scrolling issues in the scroll board as you move.
    • Might need to darken one of the turquoise blues in the palette to match up with my actual NES. This color you mainly see in World 1-2 of Super Mario Bros.
    Useful Forum Tips:

    - If you found any post that was useful, please consider rating their post

    - Give sensible thread titles, please!
    - Be sure to use [HIGHLIGHT=VB][/HIGHLIGHT] tags when posting code written in VB.
    - Write posts like a conversation, not like an email. That way you can avoid saying "Dear so and so" in every post.
    - When your problem is solved, go up to Thread Tools and click on Mark Thread Resolved

    My Contributions: Massive DirectX 2D Tutorials For VB5/VB6/VB.NET || 3D Engine In Pure VB || Friction Force ||DJ Turntable Simulation || Scratching Wavs || Time Based Movement || Newton Physics Simulation || Managed Game Loop || Rigid Body Collision Detection || World of Warcraft RGB Battle System || Bosskillers (World of Warcraft 2D Clone) || Street Fighter Controls (Flawless Simulation) || A* Pathfinding (VB6 & VB.NET) *UPDATED || *NEW* Nintendo Entertainment System Emulator (VB6) || *NEW* Video Game Making Tips (VB6 & VB.Net)

    Expert. Ask me anything NES!

    My Smilies:


  25. #25
    New Member
    Join Date
    May 13
    Posts
    7

    Re: Nintendo Emulator v0.65 (VB6)

    I'm working to fix problems in PPU. I fixed some problems based on virtuanes source code and loopy docs, and fixed games like yo noid and arch rivals. Castlevania, however, still flickering

    Name:  archrivals-ba.png
Views: 18
Size:  19.5 KBName:  yonoid-ba.png
Views: 18
Size:  22.7 KB

  26. #26
    The DirectXpert Jacob Roman's Avatar
    Join Date
    Aug 04
    Location
    Miami Beach, FL
    Posts
    4,847

    Re: Nintendo Emulator v0.65 (VB6)

    Sweet! Keep it up. In the mean time I'm gonna keep perfecting the sound.
    Useful Forum Tips:

    - If you found any post that was useful, please consider rating their post

    - Give sensible thread titles, please!
    - Be sure to use [HIGHLIGHT=VB][/HIGHLIGHT] tags when posting code written in VB.
    - Write posts like a conversation, not like an email. That way you can avoid saying "Dear so and so" in every post.
    - When your problem is solved, go up to Thread Tools and click on Mark Thread Resolved

    My Contributions: Massive DirectX 2D Tutorials For VB5/VB6/VB.NET || 3D Engine In Pure VB || Friction Force ||DJ Turntable Simulation || Scratching Wavs || Time Based Movement || Newton Physics Simulation || Managed Game Loop || Rigid Body Collision Detection || World of Warcraft RGB Battle System || Bosskillers (World of Warcraft 2D Clone) || Street Fighter Controls (Flawless Simulation) || A* Pathfinding (VB6 & VB.NET) *UPDATED || *NEW* Nintendo Entertainment System Emulator (VB6) || *NEW* Video Game Making Tips (VB6 & VB.Net)

    Expert. Ask me anything NES!

    My Smilies:


  27. #27
    The DirectXpert Jacob Roman's Avatar
    Join Date
    Aug 04
    Location
    Miami Beach, FL
    Posts
    4,847

    Re: Nintendo Emulator v0.65 (VB6)

    I found the source code to LoopyNES, so hopefully this link will help: http://home.comcast.net/~olimar/NES/loopynes.zip

    Its written entirely in assembly but I can help kinda translate it to VB.
    Useful Forum Tips:

    - If you found any post that was useful, please consider rating their post

    - Give sensible thread titles, please!
    - Be sure to use [HIGHLIGHT=VB][/HIGHLIGHT] tags when posting code written in VB.
    - Write posts like a conversation, not like an email. That way you can avoid saying "Dear so and so" in every post.
    - When your problem is solved, go up to Thread Tools and click on Mark Thread Resolved

    My Contributions: Massive DirectX 2D Tutorials For VB5/VB6/VB.NET || 3D Engine In Pure VB || Friction Force ||DJ Turntable Simulation || Scratching Wavs || Time Based Movement || Newton Physics Simulation || Managed Game Loop || Rigid Body Collision Detection || World of Warcraft RGB Battle System || Bosskillers (World of Warcraft 2D Clone) || Street Fighter Controls (Flawless Simulation) || A* Pathfinding (VB6 & VB.NET) *UPDATED || *NEW* Nintendo Entertainment System Emulator (VB6) || *NEW* Video Game Making Tips (VB6 & VB.Net)

    Expert. Ask me anything NES!

    My Smilies:


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •