No description
  • C 95.7%
  • Assembly 2%
  • Python 1.8%
  • Makefile 0.5%
Find a file
2026-10-16 14:51:42 -04:00
snes Add PVSnesLib hello world project with Makefile and README 2026-10-16 14:40:56 -04:00
tools Add fighter engine skeleton: state machine, hitboxes, HUD, placeholder sprites 2026-10-16 14:50:35 -04:00
.gitignore Add PVSnesLib hello world project with Makefile and README 2026-10-16 14:40:56 -04:00
data.asm Add fighter engine skeleton: state machine, hitboxes, HUD, placeholder sprites 2026-10-16 14:50:35 -04:00
fighter.c Add fighter engine skeleton: state machine, hitboxes, HUD, placeholder sprites 2026-10-16 14:50:35 -04:00
fighter.h Add fighter engine skeleton: state machine, hitboxes, HUD, placeholder sprites 2026-10-16 14:50:35 -04:00
fighter.png Add fighter engine skeleton: state machine, hitboxes, HUD, placeholder sprites 2026-10-16 14:50:35 -04:00
hdr.asm Add PVSnesLib hello world project with Makefile and README 2026-10-16 14:40:56 -04:00
LICENSE Add MIT license 2026-10-16 14:51:42 -04:00
main.c Add fighter engine skeleton: state machine, hitboxes, HUD, placeholder sprites 2026-10-16 14:50:35 -04:00
Makefile Add fighter engine skeleton: state machine, hitboxes, HUD, placeholder sprites 2026-10-16 14:50:35 -04:00
pvsneslibfont.png Add PVSnesLib hello world project with Makefile and README 2026-10-16 14:40:56 -04:00
README.md Add MIT license 2026-10-16 14:51:42 -04:00
snes.h Add PVSnesLib hello world project with Makefile and README 2026-10-16 14:40:56 -04:00

calc-fighter

A SNES game written in C with PVSnesLib.

Requirements

  • GNU make
  • PVSnesLib (provides 816-tcc, wla-65816, wlalink, gfx4snes, ...)

PVSNESLIB_HOME must point at the PVSnesLib directory (the one containing devkitsnes/ and pvsneslib/), in Unix-style path form. The tools under devkitsnes/bin and devkitsnes/tools must be executable.

This project was built with the copy bundled in SNES-IDE:

export PVSNESLIB_HOME=$HOME/src/SNES-IDE/SNES-IDE-out/bin/pvsneslib
chmod +x $PVSNESLIB_HOME/devkitsnes/bin/* $PVSNESLIB_HOME/devkitsnes/tools/*

Build

export PVSNESLIB_HOME=/path/to/pvsneslib
make

This converts pvsneslibfont.png to .pic/.pal, compiles main.c, assembles hdr.asm and data.asm, and links calc-fighter.sfc.

Optional switches (environment or make variables):

Variable Effect
FASTROM=1 FastROM build (default is SlowROM)
HIROM=1 HiROM build (default is LoROM)
PVSNESLIB_DEBUG=1 Keep intermediate debug files

hdr.asm defines LOROM/SLOWROM, so keep it consistent with these switches.

Clean

make clean

Game skeleton

File Purpose
main.c Setup, game loop, HUD health bars, round restart
fighter.h / fighter.c Fighter state machine, move frame data, hit/hurt boxes, pushbox, sprite drawing
fighter.png Placeholder sprite sheet: 32x32 frames in a vertical strip (frame order is FR_* in fighter.h)
tools/make_sprites.py Regenerates the placeholder fighter.png (~/.venv/bin/python3 -I tools/make_sprites.py)

Controls: P1 is pad 0, P2 is pad 1. D-pad moves, jumps (up) and crouches (down), Y punches, B kicks, START restarts after a KO.

To add a character: draw a new sheet with the same frame order, and add or change entries in the moves table in fighter.c for its frame data. P2 currently reuses the P1 sheet with red/blue swapped (makeP2Palette in main.c).

Run

Load calc-fighter.sfc in a SNES emulator (e.g. Mesen, bsnes, Snes9x).

License

MIT, see LICENSE. PVSnesLib (and the font and header files derived from it) is also MIT licensed by its authors.