Basic Questions and Answers Thread

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

  1. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    802
    Location:
    Portland, Maine
    I ported EHZ to Sonic 1 through the ASM68k version of the project 128 disassembly and I found a big problem where if you run or spindash into a wall, Sonic will go through it. This isn't present in Sonic 2. Can anyone offer a solution to this?
     
  2. JoenickROS

    JoenickROS ROS is on hiatus. (...again) Member

    Joined:
    Feb 5, 2012
    Messages:
    922
    I'll give you hint. You have not ported everything, that's all I'm giving you, because it's kind of common sense to why Sonic would go through a wall.
     
    Last edited by a moderator: Sep 30, 2015
  3. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    802
    Location:
    Portland, Maine
    The collision is completely fine. I've been working on the level for a while and I'm using Sonic 2's index. The problem only occurs when Sonic is at max speed and facing right.

    Edit: I discovered that it's present in other zones.
     
    Last edited by a moderator: Sep 30, 2015
  4. HackGame

    HackGame The ROM Hacker Member

    Joined:
    Jul 18, 2014
    Messages:
    142
    Location:
    Green Hill Zone
    How do I get to the Title Screen after you beat the level?
     
    Last edited by a moderator: Oct 3, 2015
  5. Pacca

    Pacca Why succeed when you can profit off of failure? Member

    Joined:
    Jul 5, 2014
    Messages:
    1,149
    Location:
    Triton (Moon)
    Just change the game mode. There should be a ram address with a similar name, if you clear the address and write 0 to it, it will go back to the sega screen. I don't have a dissassembly in front of me, but that should do it.
     
  6. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    389
    Location:
    Town Creek, AL
    Not a hacking question (since i  know the fix) but...

    In sonic 1 disassemblies (unsure of 2-3K) There is musiclist & musiclist2. Has me curious on why there's two, besides the fact of levelmusic & resumemusic. Is there a difference?
     
  7. Natsumi

    Natsumi Phoenix egg Member

    Joined:
    Oct 7, 2011
    Messages:
    702
    Location:
    Long and dangerous river
    ask Sonic Team. Its worthless to have MusicList2 in Sonic 1; it does absolutely nothing but duplicate MusicList
     
  8. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    802
    Location:
    Portland, Maine
    I think musiclist2 plays SBZ's music in LZ act 4/SBZ act 3.
     
  9. Pacca

    Pacca Why succeed when you can profit off of failure? Member

    Joined:
    Jul 5, 2014
    Messages:
    1,149
    Location:
    Triton (Moon)
    Actually, LZ4 has several rather sloppy checks in the music loading routine which make it load SBZs music. I should know; in my first hack, RR!, I had to manually change ALL of them.
     
    Last edited by a moderator: Oct 9, 2015
  10. MarkeyJester

    MarkeyJester ! % # @ Member

    Joined:
    Jun 27, 2009
    Messages:
    2,796


    There is one subtle difference with the first music list containing a 7th zone slot for playing Final Zone's music ID.

    Because of how close to the instructions the lists are, it is possible that it was initially setup with relative reading in mind, but as time progressed and code grew, the distance between the lists and their respective loads became too far for a relative load.  An error likely arose with them (at different time periods of course), and the quick fix would have been to load to an address register and read that way.  (This is all speculation of course, but there's no harm in taking potential past revisions into account).
     
  11. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    389
    Location:
    Town Creek, AL
    https://youtu.be/TO12zCA5_dU  This one is a strange one. Making Kram 128 use address music, done everything right (unless somewhere I screwed up) however the DAC is either sped up, or one note looped, Sounds seem to sound like it came from Galata (especially the extra points at the end). I went back & cheched everything

    Even checked to see if I made the fix. Everything seems OK unless I overlooked something

    Update: If my computer will cooperate, will double, triple check everything.
     
    Last edited by a moderator: Oct 18, 2015
  12. hackman

    hackman Newcomer Trialist

    Joined:
    Aug 30, 2015
    Messages:
    6
    Location:
    behind you
    I what to know how to port the sonic 2 beta sound driver to sonic 1 or show me a way to port the music I don't know how.



     
    Last edited by a moderator: Oct 21, 2015
  13. Clownacy

    Clownacy Negative Clownancy Staff

    Joined:
    Aug 15, 2014
    Messages:
    884
    You know what, here's a little secret: using SMPS2ASM on S2B music is easy, even though there's not an obvious option for it. S2B's format is largely S2F's. Only difference I've noticed is that the tempo value is S1-style instead of S2. So, run smps2asm.exe on an S2B file in S2 mode, then open up the produced .asm file, and change smpsHeaderStartSong from '2' to '1'. This will make the SMPS2ASM interpreter assume the song came from S1, and adjust the tempo accordingly.

    You might be wondering what the hell I'm talking about. Well, I'm not the kind that's into messing with binary music files, I prefer the ASM form, namely SMPS2ASM. It's an abstraction layer that allows ASM-converted music to work in theoretically any SMPS driver, with necessary adjustments to make up for missing DACs, PSGs, and coord. flags, of course.

    Now, you're in a bit of a tough spot. S1's driver is, in many ways, the most limited one between it and S3K's driver. What it makes up for with Special SFX support (used by all of one thing in S1), it lags behind with an extremely lacking DAC library. It's also buggy as hell sometimes. Though I doubt this is your intention, porting S2B's entire driver would eliminate some of these problems, but it would cause others, too, because of the now-missing Special SFX support, and the fact that you lose S1's entire music and SFX library.

    One option is to just take S2B's music in SMPS2ASM format, and replace any missing drums with ones from S1, allowing it work with plain old S1's sound driver. The other would be to port a driver with everything already in there, for which I recommend my S2 driver, though you do need a very specific disassembly setup in order to use it (GitHub disassembly, AS branch), so maybe it's not the best option. I'm sure there are some binary converters out there that make it so you don't have to worry about all this ASM and driver nonsense, but this is the only way I myself know.
     
  14. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    802
    Location:
    Portland, Maine
    Speaking of Sonic 1's sound driver, I always wondered how "Special SFX," which I assume relates to "playsound_special," is different than normal sound effects.
     
  15. Pokepunch

    Pokepunch That guy who posts on occasion Member

    Joined:
    Aug 7, 2009
    Messages:
    270
    Location:
    UK
    How would I make an object move around in a circular motion? Or even an infinity symbol motion? I've observed that it involves angles and the CalcSine routine, but I can't get my head around what exactly is going on.
     
  16. Selbi

    Selbi Plug in, baby. Retired Staff

    Joined:
    Jul 20, 2008
    Messages:
    2,398
    Location:
    Northern Germany
    A simple way that I always like to use is the frame counter ($FFFFFE04, Timer_frames in S2). Just feed the CalcSine routine that word via d0 and it spits out two neat values (sine and cos for d0 and d1, respectively) that you can freely mess with.

    If you want to make the object rotate slower or faster, just manipulate the frame counter's value before you call the routine. If you want to expand or decrease the rotation radius, manipulate the output values.

    Simple example:
     

    Code:
            move.w	(Timer_frames).w,d0	; get current frame counter
            add.w	d0,d0			; double the value (doubles the speed)
            jsr	(CalcSine).l		; calc sine based on it
            asr.w	#2,d0			; shrink down the Sine output (shrink down the horizontal radius)
            asr.w	#2,d1			; shrink down the Cos output (shrink down the vertical radius)
            move.w	d0,x_pos(a0)		; save result to new X-pos
            move.w	d1,y_pos(a0)		; save result to new Y-pos
     
    Last edited by a moderator: Oct 27, 2015
  17. AsuharaMoon

    AsuharaMoon kakyoin did you lay this egg Member

    Joined:
    Aug 15, 2013
    Messages:
    61
    A silly question. How I can correctly convert Sonic 1's 256x256 Chunks, FGs and BGs to Markey's Two-Eight Disassembly format?
     
  18. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    868
    LevelConverter may be able to help you. Convert from Sonic 1 to Sonic 2 format, and take the layout and chunk files.
     
    Last edited by a moderator: Oct 27, 2015
  19. redhotsonic

    redhotsonic Also known as RHS Retired Staff

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England


    IIRC, Special helps queue SFXs.  You know that the driver cannot play 2 SFX in the same frame, right?

    Code:
    somelabel:
     blah
     blah
     moveq #$8D,d0
     bsr.w PlaySound
     blah
     blah
     moveq #$9F,d0
     bsr.w PlaySound
     blah
     
    In this code above, it will only play sound ID 9F, because you've over-written 8D.  It can't do 2 SFX in the same frame.  This is where the sepcial comes into play:
    Code:
    somelabel:
     blah
     blah
     moveq #$8D,d0
     bsr.w PlaySound
     blah
     blah
     moveq #$9F,d0
     bsr.w PlaySoundSpecial
     blah
    What will happen now is that it will now play SFX ID 8D, but it will play SFX ID 9F on the very next frame.  Like said, it can't do two on the same frame.  Basically, "Special" will queue it up and will play on the next frame.
     
  20. Clownacy

    Clownacy Negative Clownancy Staff

    Joined:
    Aug 15, 2014
    Messages:
    884
    Actually, PlaySound_Special and Special SFX are unrelated. rhs is right about PlaySound_Special, though: S1 does lack proper queueing. Unfortunately I have no idea what the difference between an SFX and a Special SFX actually is. It has a different initialisation subroutine to music and regular SFX, and seems to prioritise itself below SFX but above music. It even has a different coordination flag for stopping, but that seems to be an S1-exclusive modification. Special SFX even has its own track RAM, indicating both SFX and Special SFX can run at the same time, without cancelling each other out, as two regular SFX's would, though only one would be audible.