Basic Questions and Answers Thread

Discussion in 'Discussion & Q&A' started by Malevolence, Jul 7, 2009.

  1. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,020
    Calling S3K's object definitions 'incomplete' is an understatement: they've barely even been started. In fact, the only definition for a zone-specific object (MHZ's mushroom cap) was added by me. The rest are common objects, like Special Stage Rings.
     
    Last edited: Sep 11, 2016
  2. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    That's not true, I did object definitions for the pachinko bonus.

    To import a level converted with LevelConverter, either replace the files for an existing level with the ones LevelConverter generated, or make a new level and have it load the files LevelConverter generated.
     
  3. Sheeracali

    Sheeracali Newcomer Trialist

    Joined:
    Sep 4, 2016
    Messages:
    9
    Thanks. I kind of figured that would be it, but I just wanted to make sure some way to import didn't already exist in the program. I'll try this when I get home.
     
  4. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    Do anyone know of a GOOD image downscaler, that can resize images without losing much quality? Mostly to be used for line art, black and white.
     
  5. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    I would like to ask my question again, I was trying to make the ring art load in a different location when entering the special stages. now I tried to do what ralakimus told me

    But until now I had one problem that I can't seem to figure out on my own and I believe it should be easy, I do not know how to add the rings into the special stage DPLC, i'm sorry if this is a noob question, but when he told me to do that I though I needed to do what I did in the picture I posted in the last page. but that doesn't seem too work.
     
  6. LuigiXHero

    LuigiXHero Well-Known Member Member

    Joined:
    Mar 22, 2014
    Messages:
    280
    Rotsprite can do pretty decent resizing from what I heard.
     
    FireRat likes this.
  7. Thatgamerguy2234

    Thatgamerguy2234 Newcomer In Limbo

    Joined:
    Sep 1, 2016
    Messages:
    15
    I have a question. Is it possible to take coding from,say, Sonic 3 for the insta-shield,and put it in sonic 1? Once I get a laptop,I wanna start a hacking hobby
     
    FireRat likes this.
  8. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    Yes and no. Yes, because it can be done, and has been countless times, and no, because it requires you to properly port the object, which requires making extensive changes to the code, like swapping out object variables to the ones in Sonic 1, changing branchs which to point to code outside the object to point to the Sonic 1 equivalents (and porting routines sometimes, too), and a bunch of other difficult stuff. I recommend starting out with something easier, but you can do what you like.
     
  9. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    Apologies for the double post, but what I have to say here is in no way related to what I posted prior.

    How would one edit the Sonic 2 title screen? Sonic 1 conveniently loads level assets as it's background, but Sonic 2 uses enigma mappings, which very few editors seem to support, and has the title screens background art broken up between different files. Does anyone know a better way to edit these files (or a way to work around the S2 title screen setup entirely) such that I could just import/redraw over the title screen instead of editing it's scattered artwork?
     
    Last edited: Sep 12, 2016
  10. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    You could just scrap the title screen entirely and write your own. It's what I did for KEH (well, mostly, I kept a few small bits of code, but most of the display was rewritten).
     
    Pacca likes this.
  11. Sheeracali

    Sheeracali Newcomer Trialist

    Joined:
    Sep 4, 2016
    Messages:
    9
    I replace them in the corresponding folders in the disassembly? Also, how would I go about creating a new Level in the game?
     
  12. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    Locate all of the tables in the asm that entries for each level and/or act, and add new entries based on the existing entries.
     
    Sheeracali likes this.
  13. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    Try putting the files in the folders you think they fit best with. Make copies of the files you're replacing in case you replace a file you're not supposed to. You don't have to worry about messing something up because, if you do, you can easily fix it. Once you get a problem that you have spent the time to try and fix but you can't, post it here. Also, here are some useful notes about using the level converter:
    • The palette file contains Sonic's palette line but because Sonic's palette isn't included in the palette files used in the hack, you need to remove it. Open the Palette.bin file created in the Level Converter in a hex editor and delete the first two rows ($20 bytes) of numbers.
    • Collision.bin, CollisionR.bin, and Angles.bin aren't part of the level but part of the game. The first two contain the list of collision data that is assigned to blocks in order for Sonic to have the correct collision. The third assigns angles to the collision data so Sonic can run smoothly alongs slopes. Unfortunately, each game (Sonic 1, 2, and 3K) uses a different collision data and angles set and the Level Converter uses the collision data of the game where the level is being ported from, not the game the level is being ported to. In order for the level to use the correct collision, you can replace the collision data and angles files in your hack with the files found in the converted level folder. However, it would screw up the collision of every other level in your hack. Another option is to add code under wherever the collision data is loaded (Level_LoadCol in Sonic 1) which switches the files being used depending on the level. You need at least some knowledge of asm to pull this off.
    • Indexes1.bin and Indexes2.bin (Indexes.bin in regular Sonic 1) should not be confused with Collision.bin and CollisionR.bin because they both work with collision. The collision index files do change between levels and are used to assign collision data to blocks.
    • Tey using MarkeyJester's Project 128 disassembly if you're working with Sonic 1 because standard Sonic 1's larger chunks limit level editing in lots of ways, especially if you're using chunks from a level that isn't made to work with it. Unfortunately, Level Converter can't convert levels to Project 128 so you are going to have to convert the level you're converting to both Sonic 1 and Sonic 2 and you're going to have to take Layout.bin, Blocks.bin, Chunks.bin, Indexes1.bin and Indexes2.bin and decompress and recompress the files in order to use the compression Sonic 1 uses for them.
    Wow. This took an hour to write. If you don't understand something I wrote it's because I'm not very good at wording things.
     
    Sheeracali, Pacca and MainMemory like this.
  14. Sheeracali

    Sheeracali Newcomer Trialist

    Joined:
    Sep 4, 2016
    Messages:
    9
    It makes perfect sense. Thanks so much for your help
     
  15. GenesisDoes

    GenesisDoes What Nintendont Member

    Joined:
    Jan 2, 2016
    Messages:
    159
    Location:
    Pittsburgh, PA
    Two quick questions:

    • How can I create a palette cycle that changes 5 continuous palette entries? Have an attempt below, but it is only cycling 4 entries and is greyscale instead of the correct colors. (I am terrible at memory addressing)

      Code:
      PCycle_LZ:
              subq.w    #1,(v_pcyc_time).w ; decrement timer
              bpl.s    PCycLZ_Skip    ; if time remains, branch
      
              move.w    #5,(v_pcyc_time).w ; reset timer to 5 frames
              move.w    (v_pcyc_num).w,d0 ; get cycle number
              addq.w    #1,(v_pcyc_num).w ; increment cycle number
              andi.w    #3,d0        ; if cycle > 3, reset to 0
              lsl.w    #3,d0
              lea (Pal_LZCyc2).l,a0
              lea    (v_pal_dry+$4E).w,a1
              move.l    (a0,d0.w),(a1)+
              move.l    4(a0,d0.w),(a1)    ; copy palette data to RAM
      
    • For a MID2SMPS conversion, how can I lower the volume of a PSG channel in the MIDI file? In case it matters, I am using AnvilStudio for MIDI editing.
     
  16. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    Quick question about SRAM; is there a way to support save files larger then $3FF bytes? I have plans in the works, but it absolutely requires that I be able to support a comparatively massive SRAM file (32KB). Regen seems to truncate the save data on load to $3FF, destroying all data past that point.

    EDIT: nevermind, I seem to have things working. Turns out regen is retarded at dealing with SRAM
     
    Last edited: Sep 14, 2016
  17. ValleyBell

    ValleyBell Well-Known Member Member

    Joined:
    Dec 23, 2011
    Messages:
    166
    Lower either the Volume control changes (they have ID 7) or the velocity of all notes on that channel. Unlike usual MIDI, Expression controllers don't work. (And make sure to remove all Chorus effect controllers, if present, as they can screw up your volume settings.)
     
  18. NiphFM

    NiphFM Host of the Mega Drive Music Contest Member

    Joined:
    Jun 5, 2015
    Messages:
    430
    Location:
    Music Plant Zone
    I have added the "Different songs EVERYWHERE", SSRG Splash Screen, and my own Splash Screen on the basis of HCKTROX's code into a clean Sonic 1 ASM file, and I have gotten a single build error:
    Code:
    SONIC1.ASM(6601) : Error : Illegal value (142)
    So I had a look at the offending line, and it is:
    Code:
    move.l   LoopTileNums(pc,d0.w),($FFFFF7AC).w
    I am stumped on how to fix it, as I've never ran into this problem before.
    Can anyone help me on how to fix this problem?
     
  19. Kurk

    Kurk Oh Yeah Member

    Joined:
    Jul 30, 2016
    Messages:
    99
    Location:
    Kurkistan
    Perhaps you could use a different RAM adress? It may be used in a different piece of code.

    EDIT: after realizing that you are you using obsolete code for your splash screen, I recommend looking at hixatas' guide over on retro.
     
    Last edited: Sep 14, 2016
  20. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,020
    Illegal number. I think that means LoopTileNums is too far away from that instruction.