Simple guide: How to fix the camera bug in GHZ act 1

Discussion in 'Tutorials Archive' started by Mike B Berry, Jul 7, 2012.

Thread Status:
Not open for further replies.
  1. Mike B Berry

    Mike B Berry A grandiose return Member

    Joined:
    Jun 6, 2012
    Messages:
    377
    Location:
    New places, newer motivation
    As everyone may have already noticed; When Sonic rolls at a faster pace than his initial set speed $600 he the cameras scrolling speed is very slow. this will cause him to die before he reaches the bottom boundary. I have made a very simple "Copy and Paste" guide to prevent this glitch from happening.


    Here is a screen shot: [​IMG]


    First open up your Sonic1.ASM file and search for:



    Code:
    
    Resize_GHZ1:
    
    	 move.w #$300,($FFFFF726).w ; set lower y-boundary
    
    	 cmpi.w #$1780,($FFFFF700).w ; has the camera reached $1780 on x-axis?
    
    	 bcs.s locret_6E08 ; if not, branch
    
    	 <=
    
    	 move.w #$400,($FFFFF726).w ; set lower y-boundary
    
    	 cmpi.w #$1880,($FFFFF700).w
    
    	 bcs.s locret_6E08
    
    	 rts
    
    ...
    
    


    Then add one more code in the space I've provided:





    Code:
    
    	 move.w #$400,($FFFFF72E).w ; set if the lower y-boundary x-axis ins't scrolling fast enough.
    
    

    From my understanding. The camera scrolling speed is set by the used RAM locations. To be truthful I was just screwing around until I used the RAM adress F72E; I compared the function to that of the location: F726, and it proved to be a better choice. This could better help people fix the glitch without resorting to importing the spindash. Anyway, you can compile the rom and test it.

    [/CODE]
     
    Last edited by a moderator: Jul 7, 2012
    Nat The Porcupine likes this.
  2. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    In all fairness, you don't need to port the entire spindash to fix the bug held on the guide, you could follow only that one section:


    http://info.sonicretro.org/SCHG_How-to:Add_Spin_Dash_to_Sonic_1/Part_1#Fixing_bugs


    As its applied to a universal section of code rather than one level's code, it eradicates all possibilities of being killed at the bottom of the screen if the screen is still moving, which are all levels, not just Green Hill Zone Act 1.


    Good work though, I will say, I won't afflict the fact that you've found an alternative method which fixes it "properly", where the bug is actually caused (even if it isn't universal), but knowing the true reason for the glitch's occurrence makes it easier to fix the bugs on any other levels (should it appear), the one on the spindash guide is pretty much a hackish version.
     
  3. Mike B Berry

    Mike B Berry A grandiose return Member

    Joined:
    Jun 6, 2012
    Messages:
    377
    Location:
    New places, newer motivation
    Thanks, though It' wouldn't hurt if criticism were thrown in. I know there is a more proper way to fix it.
     
    Last edited by a moderator: Jul 7, 2012
  4. Mike B Berry

    Mike B Berry A grandiose return Member

    Joined:
    Jun 6, 2012
    Messages:
    377
    Location:
    New places, newer motivation
    I noticed a little issue with the cameras again. When Sonic jumps from the bottom part of the stage, the camera shifts up abouot 8 pixels and sets in it's logical position. To fix this and set the camera to lock, change the codes:



    Code:
    
    move.w #$400,($FFFFF726).w
    
    move.w #$400,($FFFFF72E).w
    
    


    to this:





    Code:
    
    move.w #$408,($FFFFF726).w
    
    move.w #$408,($FFFFF72E).w
    
    

    Only one thing is noticeable in GHZ act 1 now. Before the circular loop, the camera drops downabout 20 pixels, so we can now see the spikes right next to the drop off. The reason is because the camera is centering Sonic's X and Y positions on screen, making this area esier to notce what goes on below. In the future, This will be fixed as well.


    The next guide will be on a similar glitch in Marble Zone act 1.

    [/CODE]
     
    Last edited by a moderator: Jul 13, 2012
Thread Status:
Not open for further replies.