Basic Questions and Answers Thread

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

  1. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    That it. I have the same problem too.

    I've try at 22050mhz, 16000 and 8000...
     
  2. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    Did you export as unsigned 8-bit?
     
  3. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Yes, 8-bit unsigned pcm...

    I put my song for speed shoes = Don't work.

    I put my song for Green Hill (music81) = Don't work.

    (hivebrain 2005)
     
  4. ValleyBell

    ValleyBell Well-Known Member Member

    Joined:
    Dec 23, 2011
    Messages:
    166
    Are you using the correct MegaPCM settings for the sound?
    i.e. use the "pcm" mode if you export as unsigned 8-bit mono OR convert it to DPCM using pcm2dpcm and use the "dpcm" mode.

    Also .. don't you think that a sample rate of 8000 MHz is a bit much? I mean.. that's 1000 times more Hz than what the MegaDrive's main CPU runs at. (7.67 MHz)
     
  5. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Ok, and how can i replace the GHZ song (music81) with my wav pcm/dpcm file?
     
  6. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    417
    Location:
    Town Creek, AL
    I'm gonna set aside the megapcm wav problem for now, but am trying to add Richter's Dagger for Richter Belmont in Sonic 1 (to be renamed later). Which compression is easier to use, opinions, Nemesis, Kosinski or Uncompressed?
     
  7. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    well for Kosinski (assuming you mean Kosinski Moduled) you would have to port the KosM queue from S3K, but even given that, kosM is wastly superior to Nemesis, for decompression speed and space used. Though you have to have 0x1000 bytes for data buffer (You can change this, but this'd mean likely recoding some tools to support smaller heap), and finding that amount of space in Sonic 1, while not impossible, is certainly not the easiest thing. Though it depends entirely on the VRAM space you have free. Could be you dont even have enough space for all the art being compressed and be forced to use DPLC.
     
  8. NiphFM

    NiphFM Host of the Mega Drive Music Contest Member

    Joined:
    Jun 5, 2015
    Messages:
    430
    Location:
    Music Plant Zone
    How could I make the level music fade back in after the drowning music?
     
  9. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    At "Sound_81to9F:" you will find:
    Code:
    Sound_81to9F:				; XREF: Sound_ChkValue
    		cmpi.b	#$88,d7		; is "extra life" music	played?
    		bne.s	loc_72024	; if not, branch
    		tst.b	$27(a6)
    		bne.w	loc_721B6
    		etc...
    
    This routine below will load new BGM tracker information, but the first thing it does, is checks to see if the extra life music is about to play. If it IS about to play, it will backup the currently playing BGM tracker information (storing it somewhere else), before it loads the extra life tracker information. What you need to do, is check for the drowning music ID, and if it is set to play, allow it to run the code below starting at that "tst.b $27(a6)".

    At the bottom of this routine, there is a "move.b #$80,$27(a6)", this will prevent the SFX from playing while the drowning/extra life music is playing, you'll want to remove this, or put in an exception for the extra life jingle.

    Now, the next part would normally be quite simple, it would be the case of just changing the F2 flag inside the drowning music for an E4 flag (this is usually done on the DAC channel). However, you want it to fade in when the music is interrupted, NOT when it's finished. So this is a little more complicated.

    Go to "ResumeMusic:", you will find the following:
    Code:
    ResumeMusic:				; XREF: Obj64_Wobble; Sonic_Water; Obj0A_ReduceAir
    		cmpi.w	#$C,($FFFFFE14).w
    		bhi.s	loc_140AC
    		move.w	#$82,d0		; play LZ music
    		cmpi.w	#$103,($FFFFFE10).w ; check if level is	0103 (SBZ3)
    		bne.s	loc_140A6
    		move.w	#$86,d0		; play SBZ music
    
    loc_140A6:
    		jsr	(PlaySound).l
    
    loc_140AC:
    		move.w	#$1E,($FFFFFE14).w
    		clr.b	($FFFFD372).w
    		rts
    These lines need to be removed:
    Code:
    		move.w	#$82,d0		; play LZ music
    		cmpi.w	#$103,($FFFFFE10).w ; check if level is	0103 (SBZ3)
    		bne.s	loc_140A6
    		move.w	#$86,d0		; play SBZ music
    
    loc_140A6:
    		jsr	(PlaySound).l
    And replaced with:
    Code:
    		lea	($FFFFF044).w,a2			; load BGM tracker address starting from DAC
    		move.l	#StopBGM,d0				; prepare stop BGM value address
    		moveq	#$01,d1					; prepare timer
    		moveq	#($06+$03)-1,d6				; set number of channels (6 FM & 3 PSG)
    		move.l	#RestoreBGM,(a2)			; set DAC tracker address
    		move.b	d1,($0E-$04)(a2)			; set DAC timer to 1
    
    RM_NextChannel:
    		lea	$30(a2),a2				; advance to next channel
    		move.l	d0,(a2)					; set to channel to stop
    		move.b	d1,($0E-$04)(a2)			; set its timer to 1
    		dbf	d6,RM_NextChannel			; repeat for all channels
    Then at the bottom, under the "rts" instruction, place the following:
    Code:
    RestoreBGM:	dc.b	$80,$10,$E4
    StopBGM:	dc.b	$F2
    		even
    This will force all FM and PSG channels to run the "F2" flag next, and will set the DAC channel to rest and delay a short while to allow the splash SFX to play, and then trigger the fade into previous song flag (E4).

    Please note, there are some adjustments to be made, for example, what should happen if you get an extra life while the drowning music is playing, and a few other minor issues here and there. But I'm going to leave you to deal with them, they are not of my interest and may be user specific depending on your needs. Also, I don't like the idea of giving you the solution without you having to work some of it out for yourself d=
     
  10. GenesisDoes

    GenesisDoes What Nintendont Member

    Joined:
    Jan 2, 2016
    Messages:
    159
    Location:
    Pittsburgh, PA
    Quick question: How does one do a bitwise NOT operation in M68k asm?
     
  11. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,020
    You're talking about 'bchg'?
     
  12. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    I think he wants the NOT instruction.
     
  13. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
  14. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    I am getting started with writing a new bugfix that I'd like to share, and I want to show the results from the game, using a GIF file. I am sure to have seen at least once, a GIF file with a few seconds of gameplay from Fusion, that had no quality loss at all. What can be used?
     
    Ashuro likes this.
  15. TheStoneBanana

    TheStoneBanana banana Member

    Joined:
    Nov 27, 2013
    Messages:
    602
    Location:
    The Milky Way Galaxy
    Why not just make a video? I think it'd be easier to show off that way.
     
  16. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    417
    Location:
    Town Creek, AL
    Where in Sonic 1 do I find the shred of code that turns rings yellow? I seen when loaded Into SonMapEd they're red, & for my Richter in Sonic 1 hack I was trying to change the rings into hearts (though need to change HUD)
    also was trying to make another counter for Energy (using shield as energy, 10 hits to die), I changed mappings to have...
    Score (score digits)
    Time (time digits)
    Rings (Rings digits, to be changed)
    Energy (as ENERG) (no digits)
    Seeing as how those digits ain't in the SCORE TIME RINGS HUD art, how would I add Energy's own digits?
     
  17. TheStoneBanana

    TheStoneBanana banana Member

    Joined:
    Nov 27, 2013
    Messages:
    602
    Location:
    The Milky Way Galaxy
    Inside Obj25 (the ring object), look for this line:
    Code:
        move.w   #$27B2,2(a1)
    Bits 13 and 14 of the word here are what set the palette line that the art should use. For reference:
    • 00 = Palette Line 1
    • 01 = Palette Line 2
    • 10 = Palette Line 3
    • 11 = Palette Line 4
    $27B2 in binary is
    0010 0111 1011 0010
    so essentially all you need to do is change that portion I bolded to 00, which results in $27B2 becoming $7B2.
    Modifying the line I showed earlier will set the palette line to 1, and your rings should be then red.
     
    warr1or2 and Devon like this.
  18. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Hi!

    Where is the BG and FG deformation code of Sandopolis Zone act 1 (i want the heat haze effect) in the sonic3k.asm?

    I know that it's not SOZ1_ScreenInit, SOZ1_ScreenEvent and SOZ1_BackgroundInit... But i can't find what i want to find.

    There is another name for the routine?
     
  19. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    Sonic 3 & Knuckles background deformation code is not directly compatible with Sonic 1, as S3K uses a greatly improved and more or less completely rewritten level drawing system, necessitating different way to deal with background scrolling, too. However, skimming through the code I found something interesting that may be what you are looking for: loc_55DF2
     
  20. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Thank you! :D