Basic Questions & Answers thread

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

  1. Random Gaming

    Random Gaming

    Just a user on Sonic Retro Member
    25
    1
    3
    Greece
    Sonic 1 Better Edition
    Hello, so I've had this issue where with some sprites that I ported from sonic 2 over to sonic 1 these numbers appear in the end. Does anybody know how to fix it, or at least the source of the problem? Here's the image link: [​IMG]
     
  2. JustMe

    JustMe

    a.k.a. DelayHacks Member
    24
    1
    3
    Planet Earth
    Some Sonic 1 on SegaCD hack
    Seems your sprites doesn't fit in VRAM, Random.
     
  3. Random Gaming

    Random Gaming

    Just a user on Sonic Retro Member
    25
    1
    3
    Greece
    Sonic 1 Better Edition
    Ok, thank you! I did some research just now after you located the problem and I'll try to expand it if possible.
     
    • Informative Informative x 1
    • List
  4. Novedicus

    Novedicus

    Tech Members Tech Member
    338
    2
    18
    Assville, Shittucky
    Dr. Yundong
    There's also the fact that the way Sonic 1 loads Sonic's graphics in VRAM is different than in Sonic 2. Sonic 1 loads the frame's tiles into a buffer in RAM that gets DMA'd to VRAM during V-BLANK. The buffer in RAM is limited in size and I don't think it can fit some of the frames in the Sonic 2 sprite set. Sonic 2 uses a DMA queue in the place of that buffer to DMA tiles from multiple sources in the ROM of any size. Part 3 of the spindash tutorial on the wiki here has an implementation of that for Sonic 1.

    However, there's still the aforementioned VRAM space issue. In Sonic 1, it stores the points tiles right after Sonic's tiles, so even if you load all of Sonic's tiles correctly, it'll end up overwriting the points tiles, so you'd probably want to find a new place in VRAM for them.
     
    • Agree Agree x 2
    • Informative Informative x 1
    • Useful Useful x 1
    • List
  5. Random Gaming

    Random Gaming

    Just a user on Sonic Retro Member
    25
    1
    3
    Greece
    Sonic 1 Better Edition
    Do you know of any empty spaces without messing with anything else? I did some research and I couldn’t find anything that doesn’t require freeing space. If there’s no option then I’ll try the methods I found. Thanks by the way!
     
  6. Novedicus

    Novedicus

    Tech Members Tech Member
    338
    2
    18
    Assville, Shittucky
    Dr. Yundong
    Unfortunately, no. VRAM is quite packed in Sonic 1.

    I do know that one way to free up some VRAM is to make shield and invincibility stars uncompressed and make it so that when a shield appears, it loads into its VRAM space, and when the stars appear, it loads its art into the same space. You can do this since the shield and stars never appear at the same time. Added bonus if you also make DPLCs for them so that only the art for the current frame of each is loaded, thus saving up even more VRAM.

    With that, though, you'd definitely want to have that DMA queue I mentioned implemented to make it easier.
     
    • Agree Agree x 1
    • Useful Useful x 1
    • List
  7. MarkeyJester

    MarkeyJester

    My predecessors have nothing on me. Tech Member
    You can move the checkpoint post art from VRAM F400 to VRAM D800, it fits perfectly and snuggly in that space in all levels. You can then move the points art from VRAM F2E0 to VRAM F520, it will then fit snuggly there.

    This will open up $520 bytes of VRAM for Sonic (41 decimal tiles).

    If you would like to go a step further, remove the points altogether, I've done that in plenty of projects and no-one notices.
     
    • Agree Agree x 1
    • Informative Informative x 1
    • Useful Useful x 1
    • List
  8. JustMe

    JustMe

    a.k.a. DelayHacks Member
    24
    1
    3
    Planet Earth
    Some Sonic 1 on SegaCD hack
    If you need to find some free VRAM yourself, you can use some Gens mod
     
  9. Random Gaming

    Random Gaming

    Just a user on Sonic Retro Member
    25
    1
    3
    Greece
    Sonic 1 Better Edition
    Okay! Thank you everyone for your responses! I believe I have already moved the art for the lamppost since I have ported the Spindash along with its smoke so I'll probably use a gens mod! Thanks again.