andrew-hoffman / halfnes Goto Github PK
View Code? Open in Web Editor NEWAn accurate NES/Famicom emulator
License: GNU General Public License v3.0
An accurate NES/Famicom emulator
License: GNU General Public License v3.0
I just realized I have like 200 copies of jinput-dx8.dll in my Temp folder, all in folders named things like halfNES-natives2281448322177416404. When the natives are created the files and the folder are set to be deleted on exit by calling (file handle).deleteOnExit(); but it doesn't seem to happen. It's not that big of a deal since each set of natives is only 64k but that could still add up over time.
I tried redesigning the Quit methods to eliminate the call to System.exit(0) and did make some things more consistent in the process, like I didn't realize that window position was only saved when you used the Quit command from the menu, but the temp files are still not deleted when I don't use System.exit at all.
Doesn't matter whether I run it inside or outside the IDE.
Need to check if this works on other platforms.
Scrolling so jerking on PAL and Dendy/Hybrid systems even if "Sleep Between Frames" is ON.
Other emulators does it more smoother (even at 60Hz physical display refresh rate).
I want to use halfnes as library.
Currently it is a stand-alone app only. What I need is embedding the emulation as library, remote control the input and grap all the output data (screen, sound, etc). Of course the hole emulation should run headless.
If you want this but not familiar with this kind of task I can contribute.
As mentioned in klaushauschild1984@a62f090#commitcomment-14746936 there should be support for some replay capabilities. FM2 files will be great for that.
My laptop has an occasional issue where the sound device stops working completely, This affects various programs differently. Most browsers will still play video without the sound, Winamp won't start playback at all. I can fix that by disabling and re-enabling it in the Device Manager but it exposes a bug in my own software that I thought I'd mention here.
With HalfNES, with the sound disabled in Preferences things work normally. But if I turn on the sound everything freezes. The reason for this is that the SourceDataLine doesn't throw any exceptions when creating it with the system in this state but when I actually try to write to the buffer it blocks forever in a wait() loop.
Now I currently depend on the audio buffer blocking at least a little bit to maintain synchronization but I can't tell if its just going to block for a little bit or if no data is being drained from the buffer at all as far as I can tell.
Having an extra sentinel thread to interrupt the waiting if it's taking far too long doesn't work because of this lovely bit of code in the Swing mixer:
https://community.oracle.com/thread/2381571
I think to fix this will require changing to a different audio system, or rewriting my code to never attempt to block on the audio buffer at all. That will require outputting much finer grained chunks of audio, maybe a line worth rather than a frame worth (a good idea anyway) and finding some other more accurate source of 60/ 50 hz timing. I can't get anything like a vblank interrupt from Swing but JavaFX does have an animation timer that might work.
There are no unit tests or something that ensures the correct functionality.
Some unit test would be nice.
Another aproach are integration tests with the various test-roms out there.
There is an issue with the current revision, it does not build or run without modification.
There are unstated deps taken on libs, these need to be found and added. There is also broken code around controller detection.
When to disable audio, the timing of emulator if too fast. Speed of frame don't 60 or 50 HZ when to disable audio.
Things I need for this:
028, 118, 158, 095, 080, 207
basically all the boards that use CHR address lines for mirroring control
Hi, this is a very interesting feature, I wonder if it could be done in halfnes? Currently only HDNes is capable of doing it but it is very slow and has low compatibility thus far. https://github.com/mkwong98/HDNes Description http://www.1emulation.com/forums/files/file/23-hdnes/
https://github.com/shonumi/gbe-plus/wiki/Project-Goals
xBRZ is a very good filter.
Tinob/Ishiiruka@d2fb925
Tinob/Ishiiruka@84f96ae
gonetz/GLideN64@daf18ef
gonetz/GLideN64@5bf7a4e
https://sourceforge.net/projects/xbrz/files/xBRZ/
http://sourceforge.net/projects/xbrz/files/?source=navbar
https://github.com/hrydgard/ppsspp/tree/master/ext/xbrz
https://github.com/devinacker/bsnes-plus/pull/27/files
http://ngemu.com/threads/peops-opengl-1-78-xbrz-scalers-mod.173953/
http://ngemu.com/threads/peteopengl2tweak-tweaker-for-peteopengl2-plugin-w-gte-accuracy-hack.160319/
Hello God, I've transplanted your project to android,but it runs very slowly every frame takes 80 milliseconds.
It can be full frame running on PC
Is the Java jvm on the mobile phone system so much worse than the PC?
someone commented that the .app file I've built doesn't work any more (it was a Japanese OS) but I don't have a Mac that can even run Yosemite. Need to check this in the graphic design comp. lab or something.
I am getting this error when compiling with maven:
/halfnes/src/main/java/com/grapeshot/halfnes/ui/OnScreenMenu.java:[54,48] package javafx.scene.input does not exist
Would it be possible to Port the emulator to another GUI? Or maybe to create an abstract GUI with different implementations for different GUIs.
I already have the sound chip emulated, so I should do the rest.
Needed:
Specifically one that doesn't drop down to 20 fps just for upscaling your image too far with bilinear. Probably LWJGL or SDL, but I need to figure out how to do a menu bar. It would be ideal if I could compile and run shaders.
Hi, Andrew.
Can you add PAL and Dendy (NTSC/PAL Hybrid) modes to halfnes please?
"Dendy-mode" is name for pirate PAL timing, which allow to run most of NTSC games (Jap, USA) on 50 Hz without glitches, with correct DPCM sound pitch also, unlike official PAL NES timing.
No need to "autodetect" it via "auto-region". It must be set by user, and emulator should "remember" it.
Complete Information:
Cycle Reference Chart - nesdev wiki
Table of differences between NTSC, official PAL NES and Dendy pirate PAL timings
Global Nesdev F.A.Q.
Dendy timings have specific behavior, causing some in-game glitches, so here is ROMs to-test it:
240pee by Tepples (Damian Yerrick) must show timing:
Battletoads and Double Dragon (U).nes
Must have glitches like this:
"Choujin Sentai - Jetman (J)" intro glitch:
Noise and DMC APU pitch tables are same as NTSC NES/Famicom,
so Sunsoft NTSC games must have correct pitch
P.S:
"Dendy-mode" is only euphonic name. A thousands of "NTSC/PAL hybrid" famiclones work on this timings.
They have different labels/names in CIS countries ("Dendy", "Lifa", "Kenga", "Subor", etc),
Eastern Europe (i know "Pegasus" in Poland) and Asian region ("MicroGenius" in Taiwan).
Thank you for support.
Completely broken:
Not really playable:
Cosmetic issues:
Many of these games depend on reading $2004 during rendering to synchronize.
(Micro Machines, Dizzy the Adventurer, Bee 52, big nose freaks out)
Should be able to provide a less jerky picture when the console is not running at the same refresh rate as the computer display, and blend frames instead of dropping them altogether.
Example Scenarios:
60 hz console on 50 fps display like most new Intel IGP laptops do on battery
50hz PAL console on 59.94 hz display
144 hz display (I don't know anyone with one of these yet)
-need to actually be able to detect frame rate of host PC! (and I can't even catch vblank with Swing)
-Nestopia automatically blends frames when they don't match. need fast frame blending (maybe CRT phosphor exponential decay emulation)
-APU sample rate will have to drift a bit so we get exactly lined up with vblank and no dropped frames or sound pops (can adjust output sample rate +/- 0.6% and no one should notice.)
Battletoads and Double Dragon - The Ultimate Team (U).nes
CRC32: 53B02F3D
MD5: 35933222CF8658F7C6679FC7DE630AAA
SHA-1: 61832D0F955CFF169FF059BD557BE4F522B15B7C
hangs on pseudo-3D levels (1,6,7) when RAW 7-bit PCM samples play (beat enemy or pause drum)
and lifebar also shakes on level 2 for the same reasons.
Hi, I have developed a JVM for browser and have ported halfnes to it, and it works! but very slow. look here:
https://github.com/neo-expert/halfnes
normaly my JVM-implementation is very fast. You can check it here:
https://gitlab.com/neoexpert/jvm
Halfnes is an interesting project for porting. I'll check why halfnes is running slow on it. Normaly the browser should automatically optimize the code...
I'm fairly certain this is a linux issue, but while it detects my controller, I can't set any buttons. I've set my controller to both xinput and directinput mode, but the set buttons... er button is still grayed out.
System: Ubuntu 16.04.3 LTS
Java: OpenJDK 1.8.0_151
Relevant part of the thread dump:
Found one Java-level deadlock:
=============================
"AWT-EventQueue-0":
waiting to lock monitor 0x00007fc258004068 (object 0x0000000771904010, a com.grapeshot.halfnes.ui.SwingUI),
which is held by "main"
"main":
waiting to lock monitor 0x00007fc258003fb8 (object 0x00000006c6e01f30, a java.awt.Component$AWTTreeLock),
which is held by "AWT-EventQueue-0"
Java stack information for the threads listed above:
===================================================
"AWT-EventQueue-0":
at java.awt.Component.addComponentListener(Component.java:5227)
- waiting to lock <0x0000000771904010> (a com.grapeshot.halfnes.ui.SwingUI)
at sun.awt.im.InputContext.addClientWindowListeners(InputContext.java:980)
- locked <0x000000076d4d3ff8> (a sun.awt.im.InputMethodContext)
at sun.awt.im.InputContext.activateInputMethod(InputContext.java:407)
at sun.awt.im.InputContext.focusGained(InputContext.java:338)
- locked <0x000000076d4d3ff8> (a sun.awt.im.InputMethodContext)
- locked <0x00000006c6e01f30> (a java.awt.Component$AWTTreeLock)
at sun.awt.im.InputContext.dispatchEvent(InputContext.java:245)
at sun.awt.im.InputMethodContext.dispatchEvent(InputMethodContext.java:196)
at java.awt.Component.dispatchEventImpl(Component.java:4821)
(...)
"main":
at java.awt.Component.resize(Component.java:2183)
- waiting to lock <0x00000006c6e01f30> (a java.awt.Component$AWTTreeLock)
at java.awt.Component.setSize(Component.java:2173)
at com.grapeshot.halfnes.ui.SwingUI.render(SwingUI.java:441)
- locked <0x0000000771904010> (a com.grapeshot.halfnes.ui.SwingUI)
at com.grapeshot.halfnes.ui.SwingUI.setFrame(SwingUI.java:424)
- locked <0x0000000771904010> (a com.grapeshot.halfnes.ui.SwingUI)
at com.grapeshot.halfnes.PPU.renderFrame(PPU.java:829)
at com.grapeshot.halfnes.NES.runframe(NES.java:98)
- locked <0x0000000771899348> (a com.grapeshot.halfnes.NES)
at com.grapeshot.halfnes.NES.run(NES.java:60)
at com.grapeshot.halfnes.ui.SwingUI.<init>(SwingUI.java:59)
at com.grapeshot.halfnes.halfNES.main(halfNES.java:23)
I think it's caused by this line: SwingUI.java:441
It should be called from the Event Dispatch Thread.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.