pvsneslib:基于C/汇编的任天堂SNES开发库,含编译器、链接器及示例

PVSnesLib : A small, open and free development kit for the Nintendo SNES

Branch3Tags16
FilesLast commitLast update
4 months ago
10 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 years ago
1 year ago
4 years ago
4 years ago
3 months ago
3 years ago
2 years ago
10 months ago
4 years ago
4 years ago
4 years ago
3 months ago

PVSnesLib

Programmer Valuable Snes Library — a small, open, and free development kit for coding Nintendo SNES games in C (or assembly).

License: MIT Discord Current Release Downloads Build

PVSnesLib bundles a compiler/linker toolchain and a library (with full source) that gives you ready-made functions for backgrounds, sprites, controller input, and music/sound on real SNES hardware — plus example projects that show how it all fits together.

It was started for the SNES's 20th anniversary in 2012, building on Ulrich Hecht's earlier SNES SDK, and has since grown into a mostly assembler-optimized library that's just as usable directly from asm if you'd rather skip C entirely.

Table of contents

Features

  • Backgrounds — tile and map loading, multiple BG modes
  • Sprites — OAM management helpers for animated sprites
  • Input — controller/pad and mouse/superscope reading
  • Sound & music — SPC700 audio driver integration
  • Toolchain included — C compiler (816-tcc) and linker, no separate install needed
  • C or assembly — write your whole game in C, drop into asm where you need the speed, or skip C altogether
  • HiROM / FastROM support
  • Cross-platform — prebuilt releases for Windows, Linux, and macOS
  • Example projects included, covering common techniques (including a Mode 7 demo and a full map/platformer engine example)

Quickstart

Get a project compiling before you dive into the details.

  1. Download the release for your OS from the latest release page, and unzip it.

  2. Set the environment variable the toolchain expects (adjust the path to where you unzipped it):

    export PVSNESLIB_HOME="/path/to/pvsneslib"
    
  3. Write the classic Hello World, following this tutorial.

For the full walkthrough — Makefile setup, folder layout, and flashing to real hardware — see the Wiki.

Before you start

PVSnesLib assumes you're already comfortable with C. Trying to learn C and SNES programming at the same time will slow you down a lot — get comfortable with C first. A solid grasp of the SNES hardware itself also goes a long way. Good starting points:

Installation

Prebuilt releases are available for:

Windows Linux macOS

Download the archive for your platform, unzip it, and follow the setup steps on the Wiki.

Generated API documentation is also available here.

Building from source / Docker

Prebuilt releases not working for your setup? You can build PVSnesLib from source.

  • On Windows, you'll need a unix-like environment such as msys2.
  • A ready-to-use Docker image is provided — see the docker folder for build instructions.
  • Full dependency list and build steps: Compiling from sources (Wiki)

PVSnesLib supports Windows, Linux, and macOS.

Editor integration

A Visual Studio Code template is available in vscode-template to get syntax highlighting, build tasks, and debugging set up quickly.

Documentation

Contributing

Bug reports, pull requests, and discussion are all welcome on the GitHub project or on Discord.

PVSnesLib and its affiliated tools are distributed under the MIT license — see pvsneslib_license.

Made with PVSnesLib

A few of the games built on PVSnesLib (non-exhaustive):

Yo-Yo Shuriken Eyra Sydney Hunter
Yo-Yo Shuriken — Dr. Ludos Eyra — Second Dimension Sydney Hunter — CollectorVision

Support the project

PVSnesLib is free to use. If it's been useful to you and help you create a game, consider supporting development.

Donate

Special thanks

PVSnesLib exists thanks to a long list of contributors and tool authors — from toolchain maintainers and optimizers to the artists behind the intro logo and everyone active on Discord.

See the project's commit history and Discord community for the full cast of people who've helped it grow.

Thanks!

Introduction

PVSnesLib : A small, open and free development kit for the Nintendo SNES

Customize your domain
371.12 K95Visit GitHub