• Rise from your gwave!

FBA WIP

Discussion in 'Saturn Dev' started by vbt, May 30, 2010.

  1. vbt

    vbt Staff Member

    finally something new :

    upload_2018-4-29_16-19-45.
     
    cafe-alpha, ROS and SegaSaturnShrine like this.
  2. XL2

    XL2 Member

    Good job! Did you get the audio working?
     
  3. vbt

    vbt Staff Member

    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.
     
    mrkotfw, SegaSaturnShrine and XL2 like this.
  4. XL2

    XL2 Member

    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 and SegaSaturnShrine like this.
  5. mrkotfw

    mrkotfw Member

    Does FBA work on hardware?
     
  6. Yes it does. I'm able to run it on my model 2 Saturn with a modchip in it :)
     
  7. vbt

    vbt Staff Member

    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.
     
    SegaSaturnShrine and XL2 like this.
  8. XL2

    XL2 Member

    Amazing work!
     
    SegaSaturnShrine likes this.
  9. vbt

    vbt Staff Member

    Thanks, well not as good as yours with Sonic Z-Ttreme.
     
  10. 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
     
    XL2 likes this.
  11. XL2

    XL2 Member

    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!
     
    SegaSaturnShrine likes this.
  12. vbt

    vbt Staff Member

    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
     
  13. Ponut

    Ponut New Member

    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: Jul 29, 2018
    vbt likes this.
  14. vbt

    vbt Staff Member

    Thanks Ponut, i try your pcm streaming function during my holidays !
     
    Ponut likes this.
  15. Ponut

    Ponut New Member

    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 !
     
    vbt likes this.
  16. vbt

    vbt Staff Member

    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 ?
     
  17. vbt

    vbt Staff Member

    i'll never complete it but it boots :

    [​IMG] [​IMG]
     
  18. vbt

    vbt Staff Member

    new picture but i'm not really hopeful to see it completed

    [​IMG]
     
    XL2 and SegaSaturnShrine like this.
  19. XL2

    XL2 Member

    Keep up the good work!
     

Share This Page