#132312 - ThousandKnives - Mon Jun 25, 2007 8:37 pm
Hi. I'm brand new to this forum, I only started GBA programming in c++ about 10 days ago, although I've done a lot of DirectX programming previously and have some experience with assembly. I've managed to get my arms around graphical basics and have a simple tile-based 2D sidescroller set up in Mode 0. It is a re-creation of a game I originally made on DirectX many many years ago for a 72-hour contest (placed 2nd at the time).
In setting up the audio, I've been using several tutorials but have yet to find any of them that is really helpful. I am having two problems with audio playback. For now I only want to touch on one problem as they are very different issues and this one doesn't actually have all that much to do with audio, which is why I'm putting it in the general forum.
The issue comes when inserting the audio data into the program. I am using a combination of wav2gba and bin2c to create header files for each of the sound files (I am deficient at the intricacies of linking bins, so thats why I use the headers). The sound files are each 22kHz 8-bit mono PCM and I had no problem creating the headers by using those tools.
The code looks well formed afterward and the 20 files total 1.18 MB as source. When specifying outputs I made sure that the data structures were prefixed with "SFX" so there was no possibility of overwriting any variable names. The code compiles without an error or warning at any rate. When including all of these files in the compile the ELF file ends up at 3.08MB and the GBA at 729 KB (the GBA file is 506KB without the audio headers).
The trouble starts when I am including the headers that hold the audio data. Including one or two of them causes no distress, but after including three or more of these headers, things start to go wonky with the graphics in Mode 0. (the title screen is in mode 4 and behaves normally). Sprite graphics are all correct, as are the tiles stored in char block 1 (mostly) - but not those stored in char block 0. Although, somehow the tiles positions for screen map 29 (which referenced char block 0) appear OK.
I know that the audio data is there and is correct because even though there are these graphics issues, when I try to play one of the sounds it plays properly (somewhat- thats my other problem I will get into sperately).
Note that these problems appear after merely uncommenting the include files for the DATA. I am not actually USING any of the data for any reason at this point.
The results are from VisualBoy Advance, not running on hardware.
Is there some kind of limitation I'm running into here that I should be aware of? I am baffled by this problem and could use some suggestions on where to even begin looking for the problem & solution. I can give more data but as I'm not even sure where the source of this problem lies I'm uncertain what data to give.
Thanks for any help in advance.
-Paul
In setting up the audio, I've been using several tutorials but have yet to find any of them that is really helpful. I am having two problems with audio playback. For now I only want to touch on one problem as they are very different issues and this one doesn't actually have all that much to do with audio, which is why I'm putting it in the general forum.
The issue comes when inserting the audio data into the program. I am using a combination of wav2gba and bin2c to create header files for each of the sound files (I am deficient at the intricacies of linking bins, so thats why I use the headers). The sound files are each 22kHz 8-bit mono PCM and I had no problem creating the headers by using those tools.
The code looks well formed afterward and the 20 files total 1.18 MB as source. When specifying outputs I made sure that the data structures were prefixed with "SFX" so there was no possibility of overwriting any variable names. The code compiles without an error or warning at any rate. When including all of these files in the compile the ELF file ends up at 3.08MB and the GBA at 729 KB (the GBA file is 506KB without the audio headers).
The trouble starts when I am including the headers that hold the audio data. Including one or two of them causes no distress, but after including three or more of these headers, things start to go wonky with the graphics in Mode 0. (the title screen is in mode 4 and behaves normally). Sprite graphics are all correct, as are the tiles stored in char block 1 (mostly) - but not those stored in char block 0. Although, somehow the tiles positions for screen map 29 (which referenced char block 0) appear OK.
I know that the audio data is there and is correct because even though there are these graphics issues, when I try to play one of the sounds it plays properly (somewhat- thats my other problem I will get into sperately).
Note that these problems appear after merely uncommenting the include files for the DATA. I am not actually USING any of the data for any reason at this point.
The results are from VisualBoy Advance, not running on hardware.
Is there some kind of limitation I'm running into here that I should be aware of? I am baffled by this problem and could use some suggestions on where to even begin looking for the problem & solution. I can give more data but as I'm not even sure where the source of this problem lies I'm uncertain what data to give.
Thanks for any help in advance.
-Paul