Basic Questions and Answers Thread

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

  1. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,016
    Stop. Nagging.
     
    Soldaten likes this.
  2. Kurk

    Kurk Oh Yeah Member

    Joined:
    Jul 30, 2016
    Messages:
    99
    Location:
    Kurkistan
    I have a question. I have extended the music index in sonic 1 and i have added the appropriate include code after kos780, but it still gives me an illigal instruction. Any help?
     
  3. Animemaster

    Animemaster Lets get to work! Member

    Joined:
    Mar 20, 2009
    Messages:
    1,229
    Location:
    UK
    You mean it gives you an error when you play on the new music slot? have you included the music file for that slot? normally if say for example "94" is selectable but you have no file for it, it has nothing to play hence the error.
     
  4. Kurk

    Kurk Oh Yeah Member

    Joined:
    Jul 30, 2016
    Messages:
    99
    Location:
    Kurkistan
    I do have the .bin file for music 94 in there.
     
  5. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    The problem is that you're setting the flag that stops the code from running when you run the code, resulting in this line:
    Code:
            bsr.w   SpeedToPos
            addi.w  #$01,$12(a0)       ; Apply less gravity
    only working once before the character hits the ground. You need this code to be branched to when $FFFFFFC4 is set instead of when it isn't. The branch to it should come before it checks if C is held so it doesn't only working if you're holding C. Basically, it should look something like this:
    Code:
    RoutineRandom:
            tst.b    ($FFFFFFC4).w    ; was falling slow flag set?
            bne.s    SlowFallDo    ; if not, branch
            btst    #5,($FFFFF604).w ; is C not held?
            beq.s    SlowFallEnd    ; if not, branch
            move.b    #1,($FFFFFFC4).w    ; set falling slow flag
            move.b    #$29,$1C(a0)    ; use "falling slow"    animation
            bclr    #4,$22(a0)    ; clear falling slow flag
    
    SlowFallDo:
            bsr.w   SpeedToPos
            addi.w  #$01,$12(a0)       ; Apply less gravity
        
    SlowFallEnd:
            rts
    This code should near ObjectFall and should be modified so when the character isn't falling it will branch to the code for using regular gravity instead.
    Look at how all the other the other music files are loaded and make sure music94.bin does the same thing. You can pretty much just copy and paste all the lines of code that have to do specifically with music93.bin/Music93 and change the 93 to 94. I remember back when I followed the guide and I got the same problem because the game wasn't able to load the file. This should fix it.
    I don't really have enough information to help. It could be a number of issues. My suggestion is to keep looking. Try looking at all the places that branch to Sonic_Roll and see if there are any problems there. Look at the flags that are set when Sonic rolls like bit 2 of $22(a0).
     
    Last edited: Aug 4, 2016
  6. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Oh, i have understand, i'll do this.
     
  7. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    Hey, it's me again. I just want to ask again. Can I do anything about the special ring? is there any way to make them go into special stages without having to go pass the goal sign? and can I make the special stages bring me back to the levels and not to the next one like kind of like in Sonic 3?
     
  8. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,016
    Of course there's a way. The only limitation is hardware, so there's nothing stopping you from imitating what S3 did. What the ring probably normally does is set a flag, or delete the Sonic object, and that's all. The end-of-act results object probably checks this flag, or if Sonic's been deleted, and goes to the special stage instead of the next level. The idea to replicate S3's ring is to make the ring object handle the 'going to special stage' bit instead. Making the player properly return to the level is much more involved: you'd have to make the ring behave like a checkpoint, by saving Sonic's location, ring count, and other data, and then having this data restored when Sonic leaves the special stage.
     
    Soldaten likes this.
  9. breakthetargets

    breakthetargets Well-Known Member Member

    Joined:
    Aug 6, 2009
    Messages:
    180
    I'm using MegaPCM, specifically the 1.1 version with the increased Playback Quality, and I am wondering why PCM samples above 16Khz sounds muffled within Sonic 1 compared to the .wav files in the DAC folder, especially 32Khz. Here is an example of Mega Turrican percussion in 16Khz vs 32Khz.

    I privated the SoundCloud uploads since I know what's up now.

    The .wav files used above are originated from the same samples. I also tried the 32Khz .wav(s) in DefleMask and they sound pretty clear compared to the ones in Sonic 1.

    If this information is needed, The original Mega Turrican samples were recorded in 44.1Khz (yes, I know that is over what the DAC could do) and were converted into playable PCM format through Wavosaur.

    It's not that big of a deal, but I would love to know the technical details behind this.
     
    Last edited: Aug 9, 2016
  10. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    Where does Sonic 1 deal with animating the special stage's red and white blocks and the goal blocks? There is only one entry for each in the Mappings and VRAM list.
     
  11. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    This is definitely a shot in the dark, but have you checked to see if it's done by palette cycling? That seems like the simplest way to create those effects.
     
  12. Dragon Wolf Leo

    Dragon Wolf Leo Wha- I'm not doing ANYTHING! Member

    Joined:
    Mar 29, 2011
    Messages:
    34
    Location:
    Texas
    It seems it's done in the subroutine SS_AniWallsRings
     
    ProjectFM likes this.
  13. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    @Ozaleto MegaPCM or the YM2612 are not capable of DAC playback >26khz. In fact, I am willing the bet MegaPCM is not even capable over 22khz (and if this is wrong, do correct me Vladik). You simply cant stick 32khz sample and expect it to play well at all (also, its very wasteful for the space; you really do not need >20khz playback for anything but speech or really complex samples). Also its good to mention that MegaPCM also uses a pitch for playback, and this needs to be adjusted accordingly. The reason everything is muffled is because the sample is actually played back too slowly, so its longer, and the muffling effect is partially up to the sample itself, and the fact that it isn't played in the correct speed.
    Side note, I have had a driver code that is capable up to 32khz playback (mind, the driver has NO other features than playback. No stopping when done, no pause, none.), and it really sounds NO different to 26khz and only very slightly different to 16khz. But you know whats the difference? File size. 32khz is IIRC twice more data than 16khz, and this adds up quickly with many samples. Sonic Team actually used quite low sample rate samples in Sonic 1. Why Mega Turrican used 44khz, is likely because it was on the Amiga. Amiga had a dedicated sound chip that ONLY played 4-channel DAC audio, and was designed to just that task, so this is likely why it was able to have so superior audio. The downside? Large files for music. Few hundred kilobytes per song, vs the few kilobytes of DAC + another few kilobytes of SMPS for Sonic games.
     
    breakthetargets and Pacca like this.
  14. breakthetargets

    breakthetargets Well-Known Member Member

    Joined:
    Aug 6, 2009
    Messages:
    180
    @Natsumi Thanks for the information, appreciate it. The YM2612's DAC can actually play up to ~27Khz samples, but that's just one up from 26 Khz which is what you said. From what I read, MegaPCM is capable of playing PCM samples at ~30Khz and DPCM samples at ~32Khz (should had probably uploaded a 30Khz version or at least converted my 32Khz PCM into DPCM..., but the last time I used 30Khz, it was basically the same result as the 32Khz but less muffled.) I should had really tested changing the pitch in MegaPCM, which is all my fault.

    I understand more now, so basically the driver used to playback tracked songs in DefleMask was made for the specific purpose of playing music, which is why it allows 32Khz. If a game was added on top to that driver, it would have to be changed to a lower sample rate.

    Also, Mega Turrican is on the Sega Genesis. Turrican 3 is the Amiga port (and the percussion sounds much different). Actually fun fact about Mega Turrican, it has a built-in software mixer that allows for 2 PCM channels at once. Pretty crazy knowing how technical that game is in other aspects. Well back onto what I saying, Mega Turrican's percussion actually wasn't originally 44.1 Khz, but the way the guy who recorded the samples made it 44.1 Khz. It's due to the fact that he didn't rip it straight from the game. He recorded an emulator playing at 44.1 Khz and muted all the channels besides the DAC. Pretty inefficient. I'm pretty sure Mega Turrican's samples actually are at the ~22Khz range, but I'm not that sure. I'll probably check the actual sample rate later.

    Yeah, I should probably start considering the size of the files now. Thanks for the information!
     
    Last edited: Aug 8, 2016
  15. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    Just so you all know, it's "kHz". The "k" meaning "kilo" (e.g. 1000) must be written lowercase, as "K" is reserved for "Kelvin", whereas "Hz" always had an uppercase "H", as it (almost) always happens when a measure unit is named after someone (in this case Heinrich Hertz).
     
  16. breakthetargets

    breakthetargets Well-Known Member Member

    Joined:
    Aug 6, 2009
    Messages:
    180
    I actually feel a bit dumbfounded now knowing that I have been typing kHz wrong for basically years now. At least I wont make that mistake for now on. Thanks for the heads up.
     
    nineko likes this.
  17. Kurk

    Kurk Oh Yeah Member

    Joined:
    Jul 30, 2016
    Messages:
    99
    Location:
    Kurkistan
    I have 2 Questions.

    1. Does anyone have Knuckles Chaotix Music with Percussion? Markey's Chaotix to Smps converter Ports the songs without precussion.

    2. Is this the right place to ask about this?
     
  18. GenesisDoes

    GenesisDoes What Nintendont Member

    Joined:
    Jan 2, 2016
    Messages:
    159
    Location:
    Pittsburgh, PA
    The Knuckles' Chaotix sound driver uses the power of the mighty Sega 32x's hardware PWM channel to software-mix 4 PWM percussion channels, while the sound driver for the classic Sonic games on the Genesis only use a single hardware DAC channel for percussion. If nobody else has it, your best bet would be to either port the Chaotix music by hand and merge the 4 PWM channels into one DAC channel, or to port over the Sonic Crackers songs (or see if anybody has those). Check out the information at SonicRetro's SCHG Music Hacking Guide for information on porting the music.
     
  19. jubbalub

    jubbalub Mania fanboy Member

    Joined:
    Dec 25, 2014
    Messages:
    286
  20. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759