gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Audio > Mod player

#121 - remi59 - Fri Jan 03, 2003 3:55 pm

What the best Mod player for GBA?

I tried Nmod 1c but I do not arrive has to compile it.
I also Tried Code Waves but I Have a lot a error when I compile my project whith it.

[Images not permitted - Click here to view it]

Please Help me!
If you whant Sources code send me an Email at Bennymarrou@aol.com

{Sorry for my English but i'm french}
_________________
---@Remi59@---
BOMBERMAN ZERO
Soon in your GBA

#126 - Corum - Fri Jan 03, 2003 7:17 pm

remi59 wrote:
What the best Mod player for GBA?

I tried Nmod 1c but I do not arrive has to compile it.
I also Tried Code Waves but I Have a lot a error when I compile my project whith it.


If you need .mod support, you should try Afm 1.1 library: www.hitmen-console.org

Here you can find a very good example (with source code, but incomplete makefile): http://darkfader.net/gba/

Hope it helps.
Bye.

Corum.

#143 - zeuhl - Fri Jan 03, 2003 10:10 pm

remi59 wrote:
What the best Mod player for GBA?

I tried Nmod 1c but I do not arrive has to compile it.

{Sorry for my English but i'm french}


nmod 1c works well with GCC or ARM SDT.
I got it working directly using the GNU assembler (the one that is used by GCC), the nmod.s (GCC version), and Jeff Frohwein's crt0.s .

and btw, I'm French too (sisi j'te jure). <joke>Please stop believing that being French allows to write bad English messages :)</joke>

#2066 - Sweex - Tue Jan 28, 2003 4:39 pm

I'm also looking for a modplayer, preferably with ability to play sound effects. Now I was trying to get a sample of AFM to compile/link and run, but yet unsuccesful. All I got was a "buzz" tone... Does anyone here have another sample that I could try or perhaps any hints?

Or perhaps with another player...?

Thanks in advance!

#2072 - NEiM0D - Tue Jan 28, 2003 7:32 pm

Indeed, the GCC version of NMOD was based on DarkFader's libraries.
You need his libraries in order to compile it.

However, it isn't that hard at all to compile it without his libraries.

#2101 - Quirky - Wed Jan 29, 2003 11:16 am

I just compiled NMOD like this:

Code:

ASFLAGS   = -mthumb-interwork -marm7tdmi

as $(ASFLAGS) -o nmod.o nmod.s


Then I could include the .o in a project as I needed. The code to set it up is really simple too:

Code:

#include "nmodgcc.h"

void PlaySong(unsigned char nSong) {
  NMOD_SetMasterVol(64,0);
  NMOD_SetMasterVol(64,1);
  NMOD_SetMasterVol(64,2);
  NMOD_SetMasterVol(64,3);
  unsigned long int regs = REG_IE;
  NMOD_Play( (u32)_binary_song_mod_start );
  REG_IE |= regs;
}

void StopSong(void) {
  // remember which regs we had irqs on before, as NMOD_Stop blitzes them
  unsigned long int regs = REG_IE;
  NMOD_Stop();
 
  // the following is needed so that the last note doesn't linger
  // otherwise, starting another tune has the last note of the last tune
  // still playing for a while.
  NMOD_pattern = 0;
  NMOD_row = 0;
  unsigned short i;
  for (i = 0; i < BUFFER_SIZE; i++) {
    NMOD_buffera[0][i] = 0;
    NMOD_buffera[1][i] = 0;
    NMOD_buffera[0][i] = 0;
    NMOD_bufferb[1][i] = 0;
  }
  for (i = 0; i < 4; i++) {
    NMOD_instrument[i] = 0;
    NMOD_effect[i] = 0;
    NMOD_period[i] = 0;
    NMOD_volume[i] = 0;
  }
  // return our irqs, minus nmod's TIMER1
  REG_IE |= regs;
  REG_IE &= ~INT_TIMER1; 
}



The extra stuff after NMOD_Stop() is only needed if you stop a song then want to play a different one later. If you don't clear out all the buffers, you get some notes remaining from the first song at the start of the second one. 'Course you probably only need to clean out certain buffers, not *all* of them, but I didn't trial and error enough to find out which.

#2116 - NEiM0D - Wed Jan 29, 2003 8:06 pm

I see you've got the hang of the NMOD_* variables, nice job by the way.
:]

#3525 - fl0w - Wed Feb 26, 2003 5:25 pm

Hi,

have a look at http://maso.r0x.free.fr

Bye !
_________________
--
fl0w