It is currently Mon Oct 23, 2017 5:39 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 38 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: phibiaNES emulator.
PostPosted: Sat May 17, 2014 10:56 am 
Offline

Joined: Tue Apr 29, 2014 1:31 pm
Posts: 47
OMG.

This is about the following problem:
* Timing problems, don't know why as I debug it the PPU cycles is exacly 3x CPU cycles at any given time, maybe the way I emulate the CPU. Dunno yet.

Seems there weren't timing issues. (tested this with Battletoads, which always failed). Seems I haven't read the PPU wiki article right. This is about the screen_mask and sprite_mask behaivor. It seems it only masks the left 8 pixels of a scanline. not the first 8 and last 8 pixels. That was what I have implemented. That is also the reason why Battletoads didn't register the Sprite #0 hit :O

Implemented that it only masks the first 8 pixels and not the last 8 pixels. What do you know.. Battletoads just runs without issues.. Even in level 2.. * smacks face into wall *

Also fixed some serious MMC1 mapper faults. Busy implementing dummy reads for all instructions. And also may implement some unofficial opcodes. Probably will fix Driar and Streemers. Since these seem to crash due to unsupported unofficial opcodes.


Top
 Profile  
 
 Post subject: Re: phibiaNES emulator.
PostPosted: Mon May 19, 2014 1:54 pm 
Offline

Joined: Tue Apr 29, 2014 1:31 pm
Posts: 47
Checked MMC3 irq code again. Seemed some all games required the irq not to be auto reloaded. Megaman 3 for example. But definitely saw this on turtles 3. The whole introduction was halfly rendered. Because the IRQ triggered too much? Fixed it and also the small glitches in SMB 3 were gone. Meaning it completely improved game compatibility. Turtles 3 renders nicely. Only no health or score visible..

Also implemented Rom address mirroring as most roms crashed because of selecting too high page numbers and thus executing garbage. Which breaks the game. Mirroring this seems to fix this. Actually a whole lot of no go games are going. This fixed a significant amount of games..

Happy coder :)


Top
 Profile  
 
 Post subject: Re: phibiaNES emulator.
PostPosted: Thu May 22, 2014 7:56 am 
Offline

Joined: Tue Apr 29, 2014 1:31 pm
Posts: 47
Anyone interested to try the 2nd public beta?

Attachment:
File comment: Public Beta #2
pnes-beta2.7z [707.04 KiB]
Downloaded 62 times


Top
 Profile  
 
 Post subject: Re: phibiaNES emulator.
PostPosted: Thu May 22, 2014 6:31 pm 
Offline

Joined: Thu Apr 14, 2011 9:27 pm
Posts: 85
Two things:

The MMC3 scanline counter should be running unless both sprites and background are disabled. (If only one is disabled, the PPU still does both background and sprite fetches.) This would fix the intro for GI Joe and Burai Fighter.

Fester's Quest is using the wrong mirroring in game, and is a little less playable than it normally is.


Top
 Profile  
 
 Post subject: Re: phibiaNES emulator.
PostPosted: Thu May 22, 2014 9:36 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3944
Bill & Ted's Excellent Video Game Adventure doesn't work (but that game is using some pretty dirty stuff to even run in the first place).
Also, when I load a file that's read only, It won't open it.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
 Post subject: Re: phibiaNES emulator.
PostPosted: Fri May 23, 2014 1:03 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
Problems I've found (using beta 2):

* Audio/video gets out of sync quite easily; 1-2 full second delays were common when I was playing Contra. Adjusting frequency playback (under Options / Nes APU) did not improve/worsen the situation.

* Keyboard input (the default) seems... delayed in some way. It's very hard to explain what I mean by this, because the delay is slight. I will state that if I set up my controller for input I'd be able to determine if this was me being nitpicky or actually an issue. So you might ignore me on this one for the time being.

