don't click here

2 player mode in Knuckles in Sonic 2?

Discussion in 'Engineering & Reverse Engineering' started by ICEknight, Mar 27, 2008.

Thread Status:
Not open for further replies.
  1. Dragonsbrethren

    Dragonsbrethren

    Member
    99
    0
    0
    They didn't have to make Sonic & Knuckles backwards compatible with Sonic 2 at all, be happy with what you got. Back then if I wanted to play as Sonic or Tails I'd just take my S&K cart out, stick Sonic 2 in by itself, and play it the same way I had been before I got S&K.
     
  2. ICEknight

    ICEknight

    Researcher Researcher
    It would have been cool to have Knuckles Vs Tails, though.

    So is it just not possible to access the Sonic object from S&K, or the Tails object from Sonic 2?
     
  3. Mr. Fox

    Mr. Fox

    Member
    559
    9
    18
    Esrael made all 3 characters playable in his S2 Delta hack, Knuckles/Tails combo is also there.
     
  4. Vangar

    Vangar

    Member
    3,654
    62
    28
    Snap. I think he did that by adding a character in though, not by modifying S2K code.

    So what your saying Tweaker, is that the base modified S2 engine to suit knuckles is in that other chip, and it just gets fed the level layouts and tiles? So I guess in that sense you could edit the code in that chip to take other data too, like the Sonic character. I might be talking garbage.
     
  5. Puto

    Puto

    Shin'ichi Kudō, detective. Tech Member
    2,013
    0
    16
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    Yes. You are talking garbage.

    Basically, S2K's upmem chip contains a modified S2 engine and only accesses the S2 cart for art and for enigma-compressed tilemaps. The idea of using an object from the S2 chip is just ridiculous, as the S2 chip is shifted to location $200000. This means that to run code from it without crashing it, the code would have to use relative addresses only. The only place that does this in Sonic 2 is the sound driver loading code, which is, indeed, used in S2K. It's also not possible to use objects from S&K, because the S&K engine and S2 engine are completely different, with a different RAM layout, SST, and whatnot.

    Besides that, most of the 2P code has been stripped from S2K to save space. Also, S2K uses S3K's mappings format, which, afaik, doesn't support 2P in the first place, so modifying S2K to allow 2P mode would be a *very* lengthy process, which would involve, among other things, changing all the mappings in the entire game.

    TLDR; It's not a possibility at all. Forget it.
     
  6. JoseTB

    JoseTB

    Tech Member
    716
    59
    28
    It might be possible to access code from external areas of the UPMEM by switching a hardware register in the same way it's being done to access the UPMEM from SK in the first place -maybe running from RAM- but that wouldn't be enough to get objects from S2 working in s2k as Puto pointed. To say it in short, it's not possible without important changes/additions.
     
  7. Puto

    Puto

    Shin'ichi Kudō, detective. Tech Member
    2,013
    0
    16
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    It is actually possible to access anything in either S2 or S&K from the S2K upmem, you just can't run any code because the entire thing is shifted to $200000. Case in point, the sound driver loading code doesn't do a single jmp/jsr or otherwise use absolute addresses in any way, and as such, it is actually used in S2K (see JmpTo_SoundDriverLoad in here if you doubt this).
     
  8. ICEknight

    ICEknight

    Researcher Researcher
    Thanks for the in-depth info, that's precisely everything I wanted to know.
     
  9. Sonic Hachelle-Bee

    Sonic Hachelle-Bee

    Taking a Sand Shower Tech Member
    809
    203
    43
    Lyon, France
    Sonic 2 Long Version
    Just to add one little detail here, the art and mappings of the Knuckles object are both loaded from S&K, and not the UPMEM ship. There is also all the Knuckles animations at the end of game, and almost* all sprites placements in the game (which adds some extra lives here and there in CPZ for example) that are loaded from here.

    *
    HPZ, DEZ and SCZ sprites placements are loaded from S2
    CNZ sprites placements are loaded from the UPMEM ship
     
  10. Dark Sonic

    Dark Sonic

    Member
    14,631
    1,611
    93
    Working on my art!
    While not exactly related to the topic, would it be possible to select your character in Sonic 2 in 2P mode (Like say P1 wanted to play as Tails instead of Sonic)?
     
  11. PowerChaos

    PowerChaos

    Member
    12
    0
    0
    Tails can be almost fully working in Sonic and Knuckles, so I wouldn't get why it wouldn't in here.
     
  12. Tweaker

    Tweaker

    Banned
    12,387
    2
    0
    Even though it was fully explained multiple times in this thread?

    Wow.
     
  13. RattleMan

    RattleMan

    Oldbie
    154
    0
    0
    FFFF71:0002 - Current Character is Tails

    The only problem is that 2P disappears. Imperfect, but there you go. I'll try and find a code for 2P.
     
  14. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    19,248
    975
    93
    Long-term happiness
    Swap pads? :)

    Nah, I see what you're saying - 2 of the same character at once like in S3. Sure, it's doable. You'd have to add some code in but I don't see it being THAT hard.
     
  15. Dark Sonic

    Dark Sonic

    Member
    14,631
    1,611
    93
    Working on my art!
    This would also be good for hacks that have Knuckles in it so that people could play as Knuckles in two player mode against Sonic.
     
  16. LocalH

    LocalH

    roxoring your soxors Tech Member
    Don't the Sonic and Tails objects use hardcoded RAM addresses? You'd have to turn those into generic 1P/2P addresses and then add checks to the objects to make sure they use the right addresses, if you want two of the same character.

    Or am I just so far behind on the deep engine internals that I'm talking out my ass?
     
Thread Status:
Not open for further replies.