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.

ASM > mod replayer for goldroad

#21448 - booger - Sat May 29, 2004 2:01 pm

i'm not sure if this should go in the audio or assembly forum, but i decided to post it here anyway. here goes:
i'm looking for a mod replayer which is simple to implement in code aimed for the goldroad assembler; i find gas annoying for
a project written in 100% assembler, but most players i've found are targeted towards gas-projects. has anyone modifyed an existing player (like nmod) or do i have to do it myself..?

#21454 - poslundc - Sat May 29, 2004 3:41 pm

I think very few people are using goldroad for new development. First of all, it's much easier to use GAS because it comes with the GNU toolchain - which most of us are already using anyway - and keeps everything streamlined with GCC. Also, unless things have changed since I started ASM programming, goldroad is abandonware and is no longer under development, and hasn't been updated or maintained in quite a while.

There are only some minor syntactical differences between goldroad and GAS. You can probably convert the program yourself to goldroad without much difficulty, but if you plan on relying on community resources regularly then you might consider taking the plunge into GAS instead, as you will be saving yourself a lot of conversion work in the long run.

Dan.

#21467 - booger - Sat May 29, 2004 5:37 pm

poslundc wrote:
I think very few people are using goldroad for new development. First of all, it's much easier to use GAS because it comes with the GNU toolchain - which most of us are already using anyway - and keeps everything streamlined with GCC. Also, unless things have changed since I started ASM programming, goldroad is abandonware and is no longer under development, and hasn't been updated or maintained in quite a while.

There are only some minor syntactical differences between goldroad and GAS. You can probably convert the program yourself to goldroad without much difficulty, but if you plan on relying on community resources regularly then you might consider taking the plunge into GAS instead, as you will be saving yourself a lot of conversion work in the long run.

Dan.


you may be right..i've given gas a second chance, and i guess it's more reliable in the long run! :)

#25334 - [mRg] - Fri Aug 20, 2004 8:33 pm

just to jump on this old topic for a second ..

I am creating a project in pure asm (gas) and was just curious as to if there was a recommended/tried/tested asm mod player out there .. im curious to see how one would work (trying to learn as much as i can hehe) and would hope to implement it into my project with the least of fuss. (well i dont mind a bit of fuss .. helps the learning proces :P)

Any nudges in the right direction would be welcome.

[mRg]

#25335 - wintermute - Fri Aug 20, 2004 9:55 pm

http://www.pdroms.de/roms.php?system=Gameboy%20Advance&typ=Applications&first=0


NMOD player 1c

#25350 - [mRg] - Sat Aug 21, 2004 8:36 am

thanks wintermute :)

I'll try it out :)

[mRg]

#25356 - [mRg] - Sat Aug 21, 2004 2:57 pm

Lo again .. .. if anyone can cast their eye on this I would be greatful !

(Apologies for the basic code but I am a newbie at this :)

Just a simple routine to play a mod in asm (trying to convert from the C example) .. Im probably doing something that is quickly recified or I have no idea what I'm doing (which, to be honest, is more likely hehe)

It compiles OK but I get a weird static noise when i run it (well least there is some noise not silence I guess :) which i think is it just playing very slowly.

I thought it may be something to do with the way i have assigned the interrupt handler .. or .. does the code need to be in iwram ? (I am a little unsure about iwram at this point as I am just starting out and links to useful docs explaining this would be useful too hehe) .. or .. have i included the nmod.s in the wrong place ?

Any help /pointers are always appreciated.

Regards

[mRg]

C Example (comes with NMOD)

Code:

int main(int argc, char argv[])
{
int i;
//Set timer1 interrupt handler to NMOD_Timer1iRQ
iTimer1Intr=NMOD_Timer1iRQ;
//Set mastervolumes to maximum
NMOD_SetMasterVol(64,0);
NMOD_SetMasterVol(64,1);
NMOD_SetMasterVol(64,2);
NMOD_SetMasterVol(64,3);
//Start playing
NMOD_Play( (u32)(&BIN(module)) );
for(;;)
   {
   pad=Joypad();
   if (!(pad&Pad1Start))
      {
      break;
      }
   VSync();
   }
//Stop playing
NMOD_Stop();
for(;;);
}


My Code ..

Code:

.arm
.text
.global main

@-------------------------------------------------------
@ Include header with standard GBA definitions                         
@-------------------------------------------------------

.include "includes/gba.h"

@-------------------------------------------------------
@ Main program label                       
@-------------------------------------------------------

main:

@--------------------------------------------------------
@ Setup screen
@--------------------------------------------------------

         ldr r0, =REG_DISPCNT
         ldr r1, =(MODE_4|BG2_ENABLE)   @ LOAD REGISTER - OR the options we want together.
         strh r1, [r0]
         
@--------------------------------------------------------
@ Music setup
@--------------------------------------------------------            

         ldr r0, =0x03007ffc            @ Set interrupt
         ldr r1, =NMOD_Timer1iRQ      @ to NMOD Timer
         str r1, [r0]

         mov r0, #64                  @ Set max vol
         mov r1, #0                  @ Channel 0
         bl NMOD_SetMasterVol   
         
         mov r0, #64                  @ Set max vol
         mov r1, #1                  @ Channel 1
         bl NMOD_SetMasterVol
         
         mov r0, #64                  @ Set max vol
         mov r1, #2                  @ Channel 2
         bl NMOD_SetMasterVol
         
         mov r0, #64                  @ Set max vol
         mov r1, #3                  @ Channel 3
         bl NMOD_SetMasterVol
         
         ldr r0,=mymod               @ Point to included module
         bl NMOD_Play               @ Play the module ?
                                                                                                                                                                                                                                                                                                   
@--------------------------------------------------------
@ Main infinite loop
@--------------------------------------------------------

infin:
         
         
         @--------------------------------------------------------
         @ Wait for VBlank
         @--------------------------------------------------------   
         
         ldr r0,=REG_VCOUNT   
waitVBlank:
         ldrh r1, [r0]                           
         cmp r1, #161                            
         bne waitVBlank                           
         
         b infin

.ltorg
         
mymod:
         .incbin "includes/module.bin"
         
.include "nmod.s"

#25459 - FluBBa - Mon Aug 23, 2004 12:44 pm

iTimer1Intr is not 0x03007ffc.
You should probably set up your interrupt handler to jump to NMOD_Timer1iRQ on Timer1IRQ.
_________________
I probably suck, my not is a programmer.