ARZ background problem

Discussion in 'Discussion and Q&A Archive' started by redhotsonic, Mar 5, 2012.

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

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    As you may of known, in my hack for Great Gate, the background changes when you go underwater. Here is a short video demonstrating:



    And here is a picture in SonED2 of my background:


    [​IMG]


    SwScrl_ARZ is the one with the mountains, SwScrl_ARZ2 is the one with the blue "underwater" background.


    In SwScrl_ARZ, I have:



    Code:
    move.w #$0000,($FFFFEE0C).w ; lock the background vertically in place (starting at the top)




    In SwScrl_ARZ2, I have:



    Code:
    move.w #$0200,($FFFFEE0C).w ; lock the background vertically in place (starting 200 down)








    Anyway, the background does not always load properly. The way I got it set, is that when you enter the area, it changes it layer deformation routine.





    Code:
    SwScrl_ARZ:
    
    tst.b  (arzbg).w
    
    bne.w SwScrl_Arz2
    
    ; blah blah blah


    in the routine events:





    Code:
    cmpi.w #$960,(Camera_X_pos).w ; Has Sonic reached this far?
    
    ble.s + ; If not, branch and see if Sonic went top way of GGZ1
    
    cmpi.w #$2E0,(Camera_Y_pos).w ; Has Sonic reached this low?
    
    ble.s + ; If not, branch and see if Sonic went top way of GGZ1
    
    move.b #1,(arzbg).w ; Move 1 to arzbg so SwScrl_Arz2 can load








    This wasn't enough. It did load SwScrl_Arz2, but it seems to not create the blue background until Sonic kept moving for a certain distance. So, I made it move a certain distance itself for a short time so it will load:





    Code:
    cmpi.w #$960,(Camera_X_pos).w ; Has Sonic reached this far?
    
    ble.s + ; If not, branch and see if Sonic went top way of GGZ1
    
    cmpi.w #$2E0,(Camera_Y_pos).w ; Has Sonic reached this low?
    
    ble.s + ; If not, branch and see if Sonic went top way of GGZ1
    
    move.b #1,(arzbg).w ; Move 1 to arzbg so SwScrl_Arz2 can load
    
    move.b #$7E,(ARZBGtimer).w ; Move 7E to timer, so the underwater background has time to load


    And in the layerdeformation:





    Code:
    SwScrl_Arz2:
    
    move.w ($FFFFEEB0).w,d4
    
    tst.b (ARZBGtimer).w ; is it 0?
    
    beq.s + ; if so, branch, and skip next 2 instructions
    
    subi.b #1,(ARZBGtimer).w
    
    addi.l #$00098000,(RamSpace4).w
    
    move.w (RamSpace4).w,d4
    
    +
    
    ext.l d4
    
    asl.l #6,d4
    
    moveq #2,d6
    
    bsr.w sub_D904
    
    
    
    ;blah blah blah



    That works, sometimes. Here is an example of it working: www.youtube.com/watch?v=Gukg4hmcA9s


    But sometimes, it doesn't load up the background completely and only loads up "columns" of it. It then loads the rest of the columns when Sonic starts moving again. Here is another video showing the example: www.youtube.com/watch?v=XRlnPGEREso


    No matter how long I make it scroll automatically, it won't always load.


    So, I wondered, does anyone know a way to make it load immediately? I tried moving #1 to Dirty_flag, but alas, no difference.


    If you need any more details or information, I will supply. I greatly appreciate any help.
     
    Last edited by a moderator: Mar 5, 2012
  2. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Maybe you could try with the s2 equivalent of "loadtilesfromstart" instead, possibly a modified version that would reload only the background tiles.


    From your video, it looks like you're moving the bg to redraw it, but the bg is moving too fast.


    If the column being redrawn is the one on the border, maybe with that speed it just skips some columns. In that case, making it slower could fix it.
     
    Last edited by a moderator: Mar 5, 2012
  3. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England

    There's loadtielsasyoumove, but that didn't do anything to the background.


    As for you saying it's going faster, you're right, it is going too fast. And that's why it's skipping some columns. The only thing is, I have NO idea why it's sped up. It's following the same code.
     
Thread Status:
Not open for further replies.