don't click here

Basic Questions & Answers thread

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

  1. Blastfrog

    Blastfrog

    See ya starside. Member
    Random question (not going to try this yet, just wanting to know if it's possible), how possible is it to get Sonic 2's engine to display all 240 lines in PAL mode?
     
  2. Selbi

    Selbi

    The Euphonic Mess Member
    1,497
    48
    28
    Northern Germany
    Sonic ERaZor
    Not at all. This has nothing to do with the "Sonic 2 engine", it is the console itself, which is limited to 320x224.
     
  3. Blastfrog

    Blastfrog

    See ya starside. Member
    What about the PAL version of Ristar and Chaotix? Those were in 320x240. I know the resolution is 224 for NTSC machines, but I was referring to PAL, which it is possible.
     
  4. E-122-Psi

    E-122-Psi

    Member
    2,470
    612
    93
    EDIT: Okay found it. Thanx.

    Also figured out the mappings for the S2 title animations from earlier (obj0E, labelled the title sparkles in the ASM). I'm still having trouble finding the coding that activates and positions Sonic and Tails' title sprites however, likely because it is connected with all the other sparkle animations in the ASM coding).
     
  5. Machenstein

    Machenstein

    Member
    830
    0
    0
    Is there a way to reduce the levels in Sonic 1 to two acts per zone instead of three?
     
  6. Selbi

    Selbi

    The Euphonic Mess Member
    1,497
    48
    28
    Northern Germany
    Sonic ERaZor
    Many ways exist. The easiest one is to modify the level order, to go directly to the next zone after beating two acts and simply ignoring every third act.
     
  7. Machenstein

    Machenstein

    Member
    830
    0
    0
    I'm completely new at this, so forgive me for asking how. Would I edit lvl_ord.bin with a hex editor using this guide? My aim is actually to replace Act 2 of each zone with Act 3 since Act 3 is the one with the bosses, the exceptions being Scrap Brain Zone and Final Zone.
     
  8. Selbi

    Selbi

    The Euphonic Mess Member
    1,497
    48
    28
    Northern Germany
    Sonic ERaZor
    Yes, that guide describes pretty well how to modify the level order. And yes, you need a hex editor.


    As a little reminder, editing the level order has some complexity. Instead of just going one by one, this system takes the current level ID into consideration, adds 1 to it and looks into the list for the level to pick.

    So in other words, after GHZ3 you get 0200, which means MZ1. After that, the game will look into the list for Marble Zone (which is where all the 020?s are). After that it jump to 0500, which is SYZ. Took some time for me to realize this too, so don't worry if you can't do it right away.

    Here's an into plain text converted and commented file:
    Code (ASM):
    1.     ;dc.w   $0000   ; GHZ 1 (is set by default and therefore not actually included in this list)
    2.     dc.w    $0001   ; GHZ 2
    3.     dc.w    $0002   ; GHZ 3
    4.     dc.w    $0200   ; MZ 1 (and jump to MZ list)
    5.     dc.w    $0000   ; >>> null
    6.     dc.w    $0101   ; LZ 2
    7.     dc.w    $0102   ; LZ 3
    8.     dc.w    $0300   ; SLZ 1 (and jump to SLZ list)
    9.     dc.w    $0502   ; Real SBZ 3 (FZ)
    10.     dc.w    $0201   ; MZ 2
    11.     dc.w    $0202   ; MZ 3
    12.     dc.w    $0400   ; SYZ 1 (and jump to SYZ list)
    13.     dc.w    $0000   ; >>> null
    14.     dc.w    $0301   ; SLZ 2
    15.     dc.w    $0302   ; SLZ 3
    16.     dc.w    $0500   ; SBZ 1 (and jump to SBZ list)
    17.     dc.w    $0000   ; >>> null
    18.     dc.w    $0401   ; SYZ 2
    19.     dc.w    $0402   ; SYZ 3
    20.     dc.w    $0100   ; LZ 1 (and jump to LZ list)
    21.     dc.w    $0000   ; >>> null
    22.     dc.w    $0501   ; SBZ 2
    23.     dc.w    $0103   ; SBZ 3 (technically LZ 4)
    24.     dc.w    $0000   ; >>> null
    25.     dc.w    $0000   ; >>> null
     
  9. Machenstein

    Machenstein

    Member
    830
    0
    0
    Here's what I get in the hex editor when opening lvl_ord.bin.

    Using the guide, I'm interpreting it as 00 (GHZ) 01 (Act 1) 00 (GHZ) 02 (Act 2) and then... 02 (MZ) 02 (Act 2)? Am I looking at this correctly?

    Okay, how about this. Let's take Green Hill Zone and make it so that it's only Act 1 and 3. No Act 2. What should I edit?
     
  10. Selbi

    Selbi

    The Euphonic Mess Member
    1,497
    48
    28
    Northern Germany
    Sonic ERaZor
    No, 00 is Act 1, 01 is Act 2, 02 is Act 3, 03 is Act 4. Everything starts at zero, you know. :P

    And scratch my idea, I just thought of something way simpler. Basically, create a check, when the game loads a new level, if it's the second act. If it is, change it to act 3. To do so simply go to Obj3A_NextLevel and add these lines after the line with the (pc,d0.w) in it:

    Code (ASM):
    1.         cmpi.b  #$01,d0 ; check for "act 2"
    2.         bne.s   @cont   ; if not, branch
    3.         addq.b  #1,d0   ; otherwise change it to "act 3"
    4.     @cont:
     
  11. Machenstein

    Machenstein

    Member
    830
    0
    0
    It worked for Green Hill Zone, but it gave me an "ILLEGAL INSTRUCTION$000077E0" for Marble Zone.

    EDIT: I just thought of a different idea on how to manage acts for my hack, so no further assistance is needed. Thanks for the advice anyway.
     
  12. flarn2006

    flarn2006

    Member
    280
    3
    18
    Sometimes I want to explore a level in debug in S3&K, figuring out where things are and trying to mess up the sequence, but it can get hard to try things with those annoying level boundaries in the way. You know, like when you try to go left or right during a boss or something, but it won't let you as if it was the beginning of the level? I do know sometimes there's even some stuff before the "beginning" of the level, such as in Mushroom Hill Zone in plain Sonic & Knuckles (I.e. no Sonic 3.) Does anyone know of a code to do this, or barring that, a (preferably simple) hex edit? Thanks.
     
  13. Tiddles

    Tiddles

    Diamond Dust Tech Member
    471
    0
    0
    Leicester, England
    Get in an accident and wake up in 1973
    For most situations you can use PAR codes similar to these:

    FFEE12:0F20 - unlock bottom
    FFEE14:0000 - unlock left
    FFEE16:7EC0 - unlock right
    FFEE18:0000 - unlock top

    They won't work everywhere; a few places use a different locking mechanism, or constantly reset the lock in the event scripts. Also bear in mind that some events will not occur at all with these enabled as they depend on a specific screen lock (e.g. the LRZ boss).
     
  14. Sambo

    Sambo

    Member
    9
    0
    0
    How do you change the order of the levels in Sonic 2?
     
  15. FraGag

    FraGag

    Tech Member
    Edit the values at LevelOrder (or WrdArr_LevelOrder, or word_142F8, depending on your version of the disassembly) in s2.asm.
     
  16. Nostalgia Ninja

    Nostalgia Ninja

    Night and day become one and two worlds come toget Member
    15
    0
    0
    Everywhere and nowhere
    Mastering SonED2 With Assembly guides Vol. 1
    Is there a way to change the color of a current zone (ie: by breaking a monitor, the stages pallete changes) to another pallete that was customly made for the stage. (Green Hill Day -> Green Hill Night)
     
  17. Elektro-Omega

    Elektro-Omega

    Mushroom Hill'in Member
    400
    2
    0
    UK
    -
    I have a few more questions:

    1) I understand that porting objects doesn't mean just copy and pasting the code but what would I need to do to, say, port an object from S3K to S1 or S2?

    2) How do you create a palette cycle or create an object that has a cycling palette in S2?

    3) How do you create animations for an object? How do you ensure that when the object is present it cycles through the frames correctly and are the frames stored in a single file or split across multiple? (S2 again)

    Also, I have literally no idea how to do music for hacks (porting or programming) so could someone give me a rough outline as how it is done.

    I have a little ASM knowledge but I am in no way asking for anyone to hold my hand through every step, just kind of detailed roughness XD. I am honestly trying to learn my way around.
     
  18. FraGag

    FraGag

    Tech Member
    You'll have to find the equivalent of RAM addresses, SST offsets and subroutines in S1 or S2. If there's no equivalent for a subroutine, you'll have to port it yourself. If the object is trying to use a RAM area that's used for a feature that's not available in the target game, you'll have to either port the feature (if you have enough available RAM) or drop the feature from the object.

    PalCycle_Load runs the palette cycles. Since there are only 4 palettes of 16 colors, you can't really make a palette cycle local to a specific object without risking affecting something else unless you plan ahead. PalCycle_Load is run once per frame and has code specific to each act to animate the palette. If you want an object to have a cycling palette, just reference the palette entries that are animated.

    Many objects use a simple animation script to define what frames to use and the duration of each step. The format is very simple: the first byte is the duration in frames, minus 1, that each step will last; subsequent bytes are frame indices in the sprite mappings; the script ends with a command ($Fx) which describes what happens when the script ends (repeat, play a different animation, etc.). The AnimateSprite subroutine animates an object according to an animation script.

    Porting music between MD games can be troublesome because each game has a different engine with different features. Even between games that use the same base engine (e.g. SMPS), you'll usually see more features in later games. There are tools that try to accommodate this fact, but it's not always perfect. If you want to import custom music, I think your best bet is to use a tool like xm4smps. Either way, you'll have to add/edit an entry in the music list to be able to use it in game.
     
  19. E-122-Psi

    E-122-Psi

    Member
    2,470
    612
    93
    I've been trying to edit the Sonic 2 titles, so far I've managed to edit the sprites but changing what displays is a little more complex. So far I've managed to get to this:

    [​IMG]

    Uploaded with ImageShack.us

    Basically I'm trying to edit it so only the (former) Tails sprite appears. I've managed to code out Sonic's hand but can't figure out Sonic's coding. I've gotten to a similar level on the separate coding when you press the Start button.
     
  20. BetaTwizzler

    BetaTwizzler

    Member
    20
    0
    0
    I posted something in here before...but I don't remember exactly what, haha. I think it had something to do with the Path Swappers in Sonic 2, which I have another question about.

    The hack I'm making has loops, lots of loops, and unfortunately they're loops that end with different tiles or continue on with different ones. What I wanna know is if it's possible for a loop to work like this or like this, and if so, what Path Swapper would I use to make them work? I know for normal loops the Swapper in the center is 03 91 00 and the one on the outside is (I think) usually 03 11 00, but the latter doesn't work for my loops. Stupid Pathswappers, there's just so many.