puNES Emulator

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Leonheart
Posts: 3
Joined: Thu Jun 04, 2020 2:33 pm

Re: puNES Emulator

Post by Leonheart »

Hey, I'm new here and I just got the latest puNES emulator. For some strange reason when I got setup my inputs for my controller it won't registered AT ALL. I'm wondering on how to resolve this, please? The older version of puNES allows me for input, why doesn't the newer version allow this?
User avatar
Arty
Posts: 2
Joined: Thu Nov 07, 2019 7:32 am

Re: puNES Emulator

Post by Arty »

You are just a great master of the super! There are no words in nature that can explain my admiration :)

However, I found a bug. If the delay of turbo A and turbo B modes differs from 1 and 2, then turbo mode does not work: only two presses occur.
User avatar
Chipsum
Posts: 14
Joined: Fri Dec 07, 2018 3:07 am
Contact:

Re: puNES Emulator

Post by Chipsum »

Version 0.111 is out :!:

https://github.com/punesemu/puNES/releases/tag/v0.111

Changelog
  • Rewritten mappers : All.
  • Rewritten WRAM, VRAM, PRGROM, CHROM and Nametebles management.
  • Rewritten FDS support.
    • Furthermore, an option has been added to select the mode for write operations. Until now, all writes were stored on an external file (diff file) to preserve the integrity of the disk image, now it's possible to choose to write them directly to the FDS/QD file (making it portable to other emulators as well).
    • Changed the format of the diff file, now I use the IPS format (which can always be applied to the original image).
  • Rewritten the format and management of save states.
    WARNING save states of version 0.110 or earlier are no longer compatible.
  • Rewritten the audio of the VRC7.
    Implemented the project "A YM2413 emulator written in C" of okaxaki :
  • Rewritten NSF player.
    Added support to NSF2 format.
  • Added the ability to configure shortcuts and the NES pad from the command line.
  • Added support to Quick Disk format.
  • Added an option for RAM initialization (#276).
    It's possible to choose between three values:
    • 0x00
    • 0xFF (default)
    • Randomize
  • Added a screen icon that shows when fast forward is active.
  • Added the possibility to set default values for PPU overclocking to be applied for all roms in addition to the per-game ones already used.
  • Added Arabic translation (thx to Chipsum).
  • Added Polish translation (thx to elektronicznypank).
  • Added full support for the NES 2.0 header format.
  • Added video filter : "NTSC CRT LMP88959" and "NTSC NES LMP88959" (https://github.com/LMP88959/NTSC-CRT, Thx to LMP88959 for is great work).
  • Added video filter : "PAL CRT LMP88959" and "PAL NES LMP88959" (https://github.com/LMP88959/PAL-CRT, Thx to LMP88959 for is great work).
  • Added support to mapper : 100, 122, 157, 170, 272, 291, 311, 334, 354, 362, 366, 384, 421, 446, 471, 517, 551, 552, 555, 561.
  • Added support to UNIF mapper : Transformer, UNROM, AMROM, AOROM, LH09, A60AS, T4A54A, FC-28-5027, 150in1A, 212-HONG-KONG, GKCXIN, 113in1JY110, 820561C, M2C52A, S-2009.
  • Added full support for the Detach Barcode Reader of mapper 157.
  • Added support for FFmpeg 6.x libraries.
  • Added support for nes20db.xml and dip.cfg (many thx to NewRisingSun for his immense work).
    Both files will be distributed together with the emulator and will be located in the following directories:
    • Linux/BSD - {default system datadir}/puNES
    • Windows - directory where the executable is placed.
      if you want to use a more updated version than the one distributed with the emulator, just copy it either in the executable directory or in the working directory of the emulator, which can also be opened from the "File -> Open working directory" menu.
  • Added full support for Vs System (UniSystem and DualSystem).
  • Added a screen icon that shows when Fast Forwarding is active.
  • In Fullscreen the menu bar can be accessed by moving the mouse over the top of the screen.
  • Updated Italian, Chinese, French, Hungarian, Portuguese and Russian translation (thx to Alex Timonin, FlameMan, stgapr29, tch_oscomp, Matheus Scattolin Anselmo, owomomo, shinyoyo, githubsilver and Benjamin Siskoo).
  • Changed the "Toggle menu bar" shortcut to ESC.
  • Windows x86_64: Update to Qt5 5.15.8 (#279).
  • Fixed the management of keyboard input (#317).
  • Fixed map of one keyboard button to multiple controllers (#277).
  • Fixed FDS wavetable pitch (#295).
  • Fixed patching of IPS files.
  • Fixed crackling sound when audio is enabled/disabled.
  • Fixed Meta button recognition on some keyboard layouts.
  • Fixed many many many other bugs.
Fiskbit
Posts: 890
Joined: Sat Nov 18, 2017 9:15 pm

Re: puNES Emulator

Post by Fiskbit »

Congrats on the massive release, FHorse.

The fact that so much was rewritten here made me play around with some test ROMs, and I've got a bug report regarding DMA. There are a few DMA test ROMs that are showing incorrect results for DMC DMA, which matters for the synced read workaround for DMC DMA joypad glitches:

- In dma_sync_test_loop, the badrol version has deliberately-wrong timing and should turn white immediately, while the goodrol version has correct timing and should never turn white (unless right is pressed). In puNES, both turn white.

- In dmc_dma_start_test_v2, there are problems with both the control test (where no DMA is done) and with several of the timings. This test works by turning on greyscale for a critical region so the length of that region can be manually counted using the white tick marks. (However, because the greyscale region jitters by a pixel every frame, you may need to move it up or down with the D-pad so that jitter isn't exposing flickering tickmarks on the edges.) The ROM contains many tests, switched between using the A button, with expected results for tests 0-5 described in this post and the remaining tests described in the earlier linked post. I noticed the following issues:

0. For test 0, greyscale is simply toggled on and off, which takes 13 cycles and thus should show 13 tick marks on the screen, but puNES shows 12. I'm not sure what exactly is going on here; I'd be surprised if the instruction timing is off by a cycle, so I wonder if greyscale turning on happens at the end of the write and turning off happens at the start, or what. Because of this, all absolute cycle counts here are likely one lower than they should be.

1-2. Tests 1 and 2 both show 15 cycles instead of 16, but if we assume from test 0 that the greyscale region is just off by 1, these look correct.

3-4. Tests 3 and 4 should alternate between 16 and 17 cycles, because DMC DMA's length varies between 3 and 4 cycles depending on whether it halted on a get or put cycle. After a $4015 write, it wants to land on 'get' cycles (taking 3 total), but half the time, these tests delay it with a write cycle so it halts on a 'put' and takes 4 cycles. puNES shows 15 cycles, which presumably means 16 cycles, so either it always takes 3 cycles here or it never collides with the write cycle.

5. Test 5 should alternate between 8 and 11 cycles depending on whether DMA occurred before the greyscale disable or after (which depends on whether the PPU mask write occurs on a get cycle or a put cycle). puNES always shows 10 cycles, presumably meaning 11 cycles, indicating DMC DMA always occurs before the PPU mask write.

7. Test 7 makes DMC DMA occur during OAM DMA. The number of cycles is too large to count, so it is instead compared against test 6, which merely does OAM DMA without DMC DMA. Test 7 should add 2 cycles to the length of test 6, because DMC DMA should pause OAM DMA for a cycle to read the sample byte and then OAM DMA should be forced to align on the next cycle. puNES adds 3 cycles.

C. Test C attempts to cause joypad bit deletion on controller 2, and so the rightmost digit of the counter in the top right should be counting up as it detects unexpected right button presses. This only happens with one of the two alignments, so it happens half the time. puNES doesn't detect any right presses (counter stays at 0).


I wrote an article explaining how DMA works (in perhaps too much detail) so emulator authors can hopefully implement it correctly. I'm happy to answer any questions.
FHorse
Posts: 232
Joined: Sat May 08, 2010 9:31 am

Re: puNES Emulator

Post by FHorse »

Hi Fiskbit, thanks so much for the tests and reports. I will read your article carefully and try to figure out what the problem is and probably bother you for information.
Post Reply