Basic Questions and Answers Thread

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

  1. jubbalub

    jubbalub Mania fanboy Member

    Joined:
    Dec 25, 2014
    Messages:
    279
    Done that, didn't fix it
     
  2. Clownacy

    Clownacy Well-Known Member Staff

    Joined:
    Aug 15, 2014
    Messages:
    888
    On a related note, the S1 Git disasm's sound driver has a bunch of commented-out bugfixes. Maybe one of those fixes your issue.
     
  3. AURORA☆FIELDS

    AURORA☆FIELDS the cute one here Member

    Joined:
    Oct 7, 2011
    Messages:
    710
    Location:
    Nathan's arms <3
    Can you upload a sound clip somewhere? Last I had issues with spin sfx was exactly for the reason I linked. Maybe try the other fixes in that thread?
     
  4. Pacca

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

    Joined:
    Jul 5, 2014
    Messages:
    1,149
    Location:
    Triton (Moon)
    Quick question about the Clone Driver v2: How do I use the extra music slots? Should I just put filler data into MusicIndex until I get to $E0, or is that not necessary? Is it more complex then that? The initial page tells you how to extend the Sound test, but doesn't give specifics on how to use those slots, and googling surprisingly didn't get me anywhere.
     
  5. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    (it feels great to finally get validated)
    Hey, for the last few days I was trying to port the spindash from sonic 2 in to sonic 1. now I know that there is a guide for doing exactly that on sonic retro, but for some reason things don't seem to work out for me. and no meter how hard i'm trying to understand I can't seem to figure things out by myself.
    Now I am using the GitHub disassembley of sonic 1 and I noticed how different it is from the norm and how it saves it's sub routines in their own ASM files (I hope i'm getting this right). anyways I am not sure but something about the sonic retro guide seems different even tho it has a guide specifically for the GitHub version it seems....out dated, I think. I mean the guide told me to just copy the code for the Spindash subroutine and port it over to an ASM file in _incObj but when I tried copying the code from s2.asm I noticed that for some reason the spindash is split in to 2 Subroutines. is it suppose to be that way? am I suppose to make 2 asm files in _incObj for each Subroutine? I though that maybe the code he used was from a different sonic 2 disassembly so I tried to download the one that the page said he used and the code while not split to 2 subroutines doesn't seem to work for me. I also though it had to do with the labels. but for some reason I don't seem to recall certain labels that the tutorial told me to change appearing anywhere in both disassemblies. I am just confused at this point .

    Edit:
    Forgot to mention. the tutorial mentions "sonic1.asm" but mine says "sonic.asm" . does this mean anything?
     
    Last edited: Aug 14, 2016
  6. jubbalub

    jubbalub Mania fanboy Member

    Joined:
    Dec 25, 2014
    Messages:
    279
  7. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
  8. Clownacy

    Clownacy Well-Known Member Staff

    Joined:
    Aug 15, 2014
    Messages:
    888
    My driver has a thread now, you could post there. Anyway, what are you talking about? By default, the Git disasms already use slots $00-$FF. Xenowhirl has slots $00-$7F disabled because the sound IDs are hardcoded, but they can be restored by changing the music's idstart in the Sound IDs file.
     
  9. Pacca

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

    Joined:
    Jul 5, 2014
    Messages:
    1,149
    Location:
    Triton (Moon)
    I just want to know where I should put the new pointers for my music in MusicIndex. It only lists music up to $9F, I assumed that further music should be added there. I'm just not sure if I need to add filler data between the pointers to add music at the appropriate music Id. Example for clarity:

    Should I do this?
    Code:
    in Sonic 2 Clone Driver v2 - Music.asm...
    ptr_mus9E:    dc.l Music9E
    ptr_mus9F:    dc.l Music9F+1
    ptr_musE0:    dc.l MusicE0
    ptr_musend
    Or this?
    Code:
    in Sonic 2 Clone Driver v2 - Music.asm...
    ptr_mus9E:    dc.l Music9E
    ptr_mus9F:    dc.l Music9F+1
    ptr_musNullA0:  dc.l FillerData ;A0
    ptr_musNullA1:  dc.l FillerData ;A1
    ptr_musNullA2:  dc.l FillerData ;A2
    ...
    ...
    ptr_musNullDF:  dc.l FillerData ; DF
    ptr_musE0:    dc.l MusicE0
    ptr_musend
     
  10. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    ok, so about the whole "labels don't apear in either disassemblies" thing. I was wrong, I was able to find them in the older sonic 2 disassamblies. I tried copying the code and switched all the labels. but I for some reason still seem to have an error
    "Error : Symbol 'sonic_spindash' not defined"
    I though I was suppose to the spindash branch in the sonic.asm file. but for some reason it doesn't seem to recognize it. I herd this problem happens when you're not using TAB for space. but I did use TAB and I even tried copying the jump bsr instruction below it and simply add "Sonic_Spindash" to it and it still doesn't work
     
  11. Clownacy

    Clownacy Well-Known Member Staff

    Joined:
    Aug 15, 2014
    Messages:
    888
    Don't put music in slot $E0? There should already be free slots between music and SFX: in Git S1, music occupies $01-$7F, and SFX occupies $80-$F8. Just do what you did in the top example.
     
    Last edited: Aug 14, 2016
  12. Pacca

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

    Joined:
    Jul 5, 2014
    Messages:
    1,149
    Location:
    Triton (Moon)
    I'm using the Xenowhirl disassembly, so I'm not sure if the $01-$7F thing applies. I was trying to use $E0 because the features section mentions this:
    Am I thinking about this all wrong? Or am I missing something? This seems like it should be super easy, but I'm just messing up on my own...

    EDIT: Just putting it at the bottom doesn't work because that space is occupied by sfx, but I'm sure everyone knows that...
     
  13. Clownacy

    Clownacy Well-Known Member Staff

    Joined:
    Aug 15, 2014
    Messages:
    888
    I guess you're out of luck. Maybe if you changed the music's idstart to $01, inserted your new music slot at the beginning, and then padded the defaults S2 music slots to $80, then it would work. The $E0 slots thing is related to a bug in S1's driver, where music in a slot higher than the first music ID+$40 - which is $E0 - would cause a crash. It's just some old terminology. The slots are only usable if SFX or the others aren't using them. The other option is making a new 'PlaySound', for a second set of music slots.

    EDIT: Wait, that would be $C0. I guess that was a typo.
     
    Last edited: Aug 14, 2016
    Pacca likes this.
  14. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    ok, so after thinking some more I though to myself how are the other branches reach from sonic.asm to their own files? I eventually found inside Sonic.asm a section with a bunch of file locations for all the different subroutines in _incObj, so i tried to add the location of my sonic_spindash.asm and it worked. I got a spindash in sonic 1. but I still need to make it look complete , so far I followed the rest of the tutorial in Sonic Retro and things seem to go fine, I fixed most of the bugs and replaced the charging animation with the jump animation so far. now i'm in the section that explains about adding tiles. the toturial is telling me to use a tile editor. can I use SonMapEd for this?
     
  15. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    525
    Location:
    France
    You can use SonMapEd or TileMolester.

    FOR ME:
    I want Sonic and Ashuro load a different start location.
    So i have do this:

    Code:
    LevSz_StartLoc:                ; XREF: LevelSizeLoad
            move.w    ($FFFFFE10).w,d0
            lsl.b    #6,d0
            lsr.w    #4,d0
            tst.b     ($FFFFFFF6).w     ; if player flag set
            beq.s     @startloccont
            lea        StartLocArrayA(pc,d0.w),a1 ; load Ashuro's start location ***
            bra.s     @startloccont2
        
    @startloccont:
            lea        StartLocArray(pc,d0.w),a1 ; load Sonic's start location
        
    @startloccont2:
    And when i build, i get this errors:
    Sonic1.asm(7964) : Error : Illegal Value (266)

    I think the error is here: (pc,d0.w),a1
    But i don't know what to do?
    (EDIT: the line "7964" is the line with the " *** ")
     
    Last edited: Aug 15, 2016
  16. Painto

    Painto Samodzierżca Najdłuższego Kija Member

    Joined:
    Mar 24, 2014
    Messages:
    315
    Location:
    Poland
    EDIT: Natsumi explained it much better than me,so you can freely ignore this.

    StartLocArrayA
    is too far from the instruction. Move the StartLocArrayA closer to it.
    You may also change it to this (not fully sure however, so it's in spoiler and if it's wrong, correct me):
    Code:
    LevSz_StartLoc:                ; XREF: LevelSizeLoad
            move.w    ($FFFFFE10).w,d0
            lsl.b    #6,d0
            lsr.w    #4,d0
            lea (StartLocArray).l,a0
            tst.b     ($FFFFFFF6).w     ; if player flag set
            beq.s     @startloccont
            lea (StartLocArrayA).l,a0
      
    @startloccont:
         lea (a0,d0.w),a1
    
     
    Last edited: Aug 15, 2016
    Ashuro likes this.
  17. AURORA☆FIELDS

    AURORA☆FIELDS the cute one here Member

    Joined:
    Oct 7, 2011
    Messages:
    710
    Location:
    Nathan's arms <3
    yes! It indeed is with the pc,d0.w. More precisely, there is only 8-bit signed offset parameter in the code. This means the pointer can be at most 128 bytes from the instruction (simplified). Now instead, the offset is 266 bytes. That is way too far. I would actually propose an interesting solution; Have pointer to only a single start location array, but add the difference to d0 with your extra character. Something like this (pseudo-code):
    Code:
    d0 = offset in original array
    if player=2
      d0 += StartLocArrayA-StartLocArray
    endif
    a1 = StartLocArray(pc,d0.w)
    Now, doing this change can be as simple as adding this difference to d0. I think you have enough grasp on code to be able to do this. Of course the preferred method is loading StartLocArray or StartLocArrayA depending on the character, to a1 first and then loading it as d0-relative a1 to a1, but to be honest thats much slower and more lame =P
     
    Ashuro likes this.
  18. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    525
    Location:
    France
    Thank you Painto, thank you Natsumi, it's much easy now!

    I will try the difference in d0 (i want to learn more by doing something much difficult :) )
     
  19. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    I tried to spindash and...
    [​IMG]
     
  20. mrcat-pixel

    mrcat-pixel The Holy Cat Jr. Member

    Joined:
    May 31, 2014
    Messages:
    381
    Is there a way to alter title screen mappings in sonic 2 SMS?