don't click here

Basic Questions & Answers thread

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

  1. redhotsonic

    redhotsonic

    Also known as RHS Tech Member
    1,587
    10
    18
    United Kingdom
    YouTuber
    EDIT: Ninja'd by ValleyBell. The git =P
     
  2. Mercury

    Mercury

    His Name Is Sonic Tech Member
    1,740
    21
    18
    Location Location
    AeStHete
    Thank you both! You have helped immensely.
     
  3. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    Okay, I have a question.

    How can I make the ending of Sonic 2 load a different palette based on the character? I mean, I know how to do character specific checks, but I'm working with Object C9 (The palette changer), and it's set up rather confusingly..
     
  4. Rika Chou

    Rika Chou

    Tech Member
    5,276
    169
    43
    Kinda late replying here, but it's buggy in the NA beta because the level art has been converted to work in 2-Player versus mode. This makes the level need a lot of duplicate tiles, so much that the level art overflows into the VRAM that's normally used for the object art.

    You can fix this by using the art/mappings from S1, but then the level won't display right in 2-Player versus mode.
     
  5. RetroKoH

    RetroKoH

    Member
    1,662
    22
    18
    Project Sonic 8x16
  6. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    Well, I figured that out myself. The problem is that the ending in Sonic 2 is pretty much a rogue case. It works nothing like the rest of the game because it's loaded by some type of routine in an object.

    Thanks anyway though.

    Thank you for answering, I was mainly just curious though. If I get bored I might try fixing it, but pretty much everything related to it is broken anyway. Though at least the Software scrolling routine seems to work, which is good because it might be easier to port it from the NA prototype than Sonic 1.
     
  7. Storm Eagle

    Storm Eagle

    20
    0
    0
    Pennsylvania
    Sonic 2 JF Remake
    I'm new at hacking, and I'm starting to learn today how to hack Sonic 2.

    Can I ask, how do I add dialog to the game, if possible?

    Also, how do I change the amount of rings needed to enter the special stage? I wanted to make it so that you can enter the special stage with 0 rings.

    I apologize if this thread seems like spam.
     
  8. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    Okay, two things:

    1: This belongs in Basic Questions and Answers, and does not warrant it's own thread.
    2: To change the special stage ring requirement, simply find the label Obj79: and search for cmpi.w #50,(Ring_count).w or cmpi.w #$32,(Ring_count).w. Change the #50 or #$32 to just #0
     
  9. Storm Eagle

    Storm Eagle

    20
    0
    0
    Pennsylvania
    Sonic 2 JF Remake
    Eh, sorry. Just realized there was a Q&A thread.

    Thanks for responding. What program do I use do do the ring requirement change?
     
  10. RetroKoH

    RetroKoH

    Member
    1,662
    22
    18
    Project Sonic 8x16
    Any standard text editor will do for .asm files. I'd advise against using the standard Notepad though...

    Personally I use ConTEXT Programmer's Text Editor... You'd just need a highlighter package for Motorola 68K... though I wouldn't label it as a requirement... it'd certainly make any new hacker's life easier.
     
  11. TheInvisibleSun

    TheInvisibleSun

    OVER THE TOP TECHNO-BLAST Member
    1,626
    193
    43
    Buffalo, NY, USA
    The Water
    I've always used WordPad, though one day I'll stop being lazy and use the above.
     
  12. Storm Eagle

    Storm Eagle

    20
    0
    0
    Pennsylvania
    Sonic 2 JF Remake
    I'm really REALLY new at this stuff, I just started hacking with the level editor.

    I apologize if I'm being a dolt, but, how do I make an .asm file out of the rom?
     
  13. Blastfrog

    Blastfrog

    See ya starside. Member
    Well, you could go through all of the trouble of disassembling it, working out what is and isn't bytecode, figuring out what the code does to label and comment it, OR, you could download one of the many premade disassemblies by our talented community here.

    As for text editors, my personal recommendation is Notepad++. Very familiar environment to Microsoft's Notepad, but a lot less suck.
     
  14. Storm Eagle

    Storm Eagle

    20
    0
    0
    Pennsylvania
    Sonic 2 JF Remake
    I can't find the specific code for special ring requirement in the asm file.
     
  15. RetroKoH

    RetroKoH

    Member
    1,662
    22
    18
    Project Sonic 8x16
    This right here. As for exactly how to find it, open s2.asm. this is the core asm for all of the game code. Perform the searches in THIS file. You should be all set to go.

    To find any object code, simply search for Obj##:. The objects are indexed in hexadecimal (0-F, 10-1F, etc.) As for what edits what... some code is commented to help you, while some code... you've gotta use some noggin to work out on your own.

    In your case, the object you want is indexed Obj79:. Here is a pointer list of every object in Sonic 2.

    Hope this helps.
     
  16. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    Okay, so I think I know the answer to this question, but just in case there's a better answer I'm going to ask this anyway.

    For Green Hill Zone in my hack, I extended the level art tiles a little. I added this:
    [​IMG]
    So the animated graphics would appear properly in SonLvL and not just little "x" boxes.
    It works in SonLvL fine, but when I try to access it in-game, the game hangs momentarily on the title card, and a bunch of stuff in VRAM get's overwritten by glitchy or blank tiles.
    Does anyone have any idea why this might be, and what my options are for working around it?
     
  17. RetroKoH

    RetroKoH

    Member
    1,662
    22
    18
    Project Sonic 8x16
    Does anyone know where to find the code in Sonic 1 that controls the camera? What code makes the camera move as fast/slow as it does... as well as where Sonic is on screen before it moves?
     
  18. vladikcomper

    vladikcomper

    Tech Member
    205
    134
    43
    Sonic Warped
    In DeformBGLayers routine (DeformLayers in HG), there are calls to the ScrollHoriz and ScrollVertical subroutines that calculate the camera position depending on Sonic's position and the camera boundaries set. X and Y coordinate are calculated independently, hence two different routines that don't rely on each other. However, they both perform similar calculations -- each one for it's own axis (X or Y). The subroutines include calculating new camera position, setting redraw flags for the Foreground (VDP's Plane A) in order to redraw playfield as you move around (the redrawing occurs later in VBlank according to the flags set), they also calculate the camera shift, I.e. a distance between the old and new camera positions. The camera shift is used later on in the BG deformation routines to calculate new BG positions (I.e. how far the BG layer should move according to FG layer shifting for this frame). Speaking of X-axis, the camera shifting will be positive if camera scrolls right, negative otherwise.

    I should also mention that the ScrollHoriz subroutine applies "speed cap" to the camera shifting, not letting it to shift more than $10 pixels per frame. If Sonic moves any faster, you'll see that neat effect of Sonic slowly moving beyond the screen, this is especially noticeable in Sonic 2's Chemical Plant zone. The reason for that is layout redrawing engine. As the camera moves to the right for example, it draws a column of 16x16 blocks to cover the whole screen vertically. VDP's memory isn't enough to keep the whole level map loaded, so it redraws the plane dynamically as the camera scrolls, but the problem is, the engine can't do more than one line of 16x16 blocks at once, if the camera scrolls faster, it will start missing blocks, so you'll see garbage (previously drawn level parts remaining on those places). ScrollVertical doesn't apply speed cap however, so the vertical redrawing bug may still occur if Sonic moves too fast vertically.

    Have you added much PLCs in GHZ's PLC list recently?
     
  19. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    Actually, on the contrary, because of the tiles I added, I removed a few PLC's. The level art now includes the two wall types and the flower stalks in the level art, so I commented out three PLC requests.

    Currently, the first PLC list has 7 entries, and the second has 6.

    My only theory is that somehow having the level art appear where the zone animation is playing is somehow causing it, but that doesn't make sense, because in Hill Top Zone, I have animated tiles in the middle of the level art (I changed how the lava works).
     
  20. Alriightyman

    Alriightyman

    I am back... from the dead! Tech Member
    357
    11
    18
    Somewhere in hot, death Florida
    0101001101101111011011100110100101100011 00000010: 0101001100000011 01000101011001000110100101110100011010010110111101101110
    Do the animated tiles display properly?