Some changes/fixes for Sonic 1

Discussion in 'Engineering & Reverse Engineering' started by KingofHarts, Sep 4, 2012.

  1. RetroKoH

    RetroKoH

    Member
    1,657
    11
    18
    Project Sonic 8x16
    Since the thread is still alive and well, and I decided to dip my toe back into things... I wanna touch on something that always bugged me in Sonic 1, and I almost guarantee no one noticed. But I did 4 years ago when I last worked on a hack, and I do again now.

    Sonic 1 has a 64 color palette file of all white, just for the background on the sega screen... Which the game branches away to go set up, and then come back to load it into RAM... Nah, methinks that could be optimized. Now, if you want to replace the Sega BG palette to something more colorful, you might not opt to do this... hell you might not opt to anyway, but I think it's good to share anyway. Someone could learn something. Go to @loadpal: under GM_Sega: and replace this:

    Code (Text):
    1.     @loadpal:
    2.         ;moveq    #palid_SegaBG,d0
    3.         ;bsr.w    PalLoad2    ; load Sega logo palette
    NOTE: I tweaked it to fade into white, because I think it looks nicer... so keep that in mind if you decide to do this.

    Code (Text):
    1.     @loadpal:
    2.         ;moveq    #palid_SegaBG,d0
    3.         ;bsr.w    PalLoad1    ; load Sega logo palette - Tweaked to allow fade in
    4.  
    5. ; Nah, let's make that more efficient, shall we?
    6.         lea        (v_pal_dry_dup).l,a3
    7.         moveq    #$3F,d7
    8.  
    9.     @loop:
    10.         move.w    #cWhite,(a3)+    ; move data to RAM
    11.         dbf        d7,@loop
    12.         bsr.w     PaletteFadeIn ; added to allow fade in
    If you instead want to change it to a proper, more colorful palette to suit you, then disregard my changes but still change to PalLoad1 and add PaletteFadeIn to make it look a lot nicer.
     
  2. RetroKoH

    RetroKoH

    Member
    1,657
    11
    18
    Project Sonic 8x16
    Question... has anyone ever accidentally made the Final Zone boss unhittable? My guess is that I either did something inadvertently to the SolidObject Routine or a shift to OSTs made something not work. I'll PM a ROM to someone willing to test but I just wonder if anyone's had this happen to them.

    In hindsight I could've put this in Basic Q/A but IDK how to Delete posts now. Forum's changed a bit.
     
  3. TheInvisibleSun

    TheInvisibleSun

    OVER THE TOP TECHNO-BLAST Member
    I don't have an answer to the Final Zone question, but to 'delete' posts, just edit the post to request that it be deleted (this is how it always worked, right?)
     
  4. RetroKoH

    RetroKoH

    Member
    1,657
    11
    18
    Project Sonic 8x16
    I thought so... but I hit Edit and didn't see a Delete button. Either I'm just blind or I'm not used to any changes that have been made since I was last here
     
  5. TheInvisibleSun

    TheInvisibleSun

    OVER THE TOP TECHNO-BLAST Member
    When you edit, literally replace the text with something like "mods please delete this"
     
  6. RetroKoH

    RetroKoH

    Member
    1,657
    11
    18
    Project Sonic 8x16
    I know I'm quoting a glitch Clownacy posted nearly 5 years ago, but it's to do with a question I currently have. I seem to recall an obscure glitch in Marble Zone Act 2 where if you perfectly ran through the start, hitting both Buzz Bombers and triggering the switch fast enough, you can somehow crash the game. I could've sworn I saw video of this once but oddly I can't find evidence of this anywhere so now I'm starting to think I'm experiencing the Mandela Effect or something.

    Has anyone ever experienced a bug like this... and could it be related to this issue that Clownacy fixed?
     
  7. Clownacy

    Clownacy

    Tech Member
    797
    29
    28
    If I remember right, that bug was listed on various wikis (Sonic Retro and TCRF included). Eventually a thread was created where people tried to recreate it, and it was determined that the bug did not actually exist, so it was removed.

    The bug that I fixed shouldn't cause any crashes anyway - it's simply a null-pointer dereference that's harmless in Sonic 1's case, because it only reads a byte. The bug only matters because it causes a crash when you port objects to Sonic 2. The reason it does is because Sonic 2 would read a word instead of a byte, and the address it would try to read from would be odd, causing a crash.
     
    • Like Like x 1
    • Informative Informative x 1
    • List
  8. Iso Kilo

    Iso Kilo

    Local Wolf-Fox Member
    27
    25
    13
    Small Town, BC
    Ripping Sonic Classic Collection ROMs
    Small fix to a peculiar bug:
    If you get a game over by drowning, the title screen will stop scrolling. This is because $F744 is set when the player drowns, which is the scroll lock flag. However it doesn't get cleared at the title screen. Here's a hardware demonstration (Featuring anxiety filled Kilo's heavy breathing and tripping)

    The fix to this is a really simple one. At Title_LoadText, just before the branch to LevelSizeLoad, clear $F744.
     
  9. Cyber Axe

    Cyber Axe

    Oldbie
    I'm interested in the score reset back to last checkpoint, imo that's the way it should be.

    Though i do think monitor behaviour is fine the way it is.

    Just thought it would be handy to list some bugs I've found for people to look at if interested, i'm not yet skilled enough to figure them out at present

    Here are bug's I've found
    1. Starlight Zone Glitch: when the zone fades in on the bottom just right of centre there's a couple of vertical blue bars that appear for a few frames (not tested on revision 0, you can see it at the start of the demo)
    2. The next glitch happens when you roll into a rock from the right side (found it when testing spindash) there's a bridge in green hill act 2 i think it is where there's rocks either side if you roll into the right from the right you tend to go into the rock a few pixels then get pushed out (sometimes doesn't trigger)
    3. There is a small period of time where if you hit an invincibility monitor you can still die before the sparkles appear (I'm actually planning on looking into this one as i think it's an easy fix and if so will post it)
    4. When testing the Air Roll I found this (I don't think it's related to air roll though): if you press jump just as you hit a spring you don't get the spring sound but still get the spring bonus height and animation, I believe you have to hit jump the same frame as you hit the spring for this to occur
    And from my count there's still about 9 bugs on https://info.sonicretro.org/Sonic_the_Hedgehog_(16-bit)/Bugs#General_bugs yet to be fixed, that I've yet to come across bug fixes for.

    Edit:

    I have just tried to confirm 2 and 4

    2: defiantly happens, i just tested it with the rock left of the bridge on GHZ2 just before the end goal run towards the rock and go into a roll and you will roll into the rock

    4: I cannot get to trigger again so it must be if you have air roll on and you jump at the same time as the spring, i have implemented a variation of air roll where you can't curl into a ball if you are in the spring jump animation but will roll if in the air and not in the spring jump animation, will toggle my implementation to the original one from the guide confirm this is the cause.

    Edit 2:
    4: I have tested this a second time with the air roll feature and still cannot get it to activate when i originally found that bug i managed to get it to activate a few times so i'm wondering if this was related to having the OptimiseSound enabled at the time or something similar.

    Also I may have fixed 3 since, the toggle on invincibility was the first thing in the Pow_ChkInvinc: after the monitor type check (I thought that might happen later before i looked at that subroutine) what i ended up doing is making it so that Pow_ChkInvinc gets checked before all the other monitors and that "seems" to make the monitor activate faster, but it's a hard one to test because i don't know a good location to hit a monitor then immediately hit an enemy or trap, though I am aware i have done this which is how i discovered it in the first place.

    Edit 3:
    4: Tested this again after disabling the air roll from previous attempt, the only difference is this time i was facing left on the spring, I bounced continuously and hit jump at just the right time and the spring sound did not play (it's the first spring at the start of GHZ1 I tested with)

    Pretty sure I was facing left when I originally found this bug. (what is it with bugs when facing left in this game)
     
    Last edited by a moderator: Jun 28, 2020 at 6:16 PM