* On more than one occasion when doing File / Exit the emulator would continue to run (100% of a CPU core), but never exit -- furthermore, it would not respond to getting focus by clicking the mouse, alt-tab, etc. -- I had to End Task the process in Task Manager. To me this indicates your main WM_* handler is probably being done wrong (some logic bug/etc. somehow keeping the WM_* messages from being processed correctly). I will point out that under normal circumstances File / Exit takes a lot longer than it should (IMO) -- almost 1-2 full seconds before it quits. No idea what it's doing.

* Lots of audio emulation bugs (doesn't require a good ear), but I know you'll get to these eventually. I find audio to be a universally difficult thing to understand (I've never done any audio on the NES or SNES, FYI) so don't take my comment all that harshly. :-)

Recommendations:

* On systems lacking Direct2D, you should probably grey out the "Disable GPU Acceleration" checkbox under Options / Nes PPU since it wouldn't have any effect.

* Under Options, change the tab names from "Nes PPU" and "Nes APU" to "Graphics" and "Audio". The settings shown there do not really have to do with the PPU or the APU, they have more to do with the actual emulator internals/behaviour.

* Under File, you should reverse the order of "Save State" and "Load State"; Load should come first.

* Under File, put a section divider between "Open NSF" and (if you make the above improvement) "Load State", as well as one between "Save State" and "APU".

* Under File, I'd rename "APU" to "Audio" -- again, has nothing to do with the APU, has to do with logging audio to a WAV file...

* The word is "phosphor", not "fosfor" (assuming we're expecting English universally through all the menus), although I know in Dutch (thus probably Afrikaans) it's spelled "fosfor". (Yeah, I've tinkered in Afrikaans... eish!)

* If you plan on saving settings, please for the love of god use an .ini file or .xml file or your own .cfg format or something (though I really recommend text); don't go with the native Windows registry please. People REALLY like being able to have emulators operate as "standalone apps" so that they can run off a USB stick and be moved around. I believe there are some Win32 calls (if you're doing native Win32) that actually use registry-like API calls but instead of the data being written to the registry it's written to an .xml file.


Top
 Profile  
 
 Post subject: Re: phibiaNES emulator.
PostPosted: Fri May 23, 2014 3:21 am 
Offline

Joined: Tue Apr 29, 2014 1:31 pm
Posts: 47
koitsu wrote:
Problems I've found (using beta 2):

* Audio/video gets out of sync quite easily; 1-2 full second delays were common when I was playing Contra. Adjusting frequency playback (under Options / Nes APU) did not improve/worsen the situation.



I already plan to totally revise the APU emulation code. Since it has problems which seems to be specific in my approach.

Quote:

* Keyboard input (the default) seems... delayed in some way. It's very hard to explain what I mean by this, because the delay is slight. I will state that if I set up my controller for input I'd be able to determine if this was me being nitpicky or actually an issue. So you might ignore me on this one for the time being.



Interesting. It doesn't seem to lag on my computer.

Quote:

* On more than one occasion when doing File / Exit the emulator would continue to run (100% of a CPU core), but never exit -- furthermore, it would not respond to getting focus by clicking the mouse, alt-tab, etc. -- I had to End Task the process in Task Manager. To me this indicates your main WM_* handler is probably being done wrong (some logic bug/etc. somehow keeping the WM_* messages from being processed correctly). I will point out that under normal circumstances File / Exit takes a lot longer than it should (IMO) -- almost 1-2 full seconds before it quits. No idea what it's doing.



Shutting down the emulator will shut down the seperate thread for emulation. Most of the time it does what it needs to do.. but sometimes it refuses to stop. Still figuring out why..

Quote:

* Lots of audio emulation bugs (doesn't require a good ear), but I know you'll get to these eventually. I find audio to be a universally difficult thing to understand (I've never done any audio on the NES or SNES, FYI) so don't take my comment all that harshly. :-)



I use approximation logic in audio to speed-up emulation. didn't go the way I planned. Set @ 88200 or 96000Hz makes the reproduction alot better. That is why I am planning to totally revise the APU part. It also can't get the DMC Interrupts right.

Quote:
Recommendations:

* On systems lacking Direct2D, you should probably grey out the "Disable GPU Acceleration" checkbox under Options / Nes PPU since it wouldn't have any effect.

* Under Options, change the tab names from "Nes PPU" and "Nes APU" to "Graphics" and "Audio". The settings shown there do not really have to do with the PPU or the APU, they have more to do with the actual emulator internals/behaviour.

* Under File, you should reverse the order of "Save State" and "Load State"; Load should come first.

* Under File, put a section divider between "Open NSF" and (if you make the above improvement) "Load State", as well as one between "Save State" and "APU".

* Under File, I'd rename "APU" to "Audio" -- again, has nothing to do with the APU, has to do with logging audio to a WAV file...

* The word is "phosphor", not "fosfor" (assuming we're expecting English universally through all the menus), although I know in Dutch (thus probably Afrikaans) it's spelled "fosfor". (Yeah, I've tinkered in Afrikaans... eish!)

* If you plan on saving settings, please for the love of god use an .ini file or .xml file or your own .cfg format or something (though I really recommend text); don't go with the native Windows registry please. People REALLY like being able to have emulators operate as "standalone apps" so that they can run off a USB stick and be moved around. I believe there are some Win32 calls (if you're doing native Win32) that actually use registry-like API calls but instead of the data being written to the registry it's written to an .xml file.


About the last part. It actually stores .INI files. But I found a bug when you nicely do File -> Exit. It won't save the settings, but clicking on the 'X' does. something that is easily fixed.

Example INI file wrote:
[Controller1]
button_a=90
button_b=88
button_select=65
button_start=83
button_up=38
button_down=40
button_left=37
button_right=39
[Controller2]
button_a=87
button_b=81
button_select=0
button_start=0
button_up=104
button_down=98
button_left=100
button_right=102
[APU]
SampleRate=88200
StereoOutput=1
StereoIntermix=0,46
[PPU]
2XSAI=0
2XSAIMODE=1
DisableGPU=0
FosforDriveStrength=32
GPULinearFiltering=0


Grapeshot wrote:
Two things:

The MMC3 scanline counter should be running unless both sprites and background are disabled. (If only one is disabled, the PPU still does both background and sprite fetches.) This would fix the intro for GI Joe and Burai Fighter.

Fester's Quest is using the wrong mirroring in game, and is a little less playable than it normally is.


Interesting, as it only triggers when both rendering modes are enabled. just changing a logic AND to a logic OR might fix these issues? Gonna try this when I am at home.


Top
 Profile  
 
 Post subject: Re: phibiaNES emulator.
PostPosted: Fri May 23, 2014 12:11 pm 
Offline

Joined: Tue Apr 29, 2014 1:31 pm
Posts: 47
Changing the line

if (dot = a12_toggle) and (enable_bg and enable_spr) then

to

if (dot = a12_toggle) and (enable_bg or enable_spr) then

fixed the issues with:

* Burai fighter
* Kick Master
* G.I. Joe

Thanks!

----

Checked MMC1 mirroring code:- it seems that never implemented 1-screen mirroring @ 2000,2800 for the MMC1 mapper. Probably was TODO since I wrote the MMC1 mapper code my PPU emulation couldn't do one-screen mirroring yet.. But that has long changed.. Implemented the 1-screen mirroring.. and Fester's Quest runs as it should. The same with Tetris (USA) (which gave a black game screen)

Still figuring out why Metroid goes almost fully blank when getting the "ball" thingy on the left @ start of the game.

----

some NEWS!

This is beta #3.

Revamped end-point renderer ( PPU buffer -> Display ) whole output is threaded. When compositing the image the emulated cpu and ppu keep running (not stalled so often anymore)
xBRZ filtering up to 4x - this is very CPU intensive. my trusty old Q9400 has trouble keeping up. Especially with games which alot of patterns. This is can be multithreaded.. Look in the System options. Recommended settings are 2 threads or 4 threads, 3 threads is still buggy. So triple-core users either set 2 or 4 threads.

Attachment:
File comment: Screenshot SMB3 with 4xBRZ
phibiaNES-4xBRZ.png
phibiaNES-4xBRZ.png [ 70.49 KiB | Viewed 1964 times ]


Download here:
Attachment:
File comment: PhibiaNES - Public Beta #3
pnes-beta3.7z [748.22 KiB]
Downloaded 70 times


Top
 Profile  
 
 Post subject: Re: phibiaNES emulator.
PostPosted: Mon May 26, 2014 12:49 pm 
Offline

Joined: Tue Apr 29, 2014 1:31 pm
Posts: 47
Want to see the next video of CV 3 on my emulator utilizing the 2xsai and 2xBRZ filter. The latter seems way more crisp. At the expense of my CPU.. My CPU wasn't able to sustain 60fps in single-thread mode. Later on I enabled the dual-thread option for the display rendering. After that my CPU was able to sustain 60fps. So you need a hefty CPU for that. Some games require alot more CPU horsepower on ?xBRZ than others. For example: Quad-thread mode xBRZ with the game Crisis Force still chokes my CPU to death :o

Here you can watch it:
https://www.youtube.com/watch?v=Xzu_GImyW_M&feature=youtu.be

For ppl seeing small details: yes I also implemented custom palettes for the emulator.


Top
 Profile  
 
 Post subject: Re: phibiaNES emulator.
PostPosted: Mon Jun 02, 2014 2:16 pm 
Offline

Joined: Tue Apr 29, 2014 1:31 pm
Posts: 47
Beta #4 is out now :)

Attachment:
File comment: phibiaNES beta #4 - Lots of filters, including Blargg NTSC filter and some scanline filters. Click high spec button to set a preset that will enable the filters.
pnes-beta4.7z [785.11 KiB]
Downloaded 59 times


Added mapper for Salamander

Added the following blitters:

* NTSC Filter ( way too slow and buggy )
* Scanlines 50%
* Scanlines 75%
* Scanlines 75% + Signalling Reflection
* Blargg NTSC Filter (+configurable)

Attachment:
File comment: screenshot SMB 3
phibiaNES-blargg-ntsc-3x.png
phibiaNES-blargg-ntsc-3x.png [ 266.37 KiB | Viewed 1864 times ]

screenshot is not final image; the flickering effect is not visible.. to fully support this you need to have Direct2D with a 60hz display refresh.

Attachment:
File comment: screenshot SMB 3 using SL75%SR
phibiaNES-scanl75sr-3x.png
phibiaNES-scanl75sr-3x.png [ 150.14 KiB | Viewed 1864 times ]

also utilizes some kind of flickering effect.


Top
 Profile  
 
 Post subject: Re: phibiaNES emulator.
PostPosted: Sun Jun 29, 2014 12:26 pm 
Offline

Joined: Tue Apr 29, 2014 1:31 pm
Posts: 47
Currently I am rewriting the APU emulation part of my NES emulator. Total rewrite that is. As I could not get it right, having audio quality issues with it.

What I already have reimplemented is:

* Pulse Channels 1 and 2
* Triangle Channel.

ToDo:

* Noise Channel
* Dreaded DPCM channel. ( this bugged the previous APU implementation horribly )
* VRC6 Pulse 1 and 2
* VRC6 Sawtooth

The audio is already a lot cleaner than the previous implementation when comparing the first 3 channels! :)
Still some small issues are pertaining. as always -_-

I will update the post with before and after sample files.


Top
 Profile  
 
 Post subject: Re: phibiaNES emulator.
PostPosted: Wed Dec 17, 2014 4:09 pm 
Offline

Joined: Tue Apr 29, 2014 1:31 pm
Posts: 47
A new release phibiaNES beta 5
------------------------------------

Tremendous amount of bugfixes, compatibiliy issue fixes. Audio emulation improved, still has issues ( I sure suck at audio programming that is for sure ) For best audio quality set the samplingrate @ 88200Hz with stereo disabled and a 2 kB play buffer/16kB render buffer. ( plays most clean without disturbing audio lag )

With the audio part. I already ditched the new-emulation core and continued to work on my old trusty APU code. Merging the new ideas into it and bugfix the hell of out. VRC6 games sound good @ 88k2/mono/2kB/16kB.

Pixel doubler (2x, 3x) implemented for people who loves the blockiness with 8:7/Linear filtering. It looks good. Advanced filters require the multithread display option to be enabled under (System). Only advanced filters that doesn't need this is the xBRZ filters, but it is very required to do so because the performance will suck tremedously when this isn't the case.

Ctrl+Backspace rewinds the emulation 5 seconds. On some games this still bugs around. (probably look at my state saving technique, probably some very important variable isn't dumped)
you can also drag & drop NES files onto the phibiaNES window to open them.

VRC7 implemented, it can also emulate Lagrange Point, BUT! I haven't implemented the VRC7 audiochip yet. Reading how this thing works scares me and uses alot of audio/music jibberisch I still do not 100% understand.

Implemented some other mappers too.
Implemented 4-screen support (4kB CIRAM) - Games such as Gauntlet and Rad Racer II run without issues now.

You can get it here:
Attachment:
pnes-beta5.zip [1.5 MiB]
Downloaded 63 times


Audio sample from Castlevania 3 Japanese Edition (VRC6, Riddle)
Attachment:
Aku-Riddle.mp3 [1.97 MiB]
Downloaded 118 times


Top
 Profile  
 
 Post subject: Re: phibiaNES emulator.
PostPosted: Sun Dec 21, 2014 4:16 pm 
Offline

Joined: Tue Apr 29, 2014 1:31 pm
Posts: 47
a new feature is about to be finished.

I am implementing AVI video recording capabilities in my emulator using VfW (DirectShow is a bit unclear with sending data to an inputpin of a compressor. Or it is required to write a videosource filter and use interproces communication)

Perhaps tomorrow it is ready for Beta #6. Here is a screenshot of the settings.
Attachment:
generaloptions-system.png
generaloptions-system.png [ 9.48 KiB | Viewed 1579 times ]


You can select the required compressor. video framerate (30 or 60 fps).
Audio will always be downsampled to 44.1/48kHz (or the filesize will grow to big)

Nice to know:
phibiaNES doesn't capture the preprocess video, but it captures the post-process video. This means you can also record the NTSC video filter, ?xBRZ filters, SuperxSAI filters, TV-scanline filters, etc.

If filesize or CPU utilization gets out of hand while recording videos you can always select 30 fps instead of 60fps.

Press CTRL+A to start capturing and CTRL+S to stop capturing. But that is for later.. probably will upload the new beta (6) in around 16 hours or so.

If you got ideas? They're welcome and I always will see if I can implement those ideas.


Top
 Profile  
 
 Post subject: Re: phibiaNES emulator.
PostPosted: Sun Dec 21, 2014 4:39 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19122
Location: NE Indiana, USA (NTSC)
A naive 30 fps recording will mess up with a lot of the 30 Hz flicker seen especially in early NES games, such as after Mario gets hurt. Could you add a way to blend pairs of frames for 30 Hz recording?

Or if there is a copy of ffmpeg or avconv on a system, you could pipe video output through those.


Top
 Profile  
 
 Post subject: Re: phibiaNES emulator.
PostPosted: Mon Dec 22, 2014 6:11 am 
Offline

Joined: Tue Apr 29, 2014 1:31 pm
Posts: 47
tepples wrote:
A naive 30 fps recording will mess up with a lot of the 30 Hz flicker seen especially in early NES games, such as after Mario gets hurt. Could you add a way to blend pairs of frames for 30 Hz recording?

Or if there is a copy of ffmpeg or avconv on a system, you could pipe video output through those.


If you install ffdshow (which is a directshow/vfw filter for ffmpeg's libavcodec) you can record using this codec. Settings can be configured using the FFDShow VfW configuration utility.

I will implement a frameblender for 30fps video. That is actually the reason that I have not published Beta#6 yet. I want to get that in before I release it to the public.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 38 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group