Giter VIP home page Giter VIP logo

libdragon's Introduction

Libdragon

Build

Welcome to libdragon

Libdragon is an open-source SDK for Nintendo 64. It aims for a complete N64 programming experience while providing programmers with modern approach to programming and debugging. These are the main features:

  • Based on modern GCC (13) and Newlib, for a full C11 programming experience. A Docker container is available to quickly set up the programming environment.
  • The GCC toolchain is 64 bit capable to be able to use the full R4300 capabilities (commercial games and libultra are based on a 32-bit ABI and is not possible to use 64-bit registers and opcodes with it)
  • Can be developed with newer-generation emulators (ares, cen64, Dillonb's n64, simple64) or development cartridges (64drive, EverDrive64, SummerCart64).
  • Support both vanilla N64 and iQue Player (Chinese variant). The support is experimental and done fully at runtime, so it is possible to run ROMs built with libdragon on iQue without modifying the source code.
  • In-ROM filesystem implementation for assets. Assets can be loaded with fopen("rom://asset.dat") without having to do complex things to link them in.
  • Efficient interrupt-based timer library (also features a monotone 64-bit timer to avoid dealing with 32-bit overflows)
  • Graphics: easy-to-use API for 2D games, accelerated with RDP
  • Support for standard N64 controllers and memory paks.
  • Support for saving to flashes and EEPROMs (including a mini EEPROM filesystem to simplify serialization of structures).
  • Audio: advanced RSP-accelerated library, supporting up to 32 channels and streaming samples from ROM during playback for very low memory usage. Supports WAV files for sound effects and the XM (FastTracker, MilkyTracker, OpenMPT), and YM (Arkos Tracker 2) module formats for background music. Can playback a 10-channel XM with < 3% CPU and < 10% RSP.
  • Debugging aids: console (printf goes to screen) exception screen, many asserts (so that you get a nice error screen instead of a console lockup), fprintf(stderr) calls are redirected to your PC console in emulators and to USB via compatible tools (UNFLoader, g64drive).
  • Support to read/write to SD cards in development kits (64drive, EverDrive64, SummerCart64), simply with fopen("sd://sdata.dat")
  • Simple and powerful Makefile-based build system for your ROMs and assets (n64.mk)

The preview branch features many more features:

  • a new comprehensive RDP engine
  • a full OpenGL 1.1 port for 3D graphics programming, with a custom, efficient RSP ucode with full T&L support.
  • a MPEG1 RSP-accelerated movie player
  • support for showing source-level stack traces in case of crashes or assertions, including source file name and line number.

and much more. These features will eventually land to trunk, but you can start playing with them even today. Go the preview branch doc for more information.

Getting started: how to build a ROM

To get started with libdragon, you need to download and install the toolchain.

Make sure to read the full installation instructions which also explain the system requirements.

Getting started: how to run a ROM

Using emulators

libdragon requires a modern N64 emulator (the first generation of emulators are basically HLE-only and can only play the old commercial games). Suggested emulators for homebrew developemnt are: ares, cen64, dgb-n64, simple64.

On all the above emulators, you are also able to see in console anything printed via fprintf(stderr), see the debug library for more information.

Using a development cartridge on a real N64

All cartridges that are able to load custom ROMs should be able to successfully load libdragon ROMs via either USB/serial, or from a MMC/SD card. For instance, the following are known to work: 64drive, EverDrive64 (all models), SC64.

If your cartridge has USB support, use one of the loaders that implement the libdragon debugging protocol, so to be able to show logs in console. For instance, UNFLoader, g64drive, ed64. The official loaders provided by the vendors are usually less feature-rich.

Libdragon stable vs preview

Currently, there are two main libragon versions:

  • The stable version is the one in the trunk. Stable means that we strive never to break backward compatibility, that is we will never do changes in a way that will impede existing applications to successfully compile and work against a newer libdragon version. We feel this is important because otherwise we would fragment the homebrew ecosystem too much, and we would leave a trail of libdragon-based applications that can't be compiled anymore.
  • The preview version is the one in the preview branch. This is where most development happens first. In fact, features are developed, evolved and battle-tested here, before the APIs are stabilized and they are finally merged on the trunk. Applications that use the preview branch need to be aware that the APIs can break at any time (though we try to avoid gratuitous breakage).

Upgrading libdragon

If you are upgrade the stable version, check the ChangeLog in the wiki to see latest changes that were merged into the stable version of libdragon. Also check the wiki page for common hurdles in upgrading libdragon.

If you are upgrading the preview version, instead, remember that some breaking changes are expected. We do not keep track of those though, so you will have to check the relevant header files yourself to check what is changed.

Resources

libdragon's People

Contributors

rasky avatar anacierdem avatar dragonminded avatar sp1187 avatar meeq avatar snacchus avatar dragorn421 avatar parasyte avatar networkfusion avatar buu342 avatar clbr avatar stefanmielke avatar polprzewodnikowy avatar deadcast2 avatar jago85 avatar frogging101 avatar jopadan avatar spookyiluha avatar thar0 avatar hazematman avatar kev4cards avatar vieux avatar klaussilveira avatar command-tab avatar a-busman avatar valandil avatar thekovic avatar mic- avatar gamemasterplc avatar devwizard64 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.