MCPcopy Index your code
hub / github.com/andrew-hoffman/halfnes

github.com/andrew-hoffman/halfnes @0.59b2

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.59b2 ↗ · + Follow
887 symbols 1,953 edges 127 files 95 documented · 11%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

DOWNLOAD HERE

halfnes

Join the chat at https://gitter.im/andrew-hoffman/halfnes

An accurate NES/Famicom emulator

Current Features

  • Joystick support through both DirectInput and xInput (thanks Zlika)
  • Cross-Platform
  • Supports Mapper 0, 1, 2, 3, 4, 5, 7, 9, 10, 11, 15, 19, 21, 22, 23, 24, 25, 26, 33, 34, 38, 41, 48, 58, 60, 61, 62, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 75, 76, 78, 79, 86, 87, 88, 89, 92, 93, 94, 97, 107, 112, 113, 118, 119, 140, 152, 154, 180, 182, 185, 200, 201, 203, 206, 212, 213, 214, 225, 226, 229, 231, 240, 241, 242, 244, 246, 255
  • Accurate sound core
  • Fast display code
  • Battery save support (No savestates! Come on. You can live without them.)
  • Remappable controls
  • Full screen mode
  • NTSC filter
  • NSF player

Running HalfNES

Download the latest version from https://github.com/andrew-hoffman/halfnes/releases . There are three versions of HalfNES included in this package: a Windows executable, a Mac .app package, and a JAR file for other platforms. Use whichever one works best on your platform, but you will need Java installed no matter what file is to be used. Linux users will need to set execute permissions on the JAR.

Default Controls (See Preferences dialog to remap them)

Controller 1: - D-Pad: Arrow Keys - B Button: Z - A Button: X - Select: Right Shift - Start: Enter

Controller 2:

  • D-Pad: WASD
  • B Button: F
  • A Button: G
  • Select: R
  • Start: T

The keys mapped to the A and B buttons are used to change tracks in the NSF player.

Note on joystick support

The first detected gamepad will be used as Controller 1, and the second will be Controller 2. Currently the buttons used are not configurable. (the controller needs to be plugged in before a game is loaded in order to be detected.)

Compatibility

At this point in development, almost all US released games will start, but certain games still have graphics corruption or freezing problems. Please report any issues you encounter with the emulator or with games on the Github Issues page (https://github.com/andrew-hoffman/halfnes/issues).

Building instructions

The project requires two libraries to build: JInput (gamepad support) and The Happy Java Library 1.3 (parallel for loops). Sorry there's no decent build script included with this package, at this point you might as well just create a new Netbeans project, import all the src files, and add those two libraries in the project properties.

Do NOT ask me where to find ROM files of commercial games. Some public domain homebrew ROMs are available at www.pdroms.de for testing purposes.

A 2 ghz Athlon 64 or better is currently required to run all games full speed. (The NTSC filter requires MUCH more processing power, however.) Saved games are placed in the folder that the ROM file is in for now.

If you are having problems getting the emulator to run, make sure to update your Java Runtime to the latest version. Go to http://java.com/en/download/manual.jsp and get the correct version for your OS.

Special Thanks to the NESDev wiki and forum community for the invaluable NES hardware reference that made this project possible.

Extension points exported contracts — how you extend this code

AudioOutInterface (Interface)
@author Andrew [6 implementers]
src/com/grapeshot/halfnes/audio/AudioOutInterface.java
ExpansionSoundChip (Interface)
@author Andrew [12 implementers]
src/com/grapeshot/halfnes/audio/ExpansionSoundChip.java
ControllerInterface (Interface)
@author Andrew [4 implementers]
src/com/grapeshot/halfnes/ui/ControllerInterface.java
FrameLimiterInterface (Interface)
@author Andrew [2 implementers]
src/com/grapeshot/halfnes/ui/FrameLimiterInterface.java
GUIInterface (Interface)
@author Andrew [2 implementers]
src/com/grapeshot/halfnes/ui/GUIInterface.java

Core symbols most depended-on inside this repo

getbit
called by 216
src/com/grapeshot/halfnes/utils.java
abs
called by 77
src/com/grapeshot/halfnes/CPU.java
write
called by 74
src/com/grapeshot/halfnes/audio/ExpansionSoundChip.java
read
called by 70
src/com/grapeshot/halfnes/PPU.java
setmirroring
called by 65
src/com/grapeshot/halfnes/mappers/Mapper.java
getbitI
called by 60
src/com/grapeshot/halfnes/utils.java
zpg
called by 57
src/com/grapeshot/halfnes/CPU.java
get
called by 38
src/com/grapeshot/halfnes/PrefsSingleton.java

Shape

Method 752
Class 126
Interface 5
Enum 4

Languages

Java100%

Modules by API surface

src/com/grapeshot/halfnes/CPU.java75 symbols
src/com/grapeshot/halfnes/ui/GUIImpl.java30 symbols
src/com/grapeshot/halfnes/ui/ControlsDialog.java27 symbols
src/com/grapeshot/halfnes/mappers/Mapper.java25 symbols
src/com/grapeshot/halfnes/PPU.java24 symbols
src/com/grapeshot/halfnes/NES.java24 symbols
src/com/grapeshot/halfnes/APU.java24 symbols
src/com/grapeshot/halfnes/cheats/ActionReplayGui.java21 symbols
src/com/grapeshot/halfnes/audio/VRC7SoundChip.java18 symbols
src/com/grapeshot/halfnes/ui/ControllerImpl.java16 symbols
src/com/grapeshot/halfnes/video/NTSCRenderer.java14 symbols
src/com/grapeshot/halfnes/mappers/NSFMapper.java14 symbols

For agents

$ claude mcp add halfnes \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact