|
||||||||||||||||||
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 |
|
![]() Wogan Member since: 2/14/2001 From: Australia |
||||
|
|
||||
| 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? |
||||
|
||||
![]() Codejoy Member since: 5/25/2001 From: USA |
||||
|
|
||||
| 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? |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| Very good articles,thank you! |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| PCM means pulse code modulation. I think it is just a bit stream format for audio data as opposed to a file type. |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| What happened to the following articles. I'd really like to read his mixing paper. |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| I can't launch the Simon Utility Program. "...VCL50.BPL was not found..." |
||||
|
||||
![]() subatomic Member since: 6/24/2008 From: Chicago |
||||
|
|
||||
Quote: 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] |
||||
|
||||
![]() subatomic Member since: 6/24/2008 From: Chicago |
||||
|
|
||||
| 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 |
||||
|
||||
All times are ET (US)![]() |
Last Thread Next Thread ![]() |
|