npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

agnes.c

v0.2.0

Published

NES emulation library with an easy to use API; Krzysztof Gabis (2019).

Readme

About

agnes is a NES emulation library written in C with an easy to use API, by Krzysztof Gabis. It consists of only 2 files (agnes.h and agnes.c).

Features

  • Only 2 files (agnes.h and agnes.c).
  • Easy to use.
  • MIT licensed.
  • Supports NROM, UxROM, MMC1 and MMC3 mappers.

API example

agnes_t *agnes = agnes_make();
agnes_load_ines_data(agnes, game_data, game_data_size);
while (true) {
    agnes_input_t input;
    get_input(&input);

    agnes_set_input(agnes, &input, NULL);

    agnes_next_frame(agnes);

    for (int y = 0; y < AGNES_SCREEN_HEIGHT; y++) {
        for (int x = 0; x < AGNES_SCREEN_WIDTH; x++) {
            agnes_color_t c = agnes_get_screen_pixel(agnes, x, y);
            display_pixel(x, y, c);
        }
    }
}
agnes_destroy(agnes);

Full and working examples can be found in examples directory.

Screenshots

Installation

Run:

$ npm i agnes.c

And then include agnes.h as follows:

#include "node_modules/agnes.c/agnes.h"

You may also want to include agnes.c as follows:

#ifndef __AGNES_C__
#define __AGNES_C__
#include "node_modules/agnes.c/agnes.c"
#endif

This will include both the function declaration and their definitions into a single file.

Testing

Run cd node_modules/agnes.c/tests && run_tests.sh ROM_DIRECTORY to compile and run tests.

Since I cannot add roms to this project they must be downloaded manually. Please look at contents of examples/recs.tar.gz for names of roms that are required to run tests. Emulator testing roms (such as nestest.nes or official_only.nes) can be obtained from here. If you want to update add a recording or update an existing one run recorder (located in tests dir).

TODO

  • APU emulation.
  • Optimizations.
  • More mappers.
  • Being able to access CPU and PPU state using API.

Splitting and joining

agnes.c can be split into separate files by running utils/split.py:

utils/split.py --input agnes.c --output-path src

It can be joined back into a single file with utils/join.py:

utils/join.py --template utils/agnes.c.templ --path src --output agnes.c

Contributing

I will always merge working bug fixes. However, if you want to add something new to the API, please create an "issue" on github for this first so we can discuss if it should end up in the library before you start implementing it.

Acknowledgements

NesDev Wiki

Other open-source NES emulators, that were extremely helpful as a reference:

  • https://github.com/fogleman/nes
  • https://github.com/AndreaOrru/LaiNES
  • https://github.com/ulfalizer/nesalizer/blob/master/src/ppu.cpp
  • https://github.com/daniel5151/ANESE

Also, many thanks to Mateusz Belicki for all his suggestions and help.

License

The MIT License (MIT)