Mini-tutorials Thread

Discussion in 'Tutorials' started by EpsilionDubwool, Feb 16, 2021.

Tags:
  1. TheInvisibleSun

    TheInvisibleSun Visible Member

    Joined:
    Jul 2, 2013
    Messages:
    411
    Location:
    Buffalo, NY, USA
    This is a nice guide, but there is a small, probably insignificant oversight; since the time resets, then getting the time bonus becomes very easy, depending on the situation. Depending on the hack, it might make sense to set the timer to a particular time, (like 5 minutes or something) to avoid inadvertently rewarding the time over. Again, it's probably insignificant, but I felt it was worth mentioning.
     
  2. Giovanni

    Giovanni It's Joevanni, not Geovanni. Member

    Joined:
    Apr 16, 2015
    Messages:
    264
    Location:
    Italy
    It's true, the oversight does exist in the original games as well. I have taken advantage of it myself in Sonic 2, using the last checkpoint of one of the Metropolis acts to gain 50000 points and trivialize the effect of the time over. One could set up a flag that nullifies the time bonus when set. Might write up something later once I get home...
     
  3. RobiWanKenobi

    RobiWanKenobi Python Developer Member

    Joined:
    Sep 10, 2022
    Messages:
    15
    Location:
    United States
    To make the sonic 2 drums sound like the sonic 1 prototype drums, go into s2.sounddriver.asm and go to
    zDACMasterPlaylist
    you will see these lines

    Code:
        db    id(zDACPtr_Sample1),17h        ; 81h
        db    id(zDACPtr_Sample2),1        ; 82h
        db    id(zDACPtr_Sample3),6        ; 83h
        db    id(zDACPtr_Sample4),8        ; 84h
        db    id(zDACPtr_Sample5),1Bh        ; 85h
        db    id(zDACPtr_Sample6),0Ah        ; 86h
        db    id(zDACPtr_Sample7),1Bh        ; 87h
        db    id(zDACPtr_Sample5),12h        ; 88h
        db    id(zDACPtr_Sample5),15h        ; 89h
        db    id(zDACPtr_Sample5),1Ch        ; 8Ah
        db    id(zDACPtr_Sample5),1Dh        ; 8Bh
        db    id(zDACPtr_Sample6),2        ; 8Ch
        db    id(zDACPtr_Sample6),5        ; 8Dh
        db    id(zDACPtr_Sample6),8        ; 8Eh
        db    id(zDACPtr_Sample7),8        ; 8Fh
        db    id(zDACPtr_Sample7),0Bh        ; 90h
        db    id(zDACPtr_Sample7),12h        ; 91h
    
    to lower their pitch, you add numbers to them, to make them sound like the sonic 1 prototype drums, replace it with this
    Code:
        db    id(zDACPtr_Sample1),19h        ; 81h
        db    id(zDACPtr_Sample2),6        ; 82h
        db    id(zDACPtr_Sample3),20h    ; 83h
        db    id(zDACPtr_Sample4),8        ; 84h
        db    id(zDACPtr_Sample5),20h        ; 85h
        db    id(zDACPtr_Sample6),0Fh        ; 86h
        db    id(zDACPtr_Sample7),20h        ; 87h
        db    id(zDACPtr_Sample5),17h        ; 88h
        db    id(zDACPtr_Sample5),1Ah        ; 89h
        db    id(zDACPtr_Sample5),22h        ; 8Ah
        db    id(zDACPtr_Sample5),23h        ; 8Bh
        db    id(zDACPtr_Sample6),0Ch        ; 8Ch
        db    id(zDACPtr_Sample6),0Ah        ; 8Dh
        db    id(zDACPtr_Sample6),0Dh        ; 8Eh
        db    id(zDACPtr_Sample7),0Dh        ; 8Fh
        db    id(zDACPtr_Sample7),0Bh        ; 90h
        db    id(zDACPtr_Sample7),12h        ; 91h
    
    then build your rom
    Sample 1 is the Kick
    Sample 2 is the Snare
    Sample 3 is the Clap
    Sample 4 is the Record Scratch from MTZ
    Sample 5 is the Timpani
    Sample 6 is the Toms
    Sample 7 is the Bongo from MCZ
     
    EddyTF and Hame like this.
  4. Hame

    Hame Newcomer Trialist

    Joined:
    Jan 12, 2021
    Messages:
    9
    Location:
    Spain
    Green hill death bug (Github)

    if you have gone at high speed on the first level of green hill it will have happened to you that you died because of too much speed


    To fix this it's easy, open DynamicLevelEvents inside the _inc folder, go to "DLE_GHZ1:" without the quotes and copy this code

    Code:
    DLE_GHZ1:
    
            move.w    #$300,(v_limitbtm1).w ; set lower y-boundary
            move.w    #$300,(v_limitbtm2).w ; set lower y-boundary; <----- insert this.
            cmpi.w    #$1780,(v_screenposx).w ; has the camera reached $1780 on x-axis?
            bcs.s    locret_6E08    ; if not, branch
            move.w    #$400,(v_limitbtm1).w ; set lower y-boundary; <----- insert this.
            move.w    #$400,(v_limitbtm2).w ; set lower y-boundary  
    locret_6E08:
            rts    
    and ready the camera will go faster

     
    Last edited: Nov 15, 2022
  5. ⸸ devon ⸸

    ⸸ devon ⸸ There's nothing left but faith Member

    Joined:
    Aug 26, 2013
    Messages:
    1,176
    Your videos are set to private. They should be unlisted. Funnily enough, this is almost 1:1 how Sonic Jam fixes it, except it doesn't put in this:
     
    JGamer2151 likes this.
  6. Hame

    Hame Newcomer Trialist

    Joined:
    Jan 12, 2021
    Messages:
    9
    Location:
    Spain
    thanks for the warning
     
  7. EddyTF

    EddyTF #romhacker Member

    Joined:
    Jan 9, 2022
    Messages:
    47
    Location:
    Russia
    How to stop or change the scrolling speed of the background on the title screen in Sonic 1

    Good day! Today I will show you another guide. Many rom hackers, more advanced than me, know how to do this, but still, it will be useful for someone who is just starting his hacking activity. We want beginners to do good hacks;) So, let's begin. I will give a guide for as many as three disassembles: Hivebrain 2005, GitHub and SVN.

    Hivebrain 2005:

    Looking for loc_317C: and see:

    Code:
    loc_317C:
            move.b    #4,($FFFFF62A).w
            bsr.w    DelayProgram
            jsr    ObjectsLoad
            bsr.w    DeformBgLayer
            jsr    BuildSprites
            bsr.w    PalCycle_Title
            bsr.w    RunPLC_RAM
            move.w    ($FFFFD008).w,d0
            addq.w    #2,d0
            move.w    d0,($FFFFD008).w ; move    Sonic to the right
            cmpi.w    #$1C00,d0    ; has Sonic object passed x-position $1C00?
            bcs.s    Title_ChkRegion    ; if not, branch
            move.b    #0,($FFFFF600).w ; go to Sega screen
            rts
    So, we need this line here:

    Code:
    addq.w    #2,d0
    Here you can change the speed from 1 to 8. Unfortunately, it is impossible to do more. (forget my words, this can be done simply by replacing addq.w #2,d0 with addi.w #2,d0. Thanks to Inferno Gear for the advice.) So, just change to these numbers and that's it. The scrolling speed will change. If you want to stop scrolling completely, then do not change the value to 0 in any case, otherwise the compiler will give this error: (forget it all, guys lol)

    Code:
    S1 HIVEBRAIN 2005 DISASM\SONIC1.ASM(3266) : Error : Illegal value (0)
     addq.w #0,d0
    So, comment out or delete this line here addq.w #2,d0. But I advise you to comment.

    GitHub/SVN:

    Many rom hackers know that GitHub disassembly was built on SVN disassembly, so both there and there, the code is the same.

    And so, look for Tit_MainLoop:
    (both in SVN and in GitHub everything is completely the same)

    and we see it:

    Code:
    Tit_MainLoop:
            move.b    #4,(v_vbla_routine).w
            bsr.w    WaitForVBla
            jsr    (ExecuteObjects).l
            bsr.w    DeformLayers
            jsr    (BuildSprites).l
            bsr.w    PCycle_Title
            bsr.w    RunPLC
            move.w    (v_objspace+obX).w,d0
            addq.w    #2,d0
            move.w    d0,(v_objspace+obX).w ; move Sonic to the right
            cmpi.w    #$1C00,d0    ; has Sonic object passed $1C00 on x-axis?
            blo.s    Tit_ChkRegion    ; if not, branch
    
            move.b    #id_Sega,(v_gamemode).w ; go to Sega screen
            rts
    And we will need exactly the same line addq.w #2,d0 and you know what to do with it. Done. Compile and check, everything works ;>

    EDIT: idk
     
    Last edited: Nov 19, 2022
    Dark Shamil Khan and Nik Pi like this.
  8. Inferno

    Inferno Rom Hacker Member

    Joined:
    Oct 27, 2015
    Messages:
    123
    Location:
    Sky Base Zone, South Island
    ... actually, this is completely false, as all that the line does is change the X position of the object in Sonic's slot, determining the current camera position.

    In order to do more, change it from addq to addi. This will be slightly slower but allow you to add more than 8 at a time.
     
    EddyTF likes this.
  9. EddyTF

    EddyTF #romhacker Member

    Joined:
    Jan 9, 2022
    Messages:
    47
    Location:
    Russia
    @Inferno oh! I didn't even know about it. Thank you, I'll know now, cap;)
     
    Inferno likes this.
  10. ⸸ devon ⸸

    ⸸ devon ⸸ There's nothing left but faith Member

    Joined:
    Aug 26, 2013
    Messages:
    1,176
    EDIT: Nevermind.
     
    nineko likes this.
  11. Nik Pi

    Nik Pi Well-Known Member Member

    Joined:
    Feb 14, 2022
    Messages:
    58
    Location:
    Kazakhstan
    How to make camera moving with you when you dead like in Sonic 2 beta 4 and 5 (Sonic 2 GitHub disasm):

    Find it:
    Code:
    CheckGameOver:
    And comment this line:
    Code:
    move.b    #1,(Scroll_lock).w
    Done

    How to restore burned death animation (Sonic 2 GitHub disasm):
    Find
    Code:
    KillCharacter:
    And before this:
    Code:
    move.b    #AniIDSonAni_Death,anim(a0)
    Insert this:
    Code:
    cmpi.b  #$31,(a2); Test for object ID (Lava in MTZ and HTZ)
        beq.s    Pizdec; Is it? Go to this label
        cmpi.b  #$95,(a2); Test for object ID (Soul in HTZ)
        beq.s    Pizdec; Go to this label
    This code checks object that hurts you, and make you go to this (should be placed before Touch_Special):

    Code:
    Pizdec:
        move.b    #AniIDSonAni_DeathBW,anim(a0)
        bset    #high_priority_bit,art_tile(a0)
        move.w    #SndID_Hurt,d0
        jsr    (PlaySound).l
    +
        moveq    #-1,d0
        rts
    It's should work:
    s2built_005.png



    It's all! If you had any questions- ask me ;)