don't click here

How to restore the unused LBZ Escaping Eggman in Sonic 3 & Knuckles

Discussion in 'Engineering & Reverse Engineering' started by Rrose80149, Apr 16, 2023.

  1. Rrose80149

    Rrose80149

    Member
    92
    19
    8
    We know you can use the Game Genie code to make Eggman escape to the Death Egg in Launch Base Zone Act 2 after beating Big Arms in Sonic 3 Alone which He goes to the left and see the bad or good ending. Ever since SEGA made the code and didn't have time to implement it and used it as a Game Genie code. But that code got removed and was not shown in Sonic 3 & Knuckles in which Sonic &/or Tails see the Death Egg fall with the camera stop with the platform moving and it takes you to Mushroom Valley (Hill) Zone. It even made an Easter Egg appearance in Sonic Origins along where Eggman goes to the right instead with the LBZ Death Egg Transition from Sonic 3 Complete. So, why not restore it in that lock-on game. I'll be using the old GitHub Disassembly version for this tutorial.

    First, in the 'ChildObjDat_7380C' label change the 6 to a 7 and add this at the end of $B01C.
    Code (Text):
    1. ChildObjDat_7380C:dc.w 7
    2.         dc.l loc_72E9E
    3.         dc.w 0
    4.         dc.l loc_72E9E
    5.         dc.w $F028
    6.         dc.l loc_72E9E
    7.         dc.w $9000
    8.         dc.l loc_72E9E
    9.         dc.w $B828
    10.         dc.l loc_72E9E
    11.         dc.w $1810
    12.         dc.l loc_72E9E
    13.         dc.w $DCF8
    14.         dc.l loc_72E9E
    15.         dc.w $B01C
    16.         dc.l Obj_FleeingRobotnik
    17.         dc.w $661C
    Next, after the 'word_74E7C' label add this code.
    Code (Text):
    1. Obj_FleeingRobotnik:
    2.         lea    ObjDat3_51F9C(pc),a1
    3.         jsr    (SetUp_ObjAttributes).l
    4.         move.l    #loc_51BB6,(a0)
    5.         bset    #0,4(a0)
    6.         move.w    #$7B20,$3A(a0)
    7.         move.b    #$30,$25(a0)
    8.         move.w    (Camera_X_pos).w,d0
    9.         addi.w    #$60,d0
    10.         move.w    d0,$10(a0)
    11.         move.w    d0,$30(a0)
    12.         move.w    (Camera_Y_pos).w,d0
    13.         addi.w    #$100,d0
    14.         move.w    d0,$14(a0)
    15.         move.w    d0,$34(a0)
    16.         move.w    #$800,$18(a0)
    17.         move.w    #-$3C0,$1A(a0)
    18.         move.b    #4,$40(a0)
    19.         move.l    #ArtScaled_FleeingRobotnik,$42(a0)
    20.         move.b    #1,$3E(a0)
    21.         jsr    (Perform_Art_Scaling_S3).l
    22.         jmp    (Draw_Sprite).l
    23. ; ---------------------------------------------------------------------------
    24.  
    25. loc_51BB6:
    26.         bsr.w    sub_51E3A
    27.         bsr.w    sub_51DEA
    28.         bsr.w    sub_51E10
    29.         jmp    (Draw_Sprite).l
    Then, after the '$EEE' in 'word_7509E' add this before 'ObjDat3_750B6'.
    Code (Text):
    1. Perform_Art_Scaling_S3:
    2.         clr.w    ($FFFFF740).w
    3.         move.l    a0,-(sp)
    4.         jsr    (Init_ArtScaling).l
    5.         movea.l    (sp)+,a0
    6.         move.l    a0,-(sp)
    7.         move.w    $A(a0),d0
    8.         jsr    (sub_2468A).l
    9.         movea.l    (sp)+,a0
    10.         move.w    ($FFFFF740).w,d3
    11.         lsl.w    #4,d3
    12.         move.l    #Kos_decomp_buffer,d1
    13.         move.w    $3A(a0),d2
    14.         jmp    (Add_To_DMA_Queue).l
    15. ; End of function Perform_Art_Scaling
    16.  
    17.  
    18. ; =============== S U B R O U T I N E =======================================
    19.  
    20.  
    21. sub_51DEA:
    22.         move.w    $18(a0),d0
    23.         addi.w    #-$28,d0
    24.         cmpi.w    #-$80,d0
    25.         blt.s    loc_51DFC
    26.         move.w    d0,$18(a0)
    27.  
    28. loc_51DFC:
    29.         move.w    $1A(a0),d0
    30.         addi.w    #8,d0
    31.         cmpi.w    #$40,d0
    32.         bge.s    locret_51E0E
    33.         move.w    d0,$1A(a0)
    34.  
    35. locret_51E0E:
    36.         rts
    37. ; End of function sub_51DEA
    38.  
    39.  
    40. ; =============== S U B R O U T I N E =======================================
    41.  
    42.  
    43. sub_51E10:
    44.         bsr.w    sub_4B30A
    45.         move.w    $30(a0),d2
    46.         move.w    $34(a0),d3
    47.         moveq    #0,d0
    48.         move.b    $40(a0),d0
    49.         addq.w    #4,d0
    50.         move.l    #$100,d4
    51.         divu.w    d0,d4
    52.         sub.w    d4,d2
    53.         sub.w    d4,d3
    54.         move.w    d2,$10(a0)
    55.         move.w    d3,$14(a0)
    56.         rts
    57. ; End of function sub_51E10
    58.  
    59.  
    60. ; =============== S U B R O U T I N E =======================================
    61.  
    62. sub_4B30A:
    63.         move.w    $18(a0),d0
    64.         ext.l    d0
    65.         lsl.l    #8,d0
    66.         add.l    d0,$30(a0)
    67.         move.w    $1A(a0),d0
    68.         ext.l    d0
    69.         lsl.l    #8,d0
    70.         add.l    d0,$34(a0)
    71.         rts
    72. ; End of function sub_4B30A
    73.  
    74.  
    75. ; =============== S U B R O U T I N E =======================================
    76.  
    77.  
    78. sub_51E3A:
    79.         subq.w    #1,$1C(a0)
    80.         bpl.s    loc_51E62
    81.         moveq    #0,d0
    82.         move.b    $23(a0),d0
    83.         addq.b    #1,d0
    84.         cmpi.b    #6,d0
    85.         bhi.s    loc_51E80
    86.         move.b    d0,$23(a0)
    87.         add.w    d0,d0
    88.         move.w    word_51E86(pc,d0.w),$1C(a0)
    89.         add.w    d0,d0
    90.         move.l    off_51E94(pc,d0.w),$42(a0)
    91.  
    92. loc_51E62:
    93.         subq.b    #1,$25(a0)
    94.         bpl.s    locret_51E7E
    95.         move.b    #4,$25(a0)
    96.         move.b    $40(a0),d0
    97.         addq.b    #1,d0
    98.         bmi.s    locret_51E7E
    99.         move.b    d0,$40(a0)
    100.         bsr.w    Perform_Art_Scaling_S3
    101.  
    102. locret_51E7E:
    103.         rts
    104. ; ---------------------------------------------------------------------------
    105.  
    106. loc_51E80:
    107.         jmp    (Go_Delete_Sprite).l
    108. ; End of function sub_51E3A
    109.  
    110. ; ---------------------------------------------------------------------------
    111. word_51E86:    dc.w $20
    112.         dc.w $20
    113.         dc.w $10
    114.         dc.w 8
    115.         dc.w 8
    116.         dc.w 8
    117.         dc.w $200
    118. off_51E94:    dc.l ArtScaled_FleeingRobotnik
    119.         dc.l ArtScaled_FleeingRobotnik
    120.         dc.l ArtScaled_FleeingRobotnik+$1000
    121.         dc.l ArtScaled_FleeingRobotnik+$2000
    122.         dc.l ArtScaled_FleeingRobotnik+$3000
    123.         dc.l ArtScaled_FleeingRobotnik+$4000
    124.         dc.l ArtScaled_FleeingRobotnik+$5000
    125. ; ---------------------------------------------------------------------------
    Finally, insert this code after the even on the 'ArtKosM_Technosqueek' label.
    Code (Text):
    1. ArtScaled_FleeingRobotnik:    binclude "General/Sprites/Robotnik/Robotnik Fly Scaled.bin"
    2.     even
    You also need to add this as well after the whole 'ObjDat3_7375A' label.
    Code (Text):
    1.  
    2. ObjDat3_51F9C:    dc.l Map_ScaledArt
    3.         dc.w $3D9
    4.         dc.w $300
    5.         dc.b $20
    6.         dc.b $20
    7.         dc.b 0
    8.         dc.b 0
    Save the ASM, build the rom, input the Level Select code in Angel Island Zone Act 1, go to Launch Base Zone Act 2, Defeat the Egg Rocket, finish the Act, and watch the cutscene to see if it worked. You can also do this if you want to restore Big Arms for Sonic &/or Tails. If you have the newer Disassembly, it's (_unkF740).
    [​IMG]
     
    • Like Like x 9
    • Informative Informative x 2
    • Useful Useful x 1
    • List