FBA WIP

GO TO ADMIN PANEL > ADD-ONS AND INSTALL VERTIFORO SIDEBAR TO SEE FORUMS AND SIDEBAR

vbt

Staff member
Joined
Dec 16, 2001
Messages
5,193
Points
63
Age
42
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
 

XL2

Member
Joined
Jul 5, 2017
Messages
172
Points
43
Age
34
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.
 

vbt

Staff member
Joined
Dec 16, 2001
Messages
5,193
Points
63
Age
42
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
 

XL2

Member
Joined
Jul 5, 2017
Messages
172
Points
43
Age
34
Don't sell yourself short, your work is amazing too <3. Both of you are doing great work for homebrew on the Saturn @vbt @XL2
I agree.
Working on an emulator requires more low level programming skills.
It's even more true on rather weak hardware like the Saturn, so it's really amazing that you manage to emulate these games!
 

vbt

Staff member
Joined
Dec 16, 2001
Messages
5,193
Points
63
Age
42
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
 

Ponut

New Member
Joined
Feb 19, 2018
Messages
30
Points
8
Age
24
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

vbt

Staff member
Joined
Dec 16, 2001
Messages
5,193
Points
63
Age
42
Thanks Ponut, i try your pcm streaming function during my holidays !
 

Ponut

New Member
Joined
Feb 19, 2018
Messages
30
Points
8
Age
24
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

vbt

Staff member
Joined
Dec 16, 2001
Messages
5,193
Points
63
Age
42
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 ?
 

vbt

Staff member
Joined
Dec 16, 2001
Messages
5,193
Points
63
Age
42
i'll never complete it but it boots :

 
Top