don't click here

Basic Questions & Answers thread

Discussion in 'Engineering & Reverse Engineering' started by Tweaker, May 29, 2008.

  1. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,161
    68
    28
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    That is because the tails object needs to take the SS angle in consideration too when determining its orientation. I can write something more later, when I am back home; but you can likely compare how S3&K does the slot bonus stage.

    Edit: I think (but can't check atm) that the code in question is in Tails' animate function, in a branch reachable only by the tails.
     
  2. RetroKoH

    RetroKoH

    Member
    1,705
    73
    28
    S1Fixed: A successor to ReadySonic
    That has to do with the Tails_Animate subroutine, correct? I did see that, and put it in. Here is what that looks like right now: (for those who also want to do this... in S3K, v_ssangle is labeled as Stat_Table)

    Code (Text):
    1.  
    2.  
    3. @tails_gettail:
    4.         move.w  x_vel(a2),d1
    5.         move.w  y_vel(a2),d2
    6.         jsr (CalcAngle).l
    7.         cmpi.b  #id_Special,(v_gamemode).w
    8.         bne.s   @notSS
    9.         add.b   (v_ssangle).w,d0
    10.     @notSS:
    11.                 moveq   #0,d1
    12.         move.b  status(a0),d2
    13.         andi.b  #1,d2
    14.         bne.s   @1D002
    15.         not.b   d0
    16.         bra.s   @1D006
    17. ; ===========================================================================
    18.  
    19.     @1D002:
    20.         addi.b  #$80,d0
    21.  
    22.     @1D006:
    23.         addi.b  #$10,d0
    24.         bpl.s   @TAnim_Next
    25.         moveq   #3,d1
    26.    
    27.         @TAnim_Next:
    28.         andi.b  #$FC,render_flags(a0)
    29.         eor.b   d1,d2
    30.         or.b    d2,render_flags(a0)
    31.         lsr.b   #3,d0
    32.         andi.b  #$C,d0
    33.         move.b  d0,d3
    34.         lea (TailstailsAni_Directional).l,a1
    35.         move.b  #3,anim_frame_duration(a0)
    36.         bsr.w   @loadframe
    37.         add.b   d3,mapping_frame(a0)
    38.         rts
    39. ; End of function Tails_Animate
    40.  
    I get the feeling I'm missing something else, but I don't think it is in the SS Object. I could be wrong though.
     
  3. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,161
    68
    28
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    That is correct, yes. Hm. Can you show your code for Tails' tails? And can you ensure that the SS player object always sets the rolling animation?
     
  4. RetroKoH

    RetroKoH

    Member
    1,705
    73
    28
    S1Fixed: A successor to ReadySonic
    Code (Text):
    1.  
    2.  
    3. ; ---------------------------------------------------------------------------
    4. ; Object 03 - Tails' tails
    5. ; ---------------------------------------------------------------------------
    6.  
    7. Tailstails:                 ; XREF: Obj_Index
    8.         moveq   #0,d0
    9.         move.b  routine(a0),d0
    10.         move.w  Tailstails_Index(pc,d0.w),d1
    11.         jmp Tailstails_Index(pc,d1.w)
    12. ; ===========================================================================
    13. Tailstails_Index:
    14.         dc.w Tailstail_Main-Tailstails_Index      ; 0
    15.         dc.w Tailstail_Display-Tailstails_Index   ; 2
    16. ; ===========================================================================
    17. ; loc_1D212
    18. Tailstail_Main:
    19.         addq.b  #2,routine(a0)
    20.         move.l  #Map_Tails,mappings(a0)
    21.         move.w  #$790,art_tile(a0)
    22.         move.w  #$100,priority(a0)
    23.         move.b  #$18,width_pixels(a0)
    24.         move.b  #4,render_flags(a0)
    25.  
    26. Tailstail_Display:
    27.         movea.w parent(a0),a2 ; a2=character
    28.         move.b  angle(a2),angle(a0)
    29.         move.b  status(a2),status(a0)
    30.         move.w  x_pos(a2),x_pos(a0)
    31.         move.w  y_pos(a2),y_pos(a0)
    32.         andi.w  #$7FFF,art_tile(a0)
    33.         tst.w   art_tile(a2)
    34.         bpl.s   @display2
    35.         ori.w   #$8000,art_tile(a0)
    36.     @display2:
    37.         moveq   #0,d0
    38.         move.b  anim(a2),d0
    39.         btst    #5,status(a2)           ; is Tails about to push something?
    40.         beq.s   @display3               ; if not, branch
    41.         cmpi.b  #$63,mapping_frame(a2)  ; Is Tails in his pushing animation yet?
    42.         blt.s   @display3               ; If not yet, branch, and do not set tails' tail pushing animation
    43.         moveq   #4,d0
    44.     @display3:
    45.         cmp.b   $30(a0),d0
    46.         beq.s   Tail_1D288
    47.         move.b  d0,$30(a0)
    48.         move.b  TailsAniSelection(pc,d0.w),anim(a0)
    49.  
    50.     Tail_1D288:
    51.         lea (Ani_Tailstails).l,a1
    52.         bsr.w   Tails_Animate_2
    53.         bsr.w   Tailstails_LoadGfx
    54.         movea.w parent(a0),a1                   ; Move Tails' register to a1
    55.             move.w  invulnerable_time(a1),d0        ; Move Tails' invulnerable time to d0
    56.             beq.s   @skip                           ; Is invulnerable_time 0?  If so, always display his tails
    57.             addq.w  #1,d0                           ; Make d0 the same as old invulnerable_time's d0
    58.             lsr.w   #3,d0                           ; Shift bits to the right 3 times
    59.             bcs.s   @skip                           ; If the Carry bit is set, branch and display his tails
    60.             rts                                     ; Otherwise, do not display Tails' tails
    61.     @skip:
    62.             jmp     DisplaySprite                   ; Display Tails' tails
    63.  
    64. TailsAniSelection:
    65.         dc.b    0,0 ; TailsAni_Walk,Run ->
    66.         dc.b    3   ; TailsAni_Roll     -> Directional
    67.         dc.b    3   ; TailsAni_Roll2    -> Directional
    68.         dc.b    9   ; TailsAni_Push     -> Pushing
    69.         dc.b    1   ; TailsAni_Wait     -> Swish
    70.         dc.b    $A  ; TailsAni_Balance  -> Blank
    71.         dc.b    1   ; TailsAni_LookUp   -> Swish
    72.         dc.b    1   ; TailsAni_Duck     -> Swish
    73.         dc.b    0   ; TailsAni_Dash     ->
    74.                 dc.b    0,0 ; TailsAni_Dummy1,2     ->
    75.         dc.b    7   ; TailsAni_Spindash -> Spindash
    76.         dc.b    8   ; TailsAni_Stop     -> Skidding
    77.         dc.b    0,0 ; TailsAni_Float,2  ->
    78.         dc.b    0   ; TailsAni_Spring   ->
    79.         dc.b    0   ; TailsAni_Hang     ->
    80.         dc.b    0,0 ; TailsAni_Leap,2   ->
    81.         dc.b    0   ; TailsAni_Surf -> Hanging
    82.         dc.b    0   ; TailsAni_Bubble   ->
    83.         dc.b    0,0,0,0 ; TailsAni_Death,2,3,4  ->
    84.         dc.b    0,0 ; TailsAni_Hurt,Slide   ->
    85.         dc.b    0   ; TailsAni_Blank    ->
    86.         dc.b    0,0 ; TailsAni_Float4,5 ->
    87.         dc.b    0   ; TailsAni_GetBubStand  ->
    88.         dc.b    0,0,0   ; TailsAni_Fly,2,3  ->
    89.         dc.b    0,0,0   ; TailsAni_Swim,2,3 ->
    90.         even
    91.  
    92.         include "_anim\Tails tails.asm"
    93.  
    There's the code for Tails' tails

    Code (Text):
    1.  
    2.  
    3. [size=2]        [/size]move.b   #id_Roll,anim(a0)
    4.         cmpi.b  #1,character_id(a0) ; is this Tails?
    5.         bne.s   @nottails          ; if not, branch
    6.         move.b  #id_TailsTails,(v_objspace+$380).w ; load Obj03 (Tails' Tails) at $FFFFD000
    7.         move.w  a0,(v_objspace+$380+parent).w ; set its parent object to this
    8.     @nottails:
    9.                 bset    #2,status(a0)
    10.         bset    #1,status(a0)
    11.  
    Here's a snippet from the INIT code for the SS Object. the animation is set, (All characters share the same values for each animation, so the id_Roll constant is correct, and not an issue).
    Also the Tails do load with Tails only as seen below, as done in S3K's slot machine stage object.
     
  5. Jimmy Hedgehog

    Jimmy Hedgehog

    Member
    1,728
    8
    18
    England - Slough
    Getting the motivation to continue old projects
    How would I go about editing the text on the Special Stage results screen in the Sonic 2 HG disassembly? The "Chaos Emerald" part specifically. I can't really see a way to load the mappings in SonMapEd (unless I'm missing something, I'm pretty sure it's object 6F but loading those mappings didn't help any).
     
  6. FireRat

    FireRat

    Nah. Fuck it. Banned
    48
    10
    8
    Chile
    Mobius Evolution 2
    I have a little question about AS:

    Let's suppose I made a macro to replace the JMP command, like this:

    Code (ASM):
    1. jmp:    macro   addr
    2.         dc.l    "_JMP"
    3.         dc.l    addr
    4.     endm
    5.  
    It would work fine if in the main code I call it as "jmp labelX", but it won't if I call it as "jmp (LabelX).l" or "jmp (LabelX).w", because then it incorrectly tries to build it with a "dc.l (LabelX).l", which is invalid.
    Is there any way I could strip the parenthesis and data size off?
     
  7. MarkeyJester

    MarkeyJester

    Original, No substitute Resident Jester
    2,236
    491
    63
    Japan
    The issue here is down to "invulnerable_time". After searching up on what that value was, I found it to be $30, which is fine. Except the characters in the special stage don't get hurt, and instead, that space is used for storing the ID of the blocks being touched in the special stage. This is of course, a conflict between the two.

    The simple fix is to skip that hurt section of the code, on the condition that you're in the special stage. Everything else should function as normal.
     
  8. redhotsonic

    redhotsonic

    Also known as RHS Tech Member
    1,587
    10
    18
    United Kingdom
    YouTuber
    Another quick question, which isn't really hacking related, but it's not worth making a new topic. Has anyone downloaded Sonic 1 for the PS3 (Backbone's version)? If so, you do get button delays? Every button I press, it takes a second to register, making the game very hard (or impossible) to play. So I press the jump button, he jumps a second later.
     
  9. Ravenfreak

    Ravenfreak

    2 Edgy 4 U Tech Member
    3,143
    228
    43
    O'Fallon Mo
    Sonic 1 Game Gear Disassembly
    It's also the case on the 360 version as well. Except for I don't have Sonic 1 but Sonic 3 and it does the same thing. It's the only thing that's holding me back from getting all the achievements in the game... >_> I believe it's a emulation error.
     
  10. Clownacy

    Clownacy

    Tech Member
    1,093
    666
    93
    I've read through the Secrets pages and the TCRF pages on the Sonic titles a bunch of times in the past, yet recently in my messing around, I happened across an unused third frame in S3K's Super Sonic's standing animation, and I haven't seen it documented anywhere. Did anyone know about this? It seems too obvious to be unknown... It no longer had its own DPLC entry and just used frame 1's, so I had to recreate it, but it can be easily done, and gives you a complete sprite. The one with the most descended quills is the one you're looking for.

    [​IMG]
     
  11. Tiddles

    Tiddles

    Diamond Dust Tech Member
    471
    0
    0
    Leicester, England
    Get in an accident and wake up in 1973
    Sonic 3 Complete and Sonic Classic Heroes use a third frame, with the former animating it 1-2-3-2-1 as your image does, and the latter doing 1-2-3-1-2-3. Most of the S3C Full Super frames come from SCH, so it probably turned up when they were implemented, but I wasn't directly aware of it, as That One Jig and Neo have handled pretty much all of the graphics since they've been involved. I haven't seen it documented either, but it might be one of those things that is lost to time in a forum post somewhere.
     
  12. Jimmy Hedgehog

    Jimmy Hedgehog

    Member
    1,728
    8
    18
    England - Slough
    Getting the motivation to continue old projects
    While I normally wouldn't quote/repeat a question (and I feel slightly incessant for doing so), I can't seem to wrap my head around this.

    Also, to Sonic 1 2005 Hivebrain disassembly for a second, is it safe to assume you'd edit Special Stage starting positions the same way you would for normal stages? Probably a silly question but I figured I'd throw it in with the Sonic 2 HG question.
     
  13. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,785
    365
    63
    SonLVL
    Your problem with the special stage result mappings is likely due to the fact that the object has the base tile set to 0, meaning it can only be viewed and edited properly if you load a full VRAM dump from the results screen as the art file. The Genesis Savestate Viewer tool can extract the VRAM from a savestate if your emulator doesn't have a VRAM dumping option.
     
  14. Steelrush

    Steelrush

    Every good deed has its reward. Member
    19
    0
    1
    A humid place
    Blaze the Cat in Sonic 2
    I have a few questions regarding Sonic 2;

    First, I would like to know how to modify the behavior of the Emerald Hill Zone boss. I managed to figure out how to alter its height, however I can't figure out how to edit its speed. Also, is there a way to get it to fire its drill before its one hit away from being destroyed?

    Another thing, if I wanted to extend the wait time at the title screen (before the game enters demo mode), how would I do that? (I'm using the 2007 Xenowhirl disassembly by the way.)
     
  15. Shockwave

    Shockwave

    Member
    26
    0
    1
    LA, CA
    Sonic: South Island Warped
    As far as modifying speed goes, anything in the object's code with x_vel next to it can be used to change the horizontal speed. For example:
    [68k]loc_2F2E0:
    subi.w #1,objoff_2A(a0)
    bpl.w JmpTo35_DisplaySprite
    move.w #-$200,x_vel(a0)[/68k]
    You can change the -$200 to another value to modify how fast the boss travels across the screen. And to change when it fires the drill:
    [68k]loc_2F8AA:
    cmpi.b #1,collision_property(a1)[/68k]
    Change the 1 to something else to have it fire at that amount of hits instead.

    I don't work with Sonic 2 too much so I don't know what controls the amount of time spent on the title screen.
     
  16. RetroKoH

    RetroKoH

    Member
    1,705
    73
    28
    S1Fixed: A successor to ReadySonic
    YES, but with a small difference. Note that with editing Special stage positions... X-$2E0 and Y-$2B0 to get your actual position on the layout. Otherwise it's identical.
     
  17. Felik

    Felik

    Member
    1,900
    94
    28
    Can someone tell me please how exactly air drag works in classic Sonics? Does it occur only when Sonic jumps or every time he is in the air (including being launched off a spring or a curve)?
     
  18. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    Is THIS what you were expecting?


    Also, in my hack, of Sonic 2, I'm having an issue with Object C9, the title screens palette changer.
    One of the palettes in my hack is 2 lines long instead of 1, and while I was able to get it to read the right entry length when the player skips Sonic & Tails' appearance with start, I can't get both lines to load when the player lets the intro finish.

    Here's what I have:

    Code (Text):
    1. PaletteChangerDataIndex: offsetTable
    2.     offsetTableEntry.w ObjC9_TitlePalette1  ;  0
    3.     offsetTableEntry.w ObjC9_TitlePalette2  ;  2
    4.     offsetTableEntry.w ObjC9_EndingPalette1 ;  4
    5.     offsetTableEntry.w ObjC9_EndingPalette2 ;  6
    6.     offsetTableEntry.w off_133BC    ;  8
    7.     offsetTableEntry.w off_133C8    ; $A
    8.     offsetTableEntry.w off_133D4    ; $C
    9.     offsetTableEntry.w off_133E0    ; $E
    10.  
    11. C9PalInfo macro codeptr,dataptr,loadtoOffset,length,fadeinTime,fadeinAmount
    12.     dc.l codeptr, dataptr
    13.     dc.b loadtoOffset, length, fadeinTime, fadeinAmount
    14.     endm
    15.  
    16. ObjC9_TitlePalette1:    C9PalInfo Pal_AddColor, Pal_1342C, $20, $F,2,$15 ;The emblem (Palette line 2)
    17. ObjC9_TitlePalette2:    C9PalInfo   loc_1344C, Pal_1340C, $40,$1F,8,$15 ;Background (2 lines), last 2 palette lines.
    Does anyone know what I have wrong?
     
  19. Felik

    Felik

    Member
    1,900
    94
    28
    I've read that, duh. It implies that air drag happens all the time Sonic is in the air but I want to make sure.
     
  20. Mercury

    Mercury

    His Name Is Sonic Tech Member
    1,740
    21
    18
    Location Location
    AeStHete
    Yes, it happens all the time he's airborne, not just for jumps. I just checked Sonic 2.