S2:AE update topic/ rika needs help topic

Discussion in 'Engineering & Reverse Engineering' started by Rika Chou, May 4, 2006.

Thread Status:
Not open for further replies.
  1. Rika Chou

    Rika Chou

    Tech Member
    5,254
    116
    43
    Due to my technical knowelege being very limited, I need some help with something.

    When you get to the ARZ boss, the screen locks at the coordinates:

    X: 2A40
    Y between 03F8 and 0400


    Now. I want the Y coordinated to be locked between 03F8 and 0420.

    (Y is the vertical coordinates, right?)

    Help plz. I had a look at the DSR (or whatever it's being called these days...DLE?) and couldn't figure it out.
     
  2. jman2050

    jman2050

    Teh Sonik Haker Tech Member
    633
    0
    16
    I believe what you're looking for is between offset $F4EE and $F51E (or in the disassembly, look for loc_F4EE). There are two instances of $400 there that you should change to $420 for your purposes
     
  3. drx

    drx

    mfw Researcher
    2,236
    214
    43
    :rolleyes:
    beat me to it...
     
  4. Eli White

    Eli White

    Member
    60
    0
    0
    Thanks much.

    I thought it would be something like that, but I was looing for $0400, instead of $400.
     
  5. Rika Chou

    Rika Chou

    Tech Member
    5,254
    116
    43
    I might as well ask some other things that I can't figure out.

    How would I edit the pallet line that object 19 3x (the WFZ platforms) reads from? I usually know how to do this, but it isn't working for some reason.

    Is there an easy way with hex that I could edit the ARZ wasp object that it has an extra animation frame, and animates a bit slower?
     
  6. Tweaker

    Tweaker

    Misfit
    12,389
    1
    0
    Palette line is defined by mappings, isn't it? I could've sworn it was.

    For the wasp, you'll want to edit the animation script. Relocate it, then add another byte to the end of the script before the return byte. Then you need to find the byte that defines speed (I forget which, may be near the start of the script) and lower it as needed.

    Sorry for being so vague, but that should cover it. I'd look at a disassembly to find the needed locations.
     
  7. StephenUK

    StephenUK

    Liquor in the front, poker in the rear Tech Member
    1,675
    0
    16
    Manchester, UK
    Quackshot Disassembly
    Not exactly. The palette line in the mappings is more like +x palette lines as opposed to a defined base line. That's usually done in the VRAM loading, and is the first nybble of the word. The last 3 nybbles are the tile starting address. It can be done either way, through mappings or VRAM, but if you look at most objects, it tends to be done by VRAM.

    EDIT:

    After a bit of looking, I've found what you are looking for. The animation script for the Whisp badnik is located at $36A4A, with the offset index pointing to it being at $36A48. The pointer to that offset index is at $36A2C. The string there is:

    43F9 0003 6A48

    If you want to relocate so you can expand the animation script, just change 0003 6A48 to the new location of the offset index as you would with any other pointer, and make sure the offset index is correctly pointing to the relocated data (if you relocate both together, the offset index won't need changing).

    The script consists of the values 1, 0, 1, and FF at the moment. This means that it plays frames 1, 0, 1 and then stops, unless the object code tells it to keep loading the animation, which I don't think it does. To add a new frame of animation, edit the mappings for the object to include the new frame, make a note of the frame number, and add it to the animation script in the necessary place. Just remember that animation scripts need to be an even number of bytes, so if you add one frame, just add an extra $FF at the end of the script.

    I can't actually see the animation speed value in the code. I'm sure it's $1E in the SST, but nothing seems to reference to that in the code. A workaround for this would be to play around with the animation script. If you want the animation at half speed, you could change 1, 0 ,1, FF to 1, 1, 0, 0, 1, 1, FF, FF. If not, you'll have to just play around until you get something you're happy with.

    Someone else might know where the animation speed for the Whisp is, but I can't see it in the code. If you need any more help, feel free to ask. Hope this helps ;)
     
  8. Rika Chou

    Rika Chou

    Tech Member
    5,254
    116
    43
    I know this already, but when I edit this, nothing changes. Maybe I'm not looking at the right place. I will check again, I guess.

    Edit: AHHH! Stupid me. I relocated the VRAM location for this object, and forgot. So when I went to go change the pallet line, I was looking for the wrong VRAM location. I got it now.

    Thanks. This helps me a buch.
     
  9. Sonic 65

    Sonic 65

    Tech Member
    A buch? *shot*
     
  10. Rika Chou

    Rika Chou

    Tech Member
    5,254
    116
    43
    SUK: It looks like you told me how to change the animations they use when they fly away, but not when they are trying to attack you.


    Edit: Oh, okay. There is more than one pointer to the offset index. There is actually four. I changed them all and it works fine now. ;)
     
  11. StephenUK

    StephenUK

    Liquor in the front, poker in the rear Tech Member
    1,675
    0
    16
    Manchester, UK
    Quackshot Disassembly
    Ah sorry bout that. I was just doing it on a quick glance, since I was doing college work at the same time :D
     
  12. Rika Chou

    Rika Chou

    Tech Member
    5,254
    116
    43
    More questions ahoy!

    1: I am putting a new level into the CNZ level slot. I have new art, mappings, etc etc. I have made the level use the BG deformation data from MZ. This causes problems, when the level is started, part of the BG is misplaced for some reason. Any help?

    2: On this same level. When the level starts, his mappings are all jumbled. I have had this problem before. What causes this? How can I fix it?
     
  13. StephenUK

    StephenUK

    Liquor in the front, poker in the rear Tech Member
    1,675
    0
    16
    Manchester, UK
    Quackshot Disassembly
    The background problem, if it's what I think it is, is caused by Sonic's start position. There are 2 ways to fix this:

    1. Move Sonic's start position until the background ends up in the right place. Requires quite a bit of trial and error, and will force you to rethink your layout.

    2. Edit the mappings for the background tiles so that the background will appear in the right place. Probably the easiet to do, and less time consuming.

    As for the Sonic bug, I too have had this before but I have no idea what causes it. What was the last thing you edited before this started happening? If you know, I might be able to help, but I've not really found a real reason for it happening. It used to happen to me after Sonic would change timezone, but I applied a small temporary fix to counter the effect until I find the real reason behind it.
     
  14. Tweaker

    Tweaker

    Misfit
    12,389
    1
    0
    Isn't it possible to be able to make an index of pre-defined initial BG positions to fix this problem? It's the one thing keeping me from releasing Sonic 2 Megamix at the moment, and I know I shouldn't have to rethink my layouts, since Esrael was able to have his work without any problems at all.
     
  15. StephenUK

    StephenUK

    Liquor in the front, poker in the rear Tech Member
    1,675
    0
    16
    Manchester, UK
    Quackshot Disassembly
    Probably is, but I haven't looked into it. Rika doesn't work in asm anyway, so even if it could be done, I doubt he could do it in hex. I'll look into it properly anyway. The other thing, like I said, is to shift the background mappings around until you get what you want. I've done that before and it usually comes out alright.
     
  16. jman2050

    jman2050

    Teh Sonik Haker Tech Member
    633
    0
    16
    There is an array at location $C296 in the ROM. This array is a list of offsets ordered by zone number, which points to code for each zone that determines the starting deformation data for the level. This is how the BG gets repositioned correctly depending on where the camera is when a level restarts. For example, for MZ, the code is as follows at $C2E4.

    Code (Text):
    1. asr.w   #2,d0
    2. move.w  d0,(BGCamera_Y1).w
    3. asr.w   #3,d1
    4. move.w  d1,(BGCamera_X1).w
    5. rts
    Ignore the labels. Also note that d0 is the Y position of the main camera and d1 is the X position. However, the code for CNZ's starting deformation at $C364, which I presume you're still using, is this:

    Code (Text):
    1. clr.l   (BGCamera_X1).w
    2. clr.l   (BGCamera_Y1).w
    3. clr.l   (c).w
    4. rts
    The solution? Go to the offset list at the location outlined above and change the offset for CNZ's level slot © so that it points to the offset for MZ. That should fix your problem in short order.

    As for Sonic' mappings, have no clue what causes that.
     
  17. Rika Chou

    Rika Chou

    Tech Member
    5,254
    116
    43
    All fixed now. I know what was causing it.

    Jman: Thanks so much, I've been looking for this for quite a while.
     
  18. Tweaker

    Tweaker

    Misfit
    12,389
    1
    0
    For the quick recap, if I want a zone to start with uppermost initial BG regardless of start position (say, EHZ style), then I just change a few pointers?

    If so, excellent. I may work on my Sonic 2 hack again.
     
  19. Rika Chou

    Rika Chou

    Tech Member
    5,254
    116
    43
    Anyone know the art location for the falling rocks from the MCZ boss? I looked, and it doesn't seem to be with the MCZ boss art.


    Also.... umm, anyone know what this circle is? I don't remember seeing it before. (probobly loaded with wrong palette)

    [​IMG]
     
  20. jman2050

    jman2050

    Teh Sonik Haker Tech Member
    633
    0
    16
    I would guess that it'd be with the Mystic Cave level art.

    As for the circle, no clue O_o
     
Thread Status:
Not open for further replies.