New Special Stage background? (Sonic 1)

Discussion in 'Discussion and Q&A Archive' started by SSGD, Feb 15, 2012.

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

    SSGD "I can't believe what cool boots you have on!" Member

    Joined:
    Nov 14, 2011
    Messages:
    125
    Location:
    Room 101
    Recently I've been trying to figure out how to port in a new background for the Special Stages in Sonic 1, but it has left me completely stumped as to what I need to be doing. From what I can understand, the backgrounds used are just a buildup of separate sprites layered onto each other (birds above clouds, fish above air bubbles).


    I can remove everything by commenting out the coding in SS_BGLoad and SS_BGAnimate so it just leaves a navy blue coloured empty void, but of course that's not all that appealing to look at. What I want to do is to change this into a whole new screen image, with no background scrolling or any other movements necessary. Any tips and advice on how to achieve this would be greatly appreciated, thanks.
     
  2. Sonic master

    Sonic master Well-Known Member Member

    Joined:
    Mar 27, 2010
    Messages:
    303
    Ok you removed the sprites ok right so all you need to do is follow my splash screen tutorial follow all the image conversion steps but instead of replacing the sonic team presents code just use this code right before the special stage




    lea (ss_bg_tile).l,a0


    lea ($FF0000).l,a1


    jsr aplib_decrunch


    ;WriteVram source, length, destination


    WriteVram $FF0000,34816,32


    writeCRAM ss_bg_pal,32,0 ;note this is set to load on the first pallet line if that is not what you want


    ;change the last value to (line you want) times 32


    lea ($FF0000).l,a1


    lea (ss_bg_map).l,a0 ; load mappings


    move.w #1,d0


    bsr.w EniDec


    ;copyTilemap $FF0000,$C000,$27,$1B ;SVN


    ;HIVEBRAIN


    ;move.l #$40000003,d0


    ;moveq #$27,d1


    ;moveq #$1B,d2


    ;bsr.w ShowVDPGraphics



    If you are using svn uncomment copyTilemap if you are using hivebrain uncomment everything under hivebrain


    Note this is set up to load data on the plane A but it needs to be on plane B (Plane a =forground plane b = background)


    I do not know the vram location for plane b


    but other than that it should work just follow everything except the sonic team part
     
    Last edited by a moderator: Feb 16, 2012
  3. SSGD

    SSGD "I can't believe what cool boots you have on!" Member

    Joined:
    Nov 14, 2011
    Messages:
    125
    Location:
    Room 101
    So after following the guide then trying to get it all fixed, this is what I get back.


    [​IMG]


    Well least it ain't blank anymore. (herpderp)


    From what I can tell, the background is now clashing with other map routines and only managing to load some parts of the new background, which should look like this:


    [​IMG]


    What the heck am I doing wrong?
     
  4. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    Your background art is loaded, and then the rest of the special stage art is loaded, but the rest of the art is positioned right where you put your background art, hence, it's overwriting it (as you can clearly see in the screenshot), another thing is either you haven't got the colours/palette lines to your background in at all, or they're in but your background mappings aren't set to use the correct line(s).


    You will need to move your background art to another space in V-Ram (a space that is free and won't be overwritten), and you will need to rewrite the map data so each tile map points to the new address where your art has moved to.


    (That is of course if you can still fit the art in at all, there's quite a lot of art tiles in that background, although it could fit on its own, I don't think it will fit with everything Sonic Team has in their special stage =$)
     
  5. Crash

    Crash Well-Known Member Member

    Joined:
    Jul 15, 2010
    Messages:
    302
    Location:
    Australia
    If you do need more VRam you should check out ReadySonic by Mercury. It's open source and one of the fixes included is to load the Special Stage walls dynamically, if you port that part to your hack it should free up a bunch of space for your background.
     
  6. SSGD

    SSGD "I can't believe what cool boots you have on!" Member

    Joined:
    Nov 14, 2011
    Messages:
    125
    Location:
    Room 101
    [​IMG]


    Yeah I'm not getting it. Thanks for the help guys but I think I'm gonna have to revert back to the original setup.
     
  7. Sonic master

    Sonic master Well-Known Member Member

    Joined:
    Mar 27, 2010
    Messages:
    303
    You need to load the background tiles after all the special stage tiles so change 32 to the amount of tiles you want it skip times 32 (the offset so it will start loading at tiles 2 if you set it to 2*32=64)




    WriteVram $FF0000,34816,32



    And change




    move.w #1,d0



    to the number of tiles you want to skip DON'T TIMES BY 32
     
    Last edited by a moderator: Feb 19, 2012
  8. SSGD

    SSGD "I can't believe what cool boots you have on!" Member

    Joined:
    Nov 14, 2011
    Messages:
    125
    Location:
    Room 101
    Changing the Vram 32 number by anything else only messes up the tiles even further or introduces tiles from other pattern load cues (I had GHZ tiles at one point from the Title Screen layout) while the move.w again pushes away tiles that I do what left or messes up the mappings altogether. I can't even get the palette file to load up correctly, it decides to use the Sonic palette instead.


    I've even tried moving the code around to see if things would improve, I either get a miscoloured background with a mutilated foreground or a screwed up miscoloured background with the foreground intact as it should be.
     
  9. Sonic master

    Sonic master Well-Known Member Member

    Joined:
    Mar 27, 2010
    Messages:
    303
    Bad news it appers that all the pallet lines are taken try somehow freeing up one.
     
  10. SSGD

    SSGD "I can't believe what cool boots you have on!" Member

    Joined:
    Nov 14, 2011
    Messages:
    125
    Location:
    Room 101
    The pallet is the least of the problems for this right now. I have an idea on how to edit them anyway but I'm gonna get back to that once I've finally fixed the background tiles. Now it's definitely the lack of free Vram space that's causing other tiles to load in within the mapping structure, but as mentioned previously I can't do anything from the Vram 32 point so I'm wondering if changing the Vram status of the other stuff that appears, would it stop clashing with the background altogether? Although I'm not sure what I need to be looking for code wise.....


    anyway, a picture of my most recent attempt:


    [​IMG]


    Changed background design for simplicity sake so I could see what other tiles exactly were getting in the way. The Glass tiles, bumper, goal, up/down and reverse tiles are what's keeping this from looking how it should be. So if anyone can tell me how to make that much needed additional Vram space I will be most grateful.
     
Thread Status:
Not open for further replies.