don't click here

Basic Questions & Answers thread

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

  1. where can I learn ASM? Is it very hard to learn?
     
  2. You can't really 'learn' it. It's code, look at the disassemblies on the wiki if you want a 'sample'. To 'learn' it just look around at things, (That's why they're labeled '; things') bra is branch, etc. The wiki has a lot of info to help you out :rolleyes:
     
  3. Jimmy Hedgehog

    Jimmy Hedgehog

    Member
    1,728
    8
    18
    England - Slough
    Getting the motivation to continue old projects
    How do you learn it? Read through the ASM and see what each bit does, and RHS also did a general guide to ASM if I remember rightly. It's still not as easy as it sounds. It won't be a walk in the park, that's for sure. I'm not sure with a lot of it myself really.

    And the answer to that last question is completely a matter of opinion. Depends on the person really.
     
  4. Thanks for the help. By the way, where can I find this general guide?
     
  5. Spanner

    Spanner

    The Tool Member
  6. Twilight

    Twilight

    Member
    51
    0
    6
    Michigan
    A Sonic the Hedgehog hack
    Yeah, how do I change the starting level in Sonic the Hedgehog 2?
     
  7. Chobbsy

    Chobbsy

    Member
    4
    0
    1
    Is there an easier way to edit the mappings of the title screen in sonic 1, I cant get SonMapEd to work with it, I've tried using both the compressed and uncompressed files and both just show garbled tiles.

    Is there something I'm missing or can it only be hex edited?
     
  8. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    How can I make an object check if Sonic touches it?
     
  9. Malevolence

    Malevolence

    Tech Member
    274
    0
    16
    Well, what do you want it to do, there are a few ways to code this and depending on what you want it to do, there could be easier ways.
     
  10. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    I want to make an object push sonic forward when he touches it. Pretty much like the giant red rings in Sonic heroes or Sonic Unleashed.
     
  11. Malevolence

    Malevolence

    Tech Member
    274
    0
    16
    Well, I was going to either suggest setting a certain collision for the object (01) or you could take sonic's X position and subtract it from the object's and if he's within it's radius to branch to a routine which would push him.
     
  12. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    I was going to make an edit of the GHZ tunnel object to accomplish this task, but that failed.

    How exactly can I make it check for him? I am not sure how to set an object's radius or make it check if Sonic is near it.
     
  13. Malevolence

    Malevolence

    Tech Member
    274
    0
    16
    Code (ASM):
    1. TestPosition:  
    2.     move.w  ($FFFFB008).w,d2    ;Sonic X position to d2
    3.     move.w  8(a0),d3    ; Object's X position to d3
    4.     sub.w   d2,d3       ; subtract from object's position
    5.     tst.w   d3
    6.     bpl.s   Itspositive     ; branch if positive
    7.     neg.w   d2      ; if not, make positive
    8.     moveq   #1,d4       ; notate that it was negative
    9.  
    10. Itspositive:
    11.     cmp.w   #6,d2       ; check if sonic is within 5 pixels of the object
    12.     bge.s   NotCloseEnough  ; if greater than or equal to 6 pixels, branch
    13.     addq.b  #2,$24(a0)  ; increase routine
    14.     cmp.w   #1,d4       ; test if sonic was on a different side
    15.     beq.s   GoRight     ; if so branch to a routine that will make the object go right
    16.     move.w  #-$40,$10(a0)   ; go left
    17.  
    18. NotCloseEnough:
    19.     rts
    20.  
    21. GoRight:
    22.     move.w  #$40,$10(a0)    ; going right speed
    23.     rts
    I think that should do it, but you may have to convert some things to meet your needs.
     
  14. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    Not exactly working, I am sending you the code through PM, so I don't take up 2 more pages in this thread.
     
  15. A little above loc_3CE4, you have this line:
    Code (ASM):
    1.     move.w  d0,(Current_ZoneAndAct).w
    Change that to
    Code (ASM):
    1.     move.w  #$XXXX,(Current_ZoneAndAct).w
    where $XXXX is the zone and act ID. Make a similar replacement in loc_909A.
     
  16. Mr. Mash

    Mr. Mash

    All fanbases are awful Member
    1,440
    0
    0
    drawing
    I used Sonik Sprite to replace sonic 2's sprites with metal sonic. It works quite well, except the top of his head on the 'walking' animation shuffles around, how do I get it to stay in one piece?
     
  17. Anthall

    Anthall

    Spambot Member
    235
    0
    0
    Leicester, UK
    Sonic the Hedgehog - The Final Showdown
    I have a bit of a problem with a monitor I am building, I am replacing the shoes monitor, with something a little more useful.

    I am trying to find the RAM offset that controls Sonic's jump hack, I have found this in the disassembly:

    btst #6,$22(a0)

    I know this controls Sonic's jump height, as changing the value will increase/decrease Sonic's height, but for the whole game.

    I am writing the code for the monitor, but I have looked at the SCHG:Sonic the Hedgehog/RAM Editing section to find the RAM offset of Sonic's jump height, but there was none.

    I looked at the top of the page and it states that "For use in disassemblies, simply add $FF0000 for addresses below $8000 and $FFFF0000 for addresses above or equal to $8000"

    I have tried to use these two following codes, but with no luck:

    move.w #$B,($FF0022).w
    move.w #$B,($FFFF0022).w

    I don't know if I am being dull yet again, but I can't seem to figure out what I am doing at all, but any help appreciated, thanks

    P.S. I know about the extra Obj01_ChkShoes.
     
  18. Mairtrus

    Mairtrus

    Get a load of this!! Tech Member
    27
    0
    0
    Mendoza, Argentina
    Sonic Z. The Z DOESN'T means nothing.
    This is because the Sonic data is stored in the offset $D000-$D03F, so the offset $22 is really the offset $FFFFD022.

    EDIT: Oh, also, I forgot something. The height is controlled by the offset $16; the bit 6 in the offset $22 just is used to check when Sonic is jumping.
     
  19. nineko

    nineko

    I am the Holy Cat Tech Member
    6,309
    486
    63
    italy
    Code (Text):
    1. Sonic_Jump:         ; XREF: Obj01_MdNormal; Obj01_MdRoll
    2.         move.b  ($FFFFF603).w,d0
    3.         andi.b  #$70,d0 ; is A, B or C pressed?
    4.         beq.w   locret_1348E; if not, branch
    5.         moveq   #0,d0
    6.         move.b  $26(a0),d0
    7.         addi.b  #$80,d0
    8.         bsr.w   sub_14D48
    9.         cmpi.w  #6,d1
    10.         blt.w   locret_1348E
    11.         move.w  #$680,d2; KEEP AN EYE ON THIS LINE
    12.         btst    #6,$22(a0)
    13.         beq.s   loc_1341C
    14.         move.w  #$380,d2; AND THIS LINE
    $680 is the "strength" of the jump while underwater; $380 is the "strength" of the jump while not underwater.
    So your code should alter d2, and you can do that before the " jsr (CalcSine).l". After that line it's too late to do anything.

    If you need further help on this, feel free to ask. But don't steal the feather monitor :p
     
  20. Mairtrus

    Mairtrus

    Get a load of this!! Tech Member
    27
    0
    0
    Mendoza, Argentina
    Sonic Z. The Z DOESN'T means nothing.
    These are related to Sonic 1:
    1) Somebody knows where are located or how to change the start position of Sonic in each level and in the end scene?
    2) The same as above, but related to the position of the signpost ...
    3) Where are located the array that contain the height and the width of each level? I mean, from where take this info SonED2 when loads a level?
    4) What is the routine that controls in certain sectors (for example, the boss battle), Sonic can't get out of the screen, and in other sectors (when the prison capsule is destroyed or when you pass the signpost) you can get out through the right side of the screen, although the camera doesn't follow Sonic?