Basic Questions and Answers Thread

Discussion in 'Discussion & Q&A' started by Malevolence, Jul 7, 2009.

  1. NiphFM

    NiphFM Host of the Mega Drive Music Contest Member

    Joined:
    Jun 5, 2015
    Messages:
    430
    Location:
    Music Plant Zone
    Where should I put
    Code:
    moveq   #$FFFFFFA1,d0 ; A1 is the sample I am using
    jsr     PlaySample
    
    ?
    I tried putting it before the act music loads backup, but the sample doesn't play and every other DAC sample afterwards does not play.
     
    Last edited: Jun 1, 2016
  2. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Can you show me your code?
    Maybe i can help you...

    Maybe you have to make a new label to make this work.

    EDIT: I have a question me too.

    When i held C button ($FFFFF604), a song ($BE) is played everytime, but i want to play it only one time, and play it again only if i held C again.
    I have to create a new label only for the jsr (playsound) or there is a flag?
     
    Last edited: Jun 1, 2016
  3. Devon

    Devon I'm a loser, baby, so why don't you kill me? Member

    Joined:
    Aug 26, 2013
    Messages:
    1,376
    Location:
    your mom
    A-S-H: You would put it in a routine in a boss object when Robotnik gets defeated. You could add it when he starts moving away after his defeat.

    Ashuro: You can use $FFFFF605, which is used for testing if a button has been pressed, but not held.
     
  4. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Ok thanks, but i want to make the ability continue when i'm holding C but play the sound 1 time per push? (sorry if you don't understand) :confused:
     
  5. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    check for push specifically before you play a sound, but have the ability itself check for held state instead.
     
  6. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Last edited: Jun 2, 2016
  7. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    The loopnums only work for SLZ and GHZ. Any other zone is ignored. You need to edit the actual routine that deals with loops to allow MZ as well use loops.
     
  8. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Ok thanks, what is the routine? (hivebrain 2005)

    EDIT 1: Sorry, i've found: Sonic_Loops:

    EDIT 2:

    I have changed this:
    Sonic_Loops: ; XREF: Obj01_Control
    cmpi.b #3,($FFFFFE10).w ; is level SLZ ?
    beq.s loc_13926 ; if yes, branch
    tst.b ($FFFFFE10).w ; is level GHZ ?
    bne.w locret_139C2 ; if not, branch

    To this:

    Sonic_Loops: ; XREF: Obj01_Control
    cmpi.b #3,($FFFFFE10).w ; is level SLZ ?
    beq.s loc_13926 ; if yes, branch
    cmpi.b #2,($FFFFFE10).w ; is level MZ ?
    beq.s loc_13926 ; if yes, branch
    tst.b ($FFFFFE10).w ; is level GHZ ?
    bne.w locret_139C2 ; if not, branch

    Thaht it's good?
     
    Last edited: Jun 2, 2016
  9. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    try it out and see what happens. It does look right
     
  10. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Don't work.
    Since 1 hour, i try to edit this routine but all my tries no longer work..
     
  11. Painto

    Painto Arthurus Paintus Erinaceus Member

    Joined:
    Mar 24, 2014
    Messages:
    321
    Location:
    Lublin, Poland
    Maybe the loop chunks aren't made properly?
     
  12. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    I've changed the loop chunks and it's working.
    But damn, i'm forced to do "standard" chunks like starlight or green hill...
    Maybe that the limit of 256x256 chunks...
     
  13. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    417
    Location:
    Town Creek, AL
    Question concerning MegaPCM
    I know that for wavs it does 8 bit wav sound. Anyone know a utility of converting 16 bit wav to 8 bit. Or should I record to 8 bit?
     
  14. vladikcomper

    vladikcomper Well-Known Member Member

    Joined:
    Dec 2, 2009
    Messages:
    415
    warr1or2, there are many good sound editors that also allow you to convert sounds between many popular formats. I may suggest Audacity (freeware) or GoldWave (shareware, but you can use it free for decently long time, if you don't do much sound editing).

    But if you need to convert 16-bit PCM to 8-bit specifically, you can even do it by hand.
    Just open your WAV file in a hex-editor, remove first $3A bytes (the header), then remove every odd byte (for Big-Endian 16-bit PCM) or every even byte (for Little-Endian PCM). If you had 16-bit signed PCM (most of the cases, I presume), you'd want to add $80 to every byte as well.
    You'll end up with headerless 8-bit PCM file. Give it *.raw extension to avoid confusion.
     
    Painto likes this.
  15. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    I would like to clarify here, that some .wav samples do not start their sample data at offset $3A, most do, at least the ones that don't try to patch in additional (and in my opinion, useless) information, but there are some rare cases where the information is forced in, and so, what you'd want to look for is the "data" string, bytes 64 61 74 61, following this is a long-word which is the size, followed by the actual wave data itself.

    I find though that Window's original sound recorder (not the shitty Vista+ one), always causes the data to start at $3A when converting the sample to 8-bit mono, and as far as I'm aware, Audacity does too. So you'd be safe using those.

    As for GoldWave, iirc, someone used it to convert a sample to 8-bit just as vlad mentioned, except it patched extra string data on the end of the file to indicate the tool that was used, while this has no effect on the wave format itself, as the long-word size prevents tools from reading passed the "true" end, it is in there, and may cause a clipping noise for your project (not getting into details why here) if not removed.
     
    vladikcomper likes this.
  16. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Is it possible to do the same thing for the background?
    I want to make blink the eyes of my Pyramid Trap background.
     
  17. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,020
    Yes? That particular implementation revolves around sending art to VRAM. Art used in the background is the same as in the foreground. You just edit the background chunks instead of the foreground chunks.
     
  18. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    417
    Location:
    Town Creek, AL
    The wav file I'm wanting to use is from Castlevania SOTN on PSX

    the one where Richter uses his upward slash. I recorded mine on audacity, but was 16 bit wav.
    (I'm on my android tablet, can't upload sound yet)
     
  19. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    I want to implement custom music too, with MegaPCM, using some wav pcm 8 bit unsigned files, but don't work for me. If you have the issue, post it here! :D
     
  20. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    417
    Location:
    Town Creek, AL
    I tried the sound file from the rar in the link in the video's description.
    The problem is, hearing static sound instead of the sound. I set audacity to export wav in 8000 MHz. I'm wanting to say in using wrong encoding, not sure