Basic Questions & Answers thread

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

  1. Screenshot (8).png
     
  2. Wafer

    Wafer

    Giving me a little Mania Member
    124
    28
    28
    Disassembling n00bs, WIP
    I know this isn't a technical question, but I thought I'd put it here because it kinda follows on from my posts above.

    Whilst trying to solve the cutscene issue, I ended up doing a lot of investigation using r57shell's Gens mod, I even found the place where Sonic was being told to look up before I decided there would probably be a faster solution.

    My question then, is: Would it help us as a community to have a guide on using a debugger, with an example being "let's track down and replace Sonic's behaviour in a cutscene"? I've got some time on my hands for the next few months(!) so I'd be happy to produce a thorough guide based on the tools and methods I use and the resources available, and if it was on the wiki other people could adapt the guide to support other debuggers.
     
    Last edited: Feb 9, 2020
  3. E-122-Psi

    E-122-Psi

    Member
    1,835
    17
    18
    Cutscenes do tend to be a recurrent issue when reprogramming movesets, so that could be helpful I suppose.
     
  4. Random Gaming

    Random Gaming

    Just a user on Sonic Retro Member
    35
    5
    8
    Greece
    Sonic 1 Better Edition
    Hey, so I have a bit of a technical question, how easy would it be to expand Sonic’s mappings in Sonic 1 beyond $FF (practically $FC)? Would there have to be big engine changes, or will some small changes do the trick?
     
  5. Inferno

    Inferno

    Previously Inferno Gear Member
    7
    1
    3
    Sonic 2 Definitive
    The basics are that you'd have to expand mapping_frame (or $1A) from a byte to a word (For $FFFF frames) by finding a conflict-free spot, then you'd have to change every single mention of that SST in the game code to be a word, and that'd make every object capable of using $FFFF frames. However, you'd also have to modify BuildSprites: to properly use the word. In addition, you'd also have to move the animation flags to another value.

    Or you could just take the S3 route and load different mappings and DPLCs once Sonic reaches a certain animation, therefore kind of expanding the number of frames Sonic has.
     
  6. Fred

    Fred

    Formerly known as 'Neo' Oldbie
    1,490
    43
    28
    Portugal
    Sonic 3 Unlocked
    This is completely misleading; S3 is still very much bound to the $FC frame limit. The DPLC hack is only there so Sonic and Tails can use more than one "page" of art -- Sonic has a lot of unique art due to Super Sonic, whereas Tails is mostly streamed from the S3 cart except for some extra anims added in S&K, which are on a separate "page" on the S&K cart.
     
    • Informative Informative x 1
    • List
  7. Inferno

    Inferno

    Previously Inferno Gear Member
    7
    1
    3
    Sonic 2 Definitive
    Sorry for that, then. I could of worded it better. Thanks for correcting me.

    I guess what I was getting at was more "you can also just use checks to swap out the mappings and DPLCs loaded once you reach a certain threshold".
     
  8. Fred

    Fred

    Formerly known as 'Neo' Oldbie
    1,490
    43
    28
    Portugal
    Sonic 3 Unlocked
    Yes this a good point, although watch out if doing this with Sonic, as the game already changes his mappings pointer on the fly when he turns/loses Super.
     
  9. SyntaxTsu

    SyntaxTsu

    Member
    70
    15
    8
    So, I managed to implement some animated tiles for one of my zones (read: by copying the MTZ routine and cutting out unneeded bits, as all I wanted was the rotating mesh), and... I don't quite know how, but it somehow messed up the Options menu's own animated tile routine. Note that no zones are affected by this.
    The only way I think this could have happened myself is because of where I placed said animated tiles.
    Note that I am using MainMemory's Sonic 2 Sound Driver Plus Disassembly - although this shouldn't really have much effect on what is going on, it might still be part of it.

    The relevant definitions for s2.constants.asm are below:
    Code (Text):
    1. ; STZ
    2. ArtTile_ArtUnc_STZCylinder                = $00CD
    3. ArtTile_ArtUnc_STZFrontClouds            = $00DD
    4. ArtTile_ArtUnc_STZBackClouds            = $00E5
    And the code it matches with from s2.asm (note that it matches with MTZ's code) is below:
    Code (Text):
    1. ;This section of code is placed between HPZ and OOZ's animation scripts.
    2.  
    3. Animated_STZ:    zoneanimstart
    4.     ; Spinning metal cylinder
    5.     zoneanimdecl 0, ArtUnc_STZCylinder, ArtTile_ArtUnc_STZCylinder, 8,$10
    6.     dc.b   0
    7.     dc.b $10
    8.     dc.b $20
    9.     dc.b $30
    10.     dc.b $40
    11.     dc.b $50
    12.     dc.b $60
    13.     dc.b $70
    14.  
    15.     zoneanimend
    16.  
    17. ;This section is between HPZ's and OOZ Animated Pattern Mappings.
    18. APM_STZ:    begin_animpat
    19.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$E,0,0,3,0),make_block_tile(ArtTile_ArtUnc_STZCylinder+$E,0,0,3,0)
    20.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$F,0,0,3,0),make_block_tile(ArtTile_ArtUnc_STZCylinder+$F,0,0,3,0)
    21.  
    22.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$C,0,0,3,0),make_block_tile(ArtTile_ArtUnc_STZCylinder+$C,0,0,3,0)
    23.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$D,0,0,3,0),make_block_tile(ArtTile_ArtUnc_STZCylinder+$D,0,0,3,0)
    24.  
    25.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$A,0,0,3,0),make_block_tile(ArtTile_ArtUnc_STZCylinder+$A,0,0,3,0)
    26.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$B,0,0,3,0),make_block_tile(ArtTile_ArtUnc_STZCylinder+$B,0,0,3,0)
    27.  
    28.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$8,0,0,3,0),make_block_tile(ArtTile_ArtUnc_STZCylinder+$8,0,0,3,0)
    29.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$9,0,0,3,0),make_block_tile(ArtTile_ArtUnc_STZCylinder+$9,0,0,3,0)
    30.  
    31.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$6,0,0,3,0),make_block_tile(ArtTile_ArtUnc_STZCylinder+$6,0,0,3,0)
    32.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$7,0,0,3,0),make_block_tile(ArtTile_ArtUnc_STZCylinder+$7,0,0,3,0)
    33.  
    34.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$4,0,0,3,0),make_block_tile(ArtTile_ArtUnc_STZCylinder+$4,0,0,3,0)
    35.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$5,0,0,3,0),make_block_tile(ArtTile_ArtUnc_STZCylinder+$5,0,0,3,0)
    36.  
    37.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$2,0,0,3,0),make_block_tile(ArtTile_ArtUnc_STZCylinder+$2,0,0,3,0)
    38.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$3,0,0,3,0),make_block_tile(ArtTile_ArtUnc_STZCylinder+$3,0,0,3,0)
    39.  
    40.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$0,0,0,3,0),make_block_tile(ArtTile_ArtUnc_STZCylinder+$0,0,0,3,0)
    41.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$1,0,0,3,0),make_block_tile(ArtTile_ArtUnc_STZCylinder+$1,0,0,3,0)
    42.  
    43.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$E,0,0,3,1),make_block_tile(ArtTile_ArtUnc_STZCylinder+$E,0,0,3,1)
    44.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$F,0,0,3,1),make_block_tile(ArtTile_ArtUnc_STZCylinder+$F,0,0,3,1)
    45.  
    46.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$C,0,0,3,1),make_block_tile(ArtTile_ArtUnc_STZCylinder+$C,0,0,3,1)
    47.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$D,0,0,3,1),make_block_tile(ArtTile_ArtUnc_STZCylinder+$D,0,0,3,1)
    48.  
    49.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$A,0,0,3,1),make_block_tile(ArtTile_ArtUnc_STZCylinder+$A,0,0,3,1)
    50.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$B,0,0,3,1),make_block_tile(ArtTile_ArtUnc_STZCylinder+$B,0,0,3,1)
    51.  
    52.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$8,0,0,3,1),make_block_tile(ArtTile_ArtUnc_STZCylinder+$8,0,0,3,1)
    53.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$9,0,0,3,1),make_block_tile(ArtTile_ArtUnc_STZCylinder+$9,0,0,3,1)
    54.  
    55.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$6,0,0,3,1),make_block_tile(ArtTile_ArtUnc_STZCylinder+$6,0,0,3,1)
    56.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$7,0,0,3,1),make_block_tile(ArtTile_ArtUnc_STZCylinder+$7,0,0,3,1)
    57.  
    58.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$4,0,0,3,1),make_block_tile(ArtTile_ArtUnc_STZCylinder+$4,0,0,3,1)
    59.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$5,0,0,3,1),make_block_tile(ArtTile_ArtUnc_STZCylinder+$5,0,0,3,1)
    60.  
    61.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$2,0,0,3,1),make_block_tile(ArtTile_ArtUnc_STZCylinder+$2,0,0,3,1)
    62.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$3,0,0,3,1),make_block_tile(ArtTile_ArtUnc_STZCylinder+$3,0,0,3,1)
    63.  
    64.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$0,0,0,3,1),make_block_tile(ArtTile_ArtUnc_STZCylinder+$0,0,0,3,1)
    65.     dc.w make_block_tile(ArtTile_ArtUnc_STZCylinder+$1,0,0,3,1),make_block_tile(ArtTile_ArtUnc_STZCylinder+$1,0,0,3,1)
    66. APM_STZ_End:
    Sonic2Mod_StrangeAnimatedTileIssue.png

    EDIT: Noticed that Sonic's 3D rotation sprites bugged out as well... Man, Sonic 2 can be sensitive. Seems unrelated to the above, though - as nulling out the animation scripts fixes the options menu...
     
    Last edited: Feb 14, 2020 at 11:47 PM
  10. MainMemory

    MainMemory

    Have no fear...Amy Rose is here! Tech Member
    4,372
    41
    28
    SonLVL
    It sounds like your art is crossing a 128kb boundary in the ROM, which messes up the DMA transfers. This explains both of your broken art problems. There's a post about it here.