Basic Questions and Answers Thread

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

  1. Trickle

    Trickle Newcomer Member

    Joined:
    Jan 18, 2018
    Messages:
    11
    Awesome guys, thanks a lot!

    [​IMG]
     
    RouRouRou likes this.
  2. Deactivated Account

    Deactivated Account Well-Known Member Exiled

    Joined:
    Aug 26, 2016
    Messages:
    244
    There are a solution about bugs in Sonic 1 driver? I mean, when especially there are songs with FM Drums e.g, the 1UP jingle or Hurt Spike SFX interrupts some channels, I have a trouble with songs with FM Drums, seems to be the channels 5 and 6 disappear when "the 1UP jingle or Hurt Spike SFX" sounds in game.
    I need help with that and I'm using Sonic 2 Clone Sound Driver in my hack.
    Thanks in advice.
     
  3. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    The higher numbered channels have a lower priority, so they are more likely to be replaced when a sound effect is playing. You want to put the parts more important to your song in the lower numbered channels. Channel 6 is the exception because it is replaced with DAC in most songs so sound effects never use that channel. The 1UP jingle is its own separate piece of music and the level music fades in afterward.

    An additional note, PSG1 has lower priority than PSG2.
     
    Deactivated Account likes this.
  4. Deactivated Account

    Deactivated Account Well-Known Member Exiled

    Joined:
    Aug 26, 2016
    Messages:
    244
    SFX Hurt Spike also interrupts the FM 6 "FM Drums" whereby, I never understood which was the reason than that bug is still presents.
    Special Stage not use DAC, but I remember than there was a tutorial for this problem but for old disassembly "Sonic 1 2005 Hivebrain disassembly". I wanted to fix that bug in MegaPCM driver and S1HS "S1 Hacking Studio" the labels and subroutines was deleted. I don't know if in present there are a method or some help for fix that bug, I'm able to pick up any suggestions for that (unless someone recommend me use other sound driver for fix that).
     
  5. ValleyBell

    ValleyBell Well-Known Member Member

    Joined:
    Dec 23, 2011
    Messages:
    166
    To be correct, there is no "priority" for channels used by sound effects. It's just that certain SFX play on certain channels.
    The ring effect for example plays on FM 4/5. "Jump" plays on PSG 1 and the skidding sound effect plays on PSG 2+3.
    Channels that are safe to use are FM 1, 2 and 6. (FM 6 only if you don't use the DAC.) FM 3 isn't occupied by SFX too often. FM 4/5 and all PSG channels are commonly used by SFX.

    There are no SFX that play on FM 6 (the sound driver doesn't support SFX on FM 6) - maybe you accidentally put the drums on another FM channel?

    If you want to fix the DAC/FM 6 bugs, you should probably look at this Sonic Retro wiki page. (I also once made a topic that has 2 of the 3 fixes from the wiki page and fixes for various other bugs.)
     
  6. Deactivated Account

    Deactivated Account Well-Known Member Exiled

    Joined:
    Aug 26, 2016
    Messages:
    244
    Yes that's the tutorial, but in MegaPCM and Sonic 2 Clone Sound Driver was deleted some codes and I can't fix that, this is not a lazyness, no, only just I told here that issue. And it's true Sonic 1 don't use FM 6 FM Drums, I put the FM Drums in channel 1 or 2 and bass in channel 3, but seems to be when the fade out in 1up sounds or SFX Hurt Spikes, the channel 5 and 6 is missing and I don't know how to fix that bug in those drivers.
    Sorry for bother again, but that tutorial is for old disassembly "Sonic 1 2005 Hivebrain disassembly", I guess.

    Edit: Testing the SFX Hurt Spikes or SFX Hurt not problem, the FM5 is the issue when fade out sounds from the 1UP jingle.
     
    Last edited: Nov 7, 2018
  7. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    I got a little question about bits. Ss there a simple, preferably one-line way I can mirror an entire byte? So for example:

    1100 0010 ($C2) becomes 0100 0011 ($43)

    Apart from using individually bit shifting every single byte into a register and then anding it, I didn't see a more straight forward solution. I know I can use ror to swap the nybbles, but then I'd still have to individually swap the four bits in one, so there's no real gain.
     
  8. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    As far as I'm aware, there is no simple one instruction way by default. Here are a few ideas though...

    The quickest way would probably be (keep in mind the upper byte of d0's lower word must be cleared 0000XX00):
    Code:
    		move.b	Array(pc,d0.w),d0
    
    
    Array:		dc.b	$00,$80,$40,$C0,$20,$A0,$60,$E0,$10,$90,$50,$D0,$30,$B0,$70,$F0
    		dc.b	$08,$88,$48,$C8,$28,$A8,$68,$E8,$18,$98,$58,$D8,$38,$B8,$78,$F8
    		dc.b	$04,$84,$44,$C4,$24,$A4,$64,$E4,$14,$94,$54,$D4,$34,$B4,$74,$F4
    		dc.b	$0C,$8C,$4C,$CC,$2C,$AC,$6C,$EC,$1C,$9C,$5C,$DC,$3C,$BC,$7C,$FC
    		dc.b	$02,$82,$42,$C2,$22,$A2,$62,$E2,$12,$92,$52,$D2,$32,$B2,$72,$F2
    		dc.b	$0A,$8A,$4A,$CA,$2A,$AA,$6A,$EA,$1A,$9A,$5A,$DA,$3A,$BA,$7A,$FA
    		dc.b	$06,$86,$46,$C6,$26,$A6,$66,$E6,$16,$96,$56,$D6,$36,$B6,$76,$F6
    		dc.b	$0E,$8E,$4E,$CE,$2E,$AE,$6E,$EE,$1E,$9E,$5E,$DE,$3E,$BE,$7E,$FE
    		dc.b	$01,$81,$41,$C1,$21,$A1,$61,$E1,$11,$91,$51,$D1,$31,$B1,$71,$F1
    		dc.b	$09,$89,$49,$C9,$29,$A9,$69,$E9,$19,$99,$59,$D9,$39,$B9,$79,$F9
    		dc.b	$05,$85,$45,$C5,$25,$A5,$65,$E5,$15,$95,$55,$D5,$35,$B5,$75,$F5
    		dc.b	$0D,$8D,$4D,$CD,$2D,$AD,$6D,$ED,$1D,$9D,$5D,$DD,$3D,$BD,$7D,$FD
    		dc.b	$03,$83,$43,$C3,$23,$A3,$63,$E3,$13,$93,$53,$D3,$33,$B3,$73,$F3
    		dc.b	$0B,$8B,$4B,$CB,$2B,$AB,$6B,$EB,$1B,$9B,$5B,$DB,$3B,$BB,$7B,$FB
    		dc.b	$07,$87,$47,$C7,$27,$A7,$67,$E7,$17,$97,$57,$D7,$37,$B7,$77,$F7
    		dc.b	$0F,$8F,$4F,$CF,$2F,$AF,$6F,$EF,$1F,$9F,$5F,$DF,$3F,$BF,$7F,$FF
    The most cost effective way would probably be:
    Code:
    	lsr.b	#$01,d0
    	addx.b	d1,d1
    	lsr.b	#$01,d0
    	addx.b	d1,d1
    	lsr.b	#$01,d0
    	addx.b	d1,d1
    	lsr.b	#$01,d0
    	addx.b	d1,d1
    	lsr.b	#$01,d0
    	addx.b	d1,d1
    	lsr.b	#$01,d0
    	addx.b	d1,d1
    	lsr.b	#$01,d0
    	addx.b	d1,d1
    	lsr.b	#$01,d0
    	addx.b	d1,d1
     
    Selbi likes this.
  9. Tanman Tanner

    Tanman Tanner Well-Known Member Member

    Joined:
    Dec 23, 2016
    Messages:
    116
    Location:
    Buffalo, New York
    It's stupid question time - or a good question time, depending on if it hasn't been asked before:
    What exactly would make a Genesis ROM Hack become a 32X ROM Hack?
    I'm asking this question code wise, in the instance of Sonic 2 (Github Version) for example. Would I need a different compiler to make it into a 32X game? Would I need follow-up ASM code that makes it compile properly as a 32X game and not a Genesis game? If so, what am I looking at exactly in the case of Sonic 2?
    I'm simply asking since I want to fully utilize the Sonic 2 Clone Driver's capabilities on Sonic 2 (Github Version) and because I thought it'd be a good challenge to undertake, but I'm not sure how to exactly go from Genesis to 32X, since I've only done a Master System ROM Hack of Sonic 2 SMS and a basic Sonic 3 (& Knuckles) ROM Hack.
     
  10. Devon

    Devon Down you're going... down you're going... Member

    Joined:
    Aug 26, 2013
    Messages:
    1,372
    Location:
    your mom
    You'd need to do a number of things. One of which being getting the MARS initialization code implemented at $3F0 in the ROM. The 32X also uses bankswitching for the ROM, with the first bank being located at $880000 and another 4 swappable banks at $900000, so you'd need to take that into account. You'd also need a master and slave SH-2 program to run along with the 68000 code. You could take a look at the dummy 32X program in the Clone Driver's GitHub, but I'm unsure of how well it works, to be honest. That's what I know that got a 32X ROM booting at least.
     
    Last edited: Nov 16, 2018
    EMK-20218 likes this.
  11. RouRouRou

    RouRouRou Ain't no fun if the aliens can't have none. Member

    Joined:
    Nov 20, 2016
    Messages:
    97
    I want to import art into S1 via SonLVL as some others have done, but I don't know where to.

    I am using an old version of SonLVL (I work with S1 Hivebrain keep in mind.) but I've seen people import art around the same time that the tool would be dated.

    Any answers will be appreciated.
     
  12. EMK-20218

    EMK-20218 The Fuss Maker Exiled

    Joined:
    Aug 8, 2008
    Messages:
    1,067
    Location:
    Jardim Capelinha, São Paulo
    Guys, I'm running into a little problem with Sonic 1. Does Sonic 1 have any kind of limitation of how many object IDs we can include in the game? I coded an object and it's its ID is object $8F. I added its pointer to the "Object Pointers.asm" file and added everything from the object (the code itself, the data were included and etc) and I placed my object $8F in my level. But when I play the level I notice that the object $0F is being loaded on its place. Somebody, please help me before I crash my head into the table. xD
     
  13. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    It's been a while since I last did any hacking, but I seem to remember that you can only use IDs from $00 to $7F in Sonic 1, because the MSb is used for the "remember status" flag.
     
  14. Tanman Tanner

    Tanman Tanner Well-Known Member Member

    Joined:
    Dec 23, 2016
    Messages:
    116
    Location:
    Buffalo, New York
    After looking into the 'number of things' you gave me, I think I don't need PWM support. Twas a silly idea to port to the 32X.
    Thank you anyhow, Novedicus.
     
  15. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    You can use the latest version of SonLVL for art importing, you just won't be able to see as many objects properly. You can import tiles, blocks, or chunks by clicking the Import button above the respective list in the Art tab, or import directly into the FG/BG layouts by right clicking and dragging to select an area, right click in the selection to bring up the context menu, then select Import. I don't know if that's the same for the version you have. It is recommended that the art you import be palettized/indexed and match exactly to the level's palette in SonLVL. You can try to import full-color images but the results may not be ideal.
     
    RouRouRou likes this.
  16. Crash

    Crash Well-Known Member Member

    Joined:
    Jul 15, 2010
    Messages:
    302
    Location:
    Australia
    You can have objects all the way up to $FF, the catch is that you can only put objects up to $7F into the level layout, because as nineko said, the "remember state" flag is stored in the upper byte of the object id in the level layout format.

    You can absolutely spawn objects from $80 to $FF from code though, so if you want to add more objects that can be part of the level layout, what you could do is change the object id some of the objects that are only ever spawned through code into slots $80 and up, and then put your level objects into the now freed up slots.

    Things like explosions, flickys, the points object, the hud, title cards, and so on are all good candidates to be moved to higher slots.
     
  17. Deactivated Account

    Deactivated Account Well-Known Member Exiled

    Joined:
    Aug 26, 2016
    Messages:
    244
    Anyone know if Mid2smps supports flanger effect? I've seen two songs from Batman and Robin makes a flanger effect so, I haven't idea if there are a trick or something to make that effect.
    Thanks for the advice.
     
  18. ethan2145

    ethan2145 Newcomer Trialist

    Joined:
    Nov 11, 2018
    Messages:
    1
    Very new to the hacking scene and ssrg. I've gotten down level designing since its easy, i know the most basic of basics of hex, but i struggle with music. Say for example, I wanted to put Rusty Ruin 2 into Marble zone. Is there a good guide for music porting? I've researched and researched and haven't found any I understood...
     
  19. RouRouRou

    RouRouRou Ain't no fun if the aliens can't have none. Member

    Joined:
    Nov 20, 2016
    Messages:
    97
    SMPSConv is good to port music, but you might also want to use the music pointer fixer before converting.

    Take that with a grain of salt though, I don't port often.

    You can find SMPSConv here, http://sonicresearch.org/community/index.php?threads/smps-converter.2523/, and music pointer fixer on SonicRetro.

    I must tell you though, I'd use MegaPCM if you want to have the song's DAC samples.
     
    Last edited: Nov 18, 2018
  20. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,016
    I've never really used SMPSConv, but I do a lot of work with sound drivers. Music porting is way too involved for a newcomer. You need to be familiar with all kinds of sound driver differences: PSG envelopes, DAC samples, etc.

    Whatever you do, don't use Music Pointer Fixer. That thing's awful. It was probably good for its time, but it's ancient and gets tons of stuff wrong.

    I suppose the simplest way to port music nowadays is by installing a custom sound driver, and adding music in SMPS2ASM format. Custom drivers let you skip a lot of the in-depth stuff, but installing them is a task of its own. Flamedriver might be the best option, but I'm pretty sure there isn't a guide for installing it in Sonic 1.
     
    Tanman Tanner, EMK-20218 and AkumaYin like this.