Port of libmikmod to BlocksDS based on the port by Sten Larsson.
  • C 99.9%
  • Makefile 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-08-04 02:07:57 +01:00
arm7/source libmikmod: Fix warnings in NDS driver code 2024-08-02 02:05:07 +01:00
arm9/source libmikmod: Update to latest git revision 2024-08-02 19:05:32 +01:00
docs docs: Update documentation from 3.3.11.1 2024-08-02 19:41:31 +01:00
examples examples: Remove unused ARM7 code 2024-08-04 02:07:57 +01:00
include libmikmod: Remove outdated headers 2024-08-02 19:46:43 +01:00
.gitignore Replace old build system by a new draft build system 2024-08-02 01:46:07 +01:00
AUTHORS libmikmod: Update to latest git revision 2024-08-02 19:05:32 +01:00
COPYING.LESSER libmikmod: Update to latest git revision 2024-08-02 19:05:32 +01:00
COPYING.LIB libmikmod: Update to latest git revision 2024-08-02 19:05:32 +01:00
Makefile build: Don't install libmikmod as a core BlocksDS library 2024-08-03 16:56:16 +01:00
Makefile.arm7 Replace old build system by a new draft build system 2024-08-02 01:46:07 +01:00
Makefile.arm9 libmikmod: Update to latest git revision 2024-08-02 19:05:32 +01:00
NEWS libmikmod: Update to latest git revision 2024-08-02 19:05:32 +01:00
README.md docs: Update readme 2024-08-02 20:00:38 +01:00
README_libmikmod.txt docs: Rename README 2024-08-02 19:10:06 +01:00
TODO libmikmod: Update to latest git revision 2024-08-02 19:05:32 +01:00

libmikmod 3.3.11.1 for NDS

Introduction

This is an unofficial Nintendo DS port of libmikmod, a portable sound library for playing various music modules like MOD, S3M, IT, etc. It runs on the ARM9 and it sends commands to the ARM7 only to update the state of the audio playback.

It is based on libmikmod 3.3.11.1, commit 0e5b74433880 from its official repository: https://sourceforge.net/p/mikmod/mikmod/ci/master/tree/libmikmod/

Install

Simply run this to build and install the library in your BlocksDS environment:

make install

Examples

Once you have installed the library, go to the folder of an example and run:

make

This will generate a NDS file that you can test with flashcarts or emulators.

Using the library

For general instructions on using libmikmod see the official manual here: http://mikmod.raphnet.net/doc/libmikmod-3.1.10/docs/mikmod.html

For details on using this port see the examples in the examples folder of this repository. I suggest you use that program as a template for your own project. You can do whatever you want with the source code of the examples, but libmikmod itself is LGPL. In practice this means your project needs to be open source (but it does not need to be (L)GPL).

More information

Two drivers are provided; one software mixer and one hardware mixer. The software driver can use a lot of CPU power depending on the module played. The hardware driver should use less, but it does not play all modules as good as the software mixer.

The software driver does all mixing on ARM9, and uses only sound channel 0. Unfortunately it uses TIMER0 and TIMER1 on ARM7 for timing.

The hardware driver uses sound channels 0 to x-1, where x is the number of channels in the module. When using the hardware driver you need to call the tick function on ARM9 every md_bpm * 0.4 seconds.

The software driver seems to be buggier than the hardware driver, and it occasionally crashes.

Both the hardware and software driver needs to send messages from ARM9 to ARM7. The communication itself needs to be done in the application. All messages will be 32-bit and always >= (1 << 28). You should allocate one of the user libnds FIFO channels for the player messages.

Changelog

  • 3.3.11.1 (2024/08/02)

    • Updated to libmikmod 3.3.11.1.
    • Example updated to use modern libnds.
  • 3.2.0ds1 (2007/12/22)

    • Based on libmikmod 3.2.0-beta2
    • Many fixes to the hardware mixer by Andreas Back. It is almost as good as the software mixer now!
  • 3.1.11ds1 (2006/11/07)

    • Initial Release

Credits

Original Nintendo DS port by Sten Larsson [email protected] http://blog.dev-scene.com/flatware

Contributions by Andreas Back [email protected]

Port to BlocksDS and update to version 3.3.11.1 by Antonio Niño Díaz

Official MikMod homepage http://mikmod.raphnet.net/