FBA WIP

finally something new :

upload_2018-4-29_16-19-45.png
 
Good job! Did you get the audio working?
on this game not yet but i'm still checking your post (really useful:bigthumb:) about sequences and try to replace my 7 pcms
but i have around 68 sfx and must play the same one multiple times + i'm still not yet a master with the sond map, it progress slowly :)

I started side arms to change my mind, too many time spent on sound, some special stuff to study on this driver :
- map size of 4096x4096
- tiles of 32x32
- stars field layer

upload_2018-5-2_2-9-19.png
 
on this game not yet but i'm still checking your post (really useful:bigthumb:) about sequences and try to replace my 7 pcms
but i have around 68 sfx and must play the same one multiple times + i'm still not yet a master with the sond map, it progress slowly :)

I started side arms to change my mind, too many time spent on sound, some special stuff to study on this driver :
- map size of 4096x4096
- tiles of 32x32
- stars field layer

View attachment 4566
In fact, you can play more than 16 sounds, you just need to do a voice change command.
The sound command seems to be only transfered during v-blank, which is why doing a voice change let me use max 16 sounds for 1 frame, but it didn't stop the sounds from the last frames, so unless you play 2 sounds from 2 different voices at the exact same frame you won't hear any problems.
In other words, it's a rather minor issue with the implementation I suggested, but I think it could be improved upon and fully fixed.
 
i've finally added the starfield, it's a bit simplified comparing to fba pc, i've gave up with sprite priorities. i use simplay nbg0 as 4bpp bitmap layer 512x256 and with scrolling sypport. I can return to midi/pcm

upload_2018-5-27_22-50-23.png
 
i'm still spending time on pcm streaming, did someone allready try it ? i previously wrote there are some troubles with pcm loops. there is a similar system with the stm library, but again it does nothing :

STM_SetLoop(grp, STM_LOOP_DFL, STM_LOOP_ENDLESS);

this function has no effect on streaming loop. the only "working" (sometimes it fails is this :

PCM_INFO_FILE_SIZE(&info) =file_size * nb_loops
 
I have a PCM streaming function. You could spend some time to manually program a looping function here. There are also some other abstractions included that relate to XL2's work. Also, a direct-to-sound-driver PCM sound effect playback.
It is tuned specifically for 30.72 KHz mono PCM sound. WHY: A single frame is a single sample, at 2048 bytes.
Sound effects could be tuned for any rate, but as it stands it is 30.72 and 15.36 (2048 bytes per frame or 1024, at 30 fps).

Note this is a "big" demo project. When running it, hit C first and watch the top left indicator (started or stopped). When it says started, stop hitting C immediately, wait until it says stopped. This is a file loading indicator. You also cannot hit D-pad left or right until the model file has loaded (you will see it when you stop moving). But you are more interested in the code.

To add loops, you would set play_ref to zero when you reach EOF and inject a break at that point to re-open the file at zero sectors.

This also isn't perfect, nor is it done: obviously, music loops and changing music file are important features that I haven't gotten to yet.
There are, at points, static injected into the PCM music. I have set-ups where this does not happen, but trust me, you don't want those. I've no idea why the PCM music gets static.
This also directly allocates regions of sound memory that other development libraries might be using. I know, for instance, SGL will NOT behave if you try to use it with this.

The file you want to look at for all PCM stuff is msfs.c (master sound & file system).
http://www.mediafire.com/file/nnzs2zadne94bfz/sharevbt.zip/file

Addendum: Why would I do this by manually sending commands to sound CPU and manually dictating a stream with GFS_NwFread?
Simple: I cannot for the life of me get SBL to work properly. So I do things my way.
 
Last edited:
  • Like
Reactions: vbt
Here's a loop condition, it was a little more complex than I thought. You'd need it !
You can CTRL+F to the first "if" statement in this quote and replace that whole chunk with this.
Code:
    if(play_ref < nsct_m){
    m_trig = true;
    } else if(play_ref >= nsct_m){
    m_trig = false;
    slSoundRequest("b", SND_PCM_STOP, 0);
        buffers_filled = 0;
        fetch_timer = 0;
        mrd_pos = 0;
        buf_pos = 0;
        music_frames = 0;
        play_ref = 0;
    break;
    }

You could also set a new file-name there and initialize the filename variable globally !
 
  • Like
Reactions: vbt
thanks ponut for the sources, i still have to convert it to SBL.
i'm bored with sound, so i'd prefer to start another driver :

- Sega Kyugo
or
- UPL Ninja kid 2

which one to port first ?
 
Back
Top