Home » Community » Forums » » Audio Programming on the GameBoy Advance Part 1
  Intel sponsors gamedev.net search:   
[Control Panel] [Register] [Bookmarks] [Who's Online] [Active Topics] [Stats] [FAQ] [Search]

Add Forum to Favorites |  Send Topic To a Friend | View Forum FAQ | Track this topic


 Last Thread Next Thread 
 Audio Programming on the GameBoy Advance Part 1
Post Reply 
The source zip seems to be missing a main.c file... am I right?

-----
Keep him tied, It makes him well
He''s getting better, Can''t you tell?

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Yes your right, i noticed that too. Also I must be out of the loop but what exactly is a PCM file? I havent heard of that file type before? And can u convert wav's to that file type?

-Shane
p.s. we going to see a music demo too sometime?

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Very good articles,thank you!

 User Rating: 1015    Report this Post to a Moderator | Link

PCM means pulse code modulation. I think it is just a bit stream format for audio data as opposed to a file type.

 User Rating: 1015    Report this Post to a Moderator | Link

What happened to the following articles. I'd really like to read his mixing paper.

 User Rating: 1015    Report this Post to a Moderator | Link

I can't launch the Simon Utility Program. "...VCL50.BPL was not found..."

 User Rating: 1015    Report this Post to a Moderator | Link

Quote:
Original post by Wogan
The source zip seems to be missing a main.c file... am I right?


you're right. it's missing the main.c.
does anyone have this file?

also, the Makefile is broken (you can fix it by replacing spaces in front of the compile lines with TAB)

Did he do his follow up articles? I'd like to read them.

His email is bouncing. :( I guess 6 years of spam would make me close my account too... :)

[Edited by - subatomic on June 24, 2008 9:20:06 PM]

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

ok, I wrote the main.cpp here it is (works just like the original):


#include "sfx.h"
#include "Bullhorn.h"
#include "Gunfire.h"

int main()
{
// video mode4, bg2 on
*(unsigned long*)0x4000000 = 0x403;

// clear screen to black
unsigned short* Screen = (unsigned short*)0x6000000;
u32 y, x;
for(y = 0; y<160; y++) //loop through all y pixels
for(x = 0; x<240;x++) //loop through all x pixels
Screen[x+y*240] = 0;

init_sfx_system();

SAMPLE sample1;
sample1.pData = (char*)BullhornRawAudio;
sample1.length = sizeof( BullhornRawAudio );

SAMPLE sample2;
sample2.pData = (char*)GunfireRawAudio;
sample2.length = sizeof( GunfireRawAudio );

#define MEM_IO 0x04000000
#define REG_CTRLINPUT (*(volatile u16 *)(MEM_IO + 0x130))
#define CTRLINPUT_A_PRESSED (~REG_CTRLINPUT & 0x0001)
#define CTRLINPUT_B_PRESSED ((~REG_CTRLINPUT & 0x0002) >> 1)
while (1)
{
if (CTRLINPUT_A_PRESSED)
{
play_sfx( &sample1 );
}
if (CTRLINPUT_B_PRESSED)
{
play_sfx( &sample2 );
}
}
}


===============
To get this to compile on my devkitadvance R5 beta 3, I had to remove the lnkscript from the makefile:
===============

CFLAGS = -c -O3
MODEL = -mthumb -mthumb-interwork
all : demo01.gba

demo01.gba: demo01.elf
objcopy -O binary demo01.elf demo01.gba


run: demo01.gba
VisualBoyAdvance demo01.gba

sfx.o: sfx.c sfx.h gba.h
gcc $(CFLAGS) $(MODEL) sfx.c

main.o: main.c sfx.h gba.h
gcc $(CFLAGS) $(MODEL) main.c

demo01.elf : main.o sfx.o
gcc $(MODEL) -o demo01.elf main.o sfx.o




http://www.subatomicglue.com

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

All times are ET (US)

Post Reply
 Last Thread Next Thread 
Forum Rules:
You may not post new threads
You may post replies
You may not edit your posts
You may not use HTML in your posts
Jump To:
Administrative Options: