Basic Questions and Answers Thread

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

  1. Clownacy

    Clownacy Well-Known Member Staff

    Joined:
    Aug 15, 2014
    Messages:
    890
    That's because S3K/S3D music uses S3K's unique DAC samples and PSG envelopes. You can enable my Clone Driver v2 to use them by adjusting the settings in the Compatibility.asm file in the sound folder.

    A recent change to how SMPS2ASM handles S3/S3D-specific PSG envelopes may have broken compatibility with flanewing's current music/SFX pack. I can't remember if I added a compatibility layer for that. So, if you see an error for only one or two "sTones" not being defined, that's the cause.
     
    Last edited: Apr 13, 2016
  2. Sinkdude

    Sinkdude He looked much leaner on TV Member

    Joined:
    May 6, 2008
    Messages:
    40
    Location:
    Michigan
    I done just that, and now the only error left is the sTone_26 "Symbol undefined" error in the Diamond Dust 1 .ASM.
     
  3. Clownacy

    Clownacy Well-Known Member Staff

    Joined:
    Aug 15, 2014
    Messages:
    890
    That's exactly what I was worried about. Does changing the instances of sTone_26 to sTone_26b fix it? I'll release a version of my driver with compatibility with the older SMPS2ASM files when I get to a computer.
     
  4. Sinkdude

    Sinkdude He looked much leaner on TV Member

    Joined:
    May 6, 2008
    Messages:
    40
    Location:
    Michigan
    I changed and the thing works. All I have to do now is increase the value of Size_of_Mega_PCM_guess to $9E6 and poof, it works again.

    Now I've got a problem. Actualy, make that two problems. First problem is that after changing the value of Size_of_Mega_PCM_guess to $9E6, the driver in general won't play at all.

    The second problem here is the uncooperative fade out after the Sega screen and before the SSRG splash screen. When the ROM first loads, the Sega screen doesn't fade out and it cuts to the SSRG splash screen and when the Sega screen is shown a second time (after leaving the options screen, for example), it doesn't fade out, but it fades into blue with Sega outlines then cuts to an orange screen for a split-second before it cuts to the SSRG splash screen and proceeds as normal.
     
    Last edited: Apr 13, 2016
  5. FireRat

    FireRat Well-Known Member Exiled

    Joined:
    Oct 31, 2009
    Messages:
    544
    The Motorola 68010 pushes more "internal status"-related bytes to the stack RAM after triggering interrupts (or just in a different order?).

    Sonic 3/&K has a decompression routine that works AGAINST the Vertical Interrupts. Inside the vertical interrupt routine, there is some code that checks whether a decompression process is being done (hence do any necessary operations); to do it, it checks the address of "where the processor was", before the vertical interrupt occurs. In the case of the Motorola 68000, and according to the code in Sonic 3, this address is located in a specific location within the stack. The issue here is, that the 68010 adds extra information to the stack memory, X extra bytes. Meaning that, the proper "where the processor was" address, in the case of the 68010, should be, say, "Stack Pointer + addrtoReturnPointer + X" instead.

    Sonic 3/&K take its approach of a very specific feature the processor gives, in a "hackish" looking but usually "good" way, and this process only happens while the engine runs an actual level. The goal is to achieve file decompression in "real-time", without needing to slow-down or freeze the game. This technique is not used in other Sonic games, that is why Sonic 1 or Sonic 2 will run just fine in both processors (costing a few more RAM bytes in the latter), but Sonic 3 will crash upon any level in 68010.

    I want suggestions... What you think is the most "optimized" solution, to check for either the current processor or how many bytes were exactly pushed to the stack?, (or a table exposing how many for each individual model?)

    EDIT: Redaction.
     
    Last edited: Apr 15, 2016
    DanielHall likes this.
  6. AURORA☆FIELDS

    AURORA☆FIELDS the cute one here Member

    Joined:
    Oct 7, 2011
    Messages:
    718
    Location:
    Where I should've been a long time ago
    I am not sure, but I dont think there is way to check which 68k model the code is running in, so you'd have to hardcode the values and either distribute separate binary for each version, or have the user select the correct model. One other way I can think, is do a test where you put a key value into stack, then cause an exception, and check how many bytes back the key value is. But you'd have to be very careful with this key value to ensure no CPU model can cause this value by default and make the program report incorrect values.
     
    FireRat likes this.
  7. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    816
    Location:
    Portland, Maine
    How can I get Sonic 1's rings to load correctly using Sonic 3's object manager including a word-length respawn index SST (originally $23(a0))?
     
  8. FireRat

    FireRat Well-Known Member Exiled

    Joined:
    Oct 31, 2009
    Messages:
    544
    It is tedious and time-consuming, but all you have to do, is be absolutely careful with the pointers (i.e. when you add or substract to the address). It has to be perfectly done so it gives a perfect result, and that is the "efficient" way (following the code's scheme).

    A least efficient but "error-safe" alternative though, if you feel... "lazy", is to: Take the object entry's ROM address and substract with the start of the objpos file's address, so you get the address WITHIN the file of the entry; divide it by 6 (the size of an entry), and use that result as respawn index. If for some reason you get to work with entries with a size of 8 bytes, you can exchange the division with lsr.X #3.

    EDIT: Redaction.
     
    Last edited: Apr 19, 2016
  9. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    816
    Location:
    Portland, Maine
    I don't understand what you mean. The problem is that the respawn index number SST is now word-length and so the rings don't use the correct formations because the formation is what is determined by the respawn index instead of individual objects. So now more things are changed by changing it into a word and there is nothing to base the code off of because Sonic 3K uses the ring manager to load the formations instead of the respawn index. What I'm having trouble figuring out is how I can make the rings use the correct formations using the word-length SST but I don't know how the code can be changed to make that happen.
     
  10. Niko

    Niko All's well that ends well, right? Member

    Joined:
    Mar 1, 2014
    Messages:
    245
    Location:
    $C800
    I remember the S3K Ring Management tutorial having a ring-layout converter, but I was also looking at a Sonic 2 guide for this.
    All at the same time, Sonic 1 and 2 are pretty close in most areas, but at that same time, let's all remember HPZ's Tails monitor.


    Also, this being a basic Q&A, I'd also like to ask something rather "basic."
    Would anyone want to see Freedom Plantet's stages imported faithfully into Sonic 2?
    I ask because I thought about doing it myself, but I'm trying to decide if it's worthwhile...

    Video (of original) for those unfamiliar:

    Code:
    Video Link: https://www.youtube.com/watch?v=t1HD4Wq6Y6c
     
    Last edited: Apr 20, 2016
  11. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    816
    Location:
    Portland, Maine
    I probably should've mentioned that Sonic 2 also uses a ring manager which means that that reply isn't very helpful. Porting the ring manager to Sonic 1 could be a possibility.

    Also, I've never played the game but judging by the gameplay video, it looks amazing and I would really like to see it in Sonic 2. However, there would be issues porting the levels over because the palettes in Freedom Planet probably consist of more colors on screen and in total than the Genesis could provide and because Freedom Planet likely doesn't use chunks which would mean there would more than $100 chunks needed to recreate the levels.
     
  12. Niko

    Niko All's well that ends well, right? Member

    Joined:
    Mar 1, 2014
    Messages:
    245
    Location:
    $C800
    Colour limits could be met, while still trying to maintain a close enough look.
    Chunks would be a problem too, but look at Sonic 2 LD's faithfulness to EHZ.
    Imperfect, but accurate.
    On that note, though, would it be better to knaw at dumbing it down, or using something like The Super Ring Engine?
    (Or, maybe even use HCGE, since that was brought back up seemingly only weeks ago.)
     
  13. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,823
    Calvin; no, I don't think you should port levels from that game in.

    One reason would be that the creators of the game, may be a little hazy on the idea, it would be best to ask first.

    Another reason, is more on my personal ground here. I'd rather see something brand new, perhaps you could try making something unique?
     
  14. SuperEgg

    SuperEgg I'm a guy that knows that you know that I know Member

    Joined:
    Oct 17, 2009
    Messages:
    Location:
    THE BEST GOD DAMN STATE OF TEXAS
    Did you wake up and forget what community you're in? Porting levels, easy tutorials, and shoving stolen content into S1 is this community specialty. Originality? What's that =P
     
    Ralakimus and Pacca like this.
  15. rika_chou

    rika_chou Adopt Member

    Joined:
    Aug 11, 2007
    Messages:
    660
    I think that while getting Freedom Planet levels to work with the limitations of a Genesis rom would be impressive, it would take a tremendous amount of work to do it right. I feel like such effort would be better used for something original.
     
    Ayla and MarkeyJester like this.
  16. Sinkdude

    Sinkdude He looked much leaner on TV Member

    Joined:
    May 6, 2008
    Messages:
    40
    Location:
    Michigan
    I am planning to convert a Sonic 2 Beta song from .bin to .asm using the SMPS2ASM tool, but every time I open the SMPS2ASM program, it just closes itself after opening. What should I do to keep the SMPS2ASM program open?
     
  17. SuperEgg

    SuperEgg I'm a guy that knows that you know that I know Member

    Joined:
    Oct 17, 2009
    Messages:
    Location:
    THE BEST GOD DAMN STATE OF TEXAS
  18. Crash

    Crash Well-Known Member Member

    Joined:
    Jul 15, 2010
    Messages:
    302
    Location:
    Australia
    just so you know next time, you need to run smps2asm from the command prompt.
     
    Sinkdude likes this.
  19. A-S-H

    A-S-H Moderator and Host of the SMPS Competition Member

    Joined:
    Jun 5, 2015
    Messages:
    427
    Location:
    Music Plant Zone
    How do I get palette line changes working in SonMapEd?
     
  20. TheStoneBanana

    TheStoneBanana The Bananaman Member

    Joined:
    Nov 27, 2013
    Messages:
    605
    Location:
    The Milky Way Galaxy
    I'm not quite sure what you mean, but if you're asking how to change the palette line of a sprite, just press the 'P' key on the sprite/piece you currently have highlighted.