don't click here

Basic Questions & Answers thread

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

  1. FraGag

    FraGag

    Tech Member
    I remember mentioning this in one of my previous posts, and I'm too lazy to search for it so I'll just repeat myself: regular bosses start "flashing" (I.e. changing a specific palette color from black to white and back) when they see they have no collision, then after some time restore their collision and stop flashing. Don't restore the collision immediately or you might get stuck in the boss and kill it before you get the time to say "what the fuck?".
     
  2. Xenowhirl

    Xenowhirl

    Tech Member
    175
    0
    0
    I had the same problem with AS always optimizing 0(a#) to (a#), but worked around it by assembling those instructions as 1(a#) and then using org and dc.b to overwrite the 1 with a 0. For me, this was preferable to requiring a special version of the assembler executable. This should work in most assemblers, but it gets clumsy if the assembler lacks powerful macro support.
     
  3. Elektro-Omega

    Elektro-Omega

    Mushroom Hill'in Member
    400
    2
    0
    UK
    -
    Hey guys, not sure if this has been asked a million times before.

    I played Sonic & Knuckles again recently and on the level select menu there are restrictions to say, prevent sonic going into Sky Sanctuary zone 2. This is all clever stuff because it prevents glitches and characters going where they should not. But my real question is why, when Sonic 3 is locked on, do those restrictions get lifted I.e. Sonic in Sky Sanctuary Zone 2 or Knuckles in Doomsday?

    When locked on do they compare bytes and overwrite the Sonic & Knuckles with some of the Sonic 3 values? or is the whole rom just Sonic 3 but with the extra levels and such that are unlocked by having Sonic 3 Locked on to Sonic & Knuckles ?

    I know it's a basic question but it's been bugging me for days now.
     
  4. Tiddles

    Tiddles

    Diamond Dust Tech Member
    471
    0
    0
    Leicester, England
    Get in an accident and wake up in 1973
    These restrictions are lifted by enabling debug, not by attaching Sonic 3. It just so happens that you can't do that in S&K alone. If you use a PAR code to enable debug in S&K, they unlock in the standalone game too. Likewise, if you only activate the level select and not debug in S3&K, you still can't access those levels.

    When locked on, the entire game still runs from the S&K side - Sonic 3 is only used to retrieve data (such as artwork and music) and very small, isolated pieces of code. When the game starts up, it checks whether Sonic 3 is attached, and sets a single word in RAM ($FFAE) if it is not attached. If that word is non-zero, you'll see the Sonic & Knuckles title screen, S&K title cards, no super emeralds, and so on... that's the one single thing that controls all the differences. But you can't just unset it and play the full game if you don't really have Sonic 3 attached, because it needs data from the attached cart to play the whole thing through. It'll crash pretty quickly, actually, because it needs Sonic 3 data to draw the S3K title screen!

    The level select only cares about lock-on for preventing you from selecting one of the Sonic 3 levels, special stages or character combinations. If you get to the S&K level select screen and use a PAR code to clear that word and make the game think it's S3K, sure enough, you can play as Invisible Glitchy Tails? or select Angel Island, Hydrocity etc. without being redirected to Mushroom Hill, but all you'll really see is a hung blank screen because the data isn't there. If there were a lock on SSZ2/DDZ depending on whether Sonic 3 were attached or not, it'd check that word in just the same way - but in reality it's checking a different word, the one that says whether debug is enabled ($FFE2).

    I'm sure that was much more long-winded than it needed to be, but hopefully it makes some sort of sense...
     
  5. Elektro-Omega

    Elektro-Omega

    Mushroom Hill'in Member
    400
    2
    0
    UK
    -
    Thank you very much Tiddles.

    I can't help but feel I should have realised that it was because of the debug mode code being used. Oh well. But still thank you for clearing that up and I understood it completely. I always knew that there was a little comparison (but I didn't realise it was in RAM) and I always knew that there was very little interaction between the two except for retrieval of artwork and music etc.

    Still, thank you very much for clearing that one up.

    Edit: Cleaning up grammar.
     
  6. GT Koopa

    GT Koopa

    Member
    2,023
    18
    18
    Elgin, IL
    Flicky Turncoat DX, T.L.W.S. Vs M.G.W.
    I know the question was asked in a obscure thread, so I will just reask it here. Porting the Sonic 2 Clone driver. I am having trouble. Should I just give up on it or is there something I am missing? After following the tutorial I tried renaming the DAC, sounds, and music but it just doesn't work.
     
  7. Selbi

    Selbi

    The Euphonic Mess Member
    1,504
    62
    28
    Northern Germany
    Sonic ERaZor
    So today I decided to disassemble Mega Bomberman, one of my favorite games on the Mega Drive. However, there are two big problems with IDA: It can't see that a code is meant to be a jump table and when art or similar data is there, I don't know where it ends. In a case like this, I have to guess and randomly press C, while placing my curser somewhere. That sucks and even after 30 minutes of work, you still have less than 10% disassembled.

    So my question: Is there a more efficient way to disassemble Mega Drive ROMs? Maybe with some options in IDA itself (it has so many features that, I have absolutely no idea where such an option could be).
     
  8. Aerosol

    Aerosol

    Not here. Moderator
    11,164
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    Can someone tell me why I can't have lots of frames of animation to make things all fluid and crap? I'm guessing that some kind of file would become too big or something or the other, but I'd like someone who actually knows what they're talking about to explain it to me.
     
  9. FraGag

    FraGag

    Tech Member
    My experience disassembling MD ROMs has been the same as yours. When you hit a jump table, you have to manually identify it. The disassembler has no way to determine the end of a jump table, so you have to guess instead. Also, if you didn't know, to make a jump table (or rather, an offset table), convert the first offset to the size of the offset (usually word), then convert it to offset (user-defined). In the dialog, for base address, you can type the address of the first operand, or you can type ScreenEA() to save time. Then, make an array of the size of the jump table. Then jump to each offset and press C if it's code.

    + - My disassembler will be smarter with offset tables, I promise!  

    The following limitations immediately come to my mind:
    • The overall size of the ROM cannot go over 4 MB, unless you use a mapper or some other bank-switching mechanism. In the original Sonic games, the player sprites are uncompressed because the art must be accessed randomly to load only the current frame to VRAM, so it takes up quite a bit of space.
    • Speaking of VRAM, most other objects load all of their frames in VRAM when the level is loaded, so if you have more animation frames, you need to use more VRAM. You are probably aware that the original levels use almost all VRAM available, making it hard to add objects or elements in the HUD. You could have a dynamic art loading mechanism to load only the current frame for every object, but you have to be careful when several instances of the same object type (e.g. 2 Crabmeats) are on screen at the same time, and of course, you'd have to program it. :P
    • In animation scripts, a single byte identifies a frame number. If you need more than 256 frames for a single animation script (and it's actually even less because some values are reserved for commands), you're out of luck. In Sonic 1 and for "normal" objects in Sonic 2, it's even worse: the original code will ignore values above $7F (as it assumes it's a command), effectively limiting you to 128 frames (of course it's easy to fix). In Sonic 2, for player objects, the limit is $EF. If you need to go beyond 250, you will have to write a custom animation routine for that object, just like the players have their own animation routine, that will read words instead of bytes.
     
  10. SegaLoco

    SegaLoco

    W)(at did you say? Banned
    Is there a ram mapping for Sonic 1 or 2? It could help a bit in disassembling Sonic CD.
     
  11. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,759
    341
    63
    SonLVL
  12. FraGag

    FraGag

    Tech Member
    Variables.asm from the Sonic 1 disassembly and s2.constants.asm (starting at the RAM_Start label) from the Sonic 2 disassembly might be more complete than the wiki.
     
  13. Azu

    Azu

    I must be stupid. Member
    Look for Full Scale levels maps of Sonic 1-3. The ones on retro aren't full scale.
     
  14. nineko

    nineko

    I am the Holy Cat Tech Member
    6,328
    492
    63
    italy
    Most of the maps on the wiki aren't full sized because pictures that big break the thumbnail thing, so they were replaced with smaller (50% or even 25%) maps. Sadly this hasn't been done consistently so right now we have a mix of 25%, 50%, and even a few 100% (thus unviewable) maps out there.

    Either way you can create level maps by your own with SonED and/or SonED2...
     
  15. Azu

    Azu

    I must be stupid. Member
    Well, SonED can't open S3/SK, can it?
     
  16. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,759
    341
    63
    SonLVL
    Yes, it can.
     
  17. GT Koopa

    GT Koopa

    Member
    2,023
    18
    18
    Elgin, IL
    Flicky Turncoat DX, T.L.W.S. Vs M.G.W.
    So getting the program unoptvgm to work correctly. What do I need to type on the command line? I do want to see if I can get I better rip instead of GYM rip that I always use. Basically I want to use actual ripped vgms for vgm2mid.
     
  18. E-122-Psi

    E-122-Psi

    Member
    2,471
    612
    93
    Okay I've managed to get diagonal jump dashes working, however I still need to fix the button activation:

    Code (Text):
    1.     move.b    ($FFFFF602).w,d0; move the current button press to d0
    2.     andi.b    #%00001010,d0            ; get only right and down button presses
    3.     cmp.b    #%00001010,d0            ; are right and down both pressed?    
    4.     beq.b    Cont_DiagD    ; if not, return        
    5.     move.b    ($FFFFF603).w,d0; is ABC pressed? (part 1)        
    6.     andi.b    #$70,d0    ; is ABC pressed? (part 2)
    7.     beq.w    JumpToDiagD_End2
    8.     jmp    Cont_DiagD2
    Basically I want it to work like the other dashes with it being activated by the direction and any of the A/B/C buttons, however right now it activates just with the directional press (I didn't edit the first branch recognition because I want the option of any of the three buttons rather than being limited to one or all of them. Any idea how to get this to work?

    Also there is this little beauty:

    [​IMG]

    This only happens to this one sprite, the downward variant sprite (which is an identical copy par the rotational change) works fine. Any idea what the problem might be?
     
  19. Mercury

    Mercury

    His Name Is Sonic Tech Member
    1,740
    21
    18
    Location Location
    AeStHete
    You can also use Sonic Extractor to map Sonic 3 & Knuckles or Sonic CD. [/shameless self promotion]

    I haven't used SonED for S3&K, so I don't know what its object support is like but mine is nearly complete.
     
  20. SMTP

    SMTP

    Tech Member
    Nearly empty. :P