cfxnes (another browser-based emulator)
Moderator: Moderators
cfxnes (another browser-based emulator)
Hi, CFxNES is emulator I've been working on for some time. It's written in JavaScript (ES6).
For more info see project page or changelog.
Live demo is running at http://cfxnes.herokuapp.com
Any comments are welcome. Thanks.
For more info see project page or changelog.
Live demo is running at http://cfxnes.herokuapp.com
Any comments are welcome. Thanks.
Last edited by jonyzz on Wed Oct 28, 2015 12:49 pm, edited 5 times in total.
Re: cfxnes (another browser-based emulator)
Running my usual list of test games:
-Battletoads freezes after the intro. (That game is extremely timing sensitive.)
-Break Time doesn't work at all (probably this is due to a mistimed APU Frame IRQ or not waiting a frame before starting to set the PPU VBlank interrupt)
-Driar (homebrew game) doesn't work probably due to lack of support for undocumented CPU opcodes
-Slalom has lines that are displaced suggesting that you're using a PPU design that draws a whole line at a time. Sadly there's no way to deal with all the raster effects that the NES can do using a line at a time renderer.
-Shadow of the Ninja doesn't work
Turning off the triangle wave should leave it outputting its current value instead of resetting it to zero (this is the cause of a lot of popping sounds)
Similarly, changing the fine period or duty cycle on the square waves should not reset them. Changing the coarse period should reset the counters though.
Higher pitches are increasingly flat. Is there an off by one error on the counters for the square waves?
Resizing the window causes the audio pitch to change too. I know you're probably trying to compensate for framerate drops but it sounds terrible and takes a while to recover. You should run the APU for more cycles to fill the buffer instead.
-Battletoads freezes after the intro. (That game is extremely timing sensitive.)
-Break Time doesn't work at all (probably this is due to a mistimed APU Frame IRQ or not waiting a frame before starting to set the PPU VBlank interrupt)
-Driar (homebrew game) doesn't work probably due to lack of support for undocumented CPU opcodes
-Slalom has lines that are displaced suggesting that you're using a PPU design that draws a whole line at a time. Sadly there's no way to deal with all the raster effects that the NES can do using a line at a time renderer.
-Shadow of the Ninja doesn't work
Turning off the triangle wave should leave it outputting its current value instead of resetting it to zero (this is the cause of a lot of popping sounds)
Similarly, changing the fine period or duty cycle on the square waves should not reset them. Changing the coarse period should reset the counters though.
Higher pitches are increasingly flat. Is there an off by one error on the counters for the square waves?
Resizing the window causes the audio pitch to change too. I know you're probably trying to compensate for framerate drops but it sounds terrible and takes a while to recover. You should run the APU for more cycles to fill the buffer instead.
Re: cfxnes (another browser-based emulator)
I implemented some of them, but not all.Grapeshot wrote:-Driar (homebrew game) doesn't work probably due to lack of support for undocumented CPU opcodes
I'm actually using per-pixel rendering. I suspect there's a bug in my PPU scrolling implementation.Grapeshot wrote:-Slalom has lines that are displaced suggesting that you're using a PPU design that draws a whole line at a time. Sadly there's no way to deal with all the raster effects that the NES can do using a line at a time renderer.
You're right, that reduced the popping. However, I can still hear it. There must be something else I'm missing.Grapeshot wrote:Turning off the triangle wave should leave it outputting its current value instead of resetting it to zero (this is the cause of a lot of popping sounds)
I'm only reseting the duty cycle and envelope during write to $4003/$4007.Grapeshot wrote:Similarly, changing the fine period or duty cycle on the square waves should not reset them. Changing the coarse period should reset the counters though.
I checked it and it seems to me it's right:Grapeshot wrote:Higher pitches are increasingly flat. Is there an off by one error on the counters for the square waves?
Code: Select all
if --timerCycle <= 0
# Duty period is 2 * 8 * (timerPeriod + 1) APU cycles
timerCycle = (timerPeriod + 1) << 1
dutyPosition = (dutyPosition + 1) & 0x7
You're right. I'm adjusting sampling rate to prevent audio buffer underflow/overflow and it's causing these transitions when framerate changes.Grapeshot wrote:Resizing the window causes the audio pitch to change too. I know you're probably trying to compensate for framerate drops but it sounds terrible and takes a while to recover. You should run the APU for more cycles to fill the buffer instead.
Re: cfxnes (another browser-based emulator)
Driar (both original SGROM and my NROM) use $8F (SAX), $B3 (LAX), and $CB (AXS). The NROM build additionally requires that RAM exist from $800-$895 (although it doesn't require that RAM be mirrored)Grapeshot wrote:-Driar (homebrew game) doesn't work probably due to lack of support for undocumented CPU opcodes
Re: cfxnes (another browser-based emulator)
I've implemented AXS and Driar is now finally working. Thanks.lidnariq wrote:Driar (both original SGROM and my NROM) use $8F (SAX), $B3 (LAX), and $CB (AXS). The NROM build additionally requires that RAM exist from $800-$895 (although it doesn't require that RAM be mirrored)Grapeshot wrote:-Driar (homebrew game) doesn't work probably due to lack of support for undocumented CPU opcodes
Re: cfxnes (another browser-based emulator)
Minor update:
- all CPU opcodes are implemented (emulator passes Blargg's instr_test and instr_timing tests)
- better PPU timing - the first level of Battletoads is now playable (the game freezes in the second level, though)
- all CPU opcodes are implemented (emulator passes Blargg's instr_test and instr_timing tests)
- better PPU timing - the first level of Battletoads is now playable (the game freezes in the second level, though)
Re: cfxnes (another browser-based emulator)
Another update:
- fixed PPU scrolling implementation (games like Slalom or F-1 Race are now properly rendered)
- fixed VBlank/NMI timing (emulator passes ppu_vbl_nmi test)
- popping sounds should be now reduced (the cause was audio buffer overflow)
- fixed PPU scrolling implementation (games like Slalom or F-1 Race are now properly rendered)
- fixed VBlank/NMI timing (emulator passes ppu_vbl_nmi test)
- popping sounds should be now reduced (the cause was audio buffer overflow)
Re: cfxnes (another browser-based emulator)
Due to performance reasons, I rewrote the whole emulator from CoffeScript to JavaScript (ES6).
There should be noticable performance improvement in Firefox (emulation speed should be as fast as in Chrome).
There should be noticable performance improvement in Firefox (emulation speed should be as fast as in Chrome).